@orderingstack/front-components-product-configurator 1.5.2-beta.0 → 1.5.3-beta.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"MenuOptions.d.ts","sourceRoot":"","sources":["MenuOptions.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAKxD,UAAU,KAAK;IACb,WAAW,EAAE,QAAQ,CAAA;IACrB,WAAW,EAAE,QAAQ,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,WAAW,UAAW,KAAK,uBAkDvC,CAAA"}
1
+ {"version":3,"file":"MenuOptions.d.ts","sourceRoot":"","sources":["MenuOptions.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAKxD,UAAU,KAAK;IACb,WAAW,EAAE,QAAQ,CAAA;IACrB,WAAW,EAAE,QAAQ,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,WAAW,UAAW,KAAK,uBAiDvC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useMenuProduct.d.ts","sourceRoot":"","sources":["useMenuProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AASvE,wBAAgB,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ;;;;;;;;;;;;6BA2GvF,GAAG;;;;EA6CpC"}
1
+ {"version":3,"file":"useMenuProduct.d.ts","sourceRoot":"","sources":["useMenuProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AASvE,wBAAgB,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ;;;;;;;;;;;;6BA+GvF,GAAG;;;;EA6CpC"}
package/dist/index.cjs.js CHANGED
@@ -8,7 +8,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  */var op=N.default,ap=Symbol.for("react.element"),sp=Symbol.for("react.fragment"),up=Object.prototype.hasOwnProperty,lp=op.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,cp={key:!0,ref:!0,__self:!0,__source:!0};function ds(e,t,r){var n,i={},o=null,a=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)up.call(t,n)&&!cp.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:ap,type:e,key:o,ref:a,props:i,_owner:lp.current}}Nr.Fragment=sp;Nr.jsx=ds;Nr.jsxs=ds;Tr.exports=Nr;const x=Tr.exports.jsx,B=Tr.exports.jsxs,je=Tr.exports.Fragment;function Oo(e){const{isOk:t,isErr:r,info:n}=e;return B("p",{className:`${t?"text-green-600":r&&"text-red-600"} ml-1 flex`,children:[t&&fp,r&&dp,n]})}const fp=x("svg",{className:"w-6 h-6 text-green-600",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","data-testid":"form-check-mark",children:x("polyline",{points:"20 6 9 17 4 12"})}),dp=x("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","data-testid":"form-exclamation-mark",children:x("path",{strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})});var gp={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},pp={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function Ut(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ut=function(t){return typeof t}:Ut=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ut(e)}function wo(e){return hp(e)||mp(e)||vp(e)||yp()}function hp(e){if(Array.isArray(e))return e}function mp(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function vp(e,t){if(!!e){if(typeof e=="string")return Eo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Eo(e,t)}}function Eo(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var bp={normalizePrecision:function(t){var r=t.reduce(function(n,i){return Math.max(n.getPrecision(),i.getPrecision())});return t.map(function(n){return n.getPrecision()!==r?n.convertPrecision(r):n})},minimum:function(t){var r=wo(t),n=r[0],i=r.slice(1),o=n;return i.forEach(function(a){o=o.lessThan(a)?o:a}),o},maximum:function(t){var r=wo(t),n=r[0],i=r.slice(1),o=n;return i.forEach(function(a){o=o.greaterThan(a)?o:a}),o}};function gs(e){return!isNaN(parseInt(e))&&isFinite(e)}function Sp(e){return gs(e)&&e<=100&&e>=0}function Op(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function Po(e){return e%2===0}function xo(e){return gs(e)&&!Number.isInteger(e)}function wp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=e.toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var r=t.split(".")[1];return r?r.length:0}function $t(e){return Math.abs(e)%1===.5}function Ep(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(r,n){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?r(JSON.parse(i.responseText)):n(new Error(i.statusText)))},onerror:function(){n(new Error("Network error"))}});i.open("GET",e,!0),Pp(i,t.headers),i.send()})}function Pp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var r in t)e.setRequestHeader(r,t[r]);return e}function Mt(e){return typeof e=="undefined"}function ps(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(n){if(Ut(n[1])==="object"){var i=ps(n[1]);Object.entries(i).forEach(function(o){r[n[0]+t+o[0]]=o[1]})}else r[n[0]]=n[1]}),r}function xp(e){return Boolean(e)&&(Ut(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function hs(){var e=function(n,i){var o=function(u){return Math.pow(10,wp(u))},a=Math.max(o(n),o(i));return Math.round(n*a)*Math.round(i*a)/(a*a)},t={HALF_ODD:function(n){var i=Math.round(n);return $t(n)&&Po(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return $t(n)?Po(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return $t(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return $t(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return $t(n)?Math.sign(n)*Math.ceil(Math.abs(n)):Math.round(n)},DOWN:function(n){return Math.floor(n)}};return{add:function(n,i){return n+i},subtract:function(n,i){return n-i},multiply:function(n,i){return xo(n)||xo(i)?e(n,i):n*i},divide:function(n,i){return n/i},modulo:function(n,i){return n%i},round:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return t[i](n)}}}var Ap=hs();function Cp(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return t!==null?t.slice(1).filter(function(n){return!Mt(n)}):[]},getMinimumFractionDigits:function(){var n=function(o){return o==="."};return Mt(this.getMatches().find(n))?0:this.getMatches()[Ap.add(this.getMatches().findIndex(n),1)].split("").length},getCurrencyDisplay:function(){var n={USD:"code",dollar:"name",$:"symbol"};return n[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return Mt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Mt(this.getMatches().find(function(n){return n===","}))}}}function _p(e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;for(var a in o)i=i.replace("{{".concat(a,"}}"),o[a]);return i},r=function(i,o){return Ep(t(e.endpoint,{from:i,to:o}),{headers:e.headers})};return{getExchangeRate:function(i,o){return(xp(e.endpoint)?e.endpoint:r(i,o)).then(function(a){return ps(a)[t(e.propertyPath,{from:i,to:o})]})}}}function Wt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function Tp(e){Wt(Sp(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Np(e){Wt(Op(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function on(e){Wt(Number.isInteger(e),"You must provide an integer.",TypeError)}var Q=hs(),Ip=function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),n=r.amount,i=r.currency,o=r.precision;on(n),on(o);var a=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,l=e.globalFormatRoundingMode,f=Object.assign({},e.globalExchangeRatesApi),c=function(p){var y=Object.assign({},Object.assign({},{amount:n,currency:i,precision:o},p),Object.assign({},{locale:this.locale},p));return Object.assign(e({amount:y.amount,currency:y.currency,precision:y.precision}),{locale:y.locale})},g=function(p){Wt(this.hasSameCurrency(p),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return i},getLocale:function(){return this.locale||a},setLocale:function(p){return c.call(this,{locale:p})},getPrecision:function(){return o},convertPrecision:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;on(p);var b=this.getPrecision(),h=p>b,v=h?Q.multiply:Q.divide,P=h?[p,b]:[b,p],E=Math.pow(10,Q.subtract.apply(Q,P));return c.call(this,{amount:Q.round(v(this.getAmount(),E),y),precision:p})},add:function(p){g.call(this,p);var y=e.normalizePrecision([this,p]);return c.call(this,{amount:Q.add(y[0].getAmount(),y[1].getAmount()),precision:y[0].getPrecision()})},subtract:function(p){g.call(this,p);var y=e.normalizePrecision([this,p]);return c.call(this,{amount:Q.subtract(y[0].getAmount(),y[1].getAmount()),precision:y[0].getPrecision()})},multiply:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return c.call(this,{amount:Q.round(Q.multiply(this.getAmount(),p),y)})},divide:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return c.call(this,{amount:Q.round(Q.divide(this.getAmount(),p),y)})},percentage:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return Tp(p),this.multiply(Q.divide(p,100),y)},allocate:function(p){var y=this;Np(p);for(var b=p.reduce(function(E,w){return Q.add(E,w)}),h=this.getAmount(),v=p.map(function(E){var w=Math.floor(Q.divide(Q.multiply(y.getAmount(),E),b));return h=Q.subtract(h,w),c.call(y,{amount:w})}),P=0;h>0;)p[P]>0&&(v[P]=v[P].add(c.call(this,{amount:1})),h=Q.subtract(h,1)),P+=1;return v},convert:function(p){var y=this,b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=b.endpoint,v=h===void 0?f.endpoint:h,P=b.propertyPath,E=P===void 0?f.propertyPath||"rates.{{to}}":P,w=b.headers,C=w===void 0?f.headers:w,T=b.roundingMode,R=T===void 0?u:T,F=Object.assign({},{endpoint:v,propertyPath:E,headers:C,roundingMode:R});return _p(F).getExchangeRate(this.getCurrency(),p).then(function(j){return Wt(!Mt(j),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),c.call(y,{amount:Q.round(Q.multiply(y.getAmount(),parseFloat(j)),F.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){g.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()<y[1].getAmount()},lessThanOrEqual:function(p){g.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()<=y[1].getAmount()},greaterThan:function(p){g.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()>y[1].getAmount()},greaterThanOrEqual:function(p){g.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()>=y[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return Q.modulo(this.getAmount(),Math.pow(10,o))!==0},hasCents:function(){return Q.modulo(this.getAmount(),Math.pow(10,o))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var y=e.normalizePrecision([this,p]);return y[0].getAmount()===y[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,b=Cp(p);return this.toRoundedUnit(b.getMinimumFractionDigits(),y).toLocaleString(this.getLocale(),{currencyDisplay:b.getCurrencyDisplay(),useGrouping:b.getUseGrouping(),minimumFractionDigits:b.getMinimumFractionDigits(),style:b.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Q.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,b=Math.pow(10,p);return Q.divide(Q.round(Q.multiply(this.toUnit(),b),y),b)},toObject:function(){return{amount:n,currency:i,precision:o}},toJSON:function(){return this.toObject()}}},$p=Object.assign(Ip,gp,pp,bp);const rr=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),n=Number(r)*100;return isNaN(n)?"0.00":$p({amount:Math.round(n),currency:t}).toFormat("0,0.00")},Rp=(e,t,r=1)=>{const n=parseFloat(e.toString());let i=!1,o=rr(`${r*n}`);const a=`${rr(`${o}`)}`;return n<parseFloat(t)&&(i=!0,o=`${rr(`${t}`)}`),{displayPriceFrom:i,formattedEndPriceWithPriceMin:o,formattedEndPrice:a}};function Ir(e){const{price:t,addPlusBefore:r=!1,size:n="md",showIfPriceZero:i=!1,minPrice:o="0.00",hiddenIfPriceZero:a=!1}=e,s=parseFloat(o),u=t>s?t:o,l=rr(`${u}`);return!t&&i===!1?null:r?B("span",{style:{visibility:`${!t&&a?"hidden":"visible"}`},className:"",children:["\xA0",`+${l}`]}):t<s?B("span",{className:"",children:["\xA0",`od ${l}`]}):x("span",{className:"",children:l})}function Lp(e,t){const{selCtx:r,id:n}=e,i=re(s=>s.expanded),o=S.useMemo(()=>Fp(r,n,t,i),[r,n,t,i]),a=re(s=>s.toggleExpanded);return{isExpanded:o,toggleExpanded:a}}const Fp=(e,t,r,n)=>{const i=n[e+t+r];return i!==void 0?i:!0};var kp=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Mp={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xA9","&#169;":"\xA9","&reg;":"\xAE","&#174;":"\xAE","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},Dp=function(t){return Mp[t]},jp=function(t){return t.replace(kp,Dp)};function Ao(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Co(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ao(Object(r),!0).forEach(function(n){Ue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ao(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var En={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:jp},ms,Up=S.createContext();function Vp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};En=Co(Co({},En),e)}function Bp(){return En}var Hp=function(){function e(){Ae(this,e),this.usedNamespaces={}}return Ce(e,[{key:"addUsedNamespaces",value:function(r){var n=this;r.forEach(function(i){n.usedNamespaces[i]||(n.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function Wp(e){ms=e}function Gp(){return ms}var zp={type:"3rdParty",init:function(t){Vp(t.options.react),Wp(t)}};function Kp(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[0]=="string"&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var _o={};function Pn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&_o[t[0]]||(typeof t[0]=="string"&&(_o[t[0]]=new Date),Kp.apply(void 0,t))}function To(e,t,r){e.loadNamespaces(t,function(){if(e.isInitialized)r();else{var n=function i(){setTimeout(function(){e.off("initialized",i)},0),r()};e.on("initialized",n)}})}function Yp(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(n.toLowerCase()==="cimode")return!0;var a=function(u,l){var f=t.services.backendConnector.state["".concat(u,"|").concat(l)];return f===-1||f===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(n,e)&&(!i||a(o,e)))}function Qp(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Pn("i18n.languages were undefined or empty",t.languages),!0;var n=t.options.ignoreJSONStructure!==void 0;return n?t.hasLoadedNamespace(e,{precheck:function(o,a){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):Yp(e,t,r)}function qp(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(f){l=!0,i=f}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}function Jp(e,t){return zo(e)||qp(e,t)||Ko(e,t)||Yo()}function No(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function an(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?No(Object(r),!0).forEach(function(n){Ue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):No(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Zp=function(t,r){var n=S.useRef();return S.useEffect(function(){n.current=r?n.current:t},[t,r]),n.current};function Yn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,n=S.useContext(Up)||{},i=n.i18n,o=n.defaultNS,a=r||i||Gp();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new Hp),!a){Pn("You will need to pass in an i18next instance by using initReactI18next");var s=function(F){return Array.isArray(F)?F[F.length-1]:F},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}a.options.react&&a.options.react.wait!==void 0&&Pn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var l=an(an(an({},Bp()),a.options.react),t),f=l.useSuspense,c=l.keyPrefix,g=e||o||a.options&&a.options.defaultNS;g=typeof g=="string"?[g]:g||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(g);var d=(a.isInitialized||a.initializedStoreOnce)&&g.every(function(R){return Qp(R,a,l)});function p(){return a.getFixedT(null,l.nsMode==="fallback"?g:g[0],c)}var y=S.useState(p),b=Jp(y,2),h=b[0],v=b[1],P=g.join(),E=Zp(P),w=S.useRef(!0);S.useEffect(function(){var R=l.bindI18n,F=l.bindI18nStore;w.current=!0,!d&&!f&&To(a,g,function(){w.current&&v(p)}),d&&E&&E!==P&&w.current&&v(p);function j(){w.current&&v(p)}return R&&a&&a.on(R,j),F&&a&&a.store.on(F,j),function(){w.current=!1,R&&a&&R.split(" ").forEach(function(L){return a.off(L,j)}),F&&a&&F.split(" ").forEach(function(L){return a.store.off(L,j)})}},[a,P]);var C=S.useRef(!0);S.useEffect(function(){w.current&&!C.current&&v(p),C.current=!1},[a,c]);var T=[h,a,d];if(T.t=h,T.i18n=a,T.ready=d,d||!d&&!f)return T;throw new Promise(function(R){To(a,g,function(){R()})})}var vs=[],Xp=vs.forEach,eh=vs.slice;function th(e){return Xp.call(eh.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var Io=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,rh=function(t,r,n){var i=n||{};i.path=i.path||"/";var o=encodeURIComponent(r),a="".concat(t,"=").concat(o);if(i.maxAge>0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!Io.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(i.domain)}if(i.path){if(!Io.test(i.path))throw new TypeError("option path is invalid");a+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var u=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(u){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},$o={create:function(t,r,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),i&&(o.domain=i),document.cookie=rh(t,encodeURIComponent(r),o)},read:function(t){for(var r="".concat(t,"="),n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(r)===0)return o.substring(r.length,o.length)}return null},remove:function(t){this.create(t,"",-1)}},nh={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var n=$o.read(t.lookupCookie);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&$o.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},ih={name:"querystring",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=n.substring(1),o=i.split("&"),a=0;a<o.length;a++){var s=o[a].indexOf("=");if(s>0){var u=o[a].substring(0,s);u===t.lookupQuerystring&&(r=o[a].substring(s+1))}}}return r}},Rt=null,Ro=function(){if(Rt!==null)return Rt;try{Rt=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Rt=!1}return Rt},oh={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&Ro()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&Ro()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},Lt=null,Lo=function(){if(Lt!==null)return Lt;try{Lt=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Lt=!1}return Lt},ah={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&Lo()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&Lo()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},sh={name:"navigator",lookup:function(t){var r=[];if(typeof navigator!="undefined"){if(navigator.languages)for(var n=0;n<navigator.languages.length;n++)r.push(navigator.languages[n]);navigator.userLanguage&&r.push(navigator.userLanguage),navigator.language&&r.push(navigator.language)}return r.length>0?r:void 0}},uh={name:"htmlTag",lookup:function(t){var r,n=t.htmlTag||(typeof document!="undefined"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},lh={name:"path",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof n[t.lookupFromPathIndex]!="string")return;r=n[t.lookupFromPathIndex].replace("/","")}else r=n[0].replace("/","")}return r}},ch={name:"subdomain",lookup:function(t){var r=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,n=typeof window!="undefined"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!!n)return n[r]}};function fh(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var ys=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ae(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return Ce(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r,this.options=th(n,this.options||{},fh()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(nh),this.addDetector(ih),this.addDetector(oh),this.addDetector(ah),this.addDetector(sh),this.addDetector(uh),this.addDetector(lh),this.addDetector(ch)}},{key:"addDetector",value:function(r){this.detectors[r.name]=r}},{key:"detect",value:function(r){var n=this;r||(r=this.options.order);var i=[];return r.forEach(function(o){if(n.detectors[o]){var a=n.detectors[o].lookup(n.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(r,n){var i=this;n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||n.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(r,i.options)}))}}]),e}();ys.type="languageDetector";const dh={"OS.ProductConfigurator.Selected.Message.From":"od","OS.ProductConfigurator.Selected.Message.UpTo":"do","OS.ProductConfigurator.Selected.Message.Choose":"Wybierz","OS.ProductConfigurator.Selected.Message.Options":"opcji","OS.ProductConfigurator.Selected.Message.OneOption":"Wybierz 1 opcj\u0119","OS.ProductConfigurator.Quantity.Message.UpTo":"do","OS.ProductConfigurator.Quantity.Message.From":"od","OS.ProductConfigurator.Quantity.Message.Max":"maksymalnie","OS.ProductConfigurator.Quantity.Message.Quantity":"ilo\u015Bci","OS.ProductConfigurator.Quantity.Message.OneOption":"Wybierz maksymalnie jedn\u0105 opcj\u0119","OS.ProductConfigurator.Add":"Dodaj","OS.ProductConfigurator.Back":"Wr\xF3\u0107","OS.ProductConfigurator.ShowMore":"Poka\u017C wi\u0119cej","OS.ProductConfigurator.ShowLess":"Poka\u017C mniej"},gh={"OS.ProductConfigurator.Selected.Message.From":"from","OS.ProductConfigurator.Selected.Message.UpTo":"up to","OS.ProductConfigurator.Selected.Message.Choose":"Choose","OS.ProductConfigurator.Selected.Message.Options":"options","OS.ProductConfigurator.Selected.Message.OneOption":"Choose one option","OS.ProductConfigurator.Quantity.Message.UpTo":"up to","OS.ProductConfigurator.Quantity.Message.From":"from","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"quantity","OS.ProductConfigurator.Quantity.Message.OneOption":"Choose maximum one option","OS.ProductConfigurator.Add":"Add","OS.ProductConfigurator.Back":"Back","OS.ProductConfigurator.ShowMore":"Show more","OS.ProductConfigurator.ShowLess":"Show less"},ph={"OS.ProductConfigurator.Selected.Message.From":"ab","OS.ProductConfigurator.Selected.Message.UpTo":"bis","OS.ProductConfigurator.Selected.Message.Choose":"W\xE4hle","OS.ProductConfigurator.Selected.Message.Options":"Optionen","OS.ProductConfigurator.Selected.Message.OneOption":"W\xE4hle eine Option","OS.ProductConfigurator.Quantity.Message.UpTo":"ab","OS.ProductConfigurator.Quantity.Message.From":"aus","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"Menge","OS.ProductConfigurator.Quantity.Message.OneOption":"W\xE4hle bis zu 1 Option aus","OS.ProductConfigurator.Add":"Hinzuf\xFCgen","OS.ProductConfigurator.Back":"Zur\xFCck","OS.ProductConfigurator.ShowMore":"Zeig mehr","OS.ProductConfigurator.ShowLess":"Zeig weniger"},hh={"OS.ProductConfigurator.Selected.Message.From":"from","OS.ProductConfigurator.Selected.Message.UpTo":"up to","OS.ProductConfigurator.Selected.Message.Choose":"Choose","OS.ProductConfigurator.Selected.Message.Options":"options","OS.ProductConfigurator.Selected.Message.OneOption":"Choose one option","OS.ProductConfigurator.Quantity.Message.UpTo":"up to","OS.ProductConfigurator.Quantity.Message.From":"from","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"quantity","OS.ProductConfigurator.Quantity.Message.OneOption":"Choose maximum one option","OS.ProductConfigurator.Add":"Add","OS.ProductConfigurator.Back":"Back","OS.ProductConfigurator.ShowMore":"Show more","OS.ProductConfigurator.ShowLess":"Show less"};pe.use(ys).use(zp).init({resources:{pl:{translation:dh},en:{translation:gh},de:{translation:ph},cs:{translation:hh}}});const mh=(e,t,r,n)=>{let i="",o="";const a=Number(e),s=Number(t);return a>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.From")} ${a}`,a>r&&(o=xe.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(o=xe.TOO_MUCH)),a>=0||s>=0&&r<a?(i=`${n("OS.ProductConfigurator.Quantity.Message.Max")}${i}`,i+=` ${n("OS.ProductConfigurator.Quantity.Message.Quantity")}`):a===1&&a===1?i=`${n("OS.ProductConfigurator.Quantity.Message.OneOption")}`:(i="",o=xe.IGNORE),r>=a&&r<=s&&(o=xe.OK),{message:i,validationStatus:o}},vh=(e,t,r,n)=>{let i="",o="";const a=parseInt(e||"-1"),s=parseInt(t||"-1");return a>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.From")} ${a}`,a>r&&(o=xe.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(o=xe.TOO_MUCH)),a>=0||s>=0?(i=`${n("OS.ProductConfigurator.Selected.Message.Choose")}${i}`,i+=` ${n("OS.ProductConfigurator.Selected.Message.Options")}`):(i="",o=xe.IGNORE),a===1&&s===1&&(i=`${n("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=a&&r<=s&&(o=xe.OK),{message:i,validationStatus:o}},yh=e=>{const{optionsItem:t,parentSelCtx:r,selected:n,isOnSubmitted:i,actualQtyCnt:o,actualSelCnt:a,children:s}=e,{selCtx:u,details:l={},id:f,attrs:c={}}=t,{qtyMin:g,qtyMax:d,selMin:p,selMax:y}=c,{name:b,description:h}=l.literals||{},{t:v}=Yn(),{isExpanded:P,toggleExpanded:E}=Lp(t,r),{validationStatus:w,message:C}=vh(p,y,a,v),{validationStatus:T,message:R}=mh(g,d,o,v),F=w===xe.OK,j=T===xe.OK,L=!F&&i&&!!C,D=!j&&i&&!!R;return B("div",{className:"pt-1 mb-3",id:Gg(u),children:[B("div",{className:"flex text-xl font-semibold",children:[x("p",{className:"",children:b}),b&&b!==" "&&B(je,{children:[x("div",{className:"ml-auto",children:x(Ir,{price:jn(n,t)})}),x("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!P&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>E(u,f,r),children:x("polyline",{points:"18 15 12 9 6 15"})})]})]}),x("p",{className:`${h&&"mb-2"}`,children:h}),!1,x("div",{className:"flex",children:B("div",{children:[x(Oo,{isOk:F,isErr:L,info:C}),x(Oo,{isOk:j,isErr:D,info:R})]})}),x("div",{className:`${P?"block":"hidden"}`,children:s})]})},bs=N.default.createContext(null);function $r(){const e=S.useContext(bs);if(!e)throw new Error("Missing ComponentsContext");return e}const bh=e=>{const{optionsItem:t,parentSelCtx:r,nestedLvl:n,parentKind:i,rootProduct:o}=e,{isFilterValidated:a,selected:s,isOnSubmitted:u,selCnt:l,qtyCnt:f,currency:c}=fs(t,n,i,r),{MenuOptionsUI:g}=$r();if(!a)return null;const d=x(Qn,{productItems:t.items,parentProduct:t,rootProduct:o,nestedLvl:n+1}),p={optionsItem:t,parentSelCtx:r,selected:s,isOnSubmitted:u,actualQtyCnt:f,actualSelCnt:l,currency:c,nestedLvl:n};return console.log("prod conf nestedLvl new",n),g?x(g,{...p,children:d}):x(yh,{...p,children:d})},Sh=e=>{const{product:t,inputId:r,isDisabled:n,registerProps:i,size:o="lg",children:a}=e,{details:{literals:s}={}}=t,{name:u="",description:l=""}=s||{},f=xa(t),c=is(t);return B("div",{className:`flex items-center justify-center p-2 pl-3 my-1 rounded-lg bg-white border-2 border-gray-200 ${n&&"opacity-50"}`,children:[x("input",{type:"checkbox",className:`simple-checkbox checkbox-${o} mr-4`,id:r,disabled:n,value:"1",...i}),c&&x("div",{className:"flex w-20 mr-2 max-h-24",children:x("img",{alt:"Product image",className:"h-auto max-w-full",src:c})}),x("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:B("div",{className:"relative",children:[x("p",{className:"w-full text-lg font-semibold",children:u}),x("p",{className:"text-sm text-gray-600",children:l})]})}),x("div",{className:"ml-auto",children:a}),x("label",{htmlFor:r,children:x(Ir,{price:parseFloat(f),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})},Oh=e=>{const{product:t,inputId:r,inputValue:n,registerProps:i,isChecked:o,size:a="lg",children:s}=e,{details:{literals:u}={}}=t,{name:l="",description:f=""}=u||{},c=xa(t),g=is(t);return B("div",{className:"flex items-center justify-between p-2 pl-3 my-1 bg-white border-2 border-gray-200 rounded-xl",children:[x("input",{type:"radio",className:`simple-radio radio-${a} mr-4`,id:r,...i,value:n,checked:o}),g&&x("div",{className:"flex w-20 mr-2 max-h-24",children:x("img",{alt:"Product image",className:"h-auto max-w-full",src:g})}),x("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:B("div",{className:"relative",children:[x("p",{className:"w-full text-lg font-semibold",children:l}),x("p",{className:"text-sm text-gray-600",children:f})]})}),x("div",{className:"ml-auto",children:s}),x("label",{htmlFor:r,children:x(Ir,{price:parseFloat(c||"0"),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})};function Ss(e){const{value:t=0,add:r,subtract:n,disabledSubtract:i,disabledAdd:o,size:a="md"}=e;return B("div",{className:`counter counter-${a} flex flex-row justify-center items-center p-1 border-[1px] rounded-md border-[rgba(229,231,235,255)] product-quantity`,children:[x("button",{type:"button",className:"quantity-button small",onClick:n,disabled:i,children:B("svg",{className:"w-4 h-4 text-black",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),x("span",{className:"font-semibold text-gray-700 product-quantity-value",children:t}),x("button",{className:"quantity-button small",type:"button",onClick:r,disabled:o,children:B("svg",{className:"w-4 h-4 text-green-600 ",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function wh(e,t,r){const{watch:n,setValue:i,getValues:o,unregister:a}=Ke(),{id:s,selCtx:u,emit:l={},fltCtx:f}=e,c=n(`selected.${u}.${s}`);return S.useEffect(()=>{var y,b,h;if(!r||r>1)return;const g=`filterWithCnt.${f}`,d=`filterWithCnt.${f}.${u}`,p=`filter.${f}`;if(t&&c&&f)if($e(l)){const v=o(d);(y=Object.keys(v||{}))==null||y.forEach(P=>{a(`${d}.${P}`);const E=Object.keys(o(g)||{});$e(E)?a(`${p}.${P}`):E.forEach(w=>{w!==u&&!o(`${g}.${w}.${P}`)&&a(`${p}.${P}`)})});return}else{const v=o(d),P=o(g);(b=Object.keys(l))==null||b.forEach(E=>{var w;(w=Object.keys(v||{}))==null||w.forEach(C=>{l[C]||(a(`${p}.${C}`),a(`${d}.${C}`))}),Object.keys(P||{}).forEach(C=>{C!==u&&E in o(g==null?void 0:g[C])&&a(`${g}.${C}.${E}`)}),i(`${p}.${E}`,l[E]),i(`${d}.${E}`,{cnt:1,value:l[E]})});return}c&&f&&!$e(l)&&((h=Object.keys(l))==null||h.forEach(v=>{i(`filter.${f}.${v}`,l[v]);const P=o(`${d}.${v}.cnt`)||0;i(`${d}.${v}`,{cnt:P+1,value:l[v]})}))},[c]),{}}function Eh(){const e=re(n=>n.getInvalidSelCtxArray),t=re(n=>n.isInputEnabled),r=re(n=>n.isInputCounterIncrementEnabled);return{getInvalidSelCtxArray:e,isInputEnabled:t,isInputCounterIncrementEnabled:r}}const Fo=(e,t)=>{Object.keys(e).forEach(r=>{t(`selected.${r}`,e[r])})},xn=(e,t,r)=>{const n=t(`selected.${e}`);console.log("changedSelCtx",n),r(`selected.${e}`,Object.keys(n).reduce((i,o)=>(i[o]=!1,i),{}))},Ph=(e,t,r,n,i,o)=>{var g,d;const{items:a,state:s,emit:u,fltCtx:l,selCtx:f}=r,{selected:c={}}=s||{};if(console.log("selected/unselected product",r,n),n){Fo(c,e);const p=y=>{var b;!Array.isArray(y)||$e(s==null?void 0:s.selected)||(b=y==null?void 0:y.filter(h=>{var v,P;return!!((P=(v=s.selected)==null?void 0:v[`${h.selCtx}`])!=null&&P[`${h.id}`])}))==null||b.map(h=>{if(h.state&&"selected"in h.state){const{state:{selected:v}}=h;Fo(v,e)}Array.isArray(h.items)&&p(h.items)})};p(a)}else{Object.keys(c).forEach(y=>{xn(y,t,e)});const p=y=>{!Array.isArray(y)||y.map(b=>{const{selCtx:h}=b;t(`selected.${h}`)&&xn(h,t,e),p(b.items)})};if(p(a),o&&o<2&&!$e(u)){(g=Object.keys(u))==null||g.forEach(v=>{const P=`filterWithCnt.${l}.${v}.${u[v]}`,E=t(P)||0;E<2?i(P):e(P,E-1)});const y=`filterWithCnt.${l}`,b=`filterWithCnt.${l}.${f}`,h=`filter.${l}`;(d=Object.keys(u))==null||d.forEach(v=>{var E,w,C;const P=t(`${b}.${v}`)||0;if(P)if(P>1)e(`${b}.${v}`,P-1);else{i(`${b}.${v}`);const T=t(y)||{},R=(E=Object.keys(T))==null?void 0:E.filter(F=>F!==f);if(!R)i(`${h}.${v}`);else{const F=R==null?void 0:R.find(j=>{var L;return!!((L=T==null?void 0:T[`${j}`])!=null&&L[`${v}`])});if(!F)i(`${h}.${v}`);else{const j=(C=(w=T==null?void 0:T[`${F}`])==null?void 0:w[`${v}`])==null?void 0:C.value;e(`${h}.${v}`,j)}}}})}}},nr=(e,t)=>{var r;if(!e.items||$e(e.items))return null;for(let n=0;n<((r=e.items)==null?void 0:r.length);n++){const i=e.items[n];if(i.selCtx&&i.selCtx===t&&i.kind===Me.PRODUCT)return i;if(i.kind===Me.OPTIONS&&i.items&&i.items.length>0){const o=nr(i,t);if(o)return o}}return null};function xh(e,t,r,n){var ie;const{id:i,selCtx:o,emit:a={},fltCtx:s}=e,{allowMultiple:u,selMin:l,selMax:f}=t,{isInputEnabled:c,isInputCounterIncrementEnabled:g}=Eh(),d=re(U=>U.refreshForm),p=re(U=>U.currency),{watch:y,getValues:b,setValue:h,register:v,unregister:P}=Ke(),E=y(`selected.${o}.${i}`),{selected:w={}}=b(),C=Number(E||0),T=l==="1"&&f==="1";wh(e,T,r);const R=!T,F=Wg(u),j=C>(T?1:0),L=g(e,w)&&(c(e)||C),D=Number(((ie=w==null?void 0:w[o])==null?void 0:ie[i])||0)>0,V=c(e)||C,H=`${T?"radio":"selected"}.${o}.${i}`,Z=v(H,{onChange:U=>{W(U)}}),G=()=>{var ne,ye;h(`selected.${o}.${i}`,`${C+1}`);const U=(ye=(ne=Object.keys(w))==null?void 0:ne.map(le=>{var fe;return{key:le,subProductId:(fe=nr(e,le))==null?void 0:fe.id}}))==null?void 0:ye.filter(le=>!!le.subProductId);U==null||U.forEach(le=>{h(`selected.${le.key}.${le.subProductId}`,`${C+1}`)})},X=()=>{var ye,le,fe,Te;const U=C-1;h(`selected.${o}.${i}`,`${U}`);const ne=(le=(ye=Object.keys(w))==null?void 0:ye.map(ee=>{var Y;return{key:ee,subProductId:(Y=nr(e,ee))==null?void 0:Y.id}}))==null?void 0:le.filter(ee=>!!ee.subProductId);if(ne==null||ne.forEach(ee=>{h(`selected.${ee.key}.${ee.subProductId}`,`${U}`)}),R&&U===0){h(`selected.${o}.${i}`,!1),(fe=Object.keys(a))==null||fe.forEach(Y=>{const ae=`filterWithCnt.${s}.${Y}.${a[Y]}`,de=b(ae)||0;de<2?P(ae):h(ae,de-1)});const ee=Y=>{!Array.isArray(Y)||Y.map(ae=>{const{selCtx:de}=ae;b(`selected.${de}`)&&xn(de,b,h),ee(ae.items)})};if(ee(e.items),r&&r<2&&!$e(a)){const Y=`filterWithCnt.${s}`,ae=`filterWithCnt.${s}.${o}`,de=`filter.${s}`;(Te=Object.keys(a))==null||Te.forEach(he=>{var Be,nt,m;const be=b(`${ae}.${he}`)||0;if(be)if(be>1)h(`${ae}.${he}`,be-1);else{P(`${ae}.${he}`);const O=b(Y)||{},A=(Be=Object.keys(O))==null?void 0:Be.filter($=>$!==o);if(!A)P(`${de}.${he}`);else{const $=A==null?void 0:A.find(k=>{var _;return!!((_=O==null?void 0:O[`${k}`])!=null&&_[`${he}`])});if(!$)P(`${de}.${he}`);else{const k=(m=(nt=O==null?void 0:O[`${$}`])==null?void 0:nt[`${he}`])==null?void 0:m.value;h(`${de}.${he}`,k)}}}})}}},W=U=>{var fe;const{target:{checked:ne,name:ye,defaultValue:le}}=U;if(Ph(h,b,e,ne,P,r),T){console.log("handleOnInputChange radio",ye,le);const Te=(fe=n==null?void 0:n.items)==null?void 0:fe.filter(Y=>Y.id!==e.id);for(const Y of Object.keys(w||{}))(Te!=null&&Te.some(de=>!!nr(de,Y))?Y:!1)&&h(`selected.${Y}`,!1);const ee="selected."+ye.replace("radio.","").split(".")[0];h(ee,{[le]:"1"}),d()}};return{registerProps:Z,isRadio:T,isCheckbox:R,isCounter:F,isDecrementEnabled:j,isIncrementEnabled:L,isChecked:D,isCheckboxEnabled:V,handleCounterIncrementQty:G,handleCounterDecrementQty:X,counterValue:C,handleOnInputChange:W,inputId:`${o}.${i}`,radioInputValue:i,currency:p}}const Ah=e=>{const{product:t,parentAttrs:r,nestedLvl:n,parentProduct:i,rootProduct:o}=e,{registerProps:a,inputId:s,radioInputValue:u,isRadio:l,isCheckbox:f,isCounter:c,isDecrementEnabled:g,isIncrementEnabled:d,isChecked:p,isCheckboxEnabled:y,counterValue:b,handleCounterIncrementQty:h,handleCounterDecrementQty:v,currency:P}=xh(t,r,n,i),{MenuProductUI:E}=$r(),w={product:t,nestedLvl:n,registerProps:a,inputId:s,radioInputValue:u,isRadio:l,isCheckbox:f,isCounter:c,isDecrementEnabled:g,isIncrementEnabled:d,isChecked:p,isCheckboxEnabled:y,counterValue:b,handleCounterIncrementQty:h,handleCounterDecrementQty:v,currency:P,parentProduct:i},C=x(Qn,{productItems:t.items,parentProduct:t,nestedLvl:n+1,rootProduct:o});return E?x(E,{...w,children:C}):x(Ch,{...w,children:C})},Ch=e=>{const{product:t,nestedLvl:r,registerProps:n,inputId:i,radioInputValue:o,isRadio:a,isCheckbox:s,isCounter:u,isDecrementEnabled:l,isIncrementEnabled:f,isChecked:c,isCheckboxEnabled:g,counterValue:d,handleCounterIncrementQty:p,handleCounterDecrementQty:y,children:b}=e,h=x(Ss,{value:d,add:p,subtract:y,disabledSubtract:!l,disabledAdd:!f}),v=()=>a?x(Oh,{product:t,inputId:i,inputValue:o,registerProps:n,isChecked:c,children:x(je,{children:u&&h})}):s?x(Sh,{product:t,inputId:i,registerProps:n,isDisabled:!g,children:x(je,{children:u&&h})}):null,P=!$e(t.items)&&d,E=oi.useTransition(P,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});return B("div",{children:[v(),P?E((w,C)=>C&&x(oi.animated.div,{className:`border-l-[2px] border-gray-300 ${r>=1&&"ml-4 pl-4"}`,style:w,children:b},r+1)):null]})};function _h(){return{isMenuProductToShow:r=>r.kind===Me.PRODUCT&&yo(r),isMenuOptionsToShow:r=>[Me.OPTIONS,Me.CONFIG].includes(r.kind)&&yo(r)}}function Qn(e){const{productItems:t,nestedLvl:r=1,parentProduct:n,rootProduct:i}=e,{attrs:o={},selCtx:a,kind:s}=n,{isMenuProductToShow:u,isMenuOptionsToShow:l}=_h(),{MenuItemsUI:f}=$r(),g={productItems:t,parentProduct:n,renderMenuItem:d=>l(d)?x(bh,{optionsItem:d,parentSelCtx:a,parentKind:s,nestedLvl:r,rootProduct:i}):u(d)?x(Ah,{product:d,parentAttrs:o,parentProduct:n,nestedLvl:r,rootProduct:i}):x(je,{}),rootProduct:i};return f?x(f,{...g}):x(Th,{...g})}function Th(e){const{productItems:t,parentProduct:r,renderMenuItem:n}=e,i=r.kind!==Me.PRODUCT,o=99,a=3,[s,u]=S.useState(i?a:o),{t:l}=Yn(),f=()=>{u(o)},c=()=>{u(a)};return x(je,{children:t.map((g,d)=>{if(d<s)return B("div",{children:[n(g),s===o&&i&&t.length===d+1&&ko(l("OS.ProductConfigurator.ShowLess"),c,!1)]},`${r.id}--${g.id}--${d}`);if(d===s)return ko(l("OS.ProductConfigurator.ShowMore"),f,!0)})})}const ko=(e,t,r)=>x("div",{className:"flex justify-center w-full",children:B("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:t,children:[e,B("svg",{className:`-mr-2 w-7 h-7 ${!r&&"rotate-180"}`,width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",x("polyline",{points:"7 7 12 12 17 7"})," ",x("polyline",{points:"7 13 12 18 17 13"})]})]})},`${e}`),Os=()=>{const{watch:e}=Ke(),t=e("selected"),r=e("filter"),n=e("filterWithCnt"),i=re(o=>o.validationMap);return console.log({selected:t,validationMap:i,filter:r,filterWithCnt:n}),B("div",{className:"flex flex-col items-center py-4",children:[x("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(t).map(o=>x("div",{children:Object.values(t[o]).filter(a=>a).length>0&&B(je,{children:[B("p",{className:"text-lg font-semibold",children:[o,":"]}),Object.keys(t[o]).map(a=>x(N.default.Fragment,{children:t[o][a]&&B("p",{children:[a,":",t[o][a].toString()]})},a))]})},o))]})};function Mo(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:n,displayPriceFrom:i=!1,productQuantity:o,increaseProductQuantity:a,decreaseProductQuantity:s,handleOnSubmit:u}=e,{t:l}=Yn();return B("div",{className:"flex items-center justify-around w-full h-16 px-4",children:[r&&B("button",{className:"inline-flex items-center px-2 py-1 font-bold text-red-600 border-2 border-red-600 border-solid rounded hover:bg-red-200",onClick:n,children:[B("svg",{className:"w-5 h-5 text-red-600",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),x("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),x("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),x("span",{className:"uppercase",children:`${l("OS.ProductConfigurator.Back")}`})]}),x("div",{className:"px-3",children:x(Ss,{value:o,add:a,subtract:s,disabledSubtract:o===1,size:"lg"})}),B("button",{type:"submit",className:"flex items-center justify-center w-2/4 px-2 py-1 font-bold text-white bg-green-600 border-2 border-green-600 border-solid rounded hover:bg-green-800 sm:w-3/5",style:{opacity:`${i?"0.4":"1"}`},disabled:i,onClick:u,children:[B("svg",{className:"w-5 h-5 mr-2 text-white",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x("circle",{cx:"9",cy:"21",r:"1"})," ",x("circle",{cx:"20",cy:"21",r:"1"}),x("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),i?x("span",{children:`${l("OS.ProductConfigurator.Selected.Message.From")} ${t}`}):x("span",{className:"uppercase",children:`${l("OS.ProductConfigurator.Add")} ${t}`})]})]})}const Zt=640,ws=e=>{const{isModal:t=!1}=e,[r,n]=S.useState(window.innerWidth),[i,o]=S.useState(window.innerHeight),[a,s]=S.useState(window.innerWidth<=Zt),[u,l]=S.useState(window.innerWidth>Zt&&!t);function f(){n(window.innerWidth),o(window.innerHeight)}return S.useEffect(()=>(window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}),[]),S.useEffect(()=>{l(window.innerWidth>Zt&&!t),s(window.innerWidth<=Zt)},[r,e,t]),{isSm:u,isMobile:a,width:r,windowHeight:i}};function Es(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Es(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Ft(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Es(e))&&(n&&(n+=" "),n+=t);return n}const Rr=typeof window=="undefined"||typeof document=="undefined";let Qe=Rr?S.useEffect:S.useLayoutEffect;function ze(e){let t=S.useRef(e);return Qe(()=>{t.current=e},[e]),t}function Lr(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Kt(){let e=[],t=[],r={enqueue(n){t.push(n)},addEventListener(n,i,o,a){return n.addEventListener(i,o,a),r.add(()=>n.removeEventListener(i,o,a))},requestAnimationFrame(...n){let i=requestAnimationFrame(...n);return r.add(()=>cancelAnimationFrame(i))},nextFrame(...n){return r.requestAnimationFrame(()=>r.requestAnimationFrame(...n))},setTimeout(...n){let i=setTimeout(...n);return r.add(()=>clearTimeout(i))},microTask(...n){let i={current:!0};return Lr(()=>{i.current&&n[0]()}),r.add(()=>{i.current=!1})},add(n){return e.push(n),()=>{let i=e.indexOf(n);if(i>=0){let[o]=e.splice(i,1);o()}}},dispose(){for(let n of e.splice(0))n()},async workQueue(){for(let n of t.splice(0))await n()}};return r}function qn(){let[e]=S.useState(Kt);return S.useEffect(()=>()=>e.dispose(),[e]),e}let ce=function(e){let t=ze(e);return N.default.useCallback((...r)=>t.current(...r),[t])},sn={serverHandoffComplete:!1};function Ct(){let[e,t]=S.useState(sn.serverHandoffComplete);return S.useEffect(()=>{e!==!0&&t(!0)},[e]),S.useEffect(()=>{sn.serverHandoffComplete===!1&&(sn.serverHandoffComplete=!0)},[]),e}var Do;let Nh=0;function jo(){return++Nh}let _t=(Do=N.default.useId)!=null?Do:function(){let e=Ct(),[t,r]=N.default.useState(e?jo:null);return Qe(()=>{t===null&&r(jo())},[t]),t!=null?""+t:void 0};function se(e,t,...r){if(e in t){let i=t[e];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,se),n}function Jn(e){return Rr?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let An=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var at=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(at||{}),Ps=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Ps||{}),Ih=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Ih||{});function $h(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(An)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var xs=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(xs||{});function Rh(e,t=0){var r;return e===((r=Jn(e))==null?void 0:r.body)?!1:se(t,{[0](){return e.matches(An)},[1](){let n=e;for(;n!==null;){if(n.matches(An))return!0;n=n.parentElement}return!1}})}function ut(e){e==null||e.focus({preventScroll:!0})}let Lh=["textarea","input"].join(",");function Fh(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Lh))!=null?r:!1}function kh(e,t=r=>r){return e.slice().sort((r,n)=>{let i=t(r),o=t(n);if(i===null||o===null)return 0;let a=i.compareDocumentPosition(o);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function ir(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?r?kh(e):e:$h(e);i.length>0&&(a=a.filter(d=>!i.includes(d))),n=n!=null?n:o.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,a.indexOf(n))-1;if(t&4)return Math.max(0,a.indexOf(n))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{},f=0,c=a.length,g;do{if(f>=c||f+c<=0)return 0;let d=u+f;if(t&16)d=(d+c)%c;else{if(d<0)return 3;if(d>=c)return 1}g=a[d],g==null||g.focus(l),f+=s}while(g!==o.activeElement);return t&6&&Fh(g)&&g.select(),g.hasAttribute("tabindex")||g.setAttribute("tabindex","0"),2}function un(e,t,r){let n=ze(t);S.useEffect(()=>{function i(o){n.current(o)}return document.addEventListener(e,i,r),()=>document.removeEventListener(e,i,r)},[e,r])}function Mh(e,t,r=!0){let n=S.useRef(!1);S.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function i(a,s){if(!n.current||a.defaultPrevented)return;let u=function f(c){return typeof c=="function"?f(c()):Array.isArray(c)||c instanceof Set?c:[c]}(e),l=s(a);if(l!==null&&!!l.getRootNode().contains(l)){for(let f of u){if(f===null)continue;let c=f instanceof HTMLElement?f:f.current;if(c!=null&&c.contains(l)||a.composed&&a.composedPath().includes(c))return}return!Rh(l,xs.Loose)&&l.tabIndex!==-1&&a.preventDefault(),t(a,l)}}let o=S.useRef(null);un("mousedown",a=>{var s,u;n.current&&(o.current=((u=(s=a.composedPath)==null?void 0:s.call(a))==null?void 0:u[0])||a.target)},!0),un("click",a=>{!o.current||(i(a,()=>o.current),o.current=null)},!0),un("blur",a=>i(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let As=Symbol();function Dh(e,t=!0){return Object.assign(e,{[As]:t})}function Re(...e){let t=S.useRef(e);S.useEffect(()=>{t.current=e},[e]);let r=ce(n=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return e.every(n=>n==null||(n==null?void 0:n[As]))?void 0:r}var yr=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(yr||{}),We=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(We||{});function _e({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:o=!0,name:a}){let s=Cs(t,e);if(o)return Xt(s,r,n,a);let u=i!=null?i:0;if(u&2){let{static:l=!1,...f}=s;if(l)return Xt(f,r,n,a)}if(u&1){let{unmount:l=!0,...f}=s;return se(l?0:1,{[0](){return null},[1](){return Xt({...f,hidden:!0,style:{display:"none"}},r,n,a)}})}return Xt(s,r,n,a)}function Xt(e,t={},r,n){let{as:i=r,children:o,refName:a="ref",...s}=ln(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},l=typeof o=="function"?o(t):o;s.className&&typeof s.className=="function"&&(s.className=s.className(t));let f={};if(t){let c=!1,g=[];for(let[d,p]of Object.entries(t))typeof p=="boolean"&&(c=!0),p===!0&&g.push(d);c&&(f["data-headlessui-state"]=g.join(" "))}if(i===S.Fragment&&Object.keys(Uo(s)).length>0){if(!S.isValidElement(l)||Array.isArray(l)&&l.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(c=>` - ${c}`).join(`
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var bp={normalizePrecision:function(t){var r=t.reduce(function(n,i){return Math.max(n.getPrecision(),i.getPrecision())});return t.map(function(n){return n.getPrecision()!==r?n.convertPrecision(r):n})},minimum:function(t){var r=wo(t),n=r[0],i=r.slice(1),o=n;return i.forEach(function(a){o=o.lessThan(a)?o:a}),o},maximum:function(t){var r=wo(t),n=r[0],i=r.slice(1),o=n;return i.forEach(function(a){o=o.greaterThan(a)?o:a}),o}};function gs(e){return!isNaN(parseInt(e))&&isFinite(e)}function Sp(e){return gs(e)&&e<=100&&e>=0}function Op(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function Po(e){return e%2===0}function xo(e){return gs(e)&&!Number.isInteger(e)}function wp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=e.toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var r=t.split(".")[1];return r?r.length:0}function $t(e){return Math.abs(e)%1===.5}function Ep(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(r,n){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?r(JSON.parse(i.responseText)):n(new Error(i.statusText)))},onerror:function(){n(new Error("Network error"))}});i.open("GET",e,!0),Pp(i,t.headers),i.send()})}function Pp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var r in t)e.setRequestHeader(r,t[r]);return e}function Mt(e){return typeof e=="undefined"}function ps(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(n){if(Ut(n[1])==="object"){var i=ps(n[1]);Object.entries(i).forEach(function(o){r[n[0]+t+o[0]]=o[1]})}else r[n[0]]=n[1]}),r}function xp(e){return Boolean(e)&&(Ut(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function hs(){var e=function(n,i){var o=function(u){return Math.pow(10,wp(u))},a=Math.max(o(n),o(i));return Math.round(n*a)*Math.round(i*a)/(a*a)},t={HALF_ODD:function(n){var i=Math.round(n);return $t(n)&&Po(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return $t(n)?Po(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return $t(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return $t(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return $t(n)?Math.sign(n)*Math.ceil(Math.abs(n)):Math.round(n)},DOWN:function(n){return Math.floor(n)}};return{add:function(n,i){return n+i},subtract:function(n,i){return n-i},multiply:function(n,i){return xo(n)||xo(i)?e(n,i):n*i},divide:function(n,i){return n/i},modulo:function(n,i){return n%i},round:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return t[i](n)}}}var Ap=hs();function Cp(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return t!==null?t.slice(1).filter(function(n){return!Mt(n)}):[]},getMinimumFractionDigits:function(){var n=function(o){return o==="."};return Mt(this.getMatches().find(n))?0:this.getMatches()[Ap.add(this.getMatches().findIndex(n),1)].split("").length},getCurrencyDisplay:function(){var n={USD:"code",dollar:"name",$:"symbol"};return n[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return Mt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Mt(this.getMatches().find(function(n){return n===","}))}}}function _p(e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;for(var a in o)i=i.replace("{{".concat(a,"}}"),o[a]);return i},r=function(i,o){return Ep(t(e.endpoint,{from:i,to:o}),{headers:e.headers})};return{getExchangeRate:function(i,o){return(xp(e.endpoint)?e.endpoint:r(i,o)).then(function(a){return ps(a)[t(e.propertyPath,{from:i,to:o})]})}}}function Wt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function Tp(e){Wt(Sp(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Np(e){Wt(Op(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function on(e){Wt(Number.isInteger(e),"You must provide an integer.",TypeError)}var Q=hs(),Ip=function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),n=r.amount,i=r.currency,o=r.precision;on(n),on(o);var a=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,l=e.globalFormatRoundingMode,f=Object.assign({},e.globalExchangeRatesApi),c=function(p){var y=Object.assign({},Object.assign({},{amount:n,currency:i,precision:o},p),Object.assign({},{locale:this.locale},p));return Object.assign(e({amount:y.amount,currency:y.currency,precision:y.precision}),{locale:y.locale})},g=function(p){Wt(this.hasSameCurrency(p),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return i},getLocale:function(){return this.locale||a},setLocale:function(p){return c.call(this,{locale:p})},getPrecision:function(){return o},convertPrecision:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;on(p);var b=this.getPrecision(),h=p>b,v=h?Q.multiply:Q.divide,P=h?[p,b]:[b,p],E=Math.pow(10,Q.subtract.apply(Q,P));return c.call(this,{amount:Q.round(v(this.getAmount(),E),y),precision:p})},add:function(p){g.call(this,p);var y=e.normalizePrecision([this,p]);return c.call(this,{amount:Q.add(y[0].getAmount(),y[1].getAmount()),precision:y[0].getPrecision()})},subtract:function(p){g.call(this,p);var y=e.normalizePrecision([this,p]);return c.call(this,{amount:Q.subtract(y[0].getAmount(),y[1].getAmount()),precision:y[0].getPrecision()})},multiply:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return c.call(this,{amount:Q.round(Q.multiply(this.getAmount(),p),y)})},divide:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return c.call(this,{amount:Q.round(Q.divide(this.getAmount(),p),y)})},percentage:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return Tp(p),this.multiply(Q.divide(p,100),y)},allocate:function(p){var y=this;Np(p);for(var b=p.reduce(function(E,w){return Q.add(E,w)}),h=this.getAmount(),v=p.map(function(E){var w=Math.floor(Q.divide(Q.multiply(y.getAmount(),E),b));return h=Q.subtract(h,w),c.call(y,{amount:w})}),P=0;h>0;)p[P]>0&&(v[P]=v[P].add(c.call(this,{amount:1})),h=Q.subtract(h,1)),P+=1;return v},convert:function(p){var y=this,b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=b.endpoint,v=h===void 0?f.endpoint:h,P=b.propertyPath,E=P===void 0?f.propertyPath||"rates.{{to}}":P,w=b.headers,C=w===void 0?f.headers:w,T=b.roundingMode,R=T===void 0?u:T,F=Object.assign({},{endpoint:v,propertyPath:E,headers:C,roundingMode:R});return _p(F).getExchangeRate(this.getCurrency(),p).then(function(j){return Wt(!Mt(j),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),c.call(y,{amount:Q.round(Q.multiply(y.getAmount(),parseFloat(j)),F.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){g.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()<y[1].getAmount()},lessThanOrEqual:function(p){g.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()<=y[1].getAmount()},greaterThan:function(p){g.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()>y[1].getAmount()},greaterThanOrEqual:function(p){g.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()>=y[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return Q.modulo(this.getAmount(),Math.pow(10,o))!==0},hasCents:function(){return Q.modulo(this.getAmount(),Math.pow(10,o))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var y=e.normalizePrecision([this,p]);return y[0].getAmount()===y[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,b=Cp(p);return this.toRoundedUnit(b.getMinimumFractionDigits(),y).toLocaleString(this.getLocale(),{currencyDisplay:b.getCurrencyDisplay(),useGrouping:b.getUseGrouping(),minimumFractionDigits:b.getMinimumFractionDigits(),style:b.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Q.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,b=Math.pow(10,p);return Q.divide(Q.round(Q.multiply(this.toUnit(),b),y),b)},toObject:function(){return{amount:n,currency:i,precision:o}},toJSON:function(){return this.toObject()}}},$p=Object.assign(Ip,gp,pp,bp);const rr=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),n=Number(r)*100;return isNaN(n)?"0.00":$p({amount:Math.round(n),currency:t}).toFormat("0,0.00")},Rp=(e,t,r=1)=>{const n=parseFloat(e.toString());let i=!1,o=rr(`${r*n}`);const a=`${rr(`${o}`)}`;return n<parseFloat(t)&&(i=!0,o=`${rr(`${t}`)}`),{displayPriceFrom:i,formattedEndPriceWithPriceMin:o,formattedEndPrice:a}};function Ir(e){const{price:t,addPlusBefore:r=!1,size:n="md",showIfPriceZero:i=!1,minPrice:o="0.00",hiddenIfPriceZero:a=!1}=e,s=parseFloat(o),u=t>s?t:o,l=rr(`${u}`);return!t&&i===!1?null:r?B("span",{style:{visibility:`${!t&&a?"hidden":"visible"}`},className:"",children:["\xA0",`+${l}`]}):t<s?B("span",{className:"",children:["\xA0",`od ${l}`]}):x("span",{className:"",children:l})}function Lp(e,t){const{selCtx:r,id:n}=e,i=re(s=>s.expanded),o=S.useMemo(()=>Fp(r,n,t,i),[r,n,t,i]),a=re(s=>s.toggleExpanded);return{isExpanded:o,toggleExpanded:a}}const Fp=(e,t,r,n)=>{const i=n[e+t+r];return i!==void 0?i:!0};var kp=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Mp={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xA9","&#169;":"\xA9","&reg;":"\xAE","&#174;":"\xAE","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},Dp=function(t){return Mp[t]},jp=function(t){return t.replace(kp,Dp)};function Ao(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Co(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ao(Object(r),!0).forEach(function(n){Ue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ao(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var En={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:jp},ms,Up=S.createContext();function Vp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};En=Co(Co({},En),e)}function Bp(){return En}var Hp=function(){function e(){Ae(this,e),this.usedNamespaces={}}return Ce(e,[{key:"addUsedNamespaces",value:function(r){var n=this;r.forEach(function(i){n.usedNamespaces[i]||(n.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function Wp(e){ms=e}function Gp(){return ms}var zp={type:"3rdParty",init:function(t){Vp(t.options.react),Wp(t)}};function Kp(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[0]=="string"&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var _o={};function Pn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&_o[t[0]]||(typeof t[0]=="string"&&(_o[t[0]]=new Date),Kp.apply(void 0,t))}function To(e,t,r){e.loadNamespaces(t,function(){if(e.isInitialized)r();else{var n=function i(){setTimeout(function(){e.off("initialized",i)},0),r()};e.on("initialized",n)}})}function Yp(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(n.toLowerCase()==="cimode")return!0;var a=function(u,l){var f=t.services.backendConnector.state["".concat(u,"|").concat(l)];return f===-1||f===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(n,e)&&(!i||a(o,e)))}function Qp(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Pn("i18n.languages were undefined or empty",t.languages),!0;var n=t.options.ignoreJSONStructure!==void 0;return n?t.hasLoadedNamespace(e,{precheck:function(o,a){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):Yp(e,t,r)}function qp(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(f){l=!0,i=f}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}function Jp(e,t){return zo(e)||qp(e,t)||Ko(e,t)||Yo()}function No(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function an(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?No(Object(r),!0).forEach(function(n){Ue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):No(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Zp=function(t,r){var n=S.useRef();return S.useEffect(function(){n.current=r?n.current:t},[t,r]),n.current};function Yn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,n=S.useContext(Up)||{},i=n.i18n,o=n.defaultNS,a=r||i||Gp();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new Hp),!a){Pn("You will need to pass in an i18next instance by using initReactI18next");var s=function(F){return Array.isArray(F)?F[F.length-1]:F},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}a.options.react&&a.options.react.wait!==void 0&&Pn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var l=an(an(an({},Bp()),a.options.react),t),f=l.useSuspense,c=l.keyPrefix,g=e||o||a.options&&a.options.defaultNS;g=typeof g=="string"?[g]:g||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(g);var d=(a.isInitialized||a.initializedStoreOnce)&&g.every(function(R){return Qp(R,a,l)});function p(){return a.getFixedT(null,l.nsMode==="fallback"?g:g[0],c)}var y=S.useState(p),b=Jp(y,2),h=b[0],v=b[1],P=g.join(),E=Zp(P),w=S.useRef(!0);S.useEffect(function(){var R=l.bindI18n,F=l.bindI18nStore;w.current=!0,!d&&!f&&To(a,g,function(){w.current&&v(p)}),d&&E&&E!==P&&w.current&&v(p);function j(){w.current&&v(p)}return R&&a&&a.on(R,j),F&&a&&a.store.on(F,j),function(){w.current=!1,R&&a&&R.split(" ").forEach(function(L){return a.off(L,j)}),F&&a&&F.split(" ").forEach(function(L){return a.store.off(L,j)})}},[a,P]);var C=S.useRef(!0);S.useEffect(function(){w.current&&!C.current&&v(p),C.current=!1},[a,c]);var T=[h,a,d];if(T.t=h,T.i18n=a,T.ready=d,d||!d&&!f)return T;throw new Promise(function(R){To(a,g,function(){R()})})}var vs=[],Xp=vs.forEach,eh=vs.slice;function th(e){return Xp.call(eh.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var Io=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,rh=function(t,r,n){var i=n||{};i.path=i.path||"/";var o=encodeURIComponent(r),a="".concat(t,"=").concat(o);if(i.maxAge>0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!Io.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(i.domain)}if(i.path){if(!Io.test(i.path))throw new TypeError("option path is invalid");a+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var u=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(u){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},$o={create:function(t,r,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),i&&(o.domain=i),document.cookie=rh(t,encodeURIComponent(r),o)},read:function(t){for(var r="".concat(t,"="),n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(r)===0)return o.substring(r.length,o.length)}return null},remove:function(t){this.create(t,"",-1)}},nh={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var n=$o.read(t.lookupCookie);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&$o.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},ih={name:"querystring",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=n.substring(1),o=i.split("&"),a=0;a<o.length;a++){var s=o[a].indexOf("=");if(s>0){var u=o[a].substring(0,s);u===t.lookupQuerystring&&(r=o[a].substring(s+1))}}}return r}},Rt=null,Ro=function(){if(Rt!==null)return Rt;try{Rt=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Rt=!1}return Rt},oh={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&Ro()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&Ro()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},Lt=null,Lo=function(){if(Lt!==null)return Lt;try{Lt=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Lt=!1}return Lt},ah={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&Lo()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&Lo()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},sh={name:"navigator",lookup:function(t){var r=[];if(typeof navigator!="undefined"){if(navigator.languages)for(var n=0;n<navigator.languages.length;n++)r.push(navigator.languages[n]);navigator.userLanguage&&r.push(navigator.userLanguage),navigator.language&&r.push(navigator.language)}return r.length>0?r:void 0}},uh={name:"htmlTag",lookup:function(t){var r,n=t.htmlTag||(typeof document!="undefined"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},lh={name:"path",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof n[t.lookupFromPathIndex]!="string")return;r=n[t.lookupFromPathIndex].replace("/","")}else r=n[0].replace("/","")}return r}},ch={name:"subdomain",lookup:function(t){var r=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,n=typeof window!="undefined"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!!n)return n[r]}};function fh(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var ys=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ae(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return Ce(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r,this.options=th(n,this.options||{},fh()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(nh),this.addDetector(ih),this.addDetector(oh),this.addDetector(ah),this.addDetector(sh),this.addDetector(uh),this.addDetector(lh),this.addDetector(ch)}},{key:"addDetector",value:function(r){this.detectors[r.name]=r}},{key:"detect",value:function(r){var n=this;r||(r=this.options.order);var i=[];return r.forEach(function(o){if(n.detectors[o]){var a=n.detectors[o].lookup(n.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(r,n){var i=this;n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||n.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(r,i.options)}))}}]),e}();ys.type="languageDetector";const dh={"OS.ProductConfigurator.Selected.Message.From":"od","OS.ProductConfigurator.Selected.Message.UpTo":"do","OS.ProductConfigurator.Selected.Message.Choose":"Wybierz","OS.ProductConfigurator.Selected.Message.Options":"opcji","OS.ProductConfigurator.Selected.Message.OneOption":"Wybierz 1 opcj\u0119","OS.ProductConfigurator.Quantity.Message.UpTo":"do","OS.ProductConfigurator.Quantity.Message.From":"od","OS.ProductConfigurator.Quantity.Message.Max":"maksymalnie","OS.ProductConfigurator.Quantity.Message.Quantity":"ilo\u015Bci","OS.ProductConfigurator.Quantity.Message.OneOption":"Wybierz maksymalnie jedn\u0105 opcj\u0119","OS.ProductConfigurator.Add":"Dodaj","OS.ProductConfigurator.Back":"Wr\xF3\u0107","OS.ProductConfigurator.ShowMore":"Poka\u017C wi\u0119cej","OS.ProductConfigurator.ShowLess":"Poka\u017C mniej"},gh={"OS.ProductConfigurator.Selected.Message.From":"from","OS.ProductConfigurator.Selected.Message.UpTo":"up to","OS.ProductConfigurator.Selected.Message.Choose":"Choose","OS.ProductConfigurator.Selected.Message.Options":"options","OS.ProductConfigurator.Selected.Message.OneOption":"Choose one option","OS.ProductConfigurator.Quantity.Message.UpTo":"up to","OS.ProductConfigurator.Quantity.Message.From":"from","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"quantity","OS.ProductConfigurator.Quantity.Message.OneOption":"Choose maximum one option","OS.ProductConfigurator.Add":"Add","OS.ProductConfigurator.Back":"Back","OS.ProductConfigurator.ShowMore":"Show more","OS.ProductConfigurator.ShowLess":"Show less"},ph={"OS.ProductConfigurator.Selected.Message.From":"ab","OS.ProductConfigurator.Selected.Message.UpTo":"bis","OS.ProductConfigurator.Selected.Message.Choose":"W\xE4hle","OS.ProductConfigurator.Selected.Message.Options":"Optionen","OS.ProductConfigurator.Selected.Message.OneOption":"W\xE4hle eine Option","OS.ProductConfigurator.Quantity.Message.UpTo":"ab","OS.ProductConfigurator.Quantity.Message.From":"aus","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"Menge","OS.ProductConfigurator.Quantity.Message.OneOption":"W\xE4hle bis zu 1 Option aus","OS.ProductConfigurator.Add":"Hinzuf\xFCgen","OS.ProductConfigurator.Back":"Zur\xFCck","OS.ProductConfigurator.ShowMore":"Zeig mehr","OS.ProductConfigurator.ShowLess":"Zeig weniger"},hh={"OS.ProductConfigurator.Selected.Message.From":"from","OS.ProductConfigurator.Selected.Message.UpTo":"up to","OS.ProductConfigurator.Selected.Message.Choose":"Choose","OS.ProductConfigurator.Selected.Message.Options":"options","OS.ProductConfigurator.Selected.Message.OneOption":"Choose one option","OS.ProductConfigurator.Quantity.Message.UpTo":"up to","OS.ProductConfigurator.Quantity.Message.From":"from","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"quantity","OS.ProductConfigurator.Quantity.Message.OneOption":"Choose maximum one option","OS.ProductConfigurator.Add":"Add","OS.ProductConfigurator.Back":"Back","OS.ProductConfigurator.ShowMore":"Show more","OS.ProductConfigurator.ShowLess":"Show less"};pe.use(ys).use(zp).init({resources:{pl:{translation:dh},en:{translation:gh},de:{translation:ph},cs:{translation:hh}}});const mh=(e,t,r,n)=>{let i="",o="";const a=Number(e),s=Number(t);return a>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.From")} ${a}`,a>r&&(o=xe.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(o=xe.TOO_MUCH)),a>=0||s>=0&&r<a?(i=`${n("OS.ProductConfigurator.Quantity.Message.Max")}${i}`,i+=` ${n("OS.ProductConfigurator.Quantity.Message.Quantity")}`):a===1&&a===1?i=`${n("OS.ProductConfigurator.Quantity.Message.OneOption")}`:(i="",o=xe.IGNORE),r>=a&&r<=s&&(o=xe.OK),{message:i,validationStatus:o}},vh=(e,t,r,n)=>{let i="",o="";const a=parseInt(e||"-1"),s=parseInt(t||"-1");return a>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.From")} ${a}`,a>r&&(o=xe.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(o=xe.TOO_MUCH)),a>=0||s>=0?(i=`${n("OS.ProductConfigurator.Selected.Message.Choose")}${i}`,i+=` ${n("OS.ProductConfigurator.Selected.Message.Options")}`):(i="",o=xe.IGNORE),a===1&&s===1&&(i=`${n("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=a&&r<=s&&(o=xe.OK),{message:i,validationStatus:o}},yh=e=>{const{optionsItem:t,parentSelCtx:r,selected:n,isOnSubmitted:i,actualQtyCnt:o,actualSelCnt:a,children:s}=e,{selCtx:u,details:l={},id:f,attrs:c={}}=t,{qtyMin:g,qtyMax:d,selMin:p,selMax:y}=c,{name:b,description:h}=l.literals||{},{t:v}=Yn(),{isExpanded:P,toggleExpanded:E}=Lp(t,r),{validationStatus:w,message:C}=vh(p,y,a,v),{validationStatus:T,message:R}=mh(g,d,o,v),F=w===xe.OK,j=T===xe.OK,L=!F&&i&&!!C,D=!j&&i&&!!R;return B("div",{className:"pt-1 mb-3",id:Gg(u),children:[B("div",{className:"flex text-xl font-semibold",children:[x("p",{className:"",children:b}),b&&b!==" "&&B(je,{children:[x("div",{className:"ml-auto",children:x(Ir,{price:jn(n,t)})}),x("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!P&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>E(u,f,r),children:x("polyline",{points:"18 15 12 9 6 15"})})]})]}),x("p",{className:`${h&&"mb-2"}`,children:h}),!1,x("div",{className:"flex",children:B("div",{children:[x(Oo,{isOk:F,isErr:L,info:C}),x(Oo,{isOk:j,isErr:D,info:R})]})}),x("div",{className:`${P?"block":"hidden"}`,children:s})]})},bs=N.default.createContext(null);function $r(){const e=S.useContext(bs);if(!e)throw new Error("Missing ComponentsContext");return e}const bh=e=>{const{optionsItem:t,parentSelCtx:r,nestedLvl:n,parentKind:i,rootProduct:o}=e,{isFilterValidated:a,selected:s,isOnSubmitted:u,selCnt:l,qtyCnt:f,currency:c}=fs(t,n,i,r),{MenuOptionsUI:g}=$r();if(!a)return null;const d=x(Qn,{productItems:t.items,parentProduct:t,rootProduct:o,nestedLvl:n+1}),p={optionsItem:t,parentSelCtx:r,selected:s,isOnSubmitted:u,actualQtyCnt:f,actualSelCnt:l,currency:c,nestedLvl:n};return g?x(g,{...p,children:d}):x(yh,{...p,children:d})},Sh=e=>{const{product:t,inputId:r,isDisabled:n,registerProps:i,size:o="lg",children:a}=e,{details:{literals:s}={}}=t,{name:u="",description:l=""}=s||{},f=xa(t),c=is(t);return B("div",{className:`flex items-center justify-center p-2 pl-3 my-1 rounded-lg bg-white border-2 border-gray-200 ${n&&"opacity-50"}`,children:[x("input",{type:"checkbox",className:`simple-checkbox checkbox-${o} mr-4`,id:r,disabled:n,value:"1",...i}),c&&x("div",{className:"flex w-20 mr-2 max-h-24",children:x("img",{alt:"Product image",className:"h-auto max-w-full",src:c})}),x("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:B("div",{className:"relative",children:[x("p",{className:"w-full text-lg font-semibold",children:u}),x("p",{className:"text-sm text-gray-600",children:l})]})}),x("div",{className:"ml-auto",children:a}),x("label",{htmlFor:r,children:x(Ir,{price:parseFloat(f),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})},Oh=e=>{const{product:t,inputId:r,inputValue:n,registerProps:i,isChecked:o,size:a="lg",children:s}=e,{details:{literals:u}={}}=t,{name:l="",description:f=""}=u||{},c=xa(t),g=is(t);return B("div",{className:"flex items-center justify-between p-2 pl-3 my-1 bg-white border-2 border-gray-200 rounded-xl",children:[x("input",{type:"radio",className:`simple-radio radio-${a} mr-4`,id:r,...i,value:n,checked:o}),g&&x("div",{className:"flex w-20 mr-2 max-h-24",children:x("img",{alt:"Product image",className:"h-auto max-w-full",src:g})}),x("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:B("div",{className:"relative",children:[x("p",{className:"w-full text-lg font-semibold",children:l}),x("p",{className:"text-sm text-gray-600",children:f})]})}),x("div",{className:"ml-auto",children:s}),x("label",{htmlFor:r,children:x(Ir,{price:parseFloat(c||"0"),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})};function Ss(e){const{value:t=0,add:r,subtract:n,disabledSubtract:i,disabledAdd:o,size:a="md"}=e;return B("div",{className:`counter counter-${a} flex flex-row justify-center items-center p-1 border-[1px] rounded-md border-[rgba(229,231,235,255)] product-quantity`,children:[x("button",{type:"button",className:"quantity-button small",onClick:n,disabled:i,children:B("svg",{className:"w-4 h-4 text-black",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),x("span",{className:"font-semibold text-gray-700 product-quantity-value",children:t}),x("button",{className:"quantity-button small",type:"button",onClick:r,disabled:o,children:B("svg",{className:"w-4 h-4 text-green-600 ",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function wh(e,t,r){const{watch:n,setValue:i,getValues:o,unregister:a}=Ke(),{id:s,selCtx:u,emit:l={},fltCtx:f}=e,c=n(`selected.${u}.${s}`);return S.useEffect(()=>{var y,b,h;if(!r||r>1)return;const g=`filterWithCnt.${f}`,d=`filterWithCnt.${f}.${u}`,p=`filter.${f}`;if(t&&c&&f)if($e(l)){const v=o(d);(y=Object.keys(v||{}))==null||y.forEach(P=>{a(`${d}.${P}`);const E=Object.keys(o(g)||{});$e(E)?a(`${p}.${P}`):E.forEach(w=>{w!==u&&!o(`${g}.${w}.${P}`)&&a(`${p}.${P}`)})});return}else{const v=o(d),P=o(g);(b=Object.keys(l))==null||b.forEach(E=>{var w;(w=Object.keys(v||{}))==null||w.forEach(C=>{l[C]||(a(`${p}.${C}`),a(`${d}.${C}`))}),Object.keys(P||{}).forEach(C=>{C!==u&&E in o(g==null?void 0:g[C])&&a(`${g}.${C}.${E}`)}),i(`${p}.${E}`,l[E]),i(`${d}.${E}`,{cnt:1,value:l[E]})});return}c&&f&&!$e(l)&&((h=Object.keys(l))==null||h.forEach(v=>{i(`filter.${f}.${v}`,l[v]);const P=o(`${d}.${v}.cnt`)||0;i(`${d}.${v}`,{cnt:P+1,value:l[v]})}))},[c]),{}}function Eh(){const e=re(n=>n.getInvalidSelCtxArray),t=re(n=>n.isInputEnabled),r=re(n=>n.isInputCounterIncrementEnabled);return{getInvalidSelCtxArray:e,isInputEnabled:t,isInputCounterIncrementEnabled:r}}const Fo=(e,t)=>{Object.keys(e).forEach(r=>{t(`selected.${r}`,e[r])})},xn=(e,t,r)=>{const n=t(`selected.${e}`);console.log("changedSelCtx",n),r(`selected.${e}`,Object.keys(n).reduce((i,o)=>(i[o]=!1,i),{}))},Ph=(e,t,r,n,i,o)=>{var g,d;const{items:a,state:s,emit:u,fltCtx:l,selCtx:f}=r,{selected:c={}}=s||{};if(console.log("selected/unselected product",r,n),n){Fo(c,e);const p=y=>{var b;!Array.isArray(y)||$e(s==null?void 0:s.selected)||(b=y==null?void 0:y.filter(h=>{var v,P;return!!((P=(v=s.selected)==null?void 0:v[`${h.selCtx}`])!=null&&P[`${h.id}`])}))==null||b.map(h=>{if(h.state&&"selected"in h.state){const{state:{selected:v}}=h;Fo(v,e)}Array.isArray(h.items)&&p(h.items)})};p(a)}else{Object.keys(c).forEach(y=>{xn(y,t,e)});const p=y=>{!Array.isArray(y)||y.map(b=>{const{selCtx:h}=b;t(`selected.${h}`)&&xn(h,t,e),p(b.items)})};if(p(a),o&&o<2&&!$e(u)){(g=Object.keys(u))==null||g.forEach(v=>{const P=`filterWithCnt.${l}.${v}.${u[v]}`,E=t(P)||0;E<2?i(P):e(P,E-1)});const y=`filterWithCnt.${l}`,b=`filterWithCnt.${l}.${f}`,h=`filter.${l}`;(d=Object.keys(u))==null||d.forEach(v=>{var E,w,C;const P=t(`${b}.${v}`)||0;if(P)if(P>1)e(`${b}.${v}`,P-1);else{i(`${b}.${v}`);const T=t(y)||{},R=(E=Object.keys(T))==null?void 0:E.filter(F=>F!==f);if(!R)i(`${h}.${v}`);else{const F=R==null?void 0:R.find(j=>{var L;return!!((L=T==null?void 0:T[`${j}`])!=null&&L[`${v}`])});if(!F)i(`${h}.${v}`);else{const j=(C=(w=T==null?void 0:T[`${F}`])==null?void 0:w[`${v}`])==null?void 0:C.value;e(`${h}.${v}`,j)}}}})}}},nr=(e,t)=>{var r;if(!e.items||$e(e.items))return null;for(let n=0;n<((r=e.items)==null?void 0:r.length);n++){const i=e.items[n];if(i.selCtx&&i.selCtx===t&&i.kind===Me.PRODUCT)return i;if(i.kind===Me.OPTIONS&&i.items&&i.items.length>0){const o=nr(i,t);if(o)return o}}return null};function xh(e,t,r,n){var ie;const{id:i,selCtx:o,emit:a={},fltCtx:s}=e,{allowMultiple:u,selMin:l,selMax:f}=t,{isInputEnabled:c,isInputCounterIncrementEnabled:g}=Eh(),d=re(U=>U.refreshForm),p=re(U=>U.currency),{watch:y,getValues:b,setValue:h,register:v,unregister:P}=Ke(),E=y(`selected.${o}.${i}`),{selected:w={}}=b(),C=Number(E||0),T=l==="1"&&f==="1";wh(e,T,r);const R=!T,F=Wg(u),j=C>(T?1:0),L=g(e,w)&&(c(e)||C),D=Number(((ie=w==null?void 0:w[o])==null?void 0:ie[i])||0)>0,V=c(e)||C,H=`${T?"radio":"selected"}.${o}.${i}`,Z=v(H,{onChange:U=>{W(U)}}),G=()=>{var ne,ye;h(`selected.${o}.${i}`,`${C+1}`);const U=(ye=(ne=Object.keys(w))==null?void 0:ne.map(le=>{var fe;return{key:le,subProductId:(fe=nr(e,le))==null?void 0:fe.id}}))==null?void 0:ye.filter(le=>!!le.subProductId);C===0&&(U==null||U.forEach(le=>{h(`selected.${le.key}.${le.subProductId}`,`${C+1}`)}))},X=()=>{var ye,le,fe,Te;const U=C-1;h(`selected.${o}.${i}`,`${U}`);const ne=(le=(ye=Object.keys(w))==null?void 0:ye.map(ee=>{var Y;return{key:ee,subProductId:(Y=nr(e,ee))==null?void 0:Y.id}}))==null?void 0:le.filter(ee=>!!ee.subProductId);if(U===0&&(ne==null||ne.forEach(ee=>{h(`selected.${ee.key}.${ee.subProductId}`,`${U}`)})),R&&U===0){h(`selected.${o}.${i}`,!1),(fe=Object.keys(a))==null||fe.forEach(Y=>{const ae=`filterWithCnt.${s}.${Y}.${a[Y]}`,de=b(ae)||0;de<2?P(ae):h(ae,de-1)});const ee=Y=>{!Array.isArray(Y)||Y.map(ae=>{const{selCtx:de}=ae;b(`selected.${de}`)&&xn(de,b,h),ee(ae.items)})};if(ee(e.items),r&&r<2&&!$e(a)){const Y=`filterWithCnt.${s}`,ae=`filterWithCnt.${s}.${o}`,de=`filter.${s}`;(Te=Object.keys(a))==null||Te.forEach(he=>{var Be,nt,m;const be=b(`${ae}.${he}`)||0;if(be)if(be>1)h(`${ae}.${he}`,be-1);else{P(`${ae}.${he}`);const O=b(Y)||{},A=(Be=Object.keys(O))==null?void 0:Be.filter($=>$!==o);if(!A)P(`${de}.${he}`);else{const $=A==null?void 0:A.find(k=>{var _;return!!((_=O==null?void 0:O[`${k}`])!=null&&_[`${he}`])});if(!$)P(`${de}.${he}`);else{const k=(m=(nt=O==null?void 0:O[`${$}`])==null?void 0:nt[`${he}`])==null?void 0:m.value;h(`${de}.${he}`,k)}}}})}}},W=U=>{var fe;const{target:{checked:ne,name:ye,defaultValue:le}}=U;if(Ph(h,b,e,ne,P,r),T){console.log("handleOnInputChange radio",ye,le);const Te=(fe=n==null?void 0:n.items)==null?void 0:fe.filter(Y=>Y.id!==e.id);for(const Y of Object.keys(w||{}))(Te!=null&&Te.some(de=>!!nr(de,Y))?Y:!1)&&h(`selected.${Y}`,!1);const ee="selected."+ye.replace("radio.","").split(".")[0];h(ee,{[le]:"1"}),d()}};return{registerProps:Z,isRadio:T,isCheckbox:R,isCounter:F,isDecrementEnabled:j,isIncrementEnabled:L,isChecked:D,isCheckboxEnabled:V,handleCounterIncrementQty:G,handleCounterDecrementQty:X,counterValue:C,handleOnInputChange:W,inputId:`${o}.${i}`,radioInputValue:i,currency:p}}const Ah=e=>{const{product:t,parentAttrs:r,nestedLvl:n,parentProduct:i,rootProduct:o}=e,{registerProps:a,inputId:s,radioInputValue:u,isRadio:l,isCheckbox:f,isCounter:c,isDecrementEnabled:g,isIncrementEnabled:d,isChecked:p,isCheckboxEnabled:y,counterValue:b,handleCounterIncrementQty:h,handleCounterDecrementQty:v,currency:P}=xh(t,r,n,i),{MenuProductUI:E}=$r(),w={product:t,nestedLvl:n,registerProps:a,inputId:s,radioInputValue:u,isRadio:l,isCheckbox:f,isCounter:c,isDecrementEnabled:g,isIncrementEnabled:d,isChecked:p,isCheckboxEnabled:y,counterValue:b,handleCounterIncrementQty:h,handleCounterDecrementQty:v,currency:P,parentProduct:i},C=x(Qn,{productItems:t.items,parentProduct:t,nestedLvl:n+1,rootProduct:o});return E?x(E,{...w,children:C}):x(Ch,{...w,children:C})},Ch=e=>{const{product:t,nestedLvl:r,registerProps:n,inputId:i,radioInputValue:o,isRadio:a,isCheckbox:s,isCounter:u,isDecrementEnabled:l,isIncrementEnabled:f,isChecked:c,isCheckboxEnabled:g,counterValue:d,handleCounterIncrementQty:p,handleCounterDecrementQty:y,children:b}=e,h=x(Ss,{value:d,add:p,subtract:y,disabledSubtract:!l,disabledAdd:!f}),v=()=>a?x(Oh,{product:t,inputId:i,inputValue:o,registerProps:n,isChecked:c,children:x(je,{children:u&&h})}):s?x(Sh,{product:t,inputId:i,registerProps:n,isDisabled:!g,children:x(je,{children:u&&h})}):null,P=!$e(t.items)&&d,E=oi.useTransition(P,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});return B("div",{children:[v(),P?E((w,C)=>C&&x(oi.animated.div,{className:`border-l-[2px] border-gray-300 ${r>=1&&"ml-4 pl-4"}`,style:w,children:b},r+1)):null]})};function _h(){return{isMenuProductToShow:r=>r.kind===Me.PRODUCT&&yo(r),isMenuOptionsToShow:r=>[Me.OPTIONS,Me.CONFIG].includes(r.kind)&&yo(r)}}function Qn(e){const{productItems:t,nestedLvl:r=1,parentProduct:n,rootProduct:i}=e,{attrs:o={},selCtx:a,kind:s}=n,{isMenuProductToShow:u,isMenuOptionsToShow:l}=_h(),{MenuItemsUI:f}=$r(),g={productItems:t,parentProduct:n,renderMenuItem:d=>l(d)?x(bh,{optionsItem:d,parentSelCtx:a,parentKind:s,nestedLvl:r,rootProduct:i}):u(d)?x(Ah,{product:d,parentAttrs:o,parentProduct:n,nestedLvl:r,rootProduct:i}):x(je,{}),rootProduct:i};return f?x(f,{...g}):x(Th,{...g})}function Th(e){const{productItems:t,parentProduct:r,renderMenuItem:n}=e,i=r.kind!==Me.PRODUCT,o=99,a=3,[s,u]=S.useState(i?a:o),{t:l}=Yn(),f=()=>{u(o)},c=()=>{u(a)};return x(je,{children:t.map((g,d)=>{if(d<s)return B("div",{children:[n(g),s===o&&i&&t.length===d+1&&ko(l("OS.ProductConfigurator.ShowLess"),c,!1)]},`${r.id}--${g.id}--${d}`);if(d===s)return ko(l("OS.ProductConfigurator.ShowMore"),f,!0)})})}const ko=(e,t,r)=>x("div",{className:"flex justify-center w-full",children:B("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:t,children:[e,B("svg",{className:`-mr-2 w-7 h-7 ${!r&&"rotate-180"}`,width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",x("polyline",{points:"7 7 12 12 17 7"})," ",x("polyline",{points:"7 13 12 18 17 13"})]})]})},`${e}`),Os=()=>{const{watch:e}=Ke(),t=e("selected"),r=e("filter"),n=e("filterWithCnt"),i=re(o=>o.validationMap);return console.log({selected:t,validationMap:i,filter:r,filterWithCnt:n}),B("div",{className:"flex flex-col items-center py-4",children:[x("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(t).map(o=>x("div",{children:Object.values(t[o]).filter(a=>a).length>0&&B(je,{children:[B("p",{className:"text-lg font-semibold",children:[o,":"]}),Object.keys(t[o]).map(a=>x(N.default.Fragment,{children:t[o][a]&&B("p",{children:[a,":",t[o][a].toString()]})},a))]})},o))]})};function Mo(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:n,displayPriceFrom:i=!1,productQuantity:o,increaseProductQuantity:a,decreaseProductQuantity:s,handleOnSubmit:u}=e,{t:l}=Yn();return B("div",{className:"flex items-center justify-around w-full h-16 px-4",children:[r&&B("button",{className:"inline-flex items-center px-2 py-1 font-bold text-red-600 border-2 border-red-600 border-solid rounded hover:bg-red-200",onClick:n,children:[B("svg",{className:"w-5 h-5 text-red-600",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"}),x("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),x("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),x("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),x("span",{className:"uppercase",children:`${l("OS.ProductConfigurator.Back")}`})]}),x("div",{className:"px-3",children:x(Ss,{value:o,add:a,subtract:s,disabledSubtract:o===1,size:"lg"})}),B("button",{type:"submit",className:"flex items-center justify-center w-2/4 px-2 py-1 font-bold text-white bg-green-600 border-2 border-green-600 border-solid rounded hover:bg-green-800 sm:w-3/5",style:{opacity:`${i?"0.4":"1"}`},disabled:i,onClick:u,children:[B("svg",{className:"w-5 h-5 mr-2 text-white",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[x("circle",{cx:"9",cy:"21",r:"1"})," ",x("circle",{cx:"20",cy:"21",r:"1"}),x("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),i?x("span",{children:`${l("OS.ProductConfigurator.Selected.Message.From")} ${t}`}):x("span",{className:"uppercase",children:`${l("OS.ProductConfigurator.Add")} ${t}`})]})]})}const Zt=640,ws=e=>{const{isModal:t=!1}=e,[r,n]=S.useState(window.innerWidth),[i,o]=S.useState(window.innerHeight),[a,s]=S.useState(window.innerWidth<=Zt),[u,l]=S.useState(window.innerWidth>Zt&&!t);function f(){n(window.innerWidth),o(window.innerHeight)}return S.useEffect(()=>(window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}),[]),S.useEffect(()=>{l(window.innerWidth>Zt&&!t),s(window.innerWidth<=Zt)},[r,e,t]),{isSm:u,isMobile:a,width:r,windowHeight:i}};function Es(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Es(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Ft(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Es(e))&&(n&&(n+=" "),n+=t);return n}const Rr=typeof window=="undefined"||typeof document=="undefined";let Qe=Rr?S.useEffect:S.useLayoutEffect;function ze(e){let t=S.useRef(e);return Qe(()=>{t.current=e},[e]),t}function Lr(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Kt(){let e=[],t=[],r={enqueue(n){t.push(n)},addEventListener(n,i,o,a){return n.addEventListener(i,o,a),r.add(()=>n.removeEventListener(i,o,a))},requestAnimationFrame(...n){let i=requestAnimationFrame(...n);return r.add(()=>cancelAnimationFrame(i))},nextFrame(...n){return r.requestAnimationFrame(()=>r.requestAnimationFrame(...n))},setTimeout(...n){let i=setTimeout(...n);return r.add(()=>clearTimeout(i))},microTask(...n){let i={current:!0};return Lr(()=>{i.current&&n[0]()}),r.add(()=>{i.current=!1})},add(n){return e.push(n),()=>{let i=e.indexOf(n);if(i>=0){let[o]=e.splice(i,1);o()}}},dispose(){for(let n of e.splice(0))n()},async workQueue(){for(let n of t.splice(0))await n()}};return r}function qn(){let[e]=S.useState(Kt);return S.useEffect(()=>()=>e.dispose(),[e]),e}let ce=function(e){let t=ze(e);return N.default.useCallback((...r)=>t.current(...r),[t])},sn={serverHandoffComplete:!1};function Ct(){let[e,t]=S.useState(sn.serverHandoffComplete);return S.useEffect(()=>{e!==!0&&t(!0)},[e]),S.useEffect(()=>{sn.serverHandoffComplete===!1&&(sn.serverHandoffComplete=!0)},[]),e}var Do;let Nh=0;function jo(){return++Nh}let _t=(Do=N.default.useId)!=null?Do:function(){let e=Ct(),[t,r]=N.default.useState(e?jo:null);return Qe(()=>{t===null&&r(jo())},[t]),t!=null?""+t:void 0};function se(e,t,...r){if(e in t){let i=t[e];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,se),n}function Jn(e){return Rr?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let An=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var at=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(at||{}),Ps=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Ps||{}),Ih=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Ih||{});function $h(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(An)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var xs=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(xs||{});function Rh(e,t=0){var r;return e===((r=Jn(e))==null?void 0:r.body)?!1:se(t,{[0](){return e.matches(An)},[1](){let n=e;for(;n!==null;){if(n.matches(An))return!0;n=n.parentElement}return!1}})}function ut(e){e==null||e.focus({preventScroll:!0})}let Lh=["textarea","input"].join(",");function Fh(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Lh))!=null?r:!1}function kh(e,t=r=>r){return e.slice().sort((r,n)=>{let i=t(r),o=t(n);if(i===null||o===null)return 0;let a=i.compareDocumentPosition(o);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function ir(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?r?kh(e):e:$h(e);i.length>0&&(a=a.filter(d=>!i.includes(d))),n=n!=null?n:o.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,a.indexOf(n))-1;if(t&4)return Math.max(0,a.indexOf(n))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{},f=0,c=a.length,g;do{if(f>=c||f+c<=0)return 0;let d=u+f;if(t&16)d=(d+c)%c;else{if(d<0)return 3;if(d>=c)return 1}g=a[d],g==null||g.focus(l),f+=s}while(g!==o.activeElement);return t&6&&Fh(g)&&g.select(),g.hasAttribute("tabindex")||g.setAttribute("tabindex","0"),2}function un(e,t,r){let n=ze(t);S.useEffect(()=>{function i(o){n.current(o)}return document.addEventListener(e,i,r),()=>document.removeEventListener(e,i,r)},[e,r])}function Mh(e,t,r=!0){let n=S.useRef(!1);S.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function i(a,s){if(!n.current||a.defaultPrevented)return;let u=function f(c){return typeof c=="function"?f(c()):Array.isArray(c)||c instanceof Set?c:[c]}(e),l=s(a);if(l!==null&&!!l.getRootNode().contains(l)){for(let f of u){if(f===null)continue;let c=f instanceof HTMLElement?f:f.current;if(c!=null&&c.contains(l)||a.composed&&a.composedPath().includes(c))return}return!Rh(l,xs.Loose)&&l.tabIndex!==-1&&a.preventDefault(),t(a,l)}}let o=S.useRef(null);un("mousedown",a=>{var s,u;n.current&&(o.current=((u=(s=a.composedPath)==null?void 0:s.call(a))==null?void 0:u[0])||a.target)},!0),un("click",a=>{!o.current||(i(a,()=>o.current),o.current=null)},!0),un("blur",a=>i(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let As=Symbol();function Dh(e,t=!0){return Object.assign(e,{[As]:t})}function Re(...e){let t=S.useRef(e);S.useEffect(()=>{t.current=e},[e]);let r=ce(n=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return e.every(n=>n==null||(n==null?void 0:n[As]))?void 0:r}var yr=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(yr||{}),We=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(We||{});function _e({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:o=!0,name:a}){let s=Cs(t,e);if(o)return Xt(s,r,n,a);let u=i!=null?i:0;if(u&2){let{static:l=!1,...f}=s;if(l)return Xt(f,r,n,a)}if(u&1){let{unmount:l=!0,...f}=s;return se(l?0:1,{[0](){return null},[1](){return Xt({...f,hidden:!0,style:{display:"none"}},r,n,a)}})}return Xt(s,r,n,a)}function Xt(e,t={},r,n){let{as:i=r,children:o,refName:a="ref",...s}=ln(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},l=typeof o=="function"?o(t):o;s.className&&typeof s.className=="function"&&(s.className=s.className(t));let f={};if(t){let c=!1,g=[];for(let[d,p]of Object.entries(t))typeof p=="boolean"&&(c=!0),p===!0&&g.push(d);c&&(f["data-headlessui-state"]=g.join(" "))}if(i===S.Fragment&&Object.keys(Uo(s)).length>0){if(!S.isValidElement(l)||Array.isArray(l)&&l.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(c=>` - ${c}`).join(`
12
12
  `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(c=>` - ${c}`).join(`
13
13
  `)].join(`
14
14
  `));return S.cloneElement(l,Object.assign({},Cs(l.props,Uo(ln(s,["ref"]))),f,u,jh(l.ref,u.ref)))}return S.createElement(i,Object.assign({},ln(s,["ref"]),i!==S.Fragment&&u,i!==S.Fragment&&f),l)}function jh(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}}function Cs(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):t[i]=n[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(t,{[n](i,...o){let a=r[n];for(let s of a){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;s(i,...o)}}});return t}function Ee(e){var t;return Object.assign(S.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Uo(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function ln(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function Uh(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&Vh(r)?!1:n}function Vh(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let Bh="div";var br=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(br||{});let Cn=Ee(function(e,t){let{features:r=1,...n}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return _e({ourProps:i,theirProps:n,slot:{},defaultTag:Bh,name:"Hidden"})}),Zn=S.createContext(null);Zn.displayName="OpenClosedContext";var ft=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ft||{});function Xn(){return S.useContext(Zn)}function Hh({value:e,children:t}){return N.default.createElement(Zn.Provider,{value:e},t)}var _s=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(_s||{});function Ts(e,t){let r=S.useRef([]),n=ce(e);S.useEffect(()=>{let i=[...r.current];for(let[o,a]of t.entries())if(r.current[o]!==a){let s=n(t,i);return r.current=t,s}},[n,...t])}function Wh(e,t,r){let n=ze(t);S.useEffect(()=>{function i(o){n.current(o)}return window.addEventListener(e,i,r),()=>window.removeEventListener(e,i,r)},[e,r])}var Dt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Dt||{});function Gh(){let e=S.useRef(0);return Wh("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Fr(){let e=S.useRef(!1);return Qe(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function kr(...e){return S.useMemo(()=>Jn(...e),[...e])}function ei(e,t,r,n){let i=ze(r);S.useEffect(()=>{e=e!=null?e:window;function o(a){i.current(a)}return e.addEventListener(t,o,n),()=>e.removeEventListener(t,o,n)},[e,t,n])}let zh="div";var Ns=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(Ns||{});let kt=Object.assign(Ee(function(e,t){let r=S.useRef(null),n=Re(r,t),{initialFocus:i,containers:o,features:a=30,...s}=e;Ct()||(a=1);let u=kr(r);Kh({ownerDocument:u},Boolean(a&16));let l=Yh({ownerDocument:u,container:r,initialFocus:i},Boolean(a&2));Qh({ownerDocument:u,container:r,containers:o,previousActiveElement:l},Boolean(a&8));let f=Gh(),c=ce(y=>{let b=r.current;!b||(h=>h())(()=>{se(f.current,{[Dt.Forwards]:()=>ir(b,at.First,{skipElements:[y.relatedTarget]}),[Dt.Backwards]:()=>ir(b,at.Last,{skipElements:[y.relatedTarget]})})})}),g=qn(),d=S.useRef(!1),p={ref:n,onKeyDown(y){y.key=="Tab"&&(d.current=!0,g.requestAnimationFrame(()=>{d.current=!1}))},onBlur(y){let b=new Set(o==null?void 0:o.current);b.add(r);let h=y.relatedTarget;!h||h.dataset.headlessuiFocusGuard!=="true"&&(Is(b,h)||(d.current?ir(r.current,se(f.current,{[Dt.Forwards]:()=>at.Next,[Dt.Backwards]:()=>at.Previous})|at.WrapAround,{relativeTo:y.target}):y.target instanceof HTMLElement&&ut(y.target)))}};return N.default.createElement(N.default.Fragment,null,Boolean(a&4)&&N.default.createElement(Cn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:br.Focusable}),_e({ourProps:p,theirProps:s,defaultTag:zh,name:"FocusTrap"}),Boolean(a&4)&&N.default.createElement(Cn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:br.Focusable}))}),{features:Ns});function Kh({ownerDocument:e},t){let r=S.useRef(null);ei(e==null?void 0:e.defaultView,"focusout",i=>{!t||r.current||(r.current=i.target)},!0),Ts(()=>{t||((e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&ut(r.current),r.current=null)},[t]);let n=S.useRef(!1);S.useEffect(()=>(n.current=!1,()=>{n.current=!0,Lr(()=>{!n.current||(ut(r.current),r.current=null)})}),[])}function Yh({ownerDocument:e,container:t,initialFocus:r},n){let i=S.useRef(null),o=Fr();return Ts(()=>{if(!n)return;let a=t.current;!a||Lr(()=>{if(!o.current)return;let s=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===s){i.current=s;return}}else if(a.contains(s)){i.current=s;return}r!=null&&r.current?ut(r.current):ir(a,at.First)===Ps.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=e==null?void 0:e.activeElement})},[n]),i}function Qh({ownerDocument:e,container:t,containers:r,previousActiveElement:n},i){let o=Fr();ei(e==null?void 0:e.defaultView,"focus",a=>{if(!i||!o.current)return;let s=new Set(r==null?void 0:r.current);s.add(t);let u=n.current;if(!u)return;let l=a.target;l&&l instanceof HTMLElement?Is(s,l)?(n.current=l,ut(l)):(a.preventDefault(),a.stopPropagation(),ut(u)):ut(n.current)},!0)}function Is(e,t){var r;for(let n of e)if((r=n.current)!=null&&r.contains(t))return!0;return!1}let yt=new Set,Ze=new Map;function Vo(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function Bo(e){let t=Ze.get(e);!t||(t["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function qh(e,t=!0){Qe(()=>{if(!t||!e.current)return;let r=e.current,n=Jn(r);if(n){yt.add(r);for(let i of Ze.keys())i.contains(r)&&(Bo(i),Ze.delete(i));return n.querySelectorAll("body > *").forEach(i=>{if(i instanceof HTMLElement){for(let o of yt)if(i.contains(o))return;yt.size===1&&(Ze.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),Vo(i))}}),()=>{if(yt.delete(r),yt.size>0)n.querySelectorAll("body > *").forEach(i=>{if(i instanceof HTMLElement&&!Ze.has(i)){for(let o of yt)if(i.contains(o))return;Ze.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),Vo(i)}});else for(let i of Ze.keys())Bo(i),Ze.delete(i)}}},[t])}let $s=S.createContext(!1);function Jh(){return S.useContext($s)}function _n(e){return N.default.createElement($s.Provider,{value:e.force},e.children)}function Zh(e){let t=Jh(),r=S.useContext(Rs),n=kr(e),[i,o]=S.useState(()=>{if(!t&&r!==null||Rr)return null;let a=n==null?void 0:n.getElementById("headlessui-portal-root");if(a)return a;if(n===null)return null;let s=n.createElement("div");return s.setAttribute("id","headlessui-portal-root"),n.body.appendChild(s)});return S.useEffect(()=>{i!==null&&(n!=null&&n.body.contains(i)||n==null||n.body.appendChild(i))},[i,n]),S.useEffect(()=>{t||r!==null&&o(r.current)},[r,o,t]),i}let Xh=S.Fragment,em=Ee(function(e,t){let r=e,n=S.useRef(null),i=Re(Dh(f=>{n.current=f}),t),o=kr(n),a=Zh(n),[s]=S.useState(()=>{var f;return Rr?null:(f=o==null?void 0:o.createElement("div"))!=null?f:null}),u=Ct(),l=S.useRef(!1);return Qe(()=>{if(l.current=!1,!(!a||!s))return a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s)),()=>{l.current=!0,Lr(()=>{var f;!l.current||!a||!s||(a.removeChild(s),a.childNodes.length<=0&&((f=a.parentElement)==null||f.removeChild(a)))})}},[a,s]),u?!a||!s?null:Ws.createPortal(_e({ourProps:{ref:i},theirProps:r,defaultTag:Xh,name:"Portal"}),s):null}),tm=S.Fragment,Rs=S.createContext(null),rm=Ee(function(e,t){let{target:r,...n}=e,i={ref:Re(t)};return N.default.createElement(Rs.Provider,{value:r},_e({ourProps:i,theirProps:n,defaultTag:tm,name:"Popover.Group"}))}),Tn=Object.assign(em,{Group:rm}),Ls=S.createContext(null);function Fs(){let e=S.useContext(Ls);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Fs),t}return e}function nm(){let[e,t]=S.useState([]);return[e.length>0?e.join(" "):void 0,S.useMemo(()=>function(r){let n=ce(o=>(t(a=>[...a,o]),()=>t(a=>{let s=a.slice(),u=s.indexOf(o);return u!==-1&&s.splice(u,1),s}))),i=S.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props}),[n,r.slot,r.name,r.props]);return N.default.createElement(Ls.Provider,{value:i},r.children)},[t])]}let im="p",om=Ee(function(e,t){let r=_t(),{id:n=`headlessui-description-${r}`,...i}=e,o=Fs(),a=Re(t);Qe(()=>o.register(n),[n,o.register]);let s={ref:a,...o.props,id:n};return _e({ourProps:s,theirProps:i,slot:o.slot||{},defaultTag:im,name:o.name||"Description"})}),ti=S.createContext(()=>{});ti.displayName="StackContext";var Nn=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Nn||{});function am(){return S.useContext(ti)}function sm({children:e,onUpdate:t,type:r,element:n,enabled:i}){let o=am(),a=ce((...s)=>{t==null||t(...s),o(...s)});return Qe(()=>{let s=i===void 0||i===!0;return s&&a(0,r,n),()=>{s&&a(1,r,n)}},[a,r,n,i]),N.default.createElement(ti.Provider,{value:a},e)}function um(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}var lm=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(lm||{}),cm=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(cm||{});let fm={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Sr=S.createContext(null);Sr.displayName="DialogContext";function Yt(e){let t=S.useContext(Sr);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Yt),r}return t}function dm(e,t,r=()=>[document.body]){S.useEffect(()=>{var n;if(!t||!e)return;let i=Kt(),o=window.pageYOffset;function a(l,f,c){let g=l.style.getPropertyValue(f);return Object.assign(l.style,{[f]:c}),i.add(()=>{Object.assign(l.style,{[f]:g})})}let s=e.documentElement,u=((n=e.defaultView)!=null?n:window).innerWidth-s.clientWidth;if(a(s,"overflow","hidden"),u>0){let l=s.clientWidth-s.offsetWidth,f=u-l;a(s,"paddingRight",`${f}px`)}if(um()){a(e.body,"marginTop",`-${o}px`),window.scrollTo(0,0);let l=null;i.addEventListener(e,"click",f=>{if(f.target instanceof HTMLElement)try{let c=f.target.closest("a");if(!c)return;let{hash:g}=new URL(c.href),d=e.querySelector(g);d&&!r().some(p=>p.contains(d))&&(l=d)}catch{}},!0),i.addEventListener(e,"touchmove",f=>{f.target instanceof HTMLElement&&!r().some(c=>c.contains(f.target))&&f.preventDefault()},{passive:!1}),i.add(()=>{window.scrollTo(0,window.pageYOffset+o),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})}return i.dispose},[e,t])}function gm(e,t){return se(t.type,fm,e,t)}let pm="div",hm=yr.RenderStrategy|yr.Static,mm=Ee(function(e,t){let r=_t(),{id:n=`headlessui-dialog-${r}`,open:i,onClose:o,initialFocus:a,__demoMode:s=!1,...u}=e,[l,f]=S.useState(0),c=Xn();i===void 0&&c!==null&&(i=se(c,{[ft.Open]:!0,[ft.Closed]:!1}));let g=S.useRef(new Set),d=S.useRef(null),p=Re(d,t),y=S.useRef(null),b=kr(d),h=e.hasOwnProperty("open")||c!==null,v=e.hasOwnProperty("onClose");if(!h&&!v)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!h)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!v)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof i!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if(typeof o!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let P=i?0:1,[E,w]=S.useReducer(gm,{titleId:null,descriptionId:null,panelRef:S.createRef()}),C=ce(()=>o(!1)),T=ce(W=>w({type:0,id:W})),R=Ct()?s?!1:P===0:!1,F=l>1,j=S.useContext(Sr)!==null,L=F?"parent":"leaf";qh(d,F?R:!1);let D=ce(()=>{var W,ie;return[...Array.from((W=b==null?void 0:b.querySelectorAll("body > *, [data-headlessui-portal]"))!=null?W:[]).filter(U=>!(!(U instanceof HTMLElement)||U.contains(y.current)||E.panelRef.current&&U.contains(E.panelRef.current))),(ie=E.panelRef.current)!=null?ie:d.current]});Mh(()=>D(),C,R&&!F),ei(b==null?void 0:b.defaultView,"keydown",W=>{W.defaultPrevented||W.key===_s.Escape&&P===0&&(F||(W.preventDefault(),W.stopPropagation(),C()))}),dm(b,P===0&&!j,D),S.useEffect(()=>{if(P!==0||!d.current)return;let W=new IntersectionObserver(ie=>{for(let U of ie)U.boundingClientRect.x===0&&U.boundingClientRect.y===0&&U.boundingClientRect.width===0&&U.boundingClientRect.height===0&&C()});return W.observe(d.current),()=>W.disconnect()},[P,d,C]);let[V,H]=nm(),Z=S.useMemo(()=>[{dialogState:P,close:C,setTitleId:T},E],[P,E,C,T]),G=S.useMemo(()=>({open:P===0}),[P]),X={ref:p,id:n,role:"dialog","aria-modal":P===0?!0:void 0,"aria-labelledby":E.titleId,"aria-describedby":V};return N.default.createElement(sm,{type:"Dialog",enabled:P===0,element:d,onUpdate:ce((W,ie,U)=>{ie==="Dialog"&&se(W,{[Nn.Add](){g.current.add(U),f(ne=>ne+1)},[Nn.Remove](){g.current.add(U),f(ne=>ne-1)}})})},N.default.createElement(_n,{force:!0},N.default.createElement(Tn,null,N.default.createElement(Sr.Provider,{value:Z},N.default.createElement(Tn.Group,{target:d},N.default.createElement(_n,{force:!1},N.default.createElement(H,{slot:G,name:"Dialog.Description"},N.default.createElement(kt,{initialFocus:a,containers:g,features:R?se(L,{parent:kt.features.RestoreFocus,leaf:kt.features.All&~kt.features.FocusLock}):kt.features.None},_e({ourProps:X,theirProps:u,slot:G,defaultTag:pm,features:hm,visible:P===0,name:"Dialog"})))))))),N.default.createElement(Cn,{features:br.Hidden,ref:y}))}),vm="div",ym=Ee(function(e,t){let r=_t(),{id:n=`headlessui-dialog-overlay-${r}`,...i}=e,[{dialogState:o,close:a}]=Yt("Dialog.Overlay"),s=Re(t),u=ce(f=>{if(f.target===f.currentTarget){if(Uh(f.currentTarget))return f.preventDefault();f.preventDefault(),f.stopPropagation(),a()}}),l=S.useMemo(()=>({open:o===0}),[o]);return _e({ourProps:{ref:s,id:n,"aria-hidden":!0,onClick:u},theirProps:i,slot:l,defaultTag:vm,name:"Dialog.Overlay"})}),bm="div",Sm=Ee(function(e,t){let r=_t(),{id:n=`headlessui-dialog-backdrop-${r}`,...i}=e,[{dialogState:o},a]=Yt("Dialog.Backdrop"),s=Re(t);S.useEffect(()=>{if(a.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[a.panelRef]);let u=S.useMemo(()=>({open:o===0}),[o]);return N.default.createElement(_n,{force:!0},N.default.createElement(Tn,null,_e({ourProps:{ref:s,id:n,"aria-hidden":!0},theirProps:i,slot:u,defaultTag:bm,name:"Dialog.Backdrop"})))}),Om="div",wm=Ee(function(e,t){let r=_t(),{id:n=`headlessui-dialog-panel-${r}`,...i}=e,[{dialogState:o},a]=Yt("Dialog.Panel"),s=Re(t,a.panelRef),u=S.useMemo(()=>({open:o===0}),[o]),l=ce(f=>{f.stopPropagation()});return _e({ourProps:{ref:s,id:n,onClick:l},theirProps:i,slot:u,defaultTag:Om,name:"Dialog.Panel"})}),Em="h2",Pm=Ee(function(e,t){let r=_t(),{id:n=`headlessui-dialog-title-${r}`,...i}=e,[{dialogState:o,setTitleId:a}]=Yt("Dialog.Title"),s=Re(t);S.useEffect(()=>(a(n),()=>a(null)),[n,a]);let u=S.useMemo(()=>({open:o===0}),[o]);return _e({ourProps:{ref:s,id:n},theirProps:i,slot:u,defaultTag:Em,name:"Dialog.Title"})}),Ho=Object.assign(mm,{Backdrop:Sm,Panel:wm,Overlay:ym,Title:Pm,Description:om});function xm(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function cn(e,...t){e&&t.length>0&&e.classList.add(...t)}function fn(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Am(e,t){let r=Kt();if(!e)return r.dispose;let{transitionDuration:n,transitionDelay:i}=getComputedStyle(e),[o,a]=[n,i].map(s=>{let[u=0]=s.split(",").filter(Boolean).map(l=>l.includes("ms")?parseFloat(l):parseFloat(l)*1e3).sort((l,f)=>f-l);return u});if(o+a!==0){let s=r.addEventListener(e,"transitionend",u=>{u.target===u.currentTarget&&(t(),s())})}else t();return r.add(()=>t()),r.dispose}function Cm(e,t,r,n){let i=r?"enter":"leave",o=Kt(),a=n!==void 0?xm(n):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=se(i,{enter:()=>t.enter,leave:()=>t.leave}),u=se(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),l=se(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return fn(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),cn(e,...s,...l),o.nextFrame(()=>{fn(e,...l),cn(e,...u),Am(e,()=>(fn(e,...s),cn(e,...t.entered),a()))}),o.dispose}function _m({container:e,direction:t,classes:r,onStart:n,onStop:i}){let o=Fr(),a=qn(),s=ze(t);Qe(()=>{let u=Kt();a.add(u.dispose);let l=e.current;if(!!l&&s.current!=="idle"&&!!o.current)return u.dispose(),n.current(s.current),u.add(Cm(l,r.current,s.current==="enter",()=>{u.dispose(),i.current(s.current)})),u.dispose},[t])}function Tm(...e){return e.filter(Boolean).join(" ")}function it(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Mr=S.createContext(null);Mr.displayName="TransitionContext";var Nm=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Nm||{});function Im(){let e=S.useContext(Mr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function $m(){let e=S.useContext(Dr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Dr=S.createContext(null);Dr.displayName="NestingContext";function jr(e){return"children"in e?jr(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function ks(e,t){let r=ze(e),n=S.useRef([]),i=Fr(),o=qn(),a=ce((d,p=We.Hidden)=>{let y=n.current.findIndex(({el:b})=>b===d);y!==-1&&(se(p,{[We.Unmount](){n.current.splice(y,1)},[We.Hidden](){n.current[y].state="hidden"}}),o.microTask(()=>{var b;!jr(n)&&i.current&&((b=r.current)==null||b.call(r))}))}),s=ce(d=>{let p=n.current.find(({el:y})=>y===d);return p?p.state!=="visible"&&(p.state="visible"):n.current.push({el:d,state:"visible"}),()=>a(d,We.Unmount)}),u=S.useRef([]),l=S.useRef(Promise.resolve()),f=S.useRef({enter:[],leave:[],idle:[]}),c=ce((d,p,y)=>{u.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([b])=>b!==d)),t==null||t.chains.current[p].push([d,new Promise(b=>{u.current.push(b)})]),t==null||t.chains.current[p].push([d,new Promise(b=>{Promise.all(f.current[p].map(([h,v])=>v)).then(()=>b())})]),p==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(p)):y(p)}),g=ce((d,p,y)=>{Promise.all(f.current[p].splice(0).map(([b,h])=>h)).then(()=>{var b;(b=u.current.shift())==null||b()}).then(()=>y(p))});return S.useMemo(()=>({children:n,register:s,unregister:a,onStart:c,onStop:g,wait:l,chains:f}),[s,a,n,c,g,f,l])}function Rm(){}let Lm=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Wo(e){var t;let r={};for(let n of Lm)r[n]=(t=e[n])!=null?t:Rm;return r}function Fm(e){let t=S.useRef(Wo(e));return S.useEffect(()=>{t.current=Wo(e)},[e]),t}let km="div",Ms=yr.RenderStrategy,Ds=Ee(function(e,t){let{beforeEnter:r,afterEnter:n,beforeLeave:i,afterLeave:o,enter:a,enterFrom:s,enterTo:u,entered:l,leave:f,leaveFrom:c,leaveTo:g,...d}=e,p=S.useRef(null),y=Re(p,t),b=d.unmount?We.Unmount:We.Hidden,{show:h,appear:v,initial:P}=Im(),[E,w]=S.useState(h?"visible":"hidden"),C=$m(),{register:T,unregister:R}=C,F=S.useRef(null);S.useEffect(()=>T(p),[T,p]),S.useEffect(()=>{if(b===We.Hidden&&!!p.current){if(h&&E!=="visible"){w("visible");return}return se(E,{hidden:()=>R(p),visible:()=>T(p)})}},[E,p,T,R,h,b]);let j=ze({enter:it(a),enterFrom:it(s),enterTo:it(u),entered:it(l),leave:it(f),leaveFrom:it(c),leaveTo:it(g)}),L=Fm({beforeEnter:r,afterEnter:n,beforeLeave:i,afterLeave:o}),D=Ct();S.useEffect(()=>{if(D&&E==="visible"&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,E,D]);let V=P&&!v,H=(()=>!D||V||F.current===h?"idle":h?"enter":"leave")(),Z=ce(U=>se(U,{enter:()=>L.current.beforeEnter(),leave:()=>L.current.beforeLeave(),idle:()=>{}})),G=ce(U=>se(U,{enter:()=>L.current.afterEnter(),leave:()=>L.current.afterLeave(),idle:()=>{}})),X=ks(()=>{w("hidden"),R(p)},C);_m({container:p,classes:j,direction:H,onStart:ze(U=>{X.onStart(p,U,Z)}),onStop:ze(U=>{X.onStop(p,U,G),U==="leave"&&!jr(X)&&(w("hidden"),R(p))})}),S.useEffect(()=>{!V||(b===We.Hidden?F.current=null:F.current=h)},[h,V,E]);let W=d,ie={ref:y};return v&&h&&(typeof window=="undefined"||typeof document=="undefined")&&(W={...W,className:Tm(d.className,...j.current.enter,...j.current.enterFrom)}),N.default.createElement(Dr.Provider,{value:X},N.default.createElement(Hh,{value:se(E,{visible:ft.Open,hidden:ft.Closed})},_e({ourProps:ie,theirProps:W,defaultTag:km,features:Ms,visible:E==="visible",name:"Transition.Child"})))}),In=Ee(function(e,t){let{show:r,appear:n=!1,unmount:i,...o}=e,a=S.useRef(null),s=Re(a,t);Ct();let u=Xn();if(r===void 0&&u!==null&&(r=se(u,{[ft.Open]:!0,[ft.Closed]:!1})),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,f]=S.useState(r?"visible":"hidden"),c=ks(()=>{f("hidden")}),[g,d]=S.useState(!0),p=S.useRef([r]);Qe(()=>{g!==!1&&p.current[p.current.length-1]!==r&&(p.current.push(r),d(!1))},[p,r]);let y=S.useMemo(()=>({show:r,appear:n,initial:g}),[r,n,g]);S.useEffect(()=>{if(r)f("visible");else if(!jr(c))f("hidden");else{let h=a.current;if(!h)return;let v=h.getBoundingClientRect();v.x===0&&v.y===0&&v.width===0&&v.height===0&&f("hidden")}},[r,c]);let b={unmount:i};return N.default.createElement(Dr.Provider,{value:c},N.default.createElement(Mr.Provider,{value:y},_e({ourProps:{...b,as:S.Fragment,children:N.default.createElement(Ds,{ref:s,...b,...o})},theirProps:{},defaultTag:S.Fragment,features:Ms,visible:l==="visible",name:"Transition"})))}),Mm=Ee(function(e,t){let r=S.useContext(Mr)!==null,n=Xn()!==null;return N.default.createElement(N.default.Fragment,null,!r&&n?N.default.createElement(In,{ref:t,...e}):N.default.createElement(Ds,{ref:t,...e}))}),dn=Object.assign(In,{Child:Mm,Root:In});function Dm(e){const{children:t,isOpen:r,handleClose:n}=e,{isMobile:i}=ws({isModal:!0});return x(je,{children:x(dn,{appear:!0,show:r,as:S.Fragment,children:x(Ho,{as:"div",className:"fixed inset-0 z-10 overflow-y-auto",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:n,children:B("div",{className:"min-h-screen text-center sm:px-4",children:[x(dn.Child,{as:S.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:x(Ho.Overlay,{className:"fixed inset-0"})}),x("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),x(dn.Child,{as:S.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:B("div",{id:"modal-content",className:"inline-block overflow-hidden sm:rounded-2xl align-middle transition-all bg-white sm:shadow-xl h-[100vh] sm:h-auto sm:max-h-[90vh] w-full sm:w-[640px]",children:[x("div",{className:"sticky top-0 z-10 flex items-center w-full px-3 text-lg font-medium leading-6 text-gray-900 bg-white h-14 modal-header",children:x("div",{className:"",children:B("svg",{className:"w-8 h-8 text-black cursor-pointer",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",onClick:n,children:[x("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",x("line",{x1:"5",y1:"12",x2:"19",y2:"12"})," ",x("line",{x1:"5",y1:"12",x2:"11",y2:"18"})," ",x("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]})})}),x("div",{className:"w-full",style:{height:`${i?"calc(100% - 56px)":"auto"}`},children:t})]})})]})})})})}function jm(e){var H,Z,G,X;const{product:t,isOpen:r,handleGoBack:n,showDebugState:i=!1,countedProductPrice:o,productQuantity:a,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:l,children:f}=e,{minPrice:c="0"}=t,[g,d]=S.useState("auto"),[p,y]=S.useState(0);S.useEffect(()=>{y(1);const W=setTimeout(()=>{w||y(2)},250);return()=>{clearTimeout(W)}},[]);const{displayPriceFrom:b,formattedEndPrice:h}=Rp(o,c,a),v=S.useRef(),P=S.useRef(),{isSm:E,isMobile:w,windowHeight:C}=ws({isModal:!0}),T=B(je,{children:[B("div",{className:Ft("px-4 w-full",E&&"sm:sticky sm:top-0 sm:w-2/5"),ref:v,children:[t.details.media&&t.details.media[0].url&&x("img",{className:Ft("mx-auto mt-2 mb-6 max-h-[250px]",E&&"max-h-[450px]"),alt:t.details.literals.name,src:(H=t.details)==null?void 0:H.media[0].url}),x("div",{className:Ft(!i&&"hidden"),children:x(Os,{})})]}),B("div",{className:Ft("w-full",E&&"sm:w-3/5"),ref:P,children:[B("div",{className:"items-center w-full p-4",children:[B("div",{className:"flex justify-between w-full mb-4 text-2xl font-semibold",children:[B("span",{className:"",children:[t.details.literals.name," "]}),x(Ir,{price:e.countedProductPrice,minPrice:c})]}),x("span",{className:"text-gray-600",children:(Z=t.details.literals)==null?void 0:Z.description})]}),B("div",{className:`items-center justify-center w-full px-4 product-configuration ${(t==null?void 0:t.items)&&"py-2 bg-gray-100"}`,children:[f,x("div",{className:"sm:h-[64px]"})]}),E&&x("div",{className:"-mt-5 mb-2 bg-gray-100",children:x(Mo,{finalPrice:h,isBackIcon:!1,handleGoBack:n,displayPriceFrom:b})})]})]}),R=(G=v==null?void 0:v.current)==null?void 0:G.clientHeight,F=(X=P==null?void 0:P.current)==null?void 0:X.clientHeight,j=R+F;j>window.innerHeight*.8||isNaN(j)?g!=="80vh"&&d("80vh"):g!=="auto"&&d("auto");const L=`${C-64-56}px`,D=!E,V={"--mobile-submit-row-top":`${C-64-80}px`};return x(Dm,{isOpen:Boolean(r),handleClose:n,children:B("div",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},children:[x("div",{className:Ft("flex relative flex-col items-start w-full form-body stretch",!D&&"sm:flex-row-reverse sm:pb-0",!w&&"mobile-scrollbar"),style:{height:`${w?L:g}`,minHeight:"400px",overflowY:"scroll"},children:T}),D&&x("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${w?"submit-row-mobile":"submit-row"}`,style:V,children:x(Mo,{handleGoBack:n,finalPrice:h,isBackIcon:!1,productQuantity:a,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:l})})]})})}const ri=(e,t={},r,n,i=0)=>{var a,s;const o=n||{};return(i===0||((a=t[e.selCtx])==null?void 0:a[e.id]))&&((s=e==null?void 0:e.items)==null||s.forEach(u=>{var l,f,c,g,d,p,y,b,h,v,P,E,w,C,T,R;if(u.kind===Me.OPTIONS&&(((l=u.attrs)==null?void 0:l.vital)||((f=u==null?void 0:u.attrs)==null?void 0:f.selMin)||((c=u.attrs)==null?void 0:c.selMax)||((g=u.attrs)==null?void 0:g.qtyMin)||((d=u.attrs)==null?void 0:d.qtyMax)||((p=u.attrs)==null?void 0:p.allowMultiple))){const[F,j]=ss(u.selCtx,t,u.items),L=_r(e,r);o[u.selCtx]={isSelCntAllowedToIncrement:F<Number(((y=u==null?void 0:u.attrs)==null?void 0:y.selMax)||Number.MAX_SAFE_INTEGER),isQtyCntAllowedToIncrement:j<Number(((b=u==null?void 0:u.attrs)==null?void 0:b.qtyMax)||Number.MAX_SAFE_INTEGER),nestedLvl:i,isPassedFiltering:L,isValid:mr(F,Number(((h=u.attrs)==null?void 0:h.selMin)||0),Number(((v=u.attrs)==null?void 0:v.selMax)||Number.MAX_SAFE_INTEGER)+1)&&mr(j,Number(((P=u.attrs)==null?void 0:P.qtyMin)||0),Number(((E=u.attrs)==null?void 0:E.qtyMax)||Number.MAX_SAFE_INTEGER)+1)&&(((w=u.attrs)==null?void 0:w.vital)!==!0||F>0)&&(((C=u.attrs)==null?void 0:C.allowMultiple)===!0||j-F===0)}}(u==null?void 0:u.items)&&((T=u.items)==null?void 0:T.length)>0&&((R=u.items)==null||R.forEach(F=>{ri(F,t,r,o,i+1)}))})),o},js=N.default.createContext(null);function Um({rootProduct:e,children:t}){return x(js.Provider,{value:{rootProduct:e},children:t})}function Vm(e){const t=S.useContext(js),r=ur({name:"selected"}),n=ur({name:"filter"}),[i,o]=S.useState(void 0);if(!t)throw new Error("Missing ComponentsContext");return S.useEffect(()=>{console.log("useGroupsValidation validationMap2 change")},[i]),S.useEffect(()=>{const a=ri(e,r,n);kg(a,i)||o(a)},[r,n]),{validationMap2:i}}const Bm=e=>{const{product:t}=e,{MenuProductRootUI:r}=$r(),{validationMap2:n}=Vm(t),i=$e(t.items)?x(je,{}):x(Qn,{productItems:t.items,parentProduct:t,rootProduct:t});return r?x(r,{...e,validationMap:n||{},children:i}):x(jm,{...e,validationMap:n||{},children:i})};const Us=N.default.createContext(null);function Hm({rootProduct:e,children:t}){return x(Us.Provider,{value:{rootProduct:e},children:t})}function Wm(){const e=S.useContext(Us);if(!e)throw new Error("Missing ComponentsContext");return e}function Gm(e){const{product:t,lang:r="en",handleAddToCart:n,handleGoBack:i,isOpen:o,handleClose:a,currency:s,showDebugState:u=!1}=e,{price:l}=t,{encodedProduct:f,initSelected:c,initFilter:g,productQuantity:d,setIsOnSubmittedOnTrue:p,getInvalidSelCtxArray:y,increaseProductQuantity:b,decreaseProductQuantity:h,setCurrency:v}=np(t);S.useEffect(()=>{pe.changeLanguage(r)},[r]),S.useEffect(()=>{v(s)},[s]);const P=ya({defaultValues:{selected:c,filter:g}}),{getValues:E}=P,w=Number((parseFloat(l||"0")+jn(E("selected"),f)).toFixed(2)),C=()=>{var j;p();const R=ri(t,E("selected"),E("filter"));if(console.log("onSubmit product-configurator",R),Object.keys(R).some(function(L){return R[L].isValid===!1}))console.warn("INVALID VALIDATION MAP product-configurator",R);else{console.log("selected",E("selected"));const L=Hg(ns(E("selected"))),D=E("filter");(j=Object.keys(L||{}))==null||j.forEach(V=>{const H=os(V,t);H&&(_r(H,D)||delete L[V])}),console.log("decodedCleanedSelected product-configurator: ",L),n({price:w,quantity:d,selected:L,filter:D})}},T=()=>C();return x(je,{children:x(Hm,{rootProduct:t,children:x(bs.Provider,{value:e.components,children:x(ra,{...P,children:B("form",{children:[u&&x("div",{className:"hidden",children:x(Os,{})}),x(Um,{rootProduct:f,children:x(Bm,{product:f,productQuantity:d,isOpen:o,handleClose:a,handleGoBack:i,handleOnSubmit:T,countedProductPrice:w,countedProductTotalPrice:w*d,increaseProductQuantity:b,decreaseProductQuantity:h,currency:s})})]})})})})})}exports.ContextType=Mn;exports.MainView=ba;exports.ProductConfigurator=Gm;exports.ProductKinds=Dn;exports.ProductTypes=Sa;exports.SelMinSelMaxStatus=xe;exports.getProductToChangeInForm=ls;exports.hookForm=ju;exports.selectProductsInForm=cs;exports.unselectProductsInForm=ip;exports.useMenuOptions=fs;exports.useProductData=Wm;exports.useStore=re;exports.validateProductFilter=_r;