@bikematrix/web-components 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bm_core.js CHANGED
@@ -1,4 +1,4 @@
1
- var BikeMatrix=function(){"use strict";var Rr,G,an,on,Vt,nn,sn,fa,ln,Ir={},cn=[],jc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,vi=Array.isArray;function dt(i,e){for(var t in e)i[t]=e[t];return i}function un(i){var e=i.parentNode;e&&e.removeChild(i)}function j(i,e,t){var r,a,o,n={};for(o in e)o=="key"?r=e[o]:o=="ref"?a=e[o]:n[o]=e[o];if(arguments.length>2&&(n.children=arguments.length>3?Rr.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(o in i.defaultProps)n[o]===void 0&&(n[o]=i.defaultProps[o]);return Or(i,n,r,a,null)}function Or(i,e,t,r,a){var o={type:i,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:a??++an,__i:-1,__u:0};return a==null&&G.vnode!=null&&G.vnode(o),o}function qc(){return{current:null}}function q(i){return i.children}function Ye(i,e){this.props=i,this.context=e}function or(i,e){if(e==null)return i.__?or(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?or(i):null}function dn(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return dn(i)}}function ha(i){(!i.__d&&(i.__d=!0)&&Vt.push(i)&&!yi.__r++||nn!==G.debounceRendering)&&((nn=G.debounceRendering)||sn)(yi)}function yi(){var i,e,t,r,a,o,n,s,l;for(Vt.sort(fa);i=Vt.shift();)i.__d&&(e=Vt.length,r=void 0,o=(a=(t=i).__v).__e,s=[],l=[],(n=t.__P)&&((r=dt({},a)).__v=a.__v+1,G.vnode&&G.vnode(r),ga(n,r,a,t.__n,n.ownerSVGElement!==void 0,32&a.__u?[o]:null,s,o??or(a),!!(32&a.__u),l),r.__v=a.__v,r.__.__k[r.__i]=r,bn(s,r,l),r.__e!=o&&dn(r)),Vt.length>e&&Vt.sort(fa));yi.__r=0}function pn(i,e,t,r,a,o,n,s,l,c,u){var d,f,h,b,m,y=r&&r.__k||cn,v=e.length;for(t.__d=l,Vc(t,e,y),l=t.__d,d=0;d<v;d++)(h=t.__k[d])!=null&&typeof h!="boolean"&&typeof h!="function"&&(f=h.__i===-1?Ir:y[h.__i]||Ir,h.__i=d,ga(i,h,f,a,o,n,s,l,c,u),b=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&ma(f.ref,null,h),u.push(h.ref,h.__c||b,h)),m==null&&b!=null&&(m=b),65536&h.__u||f.__k===h.__k?l=fn(h,l,i):typeof h.type=="function"&&h.__d!==void 0?l=h.__d:b&&(l=b.nextSibling),h.__d=void 0,h.__u&=-196609);t.__d=l,t.__e=m}function Vc(i,e,t){var r,a,o,n,s,l=e.length,c=t.length,u=c,d=0;for(i.__k=[],r=0;r<l;r++)n=r+d,(a=i.__k[r]=(a=e[r])==null||typeof a=="boolean"||typeof a=="function"?null:typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Or(null,a,null,null,null):vi(a)?Or(q,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?Or(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a)!=null?(a.__=i,a.__b=i.__b+1,s=Uc(a,t,n,u),a.__i=s,o=null,s!==-1&&(u--,(o=t[s])&&(o.__u|=131072)),o==null||o.__v===null?(s==-1&&d--,typeof a.type!="function"&&(a.__u|=65536)):s!==n&&(s===n+1?d++:s>n?u>l-n?d+=s-n:d--:s<n?s==n-1&&(d=s-n):d=0,s!==r+d&&(a.__u|=65536))):(o=t[n])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==i.__d&&(i.__d=or(o)),ba(o,o,!1),t[n]=null,u--);if(u)for(r=0;r<c;r++)(o=t[r])!=null&&!(131072&o.__u)&&(o.__e==i.__d&&(i.__d=or(o)),ba(o,o))}function fn(i,e,t){var r,a;if(typeof i.type=="function"){for(r=i.__k,a=0;r&&a<r.length;a++)r[a]&&(r[a].__=i,e=fn(r[a],e,t));return e}i.__e!=e&&(t.insertBefore(i.__e,e||null),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function pt(i,e){return e=e||[],i==null||typeof i=="boolean"||(vi(i)?i.some(function(t){pt(t,e)}):e.push(i)),e}function Uc(i,e,t,r){var a=i.key,o=i.type,n=t-1,s=t+1,l=e[t];if(l===null||l&&a==l.key&&o===l.type&&!(131072&l.__u))return t;if(r>(l!=null&&!(131072&l.__u)?1:0))for(;n>=0||s<e.length;){if(n>=0){if((l=e[n])&&!(131072&l.__u)&&a==l.key&&o===l.type)return n;n--}if(s<e.length){if((l=e[s])&&!(131072&l.__u)&&a==l.key&&o===l.type)return s;s++}}return-1}function hn(i,e,t){e[0]==="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||jc.test(e)?t:t+"px"}function ki(i,e,t,r,a){var o;e:if(e==="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(e in r)t&&e in t||hn(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||hn(i.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in i?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+o]=t,t?r?t.u=r.u:(t.u=Date.now(),i.addEventListener(e,o?mn:gn,o)):i.removeEventListener(e,o?mn:gn,o);else{if(a)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?i.removeAttribute(e):i.setAttribute(e,t))}}function gn(i){if(this.l){var e=this.l[i.type+!1];if(i.t){if(i.t<=e.u)return}else i.t=Date.now();return e(G.event?G.event(i):i)}}function mn(i){if(this.l)return this.l[i.type+!0](G.event?G.event(i):i)}function ga(i,e,t,r,a,o,n,s,l,c){var u,d,f,h,b,m,y,v,g,_,k,w,C,A,D,x=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),o=[s=e.__e=t.__e]),(u=G.__b)&&u(e);e:if(typeof x=="function")try{if(v=e.props,g=(u=x.contextType)&&r[u.__c],_=u?g?g.props.value:u.__:r,t.__c?y=(d=e.__c=t.__c).__=d.__E:("prototype"in x&&x.prototype.render?e.__c=d=new x(v,_):(e.__c=d=new Ye(v,_),d.constructor=x,d.render=Hc),g&&g.sub(d),d.props=v,d.state||(d.state={}),d.context=_,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),d.__s==null&&(d.__s=d.state),x.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=dt({},d.__s)),dt(d.__s,x.getDerivedStateFromProps(v,d.__s))),h=d.props,b=d.state,d.__v=e,f)x.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(x.getDerivedStateFromProps==null&&v!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,_),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,_)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(d.props=v,d.state=d.__s,d.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(S){S&&(S.__=e)}),k=0;k<d._sb.length;k++)d.__h.push(d._sb[k]);d._sb=[],d.__h.length&&n.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,_),d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,b,m)})}if(d.context=_,d.props=v,d.__P=i,d.__e=!1,w=G.__r,C=0,"prototype"in x&&x.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(e),u=d.render(d.props,d.state,d.context),A=0;A<d._sb.length;A++)d.__h.push(d._sb[A]);d._sb=[]}else do d.__d=!1,w&&w(e),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++C<25);d.state=d.__s,d.getChildContext!=null&&(r=dt(dt({},r),d.getChildContext())),f||d.getSnapshotBeforeUpdate==null||(m=d.getSnapshotBeforeUpdate(h,b)),pn(i,vi(D=u!=null&&u.type===q&&u.key==null?u.props.children:u)?D:[D],e,t,r,a,o,n,s,l,c),d.base=e.__e,e.__u&=-161,d.__h.length&&n.push(d),y&&(d.__E=d.__=null)}catch(S){e.__v=null,l||o!=null?(e.__e=s,e.__u|=l?160:32,o[o.indexOf(s)]=null):(e.__e=t.__e,e.__k=t.__k),G.__e(S,e,t)}else o==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=$c(t.__e,e,t,r,a,o,n,l,c);(u=G.diffed)&&u(e)}function bn(i,e,t){e.__d=void 0;for(var r=0;r<t.length;r++)ma(t[r],t[++r],t[++r]);G.__c&&G.__c(e,i),i.some(function(a){try{i=a.__h,a.__h=[],i.some(function(o){o.call(a)})}catch(o){G.__e(o,a.__v)}})}function $c(i,e,t,r,a,o,n,s,l){var c,u,d,f,h,b,m,y=t.props,v=e.props,g=e.type;if(g==="svg"&&(a=!0),o!=null){for(c=0;c<o.length;c++)if((h=o[c])&&"setAttribute"in h==!!g&&(g?h.localName===g:h.nodeType===3)){i=h,o[c]=null;break}}if(i==null){if(g===null)return document.createTextNode(v);i=a?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,v.is&&v),o=null,s=!1}if(g===null)y===v||s&&i.data===v||(i.data=v);else{if(o=o&&Rr.call(i.childNodes),y=t.props||Ir,!s&&o!=null)for(y={},c=0;c<i.attributes.length;c++)y[(h=i.attributes[c]).name]=h.value;for(c in y)h=y[c],c=="children"||(c=="dangerouslySetInnerHTML"?d=h:c==="key"||c in v||ki(i,c,null,h,a));for(c in v)h=v[c],c=="children"?f=h:c=="dangerouslySetInnerHTML"?u=h:c=="value"?b=h:c=="checked"?m=h:c==="key"||s&&typeof h!="function"||y[c]===h||ki(i,c,h,y[c],a);if(u)s||d&&(u.__html===d.__html||u.__html===i.innerHTML)||(i.innerHTML=u.__html),e.__k=[];else if(d&&(i.innerHTML=""),pn(i,vi(f)?f:[f],e,t,r,a&&g!=="foreignObject",o,n,o?o[0]:t.__k&&or(t,0),s,l),o!=null)for(c=o.length;c--;)o[c]!=null&&un(o[c]);s||(c="value",b!==void 0&&(b!==i[c]||g==="progress"&&!b||g==="option"&&b!==y[c])&&ki(i,c,b,y[c],!1),c="checked",m!==void 0&&m!==i[c]&&ki(i,c,m,y[c],!1))}return i}function ma(i,e,t){try{typeof i=="function"?i(e):i.current=e}catch(r){G.__e(r,t)}}function ba(i,e,t){var r,a;if(G.unmount&&G.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||ma(r,null,e)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){G.__e(o,e)}r.base=r.__P=null,i.__c=void 0}if(r=i.__k)for(a=0;a<r.length;a++)r[a]&&ba(r[a],e,t||typeof i.type!="function");t||i.__e==null||un(i.__e),i.__=i.__e=i.__d=void 0}function Hc(i,e,t){return this.constructor(i,t)}function Dt(i,e,t){var r,a,o,n;G.__&&G.__(i,e),a=(r=typeof t=="function")?null:t&&t.__k||e.__k,o=[],n=[],ga(e,i=(!r&&t||e).__k=j(q,null,[i]),a||Ir,Ir,e.ownerSVGElement!==void 0,!r&&t?[t]:a?null:e.firstChild?Rr.call(e.childNodes):null,o,!r&&t?t:a?a.__e:e.firstChild,r,n),bn(o,i,n)}function _a(i,e){Dt(i,e,_a)}function va(i,e,t){var r,a,o,n,s=dt({},i.props);for(o in i.type&&i.type.defaultProps&&(n=i.type.defaultProps),e)o=="key"?r=e[o]:o=="ref"?a=e[o]:s[o]=e[o]===void 0&&n!==void 0?n[o]:e[o];return arguments.length>2&&(s.children=arguments.length>3?Rr.call(arguments,2):t),Or(i.type,s,r||i.key,a||i.ref,null)}function jr(i,e){var t={__c:e="__cC"+ln++,__:i,Consumer:function(r,a){return r.children(a)},Provider:function(r){var a,o;return this.getChildContext||(a=[],(o={})[e]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&a.some(function(s){s.__e=!0,ha(s)})},this.sub=function(n){a.push(n);var s=n.componentWillUnmount;n.componentWillUnmount=function(){a.splice(a.indexOf(n),1),s&&s.call(n)}}),r.children}};return t.Provider.__=t.Consumer.contextType=t}Rr=cn.slice,G={__e:function(i,e,t,r){for(var a,o,n;e=e.__;)if((a=e.__c)&&!a.__)try{if((o=a.constructor)&&o.getDerivedStateFromError!=null&&(a.setState(o.getDerivedStateFromError(i)),n=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(i,r||{}),n=a.__d),n)return a.__E=a}catch(s){i=s}throw i}},an=0,on=function(i){return i!=null&&i.constructor==null},Ye.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=dt({},this.state),typeof i=="function"&&(i=i(dt({},t),this.props)),i&&dt(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),ha(this))},Ye.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),ha(this))},Ye.prototype.render=q,Vt=[],sn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fa=function(i,e){return i.__v.__b-e.__v.__b},yi.__r=0,ln=0;function ya(){return(ya=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i}).apply(this,arguments)}var Gc=["context","children"];function Kc(i){this.getChildContext=function(){return i.context};var e=i.children,t=function(r,a){if(r==null)return{};var o,n,s={},l=Object.keys(r);for(n=0;n<l.length;n++)a.indexOf(o=l[n])>=0||(s[o]=r[o]);return s}(i,Gc);return va(e,t)}function Wc(){var i=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(i),this._vdom=j(Kc,ya({},this._props,{context:i.detail.context}),function e(t,r){if(t.nodeType===3)return t.data;if(t.nodeType!==1)return null;var a=[],o={},n=0,s=t.attributes,l=t.childNodes;for(n=s.length;n--;)s[n].name!=="slot"&&(o[s[n].name]=s[n].value,o[_n(s[n].name)]=s[n].value);for(n=l.length;n--;){var c=e(l[n],null),u=l[n].slot;u?o[u]=j(vn,{name:u},c):a[n]=c}var d=r?j(vn,null,a):a;return j(r||t.nodeName.toLowerCase(),o,d)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?_a:Dt)(this._vdom,this._root)}function _n(i){return i.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():""})}function Yc(i,e,t){if(this._vdom){var r={};r[i]=t=t??void 0,r[_n(i)]=t,this._vdom=va(this._vdom,r),Dt(this._vdom,this._root)}}function Zc(){Dt(this._vdom=null,this._root)}function vn(i,e){var t=this;return j("slot",ya({},i,{ref:function(r){r?(t.ref=r,t._listener||(t._listener=function(a){a.stopPropagation(),a.detail.context=e},r.addEventListener("_preact",t._listener))):t.ref.removeEventListener("_preact",t._listener)}}))}function Jc(i,e,t,r){function a(){var o=Reflect.construct(HTMLElement,[],a);return o._vdomComponent=i,o._root=r&&r.shadow?o.attachShadow({mode:r.mode||"open"}):o,o}return(a.prototype=Object.create(HTMLElement.prototype)).constructor=a,a.prototype.connectedCallback=Wc,a.prototype.attributeChangedCallback=Yc,a.prototype.disconnectedCallback=Zc,t=t||i.observedAttributes||Object.keys(i.propTypes||{}),a.observedAttributes=t,t.forEach(function(o){Object.defineProperty(a.prototype,o,{get:function(){return this._vdom.props[o]},set:function(n){this._vdom?this.attributeChangedCallback(o,null,n):(this._props||(this._props={}),this._props[o]=n,this.connectedCallback());var s=typeof n;n!=null&&s!=="string"&&s!=="boolean"&&s!=="number"||this.setAttribute(o,n)}})}),customElements.define(e||i.tagName||i.displayName||i.name,a)}var St,ae,ka,yn,nr=0,kn=[],wi=[],se=G,wn=se.__b,xn=se.__r,Cn=se.diffed,An=se.__c,Dn=se.unmount,Sn=se.__;function sr(i,e){se.__h&&se.__h(ae,i,nr||e),nr=0;var t=ae.__H||(ae.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({__V:wi}),t.__[i]}function F(i){return nr=1,En(Tn,i)}function En(i,e,t){var r=sr(St++,2);if(r.t=i,!r.__c&&(r.__=[t?t(e):Tn(void 0,e),function(s){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,s);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=ae,!ae.u)){var a=function(s,l,c){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(f){return!!f.__c});if(u.every(function(f){return!f.__N}))return!o||o.call(this,s,l,c);var d=!1;return u.forEach(function(f){if(f.__N){var h=f.__[0];f.__=f.__N,f.__N=void 0,h!==f.__[0]&&(d=!0)}}),!(!d&&r.__c.props===s)&&(!o||o.call(this,s,l,c))};ae.u=!0;var o=ae.shouldComponentUpdate,n=ae.componentWillUpdate;ae.componentWillUpdate=function(s,l,c){if(this.__e){var u=o;o=void 0,a(s,l,c),o=u}n&&n.call(this,s,l,c)},ae.shouldComponentUpdate=a}return r.__N||r.__}function V(i,e){var t=sr(St++,3);!se.__s&&Ca(t.__H,e)&&(t.__=i,t.i=e,ae.__H.__h.push(t))}function lr(i,e){var t=sr(St++,4);!se.__s&&Ca(t.__H,e)&&(t.__=i,t.i=e,ae.__h.push(t))}function K(i){return nr=5,tt(function(){return{current:i}},[])}function Xc(i,e,t){nr=6,lr(function(){return typeof i=="function"?(i(e()),function(){return i(null)}):i?(i.current=e(),function(){return i.current=null}):void 0},t==null?t:t.concat(i))}function tt(i,e){var t=sr(St++,7);return Ca(t.__H,e)?(t.__V=i(),t.i=e,t.__h=i,t.__V):t.__}function Bn(i,e){return nr=8,tt(function(){return i},e)}function wa(i){var e=ae.context[i.__c],t=sr(St++,9);return t.c=i,e?(t.__==null&&(t.__=!0,e.sub(ae)),e.props.value):i.__}function Qc(i,e){se.useDebugValue&&se.useDebugValue(e?e(i):i)}function eu(){var i=sr(St++,11);if(!i.__){for(var e=ae.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var t=e.__m||(e.__m=[0,0]);i.__="P"+t[0]+"-"+t[1]++}return i.__}function tu(){for(var i;i=kn.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(xi),i.__H.__h.forEach(xa),i.__H.__h=[]}catch(e){i.__H.__h=[],se.__e(e,i.__v)}}se.__b=function(i){ae=null,wn&&wn(i)},se.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Sn&&Sn(i,e)},se.__r=function(i){xn&&xn(i),St=0;var e=(ae=i.__c).__H;e&&(ka===ae?(e.__h=[],ae.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=wi,t.__N=t.i=void 0})):(e.__h.forEach(xi),e.__h.forEach(xa),e.__h=[],St=0)),ka=ae},se.diffed=function(i){Cn&&Cn(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(kn.push(e)!==1&&yn===se.requestAnimationFrame||((yn=se.requestAnimationFrame)||ru)(tu)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==wi&&(t.__=t.__V),t.i=void 0,t.__V=wi})),ka=ae=null},se.__c=function(i,e){e.some(function(t){try{t.__h.forEach(xi),t.__h=t.__h.filter(function(r){return!r.__||xa(r)})}catch(r){e.some(function(a){a.__h&&(a.__h=[])}),e=[],se.__e(r,t.__v)}}),An&&An(i,e)},se.unmount=function(i){Dn&&Dn(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{xi(r)}catch(a){e=a}}),t.__H=void 0,e&&se.__e(e,t.__v))};var zn=typeof requestAnimationFrame=="function";function ru(i){var e,t=function(){clearTimeout(r),zn&&cancelAnimationFrame(e),setTimeout(i)},r=setTimeout(t,100);zn&&(e=requestAnimationFrame(t))}function xi(i){var e=ae,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),ae=e}function xa(i){var e=ae;i.__c=i.__(),ae=e}function Ca(i,e){return!i||i.length!==e.length||e.some(function(t,r){return t!==i[r]})}function Tn(i,e){return typeof e=="function"?e(i):e}function Ln(i,e){for(var t in e)i[t]=e[t];return i}function Aa(i,e){for(var t in i)if(t!=="__source"&&!(t in e))return!0;for(var r in e)if(r!=="__source"&&i[r]!==e[r])return!0;return!1}function Da(i,e){this.props=i,this.context=e}function iu(i,e){function t(a){var o=this.props.ref,n=o==a.ref;return!n&&o&&(o.call?o(null):o.current=null),e?!e(this.props,a)||!n:Aa(this.props,a)}function r(a){return this.shouldComponentUpdate=t,j(i,a)}return r.displayName="Memo("+(i.displayName||i.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Da.prototype=new Ye).isPureReactComponent=!0,Da.prototype.shouldComponentUpdate=function(i,e){return Aa(this.props,i)||Aa(this.state,e)};var Pn=G.__b;G.__b=function(i){i.type&&i.type.__f&&i.ref&&(i.props.ref=i.ref,i.ref=null),Pn&&Pn(i)};var au=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Sa(i){function e(t){var r=Ln({},t);return delete r.ref,i(r,t.ref||null)}return e.$$typeof=au,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(i.displayName||i.name)+")",e}var Fn=function(i,e){return i==null?null:pt(pt(i).map(e))},ou={map:Fn,forEach:Fn,count:function(i){return i?pt(i).length:0},only:function(i){var e=pt(i);if(e.length!==1)throw"Children.only";return e[0]},toArray:pt},nu=G.__e;G.__e=function(i,e,t,r){if(i.then){for(var a,o=e;o=o.__;)if((a=o.__c)&&a.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),a.__c(i,e)}nu(i,e,t,r)};var Mn=G.unmount;function Nn(i,e,t){return i&&(i.__c&&i.__c.__H&&(i.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),i.__c.__H=null),(i=Ln({},i)).__c!=null&&(i.__c.__P===t&&(i.__c.__P=e),i.__c=null),i.__k=i.__k&&i.__k.map(function(r){return Nn(r,e,t)})),i}function Rn(i,e,t){return i&&t&&(i.__v=null,i.__k=i.__k&&i.__k.map(function(r){return Rn(r,e,t)}),i.__c&&i.__c.__P===e&&(i.__e&&t.appendChild(i.__e),i.__c.__e=!0,i.__c.__P=t)),i}function Ci(){this.__u=0,this.t=null,this.__b=null}function In(i){var e=i.__.__c;return e&&e.__a&&e.__a(i)}function su(i){var e,t,r;function a(o){if(e||(e=i()).then(function(n){t=n.default||n},function(n){r=n}),r)throw r;if(!t)throw e;return j(t,o)}return a.displayName="Lazy",a.__f=!0,a}function qr(){this.u=null,this.o=null}G.unmount=function(i){var e=i.__c;e&&e.__R&&e.__R(),e&&32&i.__u&&(i.type=null),Mn&&Mn(i)},(Ci.prototype=new Ye).__c=function(i,e){var t=e.__c,r=this;r.t==null&&(r.t=[]),r.t.push(t);var a=In(r.__v),o=!1,n=function(){o||(o=!0,t.__R=null,a?a(s):s())};t.__R=n;var s=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=Rn(l,l.__c.__P,l.__c.__O)}var c;for(r.setState({__a:r.__b=null});c=r.t.pop();)c.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),i.then(n,n)},Ci.prototype.componentWillUnmount=function(){this.t=[]},Ci.prototype.render=function(i,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Nn(this.__b,t,r.__O=r.__P)}this.__b=null}var a=e.__a&&j(q,null,i.fallback);return a&&(a.__u&=-33),[j(q,null,e.__a?null:i.children),a]};var On=function(i,e,t){if(++t[1]===t[0]&&i.o.delete(e),i.props.revealOrder&&(i.props.revealOrder[0]!=="t"||!i.o.size))for(t=i.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;i.u=t=t[2]}};function lu(i){return this.getChildContext=function(){return i.context},i.children}function cu(i){var e=this,t=i.i;e.componentWillUnmount=function(){Dt(null,e.l),e.l=null,e.i=null},e.i&&e.i!==t&&e.componentWillUnmount(),e.l||(e.i=t,e.l={nodeType:1,parentNode:t,childNodes:[],appendChild:function(r){this.childNodes.push(r),e.i.appendChild(r)},insertBefore:function(r,a){this.childNodes.push(r),e.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.i.removeChild(r)}}),Dt(j(lu,{context:e.context},i.__v),e.l)}function uu(i,e){var t=j(cu,{__v:i,i:e});return t.containerInfo=e,t}(qr.prototype=new Ye).__a=function(i){var e=this,t=In(e.__v),r=e.o.get(i);return r[0]++,function(a){var o=function(){e.props.revealOrder?(r.push(a),On(e,i,r)):a()};t?t(o):o()}},qr.prototype.render=function(i){this.u=null,this.o=new Map;var e=pt(i.children);i.revealOrder&&i.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.o.set(e[t],this.u=[1,0,this.u]);return i.children},qr.prototype.componentDidUpdate=qr.prototype.componentDidMount=function(){var i=this;this.o.forEach(function(e,t){On(i,t,e)})};var jn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,du=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,pu=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,fu=/[A-Z0-9]/g,hu=typeof document<"u",gu=function(i){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(i)};function mu(i,e,t){return e.__k==null&&(e.textContent=""),Dt(i,e),typeof t=="function"&&t(),i?i.__c:null}function bu(i,e,t){return _a(i,e),typeof t=="function"&&t(),i?i.__c:null}Ye.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(i){Object.defineProperty(Ye.prototype,i,{configurable:!0,get:function(){return this["UNSAFE_"+i]},set:function(e){Object.defineProperty(this,i,{configurable:!0,writable:!0,value:e})}})});var qn=G.event;function _u(){}function vu(){return this.cancelBubble}function yu(){return this.defaultPrevented}G.event=function(i){return qn&&(i=qn(i)),i.persist=_u,i.isPropagationStopped=vu,i.isDefaultPrevented=yu,i.nativeEvent=i};var Ea,ku={enumerable:!1,configurable:!0,get:function(){return this.class}},Vn=G.vnode;G.vnode=function(i){typeof i.type=="string"&&function(e){var t=e.props,r=e.type,a={};for(var o in t){var n=t[o];if(!(o==="value"&&"defaultValue"in t&&n==null||hu&&o==="children"&&r==="noscript"||o==="class"||o==="className")){var s=o.toLowerCase();o==="defaultValue"&&"value"in t&&t.value==null?o="value":o==="download"&&n===!0?n="":s==="translate"&&n==="no"?n=!1:s==="ondoubleclick"?o="ondblclick":s!=="onchange"||r!=="input"&&r!=="textarea"||gu(t.type)?s==="onfocus"?o="onfocusin":s==="onblur"?o="onfocusout":pu.test(o)?o=s:r.indexOf("-")===-1&&du.test(o)?o=o.replace(fu,"-$&").toLowerCase():n===null&&(n=void 0):s=o="oninput",s==="oninput"&&a[o=s]&&(o="oninputCapture"),a[o]=n}}r=="select"&&a.multiple&&Array.isArray(a.value)&&(a.value=pt(t.children).forEach(function(l){l.props.selected=a.value.indexOf(l.props.value)!=-1})),r=="select"&&a.defaultValue!=null&&(a.value=pt(t.children).forEach(function(l){l.props.selected=a.multiple?a.defaultValue.indexOf(l.props.value)!=-1:a.defaultValue==l.props.value})),t.class&&!t.className?(a.class=t.class,Object.defineProperty(a,"className",ku)):(t.className&&!t.class||t.class&&t.className)&&(a.class=a.className=t.className),e.props=a}(i),i.$$typeof=jn,Vn&&Vn(i)};var Un=G.__r;G.__r=function(i){Un&&Un(i),Ea=i.__c};var $n=G.diffed;G.diffed=function(i){$n&&$n(i);var e=i.props,t=i.__e;t!=null&&i.type==="textarea"&&"value"in e&&e.value!==t.value&&(t.value=e.value==null?"":e.value),Ea=null};var wu={ReactCurrentDispatcher:{current:{readContext:function(i){return Ea.__n[i.__c].props.value}}}};function xu(i){return j.bind(null,i)}function Ai(i){return!!i&&i.$$typeof===jn}function Cu(i){return Ai(i)&&i.type===q}function Au(i){return Ai(i)?va.apply(null,arguments):i}function Du(i){return!!i.__k&&(Dt(null,i),!0)}function Su(i){return i&&(i.base||i.nodeType===1&&i)||null}var Eu=function(i,e){return i(e)},Bu=function(i,e){return i(e)},zu=q;function Hn(i){i()}function Tu(i){return i}function Lu(){return[!1,Hn]}var Pu=lr,Fu=Ai;function Mu(i,e){var t=e(),r=F({h:{__:t,v:e}}),a=r[0].h,o=r[1];return lr(function(){a.__=t,a.v=e,Ba(a)&&o({h:a})},[i,t,e]),V(function(){return Ba(a)&&o({h:a}),i(function(){Ba(a)&&o({h:a})})},[i]),t}function Ba(i){var e,t,r=i.v,a=i.__;try{var o=r();return!((e=a)===(t=o)&&(e!==0||1/e==1/t)||e!=e&&t!=t)}catch{return!0}}var me={useState:F,useId:eu,useReducer:En,useEffect:V,useLayoutEffect:lr,useInsertionEffect:Pu,useTransition:Lu,useDeferredValue:Tu,useSyncExternalStore:Mu,startTransition:Hn,useRef:K,useImperativeHandle:Xc,useMemo:tt,useCallback:Bn,useContext:wa,useDebugValue:Qc,version:"17.0.2",Children:ou,render:mu,hydrate:bu,unmountComponentAtNode:Du,createPortal:uu,createElement:j,createContext:jr,createFactory:xu,cloneElement:Au,createRef:qc,Fragment:q,isValidElement:Ai,isElement:Fu,isFragment:Cu,findDOMNode:Su,Component:Ye,PureComponent:Da,memo:iu,forwardRef:Sa,flushSync:Bu,unstable_batchedUpdates:Eu,StrictMode:zu,Suspense:Ci,SuspenseList:qr,lazy:su,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:wu},za=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nu(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}const Ru=(...i)=>{console!=null&&console.warn&&(Ut(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),console.warn(...i))},Gn={},Ta=(...i)=>{Ut(i[0])&&Gn[i[0]]||(Ut(i[0])&&(Gn[i[0]]=new Date),Ru(...i))},Kn=(i,e)=>()=>{if(i.isInitialized)e();else{const t=()=>{setTimeout(()=>{i.off("initialized",t)},0),e()};i.on("initialized",t)}},Wn=(i,e,t)=>{i.loadNamespaces(e,Kn(i,t))},Yn=(i,e,t,r)=>{Ut(t)&&(t=[t]),t.forEach(a=>{i.options.ns.indexOf(a)<0&&i.options.ns.push(a)}),i.loadLanguages(e,Kn(i,r))},Iu=(i,e,t={})=>!e.languages||!e.languages.length?(Ta("i18n.languages were undefined or empty",e.languages),!0):e.hasLoadedNamespace(i,{lng:t.lng,precheck:(r,a)=>{var o;if(((o=t.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,i))return!1}}),Ut=i=>typeof i=="string",Ou=i=>typeof i=="object"&&i!==null,ju=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qu={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Vu=i=>qu[i];let La={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:i=>i.replace(ju,Vu)};const Uu=(i={})=>{La={...La,...i}},$u=()=>La;let Zn;const Hu=i=>{Zn=i},cr=()=>Zn,Gu={type:"3rdParty",init(i){Uu(i.options.react),Hu(i)}},Ku=jr();class Wu{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Yu=(i,e)=>{const t=K();return V(()=>{t.current=e?t.current:i},[i,e]),t.current},Jn=(i,e,t,r)=>i.getFixedT(e,t,r),Zu=(i,e,t,r)=>Bn(Jn(i,e,t,r),[i,e,t,r]),X=(i,e={})=>{var k,w,C,A;const{i18n:t}=e,{i18n:r,defaultNS:a}=wa(Ku)||{},o=t||r||cr();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Wu),!o){Ta("You will need to pass in an i18next instance by using initReactI18next");const D=(S,E)=>Ut(E)?E:Ou(E)&&Ut(E.defaultValue)?E.defaultValue:Array.isArray(S)?S[S.length-1]:S,x=[D,{},!1];return x.t=D,x.i18n={},x.ready=!1,x}(k=o.options.react)!=null&&k.wait&&Ta("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const n={...$u(),...o.options.react,...e},{useSuspense:s,keyPrefix:l}=n;let c=i||a||((w=o.options)==null?void 0:w.defaultNS);c=Ut(c)?[c]:c||["translation"],(A=(C=o.reportNamespaces).addUsedNamespaces)==null||A.call(C,c);const u=(o.isInitialized||o.initializedStoreOnce)&&c.every(D=>Iu(D,o,n)),d=Zu(o,e.lng||null,n.nsMode==="fallback"?c:c[0],l),f=()=>d,h=()=>Jn(o,e.lng||null,n.nsMode==="fallback"?c:c[0],l),[b,m]=F(f);let y=c.join();e.lng&&(y=`${e.lng}${y}`);const v=Yu(y),g=K(!0);V(()=>{const{bindI18n:D,bindI18nStore:x}=n;g.current=!0,!u&&!s&&(e.lng?Yn(o,e.lng,c,()=>{g.current&&m(h)}):Wn(o,c,()=>{g.current&&m(h)})),u&&v&&v!==y&&g.current&&m(h);const S=()=>{g.current&&m(h)};return D&&(o==null||o.on(D,S)),x&&(o==null||o.store.on(x,S)),()=>{g.current=!1,o&&(D==null||D.split(" ").forEach(E=>o.off(E,S))),x&&o&&x.split(" ").forEach(E=>o.store.off(E,S))}},[o,y]),V(()=>{g.current&&u&&m(f)},[o,l,u]);const _=[b,o,u];if(_.t=b,_.i18n=o,_.ready=u,u||!u&&!s)return _;throw new Promise(D=>{e.lng?Yn(o,e.lng,c,()=>D()):Wn(o,c,()=>D())})};var Ju=Symbol.for("preact-signals");function Di(){if(Et>1)Et--;else{for(var i,e=!1;Vr!==void 0;){var t=Vr;for(Vr=void 0,Pa++;t!==void 0;){var r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&Qn(t))try{t.c()}catch(a){e||(i=a,e=!0)}t=r}}if(Pa=0,Et--,e)throw i}}function Xu(i){if(Et>0)return i();Et++;try{return i()}finally{Di()}}var te=void 0,Vr=void 0,Et=0,Pa=0,Si=0;function Xn(i){if(te!==void 0){var e=i.n;if(e===void 0||e.t!==te)return e={i:0,S:i,p:te.s,n:void 0,t:te,e:void 0,x:void 0,r:e},te.s!==void 0&&(te.s.n=e),te.s=e,i.n=e,32&te.f&&i.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=te.s,e.n=void 0,te.s.n=e,te.s=e),e}}function ve(i){this.v=i,this.i=0,this.n=void 0,this.t=void 0}ve.prototype.brand=Ju,ve.prototype.h=function(){return!0},ve.prototype.S=function(i){this.t!==i&&i.e===void 0&&(i.x=this.t,this.t!==void 0&&(this.t.e=i),this.t=i)},ve.prototype.U=function(i){if(this.t!==void 0){var e=i.e,t=i.x;e!==void 0&&(e.x=t,i.e=void 0),t!==void 0&&(t.e=e,i.x=void 0),i===this.t&&(this.t=t)}},ve.prototype.subscribe=function(i){var e=this;return Ma(function(){var t=e.value,r=te;te=void 0;try{i(t)}finally{te=r}})},ve.prototype.valueOf=function(){return this.value},ve.prototype.toString=function(){return this.value+""},ve.prototype.toJSON=function(){return this.value},ve.prototype.peek=function(){var i=te;te=void 0;try{return this.value}finally{te=i}},Object.defineProperty(ve.prototype,"value",{get:function(){var i=Xn(this);return i!==void 0&&(i.i=this.i),this.v},set:function(i){if(i!==this.v){if(Pa>100)throw new Error("Cycle detected");this.v=i,this.i++,Si++,Et++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Di()}}}});function ke(i){return new ve(i)}function Qn(i){for(var e=i.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function es(i){for(var e=i.s;e!==void 0;e=e.n){var t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){i.s=e;break}}}function ts(i){for(var e=i.s,t=void 0;e!==void 0;){var r=e.p;e.i===-1?(e.S.U(e),r!==void 0&&(r.n=e.n),e.n!==void 0&&(e.n.p=r)):t=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=r}i.s=t}function ur(i){ve.call(this,void 0),this.x=i,this.s=void 0,this.g=Si-1,this.f=4}(ur.prototype=new ve).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Si))return!0;if(this.g=Si,this.f|=1,this.i>0&&!Qn(this))return this.f&=-2,!0;var i=te;try{es(this),te=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return te=i,ts(this),this.f&=-2,!0},ur.prototype.S=function(i){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}ve.prototype.S.call(this,i)},ur.prototype.U=function(i){if(this.t!==void 0&&(ve.prototype.U.call(this,i),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}},ur.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;i!==void 0;i=i.x)i.t.N()}},Object.defineProperty(ur.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=Xn(this);if(this.h(),i!==void 0&&(i.i=this.i),16&this.f)throw this.v;return this.v}});function Qu(i){return new ur(i)}function rs(i){var e=i.u;if(i.u=void 0,typeof e=="function"){Et++;var t=te;te=void 0;try{e()}catch(r){throw i.f&=-2,i.f|=8,Fa(i),r}finally{te=t,Di()}}}function Fa(i){for(var e=i.s;e!==void 0;e=e.n)e.S.U(e);i.x=void 0,i.s=void 0,rs(i)}function ed(i){if(te!==this)throw new Error("Out-of-order effect");ts(this),te=i,this.f&=-2,8&this.f&&Fa(this),Di()}function Ur(i){this.x=i,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Ur.prototype.c=function(){var i=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{i()}},Ur.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,rs(this),es(this),Et++;var i=te;return te=this,ed.bind(this,i)},Ur.prototype.N=function(){2&this.f||(this.f|=2,this.o=Vr,Vr=this)},Ur.prototype.d=function(){this.f|=8,1&this.f||Fa(this)};function Ma(i){var e=new Ur(i);try{e.c()}catch(t){throw e.d(),t}return e.d.bind(e)}var Na;function dr(i,e){G[i]=e.bind(null,G[i]||function(){})}function Ei(i){Na&&Na(),Na=i&&i.S()}function is(i){var e=this,t=i.data,r=rd(t);r.value=t;var a=tt(function(){for(var o=e.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return e.__$u.c=function(){var n,s=e.__$u.S(),l=a.value;s(),on(l)||((n=e.base)==null?void 0:n.nodeType)!==3?(e.__$f|=1,e.setState({})):e.base.data=l},Qu(function(){var n=r.value.value;return n===0?0:n===!0?"":n||""})},[]);return a.value}is.displayName="_st",Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:is},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),dr("__b",function(i,e){if(typeof e.type=="string"){var t,r=e.props;for(var a in r)if(a!=="children"){var o=r[a];o instanceof ve&&(t||(e.__np=t={}),t[a]=o,r[a]=o.peek())}}i(e)}),dr("__r",function(i,e){Ei();var t,r=e.__c;r&&(r.__$f&=-2,(t=r.__$u)===void 0&&(r.__$u=t=function(a){var o;return Ma(function(){o=this}),o.c=function(){r.__$f|=1,r.setState({})},o}())),Ei(t),i(e)}),dr("__e",function(i,e,t,r){Ei(),i(e,t,r)}),dr("diffed",function(i,e){Ei();var t;if(typeof e.type=="string"&&(t=e.__e)){var r=e.__np,a=e.props;if(r){var o=t.U;if(o)for(var n in o){var s=o[n];s!==void 0&&!(n in r)&&(s.d(),o[n]=void 0)}else t.U=o={};for(var l in r){var c=o[l],u=r[l];c===void 0?(c=td(t,l,u,a),o[l]=c):c.o(u,a)}}}i(e)});function td(i,e,t,r){var a=e in i&&i.ownerSVGElement===void 0,o=ke(t);return{o:function(n,s){o.value=n,r=s},d:Ma(function(){var n=o.value.value;r[e]!==n&&(r[e]=n,a?i[e]=n:n?i.setAttribute(e,n):i.removeAttribute(e))})}}dr("unmount",function(i,e){if(typeof e.type=="string"){var t=e.__e;if(t){var r=t.U;if(r){t.U=void 0;for(var a in r){var o=r[a];o&&o.d()}}}}else{var n=e.__c;if(n){var s=n.__$u;s&&(n.__$u=void 0,s.d())}}i(e)}),dr("__h",function(i,e,t,r){(r<3||r===9)&&(e.__$f|=2),i(e,t,r)}),Ye.prototype.shouldComponentUpdate=function(i,e){var t=this.__$u;if(!(t&&t.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var r in e)return!0;for(var a in i)if(a!=="__source"&&i[a]!==this.props[a])return!0;for(var o in this.props)if(!(o in i))return!0;return!1};function rd(i){return tt(function(){return ke(i)},[])}const Ra=ke(!1),Y=ke(null),pr=ke([]),fr=ke(!1),De=ke(!1),hr=ke([]),Ze=ke(!1),Bi=ke(null),we=ke(null),zi=ke(!1),Ti=ke(!0),ft=ke(!1),id=()=>{Xu(()=>{Y.value=null,pr.value=[],fr.value=!1,De.value=!1,hr.value=[],Ze.value=!1,Bi.value=null,we.value=null,zi.value=!1,Ti.value=!0,ft.value=!1})},Ia="bm_currentBike",ad="v2",od="https://cdn.bikematrix.io",as={isShopify:!1,skuField:"sku",apiUrl:"https://api.bikematrix.io/proxy/v3/",apiKey:"",apiToken:"",currentCollectionHandle:"",categories:[],collections:[],pageType:"index",showHomePageCollection:!1,showSearchPageCollection:!1,designMode:!1,bikeSelectorBrands:"",productsCollections:{},isHomePage:!1,isSearchPage:!1,products:{},collectionUrl:"",compatiblityListCurrentPage:0,showCompatibleList:!0,delayCompatibleListInitialization:!1,sku:"",productCollections:[],logLevel:"none",virtualWorkshop:!0,internalLink:""},ze=function(i){return new URL(i,od).toString()};function os(i){var e,t,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i)){var a=i.length;for(e=0;e<a;e++)i[e]&&(t=os(i[e]))&&(r&&(r+=" "),r+=t)}else for(t in i)i[t]&&(r&&(r+=" "),r+=t);return r}function nd(){for(var i,e,t=0,r="",a=arguments.length;t<a;t++)(i=arguments[t])&&(e=os(i))&&(r&&(r+=" "),r+=e);return r}const Oa="-";function sd(i){const e=cd(i),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=i;function a(n){const s=n.split(Oa);return s[0]===""&&s.length!==1&&s.shift(),ns(s,e)||ld(n)}function o(n,s){const l=t[n]||[];return s&&r[n]?[...l,...r[n]]:l}return{getClassGroupId:a,getConflictingClassGroupIds:o}}function ns(i,e){var n;if(i.length===0)return e.classGroupId;const t=i[0],r=e.nextPart.get(t),a=r?ns(i.slice(1),r):void 0;if(a)return a;if(e.validators.length===0)return;const o=i.join(Oa);return(n=e.validators.find(({validator:s})=>s(o)))==null?void 0:n.classGroupId}const ss=/^\[(.+)\]$/;function ld(i){if(ss.test(i)){const e=ss.exec(i)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}}function cd(i){const{theme:e,prefix:t}=i,r={nextPart:new Map,validators:[]};return dd(Object.entries(i.classGroups),t).forEach(([o,n])=>{ja(n,r,o,e)}),r}function ja(i,e,t,r){i.forEach(a=>{if(typeof a=="string"){const o=a===""?e:ls(e,a);o.classGroupId=t;return}if(typeof a=="function"){if(ud(a)){ja(a(r),e,t,r);return}e.validators.push({validator:a,classGroupId:t});return}Object.entries(a).forEach(([o,n])=>{ja(n,ls(e,o),t,r)})})}function ls(i,e){let t=i;return e.split(Oa).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t}function ud(i){return i.isThemeGetter}function dd(i,e){return e?i.map(([t,r])=>{const a=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([n,s])=>[e+n,s])):o);return[t,a]}):i}function pd(i){if(i<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;function a(o,n){t.set(o,n),e++,e>i&&(e=0,r=t,t=new Map)}return{get(o){let n=t.get(o);if(n!==void 0)return n;if((n=r.get(o))!==void 0)return a(o,n),n},set(o,n){t.has(o)?t.set(o,n):a(o,n)}}}const cs="!";function fd(i){const e=i.separator,t=e.length===1,r=e[0],a=e.length;return function(n){const s=[];let l=0,c=0,u;for(let m=0;m<n.length;m++){let y=n[m];if(l===0){if(y===r&&(t||n.slice(m,m+a)===e)){s.push(n.slice(c,m)),c=m+a;continue}if(y==="/"){u=m;continue}}y==="["?l++:y==="]"&&l--}const d=s.length===0?n:n.substring(c),f=d.startsWith(cs),h=f?d.substring(1):d,b=u&&u>c?u-c:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:b}}}function hd(i){if(i.length<=1)return i;const e=[];let t=[];return i.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e}function gd(i){return{cache:pd(i.cacheSize),splitModifiers:fd(i),...sd(i)}}const md=/\s+/;function bd(i,e){const{splitModifiers:t,getClassGroupId:r,getConflictingClassGroupIds:a}=e,o=new Set;return i.trim().split(md).map(n=>{const{modifiers:s,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=t(n);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:n};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:n};f=!1}const h=hd(s).join(":");return{isTailwindClass:!0,modifierId:l?h+cs:h,classGroupId:d,originalClassName:n,hasPostfixModifier:f}}).reverse().filter(n=>{if(!n.isTailwindClass)return!0;const{modifierId:s,classGroupId:l,hasPostfixModifier:c}=n,u=s+l;return o.has(u)?!1:(o.add(u),a(l,c).forEach(d=>o.add(s+d)),!0)}).reverse().map(n=>n.originalClassName).join(" ")}function _d(){let i=0,e,t,r="";for(;i<arguments.length;)(e=arguments[i++])&&(t=us(e))&&(r&&(r+=" "),r+=t);return r}function us(i){if(typeof i=="string")return i;let e,t="";for(let r=0;r<i.length;r++)i[r]&&(e=us(i[r]))&&(t&&(t+=" "),t+=e);return t}function vd(i,...e){let t,r,a,o=n;function n(l){const c=e.reduce((u,d)=>d(u),i());return t=gd(c),r=t.cache.get,a=t.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=bd(l,t);return a(l,u),u}return function(){return o(_d.apply(null,arguments))}}function oe(i){const e=t=>t[i]||[];return e.isThemeGetter=!0,e}const ds=/^\[(?:([a-z-]+):)?(.+)\]$/i,yd=/^\d+\/\d+$/,kd=new Set(["px","full","screen"]),wd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Cd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ad=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function ht(i){return $t(i)||kd.has(i)||yd.test(i)}function Bt(i){return gr(i,"length",Fd)}function $t(i){return!!i&&!Number.isNaN(Number(i))}function Li(i){return gr(i,"number",$t)}function $r(i){return!!i&&Number.isInteger(Number(i))}function Sd(i){return i.endsWith("%")&&$t(i.slice(0,-1))}function W(i){return ds.test(i)}function zt(i){return wd.test(i)}const Ed=new Set(["length","size","percentage"]);function Bd(i){return gr(i,Ed,ps)}function zd(i){return gr(i,"position",ps)}const Td=new Set(["image","url"]);function Ld(i){return gr(i,Td,Nd)}function Pd(i){return gr(i,"",Md)}function Hr(){return!0}function gr(i,e,t){const r=ds.exec(i);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1}function Fd(i){return xd.test(i)&&!Cd.test(i)}function ps(){return!1}function Md(i){return Ad.test(i)}function Nd(i){return Dd.test(i)}function Rd(){const i=oe("colors"),e=oe("spacing"),t=oe("blur"),r=oe("brightness"),a=oe("borderColor"),o=oe("borderRadius"),n=oe("borderSpacing"),s=oe("borderWidth"),l=oe("contrast"),c=oe("grayscale"),u=oe("hueRotate"),d=oe("invert"),f=oe("gap"),h=oe("gradientColorStops"),b=oe("gradientColorStopPositions"),m=oe("inset"),y=oe("margin"),v=oe("opacity"),g=oe("padding"),_=oe("saturate"),k=oe("scale"),w=oe("sepia"),C=oe("skew"),A=oe("space"),D=oe("translate"),x=()=>["auto","contain","none"],S=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto",W,e],T=()=>[W,e],L=()=>["",ht,Bt],M=()=>["auto",$t,W],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],P=()=>["solid","dashed","dotted","double","none"],R=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],z=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",W],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[$t,Li],U=()=>[$t,W];return{cacheSize:500,separator:":",theme:{colors:[Hr],spacing:[ht,Bt],blur:["none","",zt,W],brightness:$(),borderColor:[i],borderRadius:["none","","full",zt,W],borderSpacing:T(),borderWidth:L(),contrast:$(),grayscale:B(),hueRotate:U(),invert:B(),gap:T(),gradientColorStops:[i],gradientColorStopPositions:[Sd,Bt],inset:E(),margin:E(),opacity:$(),padding:T(),saturate:$(),scale:$(),sepia:B(),skew:U(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",W]}],container:["container"],columns:[{columns:[zt]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...O(),W]}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-y":[{"overscroll-y":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",$r,W]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",W]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",$r,W]}],"grid-cols":[{"grid-cols":[Hr]}],"col-start-end":[{col:["auto",{span:["full",$r,W]},W]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[Hr]}],"row-start-end":[{row:["auto",{span:[$r,W]},W]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",W]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",W]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",W,e]}],"min-w":[{"min-w":[W,e,"min","max","fit"]}],"max-w":[{"max-w":[W,e,"none","full","min","max","fit","prose",{screen:[zt]},zt]}],h:[{h:[W,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[W,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[W,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[W,e,"auto","min","max","fit"]}],"font-size":[{text:["base",zt,Bt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Li]}],"font-family":[{font:[Hr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",W]}],"line-clamp":[{"line-clamp":["none",$t,Li]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ht,W]}],"list-image":[{"list-image":["none",W]}],"list-style-type":[{list:["none","disc","decimal",W]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[i]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[i]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ht,Bt]}],"underline-offset":[{"underline-offset":["auto",ht,W]}],"text-decoration-color":[{decoration:[i]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...O(),zd]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Bd]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ld]}],"bg-color":[{bg:[i]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...P(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:P()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...P()]}],"outline-offset":[{"outline-offset":[ht,W]}],"outline-w":[{outline:[ht,Bt]}],"outline-color":[{outline:[i]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[i]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[ht,Bt]}],"ring-offset-color":[{"ring-offset":[i]}],shadow:[{shadow:["","inner","none",zt,Pd]}],"shadow-color":[{shadow:[Hr]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":R()}],"bg-blend":[{"bg-blend":R()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",zt,W]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",W]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",W]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",W]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[$r,W]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",W]}],accent:[{accent:["auto",i]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",W]}],"caret-color":[{caret:[i]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",W]}],fill:[{fill:[i,"none"]}],"stroke-w":[{stroke:[ht,Bt,Li]}],stroke:[{stroke:[i,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const Id=vd(Rd);function Z(...i){return Id(nd(i))}const Od={shopify:{bikeBrands:"bike/brands",bikeModels:"bike/models",framesSeries:"bike/frameSeries",bikeSpecs:"bike/bikeSpecBikes",bikeSpecYears:"bike/bikeSpecYears",bikeSpecSizes:"bike/bikeSpecSizes",bikeBrandProductCategories:"bike/bikeBrandProductCategories",checkSku:"compatibility/checkSku",checkSkus:"compatibility/checkSkus",checkSkusWithResults:"compatibility/checkSkusWithResults",bikeBom:"workshop/bikeBom",customBike:"workshop/addCustomBike",addComponent:"workshop/addComponent",findProducts:"workshop/findProducts",removeComponent:"workshop/removeComponent",revertComponent:"workshop/revertComponent",saveCustomBike:"workshop/saveCustomBike",updateCustomBike:"workshop/updateCustomBike",updateCustomBikeName:"workshop/updateCustomBikeName"},bikematrix:{bikeBrands:"GetBikeBrands",bikeModels:"GetBikeModels",framesSeries:"GetBikeFrameSeries",bikeSpecs:"GetBikeSpecBikes",bikeSpecYears:"GetBikeSpecYears",bikeSpecSizes:"GetBikeSpecSizes",bikeBrandProductCategories:"GetBikeBrandProductCategories",checkSku:"Compatibility_CheckSku",checkSkus:"Compatibility_CheckSkus",checkSkusWithResults:"Compatibility_CheckSkusWithResults",bikeBom:"GetBikeBillOfMaterials",customBike:"AddCustomBike",addComponent:"AddComponent",findProducts:"FindProducts",removeComponent:"RemoveComponent",revertComponent:"RevertComponent",saveCustomBike:"SaveCustomBike",updateCustomBike:"UpdateCustomBike",updateCustomBikeName:"UpdateCustomBikeName"}};class Se{constructor(e,t,r,a){this._apiUrl=a?window.location.origin+"/apps/proxy/api/":e,this._apiKey=t??"",this._apiToken=r??"",this._apiType=a?"shopify":"bikematrix"}getEndpoint(e){return Od[this._apiType][e]}async getBikeBrands(){const e=this.getEndpoint("bikeBrands"),t=await this.makeRequest(e);return t.success?{success:t.success,data:t.data}:{success:t.success,error:"error_generic GetBikeBrands",logError:t.error}}async getBikeModels(e){if(!e)return{success:!1,error:"error_generic"};const t=this.getEndpoint("bikeModels"),r=await this.makeRequest(t,{params:{bikeBrandId:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_generic GetBikeModels",logError:r.error}}async getBikeFrameSeries(e){if(!e)return{error:"error_generic",success:!1};const t=this.getEndpoint("framesSeries"),r=await this.makeRequest(t,{params:{bikeModelId:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_generic GetBikeFrameSeries",logError:r.error}}async getBikeSpecs(e){if(!e)return{success:!1,error:"error_generic GetBikeSpecs"};const t=this.getEndpoint("bikeSpecs"),r=await this.makeRequest(t,{params:{bikeModelSpecId:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_generic GetBikeSpecs",logError:r.error}}async getYears(e){if(!e)return{error:"error_generic GetBikeYears",success:!1};const t=this.getEndpoint("bikeSpecYears"),r=await this.makeRequest(t,{params:{bikeModelSpecId:e}});return r.success?{data:r.data,success:r.success}:{error:"error_generic GetBikeYears",success:!1,logError:r.success}}async getFrameSizes(e,t,r){if(!e||!t)return{success:!1,error:"error_generic GetFrameSizes"};const a=this.getEndpoint("bikeSpecSizes"),o=await this.makeRequest(a,{params:{bikeModelSpecId:e,bikeSpec:t,year:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_generic GetFrameSizes",logError:o.error}}async getBikes(e,t,r){if(e&&(t||r)){const a=this.getEndpoint("bikeSpecs"),o=await this.makeRequest(a,{params:{bikeModelSpecId:e,bikeSpec:t,year:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_generic GetBikes",logError:o.error}}else return{success:!1,error:"error_generic GetBikes"}}async getBrandProductCategories(e){if(e){const t=this.getEndpoint("bikeBrandProductCategories"),r=await this.makeRequest(t,{params:{bikeBrandId:e}});return r.success?{data:r.data,success:!0}:(console.error(r.error),{success:!1,error:"error_generic GetBrandProductCategories",logError:r.error})}else return{success:!1,error:"error_generic GetBrandProductCategories"}}async checkSkuCompatibility(e,t,r){if(e&&t){const a=this.getEndpoint("checkSku")+`/${e}/${t}/${r}`,o=await this.makeRequest(a);return o.success?{success:o.success,data:o.data}:{success:o.success,error:"error_generic CheckSkuCompatibility",logError:o.error}}else return{success:!1,error:"error_generic CheckSkuCompatibility"}}async checkSkusCompatibility(e,t,r){if(e&&t){const a=this.getEndpoint("checkSkus")+`/${e}/${t}/${r}`,o=await this.makeRequest(a);return o.success?{data:o.data,success:o.success,logError:o.error}:{success:o.success,error:"error_generic CheckSkusCompatibility",logError:o.error}}else return{success:!1,error:"error_generic CheckSkusCompatibility"}}async checkSkusCompatibilityWithResults(e,t,r,a={}){if(e&&t){const o=this.getEndpoint("checkSkusWithResults")+`/${e}/${r}`,n=await this.makeRequest(o,{body:JSON.stringify(t),method:"POST",headers:{"Content-Type":"application/json"},...a});return n.success?{data:n.data,success:n.success}:{success:n.success,error:"error_compatiblelist",logError:n.error}}else return{success:!1,error:"error_compatiblelist"}}async getActiveSubscription(e){if(this._apiType!=="shopify"){e({activeSubscription:!0});return}var t="activeSubscription";const r=await this.makeRequest(t);if(!r.success){console.log(`getActiveSubscription Error: ${r.error}`);return}e(r.data)}async getBikeBom(e){if(!e)return{success:!1,error:"error_generic getBikeBom"};const t=this.getEndpoint("bikeBom"),r=await this.makeRequest(t,{params:{bikeKey:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_get_bike_bom",logError:r.error}}async addCustomBike(e){if(!e)return{success:!1,error:"error_generic addCustomBike"};const t=this.getEndpoint("customBike"),r=await this.makeRequest(t,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_add_custom_bike",logError:r.error}}async findProducts(e,t){if(!e)return{success:!1,error:"error_generic findProducts"};const r=this.getEndpoint("findProducts"),a=await this.makeRequest(r,{params:{search:e,productCategoryId:t,recordCount:500}});return a.success?{data:a.data,success:a.success}:{success:a.success,error:"error_find_products",logError:a.error}}async addComponent(e,t,r,a){if(!e||!t||!r||!a)return{success:!1,error:"error_generic addComponent"};const o=this.getEndpoint("addComponent"),n=await this.makeRequest(o,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t,productId:r,bikeFieldName:a}});return n.success?{data:n.data,success:n.success}:{success:n.success,error:"error_add_component",logError:n.error}}async removeComponent(e,t,r){if(!e||!t||!r)return{success:!1,error:"error_generic removeComponent"};const a=this.getEndpoint("removeComponent"),o=await this.makeRequest(a,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t,bikeFieldName:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_remove_component",logError:o.error}}async revertComponent(e,t,r){if(!e||!t||!r)return{success:!1,error:"error_generic revertComponent"};const a=this.getEndpoint("revertComponent"),o=await this.makeRequest(a,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t,bikeFieldName:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_revert_component",logError:o.error}}async saveCustomBike(e,t){if(!e||!t)return{success:!1,error:"error_generic saveCustomBike"};const r=this.getEndpoint("saveCustomBike"),a=await this.makeRequest(r,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,email:t}});return a.success?{data:a.data,success:a.success}:{success:a.success,error:"error_save_custom_bike",logError:a.error}}async updateCustomBike(e,t){if(!e||!t)return{success:!1,error:"error_generic saveCustomBike"};const r=this.getEndpoint("updateCustomBike"),a=await this.makeRequest(r,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t}});return a.success?{data:a.data,success:a.success}:{success:a.success,error:"error_update_custom_bike"}}async updateCustomBikeName(e,t){if(!e||!t)return{success:!1,error:"error_generic updateCustomBikeName"};const r=this.getEndpoint("updateCustomBikeName"),a=await this.makeRequest(r,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,name:t}});return a.success?{data:a.data,success:a.success}:{success:a.success,error:"error_update_custom_bike_name",logError:a.error}}async makeRequest(e,t={}){const r=new URL(e,this._apiUrl),a={"Cache-Control":"no-cache",...this._apiKey&&{"bm-subscription-key":this._apiKey},...this._apiToken&&{"bm-app-token":this._apiToken}};typeof t.params=="object"&&(Object.keys(t.params).forEach(n=>{t.params[n]&&r.searchParams.set(n,t.params[n])}),delete t.params);let o;try{const n={...a,...t.headers||{}},s={...t,headers:n};t.signal&&(s.signal=t.signal);const l=await fetch(r==null?void 0:r.href,s),c=await l.json().catch(()=>{throw new Error("Request failed: "+(l.statusText||"Status"+l.status))});c.status===400||c.statusCode===404?o={success:!1,data:c}:o={success:!0,data:c}}catch(n){o={success:!1,error:n.message}}return o}}async function fs(i){var f;const{categories:e,collections:t,apiUrl:r,apiKey:a,apiToken:o,isShopify:n,logLevel:s}=window.BikeMatrix.getConfig(),l=JSON.parse(sessionStorage.getItem("bm_categories")||"null"),c=JSON.parse(localStorage.getItem(Ia)||"null"),u=new Se(r,a,o,n);let d=[];if(s==="verbose"&&console.log("useCompatibleCollections sessionCollections",l),!l||!(l!=null&&l.collections)||!(l!=null&&l.collections.length)||(l==null?void 0:l.key)!==(c==null?void 0:c.key)){s==="verbose"&&console.log("useCompatibleCollections fetching new collections");const h=await u.getBrandProductCategories(i);if(s==="verbose"&&console.log("useCompatibleCollections bikeBrandProductCategories",h),!h.success)return console.log(h),s==="verbose"&&console.error(h.error),d={error:h.error},d;if(s==="verbose"&&(console.log("useCompatibleCollections categories",e),console.log("useCompatibleCollections collections",t)),((f=h.data)==null?void 0:f.length)>0){let b=e.filter(m=>{var y;return!!m.collection&&((y=h==null?void 0:h.data)==null?void 0:y.some(v=>v.product_Category.toLowerCase()===m.title.toLowerCase()))});s==="verbose"&&console.log("useCompatibleCollections availableCategories",b),d=b.map(m=>t.filter(v=>m.collection.split(",").map(g=>g.trim().toLowerCase()).includes(v.title.toLowerCase())).map(v=>({title:v.title,text_id:m.text_id,handle:v.handle,url:v.url}))).flat(),s==="verbose"&&console.log("useCompatibleCollections compatibleCollections",d),d=d==null?void 0:d.filter((m,y,v)=>y===v.findIndex(g=>g.title===m.title&&g.text_id===m.text_id&&g.handle===m.handle&&g.url===m.url))}sessionStorage.setItem("bm_categories",JSON.stringify({key:c==null?void 0:c.key,collections:d})),s==="verbose"&&console.log("useCompatibleCollections fetched collections",d)}else s==="verbose"&&console.log("useCompatibleCollections using session collections"),d=l.collections;return d}const hs=class _i{constructor(){this.initialized=!1,this.compatibleListInitialized=!1,this.currentBike=null,this.activeSubscription=null,this.components=[],this.config=as}async initialize(e){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: initialize() called"),this.components=[],this.initialized&&this.cleanup(),e&&(this.config={...this.config,...e}),this.initializeConfig(),this.service=new Se(this.config.apiUrl,this.config.apiKey,this.config.apiToken,this.config.isShopify),this.initializeActiveSubscription(),localStorage.bm_currentBike&&(this.currentBike=JSON.parse(localStorage.bm_currentBike)),this.setupEventListeners(),this.registerComponents(),this.initialized=!0,Ra.value=!0;const t=new Event("BM:Initialized");document.dispatchEvent(t),(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&(console.log("Core: BikeMatrix WebComponent Version: 1.3.2"),console.log("Core: BikeMatrixCore initialized"))}static getInstance(){return _i.instance||(_i.instance=new _i),_i.instance}registerComponents(){const e=["bikematrix-bikeselector","bikematrix-productresult","bikematrix-collectionresult","bikematrix-compatibilitylabel","bikematrix-compatiblelist","bikematrix-bikeselectorbanner","bikematrix-variantselector"];this.components=[],e.forEach(t=>{const r=document.getElementsByTagName(t);Array.from(r).forEach(a=>{this.components.push(a)})}),(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log(`Core: Registered ${this.components.length} components`)}resetComponents(){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: resetComponents() called"),this.components.forEach(e=>{var t;try{const r=e.cloneNode(!1);e.querySelectorAll("template").forEach(o=>{r.appendChild(o.cloneNode(!0))}),(t=e.parentNode)==null||t.replaceChild(r,e)}catch{console.error("Core: Error resetting component",e)}})}isInitialized(){return this.initialized}updateConfig(e){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: updateConfig() called"),this.config={...this.config,...e},this.reload(!1)}cleanup(){this.removeEventListeners(),id()}async destroy(){this.cleanup(),this.service=null,this.currentBike=null,this.activeSubscription=null,this.config={...as},this.initialized=!1,Ra.value=!1,this.resetComponents()}updateCompatibleList(e=!0){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: updateCompatibleList showCompatibleList: ",e),this.config.showCompatibleList=e,this.initializeConfig(),e&&(De.value=!0,this.RefreshCompatibleSkus(!0)),this.compatibleListInitialized=!0}refresh(){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: refresh() called"),this.ChangeBike()}reset(){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: reset() called"),this.destroy(),this.initialize()}reload(e=!0){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: reload() called. shouldReloadConfig: ",e),e&&this.initializeConfig(),this.refresh(),this.registerComponents(),this.resetComponents()}initializeConfig(){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: initializeConfig called");const e=document.querySelectorAll('script[type="application/json"][data-bikematrix-config]'),t=JSON.parse(sessionStorage.getItem("bm_diagnostics"));e.forEach(r=>{if(r!=null&&r.textContent)try{this.config={...this.config,...JSON.parse(r.textContent)}}catch{console.error("Core: Invalid BikeMatrix configuration"),console.log("Core: configScript ",r.textContent)}}),this.config.showCompatibleList&&!this.config.delayCompatibleListInitialization?this.compatibleListInitialized=!0:this.config.showCompatibleList&&this.config.delayCompatibleListInitialization&&!this.compatibleListInitialized&&(De.value=!0),t!=null&&t.includes("verbose")?this.config.logLevel="verbose":t!=null&&t.includes("core")&&(this.config.logLevel="core"),t!=null&&t.includes("virtualWorkshop")&&(this.config.virtualWorkshop=!0),t!=null&&t.includes("subscribtion")&&(this.activeSubscription=!0),t!=null&&t.includes("all")&&(this.config.logLevel="verbose",this.config.virtualWorkshop=!0,this.activeSubscription=!0),this.config.logLevel==="verbose"&&console.log("initializeConfig ",JSON.stringify(this.config,null,2))}initializeActiveSubscription(){const e=sessionStorage.getItem("bm_activeSubscription");if((this.config.logLevel==="verbose"||this.config.logLevel==="core")&&(console.log("Core: Not Shopify: ",!this.config.isShopify),console.log("Core: Session Active Subscription: ",e),console.log("Core: Design Mode: ",this.config.designMode)),!this.config.isShopify){this.activeSubscription=!0;return}this.activeSubscription=this.config.designMode||e==="true",e||this.service.getActiveSubscription(this.updateActiveSubscription.bind(this))}setupEventListeners(){document.addEventListener("BikeMatrix:RefreshCompatibleSkus",e=>{this.RefreshCompatibleSkus().then(()=>{document.dispatchEvent(new Event("RefreshCompatibility",{bubbles:!0,composed:!0}))})}),document.addEventListener("on:facet-filters:updated",this.handleRefreshCompatibleSkus.bind(this)),document.addEventListener("BikeChanging",this.handleBikeChanging.bind(this))}removeEventListeners(){document.removeEventListener("BikeMatrix:RefreshCompatibleSkus",this.handleRefreshCompatibleSkus),document.removeEventListener("on:facet-filters:updated",this.handleRefreshCompatibleSkus),document.removeEventListener("BikeChanging",this.handleBikeChanging)}async handleRefreshCompatibleSkus(e){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: Listener RefreshCompatibleSkus ..."),this.RefreshCompatibleSkus().then(()=>{document.dispatchEvent(new Event("RefreshCompatibility",{bubbles:!0,composed:!0}))})}async handleBikeChanging(e){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: Listener BikeChanging (pre) ..."),this.ChangeBike()}getConfig(){return this.config}getActiveSubscription(){return this.activeSubscription}getCurrentBike(){return this.currentBike}updateSku(e){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: updateSku() called with sku: ",e);const t=document.querySelector("bikematrix-productresult[data-sku]"),r=document.querySelector("bikematrix-variantselector[data-sku]");t&&t.setAttribute("data-sku",e),r&&r.setAttribute("data-sku",e),this.config.sku=e}ResetSelectedBikeIndicator(){var e,t;(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: ResetSelectedBikeIndicator() Method Called"),this.currentBike===null?(e=window.bm_selectBikeButton)==null||e.classList.remove("show-selected"):(t=window.bm_selectBikeButton)==null||t.classList.add("show-selected")}ChangeBike(){if((this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: ChangeBike() Method Called"),fr.value===!0||Ze.value===!0){console.log("Core: ChangeBike loading, return");return}fr.value=!0,De.value=!0,Ze.value=!0,pr.value=[],hr.value=[],(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: ChangeBike updateBikeSignal..."),this.updateBikeSignal().then(()=>{this.config.logLevel==="verbose"?console.log("Core: Bike Signal Updated: ",JSON.stringify(Y.value,null,2)):this.config.logLevel==="core"&&console.log("Core: Bike Signal Updated"),this.ResetSelectedBikeIndicator(),this.RefreshCompatibleSkus().then(()=>{document.dispatchEvent(new Event("RefreshCompatibility",{bubbles:!0,composed:!0})),document.dispatchEvent(new Event("BikeChanged",{bubbles:!0,composed:!0}))})})}async RefreshCompatibleSkus(e=!1){var r,a;const t=`${(r=Y.value)==null?void 0:r.key}:${this.config.currentCollectionHandle}:${ad}`;switch((this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: RefreshCompatibleSkus() called. Current Collection Bike Key: ",t),this.config.pageType){case"collection":const o=!!Y.value&&!Y.value.compatibleCollections.error&&((a=Y.value.compatibleCollections)==null?void 0:a.some(s=>s.handle===this.config.currentCollectionHandle)),n=this.config.showCompatibleList&&(this.compatibleListInitialized||e);(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: RefreshCompatibleSkus. hasCompatibleCollection: ",o," showCompatibleList: ",this.config.showCompatibleList," compatibleListInitialized: ",this.compatibleListInitialized," CompatibleListLoadingSignal: ",De.value," onlyCompatibleList: ",e," delayCompatibleListInitialization: ",this.config.delayCompatibleListInitialization," shouldRefreshCompatibleListSkus: ",n),o&&(e||await this.RefreshCollectionPageSkus(t),n&&((this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: RefreshCompatibleSkus refreshing compatible list skus for collection page..."),await this.RefreshCollectionListSkus(t))),fr.value=!1,Ze.value=!1,n&&(De.value=!1);break;case"search":case"index":fr.value=!1,De.value=!1,(this.config.pageType==="index"&&this.config.showHomePageCollection||this.config.pageType==="search"&&this.config.showSearchPageCollection)&&await this.RefreshCollectionPageSkus(t),Ze.value=!1;break;default:fr.value=!1,De.value=!1,Ze.value=!1;break}}async RefreshCollectionPageSkus(e){var n,s;let t=document.getElementsByTagName("bikematrix-collectionresult"),a=Array.from(t).map(l=>{const c=this.config.skuField==="barcode"?l.getAttribute("data-product-barcodes"):this.config.skuField==="metafield"?l.getAttribute("data-product-metafields"):l.getAttribute("data-product-skus")||"";return c==null?void 0:c.split(",").filter(u=>!!u)}).flat();this.config.logLevel==="verbose"&&console.log("Refresh Collection Page SKUs. SKUs: ",JSON.stringify(a),null,2);var o=((n=cr())==null?void 0:n.language)||"en-GB";if(a&&a.length>0){const l=await this.service.checkSkusCompatibilityWithResults((s=Y.value)==null?void 0:s.key,a,o);l.success?hr.value=l.data:(zi.value=!0,this.config.logLevel==="verbose"&&console.log("Compatible List Error: ",l.logError))}else hr.value=[]}async RefreshCollectionListSkus(e){var a,o;var t=JSON.parse(sessionStorage.getItem(e));if(t)this.config.logLevel==="verbose"&&console.log("Refresh Collection SKUs from Session: ",JSON.stringify(t),null,2),pr.value=t;else{const n=Object.values(this.config.products||{}).map(u=>u.skus).flat();this.config.logLevel==="verbose"&&console.log("Refresh Collection SKUs from API. SKUs: ",JSON.stringify(n),null,2);var r=((a=cr())==null?void 0:a.language)||"en-GB";const s=new AbortController,l=s.signal,c=()=>s.abort();window.addEventListener("beforeunload",c);try{if(!((o=Y.value)!=null&&o.key))throw new Error("BikeSignal key is undefined");const u=await this.service.checkSkusCompatibilityWithResults(Y.value.key,n,r,{signal:l});if(this.config.logLevel==="verbose"&&console.log("Refresh Collection SKUs from API. SKUs: ",JSON.stringify(u)),l.aborted){this.config.logLevel==="verbose"&&console.log("function RefreshCompatibleSkus() operation aborted");return}u.success?(sessionStorage.setItem(e,JSON.stringify(u.data)),pr.value=u.data):(zi.value=!0,this.config.logLevel==="verbose"&&console.log("Compatible List Error: ",u.logError))}catch(u){u.name==="AbortError"?console.log("function RefreshCompatibleSkus() fetch aborted"):console.error("function RefreshCompatibleSkus() fetch error",u)}finally{window.removeEventListener("beforeunload",c)}}}updateActiveSubscription(e){this.config.logLevel==="verbose"&&console.log("updateActiveSubscription data: ",e);const t=!!(e!=null&&e.activeSubscription);sessionStorage.setItem("bm_activeSubscription",JSON.stringify(t)),this.activeSubscription=t}async updateBikeSignal(){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: updateBikeSignal() called");const e=localStorage.getItem(Ia)||"null",t=JSON.parse(e);if(this.currentBike=t,t==null){Y.value=null;return}const r=await fs(t==null?void 0:t.brandId);!Array.isArray(r)&&r.error?(t.compatibleCollections=[],Y.value=t):(t.compatibleCollections=r,Y.value=t),this.config.logLevel==="verbose"?console.log("Core: Bike Changed: ",JSON.stringify(Y.value,null,2)):this.config.logLevel==="core"&&console.log("Core: Bike Changed")}};hs.instance=null;let jd=hs;const Gr=i=>j("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},j("path",{d:"M1.53553 8.60658L5.07107 5.07104M5.07107 5.07104L8.6066 1.53551M5.07107 5.07104L8.6066 8.60658M5.07107 5.07104L1.53553 1.53551",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})),qd=`:host .overlay{opacity:0;visibility:hidden}@media (min-width: 640px){:host .modal{opacity:0;transform:scale(.9);visibility:hidden}}@media not all and (min-width: 640px){:host .modal{transform:translateY(100%);visibility:hidden}}
1
+ var BikeMatrix=function(){"use strict";var Rr,G,an,on,Vt,nn,sn,fa,ln,Ir={},cn=[],jc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,vi=Array.isArray;function dt(i,e){for(var t in e)i[t]=e[t];return i}function un(i){var e=i.parentNode;e&&e.removeChild(i)}function j(i,e,t){var r,a,o,n={};for(o in e)o=="key"?r=e[o]:o=="ref"?a=e[o]:n[o]=e[o];if(arguments.length>2&&(n.children=arguments.length>3?Rr.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(o in i.defaultProps)n[o]===void 0&&(n[o]=i.defaultProps[o]);return Or(i,n,r,a,null)}function Or(i,e,t,r,a){var o={type:i,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:a??++an,__i:-1,__u:0};return a==null&&G.vnode!=null&&G.vnode(o),o}function qc(){return{current:null}}function q(i){return i.children}function Ye(i,e){this.props=i,this.context=e}function or(i,e){if(e==null)return i.__?or(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?or(i):null}function dn(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return dn(i)}}function ha(i){(!i.__d&&(i.__d=!0)&&Vt.push(i)&&!yi.__r++||nn!==G.debounceRendering)&&((nn=G.debounceRendering)||sn)(yi)}function yi(){var i,e,t,r,a,o,n,s,l;for(Vt.sort(fa);i=Vt.shift();)i.__d&&(e=Vt.length,r=void 0,o=(a=(t=i).__v).__e,s=[],l=[],(n=t.__P)&&((r=dt({},a)).__v=a.__v+1,G.vnode&&G.vnode(r),ga(n,r,a,t.__n,n.ownerSVGElement!==void 0,32&a.__u?[o]:null,s,o??or(a),!!(32&a.__u),l),r.__v=a.__v,r.__.__k[r.__i]=r,bn(s,r,l),r.__e!=o&&dn(r)),Vt.length>e&&Vt.sort(fa));yi.__r=0}function pn(i,e,t,r,a,o,n,s,l,c,u){var d,f,h,b,m,y=r&&r.__k||cn,v=e.length;for(t.__d=l,Vc(t,e,y),l=t.__d,d=0;d<v;d++)(h=t.__k[d])!=null&&typeof h!="boolean"&&typeof h!="function"&&(f=h.__i===-1?Ir:y[h.__i]||Ir,h.__i=d,ga(i,h,f,a,o,n,s,l,c,u),b=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&ma(f.ref,null,h),u.push(h.ref,h.__c||b,h)),m==null&&b!=null&&(m=b),65536&h.__u||f.__k===h.__k?l=fn(h,l,i):typeof h.type=="function"&&h.__d!==void 0?l=h.__d:b&&(l=b.nextSibling),h.__d=void 0,h.__u&=-196609);t.__d=l,t.__e=m}function Vc(i,e,t){var r,a,o,n,s,l=e.length,c=t.length,u=c,d=0;for(i.__k=[],r=0;r<l;r++)n=r+d,(a=i.__k[r]=(a=e[r])==null||typeof a=="boolean"||typeof a=="function"?null:typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Or(null,a,null,null,null):vi(a)?Or(q,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?Or(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a)!=null?(a.__=i,a.__b=i.__b+1,s=Uc(a,t,n,u),a.__i=s,o=null,s!==-1&&(u--,(o=t[s])&&(o.__u|=131072)),o==null||o.__v===null?(s==-1&&d--,typeof a.type!="function"&&(a.__u|=65536)):s!==n&&(s===n+1?d++:s>n?u>l-n?d+=s-n:d--:s<n?s==n-1&&(d=s-n):d=0,s!==r+d&&(a.__u|=65536))):(o=t[n])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==i.__d&&(i.__d=or(o)),ba(o,o,!1),t[n]=null,u--);if(u)for(r=0;r<c;r++)(o=t[r])!=null&&!(131072&o.__u)&&(o.__e==i.__d&&(i.__d=or(o)),ba(o,o))}function fn(i,e,t){var r,a;if(typeof i.type=="function"){for(r=i.__k,a=0;r&&a<r.length;a++)r[a]&&(r[a].__=i,e=fn(r[a],e,t));return e}i.__e!=e&&(t.insertBefore(i.__e,e||null),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function pt(i,e){return e=e||[],i==null||typeof i=="boolean"||(vi(i)?i.some(function(t){pt(t,e)}):e.push(i)),e}function Uc(i,e,t,r){var a=i.key,o=i.type,n=t-1,s=t+1,l=e[t];if(l===null||l&&a==l.key&&o===l.type&&!(131072&l.__u))return t;if(r>(l!=null&&!(131072&l.__u)?1:0))for(;n>=0||s<e.length;){if(n>=0){if((l=e[n])&&!(131072&l.__u)&&a==l.key&&o===l.type)return n;n--}if(s<e.length){if((l=e[s])&&!(131072&l.__u)&&a==l.key&&o===l.type)return s;s++}}return-1}function hn(i,e,t){e[0]==="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||jc.test(e)?t:t+"px"}function ki(i,e,t,r,a){var o;e:if(e==="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(e in r)t&&e in t||hn(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||hn(i.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in i?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+o]=t,t?r?t.u=r.u:(t.u=Date.now(),i.addEventListener(e,o?mn:gn,o)):i.removeEventListener(e,o?mn:gn,o);else{if(a)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?i.removeAttribute(e):i.setAttribute(e,t))}}function gn(i){if(this.l){var e=this.l[i.type+!1];if(i.t){if(i.t<=e.u)return}else i.t=Date.now();return e(G.event?G.event(i):i)}}function mn(i){if(this.l)return this.l[i.type+!0](G.event?G.event(i):i)}function ga(i,e,t,r,a,o,n,s,l,c){var u,d,f,h,b,m,y,v,g,_,k,w,C,A,D,x=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),o=[s=e.__e=t.__e]),(u=G.__b)&&u(e);e:if(typeof x=="function")try{if(v=e.props,g=(u=x.contextType)&&r[u.__c],_=u?g?g.props.value:u.__:r,t.__c?y=(d=e.__c=t.__c).__=d.__E:("prototype"in x&&x.prototype.render?e.__c=d=new x(v,_):(e.__c=d=new Ye(v,_),d.constructor=x,d.render=Hc),g&&g.sub(d),d.props=v,d.state||(d.state={}),d.context=_,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),d.__s==null&&(d.__s=d.state),x.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=dt({},d.__s)),dt(d.__s,x.getDerivedStateFromProps(v,d.__s))),h=d.props,b=d.state,d.__v=e,f)x.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(x.getDerivedStateFromProps==null&&v!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,_),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,_)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(d.props=v,d.state=d.__s,d.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(S){S&&(S.__=e)}),k=0;k<d._sb.length;k++)d.__h.push(d._sb[k]);d._sb=[],d.__h.length&&n.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,_),d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,b,m)})}if(d.context=_,d.props=v,d.__P=i,d.__e=!1,w=G.__r,C=0,"prototype"in x&&x.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(e),u=d.render(d.props,d.state,d.context),A=0;A<d._sb.length;A++)d.__h.push(d._sb[A]);d._sb=[]}else do d.__d=!1,w&&w(e),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++C<25);d.state=d.__s,d.getChildContext!=null&&(r=dt(dt({},r),d.getChildContext())),f||d.getSnapshotBeforeUpdate==null||(m=d.getSnapshotBeforeUpdate(h,b)),pn(i,vi(D=u!=null&&u.type===q&&u.key==null?u.props.children:u)?D:[D],e,t,r,a,o,n,s,l,c),d.base=e.__e,e.__u&=-161,d.__h.length&&n.push(d),y&&(d.__E=d.__=null)}catch(S){e.__v=null,l||o!=null?(e.__e=s,e.__u|=l?160:32,o[o.indexOf(s)]=null):(e.__e=t.__e,e.__k=t.__k),G.__e(S,e,t)}else o==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=$c(t.__e,e,t,r,a,o,n,l,c);(u=G.diffed)&&u(e)}function bn(i,e,t){e.__d=void 0;for(var r=0;r<t.length;r++)ma(t[r],t[++r],t[++r]);G.__c&&G.__c(e,i),i.some(function(a){try{i=a.__h,a.__h=[],i.some(function(o){o.call(a)})}catch(o){G.__e(o,a.__v)}})}function $c(i,e,t,r,a,o,n,s,l){var c,u,d,f,h,b,m,y=t.props,v=e.props,g=e.type;if(g==="svg"&&(a=!0),o!=null){for(c=0;c<o.length;c++)if((h=o[c])&&"setAttribute"in h==!!g&&(g?h.localName===g:h.nodeType===3)){i=h,o[c]=null;break}}if(i==null){if(g===null)return document.createTextNode(v);i=a?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,v.is&&v),o=null,s=!1}if(g===null)y===v||s&&i.data===v||(i.data=v);else{if(o=o&&Rr.call(i.childNodes),y=t.props||Ir,!s&&o!=null)for(y={},c=0;c<i.attributes.length;c++)y[(h=i.attributes[c]).name]=h.value;for(c in y)h=y[c],c=="children"||(c=="dangerouslySetInnerHTML"?d=h:c==="key"||c in v||ki(i,c,null,h,a));for(c in v)h=v[c],c=="children"?f=h:c=="dangerouslySetInnerHTML"?u=h:c=="value"?b=h:c=="checked"?m=h:c==="key"||s&&typeof h!="function"||y[c]===h||ki(i,c,h,y[c],a);if(u)s||d&&(u.__html===d.__html||u.__html===i.innerHTML)||(i.innerHTML=u.__html),e.__k=[];else if(d&&(i.innerHTML=""),pn(i,vi(f)?f:[f],e,t,r,a&&g!=="foreignObject",o,n,o?o[0]:t.__k&&or(t,0),s,l),o!=null)for(c=o.length;c--;)o[c]!=null&&un(o[c]);s||(c="value",b!==void 0&&(b!==i[c]||g==="progress"&&!b||g==="option"&&b!==y[c])&&ki(i,c,b,y[c],!1),c="checked",m!==void 0&&m!==i[c]&&ki(i,c,m,y[c],!1))}return i}function ma(i,e,t){try{typeof i=="function"?i(e):i.current=e}catch(r){G.__e(r,t)}}function ba(i,e,t){var r,a;if(G.unmount&&G.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||ma(r,null,e)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){G.__e(o,e)}r.base=r.__P=null,i.__c=void 0}if(r=i.__k)for(a=0;a<r.length;a++)r[a]&&ba(r[a],e,t||typeof i.type!="function");t||i.__e==null||un(i.__e),i.__=i.__e=i.__d=void 0}function Hc(i,e,t){return this.constructor(i,t)}function Dt(i,e,t){var r,a,o,n;G.__&&G.__(i,e),a=(r=typeof t=="function")?null:t&&t.__k||e.__k,o=[],n=[],ga(e,i=(!r&&t||e).__k=j(q,null,[i]),a||Ir,Ir,e.ownerSVGElement!==void 0,!r&&t?[t]:a?null:e.firstChild?Rr.call(e.childNodes):null,o,!r&&t?t:a?a.__e:e.firstChild,r,n),bn(o,i,n)}function _a(i,e){Dt(i,e,_a)}function va(i,e,t){var r,a,o,n,s=dt({},i.props);for(o in i.type&&i.type.defaultProps&&(n=i.type.defaultProps),e)o=="key"?r=e[o]:o=="ref"?a=e[o]:s[o]=e[o]===void 0&&n!==void 0?n[o]:e[o];return arguments.length>2&&(s.children=arguments.length>3?Rr.call(arguments,2):t),Or(i.type,s,r||i.key,a||i.ref,null)}function jr(i,e){var t={__c:e="__cC"+ln++,__:i,Consumer:function(r,a){return r.children(a)},Provider:function(r){var a,o;return this.getChildContext||(a=[],(o={})[e]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&a.some(function(s){s.__e=!0,ha(s)})},this.sub=function(n){a.push(n);var s=n.componentWillUnmount;n.componentWillUnmount=function(){a.splice(a.indexOf(n),1),s&&s.call(n)}}),r.children}};return t.Provider.__=t.Consumer.contextType=t}Rr=cn.slice,G={__e:function(i,e,t,r){for(var a,o,n;e=e.__;)if((a=e.__c)&&!a.__)try{if((o=a.constructor)&&o.getDerivedStateFromError!=null&&(a.setState(o.getDerivedStateFromError(i)),n=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(i,r||{}),n=a.__d),n)return a.__E=a}catch(s){i=s}throw i}},an=0,on=function(i){return i!=null&&i.constructor==null},Ye.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=dt({},this.state),typeof i=="function"&&(i=i(dt({},t),this.props)),i&&dt(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),ha(this))},Ye.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),ha(this))},Ye.prototype.render=q,Vt=[],sn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fa=function(i,e){return i.__v.__b-e.__v.__b},yi.__r=0,ln=0;function ya(){return(ya=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i}).apply(this,arguments)}var Gc=["context","children"];function Kc(i){this.getChildContext=function(){return i.context};var e=i.children,t=function(r,a){if(r==null)return{};var o,n,s={},l=Object.keys(r);for(n=0;n<l.length;n++)a.indexOf(o=l[n])>=0||(s[o]=r[o]);return s}(i,Gc);return va(e,t)}function Wc(){var i=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(i),this._vdom=j(Kc,ya({},this._props,{context:i.detail.context}),function e(t,r){if(t.nodeType===3)return t.data;if(t.nodeType!==1)return null;var a=[],o={},n=0,s=t.attributes,l=t.childNodes;for(n=s.length;n--;)s[n].name!=="slot"&&(o[s[n].name]=s[n].value,o[_n(s[n].name)]=s[n].value);for(n=l.length;n--;){var c=e(l[n],null),u=l[n].slot;u?o[u]=j(vn,{name:u},c):a[n]=c}var d=r?j(vn,null,a):a;return j(r||t.nodeName.toLowerCase(),o,d)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?_a:Dt)(this._vdom,this._root)}function _n(i){return i.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():""})}function Yc(i,e,t){if(this._vdom){var r={};r[i]=t=t??void 0,r[_n(i)]=t,this._vdom=va(this._vdom,r),Dt(this._vdom,this._root)}}function Zc(){Dt(this._vdom=null,this._root)}function vn(i,e){var t=this;return j("slot",ya({},i,{ref:function(r){r?(t.ref=r,t._listener||(t._listener=function(a){a.stopPropagation(),a.detail.context=e},r.addEventListener("_preact",t._listener))):t.ref.removeEventListener("_preact",t._listener)}}))}function Jc(i,e,t,r){function a(){var o=Reflect.construct(HTMLElement,[],a);return o._vdomComponent=i,o._root=r&&r.shadow?o.attachShadow({mode:r.mode||"open"}):o,o}return(a.prototype=Object.create(HTMLElement.prototype)).constructor=a,a.prototype.connectedCallback=Wc,a.prototype.attributeChangedCallback=Yc,a.prototype.disconnectedCallback=Zc,t=t||i.observedAttributes||Object.keys(i.propTypes||{}),a.observedAttributes=t,t.forEach(function(o){Object.defineProperty(a.prototype,o,{get:function(){return this._vdom.props[o]},set:function(n){this._vdom?this.attributeChangedCallback(o,null,n):(this._props||(this._props={}),this._props[o]=n,this.connectedCallback());var s=typeof n;n!=null&&s!=="string"&&s!=="boolean"&&s!=="number"||this.setAttribute(o,n)}})}),customElements.define(e||i.tagName||i.displayName||i.name,a)}var St,ae,ka,yn,nr=0,kn=[],wi=[],se=G,wn=se.__b,xn=se.__r,Cn=se.diffed,An=se.__c,Dn=se.unmount,Sn=se.__;function sr(i,e){se.__h&&se.__h(ae,i,nr||e),nr=0;var t=ae.__H||(ae.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({__V:wi}),t.__[i]}function F(i){return nr=1,En(Tn,i)}function En(i,e,t){var r=sr(St++,2);if(r.t=i,!r.__c&&(r.__=[t?t(e):Tn(void 0,e),function(s){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,s);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=ae,!ae.u)){var a=function(s,l,c){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(f){return!!f.__c});if(u.every(function(f){return!f.__N}))return!o||o.call(this,s,l,c);var d=!1;return u.forEach(function(f){if(f.__N){var h=f.__[0];f.__=f.__N,f.__N=void 0,h!==f.__[0]&&(d=!0)}}),!(!d&&r.__c.props===s)&&(!o||o.call(this,s,l,c))};ae.u=!0;var o=ae.shouldComponentUpdate,n=ae.componentWillUpdate;ae.componentWillUpdate=function(s,l,c){if(this.__e){var u=o;o=void 0,a(s,l,c),o=u}n&&n.call(this,s,l,c)},ae.shouldComponentUpdate=a}return r.__N||r.__}function V(i,e){var t=sr(St++,3);!se.__s&&Ca(t.__H,e)&&(t.__=i,t.i=e,ae.__H.__h.push(t))}function lr(i,e){var t=sr(St++,4);!se.__s&&Ca(t.__H,e)&&(t.__=i,t.i=e,ae.__h.push(t))}function K(i){return nr=5,tt(function(){return{current:i}},[])}function Xc(i,e,t){nr=6,lr(function(){return typeof i=="function"?(i(e()),function(){return i(null)}):i?(i.current=e(),function(){return i.current=null}):void 0},t==null?t:t.concat(i))}function tt(i,e){var t=sr(St++,7);return Ca(t.__H,e)?(t.__V=i(),t.i=e,t.__h=i,t.__V):t.__}function Bn(i,e){return nr=8,tt(function(){return i},e)}function wa(i){var e=ae.context[i.__c],t=sr(St++,9);return t.c=i,e?(t.__==null&&(t.__=!0,e.sub(ae)),e.props.value):i.__}function Qc(i,e){se.useDebugValue&&se.useDebugValue(e?e(i):i)}function eu(){var i=sr(St++,11);if(!i.__){for(var e=ae.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var t=e.__m||(e.__m=[0,0]);i.__="P"+t[0]+"-"+t[1]++}return i.__}function tu(){for(var i;i=kn.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(xi),i.__H.__h.forEach(xa),i.__H.__h=[]}catch(e){i.__H.__h=[],se.__e(e,i.__v)}}se.__b=function(i){ae=null,wn&&wn(i)},se.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Sn&&Sn(i,e)},se.__r=function(i){xn&&xn(i),St=0;var e=(ae=i.__c).__H;e&&(ka===ae?(e.__h=[],ae.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=wi,t.__N=t.i=void 0})):(e.__h.forEach(xi),e.__h.forEach(xa),e.__h=[],St=0)),ka=ae},se.diffed=function(i){Cn&&Cn(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(kn.push(e)!==1&&yn===se.requestAnimationFrame||((yn=se.requestAnimationFrame)||ru)(tu)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==wi&&(t.__=t.__V),t.i=void 0,t.__V=wi})),ka=ae=null},se.__c=function(i,e){e.some(function(t){try{t.__h.forEach(xi),t.__h=t.__h.filter(function(r){return!r.__||xa(r)})}catch(r){e.some(function(a){a.__h&&(a.__h=[])}),e=[],se.__e(r,t.__v)}}),An&&An(i,e)},se.unmount=function(i){Dn&&Dn(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{xi(r)}catch(a){e=a}}),t.__H=void 0,e&&se.__e(e,t.__v))};var zn=typeof requestAnimationFrame=="function";function ru(i){var e,t=function(){clearTimeout(r),zn&&cancelAnimationFrame(e),setTimeout(i)},r=setTimeout(t,100);zn&&(e=requestAnimationFrame(t))}function xi(i){var e=ae,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),ae=e}function xa(i){var e=ae;i.__c=i.__(),ae=e}function Ca(i,e){return!i||i.length!==e.length||e.some(function(t,r){return t!==i[r]})}function Tn(i,e){return typeof e=="function"?e(i):e}function Ln(i,e){for(var t in e)i[t]=e[t];return i}function Aa(i,e){for(var t in i)if(t!=="__source"&&!(t in e))return!0;for(var r in e)if(r!=="__source"&&i[r]!==e[r])return!0;return!1}function Da(i,e){this.props=i,this.context=e}function iu(i,e){function t(a){var o=this.props.ref,n=o==a.ref;return!n&&o&&(o.call?o(null):o.current=null),e?!e(this.props,a)||!n:Aa(this.props,a)}function r(a){return this.shouldComponentUpdate=t,j(i,a)}return r.displayName="Memo("+(i.displayName||i.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(Da.prototype=new Ye).isPureReactComponent=!0,Da.prototype.shouldComponentUpdate=function(i,e){return Aa(this.props,i)||Aa(this.state,e)};var Pn=G.__b;G.__b=function(i){i.type&&i.type.__f&&i.ref&&(i.props.ref=i.ref,i.ref=null),Pn&&Pn(i)};var au=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Sa(i){function e(t){var r=Ln({},t);return delete r.ref,i(r,t.ref||null)}return e.$$typeof=au,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(i.displayName||i.name)+")",e}var Fn=function(i,e){return i==null?null:pt(pt(i).map(e))},ou={map:Fn,forEach:Fn,count:function(i){return i?pt(i).length:0},only:function(i){var e=pt(i);if(e.length!==1)throw"Children.only";return e[0]},toArray:pt},nu=G.__e;G.__e=function(i,e,t,r){if(i.then){for(var a,o=e;o=o.__;)if((a=o.__c)&&a.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),a.__c(i,e)}nu(i,e,t,r)};var Mn=G.unmount;function Nn(i,e,t){return i&&(i.__c&&i.__c.__H&&(i.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),i.__c.__H=null),(i=Ln({},i)).__c!=null&&(i.__c.__P===t&&(i.__c.__P=e),i.__c=null),i.__k=i.__k&&i.__k.map(function(r){return Nn(r,e,t)})),i}function Rn(i,e,t){return i&&t&&(i.__v=null,i.__k=i.__k&&i.__k.map(function(r){return Rn(r,e,t)}),i.__c&&i.__c.__P===e&&(i.__e&&t.appendChild(i.__e),i.__c.__e=!0,i.__c.__P=t)),i}function Ci(){this.__u=0,this.t=null,this.__b=null}function In(i){var e=i.__.__c;return e&&e.__a&&e.__a(i)}function su(i){var e,t,r;function a(o){if(e||(e=i()).then(function(n){t=n.default||n},function(n){r=n}),r)throw r;if(!t)throw e;return j(t,o)}return a.displayName="Lazy",a.__f=!0,a}function qr(){this.u=null,this.o=null}G.unmount=function(i){var e=i.__c;e&&e.__R&&e.__R(),e&&32&i.__u&&(i.type=null),Mn&&Mn(i)},(Ci.prototype=new Ye).__c=function(i,e){var t=e.__c,r=this;r.t==null&&(r.t=[]),r.t.push(t);var a=In(r.__v),o=!1,n=function(){o||(o=!0,t.__R=null,a?a(s):s())};t.__R=n;var s=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=Rn(l,l.__c.__P,l.__c.__O)}var c;for(r.setState({__a:r.__b=null});c=r.t.pop();)c.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),i.then(n,n)},Ci.prototype.componentWillUnmount=function(){this.t=[]},Ci.prototype.render=function(i,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Nn(this.__b,t,r.__O=r.__P)}this.__b=null}var a=e.__a&&j(q,null,i.fallback);return a&&(a.__u&=-33),[j(q,null,e.__a?null:i.children),a]};var On=function(i,e,t){if(++t[1]===t[0]&&i.o.delete(e),i.props.revealOrder&&(i.props.revealOrder[0]!=="t"||!i.o.size))for(t=i.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;i.u=t=t[2]}};function lu(i){return this.getChildContext=function(){return i.context},i.children}function cu(i){var e=this,t=i.i;e.componentWillUnmount=function(){Dt(null,e.l),e.l=null,e.i=null},e.i&&e.i!==t&&e.componentWillUnmount(),e.l||(e.i=t,e.l={nodeType:1,parentNode:t,childNodes:[],appendChild:function(r){this.childNodes.push(r),e.i.appendChild(r)},insertBefore:function(r,a){this.childNodes.push(r),e.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.i.removeChild(r)}}),Dt(j(lu,{context:e.context},i.__v),e.l)}function uu(i,e){var t=j(cu,{__v:i,i:e});return t.containerInfo=e,t}(qr.prototype=new Ye).__a=function(i){var e=this,t=In(e.__v),r=e.o.get(i);return r[0]++,function(a){var o=function(){e.props.revealOrder?(r.push(a),On(e,i,r)):a()};t?t(o):o()}},qr.prototype.render=function(i){this.u=null,this.o=new Map;var e=pt(i.children);i.revealOrder&&i.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.o.set(e[t],this.u=[1,0,this.u]);return i.children},qr.prototype.componentDidUpdate=qr.prototype.componentDidMount=function(){var i=this;this.o.forEach(function(e,t){On(i,t,e)})};var jn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,du=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,pu=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,fu=/[A-Z0-9]/g,hu=typeof document<"u",gu=function(i){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(i)};function mu(i,e,t){return e.__k==null&&(e.textContent=""),Dt(i,e),typeof t=="function"&&t(),i?i.__c:null}function bu(i,e,t){return _a(i,e),typeof t=="function"&&t(),i?i.__c:null}Ye.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(i){Object.defineProperty(Ye.prototype,i,{configurable:!0,get:function(){return this["UNSAFE_"+i]},set:function(e){Object.defineProperty(this,i,{configurable:!0,writable:!0,value:e})}})});var qn=G.event;function _u(){}function vu(){return this.cancelBubble}function yu(){return this.defaultPrevented}G.event=function(i){return qn&&(i=qn(i)),i.persist=_u,i.isPropagationStopped=vu,i.isDefaultPrevented=yu,i.nativeEvent=i};var Ea,ku={enumerable:!1,configurable:!0,get:function(){return this.class}},Vn=G.vnode;G.vnode=function(i){typeof i.type=="string"&&function(e){var t=e.props,r=e.type,a={};for(var o in t){var n=t[o];if(!(o==="value"&&"defaultValue"in t&&n==null||hu&&o==="children"&&r==="noscript"||o==="class"||o==="className")){var s=o.toLowerCase();o==="defaultValue"&&"value"in t&&t.value==null?o="value":o==="download"&&n===!0?n="":s==="translate"&&n==="no"?n=!1:s==="ondoubleclick"?o="ondblclick":s!=="onchange"||r!=="input"&&r!=="textarea"||gu(t.type)?s==="onfocus"?o="onfocusin":s==="onblur"?o="onfocusout":pu.test(o)?o=s:r.indexOf("-")===-1&&du.test(o)?o=o.replace(fu,"-$&").toLowerCase():n===null&&(n=void 0):s=o="oninput",s==="oninput"&&a[o=s]&&(o="oninputCapture"),a[o]=n}}r=="select"&&a.multiple&&Array.isArray(a.value)&&(a.value=pt(t.children).forEach(function(l){l.props.selected=a.value.indexOf(l.props.value)!=-1})),r=="select"&&a.defaultValue!=null&&(a.value=pt(t.children).forEach(function(l){l.props.selected=a.multiple?a.defaultValue.indexOf(l.props.value)!=-1:a.defaultValue==l.props.value})),t.class&&!t.className?(a.class=t.class,Object.defineProperty(a,"className",ku)):(t.className&&!t.class||t.class&&t.className)&&(a.class=a.className=t.className),e.props=a}(i),i.$$typeof=jn,Vn&&Vn(i)};var Un=G.__r;G.__r=function(i){Un&&Un(i),Ea=i.__c};var $n=G.diffed;G.diffed=function(i){$n&&$n(i);var e=i.props,t=i.__e;t!=null&&i.type==="textarea"&&"value"in e&&e.value!==t.value&&(t.value=e.value==null?"":e.value),Ea=null};var wu={ReactCurrentDispatcher:{current:{readContext:function(i){return Ea.__n[i.__c].props.value}}}};function xu(i){return j.bind(null,i)}function Ai(i){return!!i&&i.$$typeof===jn}function Cu(i){return Ai(i)&&i.type===q}function Au(i){return Ai(i)?va.apply(null,arguments):i}function Du(i){return!!i.__k&&(Dt(null,i),!0)}function Su(i){return i&&(i.base||i.nodeType===1&&i)||null}var Eu=function(i,e){return i(e)},Bu=function(i,e){return i(e)},zu=q;function Hn(i){i()}function Tu(i){return i}function Lu(){return[!1,Hn]}var Pu=lr,Fu=Ai;function Mu(i,e){var t=e(),r=F({h:{__:t,v:e}}),a=r[0].h,o=r[1];return lr(function(){a.__=t,a.v=e,Ba(a)&&o({h:a})},[i,t,e]),V(function(){return Ba(a)&&o({h:a}),i(function(){Ba(a)&&o({h:a})})},[i]),t}function Ba(i){var e,t,r=i.v,a=i.__;try{var o=r();return!((e=a)===(t=o)&&(e!==0||1/e==1/t)||e!=e&&t!=t)}catch{return!0}}var me={useState:F,useId:eu,useReducer:En,useEffect:V,useLayoutEffect:lr,useInsertionEffect:Pu,useTransition:Lu,useDeferredValue:Tu,useSyncExternalStore:Mu,startTransition:Hn,useRef:K,useImperativeHandle:Xc,useMemo:tt,useCallback:Bn,useContext:wa,useDebugValue:Qc,version:"17.0.2",Children:ou,render:mu,hydrate:bu,unmountComponentAtNode:Du,createPortal:uu,createElement:j,createContext:jr,createFactory:xu,cloneElement:Au,createRef:qc,Fragment:q,isValidElement:Ai,isElement:Fu,isFragment:Cu,findDOMNode:Su,Component:Ye,PureComponent:Da,memo:iu,forwardRef:Sa,flushSync:Bu,unstable_batchedUpdates:Eu,StrictMode:zu,Suspense:Ci,SuspenseList:qr,lazy:su,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:wu},za=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nu(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}const Ru=(...i)=>{console!=null&&console.warn&&(Ut(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),console.warn(...i))},Gn={},Ta=(...i)=>{Ut(i[0])&&Gn[i[0]]||(Ut(i[0])&&(Gn[i[0]]=new Date),Ru(...i))},Kn=(i,e)=>()=>{if(i.isInitialized)e();else{const t=()=>{setTimeout(()=>{i.off("initialized",t)},0),e()};i.on("initialized",t)}},Wn=(i,e,t)=>{i.loadNamespaces(e,Kn(i,t))},Yn=(i,e,t,r)=>{Ut(t)&&(t=[t]),t.forEach(a=>{i.options.ns.indexOf(a)<0&&i.options.ns.push(a)}),i.loadLanguages(e,Kn(i,r))},Iu=(i,e,t={})=>!e.languages||!e.languages.length?(Ta("i18n.languages were undefined or empty",e.languages),!0):e.hasLoadedNamespace(i,{lng:t.lng,precheck:(r,a)=>{var o;if(((o=t.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,i))return!1}}),Ut=i=>typeof i=="string",Ou=i=>typeof i=="object"&&i!==null,ju=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qu={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Vu=i=>qu[i];let La={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:i=>i.replace(ju,Vu)};const Uu=(i={})=>{La={...La,...i}},$u=()=>La;let Zn;const Hu=i=>{Zn=i},cr=()=>Zn,Gu={type:"3rdParty",init(i){Uu(i.options.react),Hu(i)}},Ku=jr();class Wu{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Yu=(i,e)=>{const t=K();return V(()=>{t.current=e?t.current:i},[i,e]),t.current},Jn=(i,e,t,r)=>i.getFixedT(e,t,r),Zu=(i,e,t,r)=>Bn(Jn(i,e,t,r),[i,e,t,r]),X=(i,e={})=>{var k,w,C,A;const{i18n:t}=e,{i18n:r,defaultNS:a}=wa(Ku)||{},o=t||r||cr();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Wu),!o){Ta("You will need to pass in an i18next instance by using initReactI18next");const D=(S,E)=>Ut(E)?E:Ou(E)&&Ut(E.defaultValue)?E.defaultValue:Array.isArray(S)?S[S.length-1]:S,x=[D,{},!1];return x.t=D,x.i18n={},x.ready=!1,x}(k=o.options.react)!=null&&k.wait&&Ta("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const n={...$u(),...o.options.react,...e},{useSuspense:s,keyPrefix:l}=n;let c=i||a||((w=o.options)==null?void 0:w.defaultNS);c=Ut(c)?[c]:c||["translation"],(A=(C=o.reportNamespaces).addUsedNamespaces)==null||A.call(C,c);const u=(o.isInitialized||o.initializedStoreOnce)&&c.every(D=>Iu(D,o,n)),d=Zu(o,e.lng||null,n.nsMode==="fallback"?c:c[0],l),f=()=>d,h=()=>Jn(o,e.lng||null,n.nsMode==="fallback"?c:c[0],l),[b,m]=F(f);let y=c.join();e.lng&&(y=`${e.lng}${y}`);const v=Yu(y),g=K(!0);V(()=>{const{bindI18n:D,bindI18nStore:x}=n;g.current=!0,!u&&!s&&(e.lng?Yn(o,e.lng,c,()=>{g.current&&m(h)}):Wn(o,c,()=>{g.current&&m(h)})),u&&v&&v!==y&&g.current&&m(h);const S=()=>{g.current&&m(h)};return D&&(o==null||o.on(D,S)),x&&(o==null||o.store.on(x,S)),()=>{g.current=!1,o&&(D==null||D.split(" ").forEach(E=>o.off(E,S))),x&&o&&x.split(" ").forEach(E=>o.store.off(E,S))}},[o,y]),V(()=>{g.current&&u&&m(f)},[o,l,u]);const _=[b,o,u];if(_.t=b,_.i18n=o,_.ready=u,u||!u&&!s)return _;throw new Promise(D=>{e.lng?Yn(o,e.lng,c,()=>D()):Wn(o,c,()=>D())})};var Ju=Symbol.for("preact-signals");function Di(){if(Et>1)Et--;else{for(var i,e=!1;Vr!==void 0;){var t=Vr;for(Vr=void 0,Pa++;t!==void 0;){var r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&Qn(t))try{t.c()}catch(a){e||(i=a,e=!0)}t=r}}if(Pa=0,Et--,e)throw i}}function Xu(i){if(Et>0)return i();Et++;try{return i()}finally{Di()}}var te=void 0,Vr=void 0,Et=0,Pa=0,Si=0;function Xn(i){if(te!==void 0){var e=i.n;if(e===void 0||e.t!==te)return e={i:0,S:i,p:te.s,n:void 0,t:te,e:void 0,x:void 0,r:e},te.s!==void 0&&(te.s.n=e),te.s=e,i.n=e,32&te.f&&i.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=te.s,e.n=void 0,te.s.n=e,te.s=e),e}}function ve(i){this.v=i,this.i=0,this.n=void 0,this.t=void 0}ve.prototype.brand=Ju,ve.prototype.h=function(){return!0},ve.prototype.S=function(i){this.t!==i&&i.e===void 0&&(i.x=this.t,this.t!==void 0&&(this.t.e=i),this.t=i)},ve.prototype.U=function(i){if(this.t!==void 0){var e=i.e,t=i.x;e!==void 0&&(e.x=t,i.e=void 0),t!==void 0&&(t.e=e,i.x=void 0),i===this.t&&(this.t=t)}},ve.prototype.subscribe=function(i){var e=this;return Ma(function(){var t=e.value,r=te;te=void 0;try{i(t)}finally{te=r}})},ve.prototype.valueOf=function(){return this.value},ve.prototype.toString=function(){return this.value+""},ve.prototype.toJSON=function(){return this.value},ve.prototype.peek=function(){var i=te;te=void 0;try{return this.value}finally{te=i}},Object.defineProperty(ve.prototype,"value",{get:function(){var i=Xn(this);return i!==void 0&&(i.i=this.i),this.v},set:function(i){if(i!==this.v){if(Pa>100)throw new Error("Cycle detected");this.v=i,this.i++,Si++,Et++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Di()}}}});function ke(i){return new ve(i)}function Qn(i){for(var e=i.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function es(i){for(var e=i.s;e!==void 0;e=e.n){var t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){i.s=e;break}}}function ts(i){for(var e=i.s,t=void 0;e!==void 0;){var r=e.p;e.i===-1?(e.S.U(e),r!==void 0&&(r.n=e.n),e.n!==void 0&&(e.n.p=r)):t=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=r}i.s=t}function ur(i){ve.call(this,void 0),this.x=i,this.s=void 0,this.g=Si-1,this.f=4}(ur.prototype=new ve).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Si))return!0;if(this.g=Si,this.f|=1,this.i>0&&!Qn(this))return this.f&=-2,!0;var i=te;try{es(this),te=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return te=i,ts(this),this.f&=-2,!0},ur.prototype.S=function(i){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}ve.prototype.S.call(this,i)},ur.prototype.U=function(i){if(this.t!==void 0&&(ve.prototype.U.call(this,i),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}},ur.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;i!==void 0;i=i.x)i.t.N()}},Object.defineProperty(ur.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var i=Xn(this);if(this.h(),i!==void 0&&(i.i=this.i),16&this.f)throw this.v;return this.v}});function Qu(i){return new ur(i)}function rs(i){var e=i.u;if(i.u=void 0,typeof e=="function"){Et++;var t=te;te=void 0;try{e()}catch(r){throw i.f&=-2,i.f|=8,Fa(i),r}finally{te=t,Di()}}}function Fa(i){for(var e=i.s;e!==void 0;e=e.n)e.S.U(e);i.x=void 0,i.s=void 0,rs(i)}function ed(i){if(te!==this)throw new Error("Out-of-order effect");ts(this),te=i,this.f&=-2,8&this.f&&Fa(this),Di()}function Ur(i){this.x=i,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Ur.prototype.c=function(){var i=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{i()}},Ur.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,rs(this),es(this),Et++;var i=te;return te=this,ed.bind(this,i)},Ur.prototype.N=function(){2&this.f||(this.f|=2,this.o=Vr,Vr=this)},Ur.prototype.d=function(){this.f|=8,1&this.f||Fa(this)};function Ma(i){var e=new Ur(i);try{e.c()}catch(t){throw e.d(),t}return e.d.bind(e)}var Na;function dr(i,e){G[i]=e.bind(null,G[i]||function(){})}function Ei(i){Na&&Na(),Na=i&&i.S()}function is(i){var e=this,t=i.data,r=rd(t);r.value=t;var a=tt(function(){for(var o=e.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return e.__$u.c=function(){var n,s=e.__$u.S(),l=a.value;s(),on(l)||((n=e.base)==null?void 0:n.nodeType)!==3?(e.__$f|=1,e.setState({})):e.base.data=l},Qu(function(){var n=r.value.value;return n===0?0:n===!0?"":n||""})},[]);return a.value}is.displayName="_st",Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:is},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),dr("__b",function(i,e){if(typeof e.type=="string"){var t,r=e.props;for(var a in r)if(a!=="children"){var o=r[a];o instanceof ve&&(t||(e.__np=t={}),t[a]=o,r[a]=o.peek())}}i(e)}),dr("__r",function(i,e){Ei();var t,r=e.__c;r&&(r.__$f&=-2,(t=r.__$u)===void 0&&(r.__$u=t=function(a){var o;return Ma(function(){o=this}),o.c=function(){r.__$f|=1,r.setState({})},o}())),Ei(t),i(e)}),dr("__e",function(i,e,t,r){Ei(),i(e,t,r)}),dr("diffed",function(i,e){Ei();var t;if(typeof e.type=="string"&&(t=e.__e)){var r=e.__np,a=e.props;if(r){var o=t.U;if(o)for(var n in o){var s=o[n];s!==void 0&&!(n in r)&&(s.d(),o[n]=void 0)}else t.U=o={};for(var l in r){var c=o[l],u=r[l];c===void 0?(c=td(t,l,u,a),o[l]=c):c.o(u,a)}}}i(e)});function td(i,e,t,r){var a=e in i&&i.ownerSVGElement===void 0,o=ke(t);return{o:function(n,s){o.value=n,r=s},d:Ma(function(){var n=o.value.value;r[e]!==n&&(r[e]=n,a?i[e]=n:n?i.setAttribute(e,n):i.removeAttribute(e))})}}dr("unmount",function(i,e){if(typeof e.type=="string"){var t=e.__e;if(t){var r=t.U;if(r){t.U=void 0;for(var a in r){var o=r[a];o&&o.d()}}}}else{var n=e.__c;if(n){var s=n.__$u;s&&(n.__$u=void 0,s.d())}}i(e)}),dr("__h",function(i,e,t,r){(r<3||r===9)&&(e.__$f|=2),i(e,t,r)}),Ye.prototype.shouldComponentUpdate=function(i,e){var t=this.__$u;if(!(t&&t.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var r in e)return!0;for(var a in i)if(a!=="__source"&&i[a]!==this.props[a])return!0;for(var o in this.props)if(!(o in i))return!0;return!1};function rd(i){return tt(function(){return ke(i)},[])}const Ra=ke(!1),Y=ke(null),pr=ke([]),fr=ke(!1),De=ke(!1),hr=ke([]),Ze=ke(!1),Bi=ke(null),we=ke(null),zi=ke(!1),Ti=ke(!0),ft=ke(!1),id=()=>{Xu(()=>{Y.value=null,pr.value=[],fr.value=!1,De.value=!1,hr.value=[],Ze.value=!1,Bi.value=null,we.value=null,zi.value=!1,Ti.value=!0,ft.value=!1})},Ia="bm_currentBike",ad="v2",od="https://cdn.bikematrix.io",as={isShopify:!1,skuField:"sku",apiUrl:"https://api.bikematrix.io/proxy/v3/",apiKey:"",apiToken:"",currentCollectionHandle:"",categories:[],collections:[],pageType:"index",showHomePageCollection:!1,showSearchPageCollection:!1,designMode:!1,bikeSelectorBrands:"",productsCollections:{},isHomePage:!1,isSearchPage:!1,products:{},collectionUrl:"",compatiblityListCurrentPage:0,showCompatibleList:!0,delayCompatibleListInitialization:!1,sku:"",productCollections:[],logLevel:"none",virtualWorkshop:!0,internalLink:"",showBrowseCategoryButtons:!0,browseCompatibilityUrl:""},ze=function(i){return new URL(i,od).toString()};function os(i){var e,t,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i)){var a=i.length;for(e=0;e<a;e++)i[e]&&(t=os(i[e]))&&(r&&(r+=" "),r+=t)}else for(t in i)i[t]&&(r&&(r+=" "),r+=t);return r}function nd(){for(var i,e,t=0,r="",a=arguments.length;t<a;t++)(i=arguments[t])&&(e=os(i))&&(r&&(r+=" "),r+=e);return r}const Oa="-";function sd(i){const e=cd(i),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=i;function a(n){const s=n.split(Oa);return s[0]===""&&s.length!==1&&s.shift(),ns(s,e)||ld(n)}function o(n,s){const l=t[n]||[];return s&&r[n]?[...l,...r[n]]:l}return{getClassGroupId:a,getConflictingClassGroupIds:o}}function ns(i,e){var n;if(i.length===0)return e.classGroupId;const t=i[0],r=e.nextPart.get(t),a=r?ns(i.slice(1),r):void 0;if(a)return a;if(e.validators.length===0)return;const o=i.join(Oa);return(n=e.validators.find(({validator:s})=>s(o)))==null?void 0:n.classGroupId}const ss=/^\[(.+)\]$/;function ld(i){if(ss.test(i)){const e=ss.exec(i)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}}function cd(i){const{theme:e,prefix:t}=i,r={nextPart:new Map,validators:[]};return dd(Object.entries(i.classGroups),t).forEach(([o,n])=>{ja(n,r,o,e)}),r}function ja(i,e,t,r){i.forEach(a=>{if(typeof a=="string"){const o=a===""?e:ls(e,a);o.classGroupId=t;return}if(typeof a=="function"){if(ud(a)){ja(a(r),e,t,r);return}e.validators.push({validator:a,classGroupId:t});return}Object.entries(a).forEach(([o,n])=>{ja(n,ls(e,o),t,r)})})}function ls(i,e){let t=i;return e.split(Oa).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t}function ud(i){return i.isThemeGetter}function dd(i,e){return e?i.map(([t,r])=>{const a=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([n,s])=>[e+n,s])):o);return[t,a]}):i}function pd(i){if(i<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;function a(o,n){t.set(o,n),e++,e>i&&(e=0,r=t,t=new Map)}return{get(o){let n=t.get(o);if(n!==void 0)return n;if((n=r.get(o))!==void 0)return a(o,n),n},set(o,n){t.has(o)?t.set(o,n):a(o,n)}}}const cs="!";function fd(i){const e=i.separator,t=e.length===1,r=e[0],a=e.length;return function(n){const s=[];let l=0,c=0,u;for(let m=0;m<n.length;m++){let y=n[m];if(l===0){if(y===r&&(t||n.slice(m,m+a)===e)){s.push(n.slice(c,m)),c=m+a;continue}if(y==="/"){u=m;continue}}y==="["?l++:y==="]"&&l--}const d=s.length===0?n:n.substring(c),f=d.startsWith(cs),h=f?d.substring(1):d,b=u&&u>c?u-c:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:b}}}function hd(i){if(i.length<=1)return i;const e=[];let t=[];return i.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e}function gd(i){return{cache:pd(i.cacheSize),splitModifiers:fd(i),...sd(i)}}const md=/\s+/;function bd(i,e){const{splitModifiers:t,getClassGroupId:r,getConflictingClassGroupIds:a}=e,o=new Set;return i.trim().split(md).map(n=>{const{modifiers:s,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=t(n);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:n};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:n};f=!1}const h=hd(s).join(":");return{isTailwindClass:!0,modifierId:l?h+cs:h,classGroupId:d,originalClassName:n,hasPostfixModifier:f}}).reverse().filter(n=>{if(!n.isTailwindClass)return!0;const{modifierId:s,classGroupId:l,hasPostfixModifier:c}=n,u=s+l;return o.has(u)?!1:(o.add(u),a(l,c).forEach(d=>o.add(s+d)),!0)}).reverse().map(n=>n.originalClassName).join(" ")}function _d(){let i=0,e,t,r="";for(;i<arguments.length;)(e=arguments[i++])&&(t=us(e))&&(r&&(r+=" "),r+=t);return r}function us(i){if(typeof i=="string")return i;let e,t="";for(let r=0;r<i.length;r++)i[r]&&(e=us(i[r]))&&(t&&(t+=" "),t+=e);return t}function vd(i,...e){let t,r,a,o=n;function n(l){const c=e.reduce((u,d)=>d(u),i());return t=gd(c),r=t.cache.get,a=t.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=bd(l,t);return a(l,u),u}return function(){return o(_d.apply(null,arguments))}}function oe(i){const e=t=>t[i]||[];return e.isThemeGetter=!0,e}const ds=/^\[(?:([a-z-]+):)?(.+)\]$/i,yd=/^\d+\/\d+$/,kd=new Set(["px","full","screen"]),wd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Cd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ad=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function ht(i){return $t(i)||kd.has(i)||yd.test(i)}function Bt(i){return gr(i,"length",Fd)}function $t(i){return!!i&&!Number.isNaN(Number(i))}function Li(i){return gr(i,"number",$t)}function $r(i){return!!i&&Number.isInteger(Number(i))}function Sd(i){return i.endsWith("%")&&$t(i.slice(0,-1))}function W(i){return ds.test(i)}function zt(i){return wd.test(i)}const Ed=new Set(["length","size","percentage"]);function Bd(i){return gr(i,Ed,ps)}function zd(i){return gr(i,"position",ps)}const Td=new Set(["image","url"]);function Ld(i){return gr(i,Td,Nd)}function Pd(i){return gr(i,"",Md)}function Hr(){return!0}function gr(i,e,t){const r=ds.exec(i);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1}function Fd(i){return xd.test(i)&&!Cd.test(i)}function ps(){return!1}function Md(i){return Ad.test(i)}function Nd(i){return Dd.test(i)}function Rd(){const i=oe("colors"),e=oe("spacing"),t=oe("blur"),r=oe("brightness"),a=oe("borderColor"),o=oe("borderRadius"),n=oe("borderSpacing"),s=oe("borderWidth"),l=oe("contrast"),c=oe("grayscale"),u=oe("hueRotate"),d=oe("invert"),f=oe("gap"),h=oe("gradientColorStops"),b=oe("gradientColorStopPositions"),m=oe("inset"),y=oe("margin"),v=oe("opacity"),g=oe("padding"),_=oe("saturate"),k=oe("scale"),w=oe("sepia"),C=oe("skew"),A=oe("space"),D=oe("translate"),x=()=>["auto","contain","none"],S=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto",W,e],T=()=>[W,e],L=()=>["",ht,Bt],M=()=>["auto",$t,W],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],P=()=>["solid","dashed","dotted","double","none"],R=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],z=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",W],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[$t,Li],U=()=>[$t,W];return{cacheSize:500,separator:":",theme:{colors:[Hr],spacing:[ht,Bt],blur:["none","",zt,W],brightness:$(),borderColor:[i],borderRadius:["none","","full",zt,W],borderSpacing:T(),borderWidth:L(),contrast:$(),grayscale:B(),hueRotate:U(),invert:B(),gap:T(),gradientColorStops:[i],gradientColorStopPositions:[Sd,Bt],inset:E(),margin:E(),opacity:$(),padding:T(),saturate:$(),scale:$(),sepia:B(),skew:U(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",W]}],container:["container"],columns:[{columns:[zt]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...O(),W]}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-y":[{"overscroll-y":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",$r,W]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",W]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",$r,W]}],"grid-cols":[{"grid-cols":[Hr]}],"col-start-end":[{col:["auto",{span:["full",$r,W]},W]}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":[Hr]}],"row-start-end":[{row:["auto",{span:[$r,W]},W]}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",W]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",W]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",W,e]}],"min-w":[{"min-w":[W,e,"min","max","fit"]}],"max-w":[{"max-w":[W,e,"none","full","min","max","fit","prose",{screen:[zt]},zt]}],h:[{h:[W,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[W,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[W,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[W,e,"auto","min","max","fit"]}],"font-size":[{text:["base",zt,Bt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Li]}],"font-family":[{font:[Hr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",W]}],"line-clamp":[{"line-clamp":["none",$t,Li]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ht,W]}],"list-image":[{"list-image":["none",W]}],"list-style-type":[{list:["none","disc","decimal",W]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[i]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[i]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ht,Bt]}],"underline-offset":[{"underline-offset":["auto",ht,W]}],"text-decoration-color":[{decoration:[i]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...O(),zd]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Bd]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ld]}],"bg-color":[{bg:[i]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...P(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:P()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...P()]}],"outline-offset":[{"outline-offset":[ht,W]}],"outline-w":[{outline:[ht,Bt]}],"outline-color":[{outline:[i]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[i]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[ht,Bt]}],"ring-offset-color":[{"ring-offset":[i]}],shadow:[{shadow:["","inner","none",zt,Pd]}],"shadow-color":[{shadow:[Hr]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":R()}],"bg-blend":[{"bg-blend":R()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",zt,W]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",W]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",W]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",W]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[$r,W]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",W]}],accent:[{accent:["auto",i]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",W]}],"caret-color":[{caret:[i]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",W]}],fill:[{fill:[i,"none"]}],"stroke-w":[{stroke:[ht,Bt,Li]}],stroke:[{stroke:[i,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const Id=vd(Rd);function Z(...i){return Id(nd(i))}const Od={shopify:{bikeBrands:"bike/brands",bikeModels:"bike/models",framesSeries:"bike/frameSeries",bikeSpecs:"bike/bikeSpecBikes",bikeSpecYears:"bike/bikeSpecYears",bikeSpecSizes:"bike/bikeSpecSizes",bikeBrandProductCategories:"bike/bikeBrandProductCategories",checkSku:"compatibility/checkSku",checkSkus:"compatibility/checkSkus",checkSkusWithResults:"compatibility/checkSkusWithResults",bikeBom:"workshop/bikeBom",customBike:"workshop/addCustomBike",addComponent:"workshop/addComponent",findProducts:"workshop/findProducts",removeComponent:"workshop/removeComponent",revertComponent:"workshop/revertComponent",saveCustomBike:"workshop/saveCustomBike",updateCustomBike:"workshop/updateCustomBike",updateCustomBikeName:"workshop/updateCustomBikeName"},bikematrix:{bikeBrands:"GetBikeBrands",bikeModels:"GetBikeModels",framesSeries:"GetBikeFrameSeries",bikeSpecs:"GetBikeSpecBikes",bikeSpecYears:"GetBikeSpecYears",bikeSpecSizes:"GetBikeSpecSizes",bikeBrandProductCategories:"GetBikeBrandProductCategories",checkSku:"Compatibility_CheckSku",checkSkus:"Compatibility_CheckSkus",checkSkusWithResults:"Compatibility_CheckSkusWithResults",bikeBom:"GetBikeBillOfMaterials",customBike:"AddCustomBike",addComponent:"AddComponent",findProducts:"FindProducts",removeComponent:"RemoveComponent",revertComponent:"RevertComponent",saveCustomBike:"SaveCustomBike",updateCustomBike:"UpdateCustomBike",updateCustomBikeName:"UpdateCustomBikeName"}};class Se{constructor(e,t,r,a){this._apiUrl=a?window.location.origin+"/apps/proxy/api/":e,this._apiKey=t??"",this._apiToken=r??"",this._apiType=a?"shopify":"bikematrix"}getEndpoint(e){return Od[this._apiType][e]}async getBikeBrands(){const e=this.getEndpoint("bikeBrands"),t=await this.makeRequest(e);return t.success?{success:t.success,data:t.data}:{success:t.success,error:"error_generic GetBikeBrands",logError:t.error}}async getBikeModels(e){if(!e)return{success:!1,error:"error_generic"};const t=this.getEndpoint("bikeModels"),r=await this.makeRequest(t,{params:{bikeBrandId:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_generic GetBikeModels",logError:r.error}}async getBikeFrameSeries(e){if(!e)return{error:"error_generic",success:!1};const t=this.getEndpoint("framesSeries"),r=await this.makeRequest(t,{params:{bikeModelId:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_generic GetBikeFrameSeries",logError:r.error}}async getBikeSpecs(e){if(!e)return{success:!1,error:"error_generic GetBikeSpecs"};const t=this.getEndpoint("bikeSpecs"),r=await this.makeRequest(t,{params:{bikeModelSpecId:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_generic GetBikeSpecs",logError:r.error}}async getYears(e){if(!e)return{error:"error_generic GetBikeYears",success:!1};const t=this.getEndpoint("bikeSpecYears"),r=await this.makeRequest(t,{params:{bikeModelSpecId:e}});return r.success?{data:r.data,success:r.success}:{error:"error_generic GetBikeYears",success:!1,logError:r.success}}async getFrameSizes(e,t,r){if(!e||!t)return{success:!1,error:"error_generic GetFrameSizes"};const a=this.getEndpoint("bikeSpecSizes"),o=await this.makeRequest(a,{params:{bikeModelSpecId:e,bikeSpec:t,year:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_generic GetFrameSizes",logError:o.error}}async getBikes(e,t,r){if(e&&(t||r)){const a=this.getEndpoint("bikeSpecs"),o=await this.makeRequest(a,{params:{bikeModelSpecId:e,bikeSpec:t,year:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_generic GetBikes",logError:o.error}}else return{success:!1,error:"error_generic GetBikes"}}async getBrandProductCategories(e){if(e){const t=this.getEndpoint("bikeBrandProductCategories"),r=await this.makeRequest(t,{params:{bikeBrandId:e}});return r.success?{data:r.data,success:!0}:(console.error(r.error),{success:!1,error:"error_generic GetBrandProductCategories",logError:r.error})}else return{success:!1,error:"error_generic GetBrandProductCategories"}}async checkSkuCompatibility(e,t,r){if(e&&t){const a=this.getEndpoint("checkSku")+`/${e}/${t}/${r}`,o=await this.makeRequest(a);return o.success?{success:o.success,data:o.data}:{success:o.success,error:"error_generic CheckSkuCompatibility",logError:o.error}}else return{success:!1,error:"error_generic CheckSkuCompatibility"}}async checkSkusCompatibility(e,t,r){if(e&&t){const a=this.getEndpoint("checkSkus")+`/${e}/${t}/${r}`,o=await this.makeRequest(a);return o.success?{data:o.data,success:o.success,logError:o.error}:{success:o.success,error:"error_generic CheckSkusCompatibility",logError:o.error}}else return{success:!1,error:"error_generic CheckSkusCompatibility"}}async checkSkusCompatibilityWithResults(e,t,r,a={}){if(e&&t){const o=this.getEndpoint("checkSkusWithResults")+`/${e}/${r}`,n=await this.makeRequest(o,{body:JSON.stringify(t),method:"POST",headers:{"Content-Type":"application/json"},...a});return n.success?{data:n.data,success:n.success}:{success:n.success,error:"error_compatiblelist",logError:n.error}}else return{success:!1,error:"error_compatiblelist"}}async getActiveSubscription(e){if(this._apiType!=="shopify"){e({activeSubscription:!0});return}var t="activeSubscription";const r=await this.makeRequest(t);if(!r.success){console.log(`getActiveSubscription Error: ${r.error}`);return}e(r.data)}async getBikeBom(e){if(!e)return{success:!1,error:"error_generic getBikeBom"};const t=this.getEndpoint("bikeBom"),r=await this.makeRequest(t,{params:{bikeKey:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_get_bike_bom",logError:r.error}}async addCustomBike(e){if(!e)return{success:!1,error:"error_generic addCustomBike"};const t=this.getEndpoint("customBike"),r=await this.makeRequest(t,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e}});return r.success?{data:r.data,success:r.success}:{success:r.success,error:"error_add_custom_bike",logError:r.error}}async findProducts(e,t){if(!e)return{success:!1,error:"error_generic findProducts"};const r=this.getEndpoint("findProducts"),a=await this.makeRequest(r,{params:{search:e,productCategoryId:t,recordCount:500}});return a.success?{data:a.data,success:a.success}:{success:a.success,error:"error_find_products",logError:a.error}}async addComponent(e,t,r,a){if(!e||!t||!r||!a)return{success:!1,error:"error_generic addComponent"};const o=this.getEndpoint("addComponent"),n=await this.makeRequest(o,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t,productId:r,bikeFieldName:a}});return n.success?{data:n.data,success:n.success}:{success:n.success,error:"error_add_component",logError:n.error}}async removeComponent(e,t,r){if(!e||!t||!r)return{success:!1,error:"error_generic removeComponent"};const a=this.getEndpoint("removeComponent"),o=await this.makeRequest(a,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t,bikeFieldName:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_remove_component",logError:o.error}}async revertComponent(e,t,r){if(!e||!t||!r)return{success:!1,error:"error_generic revertComponent"};const a=this.getEndpoint("revertComponent"),o=await this.makeRequest(a,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t,bikeFieldName:r}});return o.success?{data:o.data,success:o.success}:{success:o.success,error:"error_revert_component",logError:o.error}}async saveCustomBike(e,t){if(!e||!t)return{success:!1,error:"error_generic saveCustomBike"};const r=this.getEndpoint("saveCustomBike"),a=await this.makeRequest(r,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,email:t}});return a.success?{data:a.data,success:a.success}:{success:a.success,error:"error_save_custom_bike",logError:a.error}}async updateCustomBike(e,t){if(!e||!t)return{success:!1,error:"error_generic saveCustomBike"};const r=this.getEndpoint("updateCustomBike"),a=await this.makeRequest(r,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,productCategoryId:t}});return a.success?{data:a.data,success:a.success}:{success:a.success,error:"error_update_custom_bike"}}async updateCustomBikeName(e,t){if(!e||!t)return{success:!1,error:"error_generic updateCustomBikeName"};const r=this.getEndpoint("updateCustomBikeName"),a=await this.makeRequest(r,{method:"POST",headers:{"Content-Type":"application/json"},params:{bikeKey:e,name:t}});return a.success?{data:a.data,success:a.success}:{success:a.success,error:"error_update_custom_bike_name",logError:a.error}}async makeRequest(e,t={}){const r=new URL(e,this._apiUrl),a={"Cache-Control":"no-cache",...this._apiKey&&{"bm-subscription-key":this._apiKey},...this._apiToken&&{"bm-app-token":this._apiToken}};typeof t.params=="object"&&(Object.keys(t.params).forEach(n=>{t.params[n]&&r.searchParams.set(n,t.params[n])}),delete t.params);let o;try{const n={...a,...t.headers||{}},s={...t,headers:n};t.signal&&(s.signal=t.signal);const l=await fetch(r==null?void 0:r.href,s),c=await l.json().catch(()=>{throw new Error("Request failed: "+(l.statusText||"Status"+l.status))});c.status===400||c.statusCode===404?o={success:!1,data:c}:o={success:!0,data:c}}catch(n){o={success:!1,error:n.message}}return o}}async function fs(i){var f;const{categories:e,collections:t,apiUrl:r,apiKey:a,apiToken:o,isShopify:n,logLevel:s}=window.BikeMatrix.getConfig(),l=JSON.parse(sessionStorage.getItem("bm_categories")||"null"),c=JSON.parse(localStorage.getItem(Ia)||"null"),u=new Se(r,a,o,n);let d=[];if(s==="verbose"&&console.log("useCompatibleCollections sessionCollections",l),!l||!(l!=null&&l.collections)||!(l!=null&&l.collections.length)||(l==null?void 0:l.key)!==(c==null?void 0:c.key)){s==="verbose"&&console.log("useCompatibleCollections fetching new collections");const h=await u.getBrandProductCategories(i);if(s==="verbose"&&console.log("useCompatibleCollections bikeBrandProductCategories",h),!h.success)return console.log(h),s==="verbose"&&console.error(h.error),d={error:h.error},d;if(s==="verbose"&&(console.log("useCompatibleCollections categories",e),console.log("useCompatibleCollections collections",t)),((f=h.data)==null?void 0:f.length)>0){let b=e.filter(m=>{var y;return!!m.collection&&((y=h==null?void 0:h.data)==null?void 0:y.some(v=>v.product_Category.toLowerCase()===m.title.toLowerCase()))});s==="verbose"&&console.log("useCompatibleCollections availableCategories",b),d=b.map(m=>t.filter(v=>m.collection.split(",").map(g=>g.trim().toLowerCase()).includes(v.title.toLowerCase())).map(v=>({title:v.title,text_id:m.text_id,handle:v.handle,url:v.url}))).flat(),s==="verbose"&&console.log("useCompatibleCollections compatibleCollections",d),d=d==null?void 0:d.filter((m,y,v)=>y===v.findIndex(g=>g.title===m.title&&g.text_id===m.text_id&&g.handle===m.handle&&g.url===m.url))}sessionStorage.setItem("bm_categories",JSON.stringify({key:c==null?void 0:c.key,collections:d})),s==="verbose"&&console.log("useCompatibleCollections fetched collections",d)}else s==="verbose"&&console.log("useCompatibleCollections using session collections"),d=l.collections;return d}const hs=class _i{constructor(){this.initialized=!1,this.compatibleListInitialized=!1,this.currentBike=null,this.activeSubscription=null,this.components=[],this.config=as}async initialize(e){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: initialize() called"),this.components=[],this.initialized&&this.cleanup(),e&&(this.config={...this.config,...e}),this.initializeConfig(),this.service=new Se(this.config.apiUrl,this.config.apiKey,this.config.apiToken,this.config.isShopify),this.initializeActiveSubscription(),localStorage.bm_currentBike&&(this.currentBike=JSON.parse(localStorage.bm_currentBike)),this.setupEventListeners(),this.registerComponents(),this.initialized=!0,Ra.value=!0;const t=new Event("BM:Initialized");document.dispatchEvent(t),(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&(console.log("Core: BikeMatrix WebComponent Version: 1.3.3"),console.log("Core: BikeMatrixCore initialized"))}static getInstance(){return _i.instance||(_i.instance=new _i),_i.instance}registerComponents(){const e=["bikematrix-bikeselector","bikematrix-productresult","bikematrix-collectionresult","bikematrix-compatibilitylabel","bikematrix-compatiblelist","bikematrix-bikeselectorbanner","bikematrix-variantselector"];this.components=[],e.forEach(t=>{const r=document.getElementsByTagName(t);Array.from(r).forEach(a=>{this.components.push(a)})}),(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log(`Core: Registered ${this.components.length} components`)}resetComponents(){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: resetComponents() called"),this.components.forEach(e=>{var t;try{const r=e.cloneNode(!1);e.querySelectorAll("template").forEach(o=>{r.appendChild(o.cloneNode(!0))}),(t=e.parentNode)==null||t.replaceChild(r,e)}catch{console.error("Core: Error resetting component",e)}})}isInitialized(){return this.initialized}updateConfig(e){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: updateConfig() called"),this.config={...this.config,...e},this.reload(!1)}cleanup(){this.removeEventListeners(),id()}async destroy(){this.cleanup(),this.service=null,this.currentBike=null,this.activeSubscription=null,this.config={...as},this.initialized=!1,Ra.value=!1,this.resetComponents()}updateCompatibleList(e=!0){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: updateCompatibleList showCompatibleList: ",e),this.config.showCompatibleList=e,this.initializeConfig(),e&&(De.value=!0,this.RefreshCompatibleSkus(!0)),this.compatibleListInitialized=!0}refresh(){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: refresh() called"),this.ChangeBike()}reset(){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: reset() called"),this.destroy(),this.initialize()}reload(e=!0){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: reload() called. shouldReloadConfig: ",e),e&&this.initializeConfig(),this.refresh(),this.registerComponents(),this.resetComponents()}initializeConfig(){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: initializeConfig called");const e=document.querySelectorAll('script[type="application/json"][data-bikematrix-config]'),t=JSON.parse(sessionStorage.getItem("bm_diagnostics"));e.forEach(r=>{if(r!=null&&r.textContent)try{this.config={...this.config,...JSON.parse(r.textContent)}}catch{console.error("Core: Invalid BikeMatrix configuration"),console.log("Core: configScript ",r.textContent)}}),this.config.showCompatibleList&&!this.config.delayCompatibleListInitialization?this.compatibleListInitialized=!0:this.config.showCompatibleList&&this.config.delayCompatibleListInitialization&&!this.compatibleListInitialized&&(De.value=!0),t!=null&&t.includes("verbose")?this.config.logLevel="verbose":t!=null&&t.includes("core")&&(this.config.logLevel="core"),t!=null&&t.includes("virtualWorkshop")&&(this.config.virtualWorkshop=!0),t!=null&&t.includes("subscribtion")&&(this.activeSubscription=!0),t!=null&&t.includes("all")&&(this.config.logLevel="verbose",this.config.virtualWorkshop=!0,this.activeSubscription=!0),this.config.logLevel==="verbose"&&console.log("initializeConfig ",JSON.stringify(this.config,null,2))}initializeActiveSubscription(){const e=sessionStorage.getItem("bm_activeSubscription");if((this.config.logLevel==="verbose"||this.config.logLevel==="core")&&(console.log("Core: Not Shopify: ",!this.config.isShopify),console.log("Core: Session Active Subscription: ",e),console.log("Core: Design Mode: ",this.config.designMode)),!this.config.isShopify){this.activeSubscription=!0;return}this.activeSubscription=this.config.designMode||e==="true",e||this.service.getActiveSubscription(this.updateActiveSubscription.bind(this))}setupEventListeners(){document.addEventListener("BikeMatrix:RefreshCompatibleSkus",e=>{this.RefreshCompatibleSkus().then(()=>{document.dispatchEvent(new Event("RefreshCompatibility",{bubbles:!0,composed:!0}))})}),document.addEventListener("on:facet-filters:updated",this.handleRefreshCompatibleSkus.bind(this)),document.addEventListener("BikeChanging",this.handleBikeChanging.bind(this))}removeEventListeners(){document.removeEventListener("BikeMatrix:RefreshCompatibleSkus",this.handleRefreshCompatibleSkus),document.removeEventListener("on:facet-filters:updated",this.handleRefreshCompatibleSkus),document.removeEventListener("BikeChanging",this.handleBikeChanging)}async handleRefreshCompatibleSkus(e){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: Listener RefreshCompatibleSkus ..."),this.RefreshCompatibleSkus().then(()=>{document.dispatchEvent(new Event("RefreshCompatibility",{bubbles:!0,composed:!0}))})}async handleBikeChanging(e){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: Listener BikeChanging (pre) ..."),this.ChangeBike()}getConfig(){return this.config}getActiveSubscription(){return this.activeSubscription}getCurrentBike(){return this.currentBike}updateSku(e){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: updateSku() called with sku: ",e);const t=document.querySelector("bikematrix-productresult[data-sku]"),r=document.querySelector("bikematrix-variantselector[data-sku]");t&&t.setAttribute("data-sku",e),r&&r.setAttribute("data-sku",e),this.config.sku=e}ResetSelectedBikeIndicator(){var e,t;(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: ResetSelectedBikeIndicator() Method Called"),this.currentBike===null?(e=window.bm_selectBikeButton)==null||e.classList.remove("show-selected"):(t=window.bm_selectBikeButton)==null||t.classList.add("show-selected")}ChangeBike(){if((this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: ChangeBike() Method Called"),fr.value===!0||Ze.value===!0){console.log("Core: ChangeBike loading, return");return}fr.value=!0,De.value=!0,Ze.value=!0,pr.value=[],hr.value=[],(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: ChangeBike updateBikeSignal..."),this.updateBikeSignal().then(()=>{this.config.logLevel==="verbose"?console.log("Core: Bike Signal Updated: ",JSON.stringify(Y.value,null,2)):this.config.logLevel==="core"&&console.log("Core: Bike Signal Updated"),this.ResetSelectedBikeIndicator(),this.RefreshCompatibleSkus().then(()=>{document.dispatchEvent(new Event("RefreshCompatibility",{bubbles:!0,composed:!0})),document.dispatchEvent(new Event("BikeChanged",{bubbles:!0,composed:!0}))})})}async RefreshCompatibleSkus(e=!1){var r,a;const t=`${(r=Y.value)==null?void 0:r.key}:${this.config.currentCollectionHandle}:${ad}`;switch((this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: RefreshCompatibleSkus() called. Current Collection Bike Key: ",t),this.config.pageType){case"collection":const o=!!Y.value&&!Y.value.compatibleCollections.error&&((a=Y.value.compatibleCollections)==null?void 0:a.some(s=>s.handle===this.config.currentCollectionHandle)),n=this.config.showCompatibleList&&(this.compatibleListInitialized||e);(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: RefreshCompatibleSkus. hasCompatibleCollection: ",o," showCompatibleList: ",this.config.showCompatibleList," compatibleListInitialized: ",this.compatibleListInitialized," CompatibleListLoadingSignal: ",De.value," onlyCompatibleList: ",e," delayCompatibleListInitialization: ",this.config.delayCompatibleListInitialization," shouldRefreshCompatibleListSkus: ",n),o&&(e||await this.RefreshCollectionPageSkus(t),n&&((this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: RefreshCompatibleSkus refreshing compatible list skus for collection page..."),await this.RefreshCollectionListSkus(t))),fr.value=!1,Ze.value=!1,n&&(De.value=!1);break;case"search":case"index":fr.value=!1,De.value=!1,(this.config.pageType==="index"&&this.config.showHomePageCollection||this.config.pageType==="search"&&this.config.showSearchPageCollection)&&await this.RefreshCollectionPageSkus(t),Ze.value=!1;break;default:fr.value=!1,De.value=!1,Ze.value=!1;break}}async RefreshCollectionPageSkus(e){var n,s;let t=document.getElementsByTagName("bikematrix-collectionresult"),a=Array.from(t).map(l=>{const c=this.config.skuField==="barcode"?l.getAttribute("data-product-barcodes"):this.config.skuField==="metafield"?l.getAttribute("data-product-metafields"):l.getAttribute("data-product-skus")||"";return c==null?void 0:c.split(",").filter(u=>!!u)}).flat();this.config.logLevel==="verbose"&&console.log("Refresh Collection Page SKUs. SKUs: ",JSON.stringify(a),null,2);var o=((n=cr())==null?void 0:n.language)||"en-GB";if(a&&a.length>0){const l=await this.service.checkSkusCompatibilityWithResults((s=Y.value)==null?void 0:s.key,a,o);l.success?hr.value=l.data:(zi.value=!0,this.config.logLevel==="verbose"&&console.log("Compatible List Error: ",l.logError))}else hr.value=[]}async RefreshCollectionListSkus(e){var a,o;var t=JSON.parse(sessionStorage.getItem(e));if(t)this.config.logLevel==="verbose"&&console.log("Refresh Collection SKUs from Session: ",JSON.stringify(t),null,2),pr.value=t;else{const n=Object.values(this.config.products||{}).map(u=>u.skus).flat();this.config.logLevel==="verbose"&&console.log("Refresh Collection SKUs from API. SKUs: ",JSON.stringify(n),null,2);var r=((a=cr())==null?void 0:a.language)||"en-GB";const s=new AbortController,l=s.signal,c=()=>s.abort();window.addEventListener("beforeunload",c);try{if(!((o=Y.value)!=null&&o.key))throw new Error("BikeSignal key is undefined");const u=await this.service.checkSkusCompatibilityWithResults(Y.value.key,n,r,{signal:l});if(this.config.logLevel==="verbose"&&console.log("Refresh Collection SKUs from API. SKUs: ",JSON.stringify(u)),l.aborted){this.config.logLevel==="verbose"&&console.log("function RefreshCompatibleSkus() operation aborted");return}u.success?(sessionStorage.setItem(e,JSON.stringify(u.data)),pr.value=u.data):(zi.value=!0,this.config.logLevel==="verbose"&&console.log("Compatible List Error: ",u.logError))}catch(u){u.name==="AbortError"?console.log("function RefreshCompatibleSkus() fetch aborted"):console.error("function RefreshCompatibleSkus() fetch error",u)}finally{window.removeEventListener("beforeunload",c)}}}updateActiveSubscription(e){this.config.logLevel==="verbose"&&console.log("updateActiveSubscription data: ",e);const t=!!(e!=null&&e.activeSubscription);sessionStorage.setItem("bm_activeSubscription",JSON.stringify(t)),this.activeSubscription=t}async updateBikeSignal(){(this.config.logLevel==="verbose"||this.config.logLevel==="core")&&console.log("Core: updateBikeSignal() called");const e=localStorage.getItem(Ia)||"null",t=JSON.parse(e);if(this.currentBike=t,t==null){Y.value=null;return}const r=await fs(t==null?void 0:t.brandId);!Array.isArray(r)&&r.error?(t.compatibleCollections=[],Y.value=t):(t.compatibleCollections=r,Y.value=t),this.config.logLevel==="verbose"?console.log("Core: Bike Changed: ",JSON.stringify(Y.value,null,2)):this.config.logLevel==="core"&&console.log("Core: Bike Changed")}};hs.instance=null;let jd=hs;const Gr=i=>j("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},j("path",{d:"M1.53553 8.60658L5.07107 5.07104M5.07107 5.07104L8.6066 1.53551M5.07107 5.07104L8.6066 8.60658M5.07107 5.07104L1.53553 1.53551",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})),qd=`:host .overlay{opacity:0;visibility:hidden}@media (min-width: 640px){:host .modal{opacity:0;transform:scale(.9);visibility:hidden}}@media not all and (min-width: 640px){:host .modal{transform:translateY(100%);visibility:hidden}}
2
2
  `;function gt(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function gs(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}/*!
3
3
  * GSAP 3.12.7
4
4
  * https://gsap.com
@@ -16,7 +16,7 @@ var BikeMatrix=function(){"use strict";var Rr,G,an,on,Vt,nn,sn,fa,ln,Ir={},cn=[]
16
16
  * Club GSAP members, the agreement issued with that membership.
17
17
  * @author: Jack Doyle, jack@greensock.com
18
18
  */var ul,Nt,Cr,vo,Zt,dl,yo,Fp=function(){return typeof window<"u"},bt={},Jt=180/Math.PI,Ar=Math.PI/180,Dr=Math.atan2,pl=1e8,ko=/([A-Z])/g,Mp=/(left|right|width|margin|padding|x)/i,Np=/[\s,\(]\S/,ot={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},wo=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Rp=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Ip=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},Op=function(e,t){var r=t.s+t.c*e;t.set(t.t,t.p,~~(r+(r<0?-.5:.5))+t.u,t)},fl=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},hl=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},jp=function(e,t,r){return e.style[t]=r},qp=function(e,t,r){return e.style.setProperty(t,r)},Vp=function(e,t,r){return e._gsap[t]=r},Up=function(e,t,r){return e._gsap.scaleX=e._gsap.scaleY=r},$p=function(e,t,r,a,o){var n=e._gsap;n.scaleX=n.scaleY=r,n.renderTransform(o,n)},Hp=function(e,t,r,a,o){var n=e._gsap;n[t]=r,n.renderTransform(o,n)},ce="transform",Me=ce+"Origin",Gp=function i(e,t){var r=this,a=this.target,o=a.style,n=a._gsap;if(e in bt&&o){if(this.tfm=this.tfm||{},e!=="transform")e=ot[e]||e,~e.indexOf(",")?e.split(",").forEach(function(s){return r.tfm[s]=_t(a,s)}):this.tfm[e]=n.x?n[e]:_t(a,e),e===Me&&(this.tfm.zOrigin=n.zOrigin);else return ot.transform.split(",").forEach(function(s){return i.call(r,s,t)});if(this.props.indexOf(ce)>=0)return;n.svg&&(this.svgo=a.getAttribute("data-svg-origin"),this.props.push(Me,t,"")),e=ce}(o||t)&&this.props.push(e,t,o[e])},gl=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},Kp=function(){var e=this.props,t=this.target,r=t.style,a=t._gsap,o,n;for(o=0;o<e.length;o+=3)e[o+1]?e[o+1]===2?t[e[o]](e[o+2]):t[e[o]]=e[o+2]:e[o+2]?r[e[o]]=e[o+2]:r.removeProperty(e[o].substr(0,2)==="--"?e[o]:e[o].replace(ko,"-$1").toLowerCase());if(this.tfm){for(n in this.tfm)a[n]=this.tfm[n];a.svg&&(a.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),o=yo(),(!o||!o.isStart)&&!r[ce]&&(gl(r),a.zOrigin&&r[Me]&&(r[Me]+=" "+a.zOrigin+"px",a.zOrigin=0,a.renderTransform()),a.uncache=1)}},ml=function(e,t){var r={target:e,props:[],revert:Kp,save:Gp};return e._gsap||Fe.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(a){return r.save(a)}),r},bl,xo=function(e,t){var r=Nt.createElementNS?Nt.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Nt.createElement(e);return r&&r.style?r:Nt.createElement(e)},nt=function i(e,t,r){var a=getComputedStyle(e);return a[t]||a.getPropertyValue(t.replace(ko,"-$1").toLowerCase())||a.getPropertyValue(t)||!r&&i(e,Sr(t)||t,1)||""},_l="O,Moz,ms,Ms,Webkit".split(","),Sr=function(e,t,r){var a=t||Zt,o=a.style,n=5;if(e in o&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);n--&&!(_l[n]+e in o););return n<0?null:(n===3?"ms":n>=0?_l[n]:"")+e},Co=function(){Fp()&&window.document&&(ul=window,Nt=ul.document,Cr=Nt.documentElement,Zt=xo("div")||{style:{}},xo("div"),ce=Sr(ce),Me=ce+"Origin",Zt.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",bl=!!Sr("perspective"),yo=Fe.core.reverting,vo=1)},vl=function(e){var t=e.ownerSVGElement,r=xo("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),a=e.cloneNode(!0),o;a.style.display="block",r.appendChild(a),Cr.appendChild(r);try{o=a.getBBox()}catch{}return r.removeChild(a),Cr.removeChild(r),o},yl=function(e,t){for(var r=t.length;r--;)if(e.hasAttribute(t[r]))return e.getAttribute(t[r])},kl=function(e){var t,r;try{t=e.getBBox()}catch{t=vl(e),r=1}return t&&(t.width||t.height)||r||(t=vl(e)),t&&!t.width&&!t.x&&!t.y?{x:+yl(e,["x","cx","x1"])||0,y:+yl(e,["y","cy","y1"])||0,width:0,height:0}:t},wl=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&kl(e))},Xt=function(e,t){if(t){var r=e.style,a;t in bt&&t!==Me&&(t=ce),r.removeProperty?(a=t.substr(0,2),(a==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),r.removeProperty(a==="--"?t:t.replace(ko,"-$1").toLowerCase())):r.removeAttribute(t)}},Rt=function(e,t,r,a,o,n){var s=new Pe(e._pt,t,r,0,1,n?hl:fl);return e._pt=s,s.b=a,s.e=o,e._props.push(r),s},xl={deg:1,rad:1,turn:1},Wp={grid:1,flex:1},It=function i(e,t,r,a){var o=parseFloat(r)||0,n=(r+"").trim().substr((o+"").length)||"px",s=Zt.style,l=Mp.test(t),c=e.tagName.toLowerCase()==="svg",u=(c?"client":"offset")+(l?"Width":"Height"),d=100,f=a==="px",h=a==="%",b,m,y,v;if(a===n||!o||xl[a]||xl[n])return o;if(n!=="px"&&!f&&(o=i(e,t,r,"px")),v=e.getCTM&&wl(e),(h||n==="%")&&(bt[t]||~t.indexOf("adius")))return b=v?e.getBBox()[l?"width":"height"]:e[u],pe(h?o/b*d:o/100*b);if(s[l?"width":"height"]=d+(f?n:a),m=a!=="rem"&&~t.indexOf("adius")||a==="em"&&e.appendChild&&!c?e:e.parentNode,v&&(m=(e.ownerSVGElement||{}).parentNode),(!m||m===Nt||!m.appendChild)&&(m=Nt.body),y=m._gsap,y&&h&&y.width&&l&&y.time===Ue.time&&!y.uncache)return pe(o/y.width*d);if(h&&(t==="height"||t==="width")){var g=e.style[t];e.style[t]=d+a,b=e[u],g?e.style[t]=g:Xt(e,t)}else(h||n==="%")&&!Wp[nt(m,"display")]&&(s.position=nt(e,"position")),m===e&&(s.position="static"),m.appendChild(Zt),b=Zt[u],m.removeChild(Zt),s.position="absolute";return l&&h&&(y=Ht(m),y.time=Ue.time,y.width=m[u]),pe(f?b*o/d:b&&o?d/b*o:0)},_t=function(e,t,r,a){var o;return vo||Co(),t in ot&&t!=="transform"&&(t=ot[t],~t.indexOf(",")&&(t=t.split(",")[0])),bt[t]&&t!=="transform"?(o=oi(e,a),o=t!=="transformOrigin"?o[t]:o.svg?o.origin:Gi(nt(e,Me))+" "+o.zOrigin+"px"):(o=e.style[t],(!o||o==="auto"||a||~(o+"").indexOf("calc("))&&(o=Hi[t]&&Hi[t](e,t,r)||nt(e,t)||Ds(e,t)||(t==="opacity"?1:0))),r&&!~(o+"").trim().indexOf(" ")?It(e,t,o,r)+r:o},Yp=function(e,t,r,a){if(!r||r==="none"){var o=Sr(t,e,1),n=o&&nt(e,o,1);n&&n!==r?(t=o,r=n):t==="borderColor"&&(r=nt(e,"borderTopColor"))}var s=new Pe(this._pt,e.style,t,0,1,nl),l=0,c=0,u,d,f,h,b,m,y,v,g,_,k,w;if(s.b=r,s.e=a,r+="",a+="",a==="auto"&&(m=e.style[t],e.style[t]=a,a=nt(e,t)||a,m?e.style[t]=m:Xt(e,t)),u=[r,a],Zs(u),r=u[0],a=u[1],f=r.match(br)||[],w=a.match(br)||[],w.length){for(;d=br.exec(a);)y=d[0],g=a.substring(l,d.index),b?b=(b+1)%5:(g.substr(-5)==="rgba("||g.substr(-5)==="hsla(")&&(b=1),y!==(m=f[c++]||"")&&(h=parseFloat(m)||0,k=m.substr((h+"").length),y.charAt(1)==="="&&(y=_r(h,y)+k),v=parseFloat(y),_=y.substr((v+"").length),l=br.lastIndex-_.length,_||(_=_||Ie.units[t]||k,l===a.length&&(a+=_,s.e+=_)),k!==_&&(h=It(e,t,m,_)||0),s._pt={_next:s._pt,p:g||c===1?g:",",s:h,c:v-h,m:b&&b<4||t==="zIndex"?Math.round:0});s.c=l<a.length?a.substring(l,a.length):""}else s.r=t==="display"&&a==="none"?hl:fl;return vs.test(a)&&(s.e=0),this._pt=s,s},Cl={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Zp=function(e){var t=e.split(" "),r=t[0],a=t[1]||"50%";return(r==="top"||r==="bottom"||a==="left"||a==="right")&&(e=r,r=a,a=e),t[0]=Cl[r]||r,t[1]=Cl[a]||a,t.join(" ")},Jp=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var r=t.t,a=r.style,o=t.u,n=r._gsap,s,l,c;if(o==="all"||o===!0)a.cssText="",l=1;else for(o=o.split(","),c=o.length;--c>-1;)s=o[c],bt[s]&&(l=1,s=s==="transformOrigin"?Me:ce),Xt(r,s);l&&(Xt(r,ce),n&&(n.svg&&r.removeAttribute("transform"),a.scale=a.rotate=a.translate="none",oi(r,1),n.uncache=1,gl(a)))}},Hi={clearProps:function(e,t,r,a,o){if(o.data!=="isFromStart"){var n=e._pt=new Pe(e._pt,t,r,0,0,Jp);return n.u=a,n.pr=-10,n.tween=o,e._props.push(r),1}}},ai=[1,0,0,1,0,0],Al={},Dl=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},Sl=function(e){var t=nt(e,ce);return Dl(t)?ai:t.substr(7).match(_s).map(pe)},Ao=function(e,t){var r=e._gsap||Ht(e),a=e.style,o=Sl(e),n,s,l,c;return r.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,o=[l.a,l.b,l.c,l.d,l.e,l.f],o.join(",")==="1,0,0,1,0,0"?ai:o):(o===ai&&!e.offsetParent&&e!==Cr&&!r.svg&&(l=a.display,a.display="block",n=e.parentNode,(!n||!e.offsetParent&&!e.getBoundingClientRect().width)&&(c=1,s=e.nextElementSibling,Cr.appendChild(e)),o=Sl(e),l?a.display=l:Xt(e,"display"),c&&(s?n.insertBefore(e,s):n?n.appendChild(e):Cr.removeChild(e))),t&&o.length>6?[o[0],o[1],o[4],o[5],o[12],o[13]]:o)},Do=function(e,t,r,a,o,n){var s=e._gsap,l=o||Ao(e,!0),c=s.xOrigin||0,u=s.yOrigin||0,d=s.xOffset||0,f=s.yOffset||0,h=l[0],b=l[1],m=l[2],y=l[3],v=l[4],g=l[5],_=t.split(" "),k=parseFloat(_[0])||0,w=parseFloat(_[1])||0,C,A,D,x;r?l!==ai&&(A=h*y-b*m)&&(D=k*(y/A)+w*(-m/A)+(m*g-y*v)/A,x=k*(-b/A)+w*(h/A)-(h*g-b*v)/A,k=D,w=x):(C=kl(e),k=C.x+(~_[0].indexOf("%")?k/100*C.width:k),w=C.y+(~(_[1]||_[0]).indexOf("%")?w/100*C.height:w)),a||a!==!1&&s.smooth?(v=k-c,g=w-u,s.xOffset=d+(v*h+g*m)-v,s.yOffset=f+(v*b+g*y)-g):s.xOffset=s.yOffset=0,s.xOrigin=k,s.yOrigin=w,s.smooth=!!a,s.origin=t,s.originIsAbsolute=!!r,e.style[Me]="0px 0px",n&&(Rt(n,s,"xOrigin",c,k),Rt(n,s,"yOrigin",u,w),Rt(n,s,"xOffset",d,s.xOffset),Rt(n,s,"yOffset",f,s.yOffset)),e.setAttribute("data-svg-origin",k+" "+w)},oi=function(e,t){var r=e._gsap||new el(e);if("x"in r&&!t&&!r.uncache)return r;var a=e.style,o=r.scaleX<0,n="px",s="deg",l=getComputedStyle(e),c=nt(e,Me)||"0",u,d,f,h,b,m,y,v,g,_,k,w,C,A,D,x,S,E,T,L,M,O,P,R,z,B,I,$,U,H,de,ge;return u=d=f=m=y=v=g=_=k=0,h=b=1,r.svg=!!(e.getCTM&&wl(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(a[ce]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[ce]!=="none"?l[ce]:"")),a.scale=a.rotate=a.translate="none"),A=Ao(e,r.svg),r.svg&&(r.uncache?(z=e.getBBox(),c=r.xOrigin-z.x+"px "+(r.yOrigin-z.y)+"px",R=""):R=!t&&e.getAttribute("data-svg-origin"),Do(e,R||c,!!R||r.originIsAbsolute,r.smooth!==!1,A)),w=r.xOrigin||0,C=r.yOrigin||0,A!==ai&&(E=A[0],T=A[1],L=A[2],M=A[3],u=O=A[4],d=P=A[5],A.length===6?(h=Math.sqrt(E*E+T*T),b=Math.sqrt(M*M+L*L),m=E||T?Dr(T,E)*Jt:0,g=L||M?Dr(L,M)*Jt+m:0,g&&(b*=Math.abs(Math.cos(g*Ar))),r.svg&&(u-=w-(w*E+C*L),d-=C-(w*T+C*M))):(ge=A[6],H=A[7],I=A[8],$=A[9],U=A[10],de=A[11],u=A[12],d=A[13],f=A[14],D=Dr(ge,U),y=D*Jt,D&&(x=Math.cos(-D),S=Math.sin(-D),R=O*x+I*S,z=P*x+$*S,B=ge*x+U*S,I=O*-S+I*x,$=P*-S+$*x,U=ge*-S+U*x,de=H*-S+de*x,O=R,P=z,ge=B),D=Dr(-L,U),v=D*Jt,D&&(x=Math.cos(-D),S=Math.sin(-D),R=E*x-I*S,z=T*x-$*S,B=L*x-U*S,de=M*S+de*x,E=R,T=z,L=B),D=Dr(T,E),m=D*Jt,D&&(x=Math.cos(D),S=Math.sin(D),R=E*x+T*S,z=O*x+P*S,T=T*x-E*S,P=P*x-O*S,E=R,O=z),y&&Math.abs(y)+Math.abs(m)>359.9&&(y=m=0,v=180-v),h=pe(Math.sqrt(E*E+T*T+L*L)),b=pe(Math.sqrt(P*P+ge*ge)),D=Dr(O,P),g=Math.abs(D)>2e-4?D*Jt:0,k=de?1/(de<0?-de:de):0),r.svg&&(R=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!Dl(nt(e,ce)),R&&e.setAttribute("transform",R))),Math.abs(g)>90&&Math.abs(g)<270&&(o?(h*=-1,g+=m<=0?180:-180,m+=m<=0?180:-180):(b*=-1,g+=g<=0?180:-180)),t=t||r.uncache,r.x=u-((r.xPercent=u&&(!t&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-u)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+n,r.y=d-((r.yPercent=d&&(!t&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-d)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+n,r.z=f+n,r.scaleX=pe(h),r.scaleY=pe(b),r.rotation=pe(m)+s,r.rotationX=pe(y)+s,r.rotationY=pe(v)+s,r.skewX=g+s,r.skewY=_+s,r.transformPerspective=k+n,(r.zOrigin=parseFloat(c.split(" ")[2])||!t&&r.zOrigin||0)&&(a[Me]=Gi(c)),r.xOffset=r.yOffset=0,r.force3D=Ie.force3D,r.renderTransform=r.svg?Qp:bl?El:Xp,r.uncache=0,r},Gi=function(e){return(e=e.split(" "))[0]+" "+e[1]},So=function(e,t,r){var a=Ce(t);return pe(parseFloat(t)+parseFloat(It(e,"x",r+"px",a)))+a},Xp=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,El(e,t)},Qt="0deg",ni="0px",er=") ",El=function(e,t){var r=t||this,a=r.xPercent,o=r.yPercent,n=r.x,s=r.y,l=r.z,c=r.rotation,u=r.rotationY,d=r.rotationX,f=r.skewX,h=r.skewY,b=r.scaleX,m=r.scaleY,y=r.transformPerspective,v=r.force3D,g=r.target,_=r.zOrigin,k="",w=v==="auto"&&e&&e!==1||v===!0;if(_&&(d!==Qt||u!==Qt)){var C=parseFloat(u)*Ar,A=Math.sin(C),D=Math.cos(C),x;C=parseFloat(d)*Ar,x=Math.cos(C),n=So(g,n,A*x*-_),s=So(g,s,-Math.sin(C)*-_),l=So(g,l,D*x*-_+_)}y!==ni&&(k+="perspective("+y+er),(a||o)&&(k+="translate("+a+"%, "+o+"%) "),(w||n!==ni||s!==ni||l!==ni)&&(k+=l!==ni||w?"translate3d("+n+", "+s+", "+l+") ":"translate("+n+", "+s+er),c!==Qt&&(k+="rotate("+c+er),u!==Qt&&(k+="rotateY("+u+er),d!==Qt&&(k+="rotateX("+d+er),(f!==Qt||h!==Qt)&&(k+="skew("+f+", "+h+er),(b!==1||m!==1)&&(k+="scale("+b+", "+m+er),g.style[ce]=k||"translate(0, 0)"},Qp=function(e,t){var r=t||this,a=r.xPercent,o=r.yPercent,n=r.x,s=r.y,l=r.rotation,c=r.skewX,u=r.skewY,d=r.scaleX,f=r.scaleY,h=r.target,b=r.xOrigin,m=r.yOrigin,y=r.xOffset,v=r.yOffset,g=r.forceCSS,_=parseFloat(n),k=parseFloat(s),w,C,A,D,x;l=parseFloat(l),c=parseFloat(c),u=parseFloat(u),u&&(u=parseFloat(u),c+=u,l+=u),l||c?(l*=Ar,c*=Ar,w=Math.cos(l)*d,C=Math.sin(l)*d,A=Math.sin(l-c)*-f,D=Math.cos(l-c)*f,c&&(u*=Ar,x=Math.tan(c-u),x=Math.sqrt(1+x*x),A*=x,D*=x,u&&(x=Math.tan(u),x=Math.sqrt(1+x*x),w*=x,C*=x)),w=pe(w),C=pe(C),A=pe(A),D=pe(D)):(w=d,D=f,C=A=0),(_&&!~(n+"").indexOf("px")||k&&!~(s+"").indexOf("px"))&&(_=It(h,"x",n,"px"),k=It(h,"y",s,"px")),(b||m||y||v)&&(_=pe(_+b-(b*w+m*A)+y),k=pe(k+m-(b*C+m*D)+v)),(a||o)&&(x=h.getBBox(),_=pe(_+a/100*x.width),k=pe(k+o/100*x.height)),x="matrix("+w+","+C+","+A+","+D+","+_+","+k+")",h.setAttribute("transform",x),g&&(h.style[ce]=x)},ef=function(e,t,r,a,o){var n=360,s=_e(o),l=parseFloat(o)*(s&&~o.indexOf("rad")?Jt:1),c=l-a,u=a+c+"deg",d,f;return s&&(d=o.split("_")[1],d==="short"&&(c%=n,c!==c%(n/2)&&(c+=c<0?n:-n)),d==="cw"&&c<0?c=(c+n*pl)%n-~~(c/n)*n:d==="ccw"&&c>0&&(c=(c-n*pl)%n-~~(c/n)*n)),e._pt=f=new Pe(e._pt,t,r,a,c,Rp),f.e=u,f.u="deg",e._props.push(r),f},Bl=function(e,t){for(var r in t)e[r]=t[r];return e},tf=function(e,t,r){var a=Bl({},r._gsap),o="perspective,force3D,transformOrigin,svgOrigin",n=r.style,s,l,c,u,d,f,h,b;a.svg?(c=r.getAttribute("transform"),r.setAttribute("transform",""),n[ce]=t,s=oi(r,1),Xt(r,ce),r.setAttribute("transform",c)):(c=getComputedStyle(r)[ce],n[ce]=t,s=oi(r,1),n[ce]=c);for(l in bt)c=a[l],u=s[l],c!==u&&o.indexOf(l)<0&&(h=Ce(c),b=Ce(u),d=h!==b?It(r,l,c,b):parseFloat(c),f=parseFloat(u),e._pt=new Pe(e._pt,s,l,d,f-d,wo),e._pt.u=b||0,e._props.push(l));Bl(s,a)};Le("padding,margin,Width,Radius",function(i,e){var t="Top",r="Right",a="Bottom",o="Left",n=(e<3?[t,r,a,o]:[t+o,t+r,a+r,a+o]).map(function(s){return e<2?i+s:"border"+s+i});Hi[e>1?"border"+i:i]=function(s,l,c,u,d){var f,h;if(arguments.length<4)return f=n.map(function(b){return _t(s,b,c)}),h=f.join(" "),h.split(f[0]).length===5?f[0]:h;f=(u+"").split(" "),h={},n.forEach(function(b,m){return h[b]=f[m]=f[m]||f[(m-1)/2|0]}),s.init(l,h,d)}});var zl={name:"css",register:Co,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,r,a,o){var n=this._props,s=e.style,l=r.vars.startAt,c,u,d,f,h,b,m,y,v,g,_,k,w,C,A,D;vo||Co(),this.styles=this.styles||ml(e),D=this.styles.props,this.tween=r;for(m in t)if(m!=="autoRound"&&(u=t[m],!(je[m]&&tl(m,t,r,a,e,o)))){if(h=typeof u,b=Hi[m],h==="function"&&(u=u.call(r,a,e,o),h=typeof u),h==="string"&&~u.indexOf("random(")&&(u=Xr(u)),b)b(this,e,m,u,r)&&(A=1);else if(m.substr(0,2)==="--")c=(getComputedStyle(e).getPropertyValue(m)+"").trim(),u+="",Ft.lastIndex=0,Ft.test(c)||(y=Ce(c),v=Ce(u)),v?y!==v&&(c=It(e,m,c,v)+v):y&&(u+=y),this.add(s,"setProperty",c,u,a,o,0,0,m),n.push(m),D.push(m,0,s[m]);else if(h!=="undefined"){if(l&&m in l?(c=typeof l[m]=="function"?l[m].call(r,a,e,o):l[m],_e(c)&&~c.indexOf("random(")&&(c=Xr(c)),Ce(c+"")||c==="auto"||(c+=Ie.units[m]||Ce(_t(e,m))||""),(c+"").charAt(1)==="="&&(c=_t(e,m))):c=_t(e,m),f=parseFloat(c),g=h==="string"&&u.charAt(1)==="="&&u.substr(0,2),g&&(u=u.substr(2)),d=parseFloat(u),m in ot&&(m==="autoAlpha"&&(f===1&&_t(e,"visibility")==="hidden"&&d&&(f=0),D.push("visibility",0,s.visibility),Rt(this,s,"visibility",f?"inherit":"hidden",d?"inherit":"hidden",!d)),m!=="scale"&&m!=="transform"&&(m=ot[m],~m.indexOf(",")&&(m=m.split(",")[0]))),_=m in bt,_){if(this.styles.save(m),k||(w=e._gsap,w.renderTransform&&!t.parseTransform||oi(e,t.parseTransform),C=t.smoothOrigin!==!1&&w.smooth,k=this._pt=new Pe(this._pt,s,ce,0,1,w.renderTransform,w,0,-1),k.dep=1),m==="scale")this._pt=new Pe(this._pt,w,"scaleY",w.scaleY,(g?_r(w.scaleY,g+d):d)-w.scaleY||0,wo),this._pt.u=0,n.push("scaleY",m),m+="X";else if(m==="transformOrigin"){D.push(Me,0,s[Me]),u=Zp(u),w.svg?Do(e,u,0,C,0,this):(v=parseFloat(u.split(" ")[2])||0,v!==w.zOrigin&&Rt(this,w,"zOrigin",w.zOrigin,v),Rt(this,s,m,Gi(c),Gi(u)));continue}else if(m==="svgOrigin"){Do(e,u,1,C,0,this);continue}else if(m in Al){ef(this,w,m,f,g?_r(f,g+u):u);continue}else if(m==="smoothOrigin"){Rt(this,w,"smooth",w.smooth,u);continue}else if(m==="force3D"){w[m]=u;continue}else if(m==="transform"){tf(this,u,e);continue}}else m in s||(m=Sr(m)||m);if(_||(d||d===0)&&(f||f===0)&&!Np.test(u)&&m in s)y=(c+"").substr((f+"").length),d||(d=0),v=Ce(u)||(m in Ie.units?Ie.units[m]:y),y!==v&&(f=It(e,m,c,v)),this._pt=new Pe(this._pt,_?w:s,m,f,(g?_r(f,g+d):d)-f,!_&&(v==="px"||m==="zIndex")&&t.autoRound!==!1?Op:wo),this._pt.u=v||0,y!==v&&v!=="%"&&(this._pt.b=c,this._pt.r=Ip);else if(m in s)Yp.call(this,e,m,c,g?g+u:u);else if(m in e)this.add(e,m,c||e[m],g?g+u:u,a,o);else if(m!=="parseTransform"){Ya(m,u);continue}_||(m in s?D.push(m,0,s[m]):typeof e[m]=="function"?D.push(m,2,e[m]()):D.push(m,1,c||e[m])),n.push(m)}}A&&sl(this)},render:function(e,t){if(t.tween._time||!yo())for(var r=t._pt;r;)r.r(e,r.d),r=r._next;else t.styles.revert()},get:_t,aliases:ot,getSetter:function(e,t,r){var a=ot[t];return a&&a.indexOf(",")<0&&(t=a),t in bt&&t!==Me&&(e._gsap.x||_t(e,"x"))?r&&dl===r?t==="scale"?Up:Vp:(dl=r||{})&&(t==="scale"?$p:Hp):e.style&&!Ua(e.style[t])?jp:~t.indexOf("-")?qp:ho(e,t)},core:{_removeProperty:Xt,_getMatrix:Ao}};Fe.utils.checkPrefix=Sr,Fe.core.getStyleSaver=ml,function(i,e,t,r){var a=Le(i+","+e+","+t,function(o){bt[o]=1});Le(e,function(o){Ie.units[o]="deg",Al[o]=1}),ot[a[13]]=i+","+e,Le(r,function(o){var n=o.split(":");ot[n[1]]=a[n[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),Le("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(i){Ie.units[i]="px"}),Fe.registerPlugin(zl);var ee=Fe.registerPlugin(zl)||Fe;ee.core.Tween;var rf=0;function p(i,e,t,r,a,o){var n,s,l={};for(s in e)s=="ref"?n=e[s]:l[s]=e[s];var c={type:i,props:l,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--rf,__i:-1,__u:0,__source:a,__self:o};if(typeof i=="function"&&(n=i.defaultProps))for(s in n)l[s]===void 0&&(l[s]=n[s]);return G.vnode&&G.vnode(c),c}function Er(){document.dispatchEvent(new Event("BmToggleModal"))}function af({children:i}){const e=K(null),t=K(null),r=()=>{document.body.classList.toggle("bm-modal-active"),ft.value?ft.value&&(ee.to(e.current,{duration:.25,autoAlpha:0}),window.innerWidth>639?ee.to(t.current,{duration:.25,autoAlpha:0,transform:"scale(1)",onComplete:()=>ft.value=!1}):ee.to(t.current,{duration:.25,autoAlpha:0,transform:"translateY(100%)",onComplete:()=>ft.value=!1})):(ee.to(e.current,{duration:.25,autoAlpha:1}),window.innerWidth>639?ee.to(t.current,{duration:.25,autoAlpha:1,transform:"scale(1)",onComplete:()=>ft.value=!0}):ee.to(t.current,{duration:.25,autoAlpha:1,transform:"translateY(0%)",onComplete:()=>ft.value=!0}))};return V(()=>{const a=document.getElementById("bm_selectBikeButton");return document.addEventListener("BmToggleModal",r),a==null||a.addEventListener("click",r),()=>{document.removeEventListener("BmToggleModal",r),a==null||a.removeEventListener("click",r)}},[]),p(q,{children:[p("style",{type:"text/css",children:qd}),p("div",{onClick:()=>{Er()},class:Z("overlay","fixed cursor-pointer inset-0 z-[2147483645] bg-black/40 "),ref:e}),p("div",{className:Z("modal","fixed pointer-events-none inset-0 mx-auto justify-end z-[2147483646] flex flex-col items-center outline-none ","sm:justify-center"),ref:t,children:p("div",{className:"flex sm:px-2 pointer-events-auto max-sm:max-h-[96%] sm:max-h-[90%] max-sm:h-[89vh] max-w-lg sm:max-w-[640px] flex-col items-center max-sm:flex-1 w-full bg-white rounded-t-3xl sm:rounded-xl shadow-[0px_-2px_10px_0px_rgba(0,0,0,0.04),0px_0px_0px_1px_rgba(0,0,0,0.06)]",children:[p("div",{className:"sm:hidden mx-auto mt-4 h-[6px] w-[100px] rounded-full bg-gray-400/50",onClick:Er}),p("div",{className:"sm:hidden h-[10px]"}),p("div",{className:"relative flex flex-col w-full sm:h-full max-sm:flex-none max-sm:grow",children:p("div",{class:"modal-content max-sm:absolute sm:h-full max-sm:inset-0 overflow-x-hidden overflow-y-auto px-8 sm:px-6",children:i})})]})})]})}const Je=i=>j("svg",{width:7,height:12,viewBox:"0 0 7 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},j("path",{d:"M1 11L6 6L1 1",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),of=i=>j("svg",{width:31,height:31,viewBox:"0 0 31 31",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},j("circle",{cx:15.5,cy:15.5,r:15.5,fill:"#030712"}),j("path",{d:"M10.1974 17.1317L13.9955 20.4461L20.8639 10.8909",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),nf=i=>j("svg",{width:31,height:31,viewBox:"0 0 31 31",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},j("g",{clipPath:"url(#clip0_64_2)"},j("path",{d:"M30.5 15.5C30.5 23.7843 23.7843 30.5 15.5 30.5C7.21573 30.5 0.5 23.7843 0.5 15.5C0.5 7.21573 7.21573 0.5 15.5 0.5C23.7843 0.5 30.5 7.21573 30.5 15.5Z",fill:"white",stroke:"#D1D5DB"})),j("path",{d:"M23.983 11.132C23.9699 10.9806 23.8699 10.8506 23.727 10.7988C23.5837 10.7466 23.4233 10.7822 23.3155 10.8894L21.1098 13.0866L18.6647 12.3153L17.8905 9.87937L20.0961 7.68201C20.2041 7.57458 20.2393 7.41475 20.1873 7.27224C20.1348 7.12945 20.0046 7.02999 19.8524 7.01688C18.5129 6.9019 17.2004 7.37836 16.2514 8.32387C14.9518 9.61873 14.6076 11.5096 15.217 13.1213C15.1504 13.1773 15.0847 13.2365 15.0199 13.3004L7.65736 20.2216C7.65476 20.2241 7.6522 20.2268 7.64939 20.2293C6.78354 21.092 6.78354 22.4955 7.64939 23.3583C8.51539 24.2209 9.91396 24.2104 10.7797 23.3477C10.7834 23.3443 10.7868 23.3408 10.7902 23.3369L17.677 15.945C17.7398 15.8822 17.798 15.8165 17.853 15.749C19.4713 16.3573 21.3705 16.0152 22.6713 14.7195C23.62 13.7739 24.0986 12.4663 23.983 11.132ZM9.67019 22.4264C9.35113 22.7442 8.83439 22.744 8.51536 22.4264C8.19644 22.1089 8.19644 21.5937 8.51536 21.2761C8.83439 20.9585 9.35113 20.9585 9.67019 21.2761C9.98911 21.5937 9.98911 22.1089 9.67019 22.4264Z",fill:"black"}),j("defs",null,j("clipPath",{id:"clip0_64_2"},j("rect",{width:31,height:31,fill:"white"})))),sf=i=>j("svg",{width:31,height:31,viewBox:"0 0 46 46",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},j("path",{d:"M2 24.0437V22.6518C4.30404 21.9559 5.82929 20.347 6.17596 18.244C6.45967 16.523 5.87584 14.7802 4.66788 13.505L5.50401 12.1672C6.3441 12.2632 7.12499 12.2938 7.83019 12.2273C8.91308 12.1253 10.0603 11.7686 10.8965 10.814C11.7162 9.87828 11.9364 8.70751 11.9455 7.65019C11.9509 7.01984 11.882 6.33439 11.7615 5.60532L13.1089 4.93163C14.6862 6.27858 16.5967 7.00972 18.5085 6.50659C20.496 5.98355 21.7104 4.35171 22.2287 2.32023L23.4959 2.17943C23.7105 2.84427 23.9686 3.45839 24.2803 4.0055C24.8609 5.02453 25.7009 5.93317 26.8959 6.37534C28.1054 6.8229 29.35 6.6716 30.4872 6.21488C31.2478 5.9094 32.0092 5.4502 32.771 4.87155L33.84 5.40607C33.3102 7.17682 33.6407 8.97473 34.9205 10.3525C36.2854 11.8219 38.3837 12.4206 40.6053 12.1884L41.4091 13.3137C40.1484 14.904 39.5422 16.7943 40.0082 18.6621C40.4975 20.623 42.0098 21.9631 44 22.6091V23.6937C42.0295 24.646 40.407 25.9295 39.9934 27.9032C39.7449 29.089 40.0083 30.2272 40.4663 31.2395C40.7549 31.8775 41.1444 32.5183 41.6038 33.1622L41.0881 34.0648C39.1096 33.5569 37.1545 33.7409 35.7252 35.1442C34.3293 36.5148 34.0136 38.5186 34.2755 40.5318L32.7931 41.4583C31.191 40.0523 29.3504 39.2822 27.3831 40.0414C26.2841 40.4655 25.451 41.2846 24.816 42.1501C24.4114 42.7016 24.0463 43.3278 23.7127 44H22.6585C22.1786 42.2318 21.2165 40.6691 19.4091 40.0247C17.4936 39.3418 15.3888 40.0023 13.3765 41.2022L11.9877 40.5078C12.4255 38.6858 12.158 36.865 10.7918 35.5311C9.4171 34.1889 7.44044 33.8741 5.42929 34.2133L4.6584 32.9799C6.03869 31.6871 6.93069 30.0087 6.40539 28.071C6.07607 26.8563 5.24467 25.9088 4.25062 25.2068C3.60737 24.7526 2.85005 24.3664 2 24.0437Z",stroke:"black",strokeWidth:4}),j("circle",{cx:23,cy:23,r:12,stroke:"black",strokeWidth:4}),j("path",{d:"M23 39.75C32.2508 39.75 39.75 32.2508 39.75 23C39.75 13.7492 32.2508 6.25 23 6.25C13.7492 6.25 6.25 13.7492 6.25 23C6.25 32.2508 13.7492 39.75 23 39.75Z",stroke:"black",strokeWidth:3.5})),lf=`.shared-icon{background-color:#fba157;padding:5px 10px;border-radius:8px;font-size:12px;display:flex;justify-content:center;align-items:center;color:#fff}
19
- `,Tl=({text:i})=>p(q,{children:[p("style",{type:"text/css",children:lf}),p("div",{className:"shared-icon",children:p("p",{className:"text",children:i||"Shared with you"})})]});function Xe({spanner:i,selected:e,settings:t,simple:r,bike:a,compact:o,readOnly:n,onClick:s,shared:l,custom:c,noSymbol:u,...d}){var C;const f=(C=a.images)!=null&&C.length?a.images:[ze("bike.png")],h=K(null),[b,m]=F(0),y=K(null);V(()=>{const A=h==null?void 0:h.current;if(A){var D=new IntersectionObserver(function(x){var S=x.reduce(function(E,T){return T.intersectionRatio>E.intersectionRatio?T:E});S.intersectionRatio>0&&m(Number(S.target.getAttribute("data-slide")))},{root:A,threshold:.8});return A.querySelectorAll("&>div").forEach(x=>{D.observe(x)}),()=>{D.disconnect()}}},[h]);function v(A){if(!h.current)return;const D=h.current.querySelectorAll("&>div")[A];h.current.scrollLeft=D.clientWidth*A}function g(){b!=0&&v(b-1)}function _(){b!=f.length-1&&v(b+1)}const k=(f==null?void 0:f.length)&&b!==f.length-1,w=(f==null?void 0:f.length)&&b!==0;return p("div",{class:Z("rounded-xl select-none border py-4 relative",e?"border-gray-950":"border-gray-300"),...d,onClick:A=>{if(y.current&&!y.current.contains(A.target))s(A);else{A.preventDefault();return}},children:[!r&&p("p",{class:"text-gray-950 px-4 text-base font-normal font-nunito leading-tight ",children:o?p(q,{children:n?`${a.bike_Brand} ${a.year} ${a.spec}`:a.name&&a.isCustom?a.name:`${a.brand} ${a.year} ${a.bikeSpec} ${a.variant?a.variant:""}`}):p(q,{children:n?a.bike_Name:a.name})}),p("div",{class:"relative mt-2",children:[p("div",{ref:h,class:Z("flex scroll-smooth snap-mandatory no-scrollbar h-32 snap-x space-x-2 relative overflow-x-auto","px-4"),"data-active-slide":b,children:[!n&&f.length&&f.map((A,D)=>p("div",{"data-slide":D,class:"w-full h-full snap-center flex items-center flex-none",children:p("img",{class:"max-w-full pointer-events-none mx-auto max-h-full h-auto w-auto",src:A,alt:A})},D)),n&&p("div",{class:"w-full h-full snap-center flex items-center flex-none",children:p("img",{class:"max-w-full pointer-events-none mx-auto max-h-full h-auto w-auto",src:`https://imagestore.bikematrix.io/${a.bike_Reference}/400-${a.bike_Thumbnail}`,alt:a.bike_Reference})})]}),p(q,{children:[p("div",{onClick:g,class:Z("border !ml-0 bg-white absolute w-9 h-9 flex items-center justify-center left-4 top-1/2 -translate-y-1/2 rounded-xl border-gray-300",w?"":"hidden"),children:p(Je,{class:"h-3 text-gray-500 -rotate-180"})}),p("div",{onClick:_,class:Z("border !ml-0 bg-white absolute w-9 h-9 flex items-center justify-center right-4 top-1/2 -translate-y-1/2 rounded-xl border-gray-300",k?"":"hidden"),children:p(Je,{class:"h-3 text-gray-500 translate-x-px"})})]})]}),(f==null?void 0:f.length)>1&&p("div",{class:"space-x-2 flex items-center justify-center",children:f.map((A,D)=>p("div",{class:Z("rounded-xl w-2 h-2 transition-all duration-300",D==b?" bg-gray-950 scale-125":" bg-gray-200")},D))}),(l||a.isShared)&&p("div",{className:"absolute left-4 bottom-4",children:p(Tl,{})}),(c||a.isCustom)&&p("div",{className:"absolute left-4 bottom-4",children:p(Tl,{text:"Custom"})}),p("div",{className:"spanner_wrapper absolute right-4 bottom-14 h-fit w-fit",ref:y,children:i&&e&&p(nf,{class:"cursor-pointer",onClick:A=>{A.preventDefault(),!(a!=null&&a.isCustom)&&!(a!=null&&a.isShared)?Q("/workshop"):a!=null&&a.isShared?Q("/read-only"):Q("/bom")}})}),e&&!t?p(of,{class:"absolute right-4 bottom-4 cursor-pointer"}):t?p(sf,{class:"absolute right-4 bottom-4 cursor-pointer",onClick:()=>Q("/settings")}):n?p("span",{}):u?p("span",{}):p(q,{children:p("span",{class:"border absolute right-4 bottom-4 rounded-full h-8 w-8 border-gray-300 bg-white/75"})})]})}function Ll(i,e){const t=()=>{try{const o=window.localStorage.getItem(i);return o?JSON.parse(o):e}catch(o){return console.error(o),e}},[r,a]=F(t);return V(()=>{try{if(!r&&i==="bm_currentBike")window.localStorage.setItem(i,null);else if(!r)window.localStorage.removeItem(i);else{const o=JSON.stringify(r);window.localStorage.setItem(i,o)}}catch(o){console.error(o)}},[i,r]),[r,a,t]}function cf(i,e){const t=()=>{try{const o=window.sessionStorage.getItem(i);return o?JSON.parse(o):e}catch(o){return console.error(o),e}},[r,a]=F(t);return V(()=>{try{if(!r)window.sessionStorage.removeItem(i);else{const o=JSON.stringify(r);window.sessionStorage.setItem(i,o)}}catch(o){console.error(o)}},[i,r]),[r,a,t]}const Eo={brand:{options:[],value:null,error:null},model:{options:[],value:null,error:null},frameSeries:{options:[],value:null,error:null},year:{options:[],value:[],error:null},bikeSpec:{options:[],value:null,error:null},frameSize:{options:[],value:null,error:null},options:[],value:{}},Pl=jr(void 0),uf=({children:i})=>{var R;const e=window.BikeMatrix.getConfig(),[t,r]=Ll(Ia,null),[a,o]=Ll("bm_lounge",[]),n=new Se(e.apiUrl,e.apiKey,e.apiToken,e.isShopify),[s,l]=F(Eo),c=K({}),[u,d]=F([]),[f,h]=F(!1),[b,m]=F(null);F(null),V(()=>{(async()=>{if(t!=null&&t.brandId){const B=await fs(t==null?void 0:t.brandId);m(B)}})()},[t==null?void 0:t.brandId]);function y(z){l(B=>{var I;return{...B,[z]:{options:[],value:(I=Eo[z])==null?void 0:I.value}}})}function v(z,B){l(I=>(I[z].value=B,{...I}))}const g=()=>{l(z=>{var B;return{...Eo,brand:{options:((B=z.brand)==null?void 0:B.options)||[],error:z.brand.error||null}}})},_=z=>{r({...z}),o([...(a||[]).filter(B=>!!B.key&&B.key!==z.key),z])},k=z=>{(t==null?void 0:t.key)===z&&r(null),o([...(a||[]).filter(B=>!!B.key&&B.key!==z)])},w=()=>{e.logLevel==="verbose"&&console.log("Dispatch BikeChanging (pre-change)..."),document.dispatchEvent(new Event("BikeChanging",{bubbles:!0,composed:!0}))},C=()=>{setTimeout(()=>{g(),Q("/")},500)},A=async()=>{const z=await n.getBikeBrands();z.success?(sessionStorage.setItem("bm_brands",JSON.stringify(z.data)),l(B=>(B.brand.options=z.data.map(I=>({label:I.bike_Brand,value:I.bike_Brand_ID})),{...B}))):z.success||(l(B=>(B.brand.error=z.error,{...B})),e.logLevel==="verbose"&&console.error(z.logError))},D=async()=>{const z=await n.getBikeModels(s.brand.value);z.success?l(B=>(B.model.options=z.data.map(I=>({label:I.model_Family,value:I.model_Family_ID})),{...B})):z.success||(l(B=>(B.model.error=z.error,{...B})),e.logLevel==="verbose"&&console.error(z.logError))},x=async()=>{const z=await n.getBikeFrameSeries(s.model.value);z.success?l(B=>{var $,U;const I=[];return B.frameSeries.options=z.data.reduce((H,de)=>{const ge={label:de.model_Spec,value:de.model_Spec_ID};return I.includes(ge.value)||(I.push(ge.value),H.push(ge)),H},[]),(($=B.frameSeries.options)==null?void 0:$.length)===1&&(B.frameSeries.value=(U=B.frameSeries.options[0])==null?void 0:U.value),{...B}}):z.success||(l(B=>(B.frameSeries.error=z.error,{...B})),e.logLevel==="verbose"&&console.error(z.logError))},S=async()=>{const z=await n.getBikeSpecs(s.frameSeries.value);if(z.success){const B=[],I=[],$=[],U=[];z.data.forEach(H=>{var Ct,be;const de=H.year+"-"+H.spec.replace(/[^0-9a-zA-Z]/g,"")+(H.bike_Variant?"-"+H.bike_Variant.replace(/[^0-9a-zA-Z]/g,""):""),ge={label:H.spec,value:H.spec};if(B.includes(ge.value)||(B.push(ge.value),$.push(ge)),!I.includes(de)){I.push(de);const ar={_key:de,key:H.bike_Key,name:H.bike_Name,variant:H.bike_Variant,brand:H.bike_Brand,brandId:H.bike_Brand_ID,model:H.model_Family,modelId:H.model_Family_ID,frameSeries:H.model_Spec,frameSeriesId:H.model_Spec_ID,bikeSpec:H.spec,year:H.year,images:[H.bike_Thumbnail,...((Ct=H==null?void 0:H.bike_Images)==null?void 0:Ct.split(","))||[]].filter(et=>!!et).map(et=>`https://imagestore.bikematrix.io/${H.bike_Reference}/400-${et}`)},qt=z.data.reduce((et,Re)=>(Re.year==H.year&&Re.spec===H.spec&&Re.model_Spec===H.model_Spec&&Re.bike_Variant===H.bike_Variant&&et.push({key:Re.bike_Key,name:Re.bike_Name,variant:Re.bike_Variant,sizeId:Re.bike_Size_ID,size:Re.bike_Size}),et),[]);(be=qt==null?void 0:qt.filter(et=>!!et.sizeId))!=null&&be.length&&(ar.sizes=qt),U.push(ar)}c.current[s.frameSeries.value]=Array.from(new Set([...c.current[s.frameSeries.value]||[],H.year]))}),l(H=>(H.bikeSpec.options=$,{...H})),d(U)}else z.success||(l(B=>(B.bikeSpec.error=z.error,{...B})),e.logLevel==="verbose"&&console.error(z.logError))},E=async()=>{l(z=>{const B=c.current[z.frameSeries.value]||[];return z.year.options=B.map(I=>({label:I,value:I})),{...z}})},T=async()=>{l(z=>{var B,I,$;if(z.frameSize.options=(B=s==null?void 0:s.value)!=null&&B.sizes?s.value.sizes.filter(U=>!!U.size).map(U=>({label:U.size,value:U.size})):[],((I=z.frameSize.options)==null?void 0:I.length)===1){const U=($=z.frameSize.options[0])==null?void 0:$.value;z.frameSize.value=U,z.value.frameSize=U}return{...z}})};V(()=>(document.addEventListener("BmToggleModal",C),()=>{document.removeEventListener("BmToggleModal",C)}),[]);const[L,M]=cf("bm_diagnostics",[]),O=()=>{const B=new URLSearchParams(window.location.search).get("diagnostics");JSON.parse(sessionStorage.getItem("bm_diagnostics")).includes(B)||M([...L,B]),B===null&&M([])};V(()=>{w(),O()},[t]),V(()=>{sessionStorage.getItem("bm_brands")?l(z=>(z.brand.options=JSON.parse(sessionStorage.getItem("bm_brands")).map(B=>({label:B.bike_Brand,value:B.bike_Brand_ID})),{...z})):ft.value&&A()},[ft.value]),V(()=>{s.brand.value&&(y("model"),y("frameSeries"),D())},[s.brand.value]),V(()=>{s.model.value&&(y("frameSeries"),x())},[s.model.value]),V(()=>{s.frameSeries.value&&(y("bikeSpec"),y("year"),d([]),S().then(()=>{E()}))},[s.frameSeries.value]),V(()=>{s.value._key&&(y("frameSize"),T())},[(R=s.value)==null?void 0:R._key]),V(()=>{s.frameSize.value&&l(z=>{var B,I;return z.value={...z.value,...((I=(B=z==null?void 0:z.value)==null?void 0:B.sizes)==null?void 0:I.find($=>s.frameSize.value==$.size))||{}},delete z.value.sizes,z})},[s.frameSize.value]);const P={bike:s,setBike:l,setBikeAttr:v,resetBike:g,results:u,loading:f,setLoading:h,compatibleCollections:b,currentBike:t,setCurrentBike:r,removeBike:k,saveBike:_,lounge:a};return p(Pl.Provider,{value:P,children:i})},Ne=()=>{const i=wa(Pl);if(!i)throw new Error("useBikeState must be used within a BikeProvider");return i};function vt(){const{t:i}=X(),t=window.BikeMatrix.getConfig(),[r,a]=F(null);return t.internalLink&&a(t.internalLink),p(q,{children:[p("p",{class:"text-gray-600 max-w-sm mx-auto mt-4 text-center font-normal text-xs",children:i("bikeselector_home_footer_message")}),p("a",{href:r||"https://bikematrix.io/landed-it",target:"_blank",class:"text-gray-950 block underline mb-4 font-bold mt-4 text-center text-xs",children:i("bikematrix_poweredby")})]})}const df=i=>j("svg",{width:17,height:17,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},j("path",{d:"M16.983 4.13197C16.9699 3.98064 16.8699 3.85064 16.727 3.7988C16.5837 3.74665 16.4233 3.78215 16.3155 3.88937L14.1098 6.08655L11.6647 5.31527L10.8905 2.87937L13.0961 0.682011C13.2041 0.574581 13.2393 0.414746 13.1873 0.272238C13.1348 0.129446 13.0046 0.0299881 12.8524 0.0168782C11.5129 -0.0980992 10.2004 0.378357 9.25142 1.32387C7.95176 2.61873 7.60759 4.50961 8.21705 6.12135C8.15043 6.17726 8.08471 6.2365 8.01987 6.30039L0.65736 13.2216C0.654763 13.2241 0.652203 13.2268 0.649393 13.2293C-0.216464 14.092 -0.216464 15.4955 0.649393 16.3583C1.51539 17.2209 2.91396 17.2104 3.77967 16.3477C3.78341 16.3443 3.78682 16.3408 3.79024 16.3369L10.677 8.94505C10.7398 8.88222 10.798 8.8165 10.853 8.74903C12.4713 9.3573 14.3705 9.01524 15.6713 7.71952C16.62 6.77394 17.0986 5.46628 16.983 4.13197ZM2.67019 15.4264C2.35113 15.7442 1.83439 15.744 1.51536 15.4264C1.19644 15.1089 1.19644 14.5937 1.51536 14.2761C1.83439 13.9585 2.35113 13.9585 2.67019 14.2761C2.98911 14.5937 2.98911 15.1089 2.67019 15.4264Z",fill:"black"})),N={id:null,name:null,product_category_id:null,swap:!1,version_id:null,unsaved_changes:null,translation:null},si={bike_Key:"",bike_Type:null,bike_Name:null,bike_Variant:null,bike_Reference:null,bike_Thumbnail:null,bike_Images:null,bike_Brand_ID:0,bike_Brand:null,model_Family_ID:0,model_Family:null,model_Spec_ID:0,model_Spec:null,spec:null,bike_Size_ID:null,bike_Size:null,year:0,original_Bike_Key:null,share_Bike_Key:null,owner_Email_Address:null,brake_Configuration:null,cockpit:{stem:N,handlebar:N,seat_Post:N,seat_Post_Clamp:N,dropper_Lever:N,lockout_Lever:N,grips:N,pedals:N,saddle:N},"frame_&_fork":{fork:N,rear_Shock:N,headseat:N},drivetrain:{chainguide:N,bottom_Bracket:N,crankset:N,largest_Chainring:N,second_Largest_Chainring:N,third_Largest_Chainring:N,chainring_Spider:N,chain:N,cassette:N,rear_Derailleur:N,front_Derailleur:N,shifter_RH:N,shifter_LH:N,shift_Brake_Combo_RH:N,shift_Brake_Combo_LH:N,shifter_Adapter_RH:N,shifter_Adapter_LH:N},brakes:{brake_Caliper_Front:N,brake_Caliper_Rear:N,brake_Lever_RH:N,brake_Lever_LH:N,brake_Pads_Front:N,brake_Pads_Rear:N,brake_Rotor_Front:N,brake_Rotor_Rear:N,brake_Adapter_Front:N,brake_Adapter_Rear:N},"wheels_&_tyres":{front_Wheel:N,front_Axle:N,rear_Wheel:N,rear_Axle:N,tyre_Front:N,tyre_Rear:N},is_E_Bike:null,eMotor_System_ID:null,eBattery_ID:null,eControl_Unit_ID:null,eCharger_ID:null,eInterconnects_ID:null},li={cockpit:{stem:N,handlebar:N,seat_Post:N,seat_Post_Clamp:N,dropper_Lever:N,lockout_Lever:N,grips:N,pedals:N,saddle:N},"frame_&_fork":{headset:N,fork:N,rear_Shock:N},drivetrain:{chainguide:N,bottom_Bracket:N,crankset:N,largest_Chainring:N,second_Largest_Chainring:N,third_Largest_Chainring:N,chainring_Spider:N,chain:N,cassette:N,rear_Derailleur:N,front_Derailleur:N,shifter_RH:N,shifter_LH:N,shift_Brake_Combo_RH:N,shift_Brake_Combo_LH:N,shifter_Adapter_RH:N,shifter_Adapter_LH:N},brakes:{brake_Caliper_Front:N,brake_Caliper_Rear:N,brake_Lever_RH:N,brake_Lever_LH:N,brake_Pads_Front:N,brake_Pads_Rear:N,brake_Rotor_Front:N,brake_Rotor_Rear:N,brake_Adapter_Front:N,brake_Adapter_Rear:N},"wheels_&_tyres":{front_Wheel:N,front_Axle:N,rear_Wheel:N,rear_Axle:N,tyre_Front:N,tyre_Rear:N}},yt={headset:{},stem:{},handlebar:{},seat_Post:{},seat_Post_Clamp:{},dropper_Lever:{},lockout_Lever:{},grips:{},pedals:{},saddle:{},fork:{},rear_Shock:{},chainguide:{},bottom_Bracket:{},crankset:{},largest_Chainring:{},second_Largest_Chainring:{},third_Largest_Chainring:{},chainring_Spider:{},chain:{},cassette:{},rear_Derailleur:{},front_Derailleur:{},shifter_RH:{},shifter_LH:{},shift_Brake_Combo_RH:{},shift_Brake_Combo_LH:{},brake_Lever_RH:{},brake_Lever_LH:{},shifter_Adapter_RH:{},shifter_Adapter_LH:{},brake_Caliper_Front:{},brake_Caliper_Rear:{},brake_Pads_Front:{},brake_Pads_Rear:{},brake_Rotor_Front:{},brake_Rotor_Rear:{},brake_Adapter_Front:{},brake_Adapter_Rear:{},front_Wheel:{},front_Axle:{},rear_Wheel:{},rear_Axle:{},tyre_Front:{},tyre_Rear:{}},Bo=(i,e)=>Object.keys(i).includes(e),Br=i=>(Object.keys(yt).forEach(e=>{Object.keys(i).forEach(t=>{`${e}_ID`===t&&(yt[e].id=i[t]),`${e}_Name`===t&&(yt[e].name=i[t]),`${e}_Product_Category_ID`===t&&(yt[e].product_category_id=i[t]),`${e}_Swap`===t&&(yt[e].swap=i[t]),`${e}_Version_ID`===t&&(yt[e].version_id=i[t]),`${e}_Unsaved_Changes`===t&&(yt[e].unsaved_changes=i[t])})}),Object.keys(li).forEach(e=>{Object.keys(yt).forEach(t=>{Bo(li[e],t)&&(li[e][t]=yt[t])})}),Object.keys(li).forEach(e=>{Bo(si,e)&&(si[e]=li[e])}),Object.keys(i).forEach(e=>{Bo(si,e)&&(si[e]=i[e])}),si),Fl=async i=>{var t;return{bikeSpec:i.spec,brand:i.bike_Brand,brandId:i.bike_Brand_ID,frameSeries:i.spec,frameSeriesId:i.model_Spec_ID,frameSize:i.bike_Size,images:[`https://imagestore.bikematrix.io/${i.bike_Reference}/400-${i.bike_Thumbnail}`],isCustom:i.bike_Type==="Custom_Bike",isShared:i.bike_Type==="Shared_Bike",key:i.bike_Type==="Shared_Bike"?i.share_Bike_Key:i.bike_Key,model:i.model_Family,modelId:i.model_Family_ID,name:i.bike_Name,size:i.bike_Size,sizeId:i.bike_Size_ID,variant:i.bike_Variant,year:i.year,_key:`${i.year}-${(t=i.spec)==null?void 0:t.replace(" ","")}`}};function pf(){const i=window.BikeMatrix.getConfig(),{bike:e,currentBike:t,setCurrentBike:r,lounge:a,removeBike:o,resetBike:n,saveBike:s}=Ne(),{t:l}=X(),{apiUrl:c,apiKey:u,apiToken:d,isShopify:f,virtualWorkshop:h}=window.BikeMatrix.getConfig();V(()=>{we.value=null},[]);const b=new Se(c,u,d,f),m=async()=>{const g=new URLSearchParams(window.location.search).get("bikematrixid"),_=sessionStorage.getItem("bm_passed_id");if(!(_&&_!==null&&g===_)&&(!_||g!==_)){const k=a.find(w=>w.key===g);k?(r(k),sessionStorage.setItem("bm_passed_id",g)):k||(await y(g),sessionStorage.setItem("bm_passed_id",g))}},y=async v=>{const g=await b.getBikeBom(v);if(!(g!=null&&g.success)){i.logLevel==="verbose"&&console.error(g.logError);return}const _=Br(g.data);e.value=await Fl(_),s(e.value),r(e.value)};return m(),V(()=>{a.map(v=>{v!=null&&v.isCustom&&(Ti.value=!1)})},[a]),p(q,{children:[a!=null&&a.length?a==null?void 0:a.filter(v=>!!v._key).map(v=>p("div",{class:"mb-4 relative",children:[p("p",{className:"opacity-0 absolute",children:v.key}),p("div",{onClick:()=>o(v.key),class:"w-7 h-7 z-10 -right-2 -top-2 flex items-center justify-center absolute bg-gray-200 text-gray-800 rounded-full",children:p(Gr,{class:"h-3 w-3"})}),p(Xe,{compact:!0,onClick:g=>{g.preventDefault(),r((t==null?void 0:t.key)===(v==null?void 0:v.key)?null:{...v})},bike:v,selected:(t==null?void 0:t.key)===(v==null?void 0:v.key),spanner:h,custom:v==null?void 0:v.isCustom})]},v.key)):p("div",{class:Z("relative mb-4 z-10 "),children:[p("div",{class:"w-full p-4 relative rounded-xl bg-white border border-gray-300 mb-4",children:[p("span",{class:"block rounded-lg h-6 w-1/2 bg-gray-200"}),p("img",{class:"w-auto mx-auto h-auto max-h-36 opacity-30",src:ze("bike.png")}),p("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-100"})]}),p("div",{class:Z("w-full relative bg-white border -z-10 border-b-0 border-gray-300 rounded-t-xl h-20 mb-4","after:bottom-0 after:-inset-x-px after:-top-6 after:bg-gradient-to-t after:absolute after:from-white after:to-transparent"),children:[p("span",{class:" absolute left-4 top-4 rounded-lg h-6 w-1/2 bg-gray-200"}),p("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-100"})]}),p("div",{class:" text-gray-800 text-center flex -mt-5 z-20 justify-center",children:[l("bikeselector_home_empty"),p("br",{}),l("bikeselector_home_add_a_bike")]})]}),p("button",{onClick:v=>{v.preventDefault(),n(),Q("/add")},class:Z("duration-300 transition-colors sticky bottom-[128px] mt-auto rounded-xl p-3 pr-5 w-full flex justify-center items-center",a.length&&!(t!=null&&t.key)?"bg-gray-950 text-white":a.length?"bg-gray-200 text-gray-800":"bg-gray-950 text-white",!t&&"bottom-0",t&&h&&"bottom-[128px]",t&&!h&&"bottom-[72px]"),children:[l("bikeselector_home_add_btn"),p(Gr,{class:"h-3 absolute [&>path]:stroke-[2px] right-5 justify-self-end rotate-45"})]}),!!(a!=null&&a.length)&&!!(t!=null&&t.key)&&h&&p("button",{onClick:v=>{v.preventDefault(),!(t!=null&&t.isCustom)&&!(t!=null&&t.isShared)?Q("/workshop"):t!=null&&t.isCustom&&!(t!=null&&t.isShared)?Q("/bom"):!(t!=null&&t.isCustom)&&(t!=null&&t.isShared)&&Q("/read-only")},class:Z("duration-300 sticky bottom-[72px] transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center","bg-gray-200 text-gray-800"),children:[l("virtualworkshop_title"),p(df,{class:"h-5 absolute right-5 justify-self-end"})]}),!!(a!=null&&a.length)&&!!(t!=null&&t.key)&&p("button",{onClick:v=>{v.preventDefault(),Q("/browse")},class:Z("duration-300 sticky bottom-4 transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center",a.length?"bg-gray-950 text-white":"bg-gray-200 text-gray-800"),children:l("bikeselector_home_browse_btn")}),p(vt,{})]})}const ff=i=>j("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},j("circle",{cx:10,cy:10,r:10,fill:"#030712"}),j("path",{d:"M6.57886 11.0526L9.02922 13.191L13.4604 7.02636",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Qe=({messages:i,left:e,margin:t})=>{const{t:r}=X(),[a,o]=F(""),[n,s]=F("");return V(()=>{i&&i.indexOf(" ")>=0&&(o(i.split(" ")[0]),s(i.split(" ")[1]))},[i]),p("div",{className:`flex h-4 w-auto ${e?"justify-start":"justify-center"} ${t?"mt-1":""}`,children:i&&p("p",{className:"message text-xs text-red-500",children:r(a||i,{endpoint_location:n})})})};function ci({type:i,title:e,placeholder:t,options:r=[],disabled:a=void 0,loading:o=!1,infoVisible:n=!1,children:s=void 0,error:l=null,...c}){const{t:u}=X(),d=h=>{switch(h){case"brand":return u("bikeselector_addbike_brand_desc");case"model":return u("bikeselector_addbike_model_desc");case"framespec":return u("bikeselector_addbike_framespec_desc");case"framesize":return u("bikeselector_size_framesize_desc");default:return""}},f=(h,b)=>h==="framesize"&&b==="One Size"?u("bikeselector_size_framesize_one_size"):b;return p(q,{children:p("div",{class:"w-full flex flex-col space-y-2",children:[p("label",{class:"text-gray-800 font-bold text",children:e}),s&&p("div",{class:Z("!my-0 overflow-hidden box-border transition-all duration-300",n?"max-h-screen":"h-0"),children:[p("p",{class:"text-gray-600 my-1 italic text-sm",children:d(i)}),p("div",{class:Z("rounded-xl overflow-hidden my-0 relative py-1 h-32 bg-gray-100 w-full"),children:s})]}),p("div",{class:"w-full flex items-center relative",children:[p("select",{class:Z("rounded-xl peer !pr-8 flex w-full border-gray-300 border p-4 py-3 text-lg bg-white placeholder:text-gray-700 text-gray-700","disabled:bg-gray-100 disabled:border-gray-200 disabled:text-gray-400",c.class),disabled:a,...c,children:[p("option",{value:"",selected:!c.value,disabled:!0,children:t}),r.map(h=>p("option",{value:h.value,disabled:h.disabled,children:f(i,h.label)}))]}),o?p("span",{class:"absolute block loader animate-spin right-4 w-5 h-5"}):c.value&&typeof a=="boolean"?p(ff,{class:"right-3 absolute w-5 pointer-events-none"}):p(Je,{class:"absolute h-3 text-gray-700 pointer-events-none rotate-90 right-5 peer-disabled:text-gray-400"})]}),l&&p(Qe,{messages:l,left:!0,margin:5})]})})}const Ml=i=>j("svg",{width:25,height:25,viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},j("circle",{cx:12.5,cy:12.5,r:12,fill:"white",stroke:"black"}),j("path",{d:"M9 16.0711L12.5355 12.5355M12.5355 12.5355L16.0711 9M12.5355 12.5355L16.0711 16.0711M12.5355 12.5355L9 9",stroke:"black",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})),hf=`.input_container{display:flex;flex-direction:column}.input_wrapper{width:100%;border-radius:12px;padding:12px;border:1px solid #d1d5db;display:flex;align-items:center;justify-content:space-between}.input_wrapper input{width:100%}
19
+ `,Tl=({text:i})=>p(q,{children:[p("style",{type:"text/css",children:lf}),p("div",{className:"shared-icon",children:p("p",{className:"text",children:i||"Shared with you"})})]});function Xe({spanner:i,selected:e,settings:t,simple:r,bike:a,compact:o,readOnly:n,onClick:s,shared:l,custom:c,noSymbol:u,...d}){var C;const f=(C=a.images)!=null&&C.length?a.images:[ze("bike.png")],h=K(null),[b,m]=F(0),y=K(null);V(()=>{const A=h==null?void 0:h.current;if(A){var D=new IntersectionObserver(function(x){var S=x.reduce(function(E,T){return T.intersectionRatio>E.intersectionRatio?T:E});S.intersectionRatio>0&&m(Number(S.target.getAttribute("data-slide")))},{root:A,threshold:.8});return A.querySelectorAll("&>div").forEach(x=>{D.observe(x)}),()=>{D.disconnect()}}},[h]);function v(A){if(!h.current)return;const D=h.current.querySelectorAll("&>div")[A];h.current.scrollLeft=D.clientWidth*A}function g(){b!=0&&v(b-1)}function _(){b!=f.length-1&&v(b+1)}const k=(f==null?void 0:f.length)&&b!==f.length-1,w=(f==null?void 0:f.length)&&b!==0;return p("div",{class:Z("rounded-xl select-none border py-4 relative",e?"border-gray-950":"border-gray-300"),...d,onClick:A=>{if(y.current&&!y.current.contains(A.target))s(A);else{A.preventDefault();return}},children:[!r&&p("p",{class:"text-gray-950 px-4 text-base font-normal font-nunito leading-tight ",children:o?p(q,{children:n?`${a.bike_Brand} ${a.year} ${a.spec}`:a.name&&a.isCustom?a.name:`${a.brand} ${a.year} ${a.bikeSpec} ${a.variant?a.variant:""}`}):p(q,{children:n?a.bike_Name:a.name})}),p("div",{class:"relative mt-2",children:[p("div",{ref:h,class:Z("flex scroll-smooth snap-mandatory no-scrollbar h-32 snap-x space-x-2 relative overflow-x-auto","px-4"),"data-active-slide":b,children:[!n&&f.length&&f.map((A,D)=>p("div",{"data-slide":D,class:"w-full h-full snap-center flex items-center flex-none",children:p("img",{class:"max-w-full pointer-events-none mx-auto max-h-full h-auto w-auto",src:A,alt:A})},D)),n&&p("div",{class:"w-full h-full snap-center flex items-center flex-none",children:p("img",{class:"max-w-full pointer-events-none mx-auto max-h-full h-auto w-auto",src:`https://imagestore.bikematrix.io/${a.bike_Reference}/400-${a.bike_Thumbnail}`,alt:a.bike_Reference})})]}),p(q,{children:[p("div",{onClick:g,class:Z("border !ml-0 bg-white absolute w-9 h-9 flex items-center justify-center left-4 top-1/2 -translate-y-1/2 rounded-xl border-gray-300",w?"":"hidden"),children:p(Je,{class:"h-3 text-gray-500 -rotate-180"})}),p("div",{onClick:_,class:Z("border !ml-0 bg-white absolute w-9 h-9 flex items-center justify-center right-4 top-1/2 -translate-y-1/2 rounded-xl border-gray-300",k?"":"hidden"),children:p(Je,{class:"h-3 text-gray-500 translate-x-px"})})]})]}),(f==null?void 0:f.length)>1&&p("div",{class:"space-x-2 flex items-center justify-center",children:f.map((A,D)=>p("div",{class:Z("rounded-xl w-2 h-2 transition-all duration-300",D==b?" bg-gray-950 scale-125":" bg-gray-200")},D))}),(l||a.isShared)&&p("div",{className:"absolute left-4 bottom-4",children:p(Tl,{})}),(c||a.isCustom)&&p("div",{className:"absolute left-4 bottom-4",children:p(Tl,{text:"Custom"})}),p("div",{className:"spanner_wrapper absolute right-4 bottom-14 h-fit w-fit",ref:y,children:i&&e&&p(nf,{class:"cursor-pointer",onClick:A=>{A.preventDefault(),!(a!=null&&a.isCustom)&&!(a!=null&&a.isShared)?Q("/workshop"):a!=null&&a.isShared?Q("/read-only"):Q("/bom")}})}),e&&!t?p(of,{class:"absolute right-4 bottom-4 cursor-pointer"}):t?p(sf,{class:"absolute right-4 bottom-4 cursor-pointer",onClick:()=>Q("/settings")}):n?p("span",{}):u?p("span",{}):p(q,{children:p("span",{class:"border absolute right-4 bottom-4 rounded-full h-8 w-8 border-gray-300 bg-white/75"})})]})}function Ll(i,e){const t=()=>{try{const o=window.localStorage.getItem(i);return o?JSON.parse(o):e}catch(o){return console.error(o),e}},[r,a]=F(t);return V(()=>{try{if(!r&&i==="bm_currentBike")window.localStorage.setItem(i,null);else if(!r)window.localStorage.removeItem(i);else{const o=JSON.stringify(r);window.localStorage.setItem(i,o)}}catch(o){console.error(o)}},[i,r]),[r,a,t]}function cf(i,e){const t=()=>{try{const o=window.sessionStorage.getItem(i);return o?JSON.parse(o):e}catch(o){return console.error(o),e}},[r,a]=F(t);return V(()=>{try{if(!r)window.sessionStorage.removeItem(i);else{const o=JSON.stringify(r);window.sessionStorage.setItem(i,o)}}catch(o){console.error(o)}},[i,r]),[r,a,t]}const Eo={brand:{options:[],value:null,error:null},model:{options:[],value:null,error:null},frameSeries:{options:[],value:null,error:null},year:{options:[],value:[],error:null},bikeSpec:{options:[],value:null,error:null},frameSize:{options:[],value:null,error:null},options:[],value:{}},Pl=jr(void 0),uf=({children:i})=>{var R;const e=window.BikeMatrix.getConfig(),[t,r]=Ll(Ia,null),[a,o]=Ll("bm_lounge",[]),n=new Se(e.apiUrl,e.apiKey,e.apiToken,e.isShopify),[s,l]=F(Eo),c=K({}),[u,d]=F([]),[f,h]=F(!1),[b,m]=F(null);F(null),V(()=>{(async()=>{if(t!=null&&t.brandId){const B=await fs(t==null?void 0:t.brandId);m(B)}})()},[t==null?void 0:t.brandId]);function y(z){l(B=>{var I;return{...B,[z]:{options:[],value:(I=Eo[z])==null?void 0:I.value}}})}function v(z,B){l(I=>(I[z].value=B,{...I}))}const g=()=>{l(z=>{var B;return{...Eo,brand:{options:((B=z.brand)==null?void 0:B.options)||[],error:z.brand.error||null}}})},_=z=>{r({...z}),o([...(a||[]).filter(B=>!!B.key&&B.key!==z.key),z])},k=z=>{(t==null?void 0:t.key)===z&&r(null),o([...(a||[]).filter(B=>!!B.key&&B.key!==z)])},w=()=>{e.logLevel==="verbose"&&console.log("Dispatch BikeChanging (pre-change)..."),document.dispatchEvent(new Event("BikeChanging",{bubbles:!0,composed:!0}))},C=()=>{setTimeout(()=>{g(),Q("/")},500)},A=async()=>{const z=await n.getBikeBrands();z.success?(sessionStorage.setItem("bm_brands",JSON.stringify(z.data)),l(B=>(B.brand.options=z.data.map(I=>({label:I.bike_Brand,value:I.bike_Brand_ID})),{...B}))):z.success||(l(B=>(B.brand.error=z.error,{...B})),e.logLevel==="verbose"&&console.error(z.logError))},D=async()=>{const z=await n.getBikeModels(s.brand.value);z.success?l(B=>(B.model.options=z.data.map(I=>({label:I.model_Family,value:I.model_Family_ID})),{...B})):z.success||(l(B=>(B.model.error=z.error,{...B})),e.logLevel==="verbose"&&console.error(z.logError))},x=async()=>{const z=await n.getBikeFrameSeries(s.model.value);z.success?l(B=>{var $,U;const I=[];return B.frameSeries.options=z.data.reduce((H,de)=>{const ge={label:de.model_Spec,value:de.model_Spec_ID};return I.includes(ge.value)||(I.push(ge.value),H.push(ge)),H},[]),(($=B.frameSeries.options)==null?void 0:$.length)===1&&(B.frameSeries.value=(U=B.frameSeries.options[0])==null?void 0:U.value),{...B}}):z.success||(l(B=>(B.frameSeries.error=z.error,{...B})),e.logLevel==="verbose"&&console.error(z.logError))},S=async()=>{const z=await n.getBikeSpecs(s.frameSeries.value);if(z.success){const B=[],I=[],$=[],U=[];z.data.forEach(H=>{var Ct,be;const de=H.year+"-"+H.spec.replace(/[^0-9a-zA-Z]/g,"")+(H.bike_Variant?"-"+H.bike_Variant.replace(/[^0-9a-zA-Z]/g,""):""),ge={label:H.spec,value:H.spec};if(B.includes(ge.value)||(B.push(ge.value),$.push(ge)),!I.includes(de)){I.push(de);const ar={_key:de,key:H.bike_Key,name:H.bike_Name,variant:H.bike_Variant,brand:H.bike_Brand,brandId:H.bike_Brand_ID,model:H.model_Family,modelId:H.model_Family_ID,frameSeries:H.model_Spec,frameSeriesId:H.model_Spec_ID,bikeSpec:H.spec,year:H.year,images:[H.bike_Thumbnail,...((Ct=H==null?void 0:H.bike_Images)==null?void 0:Ct.split(","))||[]].filter(et=>!!et).map(et=>`https://imagestore.bikematrix.io/${H.bike_Reference}/400-${et}`)},qt=z.data.reduce((et,Re)=>(Re.year==H.year&&Re.spec===H.spec&&Re.model_Spec===H.model_Spec&&Re.bike_Variant===H.bike_Variant&&et.push({key:Re.bike_Key,name:Re.bike_Name,variant:Re.bike_Variant,sizeId:Re.bike_Size_ID,size:Re.bike_Size}),et),[]);(be=qt==null?void 0:qt.filter(et=>!!et.sizeId))!=null&&be.length&&(ar.sizes=qt),U.push(ar)}c.current[s.frameSeries.value]=Array.from(new Set([...c.current[s.frameSeries.value]||[],H.year]))}),l(H=>(H.bikeSpec.options=$,{...H})),d(U)}else z.success||(l(B=>(B.bikeSpec.error=z.error,{...B})),e.logLevel==="verbose"&&console.error(z.logError))},E=async()=>{l(z=>{const B=c.current[z.frameSeries.value]||[];return z.year.options=B.map(I=>({label:I,value:I})),{...z}})},T=async()=>{l(z=>{var B,I,$;if(z.frameSize.options=(B=s==null?void 0:s.value)!=null&&B.sizes?s.value.sizes.filter(U=>!!U.size).map(U=>({label:U.size,value:U.size})):[],((I=z.frameSize.options)==null?void 0:I.length)===1){const U=($=z.frameSize.options[0])==null?void 0:$.value;z.frameSize.value=U,z.value.frameSize=U}return{...z}})};V(()=>(document.addEventListener("BmToggleModal",C),()=>{document.removeEventListener("BmToggleModal",C)}),[]);const[L,M]=cf("bm_diagnostics",[]),O=()=>{const B=new URLSearchParams(window.location.search).get("diagnostics");JSON.parse(sessionStorage.getItem("bm_diagnostics")).includes(B)||M([...L,B]),B===null&&M([])};V(()=>{w(),O()},[t]),V(()=>{sessionStorage.getItem("bm_brands")?l(z=>(z.brand.options=JSON.parse(sessionStorage.getItem("bm_brands")).map(B=>({label:B.bike_Brand,value:B.bike_Brand_ID})),{...z})):ft.value&&A()},[ft.value]),V(()=>{s.brand.value&&(y("model"),y("frameSeries"),D())},[s.brand.value]),V(()=>{s.model.value&&(y("frameSeries"),x())},[s.model.value]),V(()=>{s.frameSeries.value&&(y("bikeSpec"),y("year"),d([]),S().then(()=>{E()}))},[s.frameSeries.value]),V(()=>{s.value._key&&(y("frameSize"),T())},[(R=s.value)==null?void 0:R._key]),V(()=>{s.frameSize.value&&l(z=>{var B,I;return z.value={...z.value,...((I=(B=z==null?void 0:z.value)==null?void 0:B.sizes)==null?void 0:I.find($=>s.frameSize.value==$.size))||{}},delete z.value.sizes,z})},[s.frameSize.value]);const P={bike:s,setBike:l,setBikeAttr:v,resetBike:g,results:u,loading:f,setLoading:h,compatibleCollections:b,currentBike:t,setCurrentBike:r,removeBike:k,saveBike:_,lounge:a};return p(Pl.Provider,{value:P,children:i})},Ne=()=>{const i=wa(Pl);if(!i)throw new Error("useBikeState must be used within a BikeProvider");return i};function vt(){const{t:i}=X(),t=window.BikeMatrix.getConfig(),[r,a]=F(null);return t.internalLink&&a(t.internalLink),p(q,{children:[p("p",{class:"text-gray-600 max-w-sm mx-auto mt-4 text-center font-normal text-xs",children:i("bikeselector_home_footer_message")}),p("a",{href:r||"https://bikematrix.io/landed-it",target:"_blank",class:"text-gray-950 block underline mb-4 font-bold mt-4 text-center text-xs",children:i("bikematrix_poweredby")})]})}const df=i=>j("svg",{width:17,height:17,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},j("path",{d:"M16.983 4.13197C16.9699 3.98064 16.8699 3.85064 16.727 3.7988C16.5837 3.74665 16.4233 3.78215 16.3155 3.88937L14.1098 6.08655L11.6647 5.31527L10.8905 2.87937L13.0961 0.682011C13.2041 0.574581 13.2393 0.414746 13.1873 0.272238C13.1348 0.129446 13.0046 0.0299881 12.8524 0.0168782C11.5129 -0.0980992 10.2004 0.378357 9.25142 1.32387C7.95176 2.61873 7.60759 4.50961 8.21705 6.12135C8.15043 6.17726 8.08471 6.2365 8.01987 6.30039L0.65736 13.2216C0.654763 13.2241 0.652203 13.2268 0.649393 13.2293C-0.216464 14.092 -0.216464 15.4955 0.649393 16.3583C1.51539 17.2209 2.91396 17.2104 3.77967 16.3477C3.78341 16.3443 3.78682 16.3408 3.79024 16.3369L10.677 8.94505C10.7398 8.88222 10.798 8.8165 10.853 8.74903C12.4713 9.3573 14.3705 9.01524 15.6713 7.71952C16.62 6.77394 17.0986 5.46628 16.983 4.13197ZM2.67019 15.4264C2.35113 15.7442 1.83439 15.744 1.51536 15.4264C1.19644 15.1089 1.19644 14.5937 1.51536 14.2761C1.83439 13.9585 2.35113 13.9585 2.67019 14.2761C2.98911 14.5937 2.98911 15.1089 2.67019 15.4264Z",fill:"black"})),N={id:null,name:null,product_category_id:null,swap:!1,version_id:null,unsaved_changes:null,translation:null},si={bike_Key:"",bike_Type:null,bike_Name:null,bike_Variant:null,bike_Reference:null,bike_Thumbnail:null,bike_Images:null,bike_Brand_ID:0,bike_Brand:null,model_Family_ID:0,model_Family:null,model_Spec_ID:0,model_Spec:null,spec:null,bike_Size_ID:null,bike_Size:null,year:0,original_Bike_Key:null,share_Bike_Key:null,owner_Email_Address:null,brake_Configuration:null,cockpit:{stem:N,handlebar:N,seat_Post:N,seat_Post_Clamp:N,dropper_Lever:N,lockout_Lever:N,grips:N,pedals:N,saddle:N},"frame_&_fork":{fork:N,rear_Shock:N,headseat:N},drivetrain:{chainguide:N,bottom_Bracket:N,crankset:N,largest_Chainring:N,second_Largest_Chainring:N,third_Largest_Chainring:N,chainring_Spider:N,chain:N,cassette:N,rear_Derailleur:N,front_Derailleur:N,shifter_RH:N,shifter_LH:N,shift_Brake_Combo_RH:N,shift_Brake_Combo_LH:N,shifter_Adapter_RH:N,shifter_Adapter_LH:N},brakes:{brake_Caliper_Front:N,brake_Caliper_Rear:N,brake_Lever_RH:N,brake_Lever_LH:N,brake_Pads_Front:N,brake_Pads_Rear:N,brake_Rotor_Front:N,brake_Rotor_Rear:N,brake_Adapter_Front:N,brake_Adapter_Rear:N},"wheels_&_tyres":{front_Wheel:N,front_Axle:N,rear_Wheel:N,rear_Axle:N,tyre_Front:N,tyre_Rear:N},is_E_Bike:null,eMotor_System_ID:null,eBattery_ID:null,eControl_Unit_ID:null,eCharger_ID:null,eInterconnects_ID:null},li={cockpit:{stem:N,handlebar:N,seat_Post:N,seat_Post_Clamp:N,dropper_Lever:N,lockout_Lever:N,grips:N,pedals:N,saddle:N},"frame_&_fork":{headset:N,fork:N,rear_Shock:N},drivetrain:{chainguide:N,bottom_Bracket:N,crankset:N,largest_Chainring:N,second_Largest_Chainring:N,third_Largest_Chainring:N,chainring_Spider:N,chain:N,cassette:N,rear_Derailleur:N,front_Derailleur:N,shifter_RH:N,shifter_LH:N,shift_Brake_Combo_RH:N,shift_Brake_Combo_LH:N,shifter_Adapter_RH:N,shifter_Adapter_LH:N},brakes:{brake_Caliper_Front:N,brake_Caliper_Rear:N,brake_Lever_RH:N,brake_Lever_LH:N,brake_Pads_Front:N,brake_Pads_Rear:N,brake_Rotor_Front:N,brake_Rotor_Rear:N,brake_Adapter_Front:N,brake_Adapter_Rear:N},"wheels_&_tyres":{front_Wheel:N,front_Axle:N,rear_Wheel:N,rear_Axle:N,tyre_Front:N,tyre_Rear:N}},yt={headset:{},stem:{},handlebar:{},seat_Post:{},seat_Post_Clamp:{},dropper_Lever:{},lockout_Lever:{},grips:{},pedals:{},saddle:{},fork:{},rear_Shock:{},chainguide:{},bottom_Bracket:{},crankset:{},largest_Chainring:{},second_Largest_Chainring:{},third_Largest_Chainring:{},chainring_Spider:{},chain:{},cassette:{},rear_Derailleur:{},front_Derailleur:{},shifter_RH:{},shifter_LH:{},shift_Brake_Combo_RH:{},shift_Brake_Combo_LH:{},brake_Lever_RH:{},brake_Lever_LH:{},shifter_Adapter_RH:{},shifter_Adapter_LH:{},brake_Caliper_Front:{},brake_Caliper_Rear:{},brake_Pads_Front:{},brake_Pads_Rear:{},brake_Rotor_Front:{},brake_Rotor_Rear:{},brake_Adapter_Front:{},brake_Adapter_Rear:{},front_Wheel:{},front_Axle:{},rear_Wheel:{},rear_Axle:{},tyre_Front:{},tyre_Rear:{}},Bo=(i,e)=>Object.keys(i).includes(e),Br=i=>(Object.keys(yt).forEach(e=>{Object.keys(i).forEach(t=>{`${e}_ID`===t&&(yt[e].id=i[t]),`${e}_Name`===t&&(yt[e].name=i[t]),`${e}_Product_Category_ID`===t&&(yt[e].product_category_id=i[t]),`${e}_Swap`===t&&(yt[e].swap=i[t]),`${e}_Version_ID`===t&&(yt[e].version_id=i[t]),`${e}_Unsaved_Changes`===t&&(yt[e].unsaved_changes=i[t])})}),Object.keys(li).forEach(e=>{Object.keys(yt).forEach(t=>{Bo(li[e],t)&&(li[e][t]=yt[t])})}),Object.keys(li).forEach(e=>{Bo(si,e)&&(si[e]=li[e])}),Object.keys(i).forEach(e=>{Bo(si,e)&&(si[e]=i[e])}),si),Fl=async i=>{var t;return{bikeSpec:i.spec,brand:i.bike_Brand,brandId:i.bike_Brand_ID,frameSeries:i.spec,frameSeriesId:i.model_Spec_ID,frameSize:i.bike_Size,images:[`https://imagestore.bikematrix.io/${i.bike_Reference}/400-${i.bike_Thumbnail}`],isCustom:i.bike_Type==="Custom_Bike",isShared:i.bike_Type==="Shared_Bike",key:i.bike_Type==="Shared_Bike"?i.share_Bike_Key:i.bike_Key,model:i.model_Family,modelId:i.model_Family_ID,name:i.bike_Name,size:i.bike_Size,sizeId:i.bike_Size_ID,variant:i.bike_Variant,year:i.year,_key:`${i.year}-${(t=i.spec)==null?void 0:t.replace(" ","")}`}};function pf(){const i=window.BikeMatrix.getConfig(),{bike:e,currentBike:t,setCurrentBike:r,lounge:a,removeBike:o,resetBike:n,saveBike:s}=Ne(),{t:l}=X(),{apiUrl:c,apiKey:u,apiToken:d,isShopify:f,virtualWorkshop:h}=window.BikeMatrix.getConfig();V(()=>{we.value=null},[]);const b=new Se(c,u,d,f),m=async()=>{const g=new URLSearchParams(window.location.search).get("bikematrixid"),_=sessionStorage.getItem("bm_passed_id");if(!(_&&_!==null&&g===_)&&(!_||g!==_)){const k=a.find(w=>w.key===g);k?(r(k),sessionStorage.setItem("bm_passed_id",g)):k||(await y(g),sessionStorage.setItem("bm_passed_id",g))}},y=async v=>{const g=await b.getBikeBom(v);if(!(g!=null&&g.success)){i.logLevel==="verbose"&&console.error(g.logError);return}const _=Br(g.data);e.value=await Fl(_),s(e.value),r(e.value)};return m(),V(()=>{a.map(v=>{v!=null&&v.isCustom&&(Ti.value=!1)})},[a]),p(q,{children:[a!=null&&a.length?a==null?void 0:a.filter(v=>!!v._key).map(v=>p("div",{class:"mb-4 relative",children:[p("p",{className:"opacity-0 absolute",children:v.key}),p("div",{onClick:()=>o(v.key),class:"w-7 h-7 z-10 -right-2 -top-2 flex items-center justify-center absolute bg-gray-200 text-gray-800 rounded-full",children:p(Gr,{class:"h-3 w-3"})}),p(Xe,{compact:!0,onClick:g=>{g.preventDefault(),r((t==null?void 0:t.key)===(v==null?void 0:v.key)?null:{...v})},bike:v,selected:(t==null?void 0:t.key)===(v==null?void 0:v.key),spanner:h,custom:v==null?void 0:v.isCustom})]},v.key)):p("div",{class:Z("relative mb-4 z-10 "),children:[p("div",{class:"w-full p-4 relative rounded-xl bg-white border border-gray-300 mb-4",children:[p("span",{class:"block rounded-lg h-6 w-1/2 bg-gray-200"}),p("img",{class:"w-auto mx-auto h-auto max-h-36 opacity-30",src:ze("bike.png")}),p("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-100"})]}),p("div",{class:Z("w-full relative bg-white border -z-10 border-b-0 border-gray-300 rounded-t-xl h-20 mb-4","after:bottom-0 after:-inset-x-px after:-top-6 after:bg-gradient-to-t after:absolute after:from-white after:to-transparent"),children:[p("span",{class:" absolute left-4 top-4 rounded-lg h-6 w-1/2 bg-gray-200"}),p("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-100"})]}),p("div",{class:" text-gray-800 text-center flex -mt-5 z-20 justify-center",children:[l("bikeselector_home_empty"),p("br",{}),l("bikeselector_home_add_a_bike")]})]}),p("button",{onClick:v=>{v.preventDefault(),n(),Q("/add")},class:Z("duration-300 transition-colors sticky bottom-[128px] mt-auto rounded-xl p-3 pr-5 w-full flex justify-center items-center",a.length&&!(t!=null&&t.key)?"bg-gray-950 text-white":a.length?"bg-gray-200 text-gray-800":"bg-gray-950 text-white",!t&&"bottom-0",t&&h&&"bottom-[128px]",t&&!h&&"bottom-[72px]"),children:[l("bikeselector_home_add_btn"),p(Gr,{class:"h-3 absolute [&>path]:stroke-[2px] right-5 justify-self-end rotate-45"})]}),!!(a!=null&&a.length)&&!!(t!=null&&t.key)&&h&&p("button",{onClick:v=>{v.preventDefault(),!(t!=null&&t.isCustom)&&!(t!=null&&t.isShared)?Q("/workshop"):t!=null&&t.isCustom&&!(t!=null&&t.isShared)?Q("/bom"):!(t!=null&&t.isCustom)&&(t!=null&&t.isShared)&&Q("/read-only")},class:Z("duration-300 sticky bottom-[72px] transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center","bg-gray-200 text-gray-800"),children:[l("virtualworkshop_title"),p(df,{class:"h-5 absolute right-5 justify-self-end"})]}),!!(a!=null&&a.length)&&!!(t!=null&&t.key)&&p("button",{onClick:v=>{v.preventDefault(),!i.showBrowseCategoryButtons&&i.browseCompatibilityUrl?window.location.href=i.browseCompatibilityUrl:Q("/browse")},class:Z("duration-300 sticky bottom-4 transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center",a.length?"bg-gray-950 text-white":"bg-gray-200 text-gray-800"),children:l("bikeselector_home_browse_btn")}),p(vt,{})]})}const ff=i=>j("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},j("circle",{cx:10,cy:10,r:10,fill:"#030712"}),j("path",{d:"M6.57886 11.0526L9.02922 13.191L13.4604 7.02636",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Qe=({messages:i,left:e,margin:t})=>{const{t:r}=X(),[a,o]=F(""),[n,s]=F("");return V(()=>{i&&i.indexOf(" ")>=0&&(o(i.split(" ")[0]),s(i.split(" ")[1]))},[i]),p("div",{className:`flex h-4 w-auto ${e?"justify-start":"justify-center"} ${t?"mt-1":""}`,children:i&&p("p",{className:"message text-xs text-red-500",children:r(a||i,{endpoint_location:n})})})};function ci({type:i,title:e,placeholder:t,options:r=[],disabled:a=void 0,loading:o=!1,infoVisible:n=!1,children:s=void 0,error:l=null,...c}){const{t:u}=X(),d=h=>{switch(h){case"brand":return u("bikeselector_addbike_brand_desc");case"model":return u("bikeselector_addbike_model_desc");case"framespec":return u("bikeselector_addbike_framespec_desc");case"framesize":return u("bikeselector_size_framesize_desc");default:return""}},f=(h,b)=>h==="framesize"&&b==="One Size"?u("bikeselector_size_framesize_one_size"):b;return p(q,{children:p("div",{class:"w-full flex flex-col space-y-2",children:[p("label",{class:"text-gray-800 font-bold text",children:e}),s&&p("div",{class:Z("!my-0 overflow-hidden box-border transition-all duration-300",n?"max-h-screen":"h-0"),children:[p("p",{class:"text-gray-600 my-1 italic text-sm",children:d(i)}),p("div",{class:Z("rounded-xl overflow-hidden my-0 relative py-1 h-32 bg-gray-100 w-full"),children:s})]}),p("div",{class:"w-full flex items-center relative",children:[p("select",{class:Z("rounded-xl peer !pr-8 flex w-full border-gray-300 border p-4 py-3 text-lg bg-white placeholder:text-gray-700 text-gray-700","disabled:bg-gray-100 disabled:border-gray-200 disabled:text-gray-400",c.class),disabled:a,...c,children:[p("option",{value:"",selected:!c.value,disabled:!0,children:t}),r.map(h=>p("option",{value:h.value,disabled:h.disabled,children:f(i,h.label)}))]}),o?p("span",{class:"absolute block loader animate-spin right-4 w-5 h-5"}):c.value&&typeof a=="boolean"?p(ff,{class:"right-3 absolute w-5 pointer-events-none"}):p(Je,{class:"absolute h-3 text-gray-700 pointer-events-none rotate-90 right-5 peer-disabled:text-gray-400"})]}),l&&p(Qe,{messages:l,left:!0,margin:5})]})})}const Ml=i=>j("svg",{width:25,height:25,viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},j("circle",{cx:12.5,cy:12.5,r:12,fill:"white",stroke:"black"}),j("path",{d:"M9 16.0711L12.5355 12.5355M12.5355 12.5355L16.0711 9M12.5355 12.5355L16.0711 16.0711M12.5355 12.5355L9 9",stroke:"black",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})),hf=`.input_container{display:flex;flex-direction:column}.input_wrapper{width:100%;border-radius:12px;padding:12px;border:1px solid #d1d5db;display:flex;align-items:center;justify-content:space-between}.input_wrapper input{width:100%}
20
20
  `,Nl=({value:i,setValue:e,placeholder:t,type:r,error:a,submitInput:o,label:n,instructions:s})=>p(q,{children:[p("style",{type:"text/css",children:hf}),p("div",{className:"input_container",children:[n&&p("label",{class:"text-gray-800 font-bold text",children:n}),s&&p("label",{class:"text-gray-600 my-1 italic text-sm",children:s}),p("div",{className:"input_wrapper",children:[p("input",{placeholder:t,value:i,onChange:l=>e(l.currentTarget.value),type:r,onKeyDown:l=>{l.key==="Enter"&&o()}}),p(Ml,{height:20,width:20,onClick:()=>e(""),className:"cursor-pointer"})]}),p(Qe,{messages:a})]})]}),gf=`.lds-ring{display:inline-block;position:relative;width:24px;height:24px}.lds-ring div{box-sizing:border-box;display:block;position:absolute;width:19px;height:19px;margin:2px;border:2px solid #c4cdd5;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#c4cdd5 transparent transparent transparent}.lds-ring div:nth-child(1){animation-delay:-.45s}.lds-ring div:nth-child(2){animation-delay:-.3s}.lds-ring div:nth-child(3){animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
21
21
  `;function kt({isLoading:i,colour:e}){return p(q,{children:[p("style",{type:"text/css",children:gf}),p("div",{class:"lds-ring",id:"bm-loading-spinner",style:{display:i?"inline-block":"none"},children:[p("div",{style:{border:`2px solid ${e}`,borderColor:`${e} transparent transparent transparent`}}),p("div",{style:{border:`2px solid ${e}`,borderColor:`${e} transparent transparent transparent`}}),p("div",{style:{border:`2px solid ${e}`,borderColor:`${e} transparent transparent transparent`}}),p("div",{style:{border:`2px solid ${e}`,borderColor:`${e} transparent transparent transparent`}})]})]})}const st=({onClick:i,primary:e,text:t,loading:r,disabled:a,sticky:o,children:n,active:s=!0,noMargin:l=!1})=>p("button",{onClick:c=>{!a&&!r&&(c.preventDefault(),i())},class:Z("duration-300 bottom-4 transition-colors rounded-xl p-3 w-full flex justify-center items-center",`${e&&s?"bg-gray-950 text-white":e&&!s?"bg-gray-200 text-gray-400 ":"bg-gray-200 text-gray-800"} ${o&&"sticky"} ${!l&&"mt-4"}`),style:{cursor:a?"not-allowed":"pointer",opacity:a?.5:1},children:r?p(kt,{isLoading:r,colour:e?"#fff":"#000"}):p(q,{children:[p("span",{className:n?"ml-auto":"",children:t}),n]})});function mf(){const i=window.BikeMatrix.getConfig(),{bike:e,setBikeAttr:t}=Ne(),{brand:r,model:a,frameSeries:o}=e,{t:n}=X(),[s,l]=F([]),[c,u]=F(!1),d=new Se(i.apiUrl,i.apiKey,i.apiToken,i.isShopify),[f,h]=F(null),[b,m]=F(""),y=r.value,v=r.value&&a.value;V(()=>{const _=i.bikeSelectorBrands?i.bikeSelectorBrands.split(",").filter(k=>k!==""):[];if(_.length>0&&r.options.length>0){let k=[];r.options.forEach(w=>{_.includes(w.value.toString().trim())&&k.push(w)}),l(k)}else r.options.length>0&&l(r.options)},[i.bikeSelectorBrands,r.options]);const g=async()=>{u(!0);const _=await d.getBikeBom(b);if(!(_!=null&&_.success)){i.logLevel==="verbose"&&console.error(_.logError),u(!1),h(_.error);return}if(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(b)){const w=await d.getBikeBom(b),C=Br(w.data);we.value=C,e.value=await Fl(C),u(!1),Q("/confirm")}else h("error_get_bike_bom"),u(!1)};return p(q,{children:[p("div",{class:"space-y-5 relative w-full flex flex-col",children:[p(ci,{type:"brand",title:n("bikeselector_addbike_brand_label"),placeholder:n("bikeselector_addbike_brand_select"),value:r.value,options:s,onChange:_=>{t("brand",_.target.value)},loading:!r.options.length&&!r.error,disabled:!r.options.length||r.error,info:!0,infoVisible:!r.value,error:r.error,children:p("img",{src:ze("info-brand.svg"),class:"w-full h-full"})}),p(ci,{type:"model",title:n("bikeselector_addbike_model_label"),placeholder:n("bikeselector_addbike_model_select"),value:a.value,options:a.options,onChange:_=>{t("model",_.target.value)},loading:y&&!a.options.length&&!a.error,disabled:!y||!a.options.length,info:!0,infoVisible:y&&!a.value,error:a.error,children:p("img",{src:ze("info-model.svg"),class:"w-full h-full"})}),p(ci,{type:"framespec",title:n("bikeselector_addbike_framespec_label"),placeholder:n("bikeselector_addbike_framespec_select"),value:o.value,loading:v&&!o.options.length&&!o.error,options:o.options,onChange:_=>{t("frameSeries",_.target.value)},disabled:!v||!o.options.length||o.error,info:!0,infoVisible:v&&!o.value,error:o.error,children:p("img",{src:ze("info-frameseries.svg"),class:"w-full h-full"})}),i.virtualWorkshop&&p(q,{children:[p("div",{className:"flex justify-center items-center gap-2",children:[p("div",{className:"bg-gray-300 h-[1px] w-full"}),p("p",{className:" font-semibold text-sm",children:n("bikeselector_or")}),p("div",{className:"bg-gray-300 h-[1px] w-full"})]}),p(Nl,{value:b,setValue:_=>m(_),label:"Bike Matrix ID",placeholder:n("virtualworkshop_add_by_id"),type:"text",instructions:n("virtualworkshop_bm_id_text")})]})]}),p(Qe,{messages:f}),p(st,{noMargin:!0,primary:!0,text:n("bikeselector_addbike_find_btn"),onClick:()=>{r.value&&a.value&&o.value?Q("/search"):b&&g()},active:r.value&&a.value&&o.value||b,loading:c,children:p(Je,{class:"h-3 ml-auto justify-self-end"})})]})}function bf(){var b,m,y,v;const{bike:i,setBike:e,setBikeAttr:t,results:r,loading:a}=Ne(),{year:o,bikeSpec:n}=i,{t:s}=X(),[l,c]=[i.value,g=>e(_=>({..._,value:g}))],u=tt(()=>{const g=r==null?void 0:r.filter(_=>{var w;let k=!0;return n.value&&(k=_.bikeSpec===n.value),k&&o.value.length&&(k=(w=o.value)==null?void 0:w.includes(_.year)),k});return g.some(_=>_._key==l._key)||c({}),g},[r,n.value,o.value]),d=tt(()=>n.value?r.filter(_=>n.value==_.bikeSpec).map(_=>_.year):o.options.map(_=>_.value),[n.value]),f=tt(()=>{var _;if(!((_=o.value)!=null&&_.length))return n.options;const g=r.filter(k=>{var w;return(w=o.value)==null?void 0:w.includes(k.year)}).map(k=>k.bikeSpec);return n.options.map(k=>({...k,disabled:!g.includes(k.value)}))},[n.options,o.value]),h=g=>g===0?s("bikeselector_search_no_bikes_found"):g===1?s("bikeselector_search_one_bike_found"):s("bikeselector_search_number_bikes_found",{number_found:g});return p(q,{children:[p("div",{class:"space-y-3 mb-6 relative w-full flex flex-col",children:[(i.bikeSpec.error||i.frameSize.error||i.year.error)&&p(Qe,{messages:i.bikeSpec.error||i.frameSize.error||i.year.error}),p(ci,{type:"bikespec",title:s("bikeselector_search_bikespec_label"),placeholder:s("bikeselector_search_bikespec_select"),value:n.value,options:[{label:s("bikeselector_search_bikespec_select_all"),value:""},...f],onChange:g=>{t("bikeSpec",g.target.value)},disabled:!((b=n.options)!=null&&b.length)||i.bikeSpec.error,loading:!((m=n.options)!=null&&m.length)&&!i.bikeSpec.error}),p("div",{class:"w-full flex flex-col space-y-2",children:[p("label",{class:"text-gray-800 font-bold text",children:s("bikeselector_search_year_label")}),p("div",{class:Z("flex space-x-2 overflow-x-auto","-mx-8 w-[calc(100%_+_64px)] px-8 no-scrollbar"),children:(y=o.options)!=null&&y.length?(v=o.options)==null?void 0:v.map(g=>{var w;const _=n.value&&!d.includes(g.value),k=(w=o.value)==null?void 0:w.includes(g.value);return p("div",{onClick:()=>{_||t("year",k?o.value.filter(C=>C!==g.value):[...o.value,g.value])},class:Z("rounded-full cursor-pointer items-center flex border py-2 px-4",k?"pr-3 bg-gray-950 border-gray-950 text-white":"border-gray-300 text-gray-700 ",_&&"hidden"),children:[g.label,k&&p(Gr,{class:"w-3 h-3 ml-2"})]})}):Array(2).fill(0).map((g,_)=>p("div",{class:"rounded-full items-center flex border py-2 bg-gray-100 px-4 bg-100 border-gray-300 animate-pulse",children:p("span",{class:"rounded-lg bg-gray-100 w-9 h-5"})},_))})]}),p("div",{class:Z("text-nowrap font-medium w-full flex","[&>span]:text-gray-500 [&>span]:font-normal"),children:[a?p(q,{children:s("bikeselector_search_searching")}):p(q,{children:h(u.length)})," ",(r==null?void 0:r.length)>0&&p(q,{children:[p("span",{children:"("}),p("span",{class:"whitespace-nowrap overflow-hidden text-ellipsis truncate",children:[r[0].brand," ",r[0].frameSeries]}),p("span",{children:")"})]})]}),p("div",{class:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:u!=null&&u.length&&!a?u.map((g,_)=>p(Xe,{"data-key":g._key,bike:g,selected:g._key===l._key,onClick:k=>{k.preventDefault(),c(g)},compact:!0},g._key)):Array(a?2:1).fill(0).map((g,_)=>p("div",{class:Z("w-full relative rounded-xl h-40 bg-white border border-gray-200 ",a&&"animate-pulse"),children:[p("span",{class:" absolute left-4 top-4 rounded-lg h-6 w-1/2 bg-gray-200"}),p("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-200"})]},_))})]}),p("button",{onClick:g=>{var _,k;if(g.preventDefault(),l._key){const w=(_=this.base.querySelector(`[data-key="${l._key}"] [data-active-slide]`))==null?void 0:_.getAttribute("data-active-slide"),A=[(k=this.base.querySelector(`[data-key="${l._key}"] [data-slide="${w}"] img`))==null?void 0:k.src].filter(D=>!!D);A!=null&&A.length&&e(D=>(D.value={...D.value||{},images:A},{...D})),Q("/size")}},class:Z("duration-300 transition-colors sticky bottom-6 mt-auto rounded-xl p-3 pr-5 w-full flex justify-center items-center",l._key?"bg-gray-950 text-white":"bg-gray-200 text-gray-400 "),children:[p("span",{class:"ml-auto",children:s("bikeselector_search_confirm_btn")})," ",p(Je,{class:"h-3 ml-auto justify-self-end"})]})]})}function _f(){var o,n;const{bike:i,setBikeAttr:e,setBike:t}=Ne(),{frameSize:r}=i,{t:a}=X();return V(()=>{var s;(s=r.options)!=null&&s.length||Q("/confirm")},[]),p(q,{children:[p(Xe,{bike:i.value,selected:!0,compact:!0}),p("div",{class:" mt-4 mb-6 relative w-full flex flex-col",children:p(ci,{type:"framesize",instruction:!0,title:a("bikeselector_size_framesize_label"),placeholder:a("bikeselector_size_framesize_select"),value:r.value,options:r.options,onChange:s=>{e("frameSize",s.target.value),t(l=>{var c;return l.value.frameSize=((c=r.options.find(u=>u.value==s.target.value))==null?void 0:c.label)||"",l})},selected:!0,info:!0,infoVisible:!0,disabled:!((o=r.options)!=null&&o.length),loading:!((n=r.options)!=null&&n.length),children:p("img",{src:ze("info-size.svg"),class:"w-full h-full"})})}),p("button",{onClick:s=>{s.preventDefault(),r.value&&Q("/confirm")},class:Z("duration-300 transition-colors sticky bottom-10 mt-auto rounded-xl p-3 pr-5 w-full flex justify-center items-center",r.value?"bg-gray-950 text-white":"bg-gray-200 text-gray-400 "),children:[p("span",{class:"ml-auto",children:a("bikeselector_size_confirm_btn")})," ",p(Je,{class:"h-3 ml-auto justify-self-end"})]})]})}const lt=ke({title:"",step:0,back:""});function vf({children:i}){const{t:e}=X();return p(q,{children:[p("div",{class:"relative flex items-center justify-center w-full h-10 my-5 sm:mt-8",children:[!!lt.value.back&&p("div",{onClick:()=>Q(lt.value.back),class:" w-10 h-10 absolute left-0 rounded-xl self-start border-gray-200 border items-center justify-center flex",children:p(Je,{class:"h-3 text-gray-500 -translate-x-px -rotate-180"})}),p("h2",{class:"text-xl font-bold",style:{maxWidth:"70%",textAlign:"center"},children:e(lt.value.title)})]}),i,typeof lt.value.step<"u"&&p("div",{class:"space-x-2 my-6 flex items-center justify-center",children:[0,1,2,3].map(t=>p("div",{class:Z("rounded-xl h-2 transition-all duration-300",t==lt.value.step?"w-6 bg-gray-950":"w-2 bg-gray-200")},t))})]})}function yf(){const{bike:i,saveBike:e}=Ne(),{brand:t,model:r,frameSeries:a,frameSize:o,year:n,bikeSpec:s}=i.value,{t:l}=X(),c=we.value;return V(()=>{!o&&!c?lt.value.back="/search":c&&(lt.value.back="/add")},[]),p(q,{children:[p(Xe,{bike:i.value,selected:!0,compact:!0}),p("div",{class:" space-y-4 mt-4 mb-6 relative w-full flex flex-col",children:[{title:l("bikeselector_confirm_brandmodelframespec_label"),value:[t,r,a].join(", "),path:"/add"},{title:l("bikeselector_confirm_yearbikespec_label"),value:[n,s].join(", "),path:"/search"},{title:l("bikeselector_confirm_framesize_label"),value:o,path:"/size"}].filter(u=>!!u.value).map(u=>p("div",{class:"w-full flex flex-col space-y-2",children:[p("label",{class:"text-gray-800 font-bold",children:u.title}),p("div",{onClick:()=>Q(u.path),class:"w-full flex items-center relative cursor-pointer",children:[p("div",{class:Z("rounded-xl peer whitespace-nowrap truncate !pr-8 flex w-full border-gray-300 border p-4 py-3 text-lg placeholder:text-gray-700 text-gray-700"),children:u.value}),p(Je,{class:"absolute h-3 text-gray-700 pointer-events-none right-4 peer-disabled:text-gray-400"})]})]},u.path))}),p("button",{onClick:u=>{u.preventDefault(),e(i.value),Q("/browse")},class:Z("duration-300 transition-colors sticky bottom-10 mt-auto rounded-xl p-3 w-full flex justify-center items-center","bg-gray-950 text-white"),children:l("bikeselector_confirm_confirm_btn")}),p("p",{class:"text-gray-600 -mb-3 mt-2 text-center font-normal text-xs",children:l("bikeselector_confirm_notyourride_msg")})]})}function kf(){const{currentBike:i,compatibleCollections:e}=Ne(),[t,r]=F(!0),[a,o]=F(),{t:n}=X(),s=()=>{if(e&&e.length>0){let l=[];e.map(c=>{l.some(u=>u.text_id===c.text_id)||l.push(c)}),o(l)}};return V(()=>{s()},[e]),V(()=>{a&&r(!1)},[a]),p(q,{children:[p(Xe,{bike:i,selected:!0}),!!(a!=null&&a.length)&&!e.error&&p(q,{children:[p("p",{class:"text-gray-800 mt-4 font-bold",children:n("bikeselector_browse_products_label")}),p("div",{class:"gap-3 mt-2 mb-6 relative w-full flex flex-wrap",children:a.map(l=>p("a",{href:l.url,class:"group flex items-center relative cursor-pointer",children:[p("div",{class:Z("rounded-xl peer whitespace-nowrap truncate !pr-8 flex w-full border-gray-300 border p-4 py-3 text-lg placeholder:text-gray-700 text-gray-950","group-disabled:bg-gray-100 group-disabled:border-gray-200 group-disabled:text-gray-400"),children:n(l.text_id)}),p(Je,{class:"absolute h-3 pointer-events-none right-4 group-disabled:text-gray-400 text-gray-950"})]},l.text_id))})]}),p("div",{style:{width:"100%",display:"flex",justifyContent:"center",marginTop:"1rem"},children:p(kt,{isLoading:t,colour:"#000"})}),e&&(e==null?void 0:e.error)&&p(Qe,{messages:e.error,left:!0,margin:20}),p("button",{onClick:l=>{l.preventDefault(),Er()},class:Z("duration-300 transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center","bg-gray-950 text-white"),children:n("bikeselector_browse_shop_btn")}),p("button",{onClick:l=>{l.preventDefault(),Q("/")},class:Z("duration-300 transition-colors mt-4 rounded-xl p-3 w-full flex justify-center items-center","bg-gray-200 text-gray-800"),children:n("bikeselector_browse_back_btn")}),p(vt,{})]})}const zr=()=>p("div",{class:"w-full p-4 relative rounded-xl bg-white border border-gray-300 mb-4",children:[p("span",{class:"block rounded-lg h-6 w-1/2 bg-gray-200"}),p("img",{class:"w-auto mx-auto h-auto max-h-36 opacity-30",src:ze("bike.png")}),p("span",{class:" absolute right-4 bottom-4 rounded-full h-8 w-8 bg-gray-100"})]});function wf(){const{t:i}=X(),t=window.BikeMatrix.getConfig(),{currentBike:r,setCurrentBike:a,compatibleCollections:o}=Ne(),n=new Se(t.apiUrl,t.apiKey,t.apiToken,t.isShopify),[s,l]=F(!1),[c,u]=F(null),{saveBike:d}=Ne(),f=async()=>{l(!0);const h=await n.addCustomBike(r.key);if(h.success){const b=await n.getBikeBom(h==null?void 0:h.data);if(!b.success){u(b.error),l(!1),t.logLevel==="verbose"&&console.error(b.logError);return}const m=Br(b.data);we.value=m;const y={...r,key:m.bike_Key,isCustom:!0,shareId:m.share_Bike_Key};d(y),a(y),l(!1),Q("/bom")}else{u(h.error),l(!1),t.logLevel==="verbose"&&console.error(h.logError);return}};return p(q,{children:[p("div",{style:{marginBottom:"1rem"},children:[r?p(Xe,{bike:r,noSymbol:!0,compact:!0}):p(zr,{}),p("div",{class:" text-gray-800 text-center flex z-20 justify-center font-bold mt-6",children:!o.error&&o.length>1?i("virtualworkshop_intro_text"):i("virtualworkshop_do_not_pass")})]}),p(Qe,{messages:c||o.error}),p(st,{text:!o.error&&o.length>1?i("virtualworkshop_enter_button"):i("bikeselector_browse_back_btn"),onClick:!o.error&&o.length>1?()=>f():()=>Q("/"),loading:s,primary:!0}),p(vt,{})]})}const xf=`.overflowing{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;justify-content:flex-start}.flexend{justify-content:flex-end}
22
22
  `,wt=({paragraph:i,subheader:e,header:t,text:r,small:a,left:o,bold:n,capitalize:s,nowrap:l,flexend:c})=>p(q,{children:[p("style",{type:"text/css",children:xf}),t?p("h2",{class:"text-xl font-bold",children:r}):e?p("h4",{className:`text-gray-800 text-center flex z-20 justify-center font-bold ${s?"capitalize":""}`,children:r}):p("p",{class:`text-gray-800 flex z-20 ${a?"text-sm":""} ${o?"text-start justify-start":"text-center justify-center"} ${n?"font-bold":""} ${s?"capitalize":""} ${l?"overflowing":""} ${c?"flexend":""}`,children:r})]}),Cf=`.background-alert-wrapper{opacity:0;position:absolute;height:100%;width:100%;display:none;top:0;left:0;pointer-events:none}.alert-wrapper{position:absolute;z-index:200;width:calc(100% + 16px);height:100%;background-color:#0003;top:0;left:-8px;border-radius:12px;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none}.alert{width:80%;padding:2rem;border-radius:12px;background-color:#fff;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:300}.text-wrapper{display:flex;flex-direction:column;align-items:center;gap:1rem}.button-wrapper{display:flex;gap:1rem;width:100%;margin-top:1rem}