@orderingstack/front-components-product-configurator 1.5.2-beta.28 → 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.
Files changed (54) hide show
  1. package/dist/components/Counter/Counter.d.ts +2 -1
  2. package/dist/components/Counter/Counter.d.ts.map +1 -1
  3. package/dist/components/DisplayState/DisplayState.d.ts +2 -1
  4. package/dist/components/DisplayState/DisplayState.d.ts.map +1 -1
  5. package/dist/components/GroupStateInfo/GroupStateInfo.d.ts +2 -1
  6. package/dist/components/GroupStateInfo/GroupStateInfo.d.ts.map +1 -1
  7. package/dist/components/InfoLine/InfoLine.d.ts +2 -1
  8. package/dist/components/InfoLine/InfoLine.d.ts.map +1 -1
  9. package/dist/components/MenuItemsDispatcher/MenuItemsDispatcher.d.ts +3 -2
  10. package/dist/components/MenuItemsDispatcher/MenuItemsDispatcher.d.ts.map +1 -1
  11. package/dist/components/MenuOptions/MenuOptions.d.ts +2 -1
  12. package/dist/components/MenuOptions/MenuOptions.d.ts.map +1 -1
  13. package/dist/components/MenuOptions/MenuOptionsDefaultUI.d.ts +2 -1
  14. package/dist/components/MenuOptions/MenuOptionsDefaultUI.d.ts.map +1 -1
  15. package/dist/components/MenuProduct/MenuProduct.d.ts +3 -2
  16. package/dist/components/MenuProduct/MenuProduct.d.ts.map +1 -1
  17. package/dist/components/MenuProduct/useMenuProduct.d.ts +2 -2
  18. package/dist/components/MenuProduct/useMenuProduct.d.ts.map +1 -1
  19. package/dist/components/MenuProductRoot/MenuProductRoot.d.ts +2 -1
  20. package/dist/components/MenuProductRoot/MenuProductRoot.d.ts.map +1 -1
  21. package/dist/components/MenuProductRoot/MenuProductRootDefaultUI.d.ts +2 -1
  22. package/dist/components/MenuProductRoot/MenuProductRootDefaultUI.d.ts.map +1 -1
  23. package/dist/components/MenuProductRoot/MenuProductRootDefaultUIModal.d.ts +2 -1
  24. package/dist/components/MenuProductRoot/MenuProductRootDefaultUIModal.d.ts.map +1 -1
  25. package/dist/components/Price/Price.d.ts +2 -1
  26. package/dist/components/Price/Price.d.ts.map +1 -1
  27. package/dist/components/ProductConfigurator/ProductConfigurator.d.ts +2 -1
  28. package/dist/components/ProductConfigurator/ProductConfigurator.d.ts.map +1 -1
  29. package/dist/components/ProductConfigurator/useProductConfigurator.d.ts +1 -1
  30. package/dist/components/ProductConfigurator/useProductConfigurator.d.ts.map +1 -1
  31. package/dist/components/SimpleCheckbox/SimpleCheckbox.d.ts +2 -1
  32. package/dist/components/SimpleCheckbox/SimpleCheckbox.d.ts.map +1 -1
  33. package/dist/components/SimpleRadio/SimpleRadio.d.ts +2 -1
  34. package/dist/components/SimpleRadio/SimpleRadio.d.ts.map +1 -1
  35. package/dist/components/SubmitRow/SubmitRow.d.ts +2 -1
  36. package/dist/components/SubmitRow/SubmitRow.d.ts.map +1 -1
  37. package/dist/context/GroupsValidation.d.ts +15 -0
  38. package/dist/context/GroupsValidation.d.ts.map +1 -0
  39. package/dist/context/ProductData.d.ts +1 -1
  40. package/dist/context/ProductData.d.ts.map +1 -1
  41. package/dist/index.cjs.js +6 -6
  42. package/dist/index.cjs.js.map +1 -1
  43. package/dist/index.es.js +1342 -1679
  44. package/dist/index.es.js.map +1 -1
  45. package/dist/state/index.d.ts +1 -1
  46. package/dist/state/index.d.ts.map +1 -1
  47. package/dist/style.css +1 -1
  48. package/dist/types/index.d.ts +8 -6
  49. package/dist/types/index.d.ts.map +1 -1
  50. package/dist/utils/groupsValidation.d.ts +4 -0
  51. package/dist/utils/groupsValidation.d.ts.map +1 -0
  52. package/dist/utils/setSelected.d.ts +2 -0
  53. package/dist/utils/setSelected.d.ts.map +1 -1
  54. package/package.json +91 -89
