var GP=function(t){"use strict";let e=t=>{let e;let o=new Set,r=(t,r)=>{let n="function"==typeof t?t(e):t;if(!Object.is(n,e)){let t=e;e=(null!=r?r:"object"!=typeof n)?n:Object.assign({},e,n),o.forEach(o=>o(e,t))}},n=()=>e,i={setState:r,getState:n,subscribe:t=>(o.add(t),()=>o.delete(t)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),o.clear()}};return e=t(r,n,i),i},o=t=>t?e(t):e,r=({query:t,container:e})=>{let o=null;try{o=(e||document).querySelector(t||"")}catch(t){console.info("querySelector error",t)}return o},n=t=>t.substring(1),i=t=>{t&&t.scrollIntoView({behavior:"smooth"})},s=document.querySelectorAll('a[href^="#"]');function a(t,e){var o=function(t,e,o){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return e.get(t)}(t,e,0);return o.get?o.get.call(t):o.value}function c(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}s.forEach(t=>{let e=t.getAttribute("href");if(!e||"#"===e)return;let o=n(e),s=r({query:`[data-gp-dialog-id='${o}']`}),a=r({query:`[id='${o}']`});t.addEventListener("click",t=>{t.preventDefault();try{if(s&&"DIALOG"===s.tagName){var o;null===(o=s.parentNode)||void 0===o||o.openModal()}a&&(i(a),setTimeout(()=>{window.location.hash=e},300))}catch(t){console.info("Handle link clicked error",t)}})}),(()=>{let t=window.location.hash;if(t){window.history.scrollRestoration="manual";let e=()=>{let o=r({query:`[id='${n(t)}']`});setTimeout(()=>i(o),100),document.removeEventListener("DOMContentLoaded",e)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}})(),window.Shopify=window.Shopify||{},window.Shopify.formatMoney||(window.Shopify.formatMoney=function(t,e){let o="",r=/\{\{\s*(\w+)\s*\}\}/,n=e||this.money_format;function i(t,e){return void 0===t?e:t}function s(t,e,o,r){var n;if(e=i(e,2),o=i(o,","),r=i(r,"."),isNaN(t)||null==t)return 0;t=(t/100).toFixed(Number(e)+1).slice(0,-1);let s=t.split("."),a=null===(n=s[0])||void 0===n?void 0:n.replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+o),c=s[1]?r+s[1]:"";return a+c}switch("string"==typeof t&&(t=t.replace(".","")),n.match(r)[1]){case"amount":o=s(t,2);break;case"amount_no_decimals":o=s(t,0);break;case"amount_with_comma_separator":o=s(t,2,".",",");break;case"amount_no_decimals_with_comma_separator":o=s(t,0,".",",")}return n.replace(r,o)});var l=new WeakMap;class u extends HTMLElement{constructor(){super(),c(this,"context",void 0),c(this,"store",void 0),function(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,l),l.set(this,{writable:!0,value:t=>{if(!t)return{};try{var e;let o=null!==(e=JSON.parse(t))&&void 0!==e?e:{};return o}catch(t){return{}}}}),c(this,"getState",t=>{let e=this.store.getState();return t?e[t]:e}),c(this,"setState",(t,e)=>{this.store.setState({[t]:e})}),c(this,"subscribeState",t=>this.store.subscribe(t)),c(this,"subscribe",this.subscribeState),c(this,"getStoreContext",()=>this.context),c(this,"getContext",t=>{let e=this.context.getState();return t?e[t]:e}),c(this,"setContext",(t,e)=>{this.context.setState({[t]:e})}),c(this,"subscribeContext",t=>this.context.subscribe(t));let t=this.getAttribute("gp-data"),e=this.getAttribute("gp-context");if(this.store=o(()=>a(this,l).call(this,t)),e)this.context=o(()=>a(this,l).call(this,e));else{let t=this.closest("[gp-context]");t&&t.getStoreContext?this.context=t.getStoreContext():this.context=o(()=>({}))}}}return t.Component=u,t}({});