package/dist/index.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var S=require("react"),ci=require("react-spring"),Xs=require("react-dom");function eu(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}function tu(e){if(e&&e.__esModule)return e;var t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});return e&&Object.keys(e).forEach(function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var T=eu(S),ot=tu(S);function De(e){return De=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},De(e)}function $e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ru(e,t){if(De(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(De(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function za(e){var t=ru(e,"string");return De(t)=="symbol"?t:t+""}function fi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,za(n.key),n)}}function Ie(e,t,r){return t&&fi(e.prototype,t),r&&fi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function st(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bn(e,t){return bn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},bn(e,t)}function Nr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bn(e,t)}function Xt(e,t){if(t&&(De(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return st(e)}function We(e){return We=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},We(e)}function Ke(e,t,r){return(t=za(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qa(e){if(Array.isArray(e))return e}function nu(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function di(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function qa(e,t){if(e){if(typeof e=="string")return di(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?di(e,t):void 0}}function Ja(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iu(e){return Qa(e)||nu(e)||qa(e)||Ja()}function gi(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 pi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gi(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var au={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,r){console&&console[t]&&console[t].apply(console,r)}},ou=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$e(this,e),this.init(t,r)}return Ie(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=r||au,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(r){this.debug=r}},{key:"log",value:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return this.forward(n,"log","",!0)}},{key:"warn",value:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return this.forward(n,"warn","",!0)}},{key:"error",value:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return this.forward(n,"error","")}},{key:"deprecate",value:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(r,n,i,a){return a&&!this.debug?null:(typeof r[0]=="string"&&(r[0]="".concat(i).concat(this.prefix," ").concat(r[0])),this.logger[n](r))}},{key:"create",value:function(r){return new e(this.logger,pi(pi({},{prefix:"".concat(this.prefix,":").concat(r,":")}),this.options))}},{key:"clone",value:function(r){return r=r||this.options,r.prefix=r.prefix||this.prefix,new e(this.logger,r)}}]),e}(),Ue=new ou,ut=function(){function e(){$e(this,e),this.observers={}}return Ie(e,[{key:"on",value:function(r,n){var i=this;return r.split(" ").forEach(function(a){i.observers[a]=i.observers[a]||[],i.observers[a].push(n)}),this}},{key:"off",value:function(r,n){if(!!this.observers[r]){if(!n){delete this.observers[r];return}this.observers[r]=this.observers[r].filter(function(i){return i!==n})}}},{key:"emit",value:function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];if(this.observers[r]){var o=[].concat(this.observers[r]);o.forEach(function(u){u.apply(void 0,i)})}if(this.observers["*"]){var s=[].concat(this.observers["*"]);s.forEach(function(u){u.apply(u,[r].concat(i))})}}}]),e}();function Ft(){var e,t,r=new Promise(function(n,i){e=n,t=i});return r.resolve=e,r.reject=t,r}function hi(e){return e==null?"":""+e}function su(e,t,r){e.forEach(function(n){t[n]&&(r[n]=t[n])})}function kn(e,t,r){function n(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var a=typeof t!="string"?[].concat(t):t.split(".");a.length>1;){if(i())return{};var o=n(a.shift());!e[o]&&r&&(e[o]=new r),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={}}return i()?{}:{obj:e,k:n(a.shift())}}function mi(e,t,r){var n=kn(e,t,Object),i=n.obj,a=n.k;i[a]=r}function uu(e,t,r,n){var i=kn(e,t,Object),a=i.obj,o=i.k;a[o]=a[o]||[],n&&(a[o]=a[o].concat(r)),n||a[o].push(r)}function mr(e,t){var r=kn(e,t),n=r.obj,i=r.k;if(!!n)return n[i]}function vi(e,t,r){var n=mr(e,r);return n!==void 0?n:mr(t,r)}function Za(e,t,r){for(var n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?r&&(e[n]=t[n]):Za(e[n],t[n],r):e[n]=t[n]);return e}function xt(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var lu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function cu(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return lu[t]}):e}var $r=typeof window!="undefined"&&window.navigator&&typeof window.navigator.userAgentData=="undefined"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,fu=[" ",",","?","!",";"];function du(e,t,r){t=t||"",r=r||"";var n=fu.filter(function(s){return t.indexOf(s)<0&&r.indexOf(s)<0});if(n.length===0)return!0;var i=new RegExp("(".concat(n.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),a=!i.test(e);if(!a){var o=e.indexOf(r);o>0&&!i.test(e.substring(0,o))&&(a=!0)}return a}function yi(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 ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yi(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gu(e){var t=pu();return function(){var n=We(e),i;if(t){var a=We(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Xt(this,i)}}function pu(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Xa(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!e){if(e[t])return e[t];for(var n=t.split(r),i=e,a=0;a<n.length;++a){if(!i||typeof i[n[a]]=="string"&&a+1<n.length)return;if(i[n[a]]===void 0){for(var o=2,s=n.slice(a,a+o).join(r),u=i[s];u===void 0&&n.length>a+o;)o++,s=n.slice(a,a+o).join(r),u=i[s];if(u===void 0)return;if(u===null)return null;if(t.endsWith(s)){if(typeof u=="string")return u;if(s&&typeof u[s]=="string")return u[s]}var f=n.slice(a+o).join(r);return f?Xa(u,f,r):void 0}i=i[n[a]]}return i}}var hu=function(e){Nr(r,e);var t=gu(r);function r(n){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return $e(this,r),i=t.call(this),$r&&ut.call(st(i)),i.data=n||{},i.options=a,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return Ie(r,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var a=this.options.ns.indexOf(i);a>-1&&this.options.ns.splice(a,1)}},{key:"getResource",value:function(i,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,f=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[i,a];o&&typeof o!="string"&&(c=c.concat(o)),o&&typeof o=="string"&&(c=c.concat(u?o.split(u):o)),i.indexOf(".")>-1&&(c=i.split("."));var l=mr(this.data,c);return l||!f||typeof o!="string"?l:Xa(this.data&&this.data[i]&&this.data[i][a],o,u)}},{key:"addResource",value:function(i,a,o,s){var u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},f=this.options.keySeparator;f===void 0&&(f=".");var c=[i,a];o&&(c=c.concat(f?o.split(f):o)),i.indexOf(".")>-1&&(c=i.split("."),s=a,a=c[1]),this.addNamespaces(a),mi(this.data,c,s),u.silent||this.emit("added",i,a,o,s)}},{key:"addResources",value:function(i,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var u in o)(typeof o[u]=="string"||Object.prototype.toString.apply(o[u])==="[object Array]")&&this.addResource(i,a,u,o[u],{silent:!0});s.silent||this.emit("added",i,a,o)}},{key:"addResourceBundle",value:function(i,a,o,s,u){var f=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[i,a];i.indexOf(".")>-1&&(c=i.split("."),s=o,o=a,a=c[1]),this.addNamespaces(a);var l=mr(this.data,c)||{};s?Za(l,o,u):l=ar(ar({},l),o),mi(this.data,c,l),f.silent||this.emit("added",i,a,o)}},{key:"removeResourceBundle",value:function(i,a){this.hasResourceBundle(i,a)&&delete this.data[i][a],this.removeNamespaces(a),this.emit("removed",i,a)}},{key:"hasResourceBundle",value:function(i,a){return this.getResource(i,a)!==void 0}},{key:"getResourceBundle",value:function(i,a){return a||(a=this.options.defaultNS),this.options.compatibilityAPI==="v1"?ar(ar({},{}),this.getResource(i,a)):this.getResource(i,a)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var a=this.getDataByLanguage(i),o=a&&Object.keys(a)||[];return!!o.find(function(s){return a[s]&&Object.keys(a[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),r}(ut),eo={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,r,n,i,a){var o=this;return t.forEach(function(s){o.processors[s]&&(r=o.processors[s].process(r,n,i,a))}),r}};function bi(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 ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bi(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mu(e){var t=vu();return function(){var n=We(e),i;if(t){var a=We(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Xt(this,i)}}function vu(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Si={},Oi=function(e){Nr(r,e);var t=mu(r);function r(n){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return $e(this,r),i=t.call(this),$r&&ut.call(st(i)),su(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,st(i)),i.options=a,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Ue.create("translator"),i}return Ie(r,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var o=this.resolve(i,a);return o&&o.res!==void 0}},{key:"extractFromKey",value:function(i,a){var o=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");var s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=a.ns||this.options.defaultNS||[],f=o&&i.indexOf(o)>-1,c=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!du(i,o,s);if(f&&!c){var l=i.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:i,namespaces:u};var d=i.split(o);(o!==s||o===s&&this.options.ns.indexOf(d[0])>-1)&&(u=d.shift()),i=d.join(s)}return typeof u=="string"&&(u=[u]),{key:i,namespaces:u}}},{key:"translate",value:function(i,a,o){var s=this;if(De(a)!=="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),a||(a={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var u=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,f=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=this.extractFromKey(i[i.length-1],a),l=c.key,d=c.namespaces,g=d[d.length-1],p=a.lng||this.language,y=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(y){var v=a.nsSeparator||this.options.nsSeparator;return u?(b.res="".concat(g).concat(v).concat(l),b):"".concat(g).concat(v).concat(l)}return u?(b.res=l,b):l}var b=this.resolve(i,a),h=b&&b.res,E=b&&b.usedKey||l,C=b&&b.exactUsedKey||l,w=Object.prototype.toString.apply(h),P=["[object Number]","[object Function]","[object RegExp]"],_=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,F=typeof h!="string"&&typeof h!="boolean"&&typeof h!="number";if(L&&h&&F&&P.indexOf(w)<0&&!(typeof _=="string"&&w==="[object Array]")){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var k=this.options.returnedObjectHandler?this.options.returnedObjectHandler(E,h,ye(ye({},a),{},{ns:d})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return u?(b.res=k,b):k}if(f){var W=w==="[object Array]",D=W?[]:{},j=W?C:E;for(var V in h)if(Object.prototype.hasOwnProperty.call(h,V)){var H="".concat(j).concat(f).concat(V);D[V]=this.translate(H,ye(ye({},a),{joinArrays:!1,ns:d})),D[V]===H&&(D[V]=h[V])}h=D}}else if(L&&typeof _=="string"&&w==="[object Array]")h=h.join(_),h&&(h=this.extendTranslation(h,i,a,o));else{var Q=!1,G=!1,ge=a.count!==void 0&&typeof a.count!="string",ee=r.hasDefaultValue(a),le=ge?this.pluralResolver.getSuffix(p,a.count,a):"",ae=a["defaultValue".concat(le)]||a.defaultValue;!this.isValidLookup(h)&&ee&&(Q=!0,h=ae),this.isValidLookup(h)||(G=!0,h=l);var ce=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,pe=ce&&G?void 0:h,K=ee&&ae!==h&&this.options.updateMissing;if(G||Q||K){if(this.logger.log(K?"updateKey":"missingKey",p,g,l,K?ae:h),f){var he=this.resolve(l,ye(ye({},a),{},{keySeparator:!1}));he&&he.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var ie=[],Ee=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Ee&&Ee[0])for(var Ce=0;Ce<Ee.length;Ce++)ie.push(Ee[Ce]);else this.options.saveMissingTo==="all"?ie=this.languageUtils.toResolveHierarchy(a.lng||this.language):ie.push(a.lng||this.language);var Re=function(U,oe,re){var Se=ee&&re!==h?re:pe;s.options.missingKeyHandler?s.options.missingKeyHandler(U,g,oe,Se,K,a):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(U,g,oe,Se,K,a),s.emit("missingKey",U,g,oe,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&ge?ie.forEach(function(ke){s.pluralResolver.getSuffixes(ke,a).forEach(function(U){Re([ke],l+U,a["defaultValue".concat(U)]||ae)})}):Re(ie,l,ae))}h=this.extendTranslation(h,i,a,b,o),G&&h===l&&this.options.appendNamespaceToMissingKey&&(h="".concat(g,":").concat(l)),(G||Q)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(g,":").concat(l):l,Q?h:void 0):h=this.options.parseMissingKeyHandler(h))}return u?(b.res=h,b):h}},{key:"extendTranslation",value:function(i,a,o,s,u){var f=this;if(this.i18nFormat&&this.i18nFormat.parse)i=this.i18nFormat.parse(i,ye(ye({},this.options.interpolation.defaultVariables),o),s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init(ye(ye({},o),{interpolation:ye(ye({},this.options.interpolation),o.interpolation)}));var c=typeof i=="string"&&(o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),l;if(c){var d=i.match(this.interpolator.nestingRegexp);l=d&&d.length}var g=o.replace&&typeof o.replace!="string"?o.replace:o;if(this.options.interpolation.defaultVariables&&(g=ye(ye({},this.options.interpolation.defaultVariables),g)),i=this.interpolator.interpolate(i,g,o.lng||this.language,o),c){var p=i.match(this.interpolator.nestingRegexp),y=p&&p.length;l<y&&(o.nest=!1)}o.nest!==!1&&(i=this.interpolator.nest(i,function(){for(var h=arguments.length,E=new Array(h),C=0;C<h;C++)E[C]=arguments[C];return u&&u[0]===E[0]&&!o.context?(f.logger.warn("It seems you are nesting recursively key: ".concat(E[0]," in key: ").concat(a[0])),null):f.translate.apply(f,E.concat([a]))},o)),o.interpolation&&this.interpolator.reset()}var v=o.postProcess||this.options.postProcess,b=typeof v=="string"?[v]:v;return i!=null&&b&&b.length&&o.applyPostProcessor!==!1&&(i=eo.handle(b,i,a,this.options&&this.options.postProcessPassResolved?ye({i18nResolved:s},o):o,this)),i}},{key:"resolve",value:function(i){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,u,f,c,l;return typeof i=="string"&&(i=[i]),i.forEach(function(d){if(!a.isValidLookup(s)){var g=a.extractFromKey(d,o),p=g.key;u=p;var y=g.namespaces;a.options.fallbackNS&&(y=y.concat(a.options.fallbackNS));var v=o.count!==void 0&&typeof o.count!="string",b=v&&!o.ordinal&&o.count===0&&a.pluralResolver.shouldUseIntlApi(),h=o.context!==void 0&&(typeof o.context=="string"||typeof o.context=="number")&&o.context!=="",E=o.lngs?o.lngs:a.languageUtils.toResolveHierarchy(o.lng||a.language,o.fallbackLng);y.forEach(function(C){a.isValidLookup(s)||(l=C,!Si["".concat(E[0],"-").concat(C)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(l)&&(Si["".concat(E[0],"-").concat(C)]=!0,a.logger.warn('key "'.concat(u,'" for languages "').concat(E.join(", "),`" won't get resolved as namespace "`).concat(l,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach(function(w){if(!a.isValidLookup(s)){c=w;var P=[p];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(P,p,w,C,o);else{var _;v&&(_=a.pluralResolver.getSuffix(w,o.count,o));var L="".concat(a.options.pluralSeparator,"zero");if(v&&(P.push(p+_),b&&P.push(p+L)),h){var F="".concat(p).concat(a.options.contextSeparator).concat(o.context);P.push(F),v&&(P.push(F+_),b&&P.push(F+L))}}for(var k;k=P.pop();)a.isValidLookup(s)||(f=k,s=a.getResource(w,C,k,o))}}))})}}),{res:s,usedKey:u,exactUsedKey:f,usedLng:c,usedNS:l}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,a,o,s):this.resourceStore.getResource(i,a,o,s)}}],[{key:"hasDefaultValue",value:function(i){var a="defaultValue";for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o)&&a===o.substring(0,a.length)&&i[o]!==void 0)return!0;return!1}}]),r}(ut);function zr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var yu=function(){function e(t){$e(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ue.create("languageUtils")}return Ie(e,[{key:"getScriptPartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return null;var n=r.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return r;var n=r.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(r){if(typeof r=="string"&&r.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],i=r.split("-");return this.options.lowerCaseLng?i=i.map(function(a){return a.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=zr(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=zr(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=zr(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?r.toLowerCase():r}},{key:"isSupportedCode",value:function(r){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(r=this.getLanguagePartFromCode(r)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(r)>-1}},{key:"getBestMatchFromCodes",value:function(r){var n=this;if(!r)return null;var i;return r.forEach(function(a){if(!i){var o=n.formatLanguageCode(a);(!n.options.supportedLngs||n.isSupportedCode(o))&&(i=o)}}),!i&&this.options.supportedLngs&&r.forEach(function(a){if(!i){var o=n.getLanguagePartFromCode(a);if(n.isSupportedCode(o))return i=o;i=n.options.supportedLngs.find(function(s){if(s.indexOf(o)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(r,n){if(!r)return[];if(typeof r=="function"&&(r=r(n)),typeof r=="string"&&(r=[r]),Object.prototype.toString.apply(r)==="[object Array]")return r;if(!n)return r.default||[];var i=r[n];return i||(i=r[this.getScriptPartFromCode(n)]),i||(i=r[this.formatLanguageCode(n)]),i||(i=r[this.getLanguagePartFromCode(n)]),i||(i=r.default),i||[]}},{key:"toResolveHierarchy",value:function(r,n){var i=this,a=this.getFallbackCodes(n||this.options.fallbackLng||[],r),o=[],s=function(f){!f||(i.isSupportedCode(f)?o.push(f):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(f)))};return typeof r=="string"&&r.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(r)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(r)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(r))):typeof r=="string"&&s(this.formatLanguageCode(r)),a.forEach(function(u){o.indexOf(u)<0&&s(i.formatLanguageCode(u))}),o}}]),e}(),bu=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Su={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},Ou=["v1","v2","v3"],wi={zero:0,one:1,two:2,few:3,many:4,other:5};function wu(){var e={};return bu.forEach(function(t){t.lngs.forEach(function(r){e[r]={numbers:t.nr,plurals:Su[t.fc]}})}),e}var Eu=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$e(this,e),this.languageUtils=t,this.options=r,this.logger=Ue.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=wu()}return Ie(e,[{key:"addRule",value:function(r,n){this.rules[r]=n}},{key:"getRule",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(r,{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[r]||this.rules[this.languageUtils.getLanguagePartFromCode(r)]}},{key:"needsPlural",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(r,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(r,i).map(function(a){return"".concat(n).concat(a)})}},{key:"getSuffixes",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.getRule(r,i);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort(function(o,s){return wi[o]-wi[s]}).map(function(o){return"".concat(n.options.prepend).concat(o)}):a.numbers.map(function(o){return n.getSuffix(r,o,i)}):[]}},{key:"getSuffix",value:function(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=this.getRule(r,i);return a?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(a.select(n)):this.getSuffixRetroCompatible(a,n):(this.logger.warn("no plural rule found for: ".concat(r)),"")}},{key:"getSuffixRetroCompatible",value:function(r,n){var i=this,a=r.noAbs?r.plurals(n):r.plurals(Math.abs(n)),o=r.numbers[a];this.options.simplifyPluralSuffix&&r.numbers.length===2&&r.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));var s=function(){return i.options.prepend&&o.toString()?i.options.prepend+o.toString():o.toString()};return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?"_plural_".concat(o.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&r.numbers.length===2&&r.numbers[0]===1?s():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}},{key:"shouldUseIntlApi",value:function(){return!Ou.includes(this.options.compatibilityJSON)}}]),e}();function Ei(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 Fe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ei(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ei(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var xu=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$e(this,e),this.logger=Ue.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(r){return r},this.init(t)}return Ie(e,[{key:"init",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r.interpolation||(r.interpolation={escapeValue:!0});var n=r.interpolation;this.escape=n.escape!==void 0?n.escape:cu,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?xt(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?xt(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?xt(n.nestingPrefix):n.nestingPrefixEscaped||xt("$t("),this.nestingSuffix=n.nestingSuffix?xt(n.nestingSuffix):n.nestingSuffixEscaped||xt(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var r="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(r,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(n,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(r,n,i,a){var o=this,s,u,f,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(v){return v.replace(/\$/g,"$$$$")}var d=function(b){if(b.indexOf(o.formatSeparator)<0){var h=vi(n,c,b);return o.alwaysFormat?o.format(h,void 0,i,Fe(Fe(Fe({},a),n),{},{interpolationkey:b})):h}var E=b.split(o.formatSeparator),C=E.shift().trim(),w=E.join(o.formatSeparator).trim();return o.format(vi(n,c,C),w,i,Fe(Fe(Fe({},a),n),{},{interpolationkey:C}))};this.resetRegExp();var g=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,p=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,y=[{regex:this.regexpUnescape,safeValue:function(b){return l(b)}},{regex:this.regexp,safeValue:function(b){return o.escapeValue?l(o.escape(b)):l(b)}}];return y.forEach(function(v){for(f=0;s=v.regex.exec(r);){var b=s[1].trim();if(u=d(b),u===void 0)if(typeof g=="function"){var h=g(r,s,a);u=typeof h=="string"?h:""}else if(a&&a.hasOwnProperty(b))u="";else if(p){u=s[0];continue}else o.logger.warn("missed to pass in variable ".concat(b," for interpolating ").concat(r)),u="";else typeof u!="string"&&!o.useRawValueToEscape&&(u=hi(u));var E=v.safeValue(u);if(r=r.replace(s[0],E),p?(v.regex.lastIndex+=u.length,v.regex.lastIndex-=s[0].length):v.regex.lastIndex=0,f++,f>=o.maxReplaces)break}}),r}},{key:"nest",value:function(r,n){var i=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,u=Fe({},a);u.applyPostProcessor=!1,delete u.defaultValue;function f(g,p){var y=this.nestingOptionsSeparator;if(g.indexOf(y)<0)return g;var v=g.split(new RegExp("".concat(y,"[ ]*{"))),b="{".concat(v[1]);g=v[0],b=this.interpolate(b,u);var h=b.match(/'/g),E=b.match(/"/g);(h&&h.length%2===0&&!E||E.length%2!==0)&&(b=b.replace(/'/g,'"'));try{u=JSON.parse(b),p&&(u=Fe(Fe({},p),u))}catch(C){return this.logger.warn("failed parsing options string in nesting for key ".concat(g),C),"".concat(g).concat(y).concat(b)}return delete u.defaultValue,g}for(;o=this.nestingRegexp.exec(r);){var c=[],l=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){var d=o[1].split(this.formatSeparator).map(function(g){return g.trim()});o[1]=d.shift(),c=d,l=!0}if(s=n(f.call(this,o[1].trim(),u),u),s&&o[0]===r&&typeof s!="string")return s;typeof s!="string"&&(s=hi(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(r)),s=""),l&&(s=c.reduce(function(g,p){return i.format(g,p,a.lng,Fe(Fe({},a),{},{interpolationkey:o[1].trim()}))},s.trim())),r=r.replace(o[0],s),this.regexp.lastIndex=0}return r}}]),e}();function xi(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 et(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xi(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pu(e){var t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){var n=e.split("(");t=n[0].toLowerCase().trim();var i=n[1].substring(0,n[1].length-1);if(t==="currency"&&i.indexOf(":")<0)r.currency||(r.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)r.range||(r.range=i.trim());else{var a=i.split(";");a.forEach(function(o){if(!!o){var s=o.split(":"),u=iu(s),f=u[0],c=u.slice(1),l=c.join(":").trim().replace(/^'+|'+$/g,"");r[f.trim()]||(r[f.trim()]=l),l==="false"&&(r[f.trim()]=!1),l==="true"&&(r[f.trim()]=!0),isNaN(l)||(r[f.trim()]=parseInt(l,10))}})}}return{formatName:t,formatOptions:r}}function Pt(e){var t={};return function(n,i,a){var o=i+JSON.stringify(a),s=t[o];return s||(s=e(i,a),t[o]=s),s(n)}}var Au=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$e(this,e),this.logger=Ue.create("formatter"),this.options=t,this.formats={number:Pt(function(r,n){var i=new Intl.NumberFormat(r,n);return function(a){return i.format(a)}}),currency:Pt(function(r,n){var i=new Intl.NumberFormat(r,et(et({},n),{},{style:"currency"}));return function(a){return i.format(a)}}),datetime:Pt(function(r,n){var i=new Intl.DateTimeFormat(r,et({},n));return function(a){return i.format(a)}}),relativetime:Pt(function(r,n){var i=new Intl.RelativeTimeFormat(r,et({},n));return function(a){return i.format(a,n.range||"day")}}),list:Pt(function(r,n){var i=new Intl.ListFormat(r,et({},n));return function(a){return i.format(a)}})},this.init(t)}return Ie(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=n.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(r,n){this.formats[r.toLowerCase().trim()]=n}},{key:"addCached",value:function(r,n){this.formats[r.toLowerCase().trim()]=Pt(n)}},{key:"format",value:function(r,n,i,a){var o=this,s=n.split(this.formatSeparator),u=s.reduce(function(f,c){var l=Pu(c),d=l.formatName,g=l.formatOptions;if(o.formats[d]){var p=f;try{var y=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},v=y.locale||y.lng||a.locale||a.lng||i;p=o.formats[d](f,v,et(et(et({},g),a),y))}catch(b){o.logger.warn(b)}return p}else o.logger.warn("there was no format function for ".concat(d));return f},r);return u}}]),e}();function Pi(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 Ai(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pi(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cu(e){var t=_u();return function(){var n=We(e),i;if(t){var a=We(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Xt(this,i)}}function _u(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Tu(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var Nu=function(e){Nr(r,e);var t=Cu(r);function r(n,i,a){var o,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return $e(this,r),o=t.call(this),$r&&ut.call(st(o)),o.backend=n,o.store=i,o.services=a,o.languageUtils=a.languageUtils,o.options=s,o.logger=Ue.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=s.maxParallelReads||10,o.readingCalls=0,o.maxRetries=s.maxRetries>=0?s.maxRetries:5,o.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(a,s.backend,s),o}return Ie(r,[{key:"queueLoad",value:function(i,a,o,s){var u=this,f={},c={},l={},d={};return i.forEach(function(g){var p=!0;a.forEach(function(y){var v="".concat(g,"|").concat(y);!o.reload&&u.store.hasResourceBundle(g,y)?u.state[v]=2:u.state[v]<0||(u.state[v]===1?c[v]===void 0&&(c[v]=!0):(u.state[v]=1,p=!1,c[v]===void 0&&(c[v]=!0),f[v]===void 0&&(f[v]=!0),d[y]===void 0&&(d[y]=!0)))}),p||(l[g]=!0)}),(Object.keys(f).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(f),pending:Object.keys(c),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(d)}}},{key:"loaded",value:function(i,a,o){var s=i.split("|"),u=s[0],f=s[1];a&&this.emit("failedLoading",u,f,a),o&&this.store.addResourceBundle(u,f,o),this.state[i]=a?-1:2;var c={};this.queue.forEach(function(l){uu(l.loaded,[u],f),Tu(l,i),a&&l.errors.push(a),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(function(d){c[d]||(c[d]={});var g=l.loaded[d];g.length&&g.forEach(function(p){c[d][p]===void 0&&(c[d][p]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(l){return!l.done})}},{key:"read",value:function(i,a,o){var s=this,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!i.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:a,fcName:o,tried:u,wait:f,callback:c});return}return this.readingCalls++,this.backend[o](i,a,function(l,d){if(s.readingCalls--,s.waitingReads.length>0){var g=s.waitingReads.shift();s.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(l&&d&&u<s.maxRetries){setTimeout(function(){s.read.call(s,i,a,o,u+1,f*2,c)},f);return}c(l,d)})}},{key:"prepareLoading",value:function(i,a){var o=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),u&&u();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof a=="string"&&(a=[a]);var f=this.queueLoad(i,a,s,u);if(!f.toLoad.length)return f.pending.length||u(),null;f.toLoad.forEach(function(c){o.loadOne(c)})}},{key:"load",value:function(i,a,o){this.prepareLoading(i,a,{},o)}},{key:"reload",value:function(i,a,o){this.prepareLoading(i,a,{reload:!0},o)}},{key:"loadOne",value:function(i){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),u=s[0],f=s[1];this.read(u,f,"read",void 0,void 0,function(c,l){c&&a.logger.warn("".concat(o,"loading namespace ").concat(f," for language ").concat(u," failed"),c),!c&&l&&a.logger.log("".concat(o,"loaded namespace ").concat(f," for language ").concat(u),l),a.loaded(i,c,l)})}},{key:"saveMissing",value:function(i,a,o,s,u){var f=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(a)){this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}o==null||o===""||(this.backend&&this.backend.create&&this.backend.create(i,a,o,s,null,Ai(Ai({},f),{},{isUpdate:u})),!(!i||!i[0])&&this.store.addResource(i[0],a,o,s))}}]),r}(ut);function $u(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var r={};if(De(t[1])==="object"&&(r=t[1]),typeof t[1]=="string"&&(r.defaultValue=t[1]),typeof t[2]=="string"&&(r.tDescription=t[2]),De(t[2])==="object"||De(t[3])==="object"){var n=t[3]||t[2];Object.keys(n).forEach(function(i){r[i]=n[i]})}return r},interpolation:{escapeValue:!0,format:function(t,r,n,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Ci(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function _i(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 je(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_i(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_i(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Iu(e){var t=Lu();return function(){var n=We(e),i;if(t){var a=We(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Xt(this,i)}}function Lu(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function or(){}function Ru(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(r){typeof e[r]=="function"&&(e[r]=e[r].bind(e))})}var vr=function(e){Nr(r,e);var t=Iu(r);function r(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if($e(this,r),n=t.call(this),$r&&ut.call(st(n)),n.options=Ci(i),n.services={},n.logger=Ue,n.modules={external:[]},Ru(st(n)),a&&!n.isInitialized&&!i.isClone){if(!n.options.initImmediate)return n.init(i,a),Xt(n,st(n));setTimeout(function(){n.init(i,a)},0)}return n}return Ie(r,[{key:"init",value:function(){var i=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;typeof a=="function"&&(o=a,a={}),!a.defaultNS&&a.defaultNS!==!1&&a.ns&&(typeof a.ns=="string"?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));var s=$u();this.options=je(je(je({},s),this.options),Ci(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=je(je({},s.interpolation),this.options.interpolation)),a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator);function u(b){return b?typeof b=="function"?new b:b:null}if(!this.options.isClone){this.modules.logger?Ue.init(u(this.modules.logger),this.options):Ue.init(null,this.options);var f;this.modules.formatter?f=this.modules.formatter:typeof Intl!="undefined"&&(f=Au);var c=new yu(this.options);this.store=new hu(this.options.resources,this.options);var l=this.services;l.logger=Ue,l.resourceStore=this.store,l.languageUtils=c,l.pluralResolver=new Eu(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),f&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(l.formatter=u(f),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new xu(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new Nu(u(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(b){for(var h=arguments.length,E=new Array(h>1?h-1:0),C=1;C<h;C++)E[C-1]=arguments[C];i.emit.apply(i,[b].concat(E))}),this.modules.languageDetector&&(l.languageDetector=u(this.modules.languageDetector),l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=u(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new Oi(this.services,this.options),this.translator.on("*",function(b){for(var h=arguments.length,E=new Array(h>1?h-1:0),C=1;C<h;C++)E[C-1]=arguments[C];i.emit.apply(i,[b].concat(E))}),this.modules.external.forEach(function(b){b.init&&b.init(i)})}if(this.format=this.options.interpolation.format,o||(o=or),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var g=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];g.forEach(function(b){i[b]=function(){var h;return(h=i.store)[b].apply(h,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(b){i[b]=function(){var h;return(h=i.store)[b].apply(h,arguments),i}});var y=Ft(),v=function(){var h=function(C,w){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),y.resolve(w),o(C,w)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return h(null,i.t.bind(i));i.changeLanguage(i.options.lng,h)};return this.options.resources||!this.options.initImmediate?v():setTimeout(v,0),y}},{key:"loadResources",value:function(i){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:or,s=o,u=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(u&&u.toLowerCase()==="cimode")return s();var f=[],c=function(g){if(!!g){var p=a.services.languageUtils.toResolveHierarchy(g);p.forEach(function(y){f.indexOf(y)<0&&f.push(y)})}};if(u)c(u);else{var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.forEach(function(d){return c(d)})}this.options.preload&&this.options.preload.forEach(function(d){return c(d)}),this.services.backendConnector.load(f,this.options.ns,function(d){!d&&!a.resolvedLanguage&&a.language&&a.setResolvedLanguage(a.language),s(d)})}else s(null)}},{key:"reloadResources",value:function(i,a,o){var s=Ft();return i||(i=this.languages),a||(a=this.options.ns),o||(o=or),this.services.backendConnector.reload(i,a,function(u){s.resolve(),o(u)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&eo.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var a=0;a<this.languages.length;a++){var o=this.languages[a];if(!(["cimode","dev"].indexOf(o)>-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}}},{key:"changeLanguage",value:function(i,a){var o=this;this.isLanguageChangingTo=i;var s=Ft();this.emit("languageChanging",i);var u=function(d){o.language=d,o.languages=o.services.languageUtils.toResolveHierarchy(d),o.resolvedLanguage=void 0,o.setResolvedLanguage(d)},f=function(d,g){g?(u(g),o.translator.changeLanguage(g),o.isLanguageChangingTo=void 0,o.emit("languageChanged",g),o.logger.log("languageChanged",g)):o.isLanguageChangingTo=void 0,s.resolve(function(){return o.t.apply(o,arguments)}),a&&a(d,function(){return o.t.apply(o,arguments)})},c=function(d){!i&&!d&&o.services.languageDetector&&(d=[]);var g=typeof d=="string"?d:o.services.languageUtils.getBestMatchFromCodes(d);g&&(o.language||u(g),o.translator.language||o.translator.changeLanguage(g),o.services.languageDetector&&o.services.languageDetector.cacheUserLanguage(g)),o.loadResources(g,function(p){f(p,g)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(c):c(i),s}},{key:"getFixedT",value:function(i,a,o){var s=this,u=function f(c,l){var d;if(De(l)!=="object"){for(var g=arguments.length,p=new Array(g>2?g-2:0),y=2;y<g;y++)p[y-2]=arguments[y];d=s.options.overloadTranslationOptionHandler([c,l].concat(p))}else d=je({},l);d.lng=d.lng||f.lng,d.lngs=d.lngs||f.lngs,d.ns=d.ns||f.ns,d.keyPrefix=d.keyPrefix||o||f.keyPrefix;var v=s.options.keySeparator||".",b=d.keyPrefix?"".concat(d.keyPrefix).concat(v).concat(c):c;return s.t(b,d)};return typeof i=="string"?u.lng=i:u.lngs=i,u.ns=a,u.keyPrefix=o,u}},{key:"t",value:function(){var i;return this.translator&&(i=this.translator).translate.apply(i,arguments)}},{key:"exists",value:function(){var i;return this.translator&&(i=this.translator).exists.apply(i,arguments)}},{key:"setDefaultNamespace",value:function(i){this.options.defaultNS=i}},{key:"hasLoadedNamespace",value:function(i){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],u=this.options?this.options.fallbackLng:!1,f=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var c=function(g,p){var y=a.services.backendConnector.state["".concat(g,"|").concat(p)];return y===-1||y===2};if(o.precheck){var l=o.precheck(this,c);if(l!==void 0)return l}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(s,i)&&(!u||c(f,i)))}},{key:"loadNamespaces",value:function(i,a){var o=this,s=Ft();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(u){o.options.ns.indexOf(u)<0&&o.options.ns.push(u)}),this.loadResources(function(u){s.resolve(),a&&a(u)}),s):(a&&a(),Promise.resolve())}},{key:"loadLanguages",value:function(i,a){var o=Ft();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],u=i.filter(function(f){return s.indexOf(f)<0});return u.length?(this.options.preload=s.concat(u),this.loadResources(function(f){o.resolve(),a&&a(f)}),o):(a&&a(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return a.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:or,s=je(je(je({},this.options),a),{isClone:!0}),u=new r(s);(a.debug!==void 0||a.prefix!==void 0)&&(u.logger=u.logger.clone(a));var f=["store","services","language"];return f.forEach(function(c){u[c]=i[c]}),u.services=je({},this.services),u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u.translator=new Oi(u.services,u.options),u.translator.on("*",function(c){for(var l=arguments.length,d=new Array(l>1?l-1:0),g=1;g<l;g++)d[g-1]=arguments[g];u.emit.apply(u,[c].concat(d))}),u.init(s,o),u.translator.options=u.options,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(ut);Ke(vr,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new vr(e,t)});var ve=vr.createInstance();ve.createInstance=vr.createInstance;ve.createInstance;ve.init;ve.loadResources;ve.reloadResources;ve.use;ve.changeLanguage;ve.getFixedT;ve.t;ve.exists;ve.setDefaultNamespace;ve.hasLoadedNamespace;ve.loadNamespaces;ve.loadLanguages;var er=e=>e.type==="checkbox",Ct=e=>e instanceof Date,be=e=>e==null;const to=e=>typeof e=="object";var de=e=>!be(e)&&!Array.isArray(e)&&to(e)&&!Ct(e),ro=e=>de(e)&&e.target?er(e.target)?e.target.checked:e.target.value:e,Fu=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,no=(e,t)=>e.has(Fu(t)),Du=e=>{const t=e.constructor&&e.constructor.prototype;return de(t)&&t.hasOwnProperty("isPrototypeOf")},jn=typeof window!="undefined"&&typeof window.HTMLElement!="undefined"&&typeof document!="undefined";function fe(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(jn&&(e instanceof Blob||e instanceof FileList))&&(r||de(e)))if(t=r?[]:{},!r&&!Du(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=fe(e[n]));else return e;return t}var tr=e=>Array.isArray(e)?e.filter(Boolean):[],J=e=>e===void 0,$=(e,t,r)=>{if(!t||!de(e))return r;const n=tr(t.split(/[,[\].]+?/)).reduce((i,a)=>be(i)?i:i[a],e);return J(n)||n===e?J(e[t])?r:e[t]:n},Ve=e=>typeof e=="boolean",Vn=e=>/^\w*$/.test(e),io=e=>tr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),z=(e,t,r)=>{let n=-1;const i=Vn(t)?[t]:io(t),a=i.length,o=a-1;for(;++n<a;){const s=i[n];let u=r;if(n!==o){const f=e[s];u=de(f)||Array.isArray(f)?f:isNaN(+i[n+1])?{}:[]}if(s==="__proto__")return;e[s]=u,e=e[s]}return e};const yr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},_e={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Qe={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ao=T.default.createContext(null),Ye=()=>T.default.useContext(ao),oo=e=>{const{children:t,...r}=e;return T.default.createElement(ao.Provider,{value:r},t)};var so=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==_e.all&&(t._proxyFormState[o]=!n||_e.all),r&&(r[o]=!0),e[o]}});return i},Oe=e=>de(e)&&!Object.keys(e).length,uo=(e,t,r,n)=>{r(e);const{name:i,...a}=e;return Oe(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!n||_e.all))},we=e=>Array.isArray(e)?e:[e],lo=(e,t,r)=>!e||!t||e===t||we(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function Ir(e){const t=T.default.useRef(e);t.current=e,T.default.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function co(e){const t=Ye(),{control:r=t.control,disabled:n,name:i,exact:a}=e||{},[o,s]=T.default.useState(r._formState),u=T.default.useRef(!0),f=T.default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=T.default.useRef(i);return c.current=i,Ir({disabled:n,next:l=>u.current&&lo(c.current,l.name,a)&&uo(l,f.current,r._updateFormState)&&s({...r._formState,...l}),subject:r._subjects.state}),T.default.useEffect(()=>(u.current=!0,f.current.isValid&&r._updateValid(!0),()=>{u.current=!1}),[r]),so(o,r,f.current,!1)}var Be=e=>typeof e=="string",fo=(e,t,r,n,i)=>Be(e)?(n&&t.watch.add(e),$(r,e,i)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),$(r,a))):(n&&(t.watchAll=!0),r);function go(e){const t=Ye(),{control:r=t.control,name:n,defaultValue:i,disabled:a,exact:o}=e||{},s=T.default.useRef(n);s.current=n,Ir({disabled:a,subject:r._subjects.values,next:c=>{lo(s.current,c.name,o)&&f(fe(fo(s.current,r._names,c.values||r._formValues,!1,i)))}});const[u,f]=T.default.useState(r._getWatch(n,i));return T.default.useEffect(()=>r._removeUnmounted()),u}function po(e){const t=Ye(),{name:r,disabled:n,control:i=t.control,shouldUnregister:a}=e,o=no(i._names.array,r),s=go({control:i,name:r,defaultValue:$(i._formValues,r,$(i._defaultValues,r,e.defaultValue)),exact:!0}),u=co({control:i,name:r}),f=T.default.useRef(i.register(r,{...e.rules,value:s,...Ve(e.disabled)?{disabled:e.disabled}:{}}));return T.default.useEffect(()=>{const c=i._options.shouldUnregister||a,l=(d,g)=>{const p=$(i._fields,d);p&&p._f&&(p._f.mount=g)};if(l(r,!0),c){const d=fe($(i._options.defaultValues,r));z(i._defaultValues,r,d),J($(i._formValues,r))&&z(i._formValues,r,d)}return()=>{(o?c&&!i._state.action:c)?i.unregister(r):l(r,!1)}},[r,i,o,a]),T.default.useEffect(()=>{$(i._fields,r)&&i._updateDisabledField({disabled:n,fields:i._fields,name:r,value:$(i._fields,r)._f.value})},[n,r,i]),{field:{name:r,value:s,...Ve(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:T.default.useCallback(c=>f.current.onChange({target:{value:ro(c),name:r},type:yr.CHANGE}),[r]),onBlur:T.default.useCallback(()=>f.current.onBlur({target:{value:$(i._formValues,r),name:r},type:yr.BLUR}),[r,i]),ref:c=>{const l=$(i._fields,r);l&&c&&(l._f.ref={focus:()=>c.focus(),select:()=>c.select(),setCustomValidity:d=>c.setCustomValidity(d),reportValidity:()=>c.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!$(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!$(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!$(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!$(u.validatingFields,r)},error:{enumerable:!0,get:()=>$(u.errors,r)}})}}const Mu=e=>e.render(po(e)),ku="post";function ju(e){const t=Ye(),[r,n]=T.default.useState(!1),{control:i=t.control,onSubmit:a,children:o,action:s,method:u=ku,headers:f,encType:c,onError:l,render:d,onSuccess:g,validateStatus:p,...y}=e,v=async b=>{let h=!1,E="";await i.handleSubmit(async C=>{const w=new FormData;let P="";try{P=JSON.stringify(C)}catch{}for(const _ of i._names.mount)w.append(_,$(C,_));if(a&&await a({data:C,event:b,method:u,formData:w,formDataJson:P}),s)try{const _=[f&&f["Content-Type"],c].some(F=>F&&F.includes("json")),L=await fetch(s,{method:u,headers:{...f,...c?{"Content-Type":c}:{}},body:_?P:w});L&&(p?!p(L.status):L.status<200||L.status>=300)?(h=!0,l&&l({response:L}),E=String(L.status)):g&&g({response:L})}catch(_){h=!0,l&&l({error:_})}})(b),h&&e.control&&(e.control._subjects.state.next({isSubmitSuccessful:!1}),e.control.setError("root.server",{type:E}))};return T.default.useEffect(()=>{n(!0)},[]),d?T.default.createElement(T.default.Fragment,null,d({submit:v})):T.default.createElement("form",{noValidate:r,action:s,method:u,encType:c,onSubmit:v,...y},o)}var ho=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},tt=()=>{const e=typeof performance=="undefined"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},Qr=(e,t,r={})=>r.shouldFocus||J(r.shouldFocus)?r.focusName||`${e}.${J(r.focusIndex)?t:r.focusIndex}.`:"",Kt=e=>({isOnSubmit:!e||e===_e.onSubmit,isOnBlur:e===_e.onBlur,isOnChange:e===_e.onChange,isOnAll:e===_e.all,isOnTouch:e===_e.onTouched}),Sn=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const _t=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const a=$(e,i);if(a){const{_f:o,...s}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!n)break;if(o.ref&&t(o.ref,o.name)&&!n)break;_t(s,t)}else de(s)&&_t(s,t)}}};var mo=(e,t,r)=>{const n=we($(e,r));return z(n,"root",t[r]),z(e,r,n),e},Un=e=>e.type==="file",it=e=>typeof e=="function",br=e=>{if(!jn)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},dr=e=>Be(e),Bn=e=>e.type==="radio",Sr=e=>e instanceof RegExp;const Ti={value:!1,isValid:!1},Ni={value:!0,isValid:!0};var vo=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!J(e[0].attributes.value)?J(e[0].value)||e[0].value===""?Ni:{value:e[0].value,isValid:!0}:Ni:Ti}return Ti};const $i={isValid:!1,value:null};var yo=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,$i):$i;function Ii(e,t,r="validate"){if(dr(e)||Array.isArray(e)&&e.every(dr)||Ve(e)&&!e)return{type:r,message:dr(e)?e:"",ref:t}}var At=e=>de(e)&&!Sr(e)?e:{value:e,message:""},On=async(e,t,r,n,i)=>{const{ref:a,refs:o,required:s,maxLength:u,minLength:f,min:c,max:l,pattern:d,validate:g,name:p,valueAsNumber:y,mount:v,disabled:b}=e._f,h=$(t,p);if(!v||b)return{};const E=o?o[0]:a,C=D=>{n&&E.reportValidity&&(E.setCustomValidity(Ve(D)?"":D||""),E.reportValidity())},w={},P=Bn(a),_=er(a),L=P||_,F=(y||Un(a))&&J(a.value)&&J(h)||br(a)&&a.value===""||h===""||Array.isArray(h)&&!h.length,k=ho.bind(null,p,r,w),W=(D,j,V,H=Qe.maxLength,Q=Qe.minLength)=>{const G=D?j:V;w[p]={type:D?H:Q,message:G,ref:a,...k(D?H:Q,G)}};if(i?!Array.isArray(h)||!h.length:s&&(!L&&(F||be(h))||Ve(h)&&!h||_&&!vo(o).isValid||P&&!yo(o).isValid)){const{value:D,message:j}=dr(s)?{value:!!s,message:s}:At(s);if(D&&(w[p]={type:Qe.required,message:j,ref:E,...k(Qe.required,j)},!r))return C(j),w}if(!F&&(!be(c)||!be(l))){let D,j;const V=At(l),H=At(c);if(!be(h)&&!isNaN(h)){const Q=a.valueAsNumber||h&&+h;be(V.value)||(D=Q>V.value),be(H.value)||(j=Q<H.value)}else{const Q=a.valueAsDate||new Date(h),G=le=>new Date(new Date().toDateString()+" "+le),ge=a.type=="time",ee=a.type=="week";Be(V.value)&&h&&(D=ge?G(h)>G(V.value):ee?h>V.value:Q>new Date(V.value)),Be(H.value)&&h&&(j=ge?G(h)<G(H.value):ee?h<H.value:Q<new Date(H.value))}if((D||j)&&(W(!!D,V.message,H.message,Qe.max,Qe.min),!r))return C(w[p].message),w}if((u||f)&&!F&&(Be(h)||i&&Array.isArray(h))){const D=At(u),j=At(f),V=!be(D.value)&&h.length>+D.value,H=!be(j.value)&&h.length<+j.value;if((V||H)&&(W(V,D.message,j.message),!r))return C(w[p].message),w}if(d&&!F&&Be(h)){const{value:D,message:j}=At(d);if(Sr(D)&&!h.match(D)&&(w[p]={type:Qe.pattern,message:j,ref:a,...k(Qe.pattern,j)},!r))return C(j),w}if(g){if(it(g)){const D=await g(h,t),j=Ii(D,E);if(j&&(w[p]={...j,...k(Qe.validate,j.message)},!r))return C(j.message),w}else if(de(g)){let D={};for(const j in g){if(!Oe(D)&&!r)break;const V=Ii(await g[j](h,t),E,j);V&&(D={...V,...k(j,V.message)},C(V.message),r&&(w[p]=D))}if(!Oe(D)&&(w[p]={ref:E,...D},!r))return w}}return C(!0),w},qr=(e,t)=>[...e,...we(t)],Jr=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Zr(e,t,r){return[...e.slice(0,t),...we(r),...e.slice(t)]}var Xr=(e,t,r)=>Array.isArray(e)?(J(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],en=(e,t)=>[...we(t),...we(e)];function Vu(e,t){let r=0;const n=[...e];for(const i of t)n.splice(i-r,1),r++;return tr(n).length?n:[]}var tn=(e,t)=>J(t)?[]:Vu(e,we(t).sort((r,n)=>r-n)),rn=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]};function Uu(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=J(e)?n++:e[t[n++]];return e}function Bu(e){for(const t in e)if(e.hasOwnProperty(t)&&!J(e[t]))return!1;return!0}function ue(e,t){const r=Array.isArray(t)?t:Vn(t)?[t]:io(t),n=r.length===1?e:Uu(e,r),i=r.length-1,a=r[i];return n&&delete n[a],i!==0&&(de(n)&&Oe(n)||Array.isArray(n)&&Bu(n))&&ue(e,r.slice(0,-1)),e}var Li=(e,t,r)=>(e[t]=r,e);function Hu(e){const t=Ye(),{control:r=t.control,name:n,keyName:i="id",shouldUnregister:a}=e,[o,s]=T.default.useState(r._getFieldArray(n)),u=T.default.useRef(r._getFieldArray(n).map(tt)),f=T.default.useRef(o),c=T.default.useRef(n),l=T.default.useRef(!1);c.current=n,f.current=o,r._names.array.add(n),e.rules&&r.register(n,e.rules),Ir({next:({values:w,name:P})=>{if(P===c.current||!P){const _=$(w,c.current);Array.isArray(_)&&(s(_),u.current=_.map(tt))}},subject:r._subjects.array});const d=T.default.useCallback(w=>{l.current=!0,r._updateFieldArray(n,w)},[r,n]),g=(w,P)=>{const _=we(fe(w)),L=qr(r._getFieldArray(n),_);r._names.focus=Qr(n,L.length-1,P),u.current=qr(u.current,_.map(tt)),d(L),s(L),r._updateFieldArray(n,L,qr,{argA:Jr(w)})},p=(w,P)=>{const _=we(fe(w)),L=en(r._getFieldArray(n),_);r._names.focus=Qr(n,0,P),u.current=en(u.current,_.map(tt)),d(L),s(L),r._updateFieldArray(n,L,en,{argA:Jr(w)})},y=w=>{const P=tn(r._getFieldArray(n),w);u.current=tn(u.current,w),d(P),s(P),r._updateFieldArray(n,P,tn,{argA:w})},v=(w,P,_)=>{const L=we(fe(P)),F=Zr(r._getFieldArray(n),w,L);r._names.focus=Qr(n,w,_),u.current=Zr(u.current,w,L.map(tt)),d(F),s(F),r._updateFieldArray(n,F,Zr,{argA:w,argB:Jr(P)})},b=(w,P)=>{const _=r._getFieldArray(n);rn(_,w,P),rn(u.current,w,P),d(_),s(_),r._updateFieldArray(n,_,rn,{argA:w,argB:P},!1)},h=(w,P)=>{const _=r._getFieldArray(n);Xr(_,w,P),Xr(u.current,w,P),d(_),s(_),r._updateFieldArray(n,_,Xr,{argA:w,argB:P},!1)},E=(w,P)=>{const _=fe(P),L=Li(r._getFieldArray(n),w,_);u.current=[...L].map((F,k)=>!F||k===w?tt():u.current[k]),d(L),s([...L]),r._updateFieldArray(n,L,Li,{argA:w,argB:_},!0,!1)},C=w=>{const P=we(fe(w));u.current=P.map(tt),d([...P]),s([...P]),r._updateFieldArray(n,[...P],_=>_,{},!0,!1)};return T.default.useEffect(()=>{if(r._state.action=!1,Sn(n,r._names)&&r._subjects.state.next({...r._formState}),l.current&&(!Kt(r._options.mode).isOnSubmit||r._formState.isSubmitted))if(r._options.resolver)r._executeSchema([n]).then(w=>{const P=$(w.errors,n),_=$(r._formState.errors,n);(_?!P&&_.type||P&&(_.type!==P.type||_.message!==P.message):P&&P.type)&&(P?z(r._formState.errors,n,P):ue(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const w=$(r._fields,n);w&&w._f&&!(Kt(r._options.reValidateMode).isOnSubmit&&Kt(r._options.mode).isOnSubmit)&&On(w,r._formValues,r._options.criteriaMode===_e.all,r._options.shouldUseNativeValidation,!0).then(P=>!Oe(P)&&r._subjects.state.next({errors:mo(r._formState.errors,P,n)}))}r._subjects.values.next({name:n,values:{...r._formValues}}),r._names.focus&&_t(r._fields,(w,P)=>{if(r._names.focus&&P.startsWith(r._names.focus)&&w.focus)return w.focus(),1}),r._names.focus="",r._updateValid(),l.current=!1},[o,n,r]),T.default.useEffect(()=>(!$(r._formValues,n)&&r._updateFieldArray(n),()=>{(r._options.shouldUnregister||a)&&r.unregister(n)}),[n,r,i,a]),{swap:T.default.useCallback(b,[d,n,r]),move:T.default.useCallback(h,[d,n,r]),prepend:T.default.useCallback(p,[d,n,r]),append:T.default.useCallback(g,[d,n,r]),remove:T.default.useCallback(y,[d,n,r]),insert:T.default.useCallback(v,[d,n,r]),update:T.default.useCallback(E,[d,n,r]),replace:T.default.useCallback(C,[d,n,r]),fields:T.default.useMemo(()=>o.map((w,P)=>({...w,[i]:u.current[P]||tt()})),[o,i])}}var nn=()=>{let e=[];return{get observers(){return e},next:i=>{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}},Or=e=>be(e)||!to(e);function gt(e,t){if(Or(e)||Or(t))return e===t;if(Ct(e)&&Ct(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r){const a=e[i];if(!n.includes(i))return!1;if(i!=="ref"){const o=t[i];if(Ct(a)&&Ct(o)||de(a)&&de(o)||Array.isArray(a)&&Array.isArray(o)?!gt(a,o):a!==o)return!1}}return!0}var bo=e=>e.type==="select-multiple",Wu=e=>Bn(e)||er(e),an=e=>br(e)&&e.isConnected,So=e=>{for(const t in e)if(it(e[t]))return!0;return!1};function wr(e,t={}){const r=Array.isArray(e);if(de(e)||r)for(const n in e)Array.isArray(e[n])||de(e[n])&&!So(e[n])?(t[n]=Array.isArray(e[n])?[]:{},wr(e[n],t[n])):be(e[n])||(t[n]=!0);return t}function Oo(e,t,r){const n=Array.isArray(e);if(de(e)||n)for(const i in e)Array.isArray(e[i])||de(e[i])&&!So(e[i])?J(t)||Or(r[i])?r[i]=Array.isArray(e[i])?wr(e[i],[]):{...wr(e[i])}:Oo(e[i],be(t)?{}:t[i],r[i]):r[i]=!gt(e[i],t[i]);return r}var sr=(e,t)=>Oo(e,t,wr(t)),wo=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>J(e)?e:t?e===""?NaN:e&&+e:r&&Be(e)?new Date(e):n?n(e):e;function on(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Un(t)?t.files:Bn(t)?yo(e.refs).value:bo(t)?[...t.selectedOptions].map(({value:r})=>r):er(t)?vo(e.refs).value:wo(J(t.value)?e.ref.value:t.value,e)}var Gu=(e,t,r,n)=>{const i={};for(const a of e){const o=$(t,a);o&&z(i,a,o._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Dt=e=>J(e)?e:Sr(e)?e.source:de(e)?Sr(e.value)?e.value.source:e.value:e,Ku=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Ri(e,t,r){const n=$(e,r);if(n||Vn(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const a=i.join("."),o=$(t,a),s=$(e,a);if(o&&!Array.isArray(o)&&r!==a)return{name:r};if(s&&s.type)return{name:a,error:s};i.pop()}return{name:r}}var Yu=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,zu=(e,t)=>!tr($(e,t)).length&&ue(e,t);const Qu={mode:_e.onSubmit,reValidateMode:_e.onChange,shouldFocusError:!0};function qu(e={}){let t={...Qu,...e},r={submitCount:0,isDirty:!1,isLoading:it(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=de(t.defaultValues)||de(t.values)?fe(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:fe(i),o={action:!1,mount:!1,watch:!1},s={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,f=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},l={values:nn(),array:nn(),state:nn()},d=Kt(t.mode),g=Kt(t.reValidateMode),p=t.criteriaMode===_e.all,y=m=>O=>{clearTimeout(f),f=setTimeout(m,O)},v=async m=>{if(c.isValid||m){const O=t.resolver?Oe((await L()).errors):await k(n,!0);O!==r.isValid&&l.state.next({isValid:O})}},b=(m,O)=>{(c.isValidating||c.validatingFields)&&((m||Array.from(s.mount)).forEach(x=>{x&&(O?z(r.validatingFields,x,O):ue(r.validatingFields,x))}),l.state.next({validatingFields:r.validatingFields,isValidating:!Oe(r.validatingFields)}))},h=(m,O=[],x,R,I=!0,N=!0)=>{if(R&&x){if(o.action=!0,N&&Array.isArray($(n,m))){const M=x($(n,m),R.argA,R.argB);I&&z(n,m,M)}if(N&&Array.isArray($(r.errors,m))){const M=x($(r.errors,m),R.argA,R.argB);I&&z(r.errors,m,M),zu(r.errors,m)}if(c.touchedFields&&N&&Array.isArray($(r.touchedFields,m))){const M=x($(r.touchedFields,m),R.argA,R.argB);I&&z(r.touchedFields,m,M)}c.dirtyFields&&(r.dirtyFields=sr(i,a)),l.state.next({name:m,isDirty:D(m,O),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else z(a,m,O)},E=(m,O)=>{z(r.errors,m,O),l.state.next({errors:r.errors})},C=m=>{r.errors=m,l.state.next({errors:r.errors,isValid:!1})},w=(m,O,x,R)=>{const I=$(n,m);if(I){const N=$(a,m,J(x)?$(i,m):x);J(N)||R&&R.defaultChecked||O?z(a,m,O?N:on(I._f)):H(m,N),o.mount&&v()}},P=(m,O,x,R,I)=>{let N=!1,M=!1;const Y={name:m},se=!!($(n,m)&&$(n,m)._f&&$(n,m)._f.disabled);if(!x||R){c.isDirty&&(M=r.isDirty,r.isDirty=Y.isDirty=D(),N=M!==Y.isDirty);const xe=se||gt($(i,m),O);M=!!(!se&&$(r.dirtyFields,m)),xe||se?ue(r.dirtyFields,m):z(r.dirtyFields,m,!0),Y.dirtyFields=r.dirtyFields,N=N||c.dirtyFields&&M!==!xe}if(x){const xe=$(r.touchedFields,m);xe||(z(r.touchedFields,m,x),Y.touchedFields=r.touchedFields,N=N||c.touchedFields&&xe!==x)}return N&&I&&l.state.next(Y),N?Y:{}},_=(m,O,x,R)=>{const I=$(r.errors,m),N=c.isValid&&Ve(O)&&r.isValid!==O;if(e.delayError&&x?(u=y(()=>E(m,x)),u(e.delayError)):(clearTimeout(f),u=null,x?z(r.errors,m,x):ue(r.errors,m)),(x?!gt(I,x):I)||!Oe(R)||N){const M={...R,...N&&Ve(O)?{isValid:O}:{},errors:r.errors,name:m};r={...r,...M},l.state.next(M)}},L=async m=>{b(m,!0);const O=await t.resolver(a,t.context,Gu(m||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return b(m),O},F=async m=>{const{errors:O}=await L(m);if(m)for(const x of m){const R=$(O,x);R?z(r.errors,x,R):ue(r.errors,x)}else r.errors=O;return O},k=async(m,O,x={valid:!0})=>{for(const R in m){const I=m[R];if(I){const{_f:N,...M}=I;if(N){const Y=s.array.has(N.name);b([R],!0);const se=await On(I,a,p,t.shouldUseNativeValidation&&!O,Y);if(b([R]),se[N.name]&&(x.valid=!1,O))break;!O&&($(se,N.name)?Y?mo(r.errors,se,N.name):z(r.errors,N.name,se[N.name]):ue(r.errors,N.name))}M&&await k(M,O,x)}}return x.valid},W=()=>{for(const m of s.unMount){const O=$(n,m);O&&(O._f.refs?O._f.refs.every(x=>!an(x)):!an(O._f.ref))&&ie(m)}s.unMount=new Set},D=(m,O)=>(m&&O&&z(a,m,O),!gt(ae(),i)),j=(m,O,x)=>fo(m,s,{...o.mount?a:J(O)?i:Be(m)?{[m]:O}:O},x,O),V=m=>tr($(o.mount?a:i,m,e.shouldUnregister?$(i,m,[]):[])),H=(m,O,x={})=>{const R=$(n,m);let I=O;if(R){const N=R._f;N&&(!N.disabled&&z(a,m,wo(O,N)),I=br(N.ref)&&be(O)?"":O,bo(N.ref)?[...N.ref.options].forEach(M=>M.selected=I.includes(M.value)):N.refs?er(N.ref)?N.refs.length>1?N.refs.forEach(M=>(!M.defaultChecked||!M.disabled)&&(M.checked=Array.isArray(I)?!!I.find(Y=>Y===M.value):I===M.value)):N.refs[0]&&(N.refs[0].checked=!!I):N.refs.forEach(M=>M.checked=M.value===I):Un(N.ref)?N.ref.value="":(N.ref.value=I,N.ref.type||l.values.next({name:m,values:{...a}})))}(x.shouldDirty||x.shouldTouch)&&P(m,I,x.shouldTouch,x.shouldDirty,!0),x.shouldValidate&&le(m)},Q=(m,O,x)=>{for(const R in O){const I=O[R],N=`${m}.${R}`,M=$(n,N);(s.array.has(m)||!Or(I)||M&&!M._f)&&!Ct(I)?Q(N,I,x):H(N,I,x)}},G=(m,O,x={})=>{const R=$(n,m),I=s.array.has(m),N=fe(O);z(a,m,N),I?(l.array.next({name:m,values:{...a}}),(c.isDirty||c.dirtyFields)&&x.shouldDirty&&l.state.next({name:m,dirtyFields:sr(i,a),isDirty:D(m,N)})):R&&!R._f&&!be(N)?Q(m,N,x):H(m,N,x),Sn(m,s)&&l.state.next({...r}),l.values.next({name:o.mount?m:void 0,values:{...a}})},ge=async m=>{o.mount=!0;const O=m.target;let x=O.name,R=!0;const I=$(n,x),N=()=>O.type?on(I._f):ro(m),M=Y=>{R=Number.isNaN(Y)||Y===$(a,x,Y)};if(I){let Y,se;const xe=N(),Et=m.type===yr.BLUR||m.type===yr.FOCUS_OUT,qs=!Ku(I._f)&&!t.resolver&&!$(r.errors,x)&&!I._f.deps||Yu(Et,$(r.touchedFields,x),r.isSubmitted,g,d),Kr=Sn(x,s,Et);z(a,x,xe),Et?(I._f.onBlur&&I._f.onBlur(m),u&&u(0)):I._f.onChange&&I._f.onChange(m);const Yr=P(x,xe,Et,!1),Js=!Oe(Yr)||Kr;if(!Et&&l.values.next({name:x,type:m.type,values:{...a}}),qs)return c.isValid&&v(),Js&&l.state.next({name:x,...Kr?{}:Yr});if(!Et&&Kr&&l.state.next({...r}),t.resolver){const{errors:ui}=await L([x]);if(M(xe),R){const Zs=Ri(r.errors,n,x),li=Ri(ui,n,Zs.name||x);Y=li.error,x=li.name,se=Oe(ui)}}else b([x],!0),Y=(await On(I,a,p,t.shouldUseNativeValidation))[x],b([x]),M(xe),R&&(Y?se=!1:c.isValid&&(se=await k(n,!0)));R&&(I._f.deps&&le(I._f.deps),_(x,se,Y,Yr))}},ee=(m,O)=>{if($(r.errors,O)&&m.focus)return m.focus(),1},le=async(m,O={})=>{let x,R;const I=we(m);if(t.resolver){const N=await F(J(m)?m:I);x=Oe(N),R=m?!I.some(M=>$(N,M)):x}else m?(R=(await Promise.all(I.map(async N=>{const M=$(n,N);return await k(M&&M._f?{[N]:M}:M)}))).every(Boolean),!(!R&&!r.isValid)&&v()):R=x=await k(n);return l.state.next({...!Be(m)||c.isValid&&x!==r.isValid?{}:{name:m},...t.resolver||!m?{isValid:x}:{},errors:r.errors}),O.shouldFocus&&!R&&_t(n,ee,m?I:s.mount),R},ae=m=>{const O={...o.mount?a:i};return J(m)?O:Be(m)?$(O,m):m.map(x=>$(O,x))},ce=(m,O)=>({invalid:!!$((O||r).errors,m),isDirty:!!$((O||r).dirtyFields,m),error:$((O||r).errors,m),isValidating:!!$(r.validatingFields,m),isTouched:!!$((O||r).touchedFields,m)}),pe=m=>{m&&we(m).forEach(O=>ue(r.errors,O)),l.state.next({errors:m?r.errors:{}})},K=(m,O,x)=>{const R=($(n,m,{_f:{}})._f||{}).ref,I=$(r.errors,m)||{},{ref:N,message:M,type:Y,...se}=I;z(r.errors,m,{...se,...O,ref:R}),l.state.next({name:m,errors:r.errors,isValid:!1}),x&&x.shouldFocus&&R&&R.focus&&R.focus()},he=(m,O)=>it(m)?l.values.subscribe({next:x=>m(j(void 0,O),x)}):j(m,O,!0),ie=(m,O={})=>{for(const x of m?we(m):s.mount)s.mount.delete(x),s.array.delete(x),O.keepValue||(ue(n,x),ue(a,x)),!O.keepError&&ue(r.errors,x),!O.keepDirty&&ue(r.dirtyFields,x),!O.keepTouched&&ue(r.touchedFields,x),!O.keepIsValidating&&ue(r.validatingFields,x),!t.shouldUnregister&&!O.keepDefaultValue&&ue(i,x);l.values.next({values:{...a}}),l.state.next({...r,...O.keepDirty?{isDirty:D()}:{}}),!O.keepIsValid&&v()},Ee=({disabled:m,name:O,field:x,fields:R,value:I})=>{if(Ve(m)&&o.mount||!!m){const N=m?void 0:J(I)?on(x?x._f:$(R,O)._f):I;z(a,O,N),P(O,N,!1,!1,!0)}},Ce=(m,O={})=>{let x=$(n,m);const R=Ve(O.disabled);return z(n,m,{...x||{},_f:{...x&&x._f?x._f:{ref:{name:m}},name:m,mount:!0,...O}}),s.mount.add(m),x?Ee({field:x,disabled:O.disabled,name:m,value:O.value}):w(m,!0,O.value),{...R?{disabled:O.disabled}:{},...t.progressive?{required:!!O.required,min:Dt(O.min),max:Dt(O.max),minLength:Dt(O.minLength),maxLength:Dt(O.maxLength),pattern:Dt(O.pattern)}:{},name:m,onChange:ge,onBlur:ge,ref:I=>{if(I){Ce(m,O),x=$(n,m);const N=J(I.value)&&I.querySelectorAll&&I.querySelectorAll("input,select,textarea")[0]||I,M=Wu(N),Y=x._f.refs||[];if(M?Y.find(se=>se===N):N===x._f.ref)return;z(n,m,{_f:{...x._f,...M?{refs:[...Y.filter(an),N,...Array.isArray($(i,m))?[{}]:[]],ref:{type:N.type,name:m}}:{ref:N}}}),w(m,!1,void 0,N)}else x=$(n,m,{}),x._f&&(x._f.mount=!1),(t.shouldUnregister||O.shouldUnregister)&&!(no(s.array,m)&&o.action)&&s.unMount.add(m)}}},Re=()=>t.shouldFocusError&&_t(n,ee,s.mount),ke=m=>{Ve(m)&&(l.state.next({disabled:m}),_t(n,(O,x)=>{const R=$(n,x);R&&(O.disabled=R._f.disabled||m,Array.isArray(R._f.refs)&&R._f.refs.forEach(I=>{I.disabled=R._f.disabled||m}))},0,!1))},U=(m,O)=>async x=>{let R;x&&(x.preventDefault&&x.preventDefault(),x.persist&&x.persist());let I=fe(a);if(l.state.next({isSubmitting:!0}),t.resolver){const{errors:N,values:M}=await L();r.errors=N,I=M}else await k(n);if(ue(r.errors,"root"),Oe(r.errors)){l.state.next({errors:{}});try{await m(I,x)}catch(N){R=N}}else O&&await O({...r.errors},x),Re(),setTimeout(Re);if(l.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Oe(r.errors)&&!R,submitCount:r.submitCount+1,errors:r.errors}),R)throw R},oe=(m,O={})=>{$(n,m)&&(J(O.defaultValue)?G(m,fe($(i,m))):(G(m,O.defaultValue),z(i,m,fe(O.defaultValue))),O.keepTouched||ue(r.touchedFields,m),O.keepDirty||(ue(r.dirtyFields,m),r.isDirty=O.defaultValue?D(m,fe($(i,m))):D()),O.keepError||(ue(r.errors,m),c.isValid&&v()),l.state.next({...r}))},re=(m,O={})=>{const x=m?fe(m):i,R=fe(x),I=Oe(m),N=I?i:R;if(O.keepDefaultValues||(i=x),!O.keepValues){if(O.keepDirtyValues)for(const M of s.mount)$(r.dirtyFields,M)?z(N,M,$(a,M)):G(M,$(N,M));else{if(jn&&J(m))for(const M of s.mount){const Y=$(n,M);if(Y&&Y._f){const se=Array.isArray(Y._f.refs)?Y._f.refs[0]:Y._f.ref;if(br(se)){const xe=se.closest("form");if(xe){xe.reset();break}}}}n={}}a=e.shouldUnregister?O.keepDefaultValues?fe(i):{}:fe(N),l.array.next({values:{...N}}),l.values.next({values:{...N}})}s={mount:O.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!c.isValid||!!O.keepIsValid||!!O.keepDirtyValues,o.watch=!!e.shouldUnregister,l.state.next({submitCount:O.keepSubmitCount?r.submitCount:0,isDirty:I?!1:O.keepDirty?r.isDirty:!!(O.keepDefaultValues&&!gt(m,i)),isSubmitted:O.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:I?{}:O.keepDirtyValues?O.keepDefaultValues&&a?sr(i,a):r.dirtyFields:O.keepDefaultValues&&m?sr(i,m):O.keepDirty?r.dirtyFields:{},touchedFields:O.keepTouched?r.touchedFields:{},errors:O.keepErrors?r.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Se=(m,O)=>re(it(m)?m(a):m,O);return{control:{register:Ce,unregister:ie,getFieldState:ce,handleSubmit:U,setError:K,_executeSchema:L,_getWatch:j,_getDirty:D,_updateValid:v,_removeUnmounted:W,_updateFieldArray:h,_updateDisabledField:Ee,_getFieldArray:V,_reset:re,_resetDefaultValues:()=>it(t.defaultValues)&&t.defaultValues().then(m=>{Se(m,t.resetOptions),l.state.next({isLoading:!1})}),_updateFormState:m=>{r={...r,...m}},_disableForm:ke,_subjects:l,_proxyFormState:c,_setErrors:C,get _fields(){return n},get _formValues(){return a},get _state(){return o},set _state(m){o=m},get _defaultValues(){return i},get _names(){return s},set _names(m){s=m},get _formState(){return r},set _formState(m){r=m},get _options(){return t},set _options(m){t={...t,...m}}},trigger:le,register:Ce,handleSubmit:U,watch:he,setValue:G,getValues:ae,reset:Se,resetField:oe,clearErrors:pe,unregister:ie,setError:K,setFocus:(m,O={})=>{const x=$(n,m),R=x&&x._f;if(R){const I=R.refs?R.refs[0]:R.ref;I.focus&&(I.focus(),O.shouldSelect&&I.select())}},getFieldState:ce}}function Eo(e={}){const t=T.default.useRef(),r=T.default.useRef(),[n,i]=T.default.useState({isDirty:!1,isValidating:!1,isLoading:it(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:it(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...qu(e),formState:n});const a=t.current.control;return a._options=e,Ir({subject:a._subjects.state,next:o=>{uo(o,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),T.default.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),T.default.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==n.isDirty&&a._subjects.state.next({isDirty:o})}},[a,n.isDirty]),T.default.useEffect(()=>{e.values&&!gt(e.values,r.current)?(a._reset(e.values,a._options.resetOptions),r.current=e.values,i(o=>({...o}))):a._resetDefaultValues()},[e.values,a]),T.default.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),T.default.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),T.default.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),t.current.formState=so(n,a),t.current}var Ju=Object.freeze(Object.defineProperty({__proto__:null,Controller:Mu,Form:ju,FormProvider:oo,appendErrors:ho,get:$,set:z,useController:po,useFieldArray:Hu,useForm:Eo,useFormContext:Ye,useFormState:co,useWatch:go},Symbol.toStringTag,{value:"Module"})),xo=(e=>(e.FULL_PAGE="FULL_PAGE",e.MODAL="MODAL",e))(xo||{}),Po=(e=>(e.SIMPLE="SIMPLE",e.COMPLEX="COMPLEX",e.QUANTITY="QUANTITY",e))(Po||{}),Hn=(e=>(e.SELECT="selCtx",e.FILTER="fltCtx",e))(Hn||{}),Wn=(e=>(e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.PRODUCT="3e/product",e))(Wn||{}),Te=(e=>(e.OK="OK",e.TOO_MUCH="TOO_MUCH",e.NOT_ENOUGHT="NOT_ENOUGHT",e.IGNORE="IGNORE",e))(Te||{});const Zu=(e,t,r)=>{if(e==="selected"||e==="filter")return[];if(r[t]===e)return[r];let n=Co(e,t,r.items);return n!=null&&n.length||(n=Ao(e,t,r.items),n.length),n},Ao=(e,t,r)=>{const n=Xu(r),i=Co(e,t,n);return i!=null&&i.length?i:n!=null&&n.length?Ao(e,t,n):[]},Xu=e=>{let t=[];return Array.isArray(e)&&(t=e.map(r=>{if(Array.isArray(r==null?void 0:r.items))return r.items}).filter(r=>r!==void 0)),t.flat(1)},Co=(e,t,r)=>{let n=[];return Array.isArray(r)&&(n=r.filter(i=>{if(i&&i[t]===e)return!0})),n},el=(e,t,r,n)=>{const i=Zu(t,r,n),a=tl(e,i).filter(o=>o!==null&&typeof o!="undefined");return a.length?a[0]:null},tl=(e,t)=>{let r=[];return Array.isArray(t)&&t.length&&(r=t.map(n=>rl(e,n))),r},rl=(e,t)=>{if(t.id===e)return t;let r=To(e,t.items);return r.length?(r.length>1&&console.error(`More than one ${e} in context ${t.id}`),r[0]):(r=_o(e,t.items),r.length?(r.length>1&&console.error(`More than one ${e} in context ${t.id}`),r[0]):null)},_o=(e,t)=>{const r=nl(t),n=To(e,r);return n!=null&&n.length?n:r!=null&&r.length?_o(e,r):[]},nl=e=>{let t=[];return Array.isArray(e)&&(t=e.map(r=>{if(Array.isArray(r==null?void 0:r.items))return r.items}).filter(r=>r!==void 0)),t.flat(1)},To=(e,t)=>Array.isArray(t)?t.filter(n=>{if(n&&n.id===e)return!0}):[],Gn=(e,t)=>{let r=0;for(const[n,i]of Object.entries(e))if(i){for(const[a,o]of Object.entries(i))if(o){const s=el(a,n,Hn.SELECT,t);s&&(s==null?void 0:s.price)?r+=parseFloat(s.price)*o:s||console.warn(`Error finding product: ${a} in selCtx: ${n}`)}}return r},No=e=>{const{price:t,state:{selected:r}={}}=e;return(!t||parseFloat(t||"1")===0)&&r?`${Gn(r,e)||"0"}`:t};var il=typeof global=="object"&&global&&global.Object===Object&&global,$o=il,al=typeof self=="object"&&self&&self.Object===Object&&self,ol=$o||al||Function("return this")(),ze=ol,sl=ze.Symbol,lt=sl,Io=Object.prototype,ul=Io.hasOwnProperty,ll=Io.toString,Mt=lt?lt.toStringTag:void 0;function cl(e){var t=ul.call(e,Mt),r=e[Mt];try{e[Mt]=void 0;var n=!0}catch{}var i=ll.call(e);return n&&(t?e[Mt]=r:delete e[Mt]),i}var fl=Object.prototype,dl=fl.toString;function gl(e){return dl.call(e)}var pl="[object Null]",hl="[object Undefined]",Fi=lt?lt.toStringTag:void 0;function It(e){return e==null?e===void 0?hl:pl:Fi&&Fi in Object(e)?cl(e):gl(e)}function ct(e){return e!=null&&typeof e=="object"}var ml="[object Symbol]";function vl(e){return typeof e=="symbol"||ct(e)&&It(e)==ml}var yl=Array.isArray,Tt=yl,bl=/\s/;function Sl(e){for(var t=e.length;t--&&bl.test(e.charAt(t)););return t}var Ol=/^\s+/;function wl(e){return e&&e.slice(0,Sl(e)+1).replace(Ol,"")}function vt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Di=0/0,El=/^[-+]0x[0-9a-f]+$/i,xl=/^0b[01]+$/i,Pl=/^0o[0-7]+$/i,Al=parseInt;function Lo(e){if(typeof e=="number")return e;if(vl(e))return Di;if(vt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=vt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=wl(e);var r=xl.test(e);return r||Pl.test(e)?Al(e.slice(2),r?2:8):El.test(e)?Di:+e}var Mi=1/0,Cl=17976931348623157e292;function ki(e){if(!e)return e===0?e:0;if(e=Lo(e),e===Mi||e===-Mi){var t=e<0?-1:1;return t*Cl}return e===e?e:0}var _l="[object AsyncFunction]",Tl="[object Function]",Nl="[object GeneratorFunction]",$l="[object Proxy]";function Ro(e){if(!vt(e))return!1;var t=It(e);return t==Tl||t==Nl||t==_l||t==$l}var Il=ze["__core-js_shared__"],sn=Il,ji=function(){var e=/[^.]+$/.exec(sn&&sn.keys&&sn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ll(e){return!!ji&&ji in e}var Rl=Function.prototype,Fl=Rl.toString;function bt(e){if(e!=null){try{return Fl.call(e)}catch{}try{return e+""}catch{}}return""}var Dl=/[\\^$.*+?()[\]{}|]/g,Ml=/^\[object .+?Constructor\]$/,kl=Function.prototype,jl=Object.prototype,Vl=kl.toString,Ul=jl.hasOwnProperty,Bl=RegExp("^"+Vl.call(Ul).replace(Dl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Hl(e){if(!vt(e)||Ll(e))return!1;var t=Ro(e)?Bl:Ml;return t.test(bt(e))}function Wl(e,t){return e==null?void 0:e[t]}function St(e,t){var r=Wl(e,t);return Hl(r)?r:void 0}var Gl=St(ze,"WeakMap"),wn=Gl,Vi=Object.create,Kl=function(){function e(){}return function(t){if(!vt(t))return{};if(Vi)return Vi(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Yl=Kl;function zl(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Ql=function(){try{var e=St(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Ui=Ql;function ql(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var Jl=9007199254740991,Zl=/^(?:0|[1-9]\d*)$/;function Xl(e,t){var r=typeof e;return t=t==null?Jl:t,!!t&&(r=="number"||r!="symbol"&&Zl.test(e))&&e>-1&&e%1==0&&e<t}function Fo(e,t,r){t=="__proto__"&&Ui?Ui(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Kn(e,t){return e===t||e!==e&&t!==t}var ec=Object.prototype,tc=ec.hasOwnProperty;function Do(e,t,r){var n=e[t];(!(tc.call(e,t)&&Kn(n,r))||r===void 0&&!(t in e))&&Fo(e,t,r)}function Lr(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var s=t[a],u=n?n(r[s],e[s],s,r,e):void 0;u===void 0&&(u=e[s]),i?Fo(r,s,u):Do(r,s,u)}return r}var rc=9007199254740991;function Mo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=rc}function Yn(e){return e!=null&&Mo(e.length)&&!Ro(e)}var nc=Object.prototype;function Rr(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||nc;return e===r}function ic(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var ac="[object Arguments]";function Bi(e){return ct(e)&&It(e)==ac}var ko=Object.prototype,oc=ko.hasOwnProperty,sc=ko.propertyIsEnumerable,uc=Bi(function(){return arguments}())?Bi:function(e){return ct(e)&&oc.call(e,"callee")&&!sc.call(e,"callee")},jo=uc;function lc(){return!1}var Vo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Hi=Vo&&typeof module=="object"&&module&&!module.nodeType&&module,cc=Hi&&Hi.exports===Vo,Wi=cc?ze.Buffer:void 0,fc=Wi?Wi.isBuffer:void 0,dc=fc||lc,Qt=dc,gc="[object Arguments]",pc="[object Array]",hc="[object Boolean]",mc="[object Date]",vc="[object Error]",yc="[object Function]",bc="[object Map]",Sc="[object Number]",Oc="[object Object]",wc="[object RegExp]",Ec="[object Set]",xc="[object String]",Pc="[object WeakMap]",Ac="[object ArrayBuffer]",Cc="[object DataView]",_c="[object Float32Array]",Tc="[object Float64Array]",Nc="[object Int8Array]",$c="[object Int16Array]",Ic="[object Int32Array]",Lc="[object Uint8Array]",Rc="[object Uint8ClampedArray]",Fc="[object Uint16Array]",Dc="[object Uint32Array]",X={};X[_c]=X[Tc]=X[Nc]=X[$c]=X[Ic]=X[Lc]=X[Rc]=X[Fc]=X[Dc]=!0;X[gc]=X[pc]=X[Ac]=X[hc]=X[Cc]=X[mc]=X[vc]=X[yc]=X[bc]=X[Sc]=X[Oc]=X[wc]=X[Ec]=X[xc]=X[Pc]=!1;function Mc(e){return ct(e)&&Mo(e.length)&&!!X[It(e)]}function zn(e){return function(t){return e(t)}}var Uo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Yt=Uo&&typeof module=="object"&&module&&!module.nodeType&&module,kc=Yt&&Yt.exports===Uo,un=kc&&$o.process,jc=function(){try{var e=Yt&&Yt.require&&Yt.require("util").types;return e||un&&un.binding&&un.binding("util")}catch{}}(),Nt=jc,Gi=Nt&&Nt.isTypedArray,Vc=Gi?zn(Gi):Mc,Qn=Vc,Uc=Object.prototype,Bc=Uc.hasOwnProperty;function Bo(e,t){var r=Tt(e),n=!r&&jo(e),i=!r&&!n&&Qt(e),a=!r&&!n&&!i&&Qn(e),o=r||n||i||a,s=o?ic(e.length,String):[],u=s.length;for(var f in e)(t||Bc.call(e,f))&&!(o&&(f=="length"||i&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Xl(f,u)))&&s.push(f);return s}function Ho(e,t){return function(r){return e(t(r))}}var Hc=Ho(Object.keys,Object),Wc=Hc,Gc=Object.prototype,Kc=Gc.hasOwnProperty;function Wo(e){if(!Rr(e))return Wc(e);var t=[];for(var r in Object(e))Kc.call(e,r)&&r!="constructor"&&t.push(r);return t}function qn(e){return Yn(e)?Bo(e):Wo(e)}function Yc(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var zc=Object.prototype,Qc=zc.hasOwnProperty;function qc(e){if(!vt(e))return Yc(e);var t=Rr(e),r=[];for(var n in e)n=="constructor"&&(t||!Qc.call(e,n))||r.push(n);return r}function Jn(e){return Yn(e)?Bo(e,!0):qc(e)}var Jc=St(Object,"create"),qt=Jc;function Zc(){this.__data__=qt?qt(null):{},this.size=0}function Xc(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ef="__lodash_hash_undefined__",tf=Object.prototype,rf=tf.hasOwnProperty;function nf(e){var t=this.__data__;if(qt){var r=t[e];return r===ef?void 0:r}return rf.call(t,e)?t[e]:void 0}var af=Object.prototype,of=af.hasOwnProperty;function sf(e){var t=this.__data__;return qt?t[e]!==void 0:of.call(t,e)}var uf="__lodash_hash_undefined__";function lf(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=qt&&t===void 0?uf:t,this}function yt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}yt.prototype.clear=Zc;yt.prototype.delete=Xc;yt.prototype.get=nf;yt.prototype.has=sf;yt.prototype.set=lf;function cf(){this.__data__=[],this.size=0}function Fr(e,t){for(var r=e.length;r--;)if(Kn(e[r][0],t))return r;return-1}var ff=Array.prototype,df=ff.splice;function gf(e){var t=this.__data__,r=Fr(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():df.call(t,r,1),--this.size,!0}function pf(e){var t=this.__data__,r=Fr(t,e);return r<0?void 0:t[r][1]}function hf(e){return Fr(this.__data__,e)>-1}function mf(e,t){var r=this.__data__,n=Fr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Xe(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Xe.prototype.clear=cf;Xe.prototype.delete=gf;Xe.prototype.get=pf;Xe.prototype.has=hf;Xe.prototype.set=mf;var vf=St(ze,"Map"),Jt=vf;function yf(){this.size=0,this.__data__={hash:new yt,map:new(Jt||Xe),string:new yt}}function bf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Dr(e,t){var r=e.__data__;return bf(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Sf(e){var t=Dr(this,e).delete(e);return this.size-=t?1:0,t}function Of(e){return Dr(this,e).get(e)}function wf(e){return Dr(this,e).has(e)}function Ef(e,t){var r=Dr(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function Ot(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ot.prototype.clear=yf;Ot.prototype.delete=Sf;Ot.prototype.get=Of;Ot.prototype.has=wf;Ot.prototype.set=Ef;function Go(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var xf=Ho(Object.getPrototypeOf,Object),Ko=xf;function Pf(){this.__data__=new Xe,this.size=0}function Af(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Cf(e){return this.__data__.get(e)}function _f(e){return this.__data__.has(e)}var Tf=200;function Nf(e,t){var r=this.__data__;if(r instanceof Xe){var n=r.__data__;if(!Jt||n.length<Tf-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Ot(n)}return r.set(e,t),this.size=r.size,this}function qe(e){var t=this.__data__=new Xe(e);this.size=t.size}qe.prototype.clear=Pf;qe.prototype.delete=Af;qe.prototype.get=Cf;qe.prototype.has=_f;qe.prototype.set=Nf;function $f(e,t){return e&&Lr(t,qn(t),e)}function If(e,t){return e&&Lr(t,Jn(t),e)}var Yo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ki=Yo&&typeof module=="object"&&module&&!module.nodeType&&module,Lf=Ki&&Ki.exports===Yo,Yi=Lf?ze.Buffer:void 0,zi=Yi?Yi.allocUnsafe:void 0;function Rf(e,t){if(t)return e.slice();var r=e.length,n=zi?zi(r):new e.constructor(r);return e.copy(n),n}function Ff(e,t){for(var r=-1,n=e==null?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}function zo(){return[]}var Df=Object.prototype,Mf=Df.propertyIsEnumerable,Qi=Object.getOwnPropertySymbols,kf=Qi?function(e){return e==null?[]:(e=Object(e),Ff(Qi(e),function(t){return Mf.call(e,t)}))}:zo,Zn=kf;function jf(e,t){return Lr(e,Zn(e),t)}var Vf=Object.getOwnPropertySymbols,Uf=Vf?function(e){for(var t=[];e;)Go(t,Zn(e)),e=Ko(e);return t}:zo,Qo=Uf;function Bf(e,t){return Lr(e,Qo(e),t)}function qo(e,t,r){var n=t(e);return Tt(e)?n:Go(n,r(e))}function En(e){return qo(e,qn,Zn)}function Hf(e){return qo(e,Jn,Qo)}var Wf=St(ze,"DataView"),xn=Wf,Gf=St(ze,"Promise"),Pn=Gf,Kf=St(ze,"Set"),An=Kf,qi="[object Map]",Yf="[object Object]",Ji="[object Promise]",Zi="[object Set]",Xi="[object WeakMap]",ea="[object DataView]",zf=bt(xn),Qf=bt(Jt),qf=bt(Pn),Jf=bt(An),Zf=bt(wn),ft=It;(xn&&ft(new xn(new ArrayBuffer(1)))!=ea||Jt&&ft(new Jt)!=qi||Pn&&ft(Pn.resolve())!=Ji||An&&ft(new An)!=Zi||wn&&ft(new wn)!=Xi)&&(ft=function(e){var t=It(e),r=t==Yf?e.constructor:void 0,n=r?bt(r):"";if(n)switch(n){case zf:return ea;case Qf:return qi;case qf:return Ji;case Jf:return Zi;case Zf:return Xi}return t});var $t=ft,Xf=Object.prototype,ed=Xf.hasOwnProperty;function td(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&ed.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var rd=ze.Uint8Array,Er=rd;function Xn(e){var t=new e.constructor(e.byteLength);return new Er(t).set(new Er(e)),t}function nd(e,t){var r=t?Xn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var id=/\w*$/;function ad(e){var t=new e.constructor(e.source,id.exec(e));return t.lastIndex=e.lastIndex,t}var ta=lt?lt.prototype:void 0,ra=ta?ta.valueOf:void 0;function od(e){return ra?Object(ra.call(e)):{}}function sd(e,t){var r=t?Xn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var ud="[object Boolean]",ld="[object Date]",cd="[object Map]",fd="[object Number]",dd="[object RegExp]",gd="[object Set]",pd="[object String]",hd="[object Symbol]",md="[object ArrayBuffer]",vd="[object DataView]",yd="[object Float32Array]",bd="[object Float64Array]",Sd="[object Int8Array]",Od="[object Int16Array]",wd="[object Int32Array]",Ed="[object Uint8Array]",xd="[object Uint8ClampedArray]",Pd="[object Uint16Array]",Ad="[object Uint32Array]";function Cd(e,t,r){var n=e.constructor;switch(t){case md:return Xn(e);case ud:case ld:return new n(+e);case vd:return nd(e,r);case yd:case bd:case Sd:case Od:case wd:case Ed:case xd:case Pd:case Ad:return sd(e,r);case cd:return new n;case fd:case pd:return new n(e);case dd:return ad(e);case gd:return new n;case hd:return od(e)}}function _d(e){return typeof e.constructor=="function"&&!Rr(e)?Yl(Ko(e)):{}}var Td="[object Map]";function Nd(e){return ct(e)&&$t(e)==Td}var na=Nt&&Nt.isMap,$d=na?zn(na):Nd,Id=$d,Ld="[object Set]";function Rd(e){return ct(e)&&$t(e)==Ld}var ia=Nt&&Nt.isSet,Fd=ia?zn(ia):Rd,Dd=Fd,Md=1,kd=2,jd=4,Jo="[object Arguments]",Vd="[object Array]",Ud="[object Boolean]",Bd="[object Date]",Hd="[object Error]",Zo="[object Function]",Wd="[object GeneratorFunction]",Gd="[object Map]",Kd="[object Number]",Xo="[object Object]",Yd="[object RegExp]",zd="[object Set]",Qd="[object String]",qd="[object Symbol]",Jd="[object WeakMap]",Zd="[object ArrayBuffer]",Xd="[object DataView]",eg="[object Float32Array]",tg="[object Float64Array]",rg="[object Int8Array]",ng="[object Int16Array]",ig="[object Int32Array]",ag="[object Uint8Array]",og="[object Uint8ClampedArray]",sg="[object Uint16Array]",ug="[object Uint32Array]",q={};q[Jo]=q[Vd]=q[Zd]=q[Xd]=q[Ud]=q[Bd]=q[eg]=q[tg]=q[rg]=q[ng]=q[ig]=q[Gd]=q[Kd]=q[Xo]=q[Yd]=q[zd]=q[Qd]=q[qd]=q[ag]=q[og]=q[sg]=q[ug]=!0;q[Hd]=q[Zo]=q[Jd]=!1;function gr(e,t,r,n,i,a){var o,s=t&Md,u=t&kd,f=t&jd;if(r&&(o=i?r(e,n,i,a):r(e)),o!==void 0)return o;if(!vt(e))return e;var c=Tt(e);if(c){if(o=td(e),!s)return zl(e,o)}else{var l=$t(e),d=l==Zo||l==Wd;if(Qt(e))return Rf(e,s);if(l==Xo||l==Jo||d&&!i){if(o=u||d?{}:_d(e),!s)return u?Bf(e,If(o,e)):jf(e,$f(o,e))}else{if(!q[l])return i?e:{};o=Cd(e,l,s)}}a||(a=new qe);var g=a.get(e);if(g)return g;a.set(e,o),Dd(e)?e.forEach(function(v){o.add(gr(v,t,r,v,e,a))}):Id(e)&&e.forEach(function(v,b){o.set(b,gr(v,t,r,b,e,a))});var p=f?u?Hf:En:u?Jn:qn,y=c?void 0:p(e);return ql(y||e,function(v,b){y&&(b=v,v=e[b]),Do(o,b,gr(v,t,r,b,e,a))}),o}var lg=1,cg=4;function es(e){return gr(e,lg|cg)}var fg="__lodash_hash_undefined__";function dg(e){return this.__data__.set(e,fg),this}function gg(e){return this.__data__.has(e)}function xr(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Ot;++t<r;)this.add(e[t])}xr.prototype.add=xr.prototype.push=dg;xr.prototype.has=gg;function pg(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function hg(e,t){return e.has(t)}var mg=1,vg=2;function ts(e,t,r,n,i,a){var o=r&mg,s=e.length,u=t.length;if(s!=u&&!(o&&u>s))return!1;var f=a.get(e),c=a.get(t);if(f&&c)return f==t&&c==e;var l=-1,d=!0,g=r&vg?new xr:void 0;for(a.set(e,t),a.set(t,e);++l<s;){var p=e[l],y=t[l];if(n)var v=o?n(y,p,l,t,e,a):n(p,y,l,e,t,a);if(v!==void 0){if(v)continue;d=!1;break}if(g){if(!pg(t,function(b,h){if(!hg(g,h)&&(p===b||i(p,b,r,n,a)))return g.push(h)})){d=!1;break}}else if(!(p===y||i(p,y,r,n,a))){d=!1;break}}return a.delete(e),a.delete(t),d}function yg(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function bg(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Sg=1,Og=2,wg="[object Boolean]",Eg="[object Date]",xg="[object Error]",Pg="[object Map]",Ag="[object Number]",Cg="[object RegExp]",_g="[object Set]",Tg="[object String]",Ng="[object Symbol]",$g="[object ArrayBuffer]",Ig="[object DataView]",aa=lt?lt.prototype:void 0,ln=aa?aa.valueOf:void 0;function Lg(e,t,r,n,i,a,o){switch(r){case Ig:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case $g:return!(e.byteLength!=t.byteLength||!a(new Er(e),new Er(t)));case wg:case Eg:case Ag:return Kn(+e,+t);case xg:return e.name==t.name&&e.message==t.message;case Cg:case Tg:return e==t+"";case Pg:var s=yg;case _g:var u=n&Sg;if(s||(s=bg),e.size!=t.size&&!u)return!1;var f=o.get(e);if(f)return f==t;n|=Og,o.set(e,t);var c=ts(s(e),s(t),n,i,a,o);return o.delete(e),c;case Ng:if(ln)return ln.call(e)==ln.call(t)}return!1}var Rg=1,Fg=Object.prototype,Dg=Fg.hasOwnProperty;function Mg(e,t,r,n,i,a){var o=r&Rg,s=En(e),u=s.length,f=En(t),c=f.length;if(u!=c&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:Dg.call(t,d)))return!1}var g=a.get(e),p=a.get(t);if(g&&p)return g==t&&p==e;var y=!0;a.set(e,t),a.set(t,e);for(var v=o;++l<u;){d=s[l];var b=e[d],h=t[d];if(n)var E=o?n(h,b,d,t,e,a):n(b,h,d,e,t,a);if(!(E===void 0?b===h||i(b,h,r,n,a):E)){y=!1;break}v||(v=d=="constructor")}if(y&&!v){var C=e.constructor,w=t.constructor;C!=w&&"constructor"in e&&"constructor"in t&&!(typeof C=="function"&&C instanceof C&&typeof w=="function"&&w instanceof w)&&(y=!1)}return a.delete(e),a.delete(t),y}var kg=1,oa="[object Arguments]",sa="[object Array]",ur="[object Object]",jg=Object.prototype,ua=jg.hasOwnProperty;function Vg(e,t,r,n,i,a){var o=Tt(e),s=Tt(t),u=o?sa:$t(e),f=s?sa:$t(t);u=u==oa?ur:u,f=f==oa?ur:f;var c=u==ur,l=f==ur,d=u==f;if(d&&Qt(e)){if(!Qt(t))return!1;o=!0,c=!1}if(d&&!c)return a||(a=new qe),o||Qn(e)?ts(e,t,r,n,i,a):Lg(e,t,u,r,n,i,a);if(!(r&kg)){var g=c&&ua.call(e,"__wrapped__"),p=l&&ua.call(t,"__wrapped__");if(g||p){var y=g?e.value():e,v=p?t.value():t;return a||(a=new qe),i(y,v,r,n,a)}}return d?(a||(a=new qe),Mg(e,t,r,n,i,a)):!1}function rs(e,t,r,n,i){return e===t?!0:e==null||t==null||!ct(e)&&!ct(t)?e!==e&&t!==t:Vg(e,t,r,n,rs,i)}var Ug=Math.max,Bg=Math.min;function Hg(e,t,r){return e>=Bg(t,r)&&e<Ug(t,r)}function la(e,t,r){return t=ki(t),r===void 0?(r=t,t=0):r=ki(r),e=Lo(e),Hg(e,t,r)}var Wg="[object Map]",Gg="[object Set]",Kg=Object.prototype,Yg=Kg.hasOwnProperty;function He(e){if(e==null)return!0;if(Yn(e)&&(Tt(e)||typeof e=="string"||typeof e.splice=="function"||Qt(e)||Qn(e)||jo(e)))return!e.length;var t=$t(e);if(t==Wg||t==Gg)return!e.size;if(Rr(e))return!Wo(e).length;for(var r in e)if(Yg.call(e,r))return!1;return!0}function zg(e,t){return rs(e,t)}const Qg=["id","selCtx","fltCtx"],ns=".",is="#dot",as="#FIX_NUMBER",qg=e=>ss(es(e),Xg),Jg=e=>{const t=e.replaceAll(ns,is);return/^\d+$/.test(t)?`${as}${t}`:t},Zg=e=>e.replaceAll(is,ns).replaceAll(as,""),Xg=(e,t)=>os(e,t,Jg),ep=(e,t)=>os(e,t,Zg),os=(e,t,r)=>{let n=t;function i(a){const o={};for(const s in a)if(a.hasOwnProperty(s)){const u=r(s);let f=a[s];typeof a[s]=="object"&&a[s]!==null&&(f=i(a[s])),o[u]=f}return o}return Qg.includes(e)&&(typeof t=="string"||t instanceof String)&&(n=r(t)),(e==="selected"||e==="filter")&&(n=i(t)),n},ss=(e,t)=>(Object.keys(e).forEach(r=>{const n=e[r];e[r]=t(r,n),typeof n=="object"&&n!==null&&ss(n,t)}),e),us=e=>{const t=JSON.parse(JSON.stringify(e));for(const[r,n]of Object.entries(t))if(n&&!Array.isArray(n)){const i=t[r];for(const[a,o]of Object.entries(i))o===!1&&delete i[a];Object.keys(i).length===0&&delete t[r]}else delete t[r];return t},tp=e=>ep("selected",e);var ca;(function(e){e.UNINITIALIZED="UNINITIALIZED",e.PROCESSING="PROCESSING",e.PAID="PAID",e.FAILED="FAILED",e.PRINTING_RECEIPT="PRINTING_RECEIPT",e.PRINTING_RECEIPT_SUCCESS="PRINTING_RECEIPT_SUCCESS",e.SENDING_RECEIPT="SENDING_RECEIPT",e.SENDING_RECEIPT_SUCCESS="SENDING_RECEIPT_SUCCESS",e.ERROR="ERROR"})(ca||(ca={}));var fa;(function(e){e.CAROUSEL="carousel",e.NORMAL="normal",e.IMAGE="image"})(fa||(fa={}));var ht;(function(e){e.GROUP="3e/group",e.PRODUCT="3e/product",e.CATEGORY="3e/group/category",e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.STATIC="3e/static",e.REF="3e/ref",e.QUERY="3e/query",e.CMS="3e/cms"})(ht||(ht={}));var da;(function(e){e.GROUP="group",e.PRODUCT="product"})(da||(da={}));var ga;(function(e){e.CREATOR="CREATOR",e.CUSTOMER="CUSTOMER",e.COUPONS="COUPON",e.KIOSK="KIOSK",e.WAITER="WAITER",e.MANAGER="MANAGER",e.VIEWER="VIEWER",e.DRIVER="DRIVER",e.STAFF="STAFF"})(ga||(ga={}));var pa;(function(e){e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.DINE_IN="DINE_IN",e.DINE_IN_OPEN="DINE_IN_OPEN",e.GLOVO_DELIVERY="GLOVO_DELIVERY",e.GLOVO_TAKE_AWAY="GLOVO_TAKE_AWAY",e.JUSTEAT_DELIVERY="JUSTEAT_DELIVERY",e.JUSTEAT_TAKE_AWAY="JUSTEAT_TAKE_AWAY",e.UBER_DELIVERY="UBER_DELIVERY",e.UBER_TAKE_AWAY="UBER_TAKE_AWAY",e.UBER_DINE_IN="UBER_DINE_IN",e.WOLT_DELIVERY="WOLT_DELIVERY",e.WOLT_TAKE_AWAY="WOLT_TAKE_AWAY",e.WOLT_DINE_IN="WOLT_DINE_IN",e.BOLT_DELIVERY="BOLT_DELIVERY",e.BOLT_TAKE_AWAY="BOLT_TAKE_AWAY",e.BOLT_DINE_IN="BOLT_DINE_IN",e.TAZZ_DELIVERY="TAZZ_DELIVERY",e.TAZZ_TAKE_AWAY="TAZZ_TAKE_AWAY",e.UPMENU_DELIVERY="UPMENU_DELIVERY",e.UPMENU_TAKE_AWAY="UPMENU_TAKE_AWAY",e.UPMENU_DINE_IN="UPMENU_DINE_IN"})(pa||(pa={}));var ha;(function(e){e.KIOSK="KIOSK",e.WEB="WEB",e.JUST_EAT_TAKE_AWAY="JUSTEATTAKEAWAY",e.GLOVO="GLOVO",e.PYSZNE="PYSZNE",e.WOLT="WOLT",e.UBER="UBER",e.BOLT="BOLT",e.TAZZ="TAZZ",e.POS="POS",e.UPMENU="UPMENU"})(ha||(ha={}));var ma;(function(e){e.DINE_IN="DINE_IN",e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.GLOVO="GLOVO",e.JUSTEAT="JUSTEAT",e.UBER="UBER",e.BOLT="BOLT",e.WOLT="WOLT",e.TAZZ="TAZZ",e.UPMENU="UPMENU"})(ma||(ma={}));var va;(function(e){e.NEW="NEW",e.COMPLETED="COMPLETED",e.VERIFIED="VERIFIED",e.DELIVER="DELIVER",e.DELIVERED="DELIVERED",e.CLOSED="CLOSED",e.ABANDONED="ABANDONED",e.CANCELLED="CANCELLED",e.PICKED="PICKED"})(va||(va={}));var ya;(function(e){e.CASH="CASH",e.CARD="CARD",e.COD="COD",e.TERMINAL="TERMINAL",e.EPAYMENT="EPAYMENT",e.COUPON="COUPON",e.WALLET="WALLET",e.PREAUTHORIZED="PREAUTHORIZED",e.RETURN="RETURN",e.EXTERNAL="EXTERNAL"})(ya||(ya={}));var ba;(function(e){e.POINTS_TOTAL="x-rbi-loyalty-points",e.POINTS_EARNED="x-rbi-points-earned",e.REWARDS="x-rbi-rewards",e.OFFERS="x-rbi-offers",e.CUSTOMER_NAME="x-customer-name"})(ba||(ba={}));var Sa;(function(e){e.NEW="NEW",e.TECHNICAL="TECHNICAL",e.CONFIRMED="CONFIRMED",e.PROCESSING="PROCESSING",e.PROCESSED="PROCESSED",e.VOID="VOID",e.WASTE="WASTE"})(Sa||(Sa={}));var Oa;(function(e){e.GROUP="group",e.PRODUCT="product"})(Oa||(Oa={}));var wa;(function(e){e.ORDER_EVENT_ERROR="OrderEventError",e.ORDER_APPLIED_EVENTS="OrderAppliedEvents",e.ORDER_EVENT_FISCAL="OrderEventFiscal",e.ORDER_UPSELL="OrderUpsell"})(wa||(wa={}));const rp=e=>e==="true"||e===!0,np=e=>{const t=document.getElementById(e);t?t.scrollIntoView({behavior:"smooth"}):console.warn(`Error: scrollToId: id: ${e} not found in html structure`)},ls=e=>`options--${e}`,cs=e=>{const{details:{media:t=[]}={}}=e,r=t.find(n=>n.name==="MAIN_IMG")||t[0]||{};return(r==null?void 0:r.url)||""},Ea=e=>{var r,n;return!(((r=e==null?void 0:e.attrs)==null?void 0:r.hidden)===!0||((n=e==null?void 0:e._)==null?void 0:n.hidden)==="true")};function fs(e,t){var r;if(!t.items)return null;for(let n=0;n<((r=t.items)==null?void 0:r.length);n++){const i=t.items[n];if(i.selCtx===e&&i.kind===ht.OPTIONS)return i;if(i.items&&i.items.length>0){const a=fs(e,i);if(a)return a}}return null}function ip(e){let t;const r=new Set,n=(f,c)=>{const l=typeof f=="function"?f(t):f;if(l!==t){const d=t;t=c?l:Object.assign({},t,l),r.forEach(g=>g(t,d))}},i=()=>t,a=(f,c=i,l=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=c(t);function g(){const p=c(t);if(!l(d,p)){const y=d;f(d=p,y)}}return r.add(g),()=>r.delete(g)},u={setState:n,getState:i,subscribe:(f,c,l)=>c||l?a(f,c,l):(r.add(f),()=>r.delete(f)),destroy:()=>r.clear()};return t=e(n,i,u),u}const ap=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),xa=ap?S.useEffect:S.useLayoutEffect;function op(e){const t=typeof e=="function"?ip(e):e,r=(n=t.getState,i=Object.is)=>{const[,a]=S.useReducer(v=>v+1,0),o=t.getState(),s=S.useRef(o),u=S.useRef(n),f=S.useRef(i),c=S.useRef(!1),l=S.useRef();l.current===void 0&&(l.current=n(o));let d,g=!1;(s.current!==o||u.current!==n||f.current!==i||c.current)&&(d=n(o),g=!i(l.current,d)),xa(()=>{g&&(l.current=d),s.current=o,u.current=n,f.current=i,c.current=!1});const p=S.useRef(o);xa(()=>{const v=()=>{try{const h=t.getState(),E=u.current(h);f.current(l.current,E)||(s.current=h,l.current=E,a())}catch{c.current=!0,a()}},b=t.subscribe(v);return t.getState()!==p.current&&v(),b},[]);const y=g?d:l.current;return S.useDebugValue(y),y};return Object.assign(r,t),r[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const n=[r,t];return{next(){const i=n.length<=0;return{value:n.shift(),done:i}}}},r}const sp=e=>({filter:{},initialSelected:{},setInitialFilter:t=>{e(()=>({filter:{...t}}))},setInitialSelected:t=>{e(()=>({initialSelected:t}))},setFilter:(t,r)=>{e(({filter:n})=>({filter:{...n,[t]:{...n[t],...r}}}))}}),up=(e,t)=>Pr(e,t,"isSelCntAllowedToIncrement")&&Pr(e,t,"isQtyCntAllowedToIncrement")&&Cn(e,t,"isQtyCntAllowedToIncrement")&&Cn(e,t,"isQtyCntAllowedToIncrement"),lp=(e,t,r)=>{var a;const{selCtx:n}=e;return((a=r==null?void 0:r[n])==null?void 0:a.parentKind)===Wn.PRODUCT?Pa(e,t)&&Pr(e,r,"isQtyCntAllowedToIncrement"):Pa(e,t)&&Pr(e,r,"isQtyCntAllowedToIncrement")&&Cn(e,r,"isQtyCntAllowedToIncrement")},Pa=(e,t)=>{const{qtyMax:r}=e;return Number(t)<Number(r||Number.MAX_SAFE_INTEGER)},Pr=(e,t,r)=>{var a;const{selCtx:n}=e,i=(a=t==null?void 0:t[n])==null?void 0:a[r];return ds(i)?!0:i},Cn=(e,t,r)=>{var s;const{selCtx:n}=e,i=(s=t==null?void 0:t[n])==null?void 0:s.parentSelCtx,a=t==null?void 0:t[i],o=a==null?void 0:a[r];return ds(o)?!0:o},ds=e=>typeof e=="undefined",cp=(e,t,r)=>{const n=t[e];let i=0,a=0;if(n)for(const[,o]of Object.entries(n))parseInt(o)>0&&(i+=1,a+=Number(o));else r&&r.forEach(o=>{if(t[o.selCtx])for(const[,s]of Object.entries(t[o.selCtx]))parseInt(s)>0&&(i+=1,a+=Number(s))});return[i,a]},fp=(e,t)=>{var i;const{id:r,selCtx:n}=e;return Number(((i=t==null?void 0:t[n])==null?void 0:i[r])||0)},dp=(e,t)=>({validationMap:{},isOnSubmitted:!1,currency:"z\u0142",refreshFormDt:"",setInitialValidate:()=>{e(()=>({validationMap:{},isOnSubmitted:!1}))},setValidationMap:r=>{const{productSelCtx:n,attrs:i,actualSelCnt:a,actualQtyCnt:o,isPassedFiltering:s,nestedLvl:u,parentSelCtx:f,parentKind:c}=r,{qtyMin:l,qtyMax:d,selMin:g,selMax:p}=i||{};(d||p)&&e(({validationMap:v})=>({validationMap:{...v,[n]:{parentSelCtx:f,isSelCntAllowedToIncrement:a<Number(p||Number.MAX_SAFE_INTEGER),isQtyCntAllowedToIncrement:o<Number(d||Number.MAX_SAFE_INTEGER),parentKind:c,nestedLvl:u,isValid:la(a,Number(g||0),Number(p||Number.MAX_SAFE_INTEGER)+1)&&la(o,Number(l||0),Number(d||Number.MAX_SAFE_INTEGER)+1),isPassedFiltering:s}}}))},isInputEnabled:r=>{const n=t().validationMap;return up(r,n)},isInputCounterIncrementEnabled:(r,n)=>{const i=t().validationMap,a=fp(r,n);return lp(r,a,i)},getInvalidSelCtxArray:()=>{const r=t().validationMap,n=[];for(const[i]of Object.entries(r)){const{isValid:a,isPassedFiltering:o}=r[i];a===!1&&o===!0&&n.push(i)}return n},setIsOnSubmittedOnTrue:()=>{console.log("isOnSubmitted"),e(()=>({isOnSubmitted:!0}))},getValidationMap:()=>t().validationMap,setCurrency:r=>{e(()=>({currency:r}))},refreshForm:()=>{e(()=>({refreshFormDt:`${new Date}`}))}}),gp=(e,t)=>({expanded:{},toggleExpanded:(r,n,i)=>{const a=t().expanded[r+n+i];e(()=>({expanded:{...t().expanded,[r+n+i]:a!==void 0?!a:!1}}))},resetExpanded:()=>{e(()=>({expanded:{}}))}}),ne=op((e,t)=>({...sp(e),...dp(e,t),...gp(e,t)}));function gs(e,t){if(!t)return null;for(const r of t){if(r.id===e)return r;if(r.items){const n=gs(e,r.items);if(n)return n}}return null}function pp(e,t){return gs(e,t)!==null}function hp(e,t){if(t==null||He(t))return{};try{const r=es(t);for(const[n,i]of Object.entries(r))i&&typeof i=="object"&&!Array.isArray(i)&&Object.keys(i).forEach(a=>{pp(a,e.items)||(console.warn(`deleting selected selCtx ${n} id ${a}, not found in product`),delete r[n][a])});return us(r)}catch(r){return console.error(r),t}}function mp(e){var b;const[t,r]=S.useState(Number(e.quantity)||1),n=qg(e),{state:{filter:i={}}={}}=n,a=hp(n,(b=n.state)==null?void 0:b.selected),o=ne(h=>h.setInitialFilter),s=ne(h=>h.setInitialSelected),u=ne(h=>h.setInitialValidate),f=ne(h=>h.resetExpanded),c=ne(h=>h.filter),l=ne(h=>h.setCurrency),d=ne(h=>h.setIsOnSubmittedOnTrue);ne(h=>h.refreshFormDt);const g=ne(h=>h.getInvalidSelCtxArray),p=ne(h=>h.getValidationMap),y=()=>{r(h=>h+1)},v=()=>{t>1&&r(h=>h-1)};return S.useEffect(()=>{u(),o(i),s(a),f()},[e]),{encodedProduct:n,initSelected:a,initFilter:i,filter:c,setCurrency:l,setIsOnSubmittedOnTrue:d,getInvalidSelCtxArray:g,productQuantity:t,getValidationMap:p,increaseProductQuantity:y,decreaseProductQuantity:v}}const ei=(e,t)=>{var o;const{filter:r={},fltCtx:n=""}=e,i=(t==null?void 0:t[n])||{};if(!r||!Object.keys(r).length||!i)return!0;const a=(o=Object.keys(i))==null?void 0:o.filter(s=>{var f;const u=(f=Object.keys((r==null?void 0:r[s])||{}))==null?void 0:f.filter(c=>{var l;if(((l=r==null?void 0:r[s])==null?void 0:l[c])===(i==null?void 0:i[s]))return!0});return(u==null?void 0:u.length)>0});return(a==null?void 0:a.length)>0},ps=(e,t)=>{const{items:r,filter:n}=e,i=[],a=[],o=s=>{s&&!He(n)&&s.forEach(u=>{const{items:f=[]}=u;t?i.push(u):a.push(u),f.length>0&&o(f)})};return o(r),{productsToSelect:i,productsToUnselect:a}},vp=(e,t)=>{console.log("LOG1 productsToUnselect",e),e.map(({selCtx:r,id:n})=>{t(`selected.${r}.${n}`,!1)})},hs=(e,t,r)=>{console.log("LOG1 productToSelect",e),e.map(({selCtx:n,id:i})=>{var o;const a=(o=r[n])==null?void 0:o[i];a&&t(`selected.${n}.${i}`,a.toString())})};function ms(e,t,r,n){const{selCtx:i,attrs:a={}}=e,o=ne(b=>b.initialSelected),s=ne(b=>b.currency),{setValue:u,getValues:f}=Ye(),{selected:c={},filter:l={}}=f(),d=ei(e,l),g=ne(b=>b.isOnSubmitted),p=ne(b=>b.setValidationMap),[y,v]=cp(e.selCtx,c,e.items);return p({productSelCtx:i,attrs:a,actualQtyCnt:v,actualSelCnt:y,nestedLvl:t,isPassedFiltering:d,parentSelCtx:n,parentKind:r}),S.useEffect(()=>{const{productsToSelect:b,productsToUnselect:h}=ps(e,d);hs(b,u,o)},[d]),{isFilterValidated:d,selected:c,isOnSubmitted:g,selCnt:y,qtyCnt:v,currency:s}}var Mr={exports:{}},kr={};/**
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var S=require("react"),oi=require("react-spring"),Ws=require("react-dom");function Gs(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var N=Gs(S);function Ie(e){return Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ie(e)}function Ae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zs(e,t){if(Ie(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ie(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Go(e){var t=zs(e,"string");return Ie(t)==="symbol"?t:String(t)}function ai(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Go(n.key),n)}}function Ce(e,t,r){return t&&ai(e.prototype,t),r&&ai(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gn(e,t){return gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},gn(e,t)}function Or(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gn(e,t)}function Gt(e,t){if(t&&(Ie(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xe(e)}function De(e){return De=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},De(e)}function Ue(e,t,r){return t=Go(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zo(e){if(Array.isArray(e))return e}function Ks(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function si(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 Ko(e,t){if(!!e){if(typeof e=="string")return si(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 si(e,t)}}function Yo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ys(e){return zo(e)||Ks(e)||Ko(e)||Yo()}function ui(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 li(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ui(Object(r),!0).forEach(function(n){Ue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ui(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Qs={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,r){console&&console[t]&&console[t].apply(console,r)}},qs=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ae(this,e),this.init(t,r)}return Ce(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=r||Qs,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(r){this.debug=r}},{key:"log",value:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return this.forward(n,"log","",!0)}},{key:"warn",value:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return this.forward(n,"warn","",!0)}},{key:"error",value:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return this.forward(n,"error","")}},{key:"deprecate",value:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(r,n,i,o){return o&&!this.debug?null:(typeof r[0]=="string"&&(r[0]="".concat(i).concat(this.prefix," ").concat(r[0])),this.logger[n](r))}},{key:"create",value:function(r){return new e(this.logger,li(li({},{prefix:"".concat(this.prefix,":").concat(r,":")}),this.options))}},{key:"clone",value:function(r){return r=r||this.options,r.prefix=r.prefix||this.prefix,new e(this.logger,r)}}]),e}(),Fe=new qs,et=function(){function e(){Ae(this,e),this.observers={}}return Ce(e,[{key:"on",value:function(r,n){var i=this;return r.split(" ").forEach(function(o){i.observers[o]=i.observers[o]||[],i.observers[o].push(n)}),this}},{key:"off",value:function(r,n){if(!!this.observers[r]){if(!n){delete this.observers[r];return}this.observers[r]=this.observers[r].filter(function(i){return i!==n})}}},{key:"emit",value:function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];if(this.observers[r]){var a=[].concat(this.observers[r]);a.forEach(function(u){u.apply(void 0,i)})}if(this.observers["*"]){var s=[].concat(this.observers["*"]);s.forEach(function(u){u.apply(u,[r].concat(i))})}}}]),e}();function Tt(){var e,t,r=new Promise(function(n,i){e=n,t=i});return r.resolve=e,r.reject=t,r}function ci(e){return e==null?"":""+e}function Js(e,t,r){e.forEach(function(n){t[n]&&(r[n]=t[n])})}function $n(e,t,r){function n(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=n(o.shift());!e[a]&&r&&(e[a]=new r),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:n(o.shift())}}function fi(e,t,r){var n=$n(e,t,Object),i=n.obj,o=n.k;i[o]=r}function Zs(e,t,r,n){var i=$n(e,t,Object),o=i.obj,a=i.k;o[a]=o[a]||[],n&&(o[a]=o[a].concat(r)),n||o[a].push(r)}function or(e,t){var r=$n(e,t),n=r.obj,i=r.k;if(!!n)return n[i]}function di(e,t,r){var n=or(e,r);return n!==void 0?n:or(t,r)}function Qo(e,t,r){for(var n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?r&&(e[n]=t[n]):Qo(e[n],t[n],r):e[n]=t[n]);return e}function ht(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Xs={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function eu(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return Xs[t]}):e}var wr=typeof window!="undefined"&&window.navigator&&typeof window.navigator.userAgentData=="undefined"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,tu=[" ",",","?","!",";"];function ru(e,t,r){t=t||"",r=r||"";var n=tu.filter(function(s){return t.indexOf(s)<0&&r.indexOf(s)<0});if(n.length===0)return!0;var i=new RegExp("(".concat(n.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(r);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function gi(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 Qt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gi(Object(r),!0).forEach(function(n){Ue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nu(e){var t=iu();return function(){var n=De(e),i;if(t){var o=De(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Gt(this,i)}}function iu(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qo(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!e){if(e[t])return e[t];for(var n=t.split(r),i=e,o=0;o<n.length;++o){if(!i||typeof i[n[o]]=="string"&&o+1<n.length)return;if(i[n[o]]===void 0){for(var a=2,s=n.slice(o,o+a).join(r),u=i[s];u===void 0&&n.length>o+a;)a++,s=n.slice(o,o+a).join(r),u=i[s];if(u===void 0)return;if(u===null)return null;if(t.endsWith(s)){if(typeof u=="string")return u;if(s&&typeof u[s]=="string")return u[s]}var l=n.slice(o+a).join(r);return l?qo(u,l,r):void 0}i=i[n[o]]}return i}}var ou=function(e){Or(r,e);var t=nu(r);function r(n){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Ae(this,r),i=t.call(this),wr&&et.call(Xe(i)),i.data=n||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return Ce(r,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,l=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,f=[i,o];a&&typeof a!="string"&&(f=f.concat(a)),a&&typeof a=="string"&&(f=f.concat(u?a.split(u):a)),i.indexOf(".")>-1&&(f=i.split("."));var c=or(this.data,f);return c||!l||typeof a!="string"?c:qo(this.data&&this.data[i]&&this.data[i][o],a,u)}},{key:"addResource",value:function(i,o,a,s){var u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},l=this.options.keySeparator;l===void 0&&(l=".");var f=[i,o];a&&(f=f.concat(l?a.split(l):a)),i.indexOf(".")>-1&&(f=i.split("."),s=o,o=f[1]),this.addNamespaces(o),fi(this.data,f,s),u.silent||this.emit("added",i,o,a,s)}},{key:"addResources",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var u in a)(typeof a[u]=="string"||Object.prototype.toString.apply(a[u])==="[object Array]")&&this.addResource(i,o,u,a[u],{silent:!0});s.silent||this.emit("added",i,o,a)}},{key:"addResourceBundle",value:function(i,o,a,s,u){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},f=[i,o];i.indexOf(".")>-1&&(f=i.split("."),s=a,a=o,o=f[1]),this.addNamespaces(o);var c=or(this.data,f)||{};s?Qo(c,a,u):c=Qt(Qt({},c),a),fi(this.data,f,c),l.silent||this.emit("added",i,o,a)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Qt(Qt({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),a=o&&Object.keys(o)||[];return!!a.find(function(s){return o[s]&&Object.keys(o[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),r}(et),Jo={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,r,n,i,o){var a=this;return t.forEach(function(s){a.processors[s]&&(r=a.processors[s].process(r,n,i,o))}),r}};function pi(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 me(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pi(Object(r),!0).forEach(function(n){Ue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function au(e){var t=su();return function(){var n=De(e),i;if(t){var o=De(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Gt(this,i)}}function su(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var hi={},mi=function(e){Or(r,e);var t=au(r);function r(n){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ae(this,r),i=t.call(this),wr&&et.call(Xe(i)),Js(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,Xe(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Fe.create("translator"),i}return Ce(r,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var a=this.resolve(i,o);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(i,o){var a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=o.ns||this.options.defaultNS||[],l=a&&i.indexOf(a)>-1,f=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!ru(i,a,s);if(l&&!f){var c=i.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:i,namespaces:u};var g=i.split(a);(a!==s||a===s&&this.options.ns.indexOf(g[0])>-1)&&(u=g.shift()),i=g.join(s)}return typeof u=="string"&&(u=[u]),{key:i,namespaces:u}}},{key:"translate",value:function(i,o,a){var s=this;if(Ie(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var u=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,l=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,f=this.extractFromKey(i[i.length-1],o),c=f.key,g=f.namespaces,d=g[g.length-1],p=o.lng||this.language,y=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(y){var b=o.nsSeparator||this.options.nsSeparator;return u?(h.res="".concat(d).concat(b).concat(c),h):"".concat(d).concat(b).concat(c)}return u?(h.res=c,h):c}var h=this.resolve(i,o),v=h&&h.res,P=h&&h.usedKey||c,E=h&&h.exactUsedKey||c,w=Object.prototype.toString.apply(v),C=["[object Number]","[object Function]","[object RegExp]"],T=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,R=!this.i18nFormat||this.i18nFormat.handleAsObject,F=typeof v!="string"&&typeof v!="boolean"&&typeof v!="number";if(R&&v&&F&&C.indexOf(w)<0&&!(typeof T=="string"&&w==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var j=this.options.returnedObjectHandler?this.options.returnedObjectHandler(P,v,me(me({},o),{},{ns:g})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return u?(h.res=j,h):j}if(l){var L=w==="[object Array]",D=L?[]:{},V=L?E:P;for(var H in v)if(Object.prototype.hasOwnProperty.call(v,H)){var Z="".concat(V).concat(l).concat(H);D[H]=this.translate(Z,me(me({},o),{joinArrays:!1,ns:g})),D[H]===Z&&(D[H]=v[H])}v=D}}else if(R&&typeof T=="string"&&w==="[object Array]")v=v.join(T),v&&(v=this.extendTranslation(v,i,o,a));else{var G=!1,X=!1,W=o.count!==void 0&&typeof o.count!="string",ie=r.hasDefaultValue(o),U=W?this.pluralResolver.getSuffix(p,o.count,o):"",ne=o["defaultValue".concat(U)]||o.defaultValue;!this.isValidLookup(v)&&ie&&(G=!0,v=ne),this.isValidLookup(v)||(X=!0,v=c);var ye=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,le=ye&&X?void 0:v,fe=ie&&ne!==v&&this.options.updateMissing;if(X||G||fe){if(this.logger.log(fe?"updateKey":"missingKey",p,d,c,fe?ne:v),l){var Te=this.resolve(c,me(me({},o),{},{keySeparator:!1}));Te&&Te.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var ee=[],Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(var ae=0;ae<Y.length;ae++)ee.push(Y[ae]);else this.options.saveMissingTo==="all"?ee=this.languageUtils.toResolveHierarchy(o.lng||this.language):ee.push(o.lng||this.language);var de=function(be,Be,nt){var m=ie&&nt!==v?nt:le;s.options.missingKeyHandler?s.options.missingKeyHandler(be,d,Be,m,fe,o):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(be,d,Be,m,fe,o),s.emit("missingKey",be,d,Be,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&W?ee.forEach(function(he){s.pluralResolver.getSuffixes(he,o).forEach(function(be){de([he],c+be,o["defaultValue".concat(be)]||ne)})}):de(ee,c,ne))}v=this.extendTranslation(v,i,o,h,a),X&&v===c&&this.options.appendNamespaceToMissingKey&&(v="".concat(d,":").concat(c)),(X||G)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?v=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(d,":").concat(c):c,G?v:void 0):v=this.options.parseMissingKeyHandler(v))}return u?(h.res=v,h):v}},{key:"extendTranslation",value:function(i,o,a,s,u){var l=this;if(this.i18nFormat&&this.i18nFormat.parse)i=this.i18nFormat.parse(i,me(me({},this.options.interpolation.defaultVariables),a),s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init(me(me({},a),{interpolation:me(me({},this.options.interpolation),a.interpolation)}));var f=typeof i=="string"&&(a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),c;if(f){var g=i.match(this.interpolator.nestingRegexp);c=g&&g.length}var d=a.replace&&typeof a.replace!="string"?a.replace:a;if(this.options.interpolation.defaultVariables&&(d=me(me({},this.options.interpolation.defaultVariables),d)),i=this.interpolator.interpolate(i,d,a.lng||this.language,a),f){var p=i.match(this.interpolator.nestingRegexp),y=p&&p.length;c<y&&(a.nest=!1)}a.nest!==!1&&(i=this.interpolator.nest(i,function(){for(var v=arguments.length,P=new Array(v),E=0;E<v;E++)P[E]=arguments[E];return u&&u[0]===P[0]&&!a.context?(l.logger.warn("It seems you are nesting recursively key: ".concat(P[0]," in key: ").concat(o[0])),null):l.translate.apply(l,P.concat([o]))},a)),a.interpolation&&this.interpolator.reset()}var b=a.postProcess||this.options.postProcess,h=typeof b=="string"?[b]:b;return i!=null&&h&&h.length&&a.applyPostProcessor!==!1&&(i=Jo.handle(h,i,o,this.options&&this.options.postProcessPassResolved?me({i18nResolved:s},a):a,this)),i}},{key:"resolve",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,u,l,f,c;return typeof i=="string"&&(i=[i]),i.forEach(function(g){if(!o.isValidLookup(s)){var d=o.extractFromKey(g,a),p=d.key;u=p;var y=d.namespaces;o.options.fallbackNS&&(y=y.concat(o.options.fallbackNS));var b=a.count!==void 0&&typeof a.count!="string",h=b&&!a.ordinal&&a.count===0&&o.pluralResolver.shouldUseIntlApi(),v=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",P=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);y.forEach(function(E){o.isValidLookup(s)||(c=E,!hi["".concat(P[0],"-").concat(E)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(c)&&(hi["".concat(P[0],"-").concat(E)]=!0,o.logger.warn('key "'.concat(u,'" for languages "').concat(P.join(", "),`" won't get resolved as namespace "`).concat(c,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),P.forEach(function(w){if(!o.isValidLookup(s)){f=w;var C=[p];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(C,p,w,E,a);else{var T;b&&(T=o.pluralResolver.getSuffix(w,a.count,a));var R="".concat(o.options.pluralSeparator,"zero");if(b&&(C.push(p+T),h&&C.push(p+R)),v){var F="".concat(p).concat(o.options.contextSeparator).concat(a.context);C.push(F),b&&(C.push(F+T),h&&C.push(F+R))}}for(var j;j=C.pop();)o.isValidLookup(s)||(l=j,s=o.getResource(w,E,j,a))}}))})}}),{res:s,usedKey:u,exactUsedKey:l,usedLng:f,usedNS:c}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,a,s):this.resourceStore.getResource(i,o,a,s)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&o===a.substring(0,o.length)&&i[a]!==void 0)return!0;return!1}}]),r}(et);function Br(e){return e.charAt(0).toUpperCase()+e.slice(1)}var uu=function(){function e(t){Ae(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Fe.create("languageUtils")}return Ce(e,[{key:"getScriptPartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return null;var n=r.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return r;var n=r.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(r){if(typeof r=="string"&&r.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],i=r.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=Br(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=Br(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=Br(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?r.toLowerCase():r}},{key:"isSupportedCode",value:function(r){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(r=this.getLanguagePartFromCode(r)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(r)>-1}},{key:"getBestMatchFromCodes",value:function(r){var n=this;if(!r)return null;var i;return r.forEach(function(o){if(!i){var a=n.formatLanguageCode(o);(!n.options.supportedLngs||n.isSupportedCode(a))&&(i=a)}}),!i&&this.options.supportedLngs&&r.forEach(function(o){if(!i){var a=n.getLanguagePartFromCode(o);if(n.isSupportedCode(a))return i=a;i=n.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(r,n){if(!r)return[];if(typeof r=="function"&&(r=r(n)),typeof r=="string"&&(r=[r]),Object.prototype.toString.apply(r)==="[object Array]")return r;if(!n)return r.default||[];var i=r[n];return i||(i=r[this.getScriptPartFromCode(n)]),i||(i=r[this.formatLanguageCode(n)]),i||(i=r[this.getLanguagePartFromCode(n)]),i||(i=r.default),i||[]}},{key:"toResolveHierarchy",value:function(r,n){var i=this,o=this.getFallbackCodes(n||this.options.fallbackLng||[],r),a=[],s=function(l){!l||(i.isSupportedCode(l)?a.push(l):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(l)))};return typeof r=="string"&&r.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(r)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(r)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(r))):typeof r=="string"&&s(this.formatLanguageCode(r)),o.forEach(function(u){a.indexOf(u)<0&&s(i.formatLanguageCode(u))}),a}}]),e}(),lu=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],cu={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},fu=["v1","v2","v3"],vi={zero:0,one:1,two:2,few:3,many:4,other:5};function du(){var e={};return lu.forEach(function(t){t.lngs.forEach(function(r){e[r]={numbers:t.nr,plurals:cu[t.fc]}})}),e}var gu=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ae(this,e),this.languageUtils=t,this.options=r,this.logger=Fe.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=du()}return Ce(e,[{key:"addRule",value:function(r,n){this.rules[r]=n}},{key:"getRule",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(r,{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[r]||this.rules[this.languageUtils.getLanguagePartFromCode(r)]}},{key:"needsPlural",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(r,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(r,i).map(function(o){return"".concat(n).concat(o)})}},{key:"getSuffixes",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(r,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(a,s){return vi[a]-vi[s]}).map(function(a){return"".concat(n.options.prepend).concat(a)}):o.numbers.map(function(a){return n.getSuffix(r,a,i)}):[]}},{key:"getSuffix",value:function(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(r,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(n)):this.getSuffixRetroCompatible(o,n):(this.logger.warn("no plural rule found for: ".concat(r)),"")}},{key:"getSuffixRetroCompatible",value:function(r,n){var i=this,o=r.noAbs?r.plurals(n):r.plurals(Math.abs(n)),a=r.numbers[o];this.options.simplifyPluralSuffix&&r.numbers.length===2&&r.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return i.options.prepend&&a.toString()?i.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&r.numbers.length===2&&r.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!fu.includes(this.options.compatibilityJSON)}}]),e}();function yi(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 Ne(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yi(Object(r),!0).forEach(function(n){Ue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var pu=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ae(this,e),this.logger=Fe.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(r){return r},this.init(t)}return Ce(e,[{key:"init",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r.interpolation||(r.interpolation={escapeValue:!0});var n=r.interpolation;this.escape=n.escape!==void 0?n.escape:eu,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?ht(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?ht(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?ht(n.nestingPrefix):n.nestingPrefixEscaped||ht("$t("),this.nestingSuffix=n.nestingSuffix?ht(n.nestingSuffix):n.nestingSuffixEscaped||ht(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var r="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(r,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(n,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(r,n,i,o){var a=this,s,u,l,f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(b){return b.replace(/\$/g,"$$$$")}var g=function(h){if(h.indexOf(a.formatSeparator)<0){var v=di(n,f,h);return a.alwaysFormat?a.format(v,void 0,i,Ne(Ne(Ne({},o),n),{},{interpolationkey:h})):v}var P=h.split(a.formatSeparator),E=P.shift().trim(),w=P.join(a.formatSeparator).trim();return a.format(di(n,f,E),w,i,Ne(Ne(Ne({},o),n),{},{interpolationkey:E}))};this.resetRegExp();var d=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,p=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,y=[{regex:this.regexpUnescape,safeValue:function(h){return c(h)}},{regex:this.regexp,safeValue:function(h){return a.escapeValue?c(a.escape(h)):c(h)}}];return y.forEach(function(b){for(l=0;s=b.regex.exec(r);){var h=s[1].trim();if(u=g(h),u===void 0)if(typeof d=="function"){var v=d(r,s,o);u=typeof v=="string"?v:""}else if(o&&o.hasOwnProperty(h))u="";else if(p){u=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(h," for interpolating ").concat(r)),u="";else typeof u!="string"&&!a.useRawValueToEscape&&(u=ci(u));var P=b.safeValue(u);if(r=r.replace(s[0],P),p?(b.regex.lastIndex+=u.length,b.regex.lastIndex-=s[0].length):b.regex.lastIndex=0,l++,l>=a.maxReplaces)break}}),r}},{key:"nest",value:function(r,n){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,u=Ne({},o);u.applyPostProcessor=!1,delete u.defaultValue;function l(d,p){var y=this.nestingOptionsSeparator;if(d.indexOf(y)<0)return d;var b=d.split(new RegExp("".concat(y,"[ ]*{"))),h="{".concat(b[1]);d=b[0],h=this.interpolate(h,u);var v=h.match(/'/g),P=h.match(/"/g);(v&&v.length%2===0&&!P||P.length%2!==0)&&(h=h.replace(/'/g,'"'));try{u=JSON.parse(h),p&&(u=Ne(Ne({},p),u))}catch(E){return this.logger.warn("failed parsing options string in nesting for key ".concat(d),E),"".concat(d).concat(y).concat(h)}return delete u.defaultValue,d}for(;a=this.nestingRegexp.exec(r);){var f=[],c=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var g=a[1].split(this.formatSeparator).map(function(d){return d.trim()});a[1]=g.shift(),f=g,c=!0}if(s=n(l.call(this,a[1].trim(),u),u),s&&a[0]===r&&typeof s!="string")return s;typeof s!="string"&&(s=ci(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(r)),s=""),c&&(s=f.reduce(function(d,p){return i.format(d,p,o.lng,Ne(Ne({},o),{},{interpolationkey:a[1].trim()}))},s.trim())),r=r.replace(a[0],s),this.regexp.lastIndex=0}return r}}]),e}();function bi(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 qe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bi(Object(r),!0).forEach(function(n){Ue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hu(e){var t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){var n=e.split("(");t=n[0].toLowerCase().trim();var i=n[1].substring(0,n[1].length-1);if(t==="currency"&&i.indexOf(":")<0)r.currency||(r.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)r.range||(r.range=i.trim());else{var o=i.split(";");o.forEach(function(a){if(!!a){var s=a.split(":"),u=Ys(s),l=u[0],f=u.slice(1),c=f.join(":").trim().replace(/^'+|'+$/g,"");r[l.trim()]||(r[l.trim()]=c),c==="false"&&(r[l.trim()]=!1),c==="true"&&(r[l.trim()]=!0),isNaN(c)||(r[l.trim()]=parseInt(c,10))}})}}return{formatName:t,formatOptions:r}}function mt(e){var t={};return function(n,i,o){var a=i+JSON.stringify(o),s=t[a];return s||(s=e(i,o),t[a]=s),s(n)}}var mu=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ae(this,e),this.logger=Fe.create("formatter"),this.options=t,this.formats={number:mt(function(r,n){var i=new Intl.NumberFormat(r,n);return function(o){return i.format(o)}}),currency:mt(function(r,n){var i=new Intl.NumberFormat(r,qe(qe({},n),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:mt(function(r,n){var i=new Intl.DateTimeFormat(r,qe({},n));return function(o){return i.format(o)}}),relativetime:mt(function(r,n){var i=new Intl.RelativeTimeFormat(r,qe({},n));return function(o){return i.format(o,n.range||"day")}}),list:mt(function(r,n){var i=new Intl.ListFormat(r,qe({},n));return function(o){return i.format(o)}})},this.init(t)}return Ce(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=n.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(r,n){this.formats[r.toLowerCase().trim()]=n}},{key:"addCached",value:function(r,n){this.formats[r.toLowerCase().trim()]=mt(n)}},{key:"format",value:function(r,n,i,o){var a=this,s=n.split(this.formatSeparator),u=s.reduce(function(l,f){var c=hu(f),g=c.formatName,d=c.formatOptions;if(a.formats[g]){var p=l;try{var y=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},b=y.locale||y.lng||o.locale||o.lng||i;p=a.formats[g](l,b,qe(qe(qe({},d),o),y))}catch(h){a.logger.warn(h)}return p}else a.logger.warn("there was no format function for ".concat(g));return l},r);return u}}]),e}();function Si(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 Oi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Si(Object(r),!0).forEach(function(n){Ue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Si(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vu(e){var t=yu();return function(){var n=De(e),i;if(t){var o=De(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Gt(this,i)}}function yu(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function bu(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var Su=function(e){Or(r,e);var t=vu(r);function r(n,i,o){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Ae(this,r),a=t.call(this),wr&&et.call(Xe(a)),a.backend=n,a.store=i,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=Fe.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return Ce(r,[{key:"queueLoad",value:function(i,o,a,s){var u=this,l={},f={},c={},g={};return i.forEach(function(d){var p=!0;o.forEach(function(y){var b="".concat(d,"|").concat(y);!a.reload&&u.store.hasResourceBundle(d,y)?u.state[b]=2:u.state[b]<0||(u.state[b]===1?f[b]===void 0&&(f[b]=!0):(u.state[b]=1,p=!1,f[b]===void 0&&(f[b]=!0),l[b]===void 0&&(l[b]=!0),g[y]===void 0&&(g[y]=!0)))}),p||(c[d]=!0)}),(Object.keys(l).length||Object.keys(f).length)&&this.queue.push({pending:f,pendingCount:Object.keys(f).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(l),pending:Object.keys(f),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(g)}}},{key:"loaded",value:function(i,o,a){var s=i.split("|"),u=s[0],l=s[1];o&&this.emit("failedLoading",u,l,o),a&&this.store.addResourceBundle(u,l,a),this.state[i]=o?-1:2;var f={};this.queue.forEach(function(c){Zs(c.loaded,[u],l),bu(c,i),o&&c.errors.push(o),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(function(g){f[g]||(f[g]={});var d=c.loaded[g];d.length&&d.forEach(function(p){f[g][p]===void 0&&(f[g][p]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(function(c){return!c.done})}},{key:"read",value:function(i,o,a){var s=this,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,f=arguments.length>5?arguments[5]:void 0;if(!i.length)return f(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:a,tried:u,wait:l,callback:f});return}return this.readingCalls++,this.backend[a](i,o,function(c,g){if(s.readingCalls--,s.waitingReads.length>0){var d=s.waitingReads.shift();s.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&g&&u<s.maxRetries){setTimeout(function(){s.read.call(s,i,o,a,u+1,l*2,f)},l);return}f(c,g)})}},{key:"prepareLoading",value:function(i,o){var a=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),u&&u();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var l=this.queueLoad(i,o,s,u);if(!l.toLoad.length)return l.pending.length||u(),null;l.toLoad.forEach(function(f){a.loadOne(f)})}},{key:"load",value:function(i,o,a){this.prepareLoading(i,o,{},a)}},{key:"reload",value:function(i,o,a){this.prepareLoading(i,o,{reload:!0},a)}},{key:"loadOne",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),u=s[0],l=s[1];this.read(u,l,"read",void 0,void 0,function(f,c){f&&o.logger.warn("".concat(a,"loading namespace ").concat(l," for language ").concat(u," failed"),f),!f&&c&&o.logger.log("".concat(a,"loaded namespace ").concat(l," for language ").concat(u),c),o.loaded(i,f,c)})}},{key:"saveMissing",value:function(i,o,a,s,u){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}a==null||a===""||(this.backend&&this.backend.create&&this.backend.create(i,o,a,s,null,Oi(Oi({},l),{},{isUpdate:u})),!(!i||!i[0])&&this.store.addResource(i[0],o,a,s))}}]),r}(et);function Ou(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var r={};if(Ie(t[1])==="object"&&(r=t[1]),typeof t[1]=="string"&&(r.defaultValue=t[1]),typeof t[2]=="string"&&(r.tDescription=t[2]),Ie(t[2])==="object"||Ie(t[3])==="object"){var n=t[3]||t[2];Object.keys(n).forEach(function(i){r[i]=n[i]})}return r},interpolation:{escapeValue:!0,format:function(t,r,n,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function wi(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Ei(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 Le(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ei(Object(r),!0).forEach(function(n){Ue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ei(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wu(e){var t=Eu();return function(){var n=De(e),i;if(t){var o=De(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Gt(this,i)}}function Eu(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qt(){}function Pu(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(r){typeof e[r]=="function"&&(e[r]=e[r].bind(e))})}var ar=function(e){Or(r,e);var t=wu(r);function r(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(Ae(this,r),n=t.call(this),wr&&et.call(Xe(n)),n.options=wi(i),n.services={},n.logger=Fe,n.modules={external:[]},Pu(Xe(n)),o&&!n.isInitialized&&!i.isClone){if(!n.options.initImmediate)return n.init(i,o),Gt(n,Xe(n));setTimeout(function(){n.init(i,o)},0)}return n}return Ce(r,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(a=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var s=Ou();this.options=Le(Le(Le({},s),this.options),wi(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Le(Le({},s.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function u(h){return h?typeof h=="function"?new h:h:null}if(!this.options.isClone){this.modules.logger?Fe.init(u(this.modules.logger),this.options):Fe.init(null,this.options);var l;this.modules.formatter?l=this.modules.formatter:typeof Intl!="undefined"&&(l=mu);var f=new uu(this.options);this.store=new ou(this.options.resources,this.options);var c=this.services;c.logger=Fe,c.resourceStore=this.store,c.languageUtils=f,c.pluralResolver=new gu(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(c.formatter=u(l),c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new pu(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new Su(u(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",function(h){for(var v=arguments.length,P=new Array(v>1?v-1:0),E=1;E<v;E++)P[E-1]=arguments[E];i.emit.apply(i,[h].concat(P))}),this.modules.languageDetector&&(c.languageDetector=u(this.modules.languageDetector),c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=u(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new mi(this.services,this.options),this.translator.on("*",function(h){for(var v=arguments.length,P=new Array(v>1?v-1:0),E=1;E<v;E++)P[E-1]=arguments[E];i.emit.apply(i,[h].concat(P))}),this.modules.external.forEach(function(h){h.init&&h.init(i)})}if(this.format=this.options.interpolation.format,a||(a=qt),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var g=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);g.length>0&&g[0]!=="dev"&&(this.options.lng=g[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var d=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];d.forEach(function(h){i[h]=function(){var v;return(v=i.store)[h].apply(v,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(h){i[h]=function(){var v;return(v=i.store)[h].apply(v,arguments),i}});var y=Tt(),b=function(){var v=function(E,w){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),y.resolve(w),a(E,w)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return v(null,i.t.bind(i));i.changeLanguage(i.options.lng,v)};return this.options.resources||!this.options.initImmediate?b():setTimeout(b,0),y}},{key:"loadResources",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:qt,s=a,u=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(u&&u.toLowerCase()==="cimode")return s();var l=[],f=function(d){if(!!d){var p=o.services.languageUtils.toResolveHierarchy(d);p.forEach(function(y){l.indexOf(y)<0&&l.push(y)})}};if(u)f(u);else{var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.forEach(function(g){return f(g)})}this.options.preload&&this.options.preload.forEach(function(g){return f(g)}),this.services.backendConnector.load(l,this.options.ns,function(g){!g&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),s(g)})}else s(null)}},{key:"reloadResources",value:function(i,o,a){var s=Tt();return i||(i=this.languages),o||(o=this.options.ns),a||(a=qt),this.services.backendConnector.reload(i,o,function(u){s.resolve(),a(u)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&Jo.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o<this.languages.length;o++){var a=this.languages[o];if(!(["cimode","dev"].indexOf(a)>-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(i,o){var a=this;this.isLanguageChangingTo=i;var s=Tt();this.emit("languageChanging",i);var u=function(g){a.language=g,a.languages=a.services.languageUtils.toResolveHierarchy(g),a.resolvedLanguage=void 0,a.setResolvedLanguage(g)},l=function(g,d){d?(u(d),a.translator.changeLanguage(d),a.isLanguageChangingTo=void 0,a.emit("languageChanged",d),a.logger.log("languageChanged",d)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),o&&o(g,function(){return a.t.apply(a,arguments)})},f=function(g){!i&&!g&&a.services.languageDetector&&(g=[]);var d=typeof g=="string"?g:a.services.languageUtils.getBestMatchFromCodes(g);d&&(a.language||u(d),a.translator.language||a.translator.changeLanguage(d),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage(d)),a.loadResources(d,function(p){l(p,d)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(f):f(i),s}},{key:"getFixedT",value:function(i,o,a){var s=this,u=function l(f,c){var g;if(Ie(c)!=="object"){for(var d=arguments.length,p=new Array(d>2?d-2:0),y=2;y<d;y++)p[y-2]=arguments[y];g=s.options.overloadTranslationOptionHandler([f,c].concat(p))}else g=Le({},c);g.lng=g.lng||l.lng,g.lngs=g.lngs||l.lngs,g.ns=g.ns||l.ns,g.keyPrefix=g.keyPrefix||a||l.keyPrefix;var b=s.options.keySeparator||".",h=g.keyPrefix?"".concat(g.keyPrefix).concat(b).concat(f):f;return s.t(h,g)};return typeof i=="string"?u.lng=i:u.lngs=i,u.ns=o,u.keyPrefix=a,u}},{key:"t",value:function(){var i;return this.translator&&(i=this.translator).translate.apply(i,arguments)}},{key:"exists",value:function(){var i;return this.translator&&(i=this.translator).exists.apply(i,arguments)}},{key:"setDefaultNamespace",value:function(i){this.options.defaultNS=i}},{key:"hasLoadedNamespace",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],u=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var f=function(d,p){var y=o.services.backendConnector.state["".concat(d,"|").concat(p)];return y===-1||y===2};if(a.precheck){var c=a.precheck(this,f);if(c!==void 0)return c}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||f(s,i)&&(!u||f(l,i)))}},{key:"loadNamespaces",value:function(i,o){var a=this,s=Tt();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(u){a.options.ns.indexOf(u)<0&&a.options.ns.push(u)}),this.loadResources(function(u){s.resolve(),o&&o(u)}),s):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var a=Tt();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],u=i.filter(function(l){return s.indexOf(l)<0});return u.length?(this.options.preload=s.concat(u),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:qt,s=Le(Le(Le({},this.options),o),{isClone:!0}),u=new r(s);(o.debug!==void 0||o.prefix!==void 0)&&(u.logger=u.logger.clone(o));var l=["store","services","language"];return l.forEach(function(f){u[f]=i[f]}),u.services=Le({},this.services),u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u.translator=new mi(u.services,u.options),u.translator.on("*",function(f){for(var c=arguments.length,g=new Array(c>1?c-1:0),d=1;d<c;d++)g[d-1]=arguments[d];u.emit.apply(u,[f].concat(g))}),u.init(s,a),u.translator.options=u.options,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(et);Ue(ar,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ar(e,t)});var pe=ar.createInstance();pe.createInstance=ar.createInstance;pe.createInstance;pe.init;pe.loadResources;pe.reloadResources;pe.use;pe.changeLanguage;pe.getFixedT;pe.t;pe.exists;pe.setDefaultNamespace;pe.hasLoadedNamespace;pe.loadNamespaces;pe.loadLanguages;var zt=e=>e.type==="checkbox",bt=e=>e instanceof Date,ve=e=>e==null;const Zo=e=>typeof e=="object";var ue=e=>!ve(e)&&!Array.isArray(e)&&Zo(e)&&!bt(e),Xo=e=>ue(e)&&e.target?zt(e.target)?e.target.checked:e.target.value:e,xu=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,ea=(e,t)=>e.has(xu(t)),xt=e=>Array.isArray(e)?e.filter(Boolean):[],J=e=>e===void 0,I=(e,t,r)=>{if(!t||!ue(e))return r;const n=xt(t.split(/[,[\].]+?/)).reduce((i,o)=>ve(i)?i:i[o],e);return J(n)||n===e?J(e[t])?r:e[t]:n};const sr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Pe={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},He={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ta=N.default.createContext(null),Ke=()=>N.default.useContext(ta),ra=e=>{const{children:t,...r}=e;return N.default.createElement(ta.Provider,{value:r},t)};var na=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const a=o;return t._proxyFormState[a]!==Pe.all&&(t._proxyFormState[a]=!n||Pe.all),r&&(r[a]=!0),e[a]}});return i},Se=e=>ue(e)&&!Object.keys(e).length,ia=(e,t,r)=>{const{name:n,...i}=e;return Se(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!r||Pe.all))},we=e=>Array.isArray(e)?e:[e],oa=(e,t,r)=>r&&t?e===t:!e||!t||e===t||we(e).some(n=>n&&(n.startsWith(t)||t.startsWith(n)));function Er(e){const t=N.default.useRef(e);t.current=e,N.default.useEffect(()=>{const r=!e.disabled&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function aa(e){const t=Ke(),{control:r=t.control,disabled:n,name:i,exact:o}=e||{},[a,s]=N.default.useState(r._formState),u=N.default.useRef(!0),l=N.default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=N.default.useRef(i);return f.current=i,Er({disabled:n,next:c=>u.current&&oa(f.current,c.name,o)&&ia(c,l.current)&&s({...r._formState,...c}),subject:r._subjects.state}),N.default.useEffect(()=>{u.current=!0;const c=r._proxyFormState.isDirty&&r._getDirty();return c!==r._formState.isDirty&&r._subjects.state.next({isDirty:c}),r._updateValid(),()=>{u.current=!1}},[r]),na(a,r,l.current,!1)}var ke=e=>typeof e=="string",sa=(e,t,r,n,i)=>ke(e)?(n&&t.watch.add(e),I(r,e,i)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),I(r,o))):(n&&(t.watchAll=!0),r),Au=e=>{const t=e.constructor&&e.constructor.prototype;return ue(t)&&t.hasOwnProperty("isPrototypeOf")},Rn=typeof window!="undefined"&&typeof window.HTMLElement!="undefined"&&typeof document!="undefined";function Oe(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Rn&&(e instanceof Blob||e instanceof FileList))&&(r||ue(e)))if(t=r?[]:{},!Array.isArray(e)&&!Au(e))t=e;else for(const n in e)t[n]=Oe(e[n]);else return e;return t}function ur(e){const t=Ke(),{control:r=t.control,name:n,defaultValue:i,disabled:o,exact:a}=e||{},s=N.default.useRef(n);s.current=n,Er({disabled:o,subject:r._subjects.watch,next:f=>{oa(s.current,f.name,a)&&l(Oe(sa(s.current,r._names,f.values||r._formValues,!1,i)))}});const[u,l]=N.default.useState(r._getWatch(n,i));return N.default.useEffect(()=>r._removeUnmounted()),u}function ua(e){const t=Ke(),{name:r,control:n=t.control,shouldUnregister:i}=e,o=ea(n._names.array,r),a=ur({control:n,name:r,defaultValue:I(n._formValues,r,I(n._defaultValues,r,e.defaultValue)),exact:!0}),s=aa({control:n,name:r}),u=N.default.useRef(n.register(r,{...e.rules,value:a}));return N.default.useEffect(()=>{const l=(f,c)=>{const g=I(n._fields,f);g&&(g._f.mount=c)};return l(r,!0),()=>{const f=n._options.shouldUnregister||i;(o?f&&!n._stateFlags.action:f)?n.unregister(r):l(r,!1)}},[r,n,o,i]),{field:{name:r,value:a,onChange:N.default.useCallback(l=>u.current.onChange({target:{value:Xo(l),name:r},type:sr.CHANGE}),[r]),onBlur:N.default.useCallback(()=>u.current.onBlur({target:{value:I(n._formValues,r),name:r},type:sr.BLUR}),[r,n]),ref:l=>{const f=I(n._fields,r);f&&l&&(f._f.ref={focus:()=>l.focus(),select:()=>l.select(),setCustomValidity:c=>l.setCustomValidity(c),reportValidity:()=>l.reportValidity()})}},formState:s,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!I(s.errors,r)},isDirty:{enumerable:!0,get:()=>!!I(s.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!I(s.touchedFields,r)},error:{enumerable:!0,get:()=>I(s.errors,r)}})}}const Cu=e=>e.render(ua(e));var la=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},Ln=e=>/^\w*$/.test(e),ca=e=>xt(e.replace(/["|']|\]/g,"").split(/\.|\[/));function K(e,t,r){let n=-1;const i=Ln(t)?[t]:ca(t),o=i.length,a=o-1;for(;++n<o;){const s=i[n];let u=r;if(n!==a){const l=e[s];u=ue(l)||Array.isArray(l)?l:isNaN(+i[n+1])?{}:[]}e[s]=u,e=e[s]}return e}const lr=(e,t,r)=>{for(const n of r||Object.keys(e)){const i=I(e,n);if(i){const{_f:o,...a}=i;if(o&&t(o.name)){if(o.ref.focus){o.ref.focus();break}else if(o.refs&&o.refs[0].focus){o.refs[0].focus();break}}else ue(a)&&lr(a,t)}}};var Je=()=>{const e=typeof performance=="undefined"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},Hr=(e,t,r={})=>r.shouldFocus||J(r.shouldFocus)?r.focusName||`${e}.${J(r.focusIndex)?t:r.focusIndex}.`:"",pn=e=>({isOnSubmit:!e||e===Pe.onSubmit,isOnBlur:e===Pe.onBlur,isOnChange:e===Pe.onChange,isOnAll:e===Pe.all,isOnTouch:e===Pe.onTouched}),hn=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length)))),fa=(e,t,r)=>{const n=xt(I(e,r));return K(n,"root",t[r]),K(e,r,n),e},St=e=>typeof e=="boolean",Fn=e=>e.type==="file",Ot=e=>typeof e=="function",cr=e=>{if(!Rn)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},er=e=>ke(e)||N.default.isValidElement(e),kn=e=>e.type==="radio",fr=e=>e instanceof RegExp;const Pi={value:!1,isValid:!1},xi={value:!0,isValid:!0};var da=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!J(e[0].attributes.value)?J(e[0].value)||e[0].value===""?xi:{value:e[0].value,isValid:!0}:xi:Pi}return Pi};const Ai={isValid:!1,value:null};var ga=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Ai):Ai;function Ci(e,t,r="validate"){if(er(e)||Array.isArray(e)&&e.every(er)||St(e)&&!e)return{type:r,message:er(e)?e:"",ref:t}}var vt=e=>ue(e)&&!fr(e)?e:{value:e,message:""},mn=async(e,t,r,n,i)=>{const{ref:o,refs:a,required:s,maxLength:u,minLength:l,min:f,max:c,pattern:g,validate:d,name:p,valueAsNumber:y,mount:b,disabled:h}=e._f;if(!b||h)return{};const v=a?a[0]:o,P=L=>{n&&v.reportValidity&&(v.setCustomValidity(St(L)?"":L||""),v.reportValidity())},E={},w=kn(o),C=zt(o),T=w||C,R=(y||Fn(o))&&J(o.value)&&J(t)||cr(o)&&o.value===""||t===""||Array.isArray(t)&&!t.length,F=la.bind(null,p,r,E),j=(L,D,V,H=He.maxLength,Z=He.minLength)=>{const G=L?D:V;E[p]={type:L?H:Z,message:G,ref:o,...F(L?H:Z,G)}};if(i?!Array.isArray(t)||!t.length:s&&(!T&&(R||ve(t))||St(t)&&!t||C&&!da(a).isValid||w&&!ga(a).isValid)){const{value:L,message:D}=er(s)?{value:!!s,message:s}:vt(s);if(L&&(E[p]={type:He.required,message:D,ref:v,...F(He.required,D)},!r))return P(D),E}if(!R&&(!ve(f)||!ve(c))){let L,D;const V=vt(c),H=vt(f);if(!ve(t)&&!isNaN(t)){const Z=o.valueAsNumber||t&&+t;ve(V.value)||(L=Z>V.value),ve(H.value)||(D=Z<H.value)}else{const Z=o.valueAsDate||new Date(t),G=ie=>new Date(new Date().toDateString()+" "+ie),X=o.type=="time",W=o.type=="week";ke(V.value)&&t&&(L=X?G(t)>G(V.value):W?t>V.value:Z>new Date(V.value)),ke(H.value)&&t&&(D=X?G(t)<G(H.value):W?t<H.value:Z<new Date(H.value))}if((L||D)&&(j(!!L,V.message,H.message,He.max,He.min),!r))return P(E[p].message),E}if((u||l)&&!R&&(ke(t)||i&&Array.isArray(t))){const L=vt(u),D=vt(l),V=!ve(L.value)&&t.length>L.value,H=!ve(D.value)&&t.length<D.value;if((V||H)&&(j(V,L.message,D.message),!r))return P(E[p].message),E}if(g&&!R&&ke(t)){const{value:L,message:D}=vt(g);if(fr(L)&&!t.match(L)&&(E[p]={type:He.pattern,message:D,ref:o,...F(He.pattern,D)},!r))return P(D),E}if(d){if(Ot(d)){const L=await d(t),D=Ci(L,v);if(D&&(E[p]={...D,...F(He.validate,D.message)},!r))return P(D.message),E}else if(ue(d)){let L={};for(const D in d){if(!Se(L)&&!r)break;const V=Ci(await d[D](t),v,D);V&&(L={...V,...F(D,V.message)},P(V.message),r&&(E[p]=L))}if(!Se(L)&&(E[p]={ref:v,...L},!r))return E}}return P(!0),E};function Wr(e,t){return[...e,...we(t)]}var Gr=e=>Array.isArray(e)?e.map(()=>{}):void 0;function zr(e,t,r){return[...e.slice(0,t),...we(r),...e.slice(t)]}var Kr=(e,t,r)=>Array.isArray(e)?(J(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[];function Yr(e,t){return[...we(t),...we(e)]}function _u(e,t){let r=0;const n=[...e];for(const i of t)n.splice(i-r,1),r++;return xt(n).length?n:[]}var Qr=(e,t)=>J(t)?[]:_u(e,we(t).sort((r,n)=>r-n)),qr=(e,t,r)=>{e[t]=[e[r],e[r]=e[t]][0]};function Tu(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=J(e)?n++:e[t[n++]];return e}function Nu(e){for(const t in e)if(!J(e[t]))return!1;return!0}function ge(e,t){const r=Ln(t)?[t]:ca(t),n=r.length==1?e:Tu(e,r),i=r[r.length-1];let o;n&&delete n[i];for(let a=0;a<r.slice(0,-1).length;a++){let s=-1,u;const l=r.slice(0,-(a+1)),f=l.length-1;for(a>0&&(o=e);++s<l.length;){const c=l[s];u=u?u[c]:e[c],f===s&&(ue(u)&&Se(u)||Array.isArray(u)&&Nu(u))&&(o?delete o[c]:delete e[c]),o=u}}return e}var _i=(e,t,r)=>(e[t]=r,e);function Iu(e){const t=Ke(),{control:r=t.control,name:n,keyName:i="id",shouldUnregister:o}=e,[a,s]=N.default.useState(r._getFieldArray(n)),u=N.default.useRef(r._getFieldArray(n).map(Je)),l=N.default.useRef(a),f=N.default.useRef(n),c=N.default.useRef(!1);f.current=n,l.current=a,r._names.array.add(n),e.rules&&r.register(n,e.rules),Er({next:({values:w,name:C})=>{if(C===f.current||!C){const T=I(w,f.current);Array.isArray(T)&&(s(T),u.current=T.map(Je))}},subject:r._subjects.array});const g=N.default.useCallback(w=>{c.current=!0,r._updateFieldArray(n,w)},[r,n]),d=(w,C)=>{const T=we(Oe(w)),R=Wr(r._getFieldArray(n),T);r._names.focus=Hr(n,R.length-1,C),u.current=Wr(u.current,T.map(Je)),g(R),s(R),r._updateFieldArray(n,R,Wr,{argA:Gr(w)})},p=(w,C)=>{const T=we(Oe(w)),R=Yr(r._getFieldArray(n),T);r._names.focus=Hr(n,0,C),u.current=Yr(u.current,T.map(Je)),g(R),s(R),r._updateFieldArray(n,R,Yr,{argA:Gr(w)})},y=w=>{const C=Qr(r._getFieldArray(n),w);u.current=Qr(u.current,w),g(C),s(C),r._updateFieldArray(n,C,Qr,{argA:w})},b=(w,C,T)=>{const R=we(Oe(C)),F=zr(r._getFieldArray(n),w,R);r._names.focus=Hr(n,w,T),u.current=zr(u.current,w,R.map(Je)),g(F),s(F),r._updateFieldArray(n,F,zr,{argA:w,argB:Gr(C)})},h=(w,C)=>{const T=r._getFieldArray(n);qr(T,w,C),qr(u.current,w,C),g(T),s(T),r._updateFieldArray(n,T,qr,{argA:w,argB:C},!1)},v=(w,C)=>{const T=r._getFieldArray(n);Kr(T,w,C),Kr(u.current,w,C),g(T),s(T),r._updateFieldArray(n,T,Kr,{argA:w,argB:C},!1)},P=(w,C)=>{const T=Oe(C),R=_i(r._getFieldArray(n),w,T);u.current=[...R].map((F,j)=>!F||j===w?Je():u.current[j]),g(R),s([...R]),r._updateFieldArray(n,R,_i,{argA:w,argB:T},!0,!1)},E=w=>{const C=we(Oe(w));u.current=C.map(Je),g([...C]),s([...C]),r._updateFieldArray(n,[...C],T=>T,{},!0,!1)};return N.default.useEffect(()=>{if(r._stateFlags.action=!1,hn(n,r._names)&&r._subjects.state.next({}),c.current&&(!pn(r._options.mode).isOnSubmit||r._formState.isSubmitted))if(r._options.resolver)r._executeSchema([n]).then(w=>{const C=I(w.errors,n),T=I(r._formState.errors,n);(T?!C&&T.type:C&&C.type)&&(C?K(r._formState.errors,n,C):ge(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const w=I(r._fields,n);w&&w._f&&mn(w,I(r._formValues,n),r._options.criteriaMode===Pe.all,r._options.shouldUseNativeValidation,!0).then(C=>!Se(C)&&r._subjects.state.next({errors:fa(r._formState.errors,C,n)}))}r._subjects.watch.next({name:n,values:r._formValues}),r._names.focus&&lr(r._fields,w=>!!w&&w.startsWith(r._names.focus||"")),r._names.focus="",r._proxyFormState.isValid&&r._updateValid()},[a,n,r]),N.default.useEffect(()=>(!I(r._formValues,n)&&r._updateFieldArray(n),()=>{(r._options.shouldUnregister||o)&&r.unregister(n)}),[n,r,i,o]),{swap:N.default.useCallback(h,[g,n,r]),move:N.default.useCallback(v,[g,n,r]),prepend:N.default.useCallback(p,[g,n,r]),append:N.default.useCallback(d,[g,n,r]),remove:N.default.useCallback(y,[g,n,r]),insert:N.default.useCallback(b,[g,n,r]),update:N.default.useCallback(P,[g,n,r]),replace:N.default.useCallback(E,[g,n,r]),fields:N.default.useMemo(()=>a.map((w,C)=>({...w,[i]:u.current[C]||Je()})),[a,i])}}function Jr(){let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}}var dr=e=>ve(e)||!Zo(e);function st(e,t){if(dr(e)||dr(t))return e===t;if(bt(e)&&bt(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r){const o=e[i];if(!n.includes(i))return!1;if(i!=="ref"){const a=t[i];if(bt(o)&&bt(a)||ue(o)&&ue(a)||Array.isArray(o)&&Array.isArray(a)?!st(o,a):o!==a)return!1}}return!0}var pa=e=>e.type==="select-multiple",$u=e=>kn(e)||zt(e),Zr=e=>cr(e)&&e.isConnected,ha=e=>{for(const t in e)if(Ot(e[t]))return!0;return!1};function gr(e,t={}){const r=Array.isArray(e);if(ue(e)||r)for(const n in e)Array.isArray(e[n])||ue(e[n])&&!ha(e[n])?(t[n]=Array.isArray(e[n])?[]:{},gr(e[n],t[n])):ve(e[n])||(t[n]=!0);return t}function ma(e,t,r){const n=Array.isArray(e);if(ue(e)||n)for(const i in e)Array.isArray(e[i])||ue(e[i])&&!ha(e[i])?J(t)||dr(r[i])?r[i]=Array.isArray(e[i])?gr(e[i],[]):{...gr(e[i])}:ma(e[i],ve(t)?{}:t[i],r[i]):st(e[i],t[i])?delete r[i]:r[i]=!0;return r}var Xr=(e,t)=>ma(e,t,gr(t)),va=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>J(e)?e:t?e===""?NaN:e&&+e:r&&ke(e)?new Date(e):n?n(e):e;function en(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Fn(t)?t.files:kn(t)?ga(e.refs).value:pa(t)?[...t.selectedOptions].map(({value:r})=>r):zt(t)?da(e.refs).value:va(J(t.value)?e.ref.value:t.value,e)}var Ru=(e,t,r,n)=>{const i={};for(const o of e){const a=I(t,o);a&&K(i,o,a._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Nt=e=>J(e)?e:fr(e)?e.source:ue(e)?fr(e.value)?e.value.source:e.value:e,Lu=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Ti(e,t,r){const n=I(e,r);if(n||Ln(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const o=i.join("."),a=I(t,o),s=I(e,o);if(a&&!Array.isArray(a)&&r!==o)return{name:r};if(s&&s.type)return{name:o,error:s};i.pop()}return{name:r}}var Fu=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,ku=(e,t)=>!xt(I(e,t)).length&&ge(e,t);const Mu={mode:Pe.onSubmit,reValidateMode:Pe.onChange,shouldFocusError:!0};function Du(e={},t){let r={...Mu,...e};const n=e.resetOptions&&e.resetOptions.keepDirtyValues;let i={submitCount:0,isDirty:!1,isLoading:!0,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},o={},a=ue(r.defaultValues)?Oe(r.defaultValues)||{}:{},s=r.shouldUnregister?{}:Oe(a),u={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},f,c=0;const g={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={watch:Jr(),array:Jr(),state:Jr()},p=pn(r.mode),y=pn(r.reValidateMode),b=r.criteriaMode===Pe.all,h=m=>O=>{clearTimeout(c),c=window.setTimeout(m,O)},v=async()=>{if(g.isValid){const m=r.resolver?Se((await F()).errors):await L(o,!0);m!==i.isValid&&(i.isValid=m,d.state.next({isValid:m}))}},P=m=>g.isValidating&&d.state.next({isValidating:m}),E=(m,O=[],A,$,k=!0,_=!0)=>{if($&&A){if(u.action=!0,_&&Array.isArray(I(o,m))){const M=A(I(o,m),$.argA,$.argB);k&&K(o,m,M)}if(_&&Array.isArray(I(i.errors,m))){const M=A(I(i.errors,m),$.argA,$.argB);k&&K(i.errors,m,M),ku(i.errors,m)}if(g.touchedFields&&_&&Array.isArray(I(i.touchedFields,m))){const M=A(I(i.touchedFields,m),$.argA,$.argB);k&&K(i.touchedFields,m,M)}g.dirtyFields&&(i.dirtyFields=Xr(a,s)),d.state.next({name:m,isDirty:V(m,O),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else K(s,m,O)},w=(m,O)=>{K(i.errors,m,O),d.state.next({errors:i.errors})},C=(m,O,A,$)=>{const k=I(o,m);if(k){const _=I(s,m,J(A)?I(a,m):A);J(_)||$&&$.defaultChecked||O?K(s,m,O?_:en(k._f)):G(m,_),u.mount&&v()}},T=(m,O,A,$,k)=>{let _=!1,M=!1;const oe={name:m};if(!A||$){g.isDirty&&(M=i.isDirty,i.isDirty=oe.isDirty=V(),_=M!==oe.isDirty);const te=st(I(a,m),O);M=I(i.dirtyFields,m),te?ge(i.dirtyFields,m):K(i.dirtyFields,m,!0),oe.dirtyFields=i.dirtyFields,_=_||g.dirtyFields&&M!==!te}if(A){const te=I(i.touchedFields,m);te||(K(i.touchedFields,m,A),oe.touchedFields=i.touchedFields,_=_||g.touchedFields&&te!==A)}return _&&k&&d.state.next(oe),_?oe:{}},R=(m,O,A,$)=>{const k=I(i.errors,m),_=g.isValid&&St(O)&&i.isValid!==O;if(e.delayError&&A?(f=h(()=>w(m,A)),f(e.delayError)):(clearTimeout(c),f=null,A?K(i.errors,m,A):ge(i.errors,m)),(A?!st(k,A):k)||!Se($)||_){const M={...$,..._&&St(O)?{isValid:O}:{},errors:i.errors,name:m};i={...i,...M},d.state.next(M)}P(!1)},F=async m=>await r.resolver(s,r.context,Ru(m||l.mount,o,r.criteriaMode,r.shouldUseNativeValidation)),j=async m=>{const{errors:O}=await F();if(m)for(const A of m){const $=I(O,A);$?K(i.errors,A,$):ge(i.errors,A)}else i.errors=O;return O},L=async(m,O,A={valid:!0})=>{for(const $ in m){const k=m[$];if(k){const{_f:_,...M}=k;if(_){const oe=l.array.has(_.name),te=await mn(k,I(s,_.name),b,r.shouldUseNativeValidation,oe);if(te[_.name]&&(A.valid=!1,O))break;!O&&(I(te,_.name)?oe?fa(i.errors,te,_.name):K(i.errors,_.name,te[_.name]):ge(i.errors,_.name))}M&&await L(M,O,A)}}return A.valid},D=()=>{for(const m of l.unMount){const O=I(o,m);O&&(O._f.refs?O._f.refs.every(A=>!Zr(A)):!Zr(O._f.ref))&&ee(m)}l.unMount=new Set},V=(m,O)=>(m&&O&&K(s,m,O),!st(ne(),a)),H=(m,O,A)=>sa(m,l,{...u.mount?s:J(O)?a:ke(m)?{[m]:O}:O},A,O),Z=m=>xt(I(u.mount?s:a,m,e.shouldUnregister?I(a,m,[]):[])),G=(m,O,A={})=>{const $=I(o,m);let k=O;if($){const _=$._f;_&&(!_.disabled&&K(s,m,va(O,_)),k=cr(_.ref)&&ve(O)?"":O,pa(_.ref)?[..._.ref.options].forEach(M=>M.selected=k.includes(M.value)):_.refs?zt(_.ref)?_.refs.length>1?_.refs.forEach(M=>(!M.defaultChecked||!M.disabled)&&(M.checked=Array.isArray(k)?!!k.find(oe=>oe===M.value):k===M.value)):_.refs[0]&&(_.refs[0].checked=!!k):_.refs.forEach(M=>M.checked=M.value===k):Fn(_.ref)?_.ref.value="":(_.ref.value=k,_.ref.type||d.watch.next({name:m})))}(A.shouldDirty||A.shouldTouch)&&T(m,k,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&U(m)},X=(m,O,A)=>{for(const $ in O){const k=O[$],_=`${m}.${$}`,M=I(o,_);(l.array.has(m)||!dr(k)||M&&!M._f)&&!bt(k)?X(_,k,A):G(_,k,A)}},W=(m,O,A={})=>{const $=I(o,m),k=l.array.has(m),_=Oe(O);K(s,m,_),k?(d.array.next({name:m,values:s}),(g.isDirty||g.dirtyFields)&&A.shouldDirty&&(i.dirtyFields=Xr(a,s),d.state.next({name:m,dirtyFields:i.dirtyFields,isDirty:V(m,_)}))):$&&!$._f&&!ve(_)?X(m,_,A):G(m,_,A),hn(m,l)&&d.state.next({}),d.watch.next({name:m}),!u.mount&&t()},ie=async m=>{const O=m.target;let A=O.name;const $=I(o,A),k=()=>O.type?en($._f):Xo(m);if($){let _,M;const oe=k(),te=m.type===sr.BLUR||m.type===sr.FOCUS_OUT,Vs=!Lu($._f)&&!r.resolver&&!I(i.errors,A)&&!$._f.deps||Fu(te,I(i.touchedFields,A),i.isSubmitted,y,p),Ur=hn(A,l,te);K(s,A,oe),te?($._f.onBlur&&$._f.onBlur(m),f&&f(0)):$._f.onChange&&$._f.onChange(m);const Vr=T(A,oe,te,!1),Bs=!Se(Vr)||Ur;if(!te&&d.watch.next({name:A,type:m.type}),Vs)return g.isValid&&v(),Bs&&d.state.next({name:A,...Ur?{}:Vr});if(!te&&Ur&&d.state.next({}),P(!0),r.resolver){const{errors:ni}=await F([A]),Hs=Ti(i.errors,o,A),ii=Ti(ni,o,Hs.name||A);_=ii.error,A=ii.name,M=Se(ni)}else _=(await mn($,I(s,A),b,r.shouldUseNativeValidation))[A],_?M=!1:g.isValid&&(M=await L(o,!0));$._f.deps&&U($._f.deps),R(A,M,_,Vr)}},U=async(m,O={})=>{let A,$;const k=we(m);if(P(!0),r.resolver){const _=await j(J(m)?m:k);A=Se(_),$=m?!k.some(M=>I(_,M)):A}else m?($=(await Promise.all(k.map(async _=>{const M=I(o,_);return await L(M&&M._f?{[_]:M}:M)}))).every(Boolean),!(!$&&!i.isValid)&&v()):$=A=await L(o);return d.state.next({...!ke(m)||g.isValid&&A!==i.isValid?{}:{name:m},...r.resolver||!m?{isValid:A}:{},errors:i.errors,isValidating:!1}),O.shouldFocus&&!$&&lr(o,_=>_&&I(i.errors,_),m?k:l.mount),$},ne=m=>{const O={...a,...u.mount?s:{}};return J(m)?O:ke(m)?I(O,m):m.map(A=>I(O,A))},ye=(m,O)=>({invalid:!!I((O||i).errors,m),isDirty:!!I((O||i).dirtyFields,m),isTouched:!!I((O||i).touchedFields,m),error:I((O||i).errors,m)}),le=m=>{m?we(m).forEach(O=>ge(i.errors,O)):i.errors={},d.state.next({errors:i.errors})},fe=(m,O,A)=>{const $=(I(o,m,{_f:{}})._f||{}).ref;K(i.errors,m,{...O,ref:$}),d.state.next({name:m,errors:i.errors,isValid:!1}),A&&A.shouldFocus&&$&&$.focus&&$.focus()},Te=(m,O)=>Ot(m)?d.watch.subscribe({next:A=>m(H(void 0,O),A)}):H(m,O,!0),ee=(m,O={})=>{for(const A of m?we(m):l.mount)l.mount.delete(A),l.array.delete(A),I(o,A)&&(O.keepValue||(ge(o,A),ge(s,A)),!O.keepError&&ge(i.errors,A),!O.keepDirty&&ge(i.dirtyFields,A),!O.keepTouched&&ge(i.touchedFields,A),!r.shouldUnregister&&!O.keepDefaultValue&&ge(a,A));d.watch.next({}),d.state.next({...i,...O.keepDirty?{isDirty:V()}:{}}),!O.keepIsValid&&v()},Y=(m,O={})=>{let A=I(o,m);const $=St(O.disabled);return K(o,m,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:m}},name:m,mount:!0,...O}}),l.mount.add(m),A?$&&K(s,m,O.disabled?void 0:I(s,m,en(A._f))):C(m,!0,O.value),{...$?{disabled:O.disabled}:{},...r.shouldUseNativeValidation?{required:!!O.required,min:Nt(O.min),max:Nt(O.max),minLength:Nt(O.minLength),maxLength:Nt(O.maxLength),pattern:Nt(O.pattern)}:{},name:m,onChange:ie,onBlur:ie,ref:k=>{if(k){Y(m,O),A=I(o,m);const _=J(k.value)&&k.querySelectorAll&&k.querySelectorAll("input,select,textarea")[0]||k,M=$u(_),oe=A._f.refs||[];if(M?oe.find(te=>te===_):_===A._f.ref)return;K(o,m,{_f:{...A._f,...M?{refs:[...oe.filter(Zr),_,...Array.isArray(I(a,m))?[{}]:[]],ref:{type:_.type,name:m}}:{ref:_}}}),C(m,!1,void 0,_)}else A=I(o,m,{}),A._f&&(A._f.mount=!1),(r.shouldUnregister||O.shouldUnregister)&&!(ea(l.array,m)&&u.action)&&l.unMount.add(m)}}},ae=()=>r.shouldFocusError&&lr(o,m=>m&&I(i.errors,m),l.mount),de=(m,O)=>async A=>{A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist());let $=!0,k=Oe(s);d.state.next({isSubmitting:!0});try{if(r.resolver){const{errors:_,values:M}=await F();i.errors=_,k=M}else await L(o);Se(i.errors)?(d.state.next({errors:{},isSubmitting:!0}),await m(k,A)):(O&&await O({...i.errors},A),ae())}catch(_){throw $=!1,_}finally{i.isSubmitted=!0,d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Se(i.errors)&&$,submitCount:i.submitCount+1,errors:i.errors})}},he=(m,O={})=>{I(o,m)&&(J(O.defaultValue)?W(m,I(a,m)):(W(m,O.defaultValue),K(a,m,O.defaultValue)),O.keepTouched||ge(i.touchedFields,m),O.keepDirty||(ge(i.dirtyFields,m),i.isDirty=O.defaultValue?V(m,I(a,m)):V()),O.keepError||(ge(i.errors,m),g.isValid&&v()),d.state.next({...i}))},be=(m,O={})=>{const A=m||a,$=Oe(A),k=m&&!Se(m)?$:a;if(O.keepDefaultValues||(a=A),!O.keepValues){if(O.keepDirtyValues||n)for(const _ of l.mount)I(i.dirtyFields,_)?K(k,_,I(s,_)):W(_,I(k,_));else{if(Rn&&J(m))for(const _ of l.mount){const M=I(o,_);if(M&&M._f){const oe=Array.isArray(M._f.refs)?M._f.refs[0]:M._f.ref;if(cr(oe)){const te=oe.closest("form");if(te){te.reset();break}}}}o={}}s=e.shouldUnregister?O.keepDefaultValues?Oe(a):{}:$,d.array.next({values:k}),d.watch.next({values:k})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!u.mount&&t(),u.mount=!g.isValid||!!O.keepIsValid,u.watch=!!e.shouldUnregister,d.state.next({submitCount:O.keepSubmitCount?i.submitCount:0,isDirty:O.keepDirty||O.keepDirtyValues?i.isDirty:!!(O.keepDefaultValues&&!st(m,a)),isSubmitted:O.keepIsSubmitted?i.isSubmitted:!1,dirtyFields:O.keepDirty||O.keepDirtyValues?i.dirtyFields:O.keepDefaultValues&&m?Xr(a,m):{},touchedFields:O.keepTouched?i.touchedFields:{},errors:O.keepErrors?i.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},Be=(m,O)=>be(Ot(m)?m(s):m,O),nt=(m,O={})=>{const A=I(o,m),$=A&&A._f;if($){const k=$.refs?$.refs[0]:$.ref;k.focus&&(k.focus(),O.shouldSelect&&k.select())}};return Ot(r.defaultValues)&&r.defaultValues().then(m=>{Be(m,r.resetOptions),d.state.next({isLoading:!1})}),{control:{register:Y,unregister:ee,getFieldState:ye,_executeSchema:F,_focusError:ae,_getWatch:H,_getDirty:V,_updateValid:v,_removeUnmounted:D,_updateFieldArray:E,_getFieldArray:Z,_reset:be,_subjects:d,_proxyFormState:g,get _fields(){return o},get _formValues(){return s},get _stateFlags(){return u},set _stateFlags(m){u=m},get _defaultValues(){return a},get _names(){return l},set _names(m){l=m},get _formState(){return i},set _formState(m){i=m},get _options(){return r},set _options(m){r={...r,...m}}},trigger:U,register:Y,handleSubmit:de,watch:Te,setValue:W,getValues:ne,reset:Be,resetField:he,clearErrors:le,unregister:ee,setError:fe,setFocus:nt,getFieldState:ye}}function ya(e={}){const t=N.default.useRef(),[r,n]=N.default.useState({isDirty:!1,isValidating:!1,isLoading:!0,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Ot(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Du(e,()=>n(o=>({...o}))),formState:r});const i=t.current.control;return i._options=e,Er({subject:i._subjects.state,next:o=>{ia(o,i._proxyFormState,!0)&&(i._formState={...i._formState,...o},n({...i._formState}))}}),N.default.useEffect(()=>{i._stateFlags.mount||(i._proxyFormState.isValid&&i._updateValid(),i._stateFlags.mount=!0),i._stateFlags.watch&&(i._stateFlags.watch=!1,i._subjects.state.next({})),i._removeUnmounted()}),N.default.useEffect(()=>{e.values&&!st(e.values,i._defaultValues)&&i._reset(e.values,i._options.resetOptions)},[e.values,i]),N.default.useEffect(()=>{r.submitCount&&i._focusError()},[i,r.submitCount]),t.current.formState=na(r,i),t.current}var ju=Object.freeze(Object.defineProperty({__proto__:null,Controller:Cu,FormProvider:ra,appendErrors:la,get:I,set:K,useController:ua,useFieldArray:Iu,useForm:ya,useFormContext:Ke,useFormState:aa,useWatch:ur},Symbol.toStringTag,{value:"Module"})),ba=(e=>(e.FULL_PAGE="FULL_PAGE",e.MODAL="MODAL",e))(ba||{}),Sa=(e=>(e.SIMPLE="SIMPLE",e.COMPLEX="COMPLEX",e.QUANTITY="QUANTITY",e))(Sa||{}),Mn=(e=>(e.SELECT="selCtx",e.FILTER="fltCtx",e))(Mn||{}),Dn=(e=>(e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.PRODUCT="3e/product",e))(Dn||{}),xe=(e=>(e.OK="OK",e.TOO_MUCH="TOO_MUCH",e.NOT_ENOUGHT="NOT_ENOUGHT",e.IGNORE="IGNORE",e))(xe||{});const Uu=(e,t,r)=>{if(e==="selected"||e==="filter")return[];if(r[t]===e)return[r];let n=wa(e,t,r.items);return n!=null&&n.length||(n=Oa(e,t,r.items),n.length),n},Oa=(e,t,r)=>{const n=Vu(r),i=wa(e,t,n);return i!=null&&i.length?i:n!=null&&n.length?Oa(e,t,n):[]},Vu=e=>{let t=[];return Array.isArray(e)&&(t=e.map(r=>{if(Array.isArray(r==null?void 0:r.items))return r.items}).filter(r=>r!==void 0)),t.flat(1)},wa=(e,t,r)=>{let n=[];return Array.isArray(r)&&(n=r.filter(i=>{if(i&&i[t]===e)return!0})),n},Bu=(e,t,r,n)=>{const i=Uu(t,r,n),o=Hu(e,i).filter(a=>a!==null&&typeof a!="undefined");return o.length?o[0]:null},Hu=(e,t)=>{let r=[];return Array.isArray(t)&&t.length&&(r=t.map(n=>Wu(e,n))),r},Wu=(e,t)=>{if(t.id===e)return t;let r=Pa(e,t.items);return r.length?(r.length>1&&console.error(`More than one ${e} in context ${t.id}`),r[0]):(r=Ea(e,t.items),r.length?(r.length>1&&console.error(`More than one ${e} in context ${t.id}`),r[0]):null)},Ea=(e,t)=>{const r=Gu(t),n=Pa(e,r);return n!=null&&n.length?n:r!=null&&r.length?Ea(e,r):[]},Gu=e=>{let t=[];return Array.isArray(e)&&(t=e.map(r=>{if(Array.isArray(r==null?void 0:r.items))return r.items}).filter(r=>r!==void 0)),t.flat(1)},Pa=(e,t)=>Array.isArray(t)?t.filter(n=>{if(n&&n.id===e)return!0}):[],jn=(e,t)=>{let r=0;for(const[n,i]of Object.entries(e))if(i){for(const[o,a]of Object.entries(i))if(a){const s=Bu(o,n,Mn.SELECT,t);s&&(s==null?void 0:s.price)?r+=parseFloat(s.price)*a:s||console.warn(`Error finding product: ${o} in selCtx: ${n}`)}}return r},xa=e=>{const{price:t,state:{selected:r}={}}=e;return(!t||parseFloat(t||"1")===0)&&r?`${jn(r,e)||"0"}`:t};var zu=typeof global=="object"&&global&&global.Object===Object&&global,Aa=zu,Ku=typeof self=="object"&&self&&self.Object===Object&&self,Yu=Aa||Ku||Function("return this")(),Ve=Yu,Qu=Ve.Symbol,tt=Qu,Ca=Object.prototype,qu=Ca.hasOwnProperty,Ju=Ca.toString,It=tt?tt.toStringTag:void 0;function Zu(e){var t=qu.call(e,It),r=e[It];try{e[It]=void 0;var n=!0}catch{}var i=Ju.call(e);return n&&(t?e[It]=r:delete e[It]),i}var Xu=Object.prototype,el=Xu.toString;function tl(e){return el.call(e)}var rl="[object Null]",nl="[object Undefined]",Ni=tt?tt.toStringTag:void 0;function At(e){return e==null?e===void 0?nl:rl:Ni&&Ni in Object(e)?Zu(e):tl(e)}function rt(e){return e!=null&&typeof e=="object"}var il="[object Symbol]";function ol(e){return typeof e=="symbol"||rt(e)&&At(e)==il}var al=Array.isArray,wt=al,sl=/\s/;function ul(e){for(var t=e.length;t--&&sl.test(e.charAt(t)););return t}var ll=/^\s+/;function cl(e){return e&&e.slice(0,ul(e)+1).replace(ll,"")}function lt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ii=0/0,fl=/^[-+]0x[0-9a-f]+$/i,dl=/^0b[01]+$/i,gl=/^0o[0-7]+$/i,pl=parseInt;function _a(e){if(typeof e=="number")return e;if(ol(e))return Ii;if(lt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=lt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=cl(e);var r=dl.test(e);return r||gl.test(e)?pl(e.slice(2),r?2:8):fl.test(e)?Ii:+e}var $i=1/0,hl=17976931348623157e292;function Ri(e){if(!e)return e===0?e:0;if(e=_a(e),e===$i||e===-$i){var t=e<0?-1:1;return t*hl}return e===e?e:0}var ml="[object AsyncFunction]",vl="[object Function]",yl="[object GeneratorFunction]",bl="[object Proxy]";function Ta(e){if(!lt(e))return!1;var t=At(e);return t==vl||t==yl||t==ml||t==bl}var Sl=Ve["__core-js_shared__"],tn=Sl,Li=function(){var e=/[^.]+$/.exec(tn&&tn.keys&&tn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ol(e){return!!Li&&Li in e}var wl=Function.prototype,El=wl.toString;function dt(e){if(e!=null){try{return El.call(e)}catch{}try{return e+""}catch{}}return""}var Pl=/[\\^$.*+?()[\]{}|]/g,xl=/^\[object .+?Constructor\]$/,Al=Function.prototype,Cl=Object.prototype,_l=Al.toString,Tl=Cl.hasOwnProperty,Nl=RegExp("^"+_l.call(Tl).replace(Pl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Il(e){if(!lt(e)||Ol(e))return!1;var t=Ta(e)?Nl:xl;return t.test(dt(e))}function $l(e,t){return e==null?void 0:e[t]}function gt(e,t){var r=$l(e,t);return Il(r)?r:void 0}var Rl=gt(Ve,"WeakMap"),vn=Rl,Fi=Object.create,Ll=function(){function e(){}return function(t){if(!lt(t))return{};if(Fi)return Fi(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Fl=Ll;function kl(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Ml=function(){try{var e=gt(Object,"defineProperty");return e({},"",{}),e}catch{}}(),ki=Ml;function Dl(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var jl=9007199254740991,Ul=/^(?:0|[1-9]\d*)$/;function Vl(e,t){var r=typeof e;return t=t==null?jl:t,!!t&&(r=="number"||r!="symbol"&&Ul.test(e))&&e>-1&&e%1==0&&e<t}function Na(e,t,r){t=="__proto__"&&ki?ki(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Un(e,t){return e===t||e!==e&&t!==t}var Bl=Object.prototype,Hl=Bl.hasOwnProperty;function Ia(e,t,r){var n=e[t];(!(Hl.call(e,t)&&Un(n,r))||r===void 0&&!(t in e))&&Na(e,t,r)}function Pr(e,t,r,n){var i=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var s=t[o],u=n?n(r[s],e[s],s,r,e):void 0;u===void 0&&(u=e[s]),i?Na(r,s,u):Ia(r,s,u)}return r}var Wl=9007199254740991;function $a(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Wl}function Vn(e){return e!=null&&$a(e.length)&&!Ta(e)}var Gl=Object.prototype;function xr(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Gl;return e===r}function zl(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Kl="[object Arguments]";function Mi(e){return rt(e)&&At(e)==Kl}var Ra=Object.prototype,Yl=Ra.hasOwnProperty,Ql=Ra.propertyIsEnumerable,ql=Mi(function(){return arguments}())?Mi:function(e){return rt(e)&&Yl.call(e,"callee")&&!Ql.call(e,"callee")},La=ql;function Jl(){return!1}var Fa=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Di=Fa&&typeof module=="object"&&module&&!module.nodeType&&module,Zl=Di&&Di.exports===Fa,ji=Zl?Ve.Buffer:void 0,Xl=ji?ji.isBuffer:void 0,ec=Xl||Jl,Vt=ec,tc="[object Arguments]",rc="[object Array]",nc="[object Boolean]",ic="[object Date]",oc="[object Error]",ac="[object Function]",sc="[object Map]",uc="[object Number]",lc="[object Object]",cc="[object RegExp]",fc="[object Set]",dc="[object String]",gc="[object WeakMap]",pc="[object ArrayBuffer]",hc="[object DataView]",mc="[object Float32Array]",vc="[object Float64Array]",yc="[object Int8Array]",bc="[object Int16Array]",Sc="[object Int32Array]",Oc="[object Uint8Array]",wc="[object Uint8ClampedArray]",Ec="[object Uint16Array]",Pc="[object Uint32Array]",q={};q[mc]=q[vc]=q[yc]=q[bc]=q[Sc]=q[Oc]=q[wc]=q[Ec]=q[Pc]=!0;q[tc]=q[rc]=q[pc]=q[nc]=q[hc]=q[ic]=q[oc]=q[ac]=q[sc]=q[uc]=q[lc]=q[cc]=q[fc]=q[dc]=q[gc]=!1;function xc(e){return rt(e)&&$a(e.length)&&!!q[At(e)]}function Bn(e){return function(t){return e(t)}}var ka=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jt=ka&&typeof module=="object"&&module&&!module.nodeType&&module,Ac=jt&&jt.exports===ka,rn=Ac&&Aa.process,Cc=function(){try{var e=jt&&jt.require&&jt.require("util").types;return e||rn&&rn.binding&&rn.binding("util")}catch{}}(),Et=Cc,Ui=Et&&Et.isTypedArray,_c=Ui?Bn(Ui):xc,Hn=_c,Tc=Object.prototype,Nc=Tc.hasOwnProperty;function Ma(e,t){var r=wt(e),n=!r&&La(e),i=!r&&!n&&Vt(e),o=!r&&!n&&!i&&Hn(e),a=r||n||i||o,s=a?zl(e.length,String):[],u=s.length;for(var l in e)(t||Nc.call(e,l))&&!(a&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Vl(l,u)))&&s.push(l);return s}function Da(e,t){return function(r){return e(t(r))}}var Ic=Da(Object.keys,Object),$c=Ic,Rc=Object.prototype,Lc=Rc.hasOwnProperty;function ja(e){if(!xr(e))return $c(e);var t=[];for(var r in Object(e))Lc.call(e,r)&&r!="constructor"&&t.push(r);return t}function Wn(e){return Vn(e)?Ma(e):ja(e)}function Fc(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var kc=Object.prototype,Mc=kc.hasOwnProperty;function Dc(e){if(!lt(e))return Fc(e);var t=xr(e),r=[];for(var n in e)n=="constructor"&&(t||!Mc.call(e,n))||r.push(n);return r}function Gn(e){return Vn(e)?Ma(e,!0):Dc(e)}var jc=gt(Object,"create"),Bt=jc;function Uc(){this.__data__=Bt?Bt(null):{},this.size=0}function Vc(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Bc="__lodash_hash_undefined__",Hc=Object.prototype,Wc=Hc.hasOwnProperty;function Gc(e){var t=this.__data__;if(Bt){var r=t[e];return r===Bc?void 0:r}return Wc.call(t,e)?t[e]:void 0}var zc=Object.prototype,Kc=zc.hasOwnProperty;function Yc(e){var t=this.__data__;return Bt?t[e]!==void 0:Kc.call(t,e)}var Qc="__lodash_hash_undefined__";function qc(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Bt&&t===void 0?Qc:t,this}function ct(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ct.prototype.clear=Uc;ct.prototype.delete=Vc;ct.prototype.get=Gc;ct.prototype.has=Yc;ct.prototype.set=qc;function Jc(){this.__data__=[],this.size=0}function Ar(e,t){for(var r=e.length;r--;)if(Un(e[r][0],t))return r;return-1}var Zc=Array.prototype,Xc=Zc.splice;function ef(e){var t=this.__data__,r=Ar(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Xc.call(t,r,1),--this.size,!0}function tf(e){var t=this.__data__,r=Ar(t,e);return r<0?void 0:t[r][1]}function rf(e){return Ar(this.__data__,e)>-1}function nf(e,t){var r=this.__data__,n=Ar(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Ye(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ye.prototype.clear=Jc;Ye.prototype.delete=ef;Ye.prototype.get=tf;Ye.prototype.has=rf;Ye.prototype.set=nf;var of=gt(Ve,"Map"),Ht=of;function af(){this.size=0,this.__data__={hash:new ct,map:new(Ht||Ye),string:new ct}}function sf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Cr(e,t){var r=e.__data__;return sf(t)?r[typeof t=="string"?"string":"hash"]:r.map}function uf(e){var t=Cr(this,e).delete(e);return this.size-=t?1:0,t}function lf(e){return Cr(this,e).get(e)}function cf(e){return Cr(this,e).has(e)}function ff(e,t){var r=Cr(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function pt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}pt.prototype.clear=af;pt.prototype.delete=uf;pt.prototype.get=lf;pt.prototype.has=cf;pt.prototype.set=ff;function Ua(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var df=Da(Object.getPrototypeOf,Object),Va=df;function gf(){this.__data__=new Ye,this.size=0}function pf(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function hf(e){return this.__data__.get(e)}function mf(e){return this.__data__.has(e)}var vf=200;function yf(e,t){var r=this.__data__;if(r instanceof Ye){var n=r.__data__;if(!Ht||n.length<vf-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new pt(n)}return r.set(e,t),this.size=r.size,this}function Ge(e){var t=this.__data__=new Ye(e);this.size=t.size}Ge.prototype.clear=gf;Ge.prototype.delete=pf;Ge.prototype.get=hf;Ge.prototype.has=mf;Ge.prototype.set=yf;function bf(e,t){return e&&Pr(t,Wn(t),e)}function Sf(e,t){return e&&Pr(t,Gn(t),e)}var Ba=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vi=Ba&&typeof module=="object"&&module&&!module.nodeType&&module,Of=Vi&&Vi.exports===Ba,Bi=Of?Ve.Buffer:void 0,Hi=Bi?Bi.allocUnsafe:void 0;function wf(e,t){if(t)return e.slice();var r=e.length,n=Hi?Hi(r):new e.constructor(r);return e.copy(n),n}function Ef(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function Ha(){return[]}var Pf=Object.prototype,xf=Pf.propertyIsEnumerable,Wi=Object.getOwnPropertySymbols,Af=Wi?function(e){return e==null?[]:(e=Object(e),Ef(Wi(e),function(t){return xf.call(e,t)}))}:Ha,zn=Af;function Cf(e,t){return Pr(e,zn(e),t)}var _f=Object.getOwnPropertySymbols,Tf=_f?function(e){for(var t=[];e;)Ua(t,zn(e)),e=Va(e);return t}:Ha,Wa=Tf;function Nf(e,t){return Pr(e,Wa(e),t)}function Ga(e,t,r){var n=t(e);return wt(e)?n:Ua(n,r(e))}function yn(e){return Ga(e,Wn,zn)}function If(e){return Ga(e,Gn,Wa)}var $f=gt(Ve,"DataView"),bn=$f,Rf=gt(Ve,"Promise"),Sn=Rf,Lf=gt(Ve,"Set"),On=Lf,Gi="[object Map]",Ff="[object Object]",zi="[object Promise]",Ki="[object Set]",Yi="[object WeakMap]",Qi="[object DataView]",kf=dt(bn),Mf=dt(Ht),Df=dt(Sn),jf=dt(On),Uf=dt(vn),ot=At;(bn&&ot(new bn(new ArrayBuffer(1)))!=Qi||Ht&&ot(new Ht)!=Gi||Sn&&ot(Sn.resolve())!=zi||On&&ot(new On)!=Ki||vn&&ot(new vn)!=Yi)&&(ot=function(e){var t=At(e),r=t==Ff?e.constructor:void 0,n=r?dt(r):"";if(n)switch(n){case kf:return Qi;case Mf:return Gi;case Df:return zi;case jf:return Ki;case Uf:return Yi}return t});var Pt=ot,Vf=Object.prototype,Bf=Vf.hasOwnProperty;function Hf(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&Bf.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Wf=Ve.Uint8Array,pr=Wf;function Kn(e){var t=new e.constructor(e.byteLength);return new pr(t).set(new pr(e)),t}function Gf(e,t){var r=t?Kn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var zf=/\w*$/;function Kf(e){var t=new e.constructor(e.source,zf.exec(e));return t.lastIndex=e.lastIndex,t}var qi=tt?tt.prototype:void 0,Ji=qi?qi.valueOf:void 0;function Yf(e){return Ji?Object(Ji.call(e)):{}}function Qf(e,t){var r=t?Kn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var qf="[object Boolean]",Jf="[object Date]",Zf="[object Map]",Xf="[object Number]",ed="[object RegExp]",td="[object Set]",rd="[object String]",nd="[object Symbol]",id="[object ArrayBuffer]",od="[object DataView]",ad="[object Float32Array]",sd="[object Float64Array]",ud="[object Int8Array]",ld="[object Int16Array]",cd="[object Int32Array]",fd="[object Uint8Array]",dd="[object Uint8ClampedArray]",gd="[object Uint16Array]",pd="[object Uint32Array]";function hd(e,t,r){var n=e.constructor;switch(t){case id:return Kn(e);case qf:case Jf:return new n(+e);case od:return Gf(e,r);case ad:case sd:case ud:case ld:case cd:case fd:case dd:case gd:case pd:return Qf(e,r);case Zf:return new n;case Xf:case rd:return new n(e);case ed:return Kf(e);case td:return new n;case nd:return Yf(e)}}function md(e){return typeof e.constructor=="function"&&!xr(e)?Fl(Va(e)):{}}var vd="[object Map]";function yd(e){return rt(e)&&Pt(e)==vd}var Zi=Et&&Et.isMap,bd=Zi?Bn(Zi):yd,Sd=bd,Od="[object Set]";function wd(e){return rt(e)&&Pt(e)==Od}var Xi=Et&&Et.isSet,Ed=Xi?Bn(Xi):wd,Pd=Ed,xd=1,Ad=2,Cd=4,za="[object Arguments]",_d="[object Array]",Td="[object Boolean]",Nd="[object Date]",Id="[object Error]",Ka="[object Function]",$d="[object GeneratorFunction]",Rd="[object Map]",Ld="[object Number]",Ya="[object Object]",Fd="[object RegExp]",kd="[object Set]",Md="[object String]",Dd="[object Symbol]",jd="[object WeakMap]",Ud="[object ArrayBuffer]",Vd="[object DataView]",Bd="[object Float32Array]",Hd="[object Float64Array]",Wd="[object Int8Array]",Gd="[object Int16Array]",zd="[object Int32Array]",Kd="[object Uint8Array]",Yd="[object Uint8ClampedArray]",Qd="[object Uint16Array]",qd="[object Uint32Array]",z={};z[za]=z[_d]=z[Ud]=z[Vd]=z[Td]=z[Nd]=z[Bd]=z[Hd]=z[Wd]=z[Gd]=z[zd]=z[Rd]=z[Ld]=z[Ya]=z[Fd]=z[kd]=z[Md]=z[Dd]=z[Kd]=z[Yd]=z[Qd]=z[qd]=!0;z[Id]=z[Ka]=z[jd]=!1;function tr(e,t,r,n,i,o){var a,s=t&xd,u=t&Ad,l=t&Cd;if(r&&(a=i?r(e,n,i,o):r(e)),a!==void 0)return a;if(!lt(e))return e;var f=wt(e);if(f){if(a=Hf(e),!s)return kl(e,a)}else{var c=Pt(e),g=c==Ka||c==$d;if(Vt(e))return wf(e,s);if(c==Ya||c==za||g&&!i){if(a=u||g?{}:md(e),!s)return u?Nf(e,Sf(a,e)):Cf(e,bf(a,e))}else{if(!z[c])return i?e:{};a=hd(e,c,s)}}o||(o=new Ge);var d=o.get(e);if(d)return d;o.set(e,a),Pd(e)?e.forEach(function(b){a.add(tr(b,t,r,b,e,o))}):Sd(e)&&e.forEach(function(b,h){a.set(h,tr(b,t,r,h,e,o))});var p=l?u?If:yn:u?Gn:Wn,y=f?void 0:p(e);return Dl(y||e,function(b,h){y&&(h=b,b=e[h]),Ia(a,h,tr(b,t,r,h,e,o))}),a}var Jd=1,Zd=4;function Qa(e){return tr(e,Jd|Zd)}var Xd="__lodash_hash_undefined__";function eg(e){return this.__data__.set(e,Xd),this}function tg(e){return this.__data__.has(e)}function hr(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new pt;++t<r;)this.add(e[t])}hr.prototype.add=hr.prototype.push=eg;hr.prototype.has=tg;function rg(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function ng(e,t){return e.has(t)}var ig=1,og=2;function qa(e,t,r,n,i,o){var a=r&ig,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;var l=o.get(e),f=o.get(t);if(l&&f)return l==t&&f==e;var c=-1,g=!0,d=r&og?new hr:void 0;for(o.set(e,t),o.set(t,e);++c<s;){var p=e[c],y=t[c];if(n)var b=a?n(y,p,c,t,e,o):n(p,y,c,e,t,o);if(b!==void 0){if(b)continue;g=!1;break}if(d){if(!rg(t,function(h,v){if(!ng(d,v)&&(p===h||i(p,h,r,n,o)))return d.push(v)})){g=!1;break}}else if(!(p===y||i(p,y,r,n,o))){g=!1;break}}return o.delete(e),o.delete(t),g}function ag(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function sg(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var ug=1,lg=2,cg="[object Boolean]",fg="[object Date]",dg="[object Error]",gg="[object Map]",pg="[object Number]",hg="[object RegExp]",mg="[object Set]",vg="[object String]",yg="[object Symbol]",bg="[object ArrayBuffer]",Sg="[object DataView]",eo=tt?tt.prototype:void 0,nn=eo?eo.valueOf:void 0;function Og(e,t,r,n,i,o,a){switch(r){case Sg:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case bg:return!(e.byteLength!=t.byteLength||!o(new pr(e),new pr(t)));case cg:case fg:case pg:return Un(+e,+t);case dg:return e.name==t.name&&e.message==t.message;case hg:case vg:return e==t+"";case gg:var s=ag;case mg:var u=n&ug;if(s||(s=sg),e.size!=t.size&&!u)return!1;var l=a.get(e);if(l)return l==t;n|=lg,a.set(e,t);var f=qa(s(e),s(t),n,i,o,a);return a.delete(e),f;case yg:if(nn)return nn.call(e)==nn.call(t)}return!1}var wg=1,Eg=Object.prototype,Pg=Eg.hasOwnProperty;function xg(e,t,r,n,i,o){var a=r&wg,s=yn(e),u=s.length,l=yn(t),f=l.length;if(u!=f&&!a)return!1;for(var c=u;c--;){var g=s[c];if(!(a?g in t:Pg.call(t,g)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var y=!0;o.set(e,t),o.set(t,e);for(var b=a;++c<u;){g=s[c];var h=e[g],v=t[g];if(n)var P=a?n(v,h,g,t,e,o):n(h,v,g,e,t,o);if(!(P===void 0?h===v||i(h,v,r,n,o):P)){y=!1;break}b||(b=g=="constructor")}if(y&&!b){var E=e.constructor,w=t.constructor;E!=w&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof w=="function"&&w instanceof w)&&(y=!1)}return o.delete(e),o.delete(t),y}var Ag=1,to="[object Arguments]",ro="[object Array]",Jt="[object Object]",Cg=Object.prototype,no=Cg.hasOwnProperty;function _g(e,t,r,n,i,o){var a=wt(e),s=wt(t),u=a?ro:Pt(e),l=s?ro:Pt(t);u=u==to?Jt:u,l=l==to?Jt:l;var f=u==Jt,c=l==Jt,g=u==l;if(g&&Vt(e)){if(!Vt(t))return!1;a=!0,f=!1}if(g&&!f)return o||(o=new Ge),a||Hn(e)?qa(e,t,r,n,i,o):Og(e,t,u,r,n,i,o);if(!(r&Ag)){var d=f&&no.call(e,"__wrapped__"),p=c&&no.call(t,"__wrapped__");if(d||p){var y=d?e.value():e,b=p?t.value():t;return o||(o=new Ge),i(y,b,r,n,o)}}return g?(o||(o=new Ge),xg(e,t,r,n,i,o)):!1}function Ja(e,t,r,n,i){return e===t?!0:e==null||t==null||!rt(e)&&!rt(t)?e!==e&&t!==t:_g(e,t,r,n,Ja,i)}var Tg=Math.max,Ng=Math.min;function Ig(e,t,r){return e>=Ng(t,r)&&e<Tg(t,r)}function mr(e,t,r){return t=Ri(t),r===void 0?(r=t,t=0):r=Ri(r),e=_a(e),Ig(e,t,r)}var $g="[object Map]",Rg="[object Set]",Lg=Object.prototype,Fg=Lg.hasOwnProperty;function $e(e){if(e==null)return!0;if(Vn(e)&&(wt(e)||typeof e=="string"||typeof e.splice=="function"||Vt(e)||Hn(e)||La(e)))return!e.length;var t=Pt(e);if(t==$g||t==Rg)return!e.size;if(xr(e))return!ja(e).length;for(var r in e)if(Fg.call(e,r))return!1;return!0}function kg(e,t){return Ja(e,t)}const Mg=["id","selCtx","fltCtx"],Za=".",Xa="#dot",es="#FIX_NUMBER",Dg=e=>rs(Qa(e),Vg),jg=e=>{const t=e.replaceAll(Za,Xa);return/^\d+$/.test(t)?`${es}${t}`:t},Ug=e=>e.replaceAll(Xa,Za).replaceAll(es,""),Vg=(e,t)=>ts(e,t,jg),Bg=(e,t)=>ts(e,t,Ug),ts=(e,t,r)=>{let n=t;function i(o){const a={};for(const s in o)if(o.hasOwnProperty(s)){const u=r(s);let l=o[s];typeof o[s]=="object"&&o[s]!==null&&(l=i(o[s])),a[u]=l}return a}return Mg.includes(e)&&(typeof t=="string"||t instanceof String)&&(n=r(t)),(e==="selected"||e==="filter")&&(n=i(t)),n},rs=(e,t)=>(Object.keys(e).forEach(r=>{const n=e[r];e[r]=t(r,n),typeof n=="object"&&n!==null&&rs(n,t)}),e),ns=e=>{const t=JSON.parse(JSON.stringify(e));for(const[r,n]of Object.entries(t))if(n&&!Array.isArray(n)){const i=t[r];for(const[o,a]of Object.entries(i))a===!1&&delete i[o];Object.keys(i).length===0&&delete t[r]}else delete t[r];return t},Hg=e=>Bg("selected",e);var io;(function(e){e.UNINITIALIZED="UNINITIALIZED",e.PROCESSING="PROCESSING",e.PAID="PAID",e.FAILED="FAILED",e.PRINTING_RECEIPT="PRINTING_RECEIPT",e.PRINTING_RECEIPT_SUCCESS="PRINTING_RECEIPT_SUCCESS",e.SENDING_RECEIPT="SENDING_RECEIPT",e.SENDING_RECEIPT_SUCCESS="SENDING_RECEIPT_SUCCESS",e.ERROR="ERROR"})(io||(io={}));var oo;(function(e){e.CAROUSEL="carousel",e.NORMAL="normal",e.IMAGE="image"})(oo||(oo={}));var Me;(function(e){e.GROUP="3e/group",e.PRODUCT="3e/product",e.CATEGORY="3e/group/category",e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.STATIC="3e/static",e.REF="3e/ref",e.QUERY="3e/query",e.CMS="3e/cms"})(Me||(Me={}));var ao;(function(e){e.GROUP="group",e.PRODUCT="product"})(ao||(ao={}));var so;(function(e){e.CREATOR="CREATOR",e.CUSTOMER="CUSTOMER",e.COUPONS="COUPON",e.KIOSK="KIOSK",e.WAITER="WAITER",e.MANAGER="MANAGER",e.VIEWER="VIEWER",e.DRIVER="DRIVER",e.STAFF="STAFF"})(so||(so={}));var uo;(function(e){e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.DINE_IN="DINE_IN",e.DINE_IN_OPEN="DINE_IN_OPEN",e.GLOVO_DELIVERY="GLOVO_DELIVERY",e.GLOVO_TAKE_AWAY="GLOVO_TAKE_AWAY",e.JUSTEAT_DELIVERY="JUSTEAT_DELIVERY",e.JUSTEAT_TAKE_AWAY="JUSTEAT_TAKE_AWAY",e.UBER_DELIVERY="UBER_DELIVERY",e.UBER_TAKE_AWAY="UBER_TAKE_AWAY",e.UBER_DINE_IN="UBER_DINE_IN",e.WOLT_DELIVERY="WOLT_DELIVERY",e.WOLT_TAKE_AWAY="WOLT_TAKE_AWAY",e.WOLT_DINE_IN="WOLT_DINE_IN",e.BOLT_DELIVERY="BOLT_DELIVERY",e.BOLT_TAKE_AWAY="BOLT_TAKE_AWAY",e.BOLT_DINE_IN="BOLT_DINE_IN",e.TAZZ_DELIVERY="TAZZ_DELIVERY",e.TAZZ_TAKE_AWAY="TAZZ_TAKE_AWAY",e.UPMENU_DELIVERY="UPMENU_DELIVERY",e.UPMENU_TAKE_AWAY="UPMENU_TAKE_AWAY",e.UPMENU_DINE_IN="UPMENU_DINE_IN"})(uo||(uo={}));var lo;(function(e){e.KIOSK="KIOSK",e.WEB="WEB",e.JUST_EAT_TAKE_AWAY="JUSTEATTAKEAWAY",e.GLOVO="GLOVO",e.PYSZNE="PYSZNE",e.WOLT="WOLT",e.UBER="UBER",e.BOLT="BOLT",e.TAZZ="TAZZ",e.POS="POS",e.UPMENU="UPMENU",e.APP="APP"})(lo||(lo={}));var co;(function(e){e.DINE_IN="DINE_IN",e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.GLOVO="GLOVO",e.JUSTEAT="JUSTEAT",e.UBER="UBER",e.BOLT="BOLT",e.WOLT="WOLT",e.TAZZ="TAZZ",e.UPMENU="UPMENU"})(co||(co={}));var fo;(function(e){e.NEW="NEW",e.COMPLETED="COMPLETED",e.VERIFIED="VERIFIED",e.DELIVER="DELIVER",e.DELIVERED="DELIVERED",e.CLOSED="CLOSED",e.ABANDONED="ABANDONED",e.CANCELLED="CANCELLED",e.PICKED="PICKED"})(fo||(fo={}));var go;(function(e){e.CASH="CASH",e.CARD="CARD",e.COD="COD",e.TERMINAL="TERMINAL",e.EPAYMENT="EPAYMENT",e.COUPON="COUPON",e.WALLET="WALLET",e.PREAUTHORIZED="PREAUTHORIZED",e.RETURN="RETURN",e.EXTERNAL="EXTERNAL"})(go||(go={}));var po;(function(e){e.POINTS_TOTAL="x-rbi-loyalty-points",e.POINTS_EARNED="x-rbi-points-earned",e.REWARDS="x-rbi-rewards",e.OFFERS="x-rbi-offers",e.CUSTOMER_NAME="x-customer-name"})(po||(po={}));var ho;(function(e){e.NEW="NEW",e.TECHNICAL="TECHNICAL",e.CONFIRMED="CONFIRMED",e.PROCESSING="PROCESSING",e.PROCESSED="PROCESSED",e.VOID="VOID",e.WASTE="WASTE"})(ho||(ho={}));var mo;(function(e){e.GROUP="group",e.PRODUCT="product"})(mo||(mo={}));var vo;(function(e){e.ORDER_MESSAGE="OrderMessage",e.ORDER_EVENT_ERROR="OrderEventError",e.ORDER_APPLIED_EVENTS="OrderAppliedEvents",e.ORDER_EVENT_FISCAL="OrderEventFiscal",e.ORDER_UPSELL="OrderUpsell"})(vo||(vo={}));const Wg=e=>e==="true"||e===!0,Gg=e=>`options--${e}`,is=e=>{const{details:{media:t=[]}={}}=e,r=t.find(n=>n.name==="MAIN_IMG")||t[0]||{};return(r==null?void 0:r.url)||""},yo=e=>{var r,n;return!(((r=e==null?void 0:e.attrs)==null?void 0:r.hidden)===!0||((n=e==null?void 0:e._)==null?void 0:n.hidden)==="true")};function os(e,t){var r;if(!t.items)return null;for(let n=0;n<((r=t.items)==null?void 0:r.length);n++){const i=t.items[n];if(i.selCtx===e&&i.kind===Me.OPTIONS)return i;if(i.items&&i.items.length>0){const o=os(e,i);if(o)return o}}return null}function zg(e){let t;const r=new Set,n=(l,f)=>{const c=typeof l=="function"?l(t):l;if(c!==t){const g=t;t=f?c:Object.assign({},t,c),r.forEach(d=>d(t,g))}},i=()=>t,o=(l,f=i,c=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let g=f(t);function d(){const p=f(t);if(!c(g,p)){const y=g;l(g=p,y)}}return r.add(d),()=>r.delete(d)},u={setState:n,getState:i,subscribe:(l,f,c)=>f||c?o(l,f,c):(r.add(l),()=>r.delete(l)),destroy:()=>r.clear()};return t=e(n,i,u),u}const Kg=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),bo=Kg?S.useEffect:S.useLayoutEffect;function Yg(e){const t=typeof e=="function"?zg(e):e,r=(n=t.getState,i=Object.is)=>{const[,o]=S.useReducer(b=>b+1,0),a=t.getState(),s=S.useRef(a),u=S.useRef(n),l=S.useRef(i),f=S.useRef(!1),c=S.useRef();c.current===void 0&&(c.current=n(a));let g,d=!1;(s.current!==a||u.current!==n||l.current!==i||f.current)&&(g=n(a),d=!i(c.current,g)),bo(()=>{d&&(c.current=g),s.current=a,u.current=n,l.current=i,f.current=!1});const p=S.useRef(a);bo(()=>{const b=()=>{try{const v=t.getState(),P=u.current(v);l.current(c.current,P)||(s.current=v,c.current=P,o())}catch{f.current=!0,o()}},h=t.subscribe(b);return t.getState()!==p.current&&b(),h},[]);const y=d?g:c.current;return S.useDebugValue(y),y};return Object.assign(r,t),r[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const n=[r,t];return{next(){const i=n.length<=0;return{value:n.shift(),done:i}}}},r}const Qg=e=>({filter:{},initialSelected:{},setInitialFilter:t=>{e(()=>({filter:{...t}}))},setInitialSelected:t=>{e(()=>({initialSelected:t}))},setFilter:(t,r)=>{e(({filter:n})=>({filter:{...n,[t]:{...n[t],...r}}}))}}),qg=(e,t)=>vr(e,t,"isSelCntAllowedToIncrement")&&vr(e,t,"isQtyCntAllowedToIncrement")&&wn(e,t,"isQtyCntAllowedToIncrement")&&wn(e,t,"isQtyCntAllowedToIncrement"),Jg=(e,t,r)=>{var o;const{selCtx:n}=e;return((o=r==null?void 0:r[n])==null?void 0:o.parentKind)===Dn.PRODUCT?So(e,t)&&vr(e,r,"isQtyCntAllowedToIncrement"):So(e,t)&&vr(e,r,"isQtyCntAllowedToIncrement")&&wn(e,r,"isQtyCntAllowedToIncrement")},So=(e,t)=>{const{qtyMax:r}=e;return Number(t)<Number(r||Number.MAX_SAFE_INTEGER)},vr=(e,t,r)=>{var o;const{selCtx:n}=e,i=(o=t==null?void 0:t[n])==null?void 0:o[r];return as(i)?!0:i},wn=(e,t,r)=>{var s;const{selCtx:n}=e,i=(s=t==null?void 0:t[n])==null?void 0:s.parentSelCtx,o=t==null?void 0:t[i],a=o==null?void 0:o[r];return as(a)?!0:a},as=e=>typeof e=="undefined",ss=(e,t,r)=>{const n=t[e];let i=0,o=0;if(n)for(const[,a]of Object.entries(n))parseInt(a)>0&&(i+=1,o+=Number(a));else r&&r.forEach(a=>{if(t[a.selCtx])for(const[,s]of Object.entries(t[a.selCtx]))parseInt(s)>0&&(i+=1,o+=Number(s))});return[i,o]},Zg=(e,t)=>{var i;const{id:r,selCtx:n}=e;return Number(((i=t==null?void 0:t[n])==null?void 0:i[r])||0)},Xg=(e,t)=>({validationMap:{},isOnSubmitted:!1,currency:"z\u0142",refreshFormDt:"",setInitialValidate:()=>{e(()=>({validationMap:{},isOnSubmitted:!1}))},setValidationMap:r=>{const{productSelCtx:n,attrs:i,actualSelCnt:o,actualQtyCnt:a,isPassedFiltering:s,nestedLvl:u,parentSelCtx:l,parentKind:f}=r,{qtyMin:c,qtyMax:g,selMin:d,selMax:p}=i||{};(g||p)&&e(({validationMap:b})=>({validationMap:{...b,[n]:{parentSelCtx:l,isSelCntAllowedToIncrement:o<Number(p||Number.MAX_SAFE_INTEGER),isQtyCntAllowedToIncrement:a<Number(g||Number.MAX_SAFE_INTEGER),parentKind:f,nestedLvl:u,isValid:mr(o,Number(d||0),Number(p||Number.MAX_SAFE_INTEGER)+1)&&mr(a,Number(c||0),Number(g||Number.MAX_SAFE_INTEGER)+1),isPassedFiltering:s}}}))},isInputEnabled:r=>{const n=t().validationMap;return qg(r,n)},isInputCounterIncrementEnabled:(r,n)=>{const i=t().validationMap,o=Zg(r,n);return Jg(r,o,i)},getInvalidSelCtxArray:()=>{const r=t().validationMap,n=[];for(const[i]of Object.entries(r)){const{isValid:o,isPassedFiltering:a}=r[i];o===!1&&a===!0&&n.push(i)}return n},setIsOnSubmittedOnTrue:()=>{console.log("isOnSubmitted"),e(()=>({isOnSubmitted:!0}))},getValidationMap:()=>t().validationMap,setCurrency:r=>{e(()=>({currency:r}))},refreshForm:()=>{e(()=>({refreshFormDt:`${new Date}`}))}}),ep=(e,t)=>({expanded:{},toggleExpanded:(r,n,i)=>{const o=t().expanded[r+n+i];e(()=>({expanded:{...t().expanded,[r+n+i]:o!==void 0?!o:!1}}))},resetExpanded:()=>{e(()=>({expanded:{}}))}}),re=Yg((e,t)=>({...Qg(e),...Xg(e,t),...ep(e,t)}));function us(e,t){if(!t)return null;for(const r of t){if(r.id===e)return r;if(r.items){const n=us(e,r.items);if(n)return n}}return null}function tp(e,t){return us(e,t)!==null}function rp(e,t){if(t==null||$e(t))return{};try{const r=Qa(t);for(const[n,i]of Object.entries(r))i&&typeof i=="object"&&!Array.isArray(i)&&Object.keys(i).forEach(o=>{tp(o,e.items)||(console.warn(`deleting selected selCtx ${n} id ${o}, not found in product`),delete r[n][o])});return ns(r)}catch(r){return console.error(r),t}}function np(e){var h;const[t,r]=S.useState(Number(e.quantity)||1),n=Dg(e),{state:{filter:i={}}={}}=n,o=rp(n,(h=n.state)==null?void 0:h.selected),a=re(v=>v.setInitialFilter),s=re(v=>v.setInitialSelected),u=re(v=>v.setInitialValidate),l=re(v=>v.resetExpanded),f=re(v=>v.filter),c=re(v=>v.setCurrency),g=re(v=>v.setIsOnSubmittedOnTrue),d=re(v=>v.refreshFormDt),p=re(v=>v.getInvalidSelCtxArray),y=()=>{r(v=>v+1)},b=()=>{t>1&&r(v=>v-1)};return S.useEffect(()=>{u(),a(i),s(o),l()},[e]),{encodedProduct:n,initSelected:o,initFilter:i,filter:f,setCurrency:c,setIsOnSubmittedOnTrue:g,getInvalidSelCtxArray:p,productQuantity:t,increaseProductQuantity:y,decreaseProductQuantity:b,refreshFormDt:d}}const _r=(e,t)=>{var a;const{filter:r={},fltCtx:n=""}=e,i=(t==null?void 0:t[n])||{};if(!r||!Object.keys(r).length||!i)return!0;const o=(a=Object.keys(i))==null?void 0:a.filter(s=>{var l;const u=(l=Object.keys((r==null?void 0:r[s])||{}))==null?void 0:l.filter(f=>{var c;if(((c=r==null?void 0:r[s])==null?void 0:c[f])===(i==null?void 0:i[s]))return!0});return(u==null?void 0:u.length)>0});return(o==null?void 0:o.length)>0},ls=(e,t)=>{const{items:r,filter:n}=e,i=[],o=[],a=s=>{s&&!$e(n)&&s.forEach(u=>{const{items:l=[]}=u;t?i.push(u):o.push(u),l.length>0&&a(l)})};return a(r),{productsToSelect:i,productsToUnselect:o}},ip=(e,t)=>{e.map(({selCtx:r,id:n})=>{t(`selected.${r}.${n}`,!1)})},cs=(e,t,r)=>{e.map(({selCtx:n,id:i})=>{var a;const o=(a=r[n])==null?void 0:a[i];o&&t(`selected.${n}.${i}`,o.toString())})};function fs(e,t,r,n){const{selCtx:i,attrs:o={}}=e,a=re(h=>h.initialSelected),s=re(h=>h.currency),{setValue:u,getValues:l}=Ke(),{selected:f={},filter:c={}}=l(),g=_r(e,c),d=re(h=>h.isOnSubmitted),p=re(h=>h.setValidationMap),[y,b]=ss(e.selCtx,f,e.items);return p({productSelCtx:i,attrs:o,actualQtyCnt:b,actualSelCnt:y,nestedLvl:t,isPassedFiltering:g,parentSelCtx:n,parentKind:r}),S.useEffect(()=>{const{productsToSelect:h,productsToUnselect:v}=ls(e,g);cs(h,u,a)},[g]),{isFilterValidated:g,selected:f,isOnSubmitted:d,selCnt:y,qtyCnt:b,currency:s}}var Tr={exports:{}},Nr={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.min.js
5
5
  *
@@ -7,9 +7,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
7
7
  *
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
- */var yp=T.default,bp=Symbol.for("react.element"),Sp=Symbol.for("react.fragment"),Op=Object.prototype.hasOwnProperty,wp=yp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ep={key:!0,ref:!0,__self:!0,__source:!0};function vs(e,t,r){var n,i={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)Op.call(t,n)&&!Ep.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:bp,type:e,key:a,ref:o,props:i,_owner:wp.current}}kr.Fragment=Sp;kr.jsx=vs;kr.jsxs=vs;Mr.exports=kr;const A=Mr.exports.jsx,B=Mr.exports.jsxs,Ge=Mr.exports.Fragment;function Aa(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&&xp,r&&Pp,n]})}const xp=A("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:A("polyline",{points:"20 6 9 17 4 12"})}),Pp=A("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","data-testid":"form-exclamation-mark",children:A("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 Ap={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},Cp={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 zt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zt=function(t){return typeof t}:zt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(e)}function Ca(e){return _p(e)||Tp(e)||Np(e)||$p()}function _p(e){if(Array.isArray(e))return e}function Tp(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function Np(e,t){if(!!e){if(typeof e=="string")return _a(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 _a(e,t)}}function _a(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 $p(){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 Ip={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=Ca(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.lessThan(o)?a:o}),a},maximum:function(t){var r=Ca(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.greaterThan(o)?a:o}),a}};function ys(e){return!isNaN(parseInt(e))&&isFinite(e)}function Lp(e){return ys(e)&&e<=100&&e>=0}function Rp(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function Ta(e){return e%2===0}function Na(e){return ys(e)&&!Number.isInteger(e)}function Fp(){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 kt(e){return Math.abs(e)%1===.5}function Dp(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),Mp(i,t.headers),i.send()})}function Mp(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 Wt(e){return typeof e=="undefined"}function bs(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(n){if(zt(n[1])==="object"){var i=bs(n[1]);Object.entries(i).forEach(function(a){r[n[0]+t+a[0]]=a[1]})}else r[n[0]]=n[1]}),r}function kp(e){return Boolean(e)&&(zt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function Ss(){var e=function(n,i){var a=function(u){return Math.pow(10,Fp(u))},o=Math.max(a(n),a(i));return Math.round(n*o)*Math.round(i*o)/(o*o)},t={HALF_ODD:function(n){var i=Math.round(n);return kt(n)&&Ta(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return kt(n)?Ta(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return kt(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return kt(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return kt(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 Na(n)||Na(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 jp=Ss();function Vp(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!Wt(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return Wt(this.getMatches().find(n))?0:this.getMatches()[jp.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 Wt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Wt(this.getMatches().find(function(n){return n===","}))}}}function Up(e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var o in a)i=i.replace("{{".concat(o,"}}"),a[o]);return i},r=function(i,a){return Dp(t(e.endpoint,{from:i,to:a}),{headers:e.headers})};return{getExchangeRate:function(i,a){return(kp(e.endpoint)?e.endpoint:r(i,a)).then(function(o){return bs(o)[t(e.propertyPath,{from:i,to:a})]})}}}function Zt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function Bp(e){Zt(Lp(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Hp(e){Zt(Rp(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function cn(e){Zt(Number.isInteger(e),"You must provide an integer.",TypeError)}var Z=Ss(),Wp=function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),n=r.amount,i=r.currency,a=r.precision;cn(n),cn(a);var o=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,f=e.globalFormatRoundingMode,c=Object.assign({},e.globalExchangeRatesApi),l=function(p){var y=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},p),Object.assign({},{locale:this.locale},p));return Object.assign(e({amount:y.amount,currency:y.currency,precision:y.precision}),{locale:y.locale})},d=function(p){Zt(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||o},setLocale:function(p){return l.call(this,{locale:p})},getPrecision:function(){return a},convertPrecision:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;cn(p);var v=this.getPrecision(),b=p>v,h=b?Z.multiply:Z.divide,E=b?[p,v]:[v,p],C=Math.pow(10,Z.subtract.apply(Z,E));return l.call(this,{amount:Z.round(h(this.getAmount(),C),y),precision:p})},add:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return l.call(this,{amount:Z.add(y[0].getAmount(),y[1].getAmount()),precision:y[0].getPrecision()})},subtract:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return l.call(this,{amount:Z.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 l.call(this,{amount:Z.round(Z.multiply(this.getAmount(),p),y)})},divide:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:Z.round(Z.divide(this.getAmount(),p),y)})},percentage:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return Bp(p),this.multiply(Z.divide(p,100),y)},allocate:function(p){var y=this;Hp(p);for(var v=p.reduce(function(C,w){return Z.add(C,w)}),b=this.getAmount(),h=p.map(function(C){var w=Math.floor(Z.divide(Z.multiply(y.getAmount(),C),v));return b=Z.subtract(b,w),l.call(y,{amount:w})}),E=0;b>0;)p[E]>0&&(h[E]=h[E].add(l.call(this,{amount:1})),b=Z.subtract(b,1)),E+=1;return h},convert:function(p){var y=this,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b=v.endpoint,h=b===void 0?c.endpoint:b,E=v.propertyPath,C=E===void 0?c.propertyPath||"rates.{{to}}":E,w=v.headers,P=w===void 0?c.headers:w,_=v.roundingMode,L=_===void 0?u:_,F=Object.assign({},{endpoint:h,propertyPath:C,headers:P,roundingMode:L});return Up(F).getExchangeRate(this.getCurrency(),p).then(function(k){return Zt(!Wt(k),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(y,{amount:Z.round(Z.multiply(y.getAmount(),parseFloat(k)),F.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()<y[1].getAmount()},lessThanOrEqual:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()<=y[1].getAmount()},greaterThan:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()>y[1].getAmount()},greaterThanOrEqual:function(p){d.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 Z.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return Z.modulo(this.getAmount(),Math.pow(10,a))!==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]:f,v=Vp(p);return this.toRoundedUnit(v.getMinimumFractionDigits(),y).toLocaleString(this.getLocale(),{currencyDisplay:v.getCurrencyDisplay(),useGrouping:v.getUseGrouping(),minimumFractionDigits:v.getMinimumFractionDigits(),style:v.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Z.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,v=Math.pow(10,p);return Z.divide(Z.round(Z.multiply(this.toUnit(),v),y),v)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},Gp=Object.assign(Wp,Ap,Cp,Ip);const pr=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),n=Number(r)*100;return isNaN(n)?"0.00":Gp({amount:Math.round(n),currency:t}).toFormat("0,0.00")},Kp=(e,t,r=1)=>{const n=parseFloat(e.toString());let i=!1,a=pr(`${r*n}`);const o=`${pr(`${a}`)}`;return n<parseFloat(t)&&(i=!0,a=`${pr(`${t}`)}`),{displayPriceFrom:i,formattedEndPriceWithPriceMin:a,formattedEndPrice:o}};function jr(e){const{price:t,addPlusBefore:r=!1,size:n="md",showIfPriceZero:i=!1,minPrice:a="0.00",hiddenIfPriceZero:o=!1}=e,s=parseFloat(a),u=t>s?t:a,f=pr(`${u}`);return!t&&i===!1?null:r?B("span",{style:{visibility:`${!t&&o?"hidden":"visible"}`},className:"",children:["\xA0",`+${f}`]}):t<s?B("span",{className:"",children:["\xA0",`od ${f}`]}):A("span",{className:"",children:f})}function Yp(e,t){const{selCtx:r,id:n}=e,i=ne(s=>s.expanded),a=S.useMemo(()=>zp(r,n,t,i),[r,n,t,i]),o=ne(s=>s.toggleExpanded);return{isExpanded:a,toggleExpanded:o}}const zp=(e,t,r,n)=>{const i=n[e+t+r];return i!==void 0?i:!0};var Qp=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qp={"&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;":"/"},Jp=function(t){return qp[t]},Zp=function(t){return t.replace(Qp,Jp)};function $a(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 Ia(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$a(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$a(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var _n={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Zp},Os,Xp=S.createContext();function eh(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_n=Ia(Ia({},_n),e)}function th(){return _n}var rh=function(){function e(){$e(this,e),this.usedNamespaces={}}return Ie(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 nh(e){Os=e}function ih(){return Os}var ah={type:"3rdParty",init:function(t){eh(t.options.react),nh(t)}};function oh(){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 La={};function Tn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&La[t[0]]||(typeof t[0]=="string"&&(La[t[0]]=new Date),oh.apply(void 0,t))}function Ra(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 sh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.languages[0],i=t.options?t.options.fallbackLng:!1,a=t.languages[t.languages.length-1];if(n.toLowerCase()==="cimode")return!0;var o=function(u,f){var c=t.services.backendConnector.state["".concat(u,"|").concat(f)];return c===-1||c===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(n,e)&&(!i||o(a,e)))}function uh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Tn("i18n.languages were undefined or empty",t.languages),!0;var n=t.options.ignoreJSONStructure!==void 0;return n?t.hasLoadedNamespace(e,{precheck:function(a,o){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!o(a.isLanguageChangingTo,e))return!1}}):sh(e,t,r)}function lh(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,f=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(c){f=!0,i=c}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return s}}function ch(e,t){return Qa(e)||lh(e,t)||qa(e,t)||Ja()}function Fa(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 fn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fa(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var fh=function(t,r){var n=S.useRef();return S.useEffect(function(){n.current=r?n.current:t},[t,r]),n.current};function ti(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,n=S.useContext(Xp)||{},i=n.i18n,a=n.defaultNS,o=r||i||ih();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new rh),!o){Tn("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}o.options.react&&o.options.react.wait!==void 0&&Tn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var f=fn(fn(fn({},th()),o.options.react),t),c=f.useSuspense,l=f.keyPrefix,d=e||a||o.options&&o.options.defaultNS;d=typeof d=="string"?[d]:d||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(d);var g=(o.isInitialized||o.initializedStoreOnce)&&d.every(function(L){return uh(L,o,f)});function p(){return o.getFixedT(null,f.nsMode==="fallback"?d:d[0],l)}var y=S.useState(p),v=ch(y,2),b=v[0],h=v[1],E=d.join(),C=fh(E),w=S.useRef(!0);S.useEffect(function(){var L=f.bindI18n,F=f.bindI18nStore;w.current=!0,!g&&!c&&Ra(o,d,function(){w.current&&h(p)}),g&&C&&C!==E&&w.current&&h(p);function k(){w.current&&h(p)}return L&&o&&o.on(L,k),F&&o&&o.store.on(F,k),function(){w.current=!1,L&&o&&L.split(" ").forEach(function(W){return o.off(W,k)}),F&&o&&F.split(" ").forEach(function(W){return o.store.off(W,k)})}},[o,E]);var P=S.useRef(!0);S.useEffect(function(){w.current&&!P.current&&h(p),P.current=!1},[o,l]);var _=[b,o,g];if(_.t=b,_.i18n=o,_.ready=g,g||!g&&!c)return _;throw new Promise(function(L){Ra(o,d,function(){L()})})}var ws=[],dh=ws.forEach,gh=ws.slice;function ph(e){return dh.call(gh.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var Da=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,hh=function(t,r,n){var i=n||{};i.path=i.path||"/";var a=encodeURIComponent(r),o="".concat(t,"=").concat(a);if(i.maxAge>0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!Da.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(i.domain)}if(i.path){if(!Da.test(i.path))throw new TypeError("option path is invalid");o+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.sameSite){var u=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(u){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},Ma={create:function(t,r,n,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+n*60*1e3)),i&&(a.domain=i),document.cookie=hh(t,encodeURIComponent(r),a)},read:function(t){for(var r="".concat(t,"="),n=document.cookie.split(";"),i=0;i<n.length;i++){for(var a=n[i];a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(r)===0)return a.substring(r.length,a.length)}return null},remove:function(t){this.create(t,"",-1)}},mh={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var n=Ma.read(t.lookupCookie);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&Ma.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},vh={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),a=i.split("&"),o=0;o<a.length;o++){var s=a[o].indexOf("=");if(s>0){var u=a[o].substring(0,s);u===t.lookupQuerystring&&(r=a[o].substring(s+1))}}}return r}},jt=null,ka=function(){if(jt!==null)return jt;try{jt=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{jt=!1}return jt},yh={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&ka()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&ka()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},Vt=null,ja=function(){if(Vt!==null)return Vt;try{Vt=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Vt=!1}return Vt},bh={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&ja()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&ja()&&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}},Oh={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}},wh={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}},Eh={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 xh(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Es=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$e(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return Ie(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=ph(n,this.options||{},xh()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(mh),this.addDetector(vh),this.addDetector(yh),this.addDetector(bh),this.addDetector(Sh),this.addDetector(Oh),this.addDetector(wh),this.addDetector(Eh)}},{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(a){if(n.detectors[a]){var o=n.detectors[a].lookup(n.options);o&&typeof o=="string"&&(o=[o]),o&&(i=i.concat(o))}}),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(a){i.detectors[a]&&i.detectors[a].cacheUserLanguage(r,i.options)}))}}]),e}();Es.type="languageDetector";const Ph={"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"},Ah={"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"},Ch={"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"},_h={"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"};ve.use(Es).use(ah).init({resources:{pl:{translation:Ph},en:{translation:Ah},de:{translation:Ch},cs:{translation:_h}}});const Th=(e,t,r,n)=>{let i="",a="";const o=Number(e),s=Number(t);return o>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.From")} ${o}`,o>r&&(a=Te.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(a=Te.TOO_MUCH)),o>=0||s>=0&&r<o?(i=`${n("OS.ProductConfigurator.Quantity.Message.Max")}${i}`,i+=` ${n("OS.ProductConfigurator.Quantity.Message.Quantity")}`):o===1&&o===1?i=`${n("OS.ProductConfigurator.Quantity.Message.OneOption")}`:(i="",a=Te.IGNORE),r>=o&&r<=s&&(a=Te.OK),{message:i,validationStatus:a}},Nh=(e,t,r,n)=>{let i="",a="";const o=parseInt(e||"-1"),s=parseInt(t||"-1");return o>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.From")} ${o}`,o>r&&(a=Te.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(a=Te.TOO_MUCH)),o>=0||s>=0?(i=`${n("OS.ProductConfigurator.Selected.Message.Choose")}${i}`,i+=` ${n("OS.ProductConfigurator.Selected.Message.Options")}`):(i="",a=Te.IGNORE),o===1&&s===1&&(i=`${n("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=o&&r<=s&&(a=Te.OK),{message:i,validationStatus:a}},$h=e=>{const{optionsItem:t,parentSelCtx:r,selected:n,isOnSubmitted:i,actualQtyCnt:a,actualSelCnt:o,children:s}=e,{selCtx:u,details:f={},id:c,attrs:l={}}=t,{qtyMin:d,qtyMax:g,selMin:p,selMax:y}=l,{name:v,description:b}=f.literals||{},{t:h}=ti(),{isExpanded:E,toggleExpanded:C}=Yp(t,r),{validationStatus:w,message:P}=Nh(p,y,o,h),{validationStatus:_,message:L}=Th(d,g,a,h),F=w===Te.OK,k=_===Te.OK,W=!F&&i&&!!P,D=!k&&i&&!!L;return B("div",{className:"pt-1 mb-3",id:ls(u),children:[B("div",{className:"flex text-xl font-semibold",children:[A("p",{className:"",children:v}),v&&v!==" "&&B(Ge,{children:[A("div",{className:"ml-auto",children:A(jr,{price:Gn(n,t)})}),A("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!E&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>C(u,c,r),children:A("polyline",{points:"18 15 12 9 6 15"})})]})]}),A("p",{className:`${b&&"mb-2"}`,children:b}),!1,A("div",{className:"flex",children:B("div",{children:[A(Aa,{isOk:F,isErr:W,info:P}),A(Aa,{isOk:k,isErr:D,info:L})]})}),A("div",{className:`${E?"block":"hidden"}`,children:s})]})},xs=T.default.createContext(null);function Vr(){const e=S.useContext(xs);if(!e)throw new Error("Missing ComponentsContext");return e}const Ih=e=>{const{optionsItem:t,parentSelCtx:r,nestedLvl:n,parentKind:i,rootProduct:a}=e,{isFilterValidated:o,selected:s,isOnSubmitted:u,selCnt:f,qtyCnt:c,currency:l}=ms(t,n,i,r),{MenuOptionsUI:d}=Vr();if(!o)return null;const g=A(ri,{productItems:t.items,parentProduct:t,rootProduct:a}),p={optionsItem:t,parentSelCtx:r,selected:s,isOnSubmitted:u,actualQtyCnt:c,actualSelCnt:f,currency:l};return d?A(d,{...p,children:g}):A($h,{...p,children:g})},Lh=e=>{const{product:t,inputId:r,isDisabled:n,registerProps:i,size:a="lg",children:o}=e,{details:{literals:s}={}}=t,{name:u="",description:f=""}=s||{},c=No(t),l=cs(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:[A("input",{type:"checkbox",className:`simple-checkbox checkbox-${a} mr-4`,id:r,disabled:n,value:"1",...i}),l&&A("div",{className:"flex w-20 mr-2 max-h-24",children:A("img",{alt:"Product image",className:"h-auto max-w-full",src:l})}),A("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:B("div",{className:"relative",children:[A("p",{className:"w-full text-lg font-semibold",children:u}),A("p",{className:"text-sm text-gray-600",children:f})]})}),A("div",{className:"ml-auto",children:o}),A("label",{htmlFor:r,children:A(jr,{price:parseFloat(c),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})},Rh=e=>{const{product:t,inputId:r,inputValue:n,registerProps:i,isChecked:a,size:o="lg",children:s}=e,{details:{literals:u}={}}=t,{name:f="",description:c=""}=u||{},l=No(t),d=cs(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:[A("input",{type:"radio",className:`simple-radio radio-${o} mr-4`,id:r,...i,value:n,checked:a}),d&&A("div",{className:"flex w-20 mr-2 max-h-24",children:A("img",{alt:"Product image",className:"h-auto max-w-full",src:d})}),A("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:B("div",{className:"relative",children:[A("p",{className:"w-full text-lg font-semibold",children:f}),A("p",{className:"text-sm text-gray-600",children:c})]})}),A("div",{className:"ml-auto",children:s}),A("label",{htmlFor:r,children:A(jr,{price:parseFloat(l||"0"),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})};function Ps(e){const{value:t=0,add:r,subtract:n,disabledSubtract:i,disabledAdd:a,size:o="md"}=e;return B("div",{className:`counter counter-${o} flex flex-row justify-center items-center p-1 border-[1px] rounded-md border-[rgba(229,231,235,255)] product-quantity`,children:[A("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:[A("path",{stroke:"none",d:"M0 0h24v24H0z"}),A("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),A("span",{className:"font-semibold text-gray-700 product-quantity-value",children:t}),A("button",{className:"quantity-button small",type:"button",onClick:r,disabled:a,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:[A("path",{stroke:"none",d:"M0 0h24v24H0z"}),A("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),A("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function Fh(e,t,r){const{watch:n,setValue:i,getValues:a,unregister:o}=Ye(),{id:s,selCtx:u,emit:f={},fltCtx:c}=e,l=n(`selected.${u}.${s}`);return S.useEffect(()=>{var y,v,b;if(!r||r>1)return;const d=`filterWithCnt.${c}`,g=`filterWithCnt.${c}.${u}`,p=`filter.${c}`;if(t&&l&&c)if(He(f)){const h=a(g);(y=Object.keys(h||{}))==null||y.forEach(E=>{o(`${g}.${E}`);const C=Object.keys(a(d)||{});He(C)?o(`${p}.${E}`):C.forEach(w=>{w!==u&&!a(`${d}.${w}.${E}`)&&o(`${p}.${E}`)})});return}else{const h=a(g),E=a(d);(v=Object.keys(f))==null||v.forEach(C=>{var w;(w=Object.keys(h||{}))==null||w.forEach(P=>{f[P]||(o(`${p}.${P}`),o(`${g}.${P}`))}),Object.keys(E||{}).forEach(P=>{P!==u&&C in a(d==null?void 0:d[P])&&o(`${d}.${P}.${C}`)}),i(`${p}.${C}`,f[C]),i(`${g}.${C}`,{cnt:1,value:f[C]})});return}l&&c&&!He(f)&&((b=Object.keys(f))==null||b.forEach(h=>{i(`filter.${c}.${h}`,f[h]);const E=a(`${g}.${h}.cnt`)||0;i(`${g}.${h}`,{cnt:E+1,value:f[h]})}))},[l]),{}}function Dh(){const e=ne(n=>n.getInvalidSelCtxArray),t=ne(n=>n.isInputEnabled),r=ne(n=>n.isInputCounterIncrementEnabled);return{getInvalidSelCtxArray:e,isInputEnabled:t,isInputCounterIncrementEnabled:r}}const Va=(e,t)=>{Object.keys(e).forEach(r=>{t(`selected.${r}`,e[r])})},Nn=(e,t,r)=>{const n=t(`selected.${e}`);r(`selected.${e}`,Object.keys(n).reduce((i,a)=>(i[a]=!1,i),{}))},Mh=(e,t,r,n,i,a)=>{var d,g;const{items:o,state:s,emit:u,fltCtx:f,selCtx:c}=r,{selected:l={}}=s||{};if(console.log("selected/unselected product",r,n),n){Va(l,e);const p=y=>{var v;!Array.isArray(y)||He(s==null?void 0:s.selected)||(v=y==null?void 0:y.filter(b=>{var h,E;return!!((E=(h=s.selected)==null?void 0:h[`${b.selCtx}`])!=null&&E[`${b.id}`])}))==null||v.map(b=>{if(b.state&&"selected"in b.state){const{state:{selected:h}}=b;Va(h,e)}Array.isArray(b.items)&&p(b.items)})};p(o)}else{Object.keys(l).forEach(y=>{Nn(y,t,e)});const p=y=>{!Array.isArray(y)||y.map(v=>{const{selCtx:b}=v;t(`selected.${b}`)&&Nn(b,t,e),p(v.items)})};if(p(o),a&&a<2&&!He(u)){(d=Object.keys(u))==null||d.forEach(h=>{const E=`filterWithCnt.${f}.${h}.${u[h]}`,C=t(E)||0;C<2?i(E):e(E,C-1)});const y=`filterWithCnt.${f}`,v=`filterWithCnt.${f}.${c}`,b=`filter.${f}`;(g=Object.keys(u))==null||g.forEach(h=>{var C,w,P;const E=t(`${v}.${h}`)||0;if(E)if(E>1)e(`${v}.${h}`,E-1);else{i(`${v}.${h}`);const _=t(y)||{},L=(C=Object.keys(_))==null?void 0:C.filter(F=>F!==c);if(!L)i(`${b}.${h}`);else{const F=L==null?void 0:L.find(k=>{var W;return!!((W=_==null?void 0:_[`${k}`])!=null&&W[`${h}`])});if(!F)i(`${b}.${h}`);else{const k=(P=(w=_==null?void 0:_[`${F}`])==null?void 0:w[`${h}`])==null?void 0:P.value;e(`${b}.${h}`,k)}}}})}}};function kh(e,t,r){var ge;const{id:n,selCtx:i,emit:a={},fltCtx:o}=e,{allowMultiple:s,selMin:u,selMax:f}=t,{isInputEnabled:c,isInputCounterIncrementEnabled:l}=Dh(),d=ne(ee=>ee.refreshForm),g=ne(ee=>ee.currency),{watch:p,getValues:y,setValue:v,register:b,unregister:h}=Ye(),E=p(`selected.${i}.${n}`),{selected:C={}}=y(),w=Number(E||0),P=u==="1"&&f==="1",_=!P,L=rp(s),F=w>(P?1:0),k=Fh(e,P,r);l(e,C)&&c(e);const W=Number(((ge=C==null?void 0:C[i])==null?void 0:ge[n])||0)>0,D=c(e)||w,j=`${P?"radio":"selected"}.${i}.${n}`,V=b(j,{onChange:ee=>{G(ee)}}),H=()=>{v(`selected.${i}.${n}`,`${w+1}`)},Q=()=>{var le,ae;const ee=w-1;if(v(`selected.${i}.${n}`,`${ee}`),_&&ee===0){v(`selected.${i}.${n}`,!1),(le=Object.keys(a))==null||le.forEach(pe=>{const K=`filterWithCnt.${o}.${pe}.${a[pe]}`,he=y(K)||0;he<2?h(K):v(K,he-1)});const ce=pe=>{!Array.isArray(pe)||pe.map(K=>{const{selCtx:he}=K;y(`selected.${he}`)&&Nn(he,y,v),ce(K.items)})};if(ce(e.items),r&&r<2&&!He(a)){const pe=`filterWithCnt.${o}`,K=`filterWithCnt.${o}.${i}`,he=`filter.${o}`;(ae=Object.keys(a))==null||ae.forEach(ie=>{var Ce,Re,ke;const Ee=y(`${K}.${ie}`)||0;if(Ee)if(Ee>1)v(`${K}.${ie}`,Ee-1);else{h(`${K}.${ie}`);const U=y(pe)||{},oe=(Ce=Object.keys(U))==null?void 0:Ce.filter(re=>re!==i);if(!oe)h(`${he}.${ie}`);else{const re=oe==null?void 0:oe.find(Se=>{var Gr;return!!((Gr=U==null?void 0:U[`${Se}`])!=null&&Gr[`${ie}`])});if(!re)h(`${he}.${ie}`);else{const Se=(ke=(Re=U==null?void 0:U[`${re}`])==null?void 0:Re[`${ie}`])==null?void 0:ke.value;v(`${he}.${ie}`,Se)}}}})}}},G=ee=>{const{target:{checked:le,name:ae,defaultValue:ce}}=ee;if(Mh(v,y,e,le,h,r),P){console.log("handleOnInputChange radio",ae,ce);const pe="selected."+ae.replace("radio.","").split(".")[0];v(pe,{[ce]:"1"}),d()}};return{registerProps:V,isRadio:P,isCheckbox:_,isCounter:L,isDecrementEnabled:F,isIncrementEnabled:k,isChecked:W,isCheckboxEnabled:D,handleCounterIncrementQty:H,handleCounterDecrementQty:Q,counterValue:w,handleOnInputChange:G,inputId:`${i}.${n}`,radioInputValue:n,currency:g}}const jh=e=>{const{product:t,parentAttrs:r,nestedLvl:n,parentProduct:i,rootProduct:a}=e,{registerProps:o,inputId:s,radioInputValue:u,isRadio:f,isCheckbox:c,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:g,isChecked:p,isCheckboxEnabled:y,counterValue:v,handleCounterIncrementQty:b,handleCounterDecrementQty:h,currency:E}=kh(t,r,n),{MenuProductUI:C}=Vr(),w={product:t,nestedLvl:n,registerProps:o,inputId:s,radioInputValue:u,isRadio:f,isCheckbox:c,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:g,isChecked:p,isCheckboxEnabled:y,counterValue:v,handleCounterIncrementQty:b,handleCounterDecrementQty:h,currency:E,parentProduct:i},P=A(ri,{productItems:t.items,parentProduct:t,nestedLvl:n+1,rootProduct:a});return C?A(C,{...w,children:P}):A(Vh,{...w,children:P})},Vh=e=>{const{product:t,nestedLvl:r,registerProps:n,inputId:i,radioInputValue:a,isRadio:o,isCheckbox:s,isCounter:u,isDecrementEnabled:f,isIncrementEnabled:c,isChecked:l,isCheckboxEnabled:d,counterValue:g,handleCounterIncrementQty:p,handleCounterDecrementQty:y,children:v}=e,b=A(Ps,{value:g,add:p,subtract:y,disabledSubtract:!f,disabledAdd:!c}),h=()=>o?A(Rh,{product:t,inputId:i,inputValue:a,registerProps:n,isChecked:l,children:A(Ge,{children:u&&b})}):s?A(Lh,{product:t,inputId:i,registerProps:n,isDisabled:!d,children:A(Ge,{children:u&&b})}):null,E=!He(t.items)&&g,C=ci.useTransition(E,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});return B("div",{children:[h(),E?C((w,P)=>P&&A(ci.animated.div,{className:`border-l-[2px] border-gray-300 ${r>=1&&"ml-4 pl-4"}`,style:w,children:v},r+1)):null]})};function Uh(){return{isMenuProductToShow:r=>r.kind===ht.PRODUCT&&Ea(r),isMenuOptionsToShow:r=>[ht.OPTIONS,ht.CONFIG].includes(r.kind)&&Ea(r)}}function ri(e){const{productItems:t,nestedLvl:r=1,parentProduct:n,rootProduct:i}=e,{attrs:a={},selCtx:o,kind:s}=n,{isMenuProductToShow:u,isMenuOptionsToShow:f}=Uh(),{MenuItemsUI:c}=Vr(),d={productItems:t,parentProduct:n,renderMenuItem:g=>f(g)?A(Ih,{optionsItem:g,parentSelCtx:o,parentKind:s,nestedLvl:r,rootProduct:i}):u(g)?A(jh,{product:g,parentAttrs:a,parentProduct:n,nestedLvl:r,rootProduct:i}):A(Ge,{}),rootProduct:i};return c?A(c,{...d}):A(Bh,{...d})}function Bh(e){const{productItems:t,parentProduct:r,renderMenuItem:n}=e,i=r.kind!==ht.PRODUCT,a=99,o=3,[s,u]=S.useState(i?o:a),{t:f}=ti(),c=()=>{u(a)},l=()=>{u(o)};return A(Ge,{children:t.map((d,g)=>{if(g<s)return B("div",{children:[n(d),s===a&&i&&t.length===g+1&&Ua(f("OS.ProductConfigurator.ShowLess"),l,!1)]},`${r.id}--${d.id}--${g}`);if(g===s)return Ua(f("OS.ProductConfigurator.ShowMore"),c,!0)})})}const Ua=(e,t,r)=>A("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:[A("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",A("polyline",{points:"7 7 12 12 17 7"})," ",A("polyline",{points:"7 13 12 18 17 13"})]})]})},`${e}`),As=()=>{const{watch:e}=Ye(),t=e("selected"),r=e("filter"),n=e("filterWithCnt"),i=ne(a=>a.validationMap);return console.log({selected:t,validationMap:i,filter:r,filterWithCnt:n}),B("div",{className:"flex flex-col items-center py-4",children:[A("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(t).map(a=>A("div",{children:Object.values(t[a]).filter(o=>o).length>0&&B(Ge,{children:[B("p",{className:"text-lg font-semibold",children:[a,":"]}),Object.keys(t[a]).map(o=>A(T.default.Fragment,{children:t[a][o]&&B("p",{children:[o,":",t[a][o].toString()]})},o))]})},a))]})};function Ba(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:n,displayPriceFrom:i=!1,productQuantity:a,increaseProductQuantity:o,decreaseProductQuantity:s,handleOnSubmit:u}=e,{t:f}=ti();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:[A("path",{stroke:"none",d:"M0 0h24v24H0z"}),A("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),A("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),A("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),A("span",{className:"uppercase",children:`${f("OS.ProductConfigurator.Back")}`})]}),A("div",{className:"px-3",children:A(Ps,{value:a,add:o,subtract:s,disabledSubtract:a===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:[A("circle",{cx:"9",cy:"21",r:"1"})," ",A("circle",{cx:"20",cy:"21",r:"1"}),A("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),i?A("span",{children:`${f("OS.ProductConfigurator.Selected.Message.From")} ${t}`}):A("span",{className:"uppercase",children:`${f("OS.ProductConfigurator.Add")} ${t}`})]})]})}const lr=640,Cs=e=>{const{isModal:t=!1}=e,[r,n]=S.useState(window.innerWidth),[i,a]=S.useState(window.innerHeight),[o,s]=S.useState(window.innerWidth<=lr),[u,f]=S.useState(window.innerWidth>lr&&!t);function c(){n(window.innerWidth),a(window.innerHeight)}return S.useEffect(()=>(window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}),[]),S.useEffect(()=>{f(window.innerWidth>lr&&!t),s(window.innerWidth<=lr)},[r,e,t]),{isSm:u,isMobile:o,width:r,windowHeight:i}};function _s(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=_s(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Ut(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=_s(e))&&(n&&(n+=" "),n+=t);return n}var Hh=Object.defineProperty,Wh=(e,t,r)=>t in e?Hh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dn=(e,t,r)=>(Wh(e,typeof t!="symbol"?t+"":t,r),r);class Gh{constructor(){dn(this,"current",this.detect()),dn(this,"handoffState","pending"),dn(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window=="undefined"||typeof document=="undefined"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}}let Je=new Gh,Ne=(e,t)=>{Je.isServer?S.useEffect(e,t):S.useLayoutEffect(e,t)};function Ze(e){let t=S.useRef(e);return Ne(()=>{t.current=e},[e]),t}let te=function(e){let t=Ze(e);return T.default.useCallback((...r)=>t.current(...r),[t])};function Ur(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function wt(){let e=[],t={addEventListener(r,n,i,a){return r.addEventListener(n,i,a),t.add(()=>r.removeEventListener(n,i,a))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Ur(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,i){let a=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:a})})},group(r){let n=wt();return r(n),this.add(()=>n.dispose())},add(r){return e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let i of e.splice(n,1))i()}},dispose(){for(let r of e.splice(0))r()}};return t}function ni(){let[e]=S.useState(wt);return S.useEffect(()=>()=>e.dispose(),[e]),e}function Kh(){let e=typeof document=="undefined";return"useSyncExternalStore"in ot?(t=>t.useSyncExternalStore)(ot)(()=>()=>{},()=>!1,()=>!e):!1}function Lt(){let e=Kh(),[t,r]=ot.useState(Je.isHandoffComplete);return t&&Je.isHandoffComplete===!1&&r(!1),ot.useEffect(()=>{t!==!0&&r(!0)},[t]),ot.useEffect(()=>Je.handoff(),[]),e?!1:t}var Ha;let Rt=(Ha=T.default.useId)!=null?Ha:function(){let e=Lt(),[t,r]=T.default.useState(e?()=>Je.nextId():null);return Ne(()=>{t===null&&r(Je.nextId())},[t]),t!=null?""+t:void 0};function me(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,me),n}function Ts(e){return Je.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let $n=["[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 dt=(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))(dt||{}),Ns=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Ns||{}),Yh=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Yh||{});function zh(e=document.body){return e==null?[]:Array.from(e.querySelectorAll($n)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var $s=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))($s||{});function Qh(e,t=0){var r;return e===((r=Ts(e))==null?void 0:r.body)?!1:me(t,{[0](){return e.matches($n)},[1](){let n=e;for(;n!==null;){if(n.matches($n))return!0;n=n.parentElement}return!1}})}var qh=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(qh||{});typeof window!="undefined"&&typeof document!="undefined"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function mt(e){e==null||e.focus({preventScroll:!0})}let Jh=["textarea","input"].join(",");function Zh(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Jh))!=null?r:!1}function Xh(e,t=r=>r){return e.slice().sort((r,n)=>{let i=t(r),a=t(n);if(i===null||a===null)return 0;let o=i.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function hr(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?r?Xh(e):e:zh(e);i.length>0&&o.length>1&&(o=o.filter(g=>!i.includes(g))),n=n!=null?n:a.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,o.indexOf(n))-1;if(t&4)return Math.max(0,o.indexOf(n))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=t&32?{preventScroll:!0}:{},c=0,l=o.length,d;do{if(c>=l||c+l<=0)return 0;let g=u+c;if(t&16)g=(g+l)%l;else{if(g<0)return 3;if(g>=l)return 1}d=o[g],d==null||d.focus(f),c+=s}while(d!==a.activeElement);return t&6&&Zh(d)&&d.select(),2}function Is(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function em(){return/Android/gi.test(window.navigator.userAgent)}function tm(){return Is()||em()}function cr(e,t,r){let n=Ze(t);S.useEffect(()=>{function i(a){n.current(a)}return document.addEventListener(e,i,r),()=>document.removeEventListener(e,i,r)},[e,r])}function Ls(e,t,r){let n=Ze(t);S.useEffect(()=>{function i(a){n.current(a)}return window.addEventListener(e,i,r),()=>window.removeEventListener(e,i,r)},[e,r])}function rm(e,t,r=!0){let n=S.useRef(!1);S.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function i(o,s){if(!n.current||o.defaultPrevented)return;let u=s(o);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let f=function c(l){return typeof l=="function"?c(l()):Array.isArray(l)||l instanceof Set?l:[l]}(e);for(let c of f){if(c===null)continue;let l=c instanceof HTMLElement?c:c.current;if(l!=null&&l.contains(u)||o.composed&&o.composedPath().includes(l))return}return!Qh(u,$s.Loose)&&u.tabIndex!==-1&&o.preventDefault(),t(o,u)}let a=S.useRef(null);cr("pointerdown",o=>{var s,u;n.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),cr("mousedown",o=>{var s,u;n.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),cr("click",o=>{tm()||a.current&&(i(o,()=>a.current),a.current=null)},!0),cr("touchend",o=>i(o,()=>o.target instanceof HTMLElement?o.target:null),!0),Ls("blur",o=>i(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function rr(...e){return S.useMemo(()=>Ts(...e),[...e])}let Rs=Symbol();function nm(e,t=!0){return Object.assign(e,{[Rs]:t})}function Me(...e){let t=S.useRef(e);S.useEffect(()=>{t.current=e},[e]);let r=te(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[Rs]))?void 0:r}function ii(e,t){let r=S.useRef([]),n=te(e);S.useEffect(()=>{let i=[...r.current];for(let[a,o]of t.entries())if(r.current[a]!==o){let s=n(t,i);return r.current=t,s}},[n,...t])}function Ar(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Cr=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Cr||{}),at=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(at||{});function Le({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:a=!0,name:o,mergeRefs:s}){s=s!=null?s:im;let u=Fs(t,e);if(a)return fr(u,r,n,o,s);let f=i!=null?i:0;if(f&2){let{static:c=!1,...l}=u;if(c)return fr(l,r,n,o,s)}if(f&1){let{unmount:c=!0,...l}=u;return me(c?0:1,{[0](){return null},[1](){return fr({...l,hidden:!0,style:{display:"none"}},r,n,o,s)}})}return fr(u,r,n,o,s)}function fr(e,t={},r,n,i){let{as:a=r,children:o,refName:s="ref",...u}=gn(e,["unmount","static"]),f=e.ref!==void 0?{[s]:e.ref}:{},c=typeof o=="function"?o(t):o;"className"in u&&u.className&&typeof u.className=="function"&&(u.className=u.className(t));let l={};if(t){let d=!1,g=[];for(let[p,y]of Object.entries(t))typeof y=="boolean"&&(d=!0),y===!0&&g.push(p);d&&(l["data-headlessui-state"]=g.join(" "))}if(a===S.Fragment&&Object.keys(Wa(u)).length>0){if(!S.isValidElement(c)||Array.isArray(c)&&c.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(u).map(y=>` - ${y}`).join(`
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(y=>` - ${y}`).join(`
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 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
+ `),"","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
- `));let d=c.props,g=typeof(d==null?void 0:d.className)=="function"?(...y)=>Ar(d==null?void 0:d.className(...y),u.className):Ar(d==null?void 0:d.className,u.className),p=g?{className:g}:{};return S.cloneElement(c,Object.assign({},Fs(c.props,Wa(gn(u,["ref"]))),l,f,{ref:i(c.ref,f.ref)},p))}return S.createElement(a,Object.assign({},gn(u,["ref"]),a!==S.Fragment&&f,a!==S.Fragment&&l),c)}function im(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function Fs(...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,...a){let o=r[n];for(let s of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;s(i,...a)}}});return t}function Ae(e){var t;return Object.assign(S.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Wa(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function gn(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}let am="div";var _r=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(_r||{});function om(e,t){var r;let{features:n=1,...i}=e,a={ref:t,"aria-hidden":(n&2)===2?!0:(r=i["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!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",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Le({ourProps:a,theirProps:i,slot:{},defaultTag:am,name:"Hidden"})}let In=Ae(om),ai=S.createContext(null);ai.displayName="OpenClosedContext";var Pe=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Pe||{});function oi(){return S.useContext(ai)}function sm({value:e,children:t}){return T.default.createElement(ai.Provider,{value:e},t)}function um(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window!="undefined"&&typeof document!="undefined"&&(document.addEventListener("DOMContentLoaded",t),t())}let nt=[];um(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&nt[0]!==t.target&&(nt.unshift(t.target),nt=nt.filter(r=>r!=null&&r.isConnected),nt.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function lm(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&&cm(r)?!1:n}function cm(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}var Ds=(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))(Ds||{});function Ms(e,t,r,n){let i=Ze(r);S.useEffect(()=>{e=e!=null?e:window;function a(o){i.current(o)}return e.addEventListener(t,a,n),()=>e.removeEventListener(t,a,n)},[e,t,n])}function nr(){let e=S.useRef(!1);return Ne(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function ks(e){let t=te(e),r=S.useRef(!1);S.useEffect(()=>(r.current=!1,()=>{r.current=!0,Ur(()=>{r.current&&t()})}),[t])}var Gt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Gt||{});function fm(){let e=S.useRef(0);return Ls("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function js(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}let dm="div";var Vs=(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))(Vs||{});function gm(e,t){let r=S.useRef(null),n=Me(r,t),{initialFocus:i,containers:a,features:o=30,...s}=e;Lt()||(o=1);let u=rr(r);mm({ownerDocument:u},Boolean(o&16));let f=vm({ownerDocument:u,container:r,initialFocus:i},Boolean(o&2));ym({ownerDocument:u,container:r,containers:a,previousActiveElement:f},Boolean(o&8));let c=fm(),l=te(y=>{let v=r.current;!v||(b=>b())(()=>{me(c.current,{[Gt.Forwards]:()=>{hr(v,dt.First,{skipElements:[y.relatedTarget]})},[Gt.Backwards]:()=>{hr(v,dt.Last,{skipElements:[y.relatedTarget]})}})})}),d=ni(),g=S.useRef(!1),p={ref:n,onKeyDown(y){y.key=="Tab"&&(g.current=!0,d.requestAnimationFrame(()=>{g.current=!1}))},onBlur(y){let v=js(a);r.current instanceof HTMLElement&&v.add(r.current);let b=y.relatedTarget;b instanceof HTMLElement&&b.dataset.headlessuiFocusGuard!=="true"&&(Us(v,b)||(g.current?hr(r.current,me(c.current,{[Gt.Forwards]:()=>dt.Next,[Gt.Backwards]:()=>dt.Previous})|dt.WrapAround,{relativeTo:y.target}):y.target instanceof HTMLElement&&mt(y.target)))}};return T.default.createElement(T.default.Fragment,null,Boolean(o&4)&&T.default.createElement(In,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:l,features:_r.Focusable}),Le({ourProps:p,theirProps:s,defaultTag:dm,name:"FocusTrap"}),Boolean(o&4)&&T.default.createElement(In,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:l,features:_r.Focusable}))}let pm=Ae(gm),Bt=Object.assign(pm,{features:Vs});function hm(e=!0){let t=S.useRef(nt.slice());return ii(([r],[n])=>{n===!0&&r===!1&&Ur(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=nt.slice())},[e,nt,t]),te(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function mm({ownerDocument:e},t){let r=hm(t);ii(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&mt(r())},[t]),ks(()=>{t&&mt(r())})}function vm({ownerDocument:e,container:t,initialFocus:r},n){let i=S.useRef(null),a=nr();return ii(()=>{if(!n)return;let o=t.current;o&&Ur(()=>{if(!a.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(o.contains(s)){i.current=s;return}r!=null&&r.current?mt(r.current):hr(o,dt.First)===Ns.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=e==null?void 0:e.activeElement})},[n]),i}function ym({ownerDocument:e,container:t,containers:r,previousActiveElement:n},i){let a=nr();Ms(e==null?void 0:e.defaultView,"focus",o=>{if(!i||!a.current)return;let s=js(r);t.current instanceof HTMLElement&&s.add(t.current);let u=n.current;if(!u)return;let f=o.target;f&&f instanceof HTMLElement?Us(s,f)?(n.current=f,mt(f)):(o.preventDefault(),o.stopPropagation(),mt(u)):mt(n.current)},!0)}function Us(e,t){for(let r of e)if(r.contains(t))return!0;return!1}let Bs=S.createContext(!1);function bm(){return S.useContext(Bs)}function Ln(e){return T.default.createElement(Bs.Provider,{value:e.force},e.children)}function Sm(e){let t=bm(),r=S.useContext(Hs),n=rr(e),[i,a]=S.useState(()=>{if(!t&&r!==null||Je.isServer)return null;let o=n==null?void 0:n.getElementById("headlessui-portal-root");if(o)return o;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&&a(r.current)},[r,a,t]),i}let Om=S.Fragment;function wm(e,t){let r=e,n=S.useRef(null),i=Me(nm(c=>{n.current=c}),t),a=rr(n),o=Sm(n),[s]=S.useState(()=>{var c;return Je.isServer?null:(c=a==null?void 0:a.createElement("div"))!=null?c:null}),u=S.useContext(Rn),f=Lt();return Ne(()=>{!o||!s||o.contains(s)||(s.setAttribute("data-headlessui-portal",""),o.appendChild(s))},[o,s]),Ne(()=>{if(s&&u)return u.register(s)},[u,s]),ks(()=>{var c;!o||!s||(s instanceof Node&&o.contains(s)&&o.removeChild(s),o.childNodes.length<=0&&((c=o.parentElement)==null||c.removeChild(o)))}),f?!o||!s?null:Xs.createPortal(Le({ourProps:{ref:i},theirProps:r,defaultTag:Om,name:"Portal"}),s):null}let Em=S.Fragment,Hs=S.createContext(null);function xm(e,t){let{target:r,...n}=e,i={ref:Me(t)};return T.default.createElement(Hs.Provider,{value:r},Le({ourProps:i,theirProps:n,defaultTag:Em,name:"Popover.Group"}))}let Rn=S.createContext(null);function Pm(){let e=S.useContext(Rn),t=S.useRef([]),r=te(a=>(t.current.push(a),e&&e.register(a),()=>n(a))),n=te(a=>{let o=t.current.indexOf(a);o!==-1&&t.current.splice(o,1),e&&e.unregister(a)}),i=S.useMemo(()=>({register:r,unregister:n,portals:t}),[r,n,t]);return[t,S.useMemo(()=>function({children:a}){return T.default.createElement(Rn.Provider,{value:i},a)},[i])]}let Am=Ae(wm),Cm=Ae(xm),Fn=Object.assign(Am,{Group:Cm});function _m(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const Tm=typeof Object.is=="function"?Object.is:_m,{useState:Nm,useEffect:$m,useLayoutEffect:Im,useDebugValue:Lm}=ot;function Rm(e,t,r){const n=t(),[{inst:i},a]=Nm({inst:{value:n,getSnapshot:t}});return Im(()=>{i.value=n,i.getSnapshot=t,pn(i)&&a({inst:i})},[e,n,t]),$m(()=>(pn(i)&&a({inst:i}),e(()=>{pn(i)&&a({inst:i})})),[e]),Lm(n),n}function pn(e){const t=e.getSnapshot,r=e.value;try{const n=t();return!Tm(r,n)}catch{return!0}}function Fm(e,t,r){return t()}const Dm=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",Mm=!Dm,km=Mm?Fm:Rm,jm="useSyncExternalStore"in ot?(e=>e.useSyncExternalStore)(ot):km;function Vm(e){return jm(e.subscribe,e.getSnapshot,e.getSnapshot)}function Um(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(i){return n.add(i),()=>n.delete(i)},dispatch(i,...a){let o=t[i].call(r,...a);o&&(r=o,n.forEach(s=>s()))}}}function Bm(){let e;return{before({doc:t}){var r;let n=t.documentElement;e=((r=t.defaultView)!=null?r:window).innerWidth-n.clientWidth},after({doc:t,d:r}){let n=t.documentElement,i=n.clientWidth-n.offsetWidth,a=e-i;r.style(n,"paddingRight",`${a}px`)}}}function Hm(){return Is()?{before({doc:e,d:t,meta:r}){function n(i){return r.containers.flatMap(a=>a()).some(a=>a.contains(i))}t.microTask(()=>{var i;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=wt();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let a=(i=window.scrollY)!=null?i:window.pageYOffset,o=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let u=s.target.closest("a");if(!u)return;let{hash:f}=new URL(u.href),c=e.querySelector(f);c&&!n(c)&&(o=c)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(n(s.target)){let u=s.target;for(;u.parentElement&&n(u.parentElement);)u=u.parentElement;t.style(u,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement)if(n(s.target)){let u=s.target;for(;u.parentElement&&u.dataset.headlessuiPortal!==""&&!(u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth);)u=u.parentElement;u.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()},{passive:!1}),t.add(()=>{var s;let u=(s=window.scrollY)!=null?s:window.pageYOffset;a!==u&&window.scrollTo(0,a),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{}}function Wm(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Gm(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let pt=Um(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:wt(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n={doc:e,d:t,meta:Gm(r)},i=[Hm(),Bm(),Wm()];i.forEach(({before:a})=>a==null?void 0:a(n)),i.forEach(({after:a})=>a==null?void 0:a(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});pt.subscribe(()=>{let e=pt.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",i=r.count!==0;(i&&!n||!i&&n)&&pt.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&pt.dispatch("TEARDOWN",r)}});function Km(e,t,r){let n=Vm(pt),i=e?n.get(e):void 0,a=i?i.count>0:!1;return Ne(()=>{if(!(!e||!t))return pt.dispatch("PUSH",e,r),()=>pt.dispatch("POP",e,r)},[t,e]),a}let hn=new Map,Ht=new Map;function Ga(e,t=!0){Ne(()=>{var r;if(!t)return;let n=typeof e=="function"?e():e.current;if(!n)return;function i(){var o;if(!n)return;let s=(o=Ht.get(n))!=null?o:1;if(s===1?Ht.delete(n):Ht.set(n,s-1),s!==1)return;let u=hn.get(n);u&&(u["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",u["aria-hidden"]),n.inert=u.inert,hn.delete(n))}let a=(r=Ht.get(n))!=null?r:0;return Ht.set(n,a+1),a!==0||(hn.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0),i},[e,t])}function Ym({defaultContainers:e=[],portals:t,mainTreeNodeRef:r}={}){var n;let i=S.useRef((n=r==null?void 0:r.current)!=null?n:null),a=rr(i),o=te(()=>{var s,u,f;let c=[];for(let l of e)l!==null&&(l instanceof HTMLElement?c.push(l):"current"in l&&l.current instanceof HTMLElement&&c.push(l.current));if(t!=null&&t.current)for(let l of t.current)c.push(l);for(let l of(s=a==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?s:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(l.contains(i.current)||l.contains((f=(u=i.current)==null?void 0:u.getRootNode())==null?void 0:f.host)||c.some(d=>l.contains(d))||c.push(l));return c});return{resolveContainers:o,contains:te(s=>o().some(u=>u.contains(s))),mainTreeNodeRef:i,MainTreeNode:S.useMemo(()=>function(){return r!=null?null:T.default.createElement(In,{features:_r.Hidden,ref:i})},[i,r])}}let si=S.createContext(()=>{});si.displayName="StackContext";var Dn=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Dn||{});function zm(){return S.useContext(si)}function Qm({children:e,onUpdate:t,type:r,element:n,enabled:i}){let a=zm(),o=te((...s)=>{t==null||t(...s),a(...s)});return Ne(()=>{let s=i===void 0||i===!0;return s&&o(0,r,n),()=>{s&&o(1,r,n)}},[o,r,n,i]),T.default.createElement(si.Provider,{value:o},e)}let Ws=S.createContext(null);function Gs(){let e=S.useContext(Ws);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,Gs),t}return e}function qm(){let[e,t]=S.useState([]);return[e.length>0?e.join(" "):void 0,S.useMemo(()=>function(r){let n=te(a=>(t(o=>[...o,a]),()=>t(o=>{let s=o.slice(),u=s.indexOf(a);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 T.default.createElement(Ws.Provider,{value:i},r.children)},[t])]}let Jm="p";function Zm(e,t){let r=Rt(),{id:n=`headlessui-description-${r}`,...i}=e,a=Gs(),o=Me(t);Ne(()=>a.register(n),[n,a.register]);let s={ref:o,...a.props,id:n};return Le({ourProps:s,theirProps:i,slot:a.slot||{},defaultTag:Jm,name:a.name||"Description"})}let Xm=Ae(Zm),ev=Object.assign(Xm,{});var tv=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(tv||{}),rv=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(rv||{});let nv={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Tr=S.createContext(null);Tr.displayName="DialogContext";function ir(e){let t=S.useContext(Tr);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ir),r}return t}function iv(e,t,r=()=>[document.body]){Km(e,t,n=>{var i;return{containers:[...(i=n.containers)!=null?i:[],r]}})}function av(e,t){return me(t.type,nv,e,t)}let ov="div",sv=Cr.RenderStrategy|Cr.Static;function uv(e,t){let r=Rt(),{id:n=`headlessui-dialog-${r}`,open:i,onClose:a,initialFocus:o,role:s="dialog",__demoMode:u=!1,...f}=e,[c,l]=S.useState(0),d=S.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(d.current||(d.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let g=oi();i===void 0&&g!==null&&(i=(g&Pe.Open)===Pe.Open);let p=S.useRef(null),y=Me(p,t),v=rr(p),b=e.hasOwnProperty("open")||g!==null,h=e.hasOwnProperty("onClose");if(!b&&!h)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!b)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!h)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 a!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${a}`);let E=i?0:1,[C,w]=S.useReducer(av,{titleId:null,descriptionId:null,panelRef:S.createRef()}),P=te(()=>a(!1)),_=te(U=>w({type:0,id:U})),L=Lt()?u?!1:E===0:!1,F=c>1,k=S.useContext(Tr)!==null,[W,D]=Pm(),j={get current(){var U;return(U=C.panelRef.current)!=null?U:p.current}},{resolveContainers:V,mainTreeNodeRef:H,MainTreeNode:Q}=Ym({portals:W,defaultContainers:[j]}),G=F?"parent":"leaf",ge=g!==null?(g&Pe.Closing)===Pe.Closing:!1,ee=(()=>k||ge?!1:L)(),le=S.useCallback(()=>{var U,oe;return(oe=Array.from((U=v==null?void 0:v.querySelectorAll("body > *"))!=null?U:[]).find(re=>re.id==="headlessui-portal-root"?!1:re.contains(H.current)&&re instanceof HTMLElement))!=null?oe:null},[H]);Ga(le,ee);let ae=(()=>F?!0:L)(),ce=S.useCallback(()=>{var U,oe;return(oe=Array.from((U=v==null?void 0:v.querySelectorAll("[data-headlessui-portal]"))!=null?U:[]).find(re=>re.contains(H.current)&&re instanceof HTMLElement))!=null?oe:null},[H]);Ga(ce,ae);let pe=(()=>!(!L||F))();rm(V,U=>{U.preventDefault(),P()},pe);let K=(()=>!(F||E!==0))();Ms(v==null?void 0:v.defaultView,"keydown",U=>{K&&(U.defaultPrevented||U.key===Ds.Escape&&(U.preventDefault(),U.stopPropagation(),P()))});let he=(()=>!(ge||E!==0||k))();iv(v,he,V),S.useEffect(()=>{if(E!==0||!p.current)return;let U=new ResizeObserver(oe=>{for(let re of oe){let Se=re.target.getBoundingClientRect();Se.x===0&&Se.y===0&&Se.width===0&&Se.height===0&&P()}});return U.observe(p.current),()=>U.disconnect()},[E,p,P]);let[ie,Ee]=qm(),Ce=S.useMemo(()=>[{dialogState:E,close:P,setTitleId:_},C],[E,C,P,_]),Re=S.useMemo(()=>({open:E===0}),[E]),ke={ref:y,id:n,role:s,"aria-modal":E===0?!0:void 0,"aria-labelledby":C.titleId,"aria-describedby":ie};return T.default.createElement(Qm,{type:"Dialog",enabled:E===0,element:p,onUpdate:te((U,oe)=>{oe==="Dialog"&&me(U,{[Dn.Add]:()=>l(re=>re+1),[Dn.Remove]:()=>l(re=>re-1)})})},T.default.createElement(Ln,{force:!0},T.default.createElement(Fn,null,T.default.createElement(Tr.Provider,{value:Ce},T.default.createElement(Fn.Group,{target:p},T.default.createElement(Ln,{force:!1},T.default.createElement(Ee,{slot:Re,name:"Dialog.Description"},T.default.createElement(Bt,{initialFocus:o,containers:V,features:L?me(G,{parent:Bt.features.RestoreFocus,leaf:Bt.features.All&~Bt.features.FocusLock}):Bt.features.None},T.default.createElement(D,null,Le({ourProps:ke,theirProps:f,slot:Re,defaultTag:ov,features:sv,visible:E===0,name:"Dialog"}))))))))),T.default.createElement(Q,null))}let lv="div";function cv(e,t){let r=Rt(),{id:n=`headlessui-dialog-overlay-${r}`,...i}=e,[{dialogState:a,close:o}]=ir("Dialog.Overlay"),s=Me(t),u=te(c=>{if(c.target===c.currentTarget){if(lm(c.currentTarget))return c.preventDefault();c.preventDefault(),c.stopPropagation(),o()}}),f=S.useMemo(()=>({open:a===0}),[a]);return Le({ourProps:{ref:s,id:n,"aria-hidden":!0,onClick:u},theirProps:i,slot:f,defaultTag:lv,name:"Dialog.Overlay"})}let fv="div";function dv(e,t){let r=Rt(),{id:n=`headlessui-dialog-backdrop-${r}`,...i}=e,[{dialogState:a},o]=ir("Dialog.Backdrop"),s=Me(t);S.useEffect(()=>{if(o.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[o.panelRef]);let u=S.useMemo(()=>({open:a===0}),[a]);return T.default.createElement(Ln,{force:!0},T.default.createElement(Fn,null,Le({ourProps:{ref:s,id:n,"aria-hidden":!0},theirProps:i,slot:u,defaultTag:fv,name:"Dialog.Backdrop"})))}let gv="div";function pv(e,t){let r=Rt(),{id:n=`headlessui-dialog-panel-${r}`,...i}=e,[{dialogState:a},o]=ir("Dialog.Panel"),s=Me(t,o.panelRef),u=S.useMemo(()=>({open:a===0}),[a]),f=te(c=>{c.stopPropagation()});return Le({ourProps:{ref:s,id:n,onClick:f},theirProps:i,slot:u,defaultTag:gv,name:"Dialog.Panel"})}let hv="h2";function mv(e,t){let r=Rt(),{id:n=`headlessui-dialog-title-${r}`,...i}=e,[{dialogState:a,setTitleId:o}]=ir("Dialog.Title"),s=Me(t);S.useEffect(()=>(o(n),()=>o(null)),[n,o]);let u=S.useMemo(()=>({open:a===0}),[a]);return Le({ourProps:{ref:s,id:n},theirProps:i,slot:u,defaultTag:hv,name:"Dialog.Title"})}let vv=Ae(uv),yv=Ae(dv),bv=Ae(pv),Sv=Ae(cv),Ov=Ae(mv),Ka=Object.assign(vv,{Backdrop:yv,Panel:bv,Overlay:Sv,Title:Ov,Description:ev});function wv(e=0){let[t,r]=S.useState(e),n=nr(),i=S.useCallback(u=>{n.current&&r(f=>f|u)},[t,n]),a=S.useCallback(u=>Boolean(t&u),[t]),o=S.useCallback(u=>{n.current&&r(f=>f&~u)},[r,n]),s=S.useCallback(u=>{n.current&&r(f=>f^u)},[r]);return{flags:t,addFlag:i,hasFlag:a,removeFlag:o,toggleFlag:s}}function Ev(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function mn(e,...t){e&&t.length>0&&e.classList.add(...t)}function vn(e,...t){e&&t.length>0&&e.classList.remove(...t)}function xv(e,t){let r=wt();if(!e)return r.dispose;let{transitionDuration:n,transitionDelay:i}=getComputedStyle(e),[a,o]=[n,i].map(u=>{let[f=0]=u.split(",").filter(Boolean).map(c=>c.includes("ms")?parseFloat(c):parseFloat(c)*1e3).sort((c,l)=>l-c);return f}),s=a+o;if(s!==0){r.group(f=>{f.setTimeout(()=>{t(),f.dispose()},s),f.addEventListener(e,"transitionrun",c=>{c.target===c.currentTarget&&f.dispose()})});let u=r.addEventListener(e,"transitionend",f=>{f.target===f.currentTarget&&(t(),u())})}else t();return r.add(()=>t()),r.dispose}function Pv(e,t,r,n){let i=r?"enter":"leave",a=wt(),o=n!==void 0?Ev(n):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=me(i,{enter:()=>t.enter,leave:()=>t.leave}),u=me(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),f=me(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return vn(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),mn(e,...t.base,...s,...f),a.nextFrame(()=>{vn(e,...t.base,...s,...f),mn(e,...t.base,...s,...u),xv(e,()=>(vn(e,...t.base,...s),mn(e,...t.base,...t.entered),o()))}),a.dispose}function Av({immediate:e,container:t,direction:r,classes:n,onStart:i,onStop:a}){let o=nr(),s=ni(),u=Ze(r);Ne(()=>{e&&(u.current="enter")},[e]),Ne(()=>{let f=wt();s.add(f.dispose);let c=t.current;if(c&&u.current!=="idle"&&o.current)return f.dispose(),i.current(u.current),f.add(Pv(c,n.current,u.current==="enter",()=>{f.dispose(),a.current(u.current)})),f.dispose},[r])}function rt(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Br=S.createContext(null);Br.displayName="TransitionContext";var Cv=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Cv||{});function _v(){let e=S.useContext(Br);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Tv(){let e=S.useContext(Hr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Hr=S.createContext(null);Hr.displayName="NestingContext";function Wr(e){return"children"in e?Wr(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=nr(),a=ni(),o=te((g,p=at.Hidden)=>{let y=n.current.findIndex(({el:v})=>v===g);y!==-1&&(me(p,{[at.Unmount](){n.current.splice(y,1)},[at.Hidden](){n.current[y].state="hidden"}}),a.microTask(()=>{var v;!Wr(n)&&i.current&&((v=r.current)==null||v.call(r))}))}),s=te(g=>{let p=n.current.find(({el:y})=>y===g);return p?p.state!=="visible"&&(p.state="visible"):n.current.push({el:g,state:"visible"}),()=>o(g,at.Unmount)}),u=S.useRef([]),f=S.useRef(Promise.resolve()),c=S.useRef({enter:[],leave:[],idle:[]}),l=te((g,p,y)=>{u.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([v])=>v!==g)),t==null||t.chains.current[p].push([g,new Promise(v=>{u.current.push(v)})]),t==null||t.chains.current[p].push([g,new Promise(v=>{Promise.all(c.current[p].map(([b,h])=>h)).then(()=>v())})]),p==="enter"?f.current=f.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(p)):y(p)}),d=te((g,p,y)=>{Promise.all(c.current[p].splice(0).map(([v,b])=>b)).then(()=>{var v;(v=u.current.shift())==null||v()}).then(()=>y(p))});return S.useMemo(()=>({children:n,register:s,unregister:o,onStart:l,onStop:d,wait:f,chains:c}),[s,o,n,l,d,c,f])}function Nv(){}let $v=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Ya(e){var t;let r={};for(let n of $v)r[n]=(t=e[n])!=null?t:Nv;return r}function Iv(e){let t=S.useRef(Ya(e));return S.useEffect(()=>{t.current=Ya(e)},[e]),t}let Lv="div",Ys=Cr.RenderStrategy;function Rv(e,t){var r,n;let{beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s,enter:u,enterFrom:f,enterTo:c,entered:l,leave:d,leaveFrom:g,leaveTo:p,...y}=e,v=S.useRef(null),b=Me(v,t),h=(r=y.unmount)==null||r?at.Unmount:at.Hidden,{show:E,appear:C,initial:w}=_v(),[P,_]=S.useState(E?"visible":"hidden"),L=Tv(),{register:F,unregister:k}=L;S.useEffect(()=>F(v),[F,v]),S.useEffect(()=>{if(h===at.Hidden&&v.current){if(E&&P!=="visible"){_("visible");return}return me(P,{hidden:()=>k(v),visible:()=>F(v)})}},[P,v,F,k,E,h]);let W=Ze({base:rt(y.className),enter:rt(u),enterFrom:rt(f),enterTo:rt(c),entered:rt(l),leave:rt(d),leaveFrom:rt(g),leaveTo:rt(p)}),D=Iv({beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s}),j=Lt();S.useEffect(()=>{if(j&&P==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,P,j]);let V=w&&!C,H=C&&E&&w,Q=(()=>!j||V?"idle":E?"enter":"leave")(),G=wv(0),ge=te(K=>me(K,{enter:()=>{G.addFlag(Pe.Opening),D.current.beforeEnter()},leave:()=>{G.addFlag(Pe.Closing),D.current.beforeLeave()},idle:()=>{}})),ee=te(K=>me(K,{enter:()=>{G.removeFlag(Pe.Opening),D.current.afterEnter()},leave:()=>{G.removeFlag(Pe.Closing),D.current.afterLeave()},idle:()=>{}})),le=Ks(()=>{_("hidden"),k(v)},L),ae=S.useRef(!1);Av({immediate:H,container:v,classes:W,direction:Q,onStart:Ze(K=>{ae.current=!0,le.onStart(v,K,ge)}),onStop:Ze(K=>{ae.current=!1,le.onStop(v,K,ee),K==="leave"&&!Wr(le)&&(_("hidden"),k(v))})});let ce=y,pe={ref:b};return H?ce={...ce,className:Ar(y.className,...W.current.enter,...W.current.enterFrom)}:ae.current&&(ce.className=Ar(y.className,(n=v.current)==null?void 0:n.className),ce.className===""&&delete ce.className),T.default.createElement(Hr.Provider,{value:le},T.default.createElement(sm,{value:me(P,{visible:Pe.Open,hidden:Pe.Closed})|G.flags},Le({ourProps:pe,theirProps:ce,defaultTag:Lv,features:Ys,visible:P==="visible",name:"Transition.Child"})))}function Fv(e,t){let{show:r,appear:n=!1,unmount:i=!0,...a}=e,o=S.useRef(null),s=Me(o,t);Lt();let u=oi();if(r===void 0&&u!==null&&(r=(u&Pe.Open)===Pe.Open),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[f,c]=S.useState(r?"visible":"hidden"),l=Ks(()=>{c("hidden")}),[d,g]=S.useState(!0),p=S.useRef([r]);Ne(()=>{d!==!1&&p.current[p.current.length-1]!==r&&(p.current.push(r),g(!1))},[p,r]);let y=S.useMemo(()=>({show:r,appear:n,initial:d}),[r,n,d]);S.useEffect(()=>{if(r)c("visible");else if(!Wr(l))c("hidden");else{let E=o.current;if(!E)return;let C=E.getBoundingClientRect();C.x===0&&C.y===0&&C.width===0&&C.height===0&&c("hidden")}},[r,l]);let v={unmount:i},b=te(()=>{var E;d&&g(!1),(E=e.beforeEnter)==null||E.call(e)}),h=te(()=>{var E;d&&g(!1),(E=e.beforeLeave)==null||E.call(e)});return T.default.createElement(Hr.Provider,{value:l},T.default.createElement(Br.Provider,{value:y},Le({ourProps:{...v,as:S.Fragment,children:T.default.createElement(zs,{ref:s,...v,...a,beforeEnter:b,beforeLeave:h})},theirProps:{},defaultTag:S.Fragment,features:Ys,visible:f==="visible",name:"Transition"})))}function Dv(e,t){let r=S.useContext(Br)!==null,n=oi()!==null;return T.default.createElement(T.default.Fragment,null,!r&&n?T.default.createElement(Mn,{ref:t,...e}):T.default.createElement(zs,{ref:t,...e}))}let Mn=Ae(Fv),zs=Ae(Rv),Mv=Ae(Dv),yn=Object.assign(Mn,{Child:Mv,Root:Mn});function kv(e){const{children:t,isOpen:r,handleClose:n}=e,{isMobile:i}=Cs({isModal:!0});return A(Ge,{children:A(yn,{appear:!0,show:r,as:S.Fragment,children:A(Ka,{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:[A(yn.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:A(Ka.Overlay,{className:"fixed inset-0"})}),A("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),A(yn.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:[A("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:A("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:[A("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",A("line",{x1:"5",y1:"12",x2:"19",y2:"12"})," ",A("line",{x1:"5",y1:"12",x2:"11",y2:"18"})," ",A("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]})})}),A("div",{className:"w-full",style:{height:`${i?"calc(100% - 56px)":"auto"}`},children:t})]})})]})})})})}function jv(e){var V,H,Q,G;const{product:t,isOpen:r,handleGoBack:n,showDebugState:i=!1,countedProductPrice:a,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:f,children:c}=e,{minPrice:l="0"}=t,[d,g]=S.useState("auto"),[p,y]=S.useState(0);S.useEffect(()=>{y(1);const ge=setTimeout(()=>{w||y(2)},250);return()=>{clearTimeout(ge)}},[]);const{displayPriceFrom:v,formattedEndPrice:b}=Kp(a,l,o),h=S.useRef(),E=S.useRef(),{isSm:C,isMobile:w,windowHeight:P}=Cs({isModal:!0}),_=B(Ge,{children:[B("div",{className:Ut("px-4 w-full",C&&"sm:sticky sm:top-0 sm:w-2/5"),ref:h,children:[t.details.media&&t.details.media[0].url&&A("img",{className:Ut("mx-auto mt-2 mb-6 max-h-[250px]",C&&"max-h-[450px]"),alt:t.details.literals.name,src:(V=t.details)==null?void 0:V.media[0].url}),A("div",{className:Ut(!i&&"hidden"),children:A(As,{})})]}),B("div",{className:Ut("w-full",C&&"sm:w-3/5"),ref:E,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," "]}),A(jr,{price:e.countedProductPrice,minPrice:l})]}),A("span",{className:"text-gray-600",children:(H=t.details.literals)==null?void 0:H.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:[c,A("div",{className:"sm:h-[64px]"})]}),C&&A("div",{className:"-mt-5 mb-2 bg-gray-100",children:A(Ba,{finalPrice:b,isBackIcon:!1,handleGoBack:n,displayPriceFrom:v})})]})]}),L=(Q=h==null?void 0:h.current)==null?void 0:Q.clientHeight,F=(G=E==null?void 0:E.current)==null?void 0:G.clientHeight,k=L+F;k>window.innerHeight*.8||isNaN(k)?d!=="80vh"&&g("80vh"):d!=="auto"&&g("auto");const W=`${P-64-56}px`,D=!C,j={"--mobile-submit-row-top":`${P-64-80}px`};return A(kv,{isOpen:Boolean(r),handleClose:n,children:B("div",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},children:[A("div",{className:Ut("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?W:d}`,minHeight:"400px",overflowY:"scroll"},children:_}),D&&A("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${w?"submit-row-mobile":"submit-row"}`,style:j,children:A(Ba,{handleGoBack:n,finalPrice:b,isBackIcon:!1,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:f})})]})})}const Vv=e=>{const{product:t}=e,{MenuProductRootUI:r}=Vr(),n=He(t.items)?A(Ge,{}):A(ri,{productItems:t.items,parentProduct:t,rootProduct:t});return r?A(r,{...e,children:n}):A(jv,{...e,children:n})};const Qs=T.default.createContext(null);function Uv({rootProduct:e,children:t}){return A(Qs.Provider,{value:{rootProduct:e},children:t})}function Bv(){const e=S.useContext(Qs);if(!e)throw new Error("Missing ComponentsContext");return e}function Hv(e){const{product:t,lang:r="en",handleAddToCart:n,handleGoBack:i,isOpen:a,handleClose:o,currency:s,showDebugState:u=!1}=e,{price:f}=t,{encodedProduct:c,initSelected:l,initFilter:d,productQuantity:g,setIsOnSubmittedOnTrue:p,getInvalidSelCtxArray:y,getValidationMap:v,increaseProductQuantity:b,decreaseProductQuantity:h,setCurrency:E}=mp(t),[C,w]=S.useState(v());S.useEffect(()=>{ve.changeLanguage(r)},[r]),S.useEffect(()=>{E(s)},[s]),S.useEffect(()=>{const W=v();zg(W,C)||w(W)});const P=Eo({defaultValues:{selected:l}}),{getValues:_}=P,L=Number((parseFloat(f||"0")+Gn(_("selected"),c)).toFixed(2)),F=()=>{var D;console.log("onSubmit"),p();const W=y();if(W.length)np(ls(W[0])),console.log({invalidContextNames:W});else{console.log("selected",_("selected"));const j=tp(us(_("selected"))),V=_("filter");(D=Object.keys(j||{}))==null||D.forEach(H=>{const Q=fs(H,t);Q&&(ei(Q,V)||delete j[H])}),console.log("decodedCleanedSelected: ",j),n({price:L,quantity:g,selected:j,filter:V})}},k=()=>F();return A(Ge,{children:A(Uv,{rootProduct:t,children:A(xs.Provider,{value:e.components,children:A(oo,{...P,children:B("form",{children:[u&&A("div",{className:"hidden",children:A(As,{})}),A(Vv,{product:c,productQuantity:g,validationMap:C,isOpen:a,handleClose:o,handleGoBack:i,handleOnSubmit:k,countedProductPrice:L,countedProductTotalPrice:L*g,increaseProductQuantity:b,decreaseProductQuantity:h,currency:s})]})})})})})}exports.ContextType=Hn;exports.MainView=xo;exports.ProductConfigurator=Hv;exports.ProductKinds=Wn;exports.ProductTypes=Po;exports.SelMinSelMaxStatus=Te;exports.getProductToChangeInForm=ps;exports.hookForm=Ju;exports.selectProductsInForm=hs;exports.unselectProductsInForm=vp;exports.useMenuOptions=ms;exports.useProductData=Bv;exports.validateProductFilter=ei;
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;
15
15
  //# sourceMappingURL=index.cjs.js.map