@orderingstack/front-components-product-configurator 1.5.1-beta.3 → 1.5.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +13 -2
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var S=require("react"),mi=require("react-spring"),iu=require("react-dom");function au(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}function ou(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=au(S),ut=ou(S);function ke(e){return ke=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},ke(e)}function Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function su(e,t){if(ke(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ke(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xa(e){var t=su(e,"string");return ke(t)=="symbol"?t:t+""}function vi(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,Xa(n.key),n)}}function Re(e,t,r){return t&&vi(e.prototype,t),r&&vi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function lt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xn(e,t){return xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},xn(e,t)}function Mr(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&&xn(e,t)}function rr(e,t){if(t&&(ke(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lt(e)}function Ge(e){return Ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ge(e)}function Ye(e,t,r){return(t=Xa(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eo(e){if(Array.isArray(e))return e}function uu(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yi(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 to(e,t){if(e){if(typeof e=="string")return yi(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)?yi(e,t):void 0}}function ro(){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 lu(e){return eo(e)||uu(e)||to(e)||ro()}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 Si(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){Ye(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}var cu={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)}},fu=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Le(this,e),this.init(t,r)}return Re(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||cu,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,Si(Si({},{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}(),Be=new fu,ct=function(){function e(){Le(this,e),this.observers={}}return Re(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 Dt(){var e,t,r=new Promise(function(n,i){e=n,t=i});return r.resolve=e,r.reject=t,r}function Oi(e){return e==null?"":""+e}function du(e,t,r){e.forEach(function(n){t[n]&&(r[n]=t[n])})}function Wn(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 wi(e,t,r){var n=Wn(e,t,Object),i=n.obj,a=n.k;i[a]=r}function gu(e,t,r,n){var i=Wn(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 Sr(e,t){var r=Wn(e,t),n=r.obj,i=r.k;if(!!n)return n[i]}function Ei(e,t,r){var n=Sr(e,r);return n!==void 0?n:Sr(t,r)}function no(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]):no(e[n],t[n],r):e[n]=t[n]);return e}function xt(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var pu={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function hu(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return pu[t]}):e}var kr=typeof window!="undefined"&&window.navigator&&typeof window.navigator.userAgentData=="undefined"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,mu=[" ",",","?","!",";"];function vu(e,t,r){t=t||"",r=r||"";var n=mu.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 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 ur(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){Ye(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 yu(e){var t=bu();return function(){var n=Ge(e),i;if(t){var a=Ge(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return rr(this,i)}}function bu(){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 io(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?io(u,f,r):void 0}i=i[n[a]]}return i}}var Su=function(e){Mr(r,e);var t=yu(r);function r(n){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Le(this,r),i=t.call(this),kr&&ct.call(lt(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 Re(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=Sr(this.data,c);return l||!f||typeof o!="string"?l:io(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),wi(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=Sr(this.data,c)||{};s?no(l,o,u):l=ur(ur({},l),o),wi(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"?ur(ur({},{}),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}(ct),ao={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 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 Oe(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){Ye(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 Ou(e){var t=wu();return function(){var n=Ge(e),i;if(t){var a=Ge(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return rr(this,i)}}function wu(){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 Ai={},Ci=function(e){Mr(r,e);var t=Ou(r);function r(n){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Le(this,r),i=t.call(this),kr&&ct.call(lt(i)),du(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,lt(i)),i.options=a,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Be.create("translator"),i}return Re(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&&!vu(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(ke(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),m=b&&b.res,E=b&&b.usedKey||l,C=b&&b.exactUsedKey||l,w=Object.prototype.toString.apply(m),x=["[object Number]","[object Function]","[object RegExp]"],_=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,$=!this.i18nFormat||this.i18nFormat.handleAsObject,F=typeof m!="string"&&typeof m!="boolean"&&typeof m!="number";if($&&m&&F&&x.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,m,Oe(Oe({},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 H=w==="[object Array]",M=H?[]:{},j=H?C:E;for(var V in m)if(Object.prototype.hasOwnProperty.call(m,V)){var W="".concat(j).concat(f).concat(V);M[V]=this.translate(W,Oe(Oe({},a),{joinArrays:!1,ns:d})),M[V]===W&&(M[V]=m[V])}m=M}}else if($&&typeof _=="string"&&w==="[object Array]")m=m.join(_),m&&(m=this.extendTranslation(m,i,a,o));else{var X=!1,G=!1,he=a.count!==void 0&&typeof a.count!="string",ye=r.hasDefaultValue(a),K=he?this.pluralResolver.getSuffix(p,a.count,a):"",ie=a["defaultValue".concat(K)]||a.defaultValue;!this.isValidLookup(m)&&ye&&(X=!0,m=ie),this.isValidLookup(m)||(G=!0,m=l);var ae=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,se=ae&&G?void 0:m,q=ye&&ie!==m&&this.options.updateMissing;if(G||X||q){if(this.logger.log(q?"updateKey":"missingKey",p,g,l,q?ie:m),f){var xe=this.resolve(l,Oe(Oe({},a),{},{keySeparator:!1}));xe&&xe.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 re=[],Q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Q&&Q[0])for(var ue=0;ue<Q.length;ue++)re.push(Q[ue]);else this.options.saveMissingTo==="all"?re=this.languageUtils.toResolveHierarchy(a.lng||this.language):re.push(a.lng||this.language);var ce=function(B,me,le){var Ae=ye&&le!==m?le:se;s.options.missingKeyHandler?s.options.missingKeyHandler(B,g,me,Ae,q,a):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(B,g,me,Ae,q,a),s.emit("missingKey",B,g,me,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&he?re.forEach(function(ve){s.pluralResolver.getSuffixes(ve,a).forEach(function(B){ce([ve],l+B,a["defaultValue".concat(B)]||ie)})}):ce(re,l,ie))}m=this.extendTranslation(m,i,a,b,o),G&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(g,":").concat(l)),(G||X)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(g,":").concat(l):l,X?m:void 0):m=this.options.parseMissingKeyHandler(m))}return u?(b.res=m,b):m}},{key:"extendTranslation",value:function(i,a,o,s,u){var f=this;if(this.i18nFormat&&this.i18nFormat.parse)i=this.i18nFormat.parse(i,Oe(Oe({},this.options.interpolation.defaultVariables),o),s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init(Oe(Oe({},o),{interpolation:Oe(Oe({},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=Oe(Oe({},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 m=arguments.length,E=new Array(m),C=0;C<m;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=ao.handle(b,i,a,this.options&&this.options.postProcessPassResolved?Oe({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(),m=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,!Ai["".concat(E[0],"-").concat(C)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(l)&&(Ai["".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 x=[p];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(x,p,w,C,o);else{var _;v&&(_=a.pluralResolver.getSuffix(w,o.count,o));var $="".concat(a.options.pluralSeparator,"zero");if(v&&(x.push(p+_),b&&x.push(p+$)),m){var F="".concat(p).concat(a.options.contextSeparator).concat(o.context);x.push(F),v&&(x.push(F+_),b&&x.push(F+$))}}for(var k;k=x.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}(ct);function en(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Eu=function(){function e(t){Le(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Be.create("languageUtils")}return Re(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]=en(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]=en(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=en(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}(),Pu=[{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}],xu={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)}},Au=["v1","v2","v3"],_i={zero:0,one:1,two:2,few:3,many:4,other:5};function Cu(){var e={};return Pu.forEach(function(t){t.lngs.forEach(function(r){e[r]={numbers:t.nr,plurals:xu[t.fc]}})}),e}var _u=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Le(this,e),this.languageUtils=t,this.options=r,this.logger=Be.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=Cu()}return Re(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 _i[o]-_i[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!Au.includes(this.options.compatibilityJSON)}}]),e}();function Ti(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?Ti(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ti(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Tu=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Le(this,e),this.logger=Be.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(r){return r},this.init(t)}return Re(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:hu,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 m=Ei(n,c,b);return o.alwaysFormat?o.format(m,void 0,i,Me(Me(Me({},a),n),{},{interpolationkey:b})):m}var E=b.split(o.formatSeparator),C=E.shift().trim(),w=E.join(o.formatSeparator).trim();return o.format(Ei(n,c,C),w,i,Me(Me(Me({},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 m=g(r,s,a);u=typeof m=="string"?m:""}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=Oi(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=Me({},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 m=b.match(/'/g),E=b.match(/"/g);(m&&m.length%2===0&&!E||E.length%2!==0)&&(b=b.replace(/'/g,'"'));try{u=JSON.parse(b),p&&(u=Me(Me({},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=Oi(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,Me(Me({},a),{},{interpolationkey:o[1].trim()}))},s.trim())),r=r.replace(o[0],s),this.regexp.lastIndex=0}return r}}]),e}();function Ni(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 rt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ni(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ni(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Nu(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=lu(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 At(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 Iu=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Le(this,e),this.logger=Be.create("formatter"),this.options=t,this.formats={number:At(function(r,n){var i=new Intl.NumberFormat(r,n);return function(a){return i.format(a)}}),currency:At(function(r,n){var i=new Intl.NumberFormat(r,rt(rt({},n),{},{style:"currency"}));return function(a){return i.format(a)}}),datetime:At(function(r,n){var i=new Intl.DateTimeFormat(r,rt({},n));return function(a){return i.format(a)}}),relativetime:At(function(r,n){var i=new Intl.RelativeTimeFormat(r,rt({},n));return function(a){return i.format(a,n.range||"day")}}),list:At(function(r,n){var i=new Intl.ListFormat(r,rt({},n));return function(a){return i.format(a)}})},this.init(t)}return Re(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()]=At(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=Nu(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,rt(rt(rt({},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 Ii(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 $i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ii(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ii(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $u(e){var t=Lu();return function(){var n=Ge(e),i;if(t){var a=Ge(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return rr(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 Ru(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var Fu=function(e){Mr(r,e);var t=$u(r);function r(n,i,a){var o,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Le(this,r),o=t.call(this),kr&&ct.call(lt(o)),o.backend=n,o.store=i,o.services=a,o.languageUtils=a.languageUtils,o.options=s,o.logger=Be.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 Re(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){gu(l.loaded,[u],f),Ru(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,$i($i({},f),{},{isUpdate:u})),!(!i||!i[0])&&this.store.addResource(i[0],a,o,s))}}]),r}(ct);function Mu(){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(ke(t[1])==="object"&&(r=t[1]),typeof t[1]=="string"&&(r.defaultValue=t[1]),typeof t[2]=="string"&&(r.tDescription=t[2]),ke(t[2])==="object"||ke(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 Li(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 Ri(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 Ve(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ri(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ri(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ku(e){var t=Du();return function(){var n=Ge(e),i;if(t){var a=Ge(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return rr(this,i)}}function Du(){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 lr(){}function ju(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(r){typeof e[r]=="function"&&(e[r]=e[r].bind(e))})}var Or=function(e){Mr(r,e);var t=ku(r);function r(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(Le(this,r),n=t.call(this),kr&&ct.call(lt(n)),n.options=Li(i),n.services={},n.logger=Be,n.modules={external:[]},ju(lt(n)),a&&!n.isInitialized&&!i.isClone){if(!n.options.initImmediate)return n.init(i,a),rr(n,lt(n));setTimeout(function(){n.init(i,a)},0)}return n}return Re(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=Mu();this.options=Ve(Ve(Ve({},s),this.options),Li(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Ve(Ve({},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?Be.init(u(this.modules.logger),this.options):Be.init(null,this.options);var f;this.modules.formatter?f=this.modules.formatter:typeof Intl!="undefined"&&(f=Iu);var c=new Eu(this.options);this.store=new Su(this.options.resources,this.options);var l=this.services;l.logger=Be,l.resourceStore=this.store,l.languageUtils=c,l.pluralResolver=new _u(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 Tu(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new Fu(u(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(b){for(var m=arguments.length,E=new Array(m>1?m-1:0),C=1;C<m;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 Ci(this.services,this.options),this.translator.on("*",function(b){for(var m=arguments.length,E=new Array(m>1?m-1:0),C=1;C<m;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=lr),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 m;return(m=i.store)[b].apply(m,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(b){i[b]=function(){var m;return(m=i.store)[b].apply(m,arguments),i}});var y=Dt(),v=function(){var m=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 m(null,i.t.bind(i));i.changeLanguage(i.options.lng,m)};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]:lr,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=Dt();return i||(i=this.languages),a||(a=this.options.ns),o||(o=lr),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"&&ao.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=Dt();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(ke(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=Ve({},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=Dt();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=Dt();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]:lr,s=Ve(Ve(Ve({},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=Ve({},this.services),u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u.translator=new Ci(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}(ct);Ye(Or,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Or(e,t)});var Se=Or.createInstance();Se.createInstance=Or.createInstance;Se.createInstance;Se.init;Se.loadResources;Se.reloadResources;Se.use;Se.changeLanguage;Se.getFixedT;Se.t;Se.exists;Se.setDefaultNamespace;Se.hasLoadedNamespace;Se.loadNamespaces;Se.loadLanguages;var nr=e=>e.type==="checkbox",_t=e=>e instanceof Date,we=e=>e==null;const oo=e=>typeof e=="object";var pe=e=>!we(e)&&!Array.isArray(e)&&oo(e)&&!_t(e),so=e=>pe(e)&&e.target?nr(e.target)?e.target.checked:e.target.value:e,Vu=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,uo=(e,t)=>e.has(Vu(t)),Uu=e=>{const t=e.constructor&&e.constructor.prototype;return pe(t)&&t.hasOwnProperty("isPrototypeOf")},Gn=typeof window!="undefined"&&typeof window.HTMLElement!="undefined"&&typeof document!="undefined";function ge(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(!(Gn&&(e instanceof Blob||e instanceof FileList))&&(r||pe(e)))if(t=r?[]:{},!r&&!Uu(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=ge(e[n]));else return e;return t}var ir=e=>Array.isArray(e)?e.filter(Boolean):[],Z=e=>e===void 0,I=(e,t,r)=>{if(!t||!pe(e))return r;const n=ir(t.split(/[,[\].]+?/)).reduce((i,a)=>we(i)?i:i[a],e);return Z(n)||n===e?Z(e[t])?r:e[t]:n},Ue=e=>typeof e=="boolean",Kn=e=>/^\w*$/.test(e),lo=e=>ir(e.replace(/["|']|\]/g,"").split(/\.|\[/)),z=(e,t,r)=>{let n=-1;const i=Kn(t)?[t]:lo(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=pe(f)||Array.isArray(f)?f:isNaN(+i[n+1])?{}:[]}if(s==="__proto__")return;e[s]=u,e=e[s]}return e};const wr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ne={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"},co=T.default.createContext(null),ze=()=>T.default.useContext(co),fo=e=>{const{children:t,...r}=e;return T.default.createElement(co.Provider,{value:r},t)};var go=(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]!==Ne.all&&(t._proxyFormState[o]=!n||Ne.all),r&&(r[o]=!0),e[o]}});return i},Ee=e=>pe(e)&&!Object.keys(e).length,po=(e,t,r,n)=>{r(e);const{name:i,...a}=e;return Ee(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!n||Ne.all))},Pe=e=>Array.isArray(e)?e:[e],ho=(e,t,r)=>!e||!t||e===t||Pe(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function Dr(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 mo(e){const t=ze(),{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,Dr({disabled:n,next:l=>u.current&&ho(c.current,l.name,a)&&po(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]),go(o,r,f.current,!1)}var He=e=>typeof e=="string",vo=(e,t,r,n,i)=>He(e)?(n&&t.watch.add(e),I(r,e,i)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),I(r,a))):(n&&(t.watchAll=!0),r);function Er(e){const t=ze(),{control:r=t.control,name:n,defaultValue:i,disabled:a,exact:o}=e||{},s=T.default.useRef(n);s.current=n,Dr({disabled:a,subject:r._subjects.values,next:c=>{ho(s.current,c.name,o)&&f(ge(vo(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 yo(e){const t=ze(),{name:r,disabled:n,control:i=t.control,shouldUnregister:a}=e,o=uo(i._names.array,r),s=Er({control:i,name:r,defaultValue:I(i._formValues,r,I(i._defaultValues,r,e.defaultValue)),exact:!0}),u=mo({control:i,name:r}),f=T.default.useRef(i.register(r,{...e.rules,value:s,...Ue(e.disabled)?{disabled:e.disabled}:{}}));return T.default.useEffect(()=>{const c=i._options.shouldUnregister||a,l=(d,g)=>{const p=I(i._fields,d);p&&p._f&&(p._f.mount=g)};if(l(r,!0),c){const d=ge(I(i._options.defaultValues,r));z(i._defaultValues,r,d),Z(I(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(i._fields,r)&&i._updateDisabledField({disabled:n,fields:i._fields,name:r,value:I(i._fields,r)._f.value})},[n,r,i]),{field:{name:r,value:s,...Ue(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:T.default.useCallback(c=>f.current.onChange({target:{value:so(c),name:r},type:wr.CHANGE}),[r]),onBlur:T.default.useCallback(()=>f.current.onBlur({target:{value:I(i._formValues,r),name:r},type:wr.BLUR}),[r,i]),ref:c=>{const l=I(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:()=>!!I(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!I(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!I(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!I(u.validatingFields,r)},error:{enumerable:!0,get:()=>I(u.errors,r)}})}}const Bu=e=>e.render(yo(e)),Hu="post";function Wu(e){const t=ze(),[r,n]=T.default.useState(!1),{control:i=t.control,onSubmit:a,children:o,action:s,method:u=Hu,headers:f,encType:c,onError:l,render:d,onSuccess:g,validateStatus:p,...y}=e,v=async b=>{let m=!1,E="";await i.handleSubmit(async C=>{const w=new FormData;let x="";try{x=JSON.stringify(C)}catch{}for(const _ of i._names.mount)w.append(_,I(C,_));if(a&&await a({data:C,event:b,method:u,formData:w,formDataJson:x}),s)try{const _=[f&&f["Content-Type"],c].some(F=>F&&F.includes("json")),$=await fetch(s,{method:u,headers:{...f,...c?{"Content-Type":c}:{}},body:_?x:w});$&&(p?!p($.status):$.status<200||$.status>=300)?(m=!0,l&&l({response:$}),E=String($.status)):g&&g({response:$})}catch(_){m=!0,l&&l({error:_})}})(b),m&&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 bo=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},nt=()=>{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)})},tn=(e,t,r={})=>r.shouldFocus||Z(r.shouldFocus)?r.focusName||`${e}.${Z(r.focusIndex)?t:r.focusIndex}.`:"",qt=e=>({isOnSubmit:!e||e===Ne.onSubmit,isOnBlur:e===Ne.onBlur,isOnChange:e===Ne.onChange,isOnAll:e===Ne.all,isOnTouch:e===Ne.onTouched}),An=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Tt=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const a=I(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;Tt(s,t)}else pe(s)&&Tt(s,t)}}};var So=(e,t,r)=>{const n=Pe(I(e,r));return z(n,"root",t[r]),z(e,r,n),e},Yn=e=>e.type==="file",ot=e=>typeof e=="function",Pr=e=>{if(!Gn)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},hr=e=>He(e),zn=e=>e.type==="radio",xr=e=>e instanceof RegExp;const Fi={value:!1,isValid:!1},Mi={value:!0,isValid:!0};var Oo=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&&!Z(e[0].attributes.value)?Z(e[0].value)||e[0].value===""?Mi:{value:e[0].value,isValid:!0}:Mi:Fi}return Fi};const ki={isValid:!1,value:null};var wo=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,ki):ki;function Di(e,t,r="validate"){if(hr(e)||Array.isArray(e)&&e.every(hr)||Ue(e)&&!e)return{type:r,message:hr(e)?e:"",ref:t}}var Ct=e=>pe(e)&&!xr(e)?e:{value:e,message:""},Cn=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,m=I(t,p);if(!v||b)return{};const E=o?o[0]:a,C=M=>{n&&E.reportValidity&&(E.setCustomValidity(Ue(M)?"":M||""),E.reportValidity())},w={},x=zn(a),_=nr(a),$=x||_,F=(y||Yn(a))&&Z(a.value)&&Z(m)||Pr(a)&&a.value===""||m===""||Array.isArray(m)&&!m.length,k=bo.bind(null,p,r,w),H=(M,j,V,W=Qe.maxLength,X=Qe.minLength)=>{const G=M?j:V;w[p]={type:M?W:X,message:G,ref:a,...k(M?W:X,G)}};if(i?!Array.isArray(m)||!m.length:s&&(!$&&(F||we(m))||Ue(m)&&!m||_&&!Oo(o).isValid||x&&!wo(o).isValid)){const{value:M,message:j}=hr(s)?{value:!!s,message:s}:Ct(s);if(M&&(w[p]={type:Qe.required,message:j,ref:E,...k(Qe.required,j)},!r))return C(j),w}if(!F&&(!we(c)||!we(l))){let M,j;const V=Ct(l),W=Ct(c);if(!we(m)&&!isNaN(m)){const X=a.valueAsNumber||m&&+m;we(V.value)||(M=X>V.value),we(W.value)||(j=X<W.value)}else{const X=a.valueAsDate||new Date(m),G=K=>new Date(new Date().toDateString()+" "+K),he=a.type=="time",ye=a.type=="week";He(V.value)&&m&&(M=he?G(m)>G(V.value):ye?m>V.value:X>new Date(V.value)),He(W.value)&&m&&(j=he?G(m)<G(W.value):ye?m<W.value:X<new Date(W.value))}if((M||j)&&(H(!!M,V.message,W.message,Qe.max,Qe.min),!r))return C(w[p].message),w}if((u||f)&&!F&&(He(m)||i&&Array.isArray(m))){const M=Ct(u),j=Ct(f),V=!we(M.value)&&m.length>+M.value,W=!we(j.value)&&m.length<+j.value;if((V||W)&&(H(V,M.message,j.message),!r))return C(w[p].message),w}if(d&&!F&&He(m)){const{value:M,message:j}=Ct(d);if(xr(M)&&!m.match(M)&&(w[p]={type:Qe.pattern,message:j,ref:a,...k(Qe.pattern,j)},!r))return C(j),w}if(g){if(ot(g)){const M=await g(m,t),j=Di(M,E);if(j&&(w[p]={...j,...k(Qe.validate,j.message)},!r))return C(j.message),w}else if(pe(g)){let M={};for(const j in g){if(!Ee(M)&&!r)break;const V=Di(await g[j](m,t),E,j);V&&(M={...V,...k(j,V.message)},C(V.message),r&&(w[p]=M))}if(!Ee(M)&&(w[p]={ref:E,...M},!r))return w}}return C(!0),w},rn=(e,t)=>[...e,...Pe(t)],nn=e=>Array.isArray(e)?e.map(()=>{}):void 0;function an(e,t,r){return[...e.slice(0,t),...Pe(r),...e.slice(t)]}var on=(e,t,r)=>Array.isArray(e)?(Z(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],sn=(e,t)=>[...Pe(t),...Pe(e)];function Gu(e,t){let r=0;const n=[...e];for(const i of t)n.splice(i-r,1),r++;return ir(n).length?n:[]}var un=(e,t)=>Z(t)?[]:Gu(e,Pe(t).sort((r,n)=>r-n)),ln=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]};function Ku(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Z(e)?n++:e[t[n++]];return e}function Yu(e){for(const t in e)if(e.hasOwnProperty(t)&&!Z(e[t]))return!1;return!0}function de(e,t){const r=Array.isArray(t)?t:Kn(t)?[t]:lo(t),n=r.length===1?e:Ku(e,r),i=r.length-1,a=r[i];return n&&delete n[a],i!==0&&(pe(n)&&Ee(n)||Array.isArray(n)&&Yu(n))&&de(e,r.slice(0,-1)),e}var ji=(e,t,r)=>(e[t]=r,e);function zu(e){const t=ze(),{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(nt)),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),Dr({next:({values:w,name:x})=>{if(x===c.current||!x){const _=I(w,c.current);Array.isArray(_)&&(s(_),u.current=_.map(nt))}},subject:r._subjects.array});const d=T.default.useCallback(w=>{l.current=!0,r._updateFieldArray(n,w)},[r,n]),g=(w,x)=>{const _=Pe(ge(w)),$=rn(r._getFieldArray(n),_);r._names.focus=tn(n,$.length-1,x),u.current=rn(u.current,_.map(nt)),d($),s($),r._updateFieldArray(n,$,rn,{argA:nn(w)})},p=(w,x)=>{const _=Pe(ge(w)),$=sn(r._getFieldArray(n),_);r._names.focus=tn(n,0,x),u.current=sn(u.current,_.map(nt)),d($),s($),r._updateFieldArray(n,$,sn,{argA:nn(w)})},y=w=>{const x=un(r._getFieldArray(n),w);u.current=un(u.current,w),d(x),s(x),r._updateFieldArray(n,x,un,{argA:w})},v=(w,x,_)=>{const $=Pe(ge(x)),F=an(r._getFieldArray(n),w,$);r._names.focus=tn(n,w,_),u.current=an(u.current,w,$.map(nt)),d(F),s(F),r._updateFieldArray(n,F,an,{argA:w,argB:nn(x)})},b=(w,x)=>{const _=r._getFieldArray(n);ln(_,w,x),ln(u.current,w,x),d(_),s(_),r._updateFieldArray(n,_,ln,{argA:w,argB:x},!1)},m=(w,x)=>{const _=r._getFieldArray(n);on(_,w,x),on(u.current,w,x),d(_),s(_),r._updateFieldArray(n,_,on,{argA:w,argB:x},!1)},E=(w,x)=>{const _=ge(x),$=ji(r._getFieldArray(n),w,_);u.current=[...$].map((F,k)=>!F||k===w?nt():u.current[k]),d($),s([...$]),r._updateFieldArray(n,$,ji,{argA:w,argB:_},!0,!1)},C=w=>{const x=Pe(ge(w));u.current=x.map(nt),d([...x]),s([...x]),r._updateFieldArray(n,[...x],_=>_,{},!0,!1)};return T.default.useEffect(()=>{if(r._state.action=!1,An(n,r._names)&&r._subjects.state.next({...r._formState}),l.current&&(!qt(r._options.mode).isOnSubmit||r._formState.isSubmitted))if(r._options.resolver)r._executeSchema([n]).then(w=>{const x=I(w.errors,n),_=I(r._formState.errors,n);(_?!x&&_.type||x&&(_.type!==x.type||_.message!==x.message):x&&x.type)&&(x?z(r._formState.errors,n,x):de(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const w=I(r._fields,n);w&&w._f&&!(qt(r._options.reValidateMode).isOnSubmit&&qt(r._options.mode).isOnSubmit)&&Cn(w,r._formValues,r._options.criteriaMode===Ne.all,r._options.shouldUseNativeValidation,!0).then(x=>!Ee(x)&&r._subjects.state.next({errors:So(r._formState.errors,x,n)}))}r._subjects.values.next({name:n,values:{...r._formValues}}),r._names.focus&&Tt(r._fields,(w,x)=>{if(r._names.focus&&x.startsWith(r._names.focus)&&w.focus)return w.focus(),1}),r._names.focus="",r._updateValid(),l.current=!1},[o,n,r]),T.default.useEffect(()=>(!I(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(m,[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,x)=>({...w,[i]:u.current[x]||nt()})),[o,i])}}var cn=()=>{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=[]}}},Ar=e=>we(e)||!oo(e);function ht(e,t){if(Ar(e)||Ar(t))return e===t;if(_t(e)&&_t(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(_t(a)&&_t(o)||pe(a)&&pe(o)||Array.isArray(a)&&Array.isArray(o)?!ht(a,o):a!==o)return!1}}return!0}var Eo=e=>e.type==="select-multiple",qu=e=>zn(e)||nr(e),fn=e=>Pr(e)&&e.isConnected,Po=e=>{for(const t in e)if(ot(e[t]))return!0;return!1};function Cr(e,t={}){const r=Array.isArray(e);if(pe(e)||r)for(const n in e)Array.isArray(e[n])||pe(e[n])&&!Po(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Cr(e[n],t[n])):we(e[n])||(t[n]=!0);return t}function xo(e,t,r){const n=Array.isArray(e);if(pe(e)||n)for(const i in e)Array.isArray(e[i])||pe(e[i])&&!Po(e[i])?Z(t)||Ar(r[i])?r[i]=Array.isArray(e[i])?Cr(e[i],[]):{...Cr(e[i])}:xo(e[i],we(t)?{}:t[i],r[i]):r[i]=!ht(e[i],t[i]);return r}var cr=(e,t)=>xo(e,t,Cr(t)),Ao=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Z(e)?e:t?e===""?NaN:e&&+e:r&&He(e)?new Date(e):n?n(e):e;function dn(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Yn(t)?t.files:zn(t)?wo(e.refs).value:Eo(t)?[...t.selectedOptions].map(({value:r})=>r):nr(t)?Oo(e.refs).value:Ao(Z(t.value)?e.ref.value:t.value,e)}var Qu=(e,t,r,n)=>{const i={};for(const a of e){const o=I(t,a);o&&z(i,a,o._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},jt=e=>Z(e)?e:xr(e)?e.source:pe(e)?xr(e.value)?e.value.source:e.value:e,Ju=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Vi(e,t,r){const n=I(e,r);if(n||Kn(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const a=i.join("."),o=I(t,a),s=I(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 Zu=(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,Xu=(e,t)=>!ir(I(e,t)).length&&de(e,t);const el={mode:Ne.onSubmit,reValidateMode:Ne.onChange,shouldFocusError:!0};function tl(e={}){let t={...el,...e},r={submitCount:0,isDirty:!1,isLoading:ot(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=pe(t.defaultValues)||pe(t.values)?ge(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:ge(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:cn(),array:cn(),state:cn()},d=qt(t.mode),g=qt(t.reValidateMode),p=t.criteriaMode===Ne.all,y=h=>O=>{clearTimeout(f),f=setTimeout(h,O)},v=async h=>{if(c.isValid||h){const O=t.resolver?Ee((await $()).errors):await k(n,!0);O!==r.isValid&&l.state.next({isValid:O})}},b=(h,O)=>{(c.isValidating||c.validatingFields)&&((h||Array.from(s.mount)).forEach(P=>{P&&(O?z(r.validatingFields,P,O):de(r.validatingFields,P))}),l.state.next({validatingFields:r.validatingFields,isValidating:!Ee(r.validatingFields)}))},m=(h,O=[],P,R,L=!0,N=!0)=>{if(R&&P){if(o.action=!0,N&&Array.isArray(I(n,h))){const D=P(I(n,h),R.argA,R.argB);L&&z(n,h,D)}if(N&&Array.isArray(I(r.errors,h))){const D=P(I(r.errors,h),R.argA,R.argB);L&&z(r.errors,h,D),Xu(r.errors,h)}if(c.touchedFields&&N&&Array.isArray(I(r.touchedFields,h))){const D=P(I(r.touchedFields,h),R.argA,R.argB);L&&z(r.touchedFields,h,D)}c.dirtyFields&&(r.dirtyFields=cr(i,a)),l.state.next({name:h,isDirty:M(h,O),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else z(a,h,O)},E=(h,O)=>{z(r.errors,h,O),l.state.next({errors:r.errors})},C=h=>{r.errors=h,l.state.next({errors:r.errors,isValid:!1})},w=(h,O,P,R)=>{const L=I(n,h);if(L){const N=I(a,h,Z(P)?I(i,h):P);Z(N)||R&&R.defaultChecked||O?z(a,h,O?N:dn(L._f)):W(h,N),o.mount&&v()}},x=(h,O,P,R,L)=>{let N=!1,D=!1;const Y={name:h},fe=!!(I(n,h)&&I(n,h)._f&&I(n,h)._f.disabled);if(!P||R){c.isDirty&&(D=r.isDirty,r.isDirty=Y.isDirty=M(),N=D!==Y.isDirty);const Ce=fe||ht(I(i,h),O);D=!!(!fe&&I(r.dirtyFields,h)),Ce||fe?de(r.dirtyFields,h):z(r.dirtyFields,h,!0),Y.dirtyFields=r.dirtyFields,N=N||c.dirtyFields&&D!==!Ce}if(P){const Ce=I(r.touchedFields,h);Ce||(z(r.touchedFields,h,P),Y.touchedFields=r.touchedFields,N=N||c.touchedFields&&Ce!==P)}return N&&L&&l.state.next(Y),N?Y:{}},_=(h,O,P,R)=>{const L=I(r.errors,h),N=c.isValid&&Ue(O)&&r.isValid!==O;if(e.delayError&&P?(u=y(()=>E(h,P)),u(e.delayError)):(clearTimeout(f),u=null,P?z(r.errors,h,P):de(r.errors,h)),(P?!ht(L,P):L)||!Ee(R)||N){const D={...R,...N&&Ue(O)?{isValid:O}:{},errors:r.errors,name:h};r={...r,...D},l.state.next(D)}},$=async h=>{b(h,!0);const O=await t.resolver(a,t.context,Qu(h||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return b(h),O},F=async h=>{const{errors:O}=await $(h);if(h)for(const P of h){const R=I(O,P);R?z(r.errors,P,R):de(r.errors,P)}else r.errors=O;return O},k=async(h,O,P={valid:!0})=>{for(const R in h){const L=h[R];if(L){const{_f:N,...D}=L;if(N){const Y=s.array.has(N.name);b([R],!0);const fe=await Cn(L,a,p,t.shouldUseNativeValidation&&!O,Y);if(b([R]),fe[N.name]&&(P.valid=!1,O))break;!O&&(I(fe,N.name)?Y?So(r.errors,fe,N.name):z(r.errors,N.name,fe[N.name]):de(r.errors,N.name))}D&&await k(D,O,P)}}return P.valid},H=()=>{for(const h of s.unMount){const O=I(n,h);O&&(O._f.refs?O._f.refs.every(P=>!fn(P)):!fn(O._f.ref))&&re(h)}s.unMount=new Set},M=(h,O)=>(h&&O&&z(a,h,O),!ht(ie(),i)),j=(h,O,P)=>vo(h,s,{...o.mount?a:Z(O)?i:He(h)?{[h]:O}:O},P,O),V=h=>ir(I(o.mount?a:i,h,e.shouldUnregister?I(i,h,[]):[])),W=(h,O,P={})=>{const R=I(n,h);let L=O;if(R){const N=R._f;N&&(!N.disabled&&z(a,h,Ao(O,N)),L=Pr(N.ref)&&we(O)?"":O,Eo(N.ref)?[...N.ref.options].forEach(D=>D.selected=L.includes(D.value)):N.refs?nr(N.ref)?N.refs.length>1?N.refs.forEach(D=>(!D.defaultChecked||!D.disabled)&&(D.checked=Array.isArray(L)?!!L.find(Y=>Y===D.value):L===D.value)):N.refs[0]&&(N.refs[0].checked=!!L):N.refs.forEach(D=>D.checked=D.value===L):Yn(N.ref)?N.ref.value="":(N.ref.value=L,N.ref.type||l.values.next({name:h,values:{...a}})))}(P.shouldDirty||P.shouldTouch)&&x(h,L,P.shouldTouch,P.shouldDirty,!0),P.shouldValidate&&K(h)},X=(h,O,P)=>{for(const R in O){const L=O[R],N=`${h}.${R}`,D=I(n,N);(s.array.has(h)||!Ar(L)||D&&!D._f)&&!_t(L)?X(N,L,P):W(N,L,P)}},G=(h,O,P={})=>{const R=I(n,h),L=s.array.has(h),N=ge(O);z(a,h,N),L?(l.array.next({name:h,values:{...a}}),(c.isDirty||c.dirtyFields)&&P.shouldDirty&&l.state.next({name:h,dirtyFields:cr(i,a),isDirty:M(h,N)})):R&&!R._f&&!we(N)?X(h,N,P):W(h,N,P),An(h,s)&&l.state.next({...r}),l.values.next({name:o.mount?h:void 0,values:{...a}})},he=async h=>{o.mount=!0;const O=h.target;let P=O.name,R=!0;const L=I(n,P),N=()=>O.type?dn(L._f):so(h),D=Y=>{R=Number.isNaN(Y)||Y===I(a,P,Y)};if(L){let Y,fe;const Ce=N(),Pt=h.type===wr.BLUR||h.type===wr.FOCUS_OUT,tu=!Ju(L._f)&&!t.resolver&&!I(r.errors,P)&&!L._f.deps||Zu(Pt,I(r.touchedFields,P),r.isSubmitted,g,d),Zr=An(P,s,Pt);z(a,P,Ce),Pt?(L._f.onBlur&&L._f.onBlur(h),u&&u(0)):L._f.onChange&&L._f.onChange(h);const Xr=x(P,Ce,Pt,!1),ru=!Ee(Xr)||Zr;if(!Pt&&l.values.next({name:P,type:h.type,values:{...a}}),tu)return c.isValid&&v(),ru&&l.state.next({name:P,...Zr?{}:Xr});if(!Pt&&Zr&&l.state.next({...r}),t.resolver){const{errors:pi}=await $([P]);if(D(Ce),R){const nu=Vi(r.errors,n,P),hi=Vi(pi,n,nu.name||P);Y=hi.error,P=hi.name,fe=Ee(pi)}}else b([P],!0),Y=(await Cn(L,a,p,t.shouldUseNativeValidation))[P],b([P]),D(Ce),R&&(Y?fe=!1:c.isValid&&(fe=await k(n,!0)));R&&(L._f.deps&&K(L._f.deps),_(P,fe,Y,Xr))}},ye=(h,O)=>{if(I(r.errors,O)&&h.focus)return h.focus(),1},K=async(h,O={})=>{let P,R;const L=Pe(h);if(t.resolver){const N=await F(Z(h)?h:L);P=Ee(N),R=h?!L.some(D=>I(N,D)):P}else h?(R=(await Promise.all(L.map(async N=>{const D=I(n,N);return await k(D&&D._f?{[N]:D}:D)}))).every(Boolean),!(!R&&!r.isValid)&&v()):R=P=await k(n);return l.state.next({...!He(h)||c.isValid&&P!==r.isValid?{}:{name:h},...t.resolver||!h?{isValid:P}:{},errors:r.errors}),O.shouldFocus&&!R&&Tt(n,ye,h?L:s.mount),R},ie=h=>{const O={...o.mount?a:i};return Z(h)?O:He(h)?I(O,h):h.map(P=>I(O,P))},ae=(h,O)=>({invalid:!!I((O||r).errors,h),isDirty:!!I((O||r).dirtyFields,h),error:I((O||r).errors,h),isValidating:!!I(r.validatingFields,h),isTouched:!!I((O||r).touchedFields,h)}),se=h=>{h&&Pe(h).forEach(O=>de(r.errors,O)),l.state.next({errors:h?r.errors:{}})},q=(h,O,P)=>{const R=(I(n,h,{_f:{}})._f||{}).ref,L=I(r.errors,h)||{},{ref:N,message:D,type:Y,...fe}=L;z(r.errors,h,{...fe,...O,ref:R}),l.state.next({name:h,errors:r.errors,isValid:!1}),P&&P.shouldFocus&&R&&R.focus&&R.focus()},xe=(h,O)=>ot(h)?l.values.subscribe({next:P=>h(j(void 0,O),P)}):j(h,O,!0),re=(h,O={})=>{for(const P of h?Pe(h):s.mount)s.mount.delete(P),s.array.delete(P),O.keepValue||(de(n,P),de(a,P)),!O.keepError&&de(r.errors,P),!O.keepDirty&&de(r.dirtyFields,P),!O.keepTouched&&de(r.touchedFields,P),!O.keepIsValidating&&de(r.validatingFields,P),!t.shouldUnregister&&!O.keepDefaultValue&&de(i,P);l.values.next({values:{...a}}),l.state.next({...r,...O.keepDirty?{isDirty:M()}:{}}),!O.keepIsValid&&v()},Q=({disabled:h,name:O,field:P,fields:R,value:L})=>{if(Ue(h)&&o.mount||!!h){const N=h?void 0:Z(L)?dn(P?P._f:I(R,O)._f):L;z(a,O,N),x(O,N,!1,!1,!0)}},ue=(h,O={})=>{let P=I(n,h);const R=Ue(O.disabled);return z(n,h,{...P||{},_f:{...P&&P._f?P._f:{ref:{name:h}},name:h,mount:!0,...O}}),s.mount.add(h),P?Q({field:P,disabled:O.disabled,name:h,value:O.value}):w(h,!0,O.value),{...R?{disabled:O.disabled}:{},...t.progressive?{required:!!O.required,min:jt(O.min),max:jt(O.max),minLength:jt(O.minLength),maxLength:jt(O.maxLength),pattern:jt(O.pattern)}:{},name:h,onChange:he,onBlur:he,ref:L=>{if(L){ue(h,O),P=I(n,h);const N=Z(L.value)&&L.querySelectorAll&&L.querySelectorAll("input,select,textarea")[0]||L,D=qu(N),Y=P._f.refs||[];if(D?Y.find(fe=>fe===N):N===P._f.ref)return;z(n,h,{_f:{...P._f,...D?{refs:[...Y.filter(fn),N,...Array.isArray(I(i,h))?[{}]:[]],ref:{type:N.type,name:h}}:{ref:N}}}),w(h,!1,void 0,N)}else P=I(n,h,{}),P._f&&(P._f.mount=!1),(t.shouldUnregister||O.shouldUnregister)&&!(uo(s.array,h)&&o.action)&&s.unMount.add(h)}}},ce=()=>t.shouldFocusError&&Tt(n,ye,s.mount),ve=h=>{Ue(h)&&(l.state.next({disabled:h}),Tt(n,(O,P)=>{const R=I(n,P);R&&(O.disabled=R._f.disabled||h,Array.isArray(R._f.refs)&&R._f.refs.forEach(L=>{L.disabled=R._f.disabled||h}))},0,!1))},B=(h,O)=>async P=>{let R;P&&(P.preventDefault&&P.preventDefault(),P.persist&&P.persist());let L=ge(a);if(l.state.next({isSubmitting:!0}),t.resolver){const{errors:N,values:D}=await $();r.errors=N,L=D}else await k(n);if(de(r.errors,"root"),Ee(r.errors)){l.state.next({errors:{}});try{await h(L,P)}catch(N){R=N}}else O&&await O({...r.errors},P),ce(),setTimeout(ce);if(l.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ee(r.errors)&&!R,submitCount:r.submitCount+1,errors:r.errors}),R)throw R},me=(h,O={})=>{I(n,h)&&(Z(O.defaultValue)?G(h,ge(I(i,h))):(G(h,O.defaultValue),z(i,h,ge(O.defaultValue))),O.keepTouched||de(r.touchedFields,h),O.keepDirty||(de(r.dirtyFields,h),r.isDirty=O.defaultValue?M(h,ge(I(i,h))):M()),O.keepError||(de(r.errors,h),c.isValid&&v()),l.state.next({...r}))},le=(h,O={})=>{const P=h?ge(h):i,R=ge(P),L=Ee(h),N=L?i:R;if(O.keepDefaultValues||(i=P),!O.keepValues){if(O.keepDirtyValues)for(const D of s.mount)I(r.dirtyFields,D)?z(N,D,I(a,D)):G(D,I(N,D));else{if(Gn&&Z(h))for(const D of s.mount){const Y=I(n,D);if(Y&&Y._f){const fe=Array.isArray(Y._f.refs)?Y._f.refs[0]:Y._f.ref;if(Pr(fe)){const Ce=fe.closest("form");if(Ce){Ce.reset();break}}}}n={}}a=e.shouldUnregister?O.keepDefaultValues?ge(i):{}:ge(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:L?!1:O.keepDirty?r.isDirty:!!(O.keepDefaultValues&&!ht(h,i)),isSubmitted:O.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:L?{}:O.keepDirtyValues?O.keepDefaultValues&&a?cr(i,a):r.dirtyFields:O.keepDefaultValues&&h?cr(i,h):O.keepDirty?r.dirtyFields:{},touchedFields:O.keepTouched?r.touchedFields:{},errors:O.keepErrors?r.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Ae=(h,O)=>le(ot(h)?h(a):h,O);return{control:{register:ue,unregister:re,getFieldState:ae,handleSubmit:B,setError:q,_executeSchema:$,_getWatch:j,_getDirty:M,_updateValid:v,_removeUnmounted:H,_updateFieldArray:m,_updateDisabledField:Q,_getFieldArray:V,_reset:le,_resetDefaultValues:()=>ot(t.defaultValues)&&t.defaultValues().then(h=>{Ae(h,t.resetOptions),l.state.next({isLoading:!1})}),_updateFormState:h=>{r={...r,...h}},_disableForm:ve,_subjects:l,_proxyFormState:c,_setErrors:C,get _fields(){return n},get _formValues(){return a},get _state(){return o},set _state(h){o=h},get _defaultValues(){return i},get _names(){return s},set _names(h){s=h},get _formState(){return r},set _formState(h){r=h},get _options(){return t},set _options(h){t={...t,...h}}},trigger:K,register:ue,handleSubmit:B,watch:xe,setValue:G,getValues:ie,reset:Ae,resetField:me,clearErrors:se,unregister:re,setError:q,setFocus:(h,O={})=>{const P=I(n,h),R=P&&P._f;if(R){const L=R.refs?R.refs[0]:R.ref;L.focus&&(L.focus(),O.shouldSelect&&L.select())}},getFieldState:ae}}function Co(e={}){const t=T.default.useRef(),r=T.default.useRef(),[n,i]=T.default.useState({isDirty:!1,isValidating:!1,isLoading:ot(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ot(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...tl(e),formState:n});const a=t.current.control;return a._options=e,Dr({subject:a._subjects.state,next:o=>{po(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&&!ht(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=go(n,a),t.current}var rl=Object.freeze(Object.defineProperty({__proto__:null,Controller:Bu,Form:Wu,FormProvider:fo,appendErrors:bo,get:I,set:z,useController:yo,useFieldArray:zu,useForm:Co,useFormContext:ze,useFormState:mo,useWatch:Er},Symbol.toStringTag,{value:"Module"})),_o=(e=>(e.FULL_PAGE="FULL_PAGE",e.MODAL="MODAL",e))(_o||{}),To=(e=>(e.SIMPLE="SIMPLE",e.COMPLEX="COMPLEX",e.QUANTITY="QUANTITY",e))(To||{}),qn=(e=>(e.SELECT="selCtx",e.FILTER="fltCtx",e))(qn||{}),Qn=(e=>(e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.PRODUCT="3e/product",e))(Qn||{}),Ie=(e=>(e.OK="OK",e.TOO_MUCH="TOO_MUCH",e.NOT_ENOUGHT="NOT_ENOUGHT",e.IGNORE="IGNORE",e))(Ie||{});const nl=(e,t,r)=>{if(e==="selected"||e==="filter")return[];if(r[t]===e)return[r];let n=Io(e,t,r.items);return n!=null&&n.length||(n=No(e,t,r.items),n.length),n},No=(e,t,r)=>{const n=il(r),i=Io(e,t,n);return i!=null&&i.length?i:n!=null&&n.length?No(e,t,n):[]},il=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)},Io=(e,t,r)=>{let n=[];return Array.isArray(r)&&(n=r.filter(i=>{if(i&&i[t]===e)return!0})),n},al=(e,t,r,n)=>{const i=nl(t,r,n),a=ol(e,i).filter(o=>o!==null&&typeof o!="undefined");return a.length?a[0]:null},ol=(e,t)=>{let r=[];return Array.isArray(t)&&t.length&&(r=t.map(n=>sl(e,n))),r},sl=(e,t)=>{if(t.id===e)return t;let r=Lo(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=ul(t),n=Lo(e,r);return n!=null&&n.length?n:r!=null&&r.length?$o(e,r):[]},ul=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)},Lo=(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[a,o]of Object.entries(i))if(o){const s=al(a,n,qn.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},Ro=e=>{const{price:t,state:{selected:r}={}}=e;return(!t||parseFloat(t||"1")===0)&&r?`${Jn(r,e)||"0"}`:t};var ll=typeof global=="object"&&global&&global.Object===Object&&global,Fo=ll,cl=typeof self=="object"&&self&&self.Object===Object&&self,fl=Fo||cl||Function("return this")(),qe=fl,dl=qe.Symbol,ft=dl,Mo=Object.prototype,gl=Mo.hasOwnProperty,pl=Mo.toString,Vt=ft?ft.toStringTag:void 0;function hl(e){var t=gl.call(e,Vt),r=e[Vt];try{e[Vt]=void 0;var n=!0}catch{}var i=pl.call(e);return n&&(t?e[Vt]=r:delete e[Vt]),i}var ml=Object.prototype,vl=ml.toString;function yl(e){return vl.call(e)}var bl="[object Null]",Sl="[object Undefined]",Ui=ft?ft.toStringTag:void 0;function Lt(e){return e==null?e===void 0?Sl:bl:Ui&&Ui in Object(e)?hl(e):yl(e)}function dt(e){return e!=null&&typeof e=="object"}var Ol="[object Symbol]";function wl(e){return typeof e=="symbol"||dt(e)&&Lt(e)==Ol}var El=Array.isArray,Nt=El,Pl=/\s/;function xl(e){for(var t=e.length;t--&&Pl.test(e.charAt(t)););return t}var Al=/^\s+/;function Cl(e){return e&&e.slice(0,xl(e)+1).replace(Al,"")}function yt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Bi=0/0,_l=/^[-+]0x[0-9a-f]+$/i,Tl=/^0b[01]+$/i,Nl=/^0o[0-7]+$/i,Il=parseInt;function ko(e){if(typeof e=="number")return e;if(wl(e))return Bi;if(yt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=yt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Cl(e);var r=Tl.test(e);return r||Nl.test(e)?Il(e.slice(2),r?2:8):_l.test(e)?Bi:+e}var Hi=1/0,$l=17976931348623157e292;function Wi(e){if(!e)return e===0?e:0;if(e=ko(e),e===Hi||e===-Hi){var t=e<0?-1:1;return t*$l}return e===e?e:0}var Ll="[object AsyncFunction]",Rl="[object Function]",Fl="[object GeneratorFunction]",Ml="[object Proxy]";function Do(e){if(!yt(e))return!1;var t=Lt(e);return t==Rl||t==Fl||t==Ll||t==Ml}var kl=qe["__core-js_shared__"],gn=kl,Gi=function(){var e=/[^.]+$/.exec(gn&&gn.keys&&gn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Dl(e){return!!Gi&&Gi in e}var jl=Function.prototype,Vl=jl.toString;function St(e){if(e!=null){try{return Vl.call(e)}catch{}try{return e+""}catch{}}return""}var Ul=/[\\^$.*+?()[\]{}|]/g,Bl=/^\[object .+?Constructor\]$/,Hl=Function.prototype,Wl=Object.prototype,Gl=Hl.toString,Kl=Wl.hasOwnProperty,Yl=RegExp("^"+Gl.call(Kl).replace(Ul,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function zl(e){if(!yt(e)||Dl(e))return!1;var t=Do(e)?Yl:Bl;return t.test(St(e))}function ql(e,t){return e==null?void 0:e[t]}function Ot(e,t){var r=ql(e,t);return zl(r)?r:void 0}var Ql=Ot(qe,"WeakMap"),_n=Ql,Ki=Object.create,Jl=function(){function e(){}return function(t){if(!yt(t))return{};if(Ki)return Ki(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Zl=Jl;function Xl(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var ec=function(){try{var e=Ot(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Yi=ec;function tc(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var rc=9007199254740991,nc=/^(?:0|[1-9]\d*)$/;function ic(e,t){var r=typeof e;return t=t==null?rc:t,!!t&&(r=="number"||r!="symbol"&&nc.test(e))&&e>-1&&e%1==0&&e<t}function jo(e,t,r){t=="__proto__"&&Yi?Yi(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Zn(e,t){return e===t||e!==e&&t!==t}var ac=Object.prototype,oc=ac.hasOwnProperty;function Vo(e,t,r){var n=e[t];(!(oc.call(e,t)&&Zn(n,r))||r===void 0&&!(t in e))&&jo(e,t,r)}function jr(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?jo(r,s,u):Vo(r,s,u)}return r}var sc=9007199254740991;function Uo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=sc}function Xn(e){return e!=null&&Uo(e.length)&&!Do(e)}var uc=Object.prototype;function Vr(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||uc;return e===r}function lc(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var cc="[object Arguments]";function zi(e){return dt(e)&&Lt(e)==cc}var Bo=Object.prototype,fc=Bo.hasOwnProperty,dc=Bo.propertyIsEnumerable,gc=zi(function(){return arguments}())?zi:function(e){return dt(e)&&fc.call(e,"callee")&&!dc.call(e,"callee")},Ho=gc;function pc(){return!1}var Wo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,qi=Wo&&typeof module=="object"&&module&&!module.nodeType&&module,hc=qi&&qi.exports===Wo,Qi=hc?qe.Buffer:void 0,mc=Qi?Qi.isBuffer:void 0,vc=mc||pc,Zt=vc,yc="[object Arguments]",bc="[object Array]",Sc="[object Boolean]",Oc="[object Date]",wc="[object Error]",Ec="[object Function]",Pc="[object Map]",xc="[object Number]",Ac="[object Object]",Cc="[object RegExp]",_c="[object Set]",Tc="[object String]",Nc="[object WeakMap]",Ic="[object ArrayBuffer]",$c="[object DataView]",Lc="[object Float32Array]",Rc="[object Float64Array]",Fc="[object Int8Array]",Mc="[object Int16Array]",kc="[object Int32Array]",Dc="[object Uint8Array]",jc="[object Uint8ClampedArray]",Vc="[object Uint16Array]",Uc="[object Uint32Array]",te={};te[Lc]=te[Rc]=te[Fc]=te[Mc]=te[kc]=te[Dc]=te[jc]=te[Vc]=te[Uc]=!0;te[yc]=te[bc]=te[Ic]=te[Sc]=te[$c]=te[Oc]=te[wc]=te[Ec]=te[Pc]=te[xc]=te[Ac]=te[Cc]=te[_c]=te[Tc]=te[Nc]=!1;function Bc(e){return dt(e)&&Uo(e.length)&&!!te[Lt(e)]}function ei(e){return function(t){return e(t)}}var Go=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qt=Go&&typeof module=="object"&&module&&!module.nodeType&&module,Hc=Qt&&Qt.exports===Go,pn=Hc&&Fo.process,Wc=function(){try{var e=Qt&&Qt.require&&Qt.require("util").types;return e||pn&&pn.binding&&pn.binding("util")}catch{}}(),It=Wc,Ji=It&&It.isTypedArray,Gc=Ji?ei(Ji):Bc,ti=Gc,Kc=Object.prototype,Yc=Kc.hasOwnProperty;function Ko(e,t){var r=Nt(e),n=!r&&Ho(e),i=!r&&!n&&Zt(e),a=!r&&!n&&!i&&ti(e),o=r||n||i||a,s=o?lc(e.length,String):[],u=s.length;for(var f in e)(t||Yc.call(e,f))&&!(o&&(f=="length"||i&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||ic(f,u)))&&s.push(f);return s}function Yo(e,t){return function(r){return e(t(r))}}var zc=Yo(Object.keys,Object),qc=zc,Qc=Object.prototype,Jc=Qc.hasOwnProperty;function zo(e){if(!Vr(e))return qc(e);var t=[];for(var r in Object(e))Jc.call(e,r)&&r!="constructor"&&t.push(r);return t}function ri(e){return Xn(e)?Ko(e):zo(e)}function Zc(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var Xc=Object.prototype,ef=Xc.hasOwnProperty;function tf(e){if(!yt(e))return Zc(e);var t=Vr(e),r=[];for(var n in e)n=="constructor"&&(t||!ef.call(e,n))||r.push(n);return r}function ni(e){return Xn(e)?Ko(e,!0):tf(e)}var rf=Ot(Object,"create"),Xt=rf;function nf(){this.__data__=Xt?Xt(null):{},this.size=0}function af(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var of="__lodash_hash_undefined__",sf=Object.prototype,uf=sf.hasOwnProperty;function lf(e){var t=this.__data__;if(Xt){var r=t[e];return r===of?void 0:r}return uf.call(t,e)?t[e]:void 0}var cf=Object.prototype,ff=cf.hasOwnProperty;function df(e){var t=this.__data__;return Xt?t[e]!==void 0:ff.call(t,e)}var gf="__lodash_hash_undefined__";function pf(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Xt&&t===void 0?gf:t,this}function bt(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])}}bt.prototype.clear=nf;bt.prototype.delete=af;bt.prototype.get=lf;bt.prototype.has=df;bt.prototype.set=pf;function hf(){this.__data__=[],this.size=0}function Ur(e,t){for(var r=e.length;r--;)if(Zn(e[r][0],t))return r;return-1}var mf=Array.prototype,vf=mf.splice;function yf(e){var t=this.__data__,r=Ur(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():vf.call(t,r,1),--this.size,!0}function bf(e){var t=this.__data__,r=Ur(t,e);return r<0?void 0:t[r][1]}function Sf(e){return Ur(this.__data__,e)>-1}function Of(e,t){var r=this.__data__,n=Ur(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function et(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])}}et.prototype.clear=hf;et.prototype.delete=yf;et.prototype.get=bf;et.prototype.has=Sf;et.prototype.set=Of;var wf=Ot(qe,"Map"),er=wf;function Ef(){this.size=0,this.__data__={hash:new bt,map:new(er||et),string:new bt}}function Pf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Br(e,t){var r=e.__data__;return Pf(t)?r[typeof t=="string"?"string":"hash"]:r.map}function xf(e){var t=Br(this,e).delete(e);return this.size-=t?1:0,t}function Af(e){return Br(this,e).get(e)}function Cf(e){return Br(this,e).has(e)}function _f(e,t){var r=Br(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function wt(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])}}wt.prototype.clear=Ef;wt.prototype.delete=xf;wt.prototype.get=Af;wt.prototype.has=Cf;wt.prototype.set=_f;function qo(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Tf=Yo(Object.getPrototypeOf,Object),Qo=Tf;function Nf(){this.__data__=new et,this.size=0}function If(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function $f(e){return this.__data__.get(e)}function Lf(e){return this.__data__.has(e)}var Rf=200;function Ff(e,t){var r=this.__data__;if(r instanceof et){var n=r.__data__;if(!er||n.length<Rf-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new wt(n)}return r.set(e,t),this.size=r.size,this}function Je(e){var t=this.__data__=new et(e);this.size=t.size}Je.prototype.clear=Nf;Je.prototype.delete=If;Je.prototype.get=$f;Je.prototype.has=Lf;Je.prototype.set=Ff;function Mf(e,t){return e&&jr(t,ri(t),e)}function kf(e,t){return e&&jr(t,ni(t),e)}var Jo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Zi=Jo&&typeof module=="object"&&module&&!module.nodeType&&module,Df=Zi&&Zi.exports===Jo,Xi=Df?qe.Buffer:void 0,ea=Xi?Xi.allocUnsafe:void 0;function jf(e,t){if(t)return e.slice();var r=e.length,n=ea?ea(r):new e.constructor(r);return e.copy(n),n}function Vf(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 Uf=Object.prototype,Bf=Uf.propertyIsEnumerable,ta=Object.getOwnPropertySymbols,Hf=ta?function(e){return e==null?[]:(e=Object(e),Vf(ta(e),function(t){return Bf.call(e,t)}))}:Zo,ii=Hf;function Wf(e,t){return jr(e,ii(e),t)}var Gf=Object.getOwnPropertySymbols,Kf=Gf?function(e){for(var t=[];e;)qo(t,ii(e)),e=Qo(e);return t}:Zo,Xo=Kf;function Yf(e,t){return jr(e,Xo(e),t)}function es(e,t,r){var n=t(e);return Nt(e)?n:qo(n,r(e))}function Tn(e){return es(e,ri,ii)}function zf(e){return es(e,ni,Xo)}var qf=Ot(qe,"DataView"),Nn=qf,Qf=Ot(qe,"Promise"),In=Qf,Jf=Ot(qe,"Set"),$n=Jf,ra="[object Map]",Zf="[object Object]",na="[object Promise]",ia="[object Set]",aa="[object WeakMap]",oa="[object DataView]",Xf=St(Nn),ed=St(er),td=St(In),rd=St($n),nd=St(_n),gt=Lt;(Nn&>(new Nn(new ArrayBuffer(1)))!=oa||er&>(new er)!=ra||In&>(In.resolve())!=na||$n&>(new $n)!=ia||_n&>(new _n)!=aa)&&(gt=function(e){var t=Lt(e),r=t==Zf?e.constructor:void 0,n=r?St(r):"";if(n)switch(n){case Xf:return oa;case ed:return ra;case td:return na;case rd:return ia;case nd:return aa}return t});var $t=gt,id=Object.prototype,ad=id.hasOwnProperty;function od(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&ad.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var sd=qe.Uint8Array,_r=sd;function ai(e){var t=new e.constructor(e.byteLength);return new _r(t).set(new _r(e)),t}function ud(e,t){var r=t?ai(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var ld=/\w*$/;function cd(e){var t=new e.constructor(e.source,ld.exec(e));return t.lastIndex=e.lastIndex,t}var sa=ft?ft.prototype:void 0,ua=sa?sa.valueOf:void 0;function fd(e){return ua?Object(ua.call(e)):{}}function dd(e,t){var r=t?ai(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var gd="[object Boolean]",pd="[object Date]",hd="[object Map]",md="[object Number]",vd="[object RegExp]",yd="[object Set]",bd="[object String]",Sd="[object Symbol]",Od="[object ArrayBuffer]",wd="[object DataView]",Ed="[object Float32Array]",Pd="[object Float64Array]",xd="[object Int8Array]",Ad="[object Int16Array]",Cd="[object Int32Array]",_d="[object Uint8Array]",Td="[object Uint8ClampedArray]",Nd="[object Uint16Array]",Id="[object Uint32Array]";function $d(e,t,r){var n=e.constructor;switch(t){case Od:return ai(e);case gd:case pd:return new n(+e);case wd:return ud(e,r);case Ed:case Pd:case xd:case Ad:case Cd:case _d:case Td:case Nd:case Id:return dd(e,r);case hd:return new n;case md:case bd:return new n(e);case vd:return cd(e);case yd:return new n;case Sd:return fd(e)}}function Ld(e){return typeof e.constructor=="function"&&!Vr(e)?Zl(Qo(e)):{}}var Rd="[object Map]";function Fd(e){return dt(e)&&$t(e)==Rd}var la=It&&It.isMap,Md=la?ei(la):Fd,kd=Md,Dd="[object Set]";function jd(e){return dt(e)&&$t(e)==Dd}var ca=It&&It.isSet,Vd=ca?ei(ca):jd,Ud=Vd,Bd=1,Hd=2,Wd=4,ts="[object Arguments]",Gd="[object Array]",Kd="[object Boolean]",Yd="[object Date]",zd="[object Error]",rs="[object Function]",qd="[object GeneratorFunction]",Qd="[object Map]",Jd="[object Number]",ns="[object Object]",Zd="[object RegExp]",Xd="[object Set]",eg="[object String]",tg="[object Symbol]",rg="[object WeakMap]",ng="[object ArrayBuffer]",ig="[object DataView]",ag="[object Float32Array]",og="[object Float64Array]",sg="[object Int8Array]",ug="[object Int16Array]",lg="[object Int32Array]",cg="[object Uint8Array]",fg="[object Uint8ClampedArray]",dg="[object Uint16Array]",gg="[object Uint32Array]",J={};J[ts]=J[Gd]=J[ng]=J[ig]=J[Kd]=J[Yd]=J[ag]=J[og]=J[sg]=J[ug]=J[lg]=J[Qd]=J[Jd]=J[ns]=J[Zd]=J[Xd]=J[eg]=J[tg]=J[cg]=J[fg]=J[dg]=J[gg]=!0;J[zd]=J[rs]=J[rg]=!1;function mr(e,t,r,n,i,a){var o,s=t&Bd,u=t&Hd,f=t&Wd;if(r&&(o=i?r(e,n,i,a):r(e)),o!==void 0)return o;if(!yt(e))return e;var c=Nt(e);if(c){if(o=od(e),!s)return Xl(e,o)}else{var l=$t(e),d=l==rs||l==qd;if(Zt(e))return jf(e,s);if(l==ns||l==ts||d&&!i){if(o=u||d?{}:Ld(e),!s)return u?Yf(e,kf(o,e)):Wf(e,Mf(o,e))}else{if(!J[l])return i?e:{};o=$d(e,l,s)}}a||(a=new Je);var g=a.get(e);if(g)return g;a.set(e,o),Ud(e)?e.forEach(function(v){o.add(mr(v,t,r,v,e,a))}):kd(e)&&e.forEach(function(v,b){o.set(b,mr(v,t,r,b,e,a))});var p=f?u?zf:Tn:u?ni:ri,y=c?void 0:p(e);return tc(y||e,function(v,b){y&&(b=v,v=e[b]),Vo(o,b,mr(v,t,r,b,e,a))}),o}var pg=1,hg=4;function is(e){return mr(e,pg|hg)}var mg="__lodash_hash_undefined__";function vg(e){return this.__data__.set(e,mg),this}function yg(e){return this.__data__.has(e)}function Tr(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new wt;++t<r;)this.add(e[t])}Tr.prototype.add=Tr.prototype.push=vg;Tr.prototype.has=yg;function bg(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 Sg(e,t){return e.has(t)}var Og=1,wg=2;function as(e,t,r,n,i,a){var o=r&Og,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&wg?new Tr: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(!bg(t,function(b,m){if(!Sg(g,m)&&(p===b||i(p,b,r,n,a)))return g.push(m)})){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 Eg(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function Pg(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var xg=1,Ag=2,Cg="[object Boolean]",_g="[object Date]",Tg="[object Error]",Ng="[object Map]",Ig="[object Number]",$g="[object RegExp]",Lg="[object Set]",Rg="[object String]",Fg="[object Symbol]",Mg="[object ArrayBuffer]",kg="[object DataView]",fa=ft?ft.prototype:void 0,hn=fa?fa.valueOf:void 0;function Dg(e,t,r,n,i,a,o){switch(r){case kg:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Mg:return!(e.byteLength!=t.byteLength||!a(new _r(e),new _r(t)));case Cg:case _g:case Ig:return Zn(+e,+t);case Tg:return e.name==t.name&&e.message==t.message;case $g:case Rg:return e==t+"";case Ng:var s=Eg;case Lg:var u=n&xg;if(s||(s=Pg),e.size!=t.size&&!u)return!1;var f=o.get(e);if(f)return f==t;n|=Ag,o.set(e,t);var c=as(s(e),s(t),n,i,a,o);return o.delete(e),c;case Fg:if(hn)return hn.call(e)==hn.call(t)}return!1}var jg=1,Vg=Object.prototype,Ug=Vg.hasOwnProperty;function Bg(e,t,r,n,i,a){var o=r&jg,s=Tn(e),u=s.length,f=Tn(t),c=f.length;if(u!=c&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:Ug.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],m=t[d];if(n)var E=o?n(m,b,d,t,e,a):n(b,m,d,e,t,a);if(!(E===void 0?b===m||i(b,m,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 Hg=1,da="[object Arguments]",ga="[object Array]",fr="[object Object]",Wg=Object.prototype,pa=Wg.hasOwnProperty;function Gg(e,t,r,n,i,a){var o=Nt(e),s=Nt(t),u=o?ga:$t(e),f=s?ga:$t(t);u=u==da?fr:u,f=f==da?fr:f;var c=u==fr,l=f==fr,d=u==f;if(d&&Zt(e)){if(!Zt(t))return!1;o=!0,c=!1}if(d&&!c)return a||(a=new Je),o||ti(e)?as(e,t,r,n,i,a):Dg(e,t,u,r,n,i,a);if(!(r&Hg)){var g=c&&pa.call(e,"__wrapped__"),p=l&&pa.call(t,"__wrapped__");if(g||p){var y=g?e.value():e,v=p?t.value():t;return a||(a=new Je),i(y,v,r,n,a)}}return d?(a||(a=new Je),Bg(e,t,r,n,i,a)):!1}function os(e,t,r,n,i){return e===t?!0:e==null||t==null||!dt(e)&&!dt(t)?e!==e&&t!==t:Gg(e,t,r,n,os,i)}var Kg=Math.max,Yg=Math.min;function zg(e,t,r){return e>=Yg(t,r)&&e<Kg(t,r)}function Nr(e,t,r){return t=Wi(t),r===void 0?(r=t,t=0):r=Wi(r),e=ko(e),zg(e,t,r)}var qg="[object Map]",Qg="[object Set]",Jg=Object.prototype,Zg=Jg.hasOwnProperty;function De(e){if(e==null)return!0;if(Xn(e)&&(Nt(e)||typeof e=="string"||typeof e.splice=="function"||Zt(e)||ti(e)||Ho(e)))return!e.length;var t=$t(e);if(t==qg||t==Qg)return!e.size;if(Vr(e))return!zo(e).length;for(var r in e)if(Zg.call(e,r))return!1;return!0}function Xg(e,t){return os(e,t)}const ep=["id","selCtx","fltCtx"],ss=".",us="#dot",ls="#FIX_NUMBER",tp=e=>fs(is(e),ip),rp=e=>{const t=e.replaceAll(ss,us);return/^\d+$/.test(t)?`${ls}${t}`:t},np=e=>e.replaceAll(us,ss).replaceAll(ls,""),ip=(e,t)=>cs(e,t,rp),ap=(e,t)=>cs(e,t,np),cs=(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 ep.includes(e)&&(typeof t=="string"||t instanceof String)&&(n=r(t)),(e==="selected"||e==="filter")&&(n=i(t)),n},fs=(e,t)=>(Object.keys(e).forEach(r=>{const n=e[r];e[r]=t(r,n),typeof n=="object"&&n!==null&&fs(n,t)}),e),ds=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},op=e=>ap("selected",e);var ha;(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"})(ha||(ha={}));var ma;(function(e){e.CAROUSEL="carousel",e.NORMAL="normal",e.IMAGE="image"})(ma||(ma={}));var We;(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"})(We||(We={}));var va;(function(e){e.GROUP="group",e.PRODUCT="product"})(va||(va={}));var ya;(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"})(ya||(ya={}));var ba;(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"})(ba||(ba={}));var Sa;(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"})(Sa||(Sa={}));var Oa;(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"})(Oa||(Oa={}));var wa;(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"})(wa||(wa={}));var Ea;(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"})(Ea||(Ea={}));var Pa;(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"})(Pa||(Pa={}));var xa;(function(e){e.NEW="NEW",e.TECHNICAL="TECHNICAL",e.CONFIRMED="CONFIRMED",e.PROCESSING="PROCESSING",e.PROCESSED="PROCESSED",e.VOID="VOID",e.WASTE="WASTE"})(xa||(xa={}));var Aa;(function(e){e.GROUP="group",e.PRODUCT="product"})(Aa||(Aa={}));var Ca;(function(e){e.ORDER_EVENT_ERROR="OrderEventError",e.ORDER_APPLIED_EVENTS="OrderAppliedEvents",e.ORDER_EVENT_FISCAL="OrderEventFiscal",e.ORDER_UPSELL="OrderUpsell"})(Ca||(Ca={}));const sp=e=>e==="true"||e===!0,up=e=>`options--${e}`,gs=e=>{const{details:{media:t=[]}={}}=e,r=t.find(n=>n.name==="MAIN_IMG")||t[0]||{};return(r==null?void 0:r.url)||""},_a=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 ps(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===We.OPTIONS)return i;if(i.items&&i.items.length>0){const a=ps(e,i);if(a)return a}}return null}function lp(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 cp=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Ta=cp?S.useEffect:S.useLayoutEffect;function fp(e){const t=typeof e=="function"?lp(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)),Ta(()=>{g&&(l.current=d),s.current=o,u.current=n,f.current=i,c.current=!1});const p=S.useRef(o);Ta(()=>{const v=()=>{try{const m=t.getState(),E=u.current(m);f.current(l.current,E)||(s.current=m,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 dp=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}}}))}}),gp=(e,t)=>Ir(e,t,"isSelCntAllowedToIncrement")&&Ir(e,t,"isQtyCntAllowedToIncrement")&&Ln(e,t,"isQtyCntAllowedToIncrement")&&Ln(e,t,"isQtyCntAllowedToIncrement"),pp=(e,t,r)=>{var a;const{selCtx:n}=e;return((a=r==null?void 0:r[n])==null?void 0:a.parentKind)===Qn.PRODUCT?Na(e,t)&&Ir(e,r,"isQtyCntAllowedToIncrement"):Na(e,t)&&Ir(e,r,"isQtyCntAllowedToIncrement")&&Ln(e,r,"isQtyCntAllowedToIncrement")},Na=(e,t)=>{const{qtyMax:r}=e;return Number(t)<Number(r||Number.MAX_SAFE_INTEGER)},Ir=(e,t,r)=>{var a;const{selCtx:n}=e,i=(a=t==null?void 0:t[n])==null?void 0:a[r];return hs(i)?!0:i},Ln=(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 hs(o)?!0:o},hs=e=>typeof e=="undefined",ms=(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]},hp=(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)},mp=(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:Nr(a,Number(g||0),Number(p||Number.MAX_SAFE_INTEGER)+1)&&Nr(o,Number(l||0),Number(d||Number.MAX_SAFE_INTEGER)+1),isPassedFiltering:s}}}))},isInputEnabled:r=>{const n=t().validationMap;return gp(r,n)},isInputCounterIncrementEnabled:(r,n)=>{const i=t().validationMap,a=hp(r,n);return pp(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}`}))}}),vp=(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:{}}))}}),oe=fp((e,t)=>({...dp(e),...mp(e,t),...vp(e,t)}));function vs(e,t){if(!t)return null;for(const r of t){if(r.id===e)return r;if(r.items){const n=vs(e,r.items);if(n)return n}}return null}function yp(e,t){return vs(e,t)!==null}function bp(e,t){if(t==null||De(t))return{};try{const r=is(t);for(const[n,i]of Object.entries(r))i&&typeof i=="object"&&!Array.isArray(i)&&Object.keys(i).forEach(a=>{yp(a,e.items)||(console.warn(`deleting selected selCtx ${n} id ${a}, not found in product`),delete r[n][a])});return ds(r)}catch(r){return console.error(r),t}}function Sp(e){var b;const[t,r]=S.useState(Number(e.quantity)||1),n=tp(e),{state:{filter:i={}}={}}=n,a=bp(n,(b=n.state)==null?void 0:b.selected),o=oe(m=>m.setInitialFilter),s=oe(m=>m.setInitialSelected),u=oe(m=>m.setInitialValidate),f=oe(m=>m.resetExpanded),c=oe(m=>m.filter),l=oe(m=>m.setCurrency),d=oe(m=>m.setIsOnSubmittedOnTrue),g=oe(m=>m.refreshFormDt),p=oe(m=>m.getInvalidSelCtxArray),y=()=>{r(m=>m+1)},v=()=>{t>1&&r(m=>m-1)};return S.useEffect(()=>{u(),o(i),s(a),f()},[e]),{encodedProduct:n,initSelected:a,initFilter:i,filter:c,setCurrency:l,setIsOnSubmittedOnTrue:d,getInvalidSelCtxArray:p,productQuantity:t,increaseProductQuantity:y,decreaseProductQuantity:v,refreshFormDt:g}}const Hr=(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},ys=(e,t)=>{const{items:r,filter:n}=e,i=[],a=[],o=s=>{s&&!De(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}},Op=(e,t)=>{console.log("LOG1 productsToUnselect",e),e.map(({selCtx:r,id:n})=>{t(`selected.${r}.${n}`,!1)})},bs=(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 Ss(e,t,r,n){const i=oe(p=>p.initialSelected),a=oe(p=>p.currency),{setValue:o,getValues:s}=ze(),{selected:u={},filter:f={}}=s(),c=Hr(e,f),l=oe(p=>p.isOnSubmitted);oe(p=>p.setValidationMap);const[d,g]=ms(e.selCtx,u,e.items);return S.useEffect(()=>{const{productsToSelect:p,productsToUnselect:y}=ys(e,c);bs(p,o,i)},[c]),{isFilterValidated:c,selected:u,isOnSubmitted:l,selCnt:d,qtyCnt:g,currency:a}}var Wr={exports:{}},Gr={};/**
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lu(e){return eo(e)||uu(e)||to(e)||ro()}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 Si(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){Ye(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}var cu={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)}},fu=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Le(this,e),this.init(t,r)}return Re(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||cu,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,Si(Si({},{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}(),Be=new fu,ct=function(){function e(){Le(this,e),this.observers={}}return Re(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 Dt(){var e,t,r=new Promise(function(n,i){e=n,t=i});return r.resolve=e,r.reject=t,r}function Oi(e){return e==null?"":""+e}function du(e,t,r){e.forEach(function(n){t[n]&&(r[n]=t[n])})}function Wn(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 wi(e,t,r){var n=Wn(e,t,Object),i=n.obj,a=n.k;i[a]=r}function gu(e,t,r,n){var i=Wn(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 Sr(e,t){var r=Wn(e,t),n=r.obj,i=r.k;if(!!n)return n[i]}function Ei(e,t,r){var n=Sr(e,r);return n!==void 0?n:Sr(t,r)}function no(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]):no(e[n],t[n],r):e[n]=t[n]);return e}function xt(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var pu={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function hu(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return pu[t]}):e}var kr=typeof window!="undefined"&&window.navigator&&typeof window.navigator.userAgentData=="undefined"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,mu=[" ",",","?","!",";"];function vu(e,t,r){t=t||"",r=r||"";var n=mu.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 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 ur(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){Ye(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 yu(e){var t=bu();return function(){var n=Ge(e),i;if(t){var a=Ge(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return rr(this,i)}}function bu(){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 io(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?io(u,f,r):void 0}i=i[n[a]]}return i}}var Su=function(e){Mr(r,e);var t=yu(r);function r(n){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Le(this,r),i=t.call(this),kr&&ct.call(lt(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 Re(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=Sr(this.data,c);return l||!f||typeof o!="string"?l:io(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),wi(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=Sr(this.data,c)||{};s?no(l,o,u):l=ur(ur({},l),o),wi(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"?ur(ur({},{}),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}(ct),ao={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 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 Oe(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){Ye(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 Ou(e){var t=wu();return function(){var n=Ge(e),i;if(t){var a=Ge(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return rr(this,i)}}function wu(){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 Ai={},Ci=function(e){Mr(r,e);var t=Ou(r);function r(n){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Le(this,r),i=t.call(this),kr&&ct.call(lt(i)),du(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,lt(i)),i.options=a,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Be.create("translator"),i}return Re(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&&!vu(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(ke(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,b=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(b){var v=a.nsSeparator||this.options.nsSeparator;return u?(y.res="".concat(g).concat(v).concat(l),y):"".concat(g).concat(v).concat(l)}return u?(y.res=l,y):l}var y=this.resolve(i,a),h=y&&y.res,E=y&&y.usedKey||l,C=y&&y.exactUsedKey||l,w=Object.prototype.toString.apply(h),x=["[object Number]","[object Function]","[object RegExp]"],_=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,$=!this.i18nFormat||this.i18nFormat.handleAsObject,F=typeof h!="string"&&typeof h!="boolean"&&typeof h!="number";if($&&h&&F&&x.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,Oe(Oe({},a),{},{ns:d})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return u?(y.res=k,y):k}if(f){var H=w==="[object Array]",M=H?[]:{},j=H?C:E;for(var V in h)if(Object.prototype.hasOwnProperty.call(h,V)){var W="".concat(j).concat(f).concat(V);M[V]=this.translate(W,Oe(Oe({},a),{joinArrays:!1,ns:d})),M[V]===W&&(M[V]=h[V])}h=M}}else if($&&typeof _=="string"&&w==="[object Array]")h=h.join(_),h&&(h=this.extendTranslation(h,i,a,o));else{var X=!1,G=!1,he=a.count!==void 0&&typeof a.count!="string",ye=r.hasDefaultValue(a),K=he?this.pluralResolver.getSuffix(p,a.count,a):"",ie=a["defaultValue".concat(K)]||a.defaultValue;!this.isValidLookup(h)&&ye&&(X=!0,h=ie),this.isValidLookup(h)||(G=!0,h=l);var ae=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,se=ae&&G?void 0:h,Q=ye&&ie!==h&&this.options.updateMissing;if(G||X||Q){if(this.logger.log(Q?"updateKey":"missingKey",p,g,l,Q?ie:h),f){var xe=this.resolve(l,Oe(Oe({},a),{},{keySeparator:!1}));xe&&xe.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 re=[],q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&q&&q[0])for(var ue=0;ue<q.length;ue++)re.push(q[ue]);else this.options.saveMissingTo==="all"?re=this.languageUtils.toResolveHierarchy(a.lng||this.language):re.push(a.lng||this.language);var ce=function(B,me,le){var Ae=ye&&le!==h?le:se;s.options.missingKeyHandler?s.options.missingKeyHandler(B,g,me,Ae,Q,a):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(B,g,me,Ae,Q,a),s.emit("missingKey",B,g,me,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&he?re.forEach(function(ve){s.pluralResolver.getSuffixes(ve,a).forEach(function(B){ce([ve],l+B,a["defaultValue".concat(B)]||ie)})}):ce(re,l,ie))}h=this.extendTranslation(h,i,a,y,o),G&&h===l&&this.options.appendNamespaceToMissingKey&&(h="".concat(g,":").concat(l)),(G||X)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(g,":").concat(l):l,X?h:void 0):h=this.options.parseMissingKeyHandler(h))}return u?(y.res=h,y):h}},{key:"extendTranslation",value:function(i,a,o,s,u){var f=this;if(this.i18nFormat&&this.i18nFormat.parse)i=this.i18nFormat.parse(i,Oe(Oe({},this.options.interpolation.defaultVariables),o),s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init(Oe(Oe({},o),{interpolation:Oe(Oe({},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=Oe(Oe({},this.options.interpolation.defaultVariables),g)),i=this.interpolator.interpolate(i,g,o.lng||this.language,o),c){var p=i.match(this.interpolator.nestingRegexp),b=p&&p.length;l<b&&(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,y=typeof v=="string"?[v]:v;return i!=null&&y&&y.length&&o.applyPostProcessor!==!1&&(i=ao.handle(y,i,a,this.options&&this.options.postProcessPassResolved?Oe({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 b=g.namespaces;a.options.fallbackNS&&(b=b.concat(a.options.fallbackNS));var v=o.count!==void 0&&typeof o.count!="string",y=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);b.forEach(function(C){a.isValidLookup(s)||(l=C,!Ai["".concat(E[0],"-").concat(C)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(l)&&(Ai["".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 x=[p];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(x,p,w,C,o);else{var _;v&&(_=a.pluralResolver.getSuffix(w,o.count,o));var $="".concat(a.options.pluralSeparator,"zero");if(v&&(x.push(p+_),y&&x.push(p+$)),h){var F="".concat(p).concat(a.options.contextSeparator).concat(o.context);x.push(F),v&&(x.push(F+_),y&&x.push(F+$))}}for(var k;k=x.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}(ct);function en(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Eu=function(){function e(t){Le(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Be.create("languageUtils")}return Re(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]=en(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]=en(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=en(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}(),Pu=[{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}],xu={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)}},Au=["v1","v2","v3"],_i={zero:0,one:1,two:2,few:3,many:4,other:5};function Cu(){var e={};return Pu.forEach(function(t){t.lngs.forEach(function(r){e[r]={numbers:t.nr,plurals:xu[t.fc]}})}),e}var _u=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Le(this,e),this.languageUtils=t,this.options=r,this.logger=Be.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=Cu()}return Re(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 _i[o]-_i[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!Au.includes(this.options.compatibilityJSON)}}]),e}();function Ti(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?Ti(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ti(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Tu=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Le(this,e),this.logger=Be.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(r){return r},this.init(t)}return Re(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:hu,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(y){if(y.indexOf(o.formatSeparator)<0){var h=Ei(n,c,y);return o.alwaysFormat?o.format(h,void 0,i,Me(Me(Me({},a),n),{},{interpolationkey:y})):h}var E=y.split(o.formatSeparator),C=E.shift().trim(),w=E.join(o.formatSeparator).trim();return o.format(Ei(n,c,C),w,i,Me(Me(Me({},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,b=[{regex:this.regexpUnescape,safeValue:function(y){return l(y)}},{regex:this.regexp,safeValue:function(y){return o.escapeValue?l(o.escape(y)):l(y)}}];return b.forEach(function(v){for(f=0;s=v.regex.exec(r);){var y=s[1].trim();if(u=d(y),u===void 0)if(typeof g=="function"){var h=g(r,s,a);u=typeof h=="string"?h:""}else if(a&&a.hasOwnProperty(y))u="";else if(p){u=s[0];continue}else o.logger.warn("missed to pass in variable ".concat(y," for interpolating ").concat(r)),u="";else typeof u!="string"&&!o.useRawValueToEscape&&(u=Oi(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=Me({},a);u.applyPostProcessor=!1,delete u.defaultValue;function f(g,p){var b=this.nestingOptionsSeparator;if(g.indexOf(b)<0)return g;var v=g.split(new RegExp("".concat(b,"[ ]*{"))),y="{".concat(v[1]);g=v[0],y=this.interpolate(y,u);var h=y.match(/'/g),E=y.match(/"/g);(h&&h.length%2===0&&!E||E.length%2!==0)&&(y=y.replace(/'/g,'"'));try{u=JSON.parse(y),p&&(u=Me(Me({},p),u))}catch(C){return this.logger.warn("failed parsing options string in nesting for key ".concat(g),C),"".concat(g).concat(b).concat(y)}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=Oi(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,Me(Me({},a),{},{interpolationkey:o[1].trim()}))},s.trim())),r=r.replace(o[0],s),this.regexp.lastIndex=0}return r}}]),e}();function Ni(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 rt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ni(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ni(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Nu(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=lu(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 At(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 Iu=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Le(this,e),this.logger=Be.create("formatter"),this.options=t,this.formats={number:At(function(r,n){var i=new Intl.NumberFormat(r,n);return function(a){return i.format(a)}}),currency:At(function(r,n){var i=new Intl.NumberFormat(r,rt(rt({},n),{},{style:"currency"}));return function(a){return i.format(a)}}),datetime:At(function(r,n){var i=new Intl.DateTimeFormat(r,rt({},n));return function(a){return i.format(a)}}),relativetime:At(function(r,n){var i=new Intl.RelativeTimeFormat(r,rt({},n));return function(a){return i.format(a,n.range||"day")}}),list:At(function(r,n){var i=new Intl.ListFormat(r,rt({},n));return function(a){return i.format(a)}})},this.init(t)}return Re(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()]=At(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=Nu(c),d=l.formatName,g=l.formatOptions;if(o.formats[d]){var p=f;try{var b=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},v=b.locale||b.lng||a.locale||a.lng||i;p=o.formats[d](f,v,rt(rt(rt({},g),a),b))}catch(y){o.logger.warn(y)}return p}else o.logger.warn("there was no format function for ".concat(d));return f},r);return u}}]),e}();function Ii(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 $i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ii(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ii(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $u(e){var t=Lu();return function(){var n=Ge(e),i;if(t){var a=Ge(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return rr(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 Ru(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var Fu=function(e){Mr(r,e);var t=$u(r);function r(n,i,a){var o,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Le(this,r),o=t.call(this),kr&&ct.call(lt(o)),o.backend=n,o.store=i,o.services=a,o.languageUtils=a.languageUtils,o.options=s,o.logger=Be.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 Re(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(b){var v="".concat(g,"|").concat(b);!o.reload&&u.store.hasResourceBundle(g,b)?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[b]===void 0&&(d[b]=!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){gu(l.loaded,[u],f),Ru(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,$i($i({},f),{},{isUpdate:u})),!(!i||!i[0])&&this.store.addResource(i[0],a,o,s))}}]),r}(ct);function Mu(){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(ke(t[1])==="object"&&(r=t[1]),typeof t[1]=="string"&&(r.defaultValue=t[1]),typeof t[2]=="string"&&(r.tDescription=t[2]),ke(t[2])==="object"||ke(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 Li(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 Ri(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 Ve(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ri(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ri(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ku(e){var t=Du();return function(){var n=Ge(e),i;if(t){var a=Ge(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return rr(this,i)}}function Du(){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 lr(){}function ju(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(r){typeof e[r]=="function"&&(e[r]=e[r].bind(e))})}var Or=function(e){Mr(r,e);var t=ku(r);function r(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(Le(this,r),n=t.call(this),kr&&ct.call(lt(n)),n.options=Li(i),n.services={},n.logger=Be,n.modules={external:[]},ju(lt(n)),a&&!n.isInitialized&&!i.isClone){if(!n.options.initImmediate)return n.init(i,a),rr(n,lt(n));setTimeout(function(){n.init(i,a)},0)}return n}return Re(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=Mu();this.options=Ve(Ve(Ve({},s),this.options),Li(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Ve(Ve({},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(y){return y?typeof y=="function"?new y:y:null}if(!this.options.isClone){this.modules.logger?Be.init(u(this.modules.logger),this.options):Be.init(null,this.options);var f;this.modules.formatter?f=this.modules.formatter:typeof Intl!="undefined"&&(f=Iu);var c=new Eu(this.options);this.store=new Su(this.options.resources,this.options);var l=this.services;l.logger=Be,l.resourceStore=this.store,l.languageUtils=c,l.pluralResolver=new _u(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 Tu(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new Fu(u(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(y){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,[y].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 Ci(this.services,this.options),this.translator.on("*",function(y){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,[y].concat(E))}),this.modules.external.forEach(function(y){y.init&&y.init(i)})}if(this.format=this.options.interpolation.format,o||(o=lr),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(y){i[y]=function(){var h;return(h=i.store)[y].apply(h,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(y){i[y]=function(){var h;return(h=i.store)[y].apply(h,arguments),i}});var b=Dt(),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),b.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),b}},{key:"loadResources",value:function(i){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:lr,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(b){f.indexOf(b)<0&&f.push(b)})}};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=Dt();return i||(i=this.languages),a||(a=this.options.ns),o||(o=lr),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"&&ao.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=Dt();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(ke(l)!=="object"){for(var g=arguments.length,p=new Array(g>2?g-2:0),b=2;b<g;b++)p[b-2]=arguments[b];d=s.options.overloadTranslationOptionHandler([c,l].concat(p))}else d=Ve({},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||".",y=d.keyPrefix?"".concat(d.keyPrefix).concat(v).concat(c):c;return s.t(y,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 b=a.services.backendConnector.state["".concat(g,"|").concat(p)];return b===-1||b===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=Dt();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=Dt();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]:lr,s=Ve(Ve(Ve({},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=Ve({},this.services),u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u.translator=new Ci(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}(ct);Ye(Or,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Or(e,t)});var Se=Or.createInstance();Se.createInstance=Or.createInstance;Se.createInstance;Se.init;Se.loadResources;Se.reloadResources;Se.use;Se.changeLanguage;Se.getFixedT;Se.t;Se.exists;Se.setDefaultNamespace;Se.hasLoadedNamespace;Se.loadNamespaces;Se.loadLanguages;var nr=e=>e.type==="checkbox",_t=e=>e instanceof Date,we=e=>e==null;const oo=e=>typeof e=="object";var pe=e=>!we(e)&&!Array.isArray(e)&&oo(e)&&!_t(e),so=e=>pe(e)&&e.target?nr(e.target)?e.target.checked:e.target.value:e,Vu=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,uo=(e,t)=>e.has(Vu(t)),Uu=e=>{const t=e.constructor&&e.constructor.prototype;return pe(t)&&t.hasOwnProperty("isPrototypeOf")},Gn=typeof window!="undefined"&&typeof window.HTMLElement!="undefined"&&typeof document!="undefined";function ge(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(!(Gn&&(e instanceof Blob||e instanceof FileList))&&(r||pe(e)))if(t=r?[]:{},!r&&!Uu(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=ge(e[n]));else return e;return t}var ir=e=>Array.isArray(e)?e.filter(Boolean):[],Z=e=>e===void 0,I=(e,t,r)=>{if(!t||!pe(e))return r;const n=ir(t.split(/[,[\].]+?/)).reduce((i,a)=>we(i)?i:i[a],e);return Z(n)||n===e?Z(e[t])?r:e[t]:n},Ue=e=>typeof e=="boolean",Kn=e=>/^\w*$/.test(e),lo=e=>ir(e.replace(/["|']|\]/g,"").split(/\.|\[/)),z=(e,t,r)=>{let n=-1;const i=Kn(t)?[t]:lo(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=pe(f)||Array.isArray(f)?f:isNaN(+i[n+1])?{}:[]}if(s==="__proto__")return;e[s]=u,e=e[s]}return e};const wr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ne={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"},co=T.default.createContext(null),ze=()=>T.default.useContext(co),fo=e=>{const{children:t,...r}=e;return T.default.createElement(co.Provider,{value:r},t)};var go=(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]!==Ne.all&&(t._proxyFormState[o]=!n||Ne.all),r&&(r[o]=!0),e[o]}});return i},Ee=e=>pe(e)&&!Object.keys(e).length,po=(e,t,r,n)=>{r(e);const{name:i,...a}=e;return Ee(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!n||Ne.all))},Pe=e=>Array.isArray(e)?e:[e],ho=(e,t,r)=>!e||!t||e===t||Pe(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function Dr(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 mo(e){const t=ze(),{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,Dr({disabled:n,next:l=>u.current&&ho(c.current,l.name,a)&&po(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]),go(o,r,f.current,!1)}var He=e=>typeof e=="string",vo=(e,t,r,n,i)=>He(e)?(n&&t.watch.add(e),I(r,e,i)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),I(r,a))):(n&&(t.watchAll=!0),r);function Er(e){const t=ze(),{control:r=t.control,name:n,defaultValue:i,disabled:a,exact:o}=e||{},s=T.default.useRef(n);s.current=n,Dr({disabled:a,subject:r._subjects.values,next:c=>{ho(s.current,c.name,o)&&f(ge(vo(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 yo(e){const t=ze(),{name:r,disabled:n,control:i=t.control,shouldUnregister:a}=e,o=uo(i._names.array,r),s=Er({control:i,name:r,defaultValue:I(i._formValues,r,I(i._defaultValues,r,e.defaultValue)),exact:!0}),u=mo({control:i,name:r}),f=T.default.useRef(i.register(r,{...e.rules,value:s,...Ue(e.disabled)?{disabled:e.disabled}:{}}));return T.default.useEffect(()=>{const c=i._options.shouldUnregister||a,l=(d,g)=>{const p=I(i._fields,d);p&&p._f&&(p._f.mount=g)};if(l(r,!0),c){const d=ge(I(i._options.defaultValues,r));z(i._defaultValues,r,d),Z(I(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(i._fields,r)&&i._updateDisabledField({disabled:n,fields:i._fields,name:r,value:I(i._fields,r)._f.value})},[n,r,i]),{field:{name:r,value:s,...Ue(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:T.default.useCallback(c=>f.current.onChange({target:{value:so(c),name:r},type:wr.CHANGE}),[r]),onBlur:T.default.useCallback(()=>f.current.onBlur({target:{value:I(i._formValues,r),name:r},type:wr.BLUR}),[r,i]),ref:c=>{const l=I(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:()=>!!I(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!I(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!I(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!I(u.validatingFields,r)},error:{enumerable:!0,get:()=>I(u.errors,r)}})}}const Bu=e=>e.render(yo(e)),Hu="post";function Wu(e){const t=ze(),[r,n]=T.default.useState(!1),{control:i=t.control,onSubmit:a,children:o,action:s,method:u=Hu,headers:f,encType:c,onError:l,render:d,onSuccess:g,validateStatus:p,...b}=e,v=async y=>{let h=!1,E="";await i.handleSubmit(async C=>{const w=new FormData;let x="";try{x=JSON.stringify(C)}catch{}for(const _ of i._names.mount)w.append(_,I(C,_));if(a&&await a({data:C,event:y,method:u,formData:w,formDataJson:x}),s)try{const _=[f&&f["Content-Type"],c].some(F=>F&&F.includes("json")),$=await fetch(s,{method:u,headers:{...f,...c?{"Content-Type":c}:{}},body:_?x:w});$&&(p?!p($.status):$.status<200||$.status>=300)?(h=!0,l&&l({response:$}),E=String($.status)):g&&g({response:$})}catch(_){h=!0,l&&l({error:_})}})(y),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,...b},o)}var bo=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},nt=()=>{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)})},tn=(e,t,r={})=>r.shouldFocus||Z(r.shouldFocus)?r.focusName||`${e}.${Z(r.focusIndex)?t:r.focusIndex}.`:"",Qt=e=>({isOnSubmit:!e||e===Ne.onSubmit,isOnBlur:e===Ne.onBlur,isOnChange:e===Ne.onChange,isOnAll:e===Ne.all,isOnTouch:e===Ne.onTouched}),An=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Tt=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const a=I(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;Tt(s,t)}else pe(s)&&Tt(s,t)}}};var So=(e,t,r)=>{const n=Pe(I(e,r));return z(n,"root",t[r]),z(e,r,n),e},Yn=e=>e.type==="file",ot=e=>typeof e=="function",Pr=e=>{if(!Gn)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},hr=e=>He(e),zn=e=>e.type==="radio",xr=e=>e instanceof RegExp;const Fi={value:!1,isValid:!1},Mi={value:!0,isValid:!0};var Oo=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&&!Z(e[0].attributes.value)?Z(e[0].value)||e[0].value===""?Mi:{value:e[0].value,isValid:!0}:Mi:Fi}return Fi};const ki={isValid:!1,value:null};var wo=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,ki):ki;function Di(e,t,r="validate"){if(hr(e)||Array.isArray(e)&&e.every(hr)||Ue(e)&&!e)return{type:r,message:hr(e)?e:"",ref:t}}var Ct=e=>pe(e)&&!xr(e)?e:{value:e,message:""},Cn=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:b,mount:v,disabled:y}=e._f,h=I(t,p);if(!v||y)return{};const E=o?o[0]:a,C=M=>{n&&E.reportValidity&&(E.setCustomValidity(Ue(M)?"":M||""),E.reportValidity())},w={},x=zn(a),_=nr(a),$=x||_,F=(b||Yn(a))&&Z(a.value)&&Z(h)||Pr(a)&&a.value===""||h===""||Array.isArray(h)&&!h.length,k=bo.bind(null,p,r,w),H=(M,j,V,W=qe.maxLength,X=qe.minLength)=>{const G=M?j:V;w[p]={type:M?W:X,message:G,ref:a,...k(M?W:X,G)}};if(i?!Array.isArray(h)||!h.length:s&&(!$&&(F||we(h))||Ue(h)&&!h||_&&!Oo(o).isValid||x&&!wo(o).isValid)){const{value:M,message:j}=hr(s)?{value:!!s,message:s}:Ct(s);if(M&&(w[p]={type:qe.required,message:j,ref:E,...k(qe.required,j)},!r))return C(j),w}if(!F&&(!we(c)||!we(l))){let M,j;const V=Ct(l),W=Ct(c);if(!we(h)&&!isNaN(h)){const X=a.valueAsNumber||h&&+h;we(V.value)||(M=X>V.value),we(W.value)||(j=X<W.value)}else{const X=a.valueAsDate||new Date(h),G=K=>new Date(new Date().toDateString()+" "+K),he=a.type=="time",ye=a.type=="week";He(V.value)&&h&&(M=he?G(h)>G(V.value):ye?h>V.value:X>new Date(V.value)),He(W.value)&&h&&(j=he?G(h)<G(W.value):ye?h<W.value:X<new Date(W.value))}if((M||j)&&(H(!!M,V.message,W.message,qe.max,qe.min),!r))return C(w[p].message),w}if((u||f)&&!F&&(He(h)||i&&Array.isArray(h))){const M=Ct(u),j=Ct(f),V=!we(M.value)&&h.length>+M.value,W=!we(j.value)&&h.length<+j.value;if((V||W)&&(H(V,M.message,j.message),!r))return C(w[p].message),w}if(d&&!F&&He(h)){const{value:M,message:j}=Ct(d);if(xr(M)&&!h.match(M)&&(w[p]={type:qe.pattern,message:j,ref:a,...k(qe.pattern,j)},!r))return C(j),w}if(g){if(ot(g)){const M=await g(h,t),j=Di(M,E);if(j&&(w[p]={...j,...k(qe.validate,j.message)},!r))return C(j.message),w}else if(pe(g)){let M={};for(const j in g){if(!Ee(M)&&!r)break;const V=Di(await g[j](h,t),E,j);V&&(M={...V,...k(j,V.message)},C(V.message),r&&(w[p]=M))}if(!Ee(M)&&(w[p]={ref:E,...M},!r))return w}}return C(!0),w},rn=(e,t)=>[...e,...Pe(t)],nn=e=>Array.isArray(e)?e.map(()=>{}):void 0;function an(e,t,r){return[...e.slice(0,t),...Pe(r),...e.slice(t)]}var on=(e,t,r)=>Array.isArray(e)?(Z(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],sn=(e,t)=>[...Pe(t),...Pe(e)];function Gu(e,t){let r=0;const n=[...e];for(const i of t)n.splice(i-r,1),r++;return ir(n).length?n:[]}var un=(e,t)=>Z(t)?[]:Gu(e,Pe(t).sort((r,n)=>r-n)),ln=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]};function Ku(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Z(e)?n++:e[t[n++]];return e}function Yu(e){for(const t in e)if(e.hasOwnProperty(t)&&!Z(e[t]))return!1;return!0}function de(e,t){const r=Array.isArray(t)?t:Kn(t)?[t]:lo(t),n=r.length===1?e:Ku(e,r),i=r.length-1,a=r[i];return n&&delete n[a],i!==0&&(pe(n)&&Ee(n)||Array.isArray(n)&&Yu(n))&&de(e,r.slice(0,-1)),e}var ji=(e,t,r)=>(e[t]=r,e);function zu(e){const t=ze(),{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(nt)),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),Dr({next:({values:w,name:x})=>{if(x===c.current||!x){const _=I(w,c.current);Array.isArray(_)&&(s(_),u.current=_.map(nt))}},subject:r._subjects.array});const d=T.default.useCallback(w=>{l.current=!0,r._updateFieldArray(n,w)},[r,n]),g=(w,x)=>{const _=Pe(ge(w)),$=rn(r._getFieldArray(n),_);r._names.focus=tn(n,$.length-1,x),u.current=rn(u.current,_.map(nt)),d($),s($),r._updateFieldArray(n,$,rn,{argA:nn(w)})},p=(w,x)=>{const _=Pe(ge(w)),$=sn(r._getFieldArray(n),_);r._names.focus=tn(n,0,x),u.current=sn(u.current,_.map(nt)),d($),s($),r._updateFieldArray(n,$,sn,{argA:nn(w)})},b=w=>{const x=un(r._getFieldArray(n),w);u.current=un(u.current,w),d(x),s(x),r._updateFieldArray(n,x,un,{argA:w})},v=(w,x,_)=>{const $=Pe(ge(x)),F=an(r._getFieldArray(n),w,$);r._names.focus=tn(n,w,_),u.current=an(u.current,w,$.map(nt)),d(F),s(F),r._updateFieldArray(n,F,an,{argA:w,argB:nn(x)})},y=(w,x)=>{const _=r._getFieldArray(n);ln(_,w,x),ln(u.current,w,x),d(_),s(_),r._updateFieldArray(n,_,ln,{argA:w,argB:x},!1)},h=(w,x)=>{const _=r._getFieldArray(n);on(_,w,x),on(u.current,w,x),d(_),s(_),r._updateFieldArray(n,_,on,{argA:w,argB:x},!1)},E=(w,x)=>{const _=ge(x),$=ji(r._getFieldArray(n),w,_);u.current=[...$].map((F,k)=>!F||k===w?nt():u.current[k]),d($),s([...$]),r._updateFieldArray(n,$,ji,{argA:w,argB:_},!0,!1)},C=w=>{const x=Pe(ge(w));u.current=x.map(nt),d([...x]),s([...x]),r._updateFieldArray(n,[...x],_=>_,{},!0,!1)};return T.default.useEffect(()=>{if(r._state.action=!1,An(n,r._names)&&r._subjects.state.next({...r._formState}),l.current&&(!Qt(r._options.mode).isOnSubmit||r._formState.isSubmitted))if(r._options.resolver)r._executeSchema([n]).then(w=>{const x=I(w.errors,n),_=I(r._formState.errors,n);(_?!x&&_.type||x&&(_.type!==x.type||_.message!==x.message):x&&x.type)&&(x?z(r._formState.errors,n,x):de(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const w=I(r._fields,n);w&&w._f&&!(Qt(r._options.reValidateMode).isOnSubmit&&Qt(r._options.mode).isOnSubmit)&&Cn(w,r._formValues,r._options.criteriaMode===Ne.all,r._options.shouldUseNativeValidation,!0).then(x=>!Ee(x)&&r._subjects.state.next({errors:So(r._formState.errors,x,n)}))}r._subjects.values.next({name:n,values:{...r._formValues}}),r._names.focus&&Tt(r._fields,(w,x)=>{if(r._names.focus&&x.startsWith(r._names.focus)&&w.focus)return w.focus(),1}),r._names.focus="",r._updateValid(),l.current=!1},[o,n,r]),T.default.useEffect(()=>(!I(r._formValues,n)&&r._updateFieldArray(n),()=>{(r._options.shouldUnregister||a)&&r.unregister(n)}),[n,r,i,a]),{swap:T.default.useCallback(y,[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(b,[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,x)=>({...w,[i]:u.current[x]||nt()})),[o,i])}}var cn=()=>{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=[]}}},Ar=e=>we(e)||!oo(e);function ht(e,t){if(Ar(e)||Ar(t))return e===t;if(_t(e)&&_t(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(_t(a)&&_t(o)||pe(a)&&pe(o)||Array.isArray(a)&&Array.isArray(o)?!ht(a,o):a!==o)return!1}}return!0}var Eo=e=>e.type==="select-multiple",Qu=e=>zn(e)||nr(e),fn=e=>Pr(e)&&e.isConnected,Po=e=>{for(const t in e)if(ot(e[t]))return!0;return!1};function Cr(e,t={}){const r=Array.isArray(e);if(pe(e)||r)for(const n in e)Array.isArray(e[n])||pe(e[n])&&!Po(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Cr(e[n],t[n])):we(e[n])||(t[n]=!0);return t}function xo(e,t,r){const n=Array.isArray(e);if(pe(e)||n)for(const i in e)Array.isArray(e[i])||pe(e[i])&&!Po(e[i])?Z(t)||Ar(r[i])?r[i]=Array.isArray(e[i])?Cr(e[i],[]):{...Cr(e[i])}:xo(e[i],we(t)?{}:t[i],r[i]):r[i]=!ht(e[i],t[i]);return r}var cr=(e,t)=>xo(e,t,Cr(t)),Ao=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Z(e)?e:t?e===""?NaN:e&&+e:r&&He(e)?new Date(e):n?n(e):e;function dn(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return Yn(t)?t.files:zn(t)?wo(e.refs).value:Eo(t)?[...t.selectedOptions].map(({value:r})=>r):nr(t)?Oo(e.refs).value:Ao(Z(t.value)?e.ref.value:t.value,e)}var qu=(e,t,r,n)=>{const i={};for(const a of e){const o=I(t,a);o&&z(i,a,o._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},jt=e=>Z(e)?e:xr(e)?e.source:pe(e)?xr(e.value)?e.value.source:e.value:e,Ju=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Vi(e,t,r){const n=I(e,r);if(n||Kn(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const a=i.join("."),o=I(t,a),s=I(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 Zu=(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,Xu=(e,t)=>!ir(I(e,t)).length&&de(e,t);const el={mode:Ne.onSubmit,reValidateMode:Ne.onChange,shouldFocusError:!0};function tl(e={}){let t={...el,...e},r={submitCount:0,isDirty:!1,isLoading:ot(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=pe(t.defaultValues)||pe(t.values)?ge(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:ge(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:cn(),array:cn(),state:cn()},d=Qt(t.mode),g=Qt(t.reValidateMode),p=t.criteriaMode===Ne.all,b=m=>O=>{clearTimeout(f),f=setTimeout(m,O)},v=async m=>{if(c.isValid||m){const O=t.resolver?Ee((await $()).errors):await k(n,!0);O!==r.isValid&&l.state.next({isValid:O})}},y=(m,O)=>{(c.isValidating||c.validatingFields)&&((m||Array.from(s.mount)).forEach(P=>{P&&(O?z(r.validatingFields,P,O):de(r.validatingFields,P))}),l.state.next({validatingFields:r.validatingFields,isValidating:!Ee(r.validatingFields)}))},h=(m,O=[],P,R,L=!0,N=!0)=>{if(R&&P){if(o.action=!0,N&&Array.isArray(I(n,m))){const D=P(I(n,m),R.argA,R.argB);L&&z(n,m,D)}if(N&&Array.isArray(I(r.errors,m))){const D=P(I(r.errors,m),R.argA,R.argB);L&&z(r.errors,m,D),Xu(r.errors,m)}if(c.touchedFields&&N&&Array.isArray(I(r.touchedFields,m))){const D=P(I(r.touchedFields,m),R.argA,R.argB);L&&z(r.touchedFields,m,D)}c.dirtyFields&&(r.dirtyFields=cr(i,a)),l.state.next({name:m,isDirty:M(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,P,R)=>{const L=I(n,m);if(L){const N=I(a,m,Z(P)?I(i,m):P);Z(N)||R&&R.defaultChecked||O?z(a,m,O?N:dn(L._f)):W(m,N),o.mount&&v()}},x=(m,O,P,R,L)=>{let N=!1,D=!1;const Y={name:m},fe=!!(I(n,m)&&I(n,m)._f&&I(n,m)._f.disabled);if(!P||R){c.isDirty&&(D=r.isDirty,r.isDirty=Y.isDirty=M(),N=D!==Y.isDirty);const Ce=fe||ht(I(i,m),O);D=!!(!fe&&I(r.dirtyFields,m)),Ce||fe?de(r.dirtyFields,m):z(r.dirtyFields,m,!0),Y.dirtyFields=r.dirtyFields,N=N||c.dirtyFields&&D!==!Ce}if(P){const Ce=I(r.touchedFields,m);Ce||(z(r.touchedFields,m,P),Y.touchedFields=r.touchedFields,N=N||c.touchedFields&&Ce!==P)}return N&&L&&l.state.next(Y),N?Y:{}},_=(m,O,P,R)=>{const L=I(r.errors,m),N=c.isValid&&Ue(O)&&r.isValid!==O;if(e.delayError&&P?(u=b(()=>E(m,P)),u(e.delayError)):(clearTimeout(f),u=null,P?z(r.errors,m,P):de(r.errors,m)),(P?!ht(L,P):L)||!Ee(R)||N){const D={...R,...N&&Ue(O)?{isValid:O}:{},errors:r.errors,name:m};r={...r,...D},l.state.next(D)}},$=async m=>{y(m,!0);const O=await t.resolver(a,t.context,qu(m||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return y(m),O},F=async m=>{const{errors:O}=await $(m);if(m)for(const P of m){const R=I(O,P);R?z(r.errors,P,R):de(r.errors,P)}else r.errors=O;return O},k=async(m,O,P={valid:!0})=>{for(const R in m){const L=m[R];if(L){const{_f:N,...D}=L;if(N){const Y=s.array.has(N.name);y([R],!0);const fe=await Cn(L,a,p,t.shouldUseNativeValidation&&!O,Y);if(y([R]),fe[N.name]&&(P.valid=!1,O))break;!O&&(I(fe,N.name)?Y?So(r.errors,fe,N.name):z(r.errors,N.name,fe[N.name]):de(r.errors,N.name))}D&&await k(D,O,P)}}return P.valid},H=()=>{for(const m of s.unMount){const O=I(n,m);O&&(O._f.refs?O._f.refs.every(P=>!fn(P)):!fn(O._f.ref))&&re(m)}s.unMount=new Set},M=(m,O)=>(m&&O&&z(a,m,O),!ht(ie(),i)),j=(m,O,P)=>vo(m,s,{...o.mount?a:Z(O)?i:He(m)?{[m]:O}:O},P,O),V=m=>ir(I(o.mount?a:i,m,e.shouldUnregister?I(i,m,[]):[])),W=(m,O,P={})=>{const R=I(n,m);let L=O;if(R){const N=R._f;N&&(!N.disabled&&z(a,m,Ao(O,N)),L=Pr(N.ref)&&we(O)?"":O,Eo(N.ref)?[...N.ref.options].forEach(D=>D.selected=L.includes(D.value)):N.refs?nr(N.ref)?N.refs.length>1?N.refs.forEach(D=>(!D.defaultChecked||!D.disabled)&&(D.checked=Array.isArray(L)?!!L.find(Y=>Y===D.value):L===D.value)):N.refs[0]&&(N.refs[0].checked=!!L):N.refs.forEach(D=>D.checked=D.value===L):Yn(N.ref)?N.ref.value="":(N.ref.value=L,N.ref.type||l.values.next({name:m,values:{...a}})))}(P.shouldDirty||P.shouldTouch)&&x(m,L,P.shouldTouch,P.shouldDirty,!0),P.shouldValidate&&K(m)},X=(m,O,P)=>{for(const R in O){const L=O[R],N=`${m}.${R}`,D=I(n,N);(s.array.has(m)||!Ar(L)||D&&!D._f)&&!_t(L)?X(N,L,P):W(N,L,P)}},G=(m,O,P={})=>{const R=I(n,m),L=s.array.has(m),N=ge(O);z(a,m,N),L?(l.array.next({name:m,values:{...a}}),(c.isDirty||c.dirtyFields)&&P.shouldDirty&&l.state.next({name:m,dirtyFields:cr(i,a),isDirty:M(m,N)})):R&&!R._f&&!we(N)?X(m,N,P):W(m,N,P),An(m,s)&&l.state.next({...r}),l.values.next({name:o.mount?m:void 0,values:{...a}})},he=async m=>{o.mount=!0;const O=m.target;let P=O.name,R=!0;const L=I(n,P),N=()=>O.type?dn(L._f):so(m),D=Y=>{R=Number.isNaN(Y)||Y===I(a,P,Y)};if(L){let Y,fe;const Ce=N(),Pt=m.type===wr.BLUR||m.type===wr.FOCUS_OUT,tu=!Ju(L._f)&&!t.resolver&&!I(r.errors,P)&&!L._f.deps||Zu(Pt,I(r.touchedFields,P),r.isSubmitted,g,d),Zr=An(P,s,Pt);z(a,P,Ce),Pt?(L._f.onBlur&&L._f.onBlur(m),u&&u(0)):L._f.onChange&&L._f.onChange(m);const Xr=x(P,Ce,Pt,!1),ru=!Ee(Xr)||Zr;if(!Pt&&l.values.next({name:P,type:m.type,values:{...a}}),tu)return c.isValid&&v(),ru&&l.state.next({name:P,...Zr?{}:Xr});if(!Pt&&Zr&&l.state.next({...r}),t.resolver){const{errors:pi}=await $([P]);if(D(Ce),R){const nu=Vi(r.errors,n,P),hi=Vi(pi,n,nu.name||P);Y=hi.error,P=hi.name,fe=Ee(pi)}}else y([P],!0),Y=(await Cn(L,a,p,t.shouldUseNativeValidation))[P],y([P]),D(Ce),R&&(Y?fe=!1:c.isValid&&(fe=await k(n,!0)));R&&(L._f.deps&&K(L._f.deps),_(P,fe,Y,Xr))}},ye=(m,O)=>{if(I(r.errors,O)&&m.focus)return m.focus(),1},K=async(m,O={})=>{let P,R;const L=Pe(m);if(t.resolver){const N=await F(Z(m)?m:L);P=Ee(N),R=m?!L.some(D=>I(N,D)):P}else m?(R=(await Promise.all(L.map(async N=>{const D=I(n,N);return await k(D&&D._f?{[N]:D}:D)}))).every(Boolean),!(!R&&!r.isValid)&&v()):R=P=await k(n);return l.state.next({...!He(m)||c.isValid&&P!==r.isValid?{}:{name:m},...t.resolver||!m?{isValid:P}:{},errors:r.errors}),O.shouldFocus&&!R&&Tt(n,ye,m?L:s.mount),R},ie=m=>{const O={...o.mount?a:i};return Z(m)?O:He(m)?I(O,m):m.map(P=>I(O,P))},ae=(m,O)=>({invalid:!!I((O||r).errors,m),isDirty:!!I((O||r).dirtyFields,m),error:I((O||r).errors,m),isValidating:!!I(r.validatingFields,m),isTouched:!!I((O||r).touchedFields,m)}),se=m=>{m&&Pe(m).forEach(O=>de(r.errors,O)),l.state.next({errors:m?r.errors:{}})},Q=(m,O,P)=>{const R=(I(n,m,{_f:{}})._f||{}).ref,L=I(r.errors,m)||{},{ref:N,message:D,type:Y,...fe}=L;z(r.errors,m,{...fe,...O,ref:R}),l.state.next({name:m,errors:r.errors,isValid:!1}),P&&P.shouldFocus&&R&&R.focus&&R.focus()},xe=(m,O)=>ot(m)?l.values.subscribe({next:P=>m(j(void 0,O),P)}):j(m,O,!0),re=(m,O={})=>{for(const P of m?Pe(m):s.mount)s.mount.delete(P),s.array.delete(P),O.keepValue||(de(n,P),de(a,P)),!O.keepError&&de(r.errors,P),!O.keepDirty&&de(r.dirtyFields,P),!O.keepTouched&&de(r.touchedFields,P),!O.keepIsValidating&&de(r.validatingFields,P),!t.shouldUnregister&&!O.keepDefaultValue&&de(i,P);l.values.next({values:{...a}}),l.state.next({...r,...O.keepDirty?{isDirty:M()}:{}}),!O.keepIsValid&&v()},q=({disabled:m,name:O,field:P,fields:R,value:L})=>{if(Ue(m)&&o.mount||!!m){const N=m?void 0:Z(L)?dn(P?P._f:I(R,O)._f):L;z(a,O,N),x(O,N,!1,!1,!0)}},ue=(m,O={})=>{let P=I(n,m);const R=Ue(O.disabled);return z(n,m,{...P||{},_f:{...P&&P._f?P._f:{ref:{name:m}},name:m,mount:!0,...O}}),s.mount.add(m),P?q({field:P,disabled:O.disabled,name:m,value:O.value}):w(m,!0,O.value),{...R?{disabled:O.disabled}:{},...t.progressive?{required:!!O.required,min:jt(O.min),max:jt(O.max),minLength:jt(O.minLength),maxLength:jt(O.maxLength),pattern:jt(O.pattern)}:{},name:m,onChange:he,onBlur:he,ref:L=>{if(L){ue(m,O),P=I(n,m);const N=Z(L.value)&&L.querySelectorAll&&L.querySelectorAll("input,select,textarea")[0]||L,D=Qu(N),Y=P._f.refs||[];if(D?Y.find(fe=>fe===N):N===P._f.ref)return;z(n,m,{_f:{...P._f,...D?{refs:[...Y.filter(fn),N,...Array.isArray(I(i,m))?[{}]:[]],ref:{type:N.type,name:m}}:{ref:N}}}),w(m,!1,void 0,N)}else P=I(n,m,{}),P._f&&(P._f.mount=!1),(t.shouldUnregister||O.shouldUnregister)&&!(uo(s.array,m)&&o.action)&&s.unMount.add(m)}}},ce=()=>t.shouldFocusError&&Tt(n,ye,s.mount),ve=m=>{Ue(m)&&(l.state.next({disabled:m}),Tt(n,(O,P)=>{const R=I(n,P);R&&(O.disabled=R._f.disabled||m,Array.isArray(R._f.refs)&&R._f.refs.forEach(L=>{L.disabled=R._f.disabled||m}))},0,!1))},B=(m,O)=>async P=>{let R;P&&(P.preventDefault&&P.preventDefault(),P.persist&&P.persist());let L=ge(a);if(l.state.next({isSubmitting:!0}),t.resolver){const{errors:N,values:D}=await $();r.errors=N,L=D}else await k(n);if(de(r.errors,"root"),Ee(r.errors)){l.state.next({errors:{}});try{await m(L,P)}catch(N){R=N}}else O&&await O({...r.errors},P),ce(),setTimeout(ce);if(l.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ee(r.errors)&&!R,submitCount:r.submitCount+1,errors:r.errors}),R)throw R},me=(m,O={})=>{I(n,m)&&(Z(O.defaultValue)?G(m,ge(I(i,m))):(G(m,O.defaultValue),z(i,m,ge(O.defaultValue))),O.keepTouched||de(r.touchedFields,m),O.keepDirty||(de(r.dirtyFields,m),r.isDirty=O.defaultValue?M(m,ge(I(i,m))):M()),O.keepError||(de(r.errors,m),c.isValid&&v()),l.state.next({...r}))},le=(m,O={})=>{const P=m?ge(m):i,R=ge(P),L=Ee(m),N=L?i:R;if(O.keepDefaultValues||(i=P),!O.keepValues){if(O.keepDirtyValues)for(const D of s.mount)I(r.dirtyFields,D)?z(N,D,I(a,D)):G(D,I(N,D));else{if(Gn&&Z(m))for(const D of s.mount){const Y=I(n,D);if(Y&&Y._f){const fe=Array.isArray(Y._f.refs)?Y._f.refs[0]:Y._f.ref;if(Pr(fe)){const Ce=fe.closest("form");if(Ce){Ce.reset();break}}}}n={}}a=e.shouldUnregister?O.keepDefaultValues?ge(i):{}:ge(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:L?!1:O.keepDirty?r.isDirty:!!(O.keepDefaultValues&&!ht(m,i)),isSubmitted:O.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:L?{}:O.keepDirtyValues?O.keepDefaultValues&&a?cr(i,a):r.dirtyFields:O.keepDefaultValues&&m?cr(i,m):O.keepDirty?r.dirtyFields:{},touchedFields:O.keepTouched?r.touchedFields:{},errors:O.keepErrors?r.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Ae=(m,O)=>le(ot(m)?m(a):m,O);return{control:{register:ue,unregister:re,getFieldState:ae,handleSubmit:B,setError:Q,_executeSchema:$,_getWatch:j,_getDirty:M,_updateValid:v,_removeUnmounted:H,_updateFieldArray:h,_updateDisabledField:q,_getFieldArray:V,_reset:le,_resetDefaultValues:()=>ot(t.defaultValues)&&t.defaultValues().then(m=>{Ae(m,t.resetOptions),l.state.next({isLoading:!1})}),_updateFormState:m=>{r={...r,...m}},_disableForm:ve,_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:K,register:ue,handleSubmit:B,watch:xe,setValue:G,getValues:ie,reset:Ae,resetField:me,clearErrors:se,unregister:re,setError:Q,setFocus:(m,O={})=>{const P=I(n,m),R=P&&P._f;if(R){const L=R.refs?R.refs[0]:R.ref;L.focus&&(L.focus(),O.shouldSelect&&L.select())}},getFieldState:ae}}function Co(e={}){const t=T.default.useRef(),r=T.default.useRef(),[n,i]=T.default.useState({isDirty:!1,isValidating:!1,isLoading:ot(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ot(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...tl(e),formState:n});const a=t.current.control;return a._options=e,Dr({subject:a._subjects.state,next:o=>{po(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&&!ht(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=go(n,a),t.current}var rl=Object.freeze(Object.defineProperty({__proto__:null,Controller:Bu,Form:Wu,FormProvider:fo,appendErrors:bo,get:I,set:z,useController:yo,useFieldArray:zu,useForm:Co,useFormContext:ze,useFormState:mo,useWatch:Er},Symbol.toStringTag,{value:"Module"})),_o=(e=>(e.FULL_PAGE="FULL_PAGE",e.MODAL="MODAL",e))(_o||{}),To=(e=>(e.SIMPLE="SIMPLE",e.COMPLEX="COMPLEX",e.QUANTITY="QUANTITY",e))(To||{}),Qn=(e=>(e.SELECT="selCtx",e.FILTER="fltCtx",e))(Qn||{}),qn=(e=>(e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.PRODUCT="3e/product",e))(qn||{}),Ie=(e=>(e.OK="OK",e.TOO_MUCH="TOO_MUCH",e.NOT_ENOUGHT="NOT_ENOUGHT",e.IGNORE="IGNORE",e))(Ie||{});const nl=(e,t,r)=>{if(e==="selected"||e==="filter")return[];if(r[t]===e)return[r];let n=Io(e,t,r.items);return n!=null&&n.length||(n=No(e,t,r.items),n.length),n},No=(e,t,r)=>{const n=il(r),i=Io(e,t,n);return i!=null&&i.length?i:n!=null&&n.length?No(e,t,n):[]},il=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)},Io=(e,t,r)=>{let n=[];return Array.isArray(r)&&(n=r.filter(i=>{if(i&&i[t]===e)return!0})),n},al=(e,t,r,n)=>{const i=nl(t,r,n),a=ol(e,i).filter(o=>o!==null&&typeof o!="undefined");return a.length?a[0]:null},ol=(e,t)=>{let r=[];return Array.isArray(t)&&t.length&&(r=t.map(n=>sl(e,n))),r},sl=(e,t)=>{if(t.id===e)return t;let r=Lo(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=ul(t),n=Lo(e,r);return n!=null&&n.length?n:r!=null&&r.length?$o(e,r):[]},ul=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)},Lo=(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[a,o]of Object.entries(i))if(o){const s=al(a,n,Qn.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},Ro=e=>{const{price:t,state:{selected:r}={}}=e;return(!t||parseFloat(t||"1")===0)&&r?`${Jn(r,e)||"0"}`:t};var ll=typeof global=="object"&&global&&global.Object===Object&&global,Fo=ll,cl=typeof self=="object"&&self&&self.Object===Object&&self,fl=Fo||cl||Function("return this")(),Qe=fl,dl=Qe.Symbol,ft=dl,Mo=Object.prototype,gl=Mo.hasOwnProperty,pl=Mo.toString,Vt=ft?ft.toStringTag:void 0;function hl(e){var t=gl.call(e,Vt),r=e[Vt];try{e[Vt]=void 0;var n=!0}catch{}var i=pl.call(e);return n&&(t?e[Vt]=r:delete e[Vt]),i}var ml=Object.prototype,vl=ml.toString;function yl(e){return vl.call(e)}var bl="[object Null]",Sl="[object Undefined]",Ui=ft?ft.toStringTag:void 0;function Lt(e){return e==null?e===void 0?Sl:bl:Ui&&Ui in Object(e)?hl(e):yl(e)}function dt(e){return e!=null&&typeof e=="object"}var Ol="[object Symbol]";function wl(e){return typeof e=="symbol"||dt(e)&&Lt(e)==Ol}var El=Array.isArray,Nt=El,Pl=/\s/;function xl(e){for(var t=e.length;t--&&Pl.test(e.charAt(t)););return t}var Al=/^\s+/;function Cl(e){return e&&e.slice(0,xl(e)+1).replace(Al,"")}function yt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Bi=0/0,_l=/^[-+]0x[0-9a-f]+$/i,Tl=/^0b[01]+$/i,Nl=/^0o[0-7]+$/i,Il=parseInt;function ko(e){if(typeof e=="number")return e;if(wl(e))return Bi;if(yt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=yt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Cl(e);var r=Tl.test(e);return r||Nl.test(e)?Il(e.slice(2),r?2:8):_l.test(e)?Bi:+e}var Hi=1/0,$l=17976931348623157e292;function Wi(e){if(!e)return e===0?e:0;if(e=ko(e),e===Hi||e===-Hi){var t=e<0?-1:1;return t*$l}return e===e?e:0}var Ll="[object AsyncFunction]",Rl="[object Function]",Fl="[object GeneratorFunction]",Ml="[object Proxy]";function Do(e){if(!yt(e))return!1;var t=Lt(e);return t==Rl||t==Fl||t==Ll||t==Ml}var kl=Qe["__core-js_shared__"],gn=kl,Gi=function(){var e=/[^.]+$/.exec(gn&&gn.keys&&gn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Dl(e){return!!Gi&&Gi in e}var jl=Function.prototype,Vl=jl.toString;function St(e){if(e!=null){try{return Vl.call(e)}catch{}try{return e+""}catch{}}return""}var Ul=/[\\^$.*+?()[\]{}|]/g,Bl=/^\[object .+?Constructor\]$/,Hl=Function.prototype,Wl=Object.prototype,Gl=Hl.toString,Kl=Wl.hasOwnProperty,Yl=RegExp("^"+Gl.call(Kl).replace(Ul,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function zl(e){if(!yt(e)||Dl(e))return!1;var t=Do(e)?Yl:Bl;return t.test(St(e))}function Ql(e,t){return e==null?void 0:e[t]}function Ot(e,t){var r=Ql(e,t);return zl(r)?r:void 0}var ql=Ot(Qe,"WeakMap"),_n=ql,Ki=Object.create,Jl=function(){function e(){}return function(t){if(!yt(t))return{};if(Ki)return Ki(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Zl=Jl;function Xl(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var ec=function(){try{var e=Ot(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Yi=ec;function tc(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var rc=9007199254740991,nc=/^(?:0|[1-9]\d*)$/;function ic(e,t){var r=typeof e;return t=t==null?rc:t,!!t&&(r=="number"||r!="symbol"&&nc.test(e))&&e>-1&&e%1==0&&e<t}function jo(e,t,r){t=="__proto__"&&Yi?Yi(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Zn(e,t){return e===t||e!==e&&t!==t}var ac=Object.prototype,oc=ac.hasOwnProperty;function Vo(e,t,r){var n=e[t];(!(oc.call(e,t)&&Zn(n,r))||r===void 0&&!(t in e))&&jo(e,t,r)}function jr(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?jo(r,s,u):Vo(r,s,u)}return r}var sc=9007199254740991;function Uo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=sc}function Xn(e){return e!=null&&Uo(e.length)&&!Do(e)}var uc=Object.prototype;function Vr(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||uc;return e===r}function lc(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var cc="[object Arguments]";function zi(e){return dt(e)&&Lt(e)==cc}var Bo=Object.prototype,fc=Bo.hasOwnProperty,dc=Bo.propertyIsEnumerable,gc=zi(function(){return arguments}())?zi:function(e){return dt(e)&&fc.call(e,"callee")&&!dc.call(e,"callee")},Ho=gc;function pc(){return!1}var Wo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qi=Wo&&typeof module=="object"&&module&&!module.nodeType&&module,hc=Qi&&Qi.exports===Wo,qi=hc?Qe.Buffer:void 0,mc=qi?qi.isBuffer:void 0,vc=mc||pc,Zt=vc,yc="[object Arguments]",bc="[object Array]",Sc="[object Boolean]",Oc="[object Date]",wc="[object Error]",Ec="[object Function]",Pc="[object Map]",xc="[object Number]",Ac="[object Object]",Cc="[object RegExp]",_c="[object Set]",Tc="[object String]",Nc="[object WeakMap]",Ic="[object ArrayBuffer]",$c="[object DataView]",Lc="[object Float32Array]",Rc="[object Float64Array]",Fc="[object Int8Array]",Mc="[object Int16Array]",kc="[object Int32Array]",Dc="[object Uint8Array]",jc="[object Uint8ClampedArray]",Vc="[object Uint16Array]",Uc="[object Uint32Array]",te={};te[Lc]=te[Rc]=te[Fc]=te[Mc]=te[kc]=te[Dc]=te[jc]=te[Vc]=te[Uc]=!0;te[yc]=te[bc]=te[Ic]=te[Sc]=te[$c]=te[Oc]=te[wc]=te[Ec]=te[Pc]=te[xc]=te[Ac]=te[Cc]=te[_c]=te[Tc]=te[Nc]=!1;function Bc(e){return dt(e)&&Uo(e.length)&&!!te[Lt(e)]}function ei(e){return function(t){return e(t)}}var Go=typeof exports=="object"&&exports&&!exports.nodeType&&exports,qt=Go&&typeof module=="object"&&module&&!module.nodeType&&module,Hc=qt&&qt.exports===Go,pn=Hc&&Fo.process,Wc=function(){try{var e=qt&&qt.require&&qt.require("util").types;return e||pn&&pn.binding&&pn.binding("util")}catch{}}(),It=Wc,Ji=It&&It.isTypedArray,Gc=Ji?ei(Ji):Bc,ti=Gc,Kc=Object.prototype,Yc=Kc.hasOwnProperty;function Ko(e,t){var r=Nt(e),n=!r&&Ho(e),i=!r&&!n&&Zt(e),a=!r&&!n&&!i&&ti(e),o=r||n||i||a,s=o?lc(e.length,String):[],u=s.length;for(var f in e)(t||Yc.call(e,f))&&!(o&&(f=="length"||i&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||ic(f,u)))&&s.push(f);return s}function Yo(e,t){return function(r){return e(t(r))}}var zc=Yo(Object.keys,Object),Qc=zc,qc=Object.prototype,Jc=qc.hasOwnProperty;function zo(e){if(!Vr(e))return Qc(e);var t=[];for(var r in Object(e))Jc.call(e,r)&&r!="constructor"&&t.push(r);return t}function ri(e){return Xn(e)?Ko(e):zo(e)}function Zc(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var Xc=Object.prototype,ef=Xc.hasOwnProperty;function tf(e){if(!yt(e))return Zc(e);var t=Vr(e),r=[];for(var n in e)n=="constructor"&&(t||!ef.call(e,n))||r.push(n);return r}function ni(e){return Xn(e)?Ko(e,!0):tf(e)}var rf=Ot(Object,"create"),Xt=rf;function nf(){this.__data__=Xt?Xt(null):{},this.size=0}function af(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var of="__lodash_hash_undefined__",sf=Object.prototype,uf=sf.hasOwnProperty;function lf(e){var t=this.__data__;if(Xt){var r=t[e];return r===of?void 0:r}return uf.call(t,e)?t[e]:void 0}var cf=Object.prototype,ff=cf.hasOwnProperty;function df(e){var t=this.__data__;return Xt?t[e]!==void 0:ff.call(t,e)}var gf="__lodash_hash_undefined__";function pf(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Xt&&t===void 0?gf:t,this}function bt(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])}}bt.prototype.clear=nf;bt.prototype.delete=af;bt.prototype.get=lf;bt.prototype.has=df;bt.prototype.set=pf;function hf(){this.__data__=[],this.size=0}function Ur(e,t){for(var r=e.length;r--;)if(Zn(e[r][0],t))return r;return-1}var mf=Array.prototype,vf=mf.splice;function yf(e){var t=this.__data__,r=Ur(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():vf.call(t,r,1),--this.size,!0}function bf(e){var t=this.__data__,r=Ur(t,e);return r<0?void 0:t[r][1]}function Sf(e){return Ur(this.__data__,e)>-1}function Of(e,t){var r=this.__data__,n=Ur(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function et(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])}}et.prototype.clear=hf;et.prototype.delete=yf;et.prototype.get=bf;et.prototype.has=Sf;et.prototype.set=Of;var wf=Ot(Qe,"Map"),er=wf;function Ef(){this.size=0,this.__data__={hash:new bt,map:new(er||et),string:new bt}}function Pf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Br(e,t){var r=e.__data__;return Pf(t)?r[typeof t=="string"?"string":"hash"]:r.map}function xf(e){var t=Br(this,e).delete(e);return this.size-=t?1:0,t}function Af(e){return Br(this,e).get(e)}function Cf(e){return Br(this,e).has(e)}function _f(e,t){var r=Br(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function wt(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])}}wt.prototype.clear=Ef;wt.prototype.delete=xf;wt.prototype.get=Af;wt.prototype.has=Cf;wt.prototype.set=_f;function Qo(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Tf=Yo(Object.getPrototypeOf,Object),qo=Tf;function Nf(){this.__data__=new et,this.size=0}function If(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function $f(e){return this.__data__.get(e)}function Lf(e){return this.__data__.has(e)}var Rf=200;function Ff(e,t){var r=this.__data__;if(r instanceof et){var n=r.__data__;if(!er||n.length<Rf-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new wt(n)}return r.set(e,t),this.size=r.size,this}function Je(e){var t=this.__data__=new et(e);this.size=t.size}Je.prototype.clear=Nf;Je.prototype.delete=If;Je.prototype.get=$f;Je.prototype.has=Lf;Je.prototype.set=Ff;function Mf(e,t){return e&&jr(t,ri(t),e)}function kf(e,t){return e&&jr(t,ni(t),e)}var Jo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Zi=Jo&&typeof module=="object"&&module&&!module.nodeType&&module,Df=Zi&&Zi.exports===Jo,Xi=Df?Qe.Buffer:void 0,ea=Xi?Xi.allocUnsafe:void 0;function jf(e,t){if(t)return e.slice();var r=e.length,n=ea?ea(r):new e.constructor(r);return e.copy(n),n}function Vf(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 Uf=Object.prototype,Bf=Uf.propertyIsEnumerable,ta=Object.getOwnPropertySymbols,Hf=ta?function(e){return e==null?[]:(e=Object(e),Vf(ta(e),function(t){return Bf.call(e,t)}))}:Zo,ii=Hf;function Wf(e,t){return jr(e,ii(e),t)}var Gf=Object.getOwnPropertySymbols,Kf=Gf?function(e){for(var t=[];e;)Qo(t,ii(e)),e=qo(e);return t}:Zo,Xo=Kf;function Yf(e,t){return jr(e,Xo(e),t)}function es(e,t,r){var n=t(e);return Nt(e)?n:Qo(n,r(e))}function Tn(e){return es(e,ri,ii)}function zf(e){return es(e,ni,Xo)}var Qf=Ot(Qe,"DataView"),Nn=Qf,qf=Ot(Qe,"Promise"),In=qf,Jf=Ot(Qe,"Set"),$n=Jf,ra="[object Map]",Zf="[object Object]",na="[object Promise]",ia="[object Set]",aa="[object WeakMap]",oa="[object DataView]",Xf=St(Nn),ed=St(er),td=St(In),rd=St($n),nd=St(_n),gt=Lt;(Nn&>(new Nn(new ArrayBuffer(1)))!=oa||er&>(new er)!=ra||In&>(In.resolve())!=na||$n&>(new $n)!=ia||_n&>(new _n)!=aa)&&(gt=function(e){var t=Lt(e),r=t==Zf?e.constructor:void 0,n=r?St(r):"";if(n)switch(n){case Xf:return oa;case ed:return ra;case td:return na;case rd:return ia;case nd:return aa}return t});var $t=gt,id=Object.prototype,ad=id.hasOwnProperty;function od(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&ad.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var sd=Qe.Uint8Array,_r=sd;function ai(e){var t=new e.constructor(e.byteLength);return new _r(t).set(new _r(e)),t}function ud(e,t){var r=t?ai(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var ld=/\w*$/;function cd(e){var t=new e.constructor(e.source,ld.exec(e));return t.lastIndex=e.lastIndex,t}var sa=ft?ft.prototype:void 0,ua=sa?sa.valueOf:void 0;function fd(e){return ua?Object(ua.call(e)):{}}function dd(e,t){var r=t?ai(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var gd="[object Boolean]",pd="[object Date]",hd="[object Map]",md="[object Number]",vd="[object RegExp]",yd="[object Set]",bd="[object String]",Sd="[object Symbol]",Od="[object ArrayBuffer]",wd="[object DataView]",Ed="[object Float32Array]",Pd="[object Float64Array]",xd="[object Int8Array]",Ad="[object Int16Array]",Cd="[object Int32Array]",_d="[object Uint8Array]",Td="[object Uint8ClampedArray]",Nd="[object Uint16Array]",Id="[object Uint32Array]";function $d(e,t,r){var n=e.constructor;switch(t){case Od:return ai(e);case gd:case pd:return new n(+e);case wd:return ud(e,r);case Ed:case Pd:case xd:case Ad:case Cd:case _d:case Td:case Nd:case Id:return dd(e,r);case hd:return new n;case md:case bd:return new n(e);case vd:return cd(e);case yd:return new n;case Sd:return fd(e)}}function Ld(e){return typeof e.constructor=="function"&&!Vr(e)?Zl(qo(e)):{}}var Rd="[object Map]";function Fd(e){return dt(e)&&$t(e)==Rd}var la=It&&It.isMap,Md=la?ei(la):Fd,kd=Md,Dd="[object Set]";function jd(e){return dt(e)&&$t(e)==Dd}var ca=It&&It.isSet,Vd=ca?ei(ca):jd,Ud=Vd,Bd=1,Hd=2,Wd=4,ts="[object Arguments]",Gd="[object Array]",Kd="[object Boolean]",Yd="[object Date]",zd="[object Error]",rs="[object Function]",Qd="[object GeneratorFunction]",qd="[object Map]",Jd="[object Number]",ns="[object Object]",Zd="[object RegExp]",Xd="[object Set]",eg="[object String]",tg="[object Symbol]",rg="[object WeakMap]",ng="[object ArrayBuffer]",ig="[object DataView]",ag="[object Float32Array]",og="[object Float64Array]",sg="[object Int8Array]",ug="[object Int16Array]",lg="[object Int32Array]",cg="[object Uint8Array]",fg="[object Uint8ClampedArray]",dg="[object Uint16Array]",gg="[object Uint32Array]",J={};J[ts]=J[Gd]=J[ng]=J[ig]=J[Kd]=J[Yd]=J[ag]=J[og]=J[sg]=J[ug]=J[lg]=J[qd]=J[Jd]=J[ns]=J[Zd]=J[Xd]=J[eg]=J[tg]=J[cg]=J[fg]=J[dg]=J[gg]=!0;J[zd]=J[rs]=J[rg]=!1;function mr(e,t,r,n,i,a){var o,s=t&Bd,u=t&Hd,f=t&Wd;if(r&&(o=i?r(e,n,i,a):r(e)),o!==void 0)return o;if(!yt(e))return e;var c=Nt(e);if(c){if(o=od(e),!s)return Xl(e,o)}else{var l=$t(e),d=l==rs||l==Qd;if(Zt(e))return jf(e,s);if(l==ns||l==ts||d&&!i){if(o=u||d?{}:Ld(e),!s)return u?Yf(e,kf(o,e)):Wf(e,Mf(o,e))}else{if(!J[l])return i?e:{};o=$d(e,l,s)}}a||(a=new Je);var g=a.get(e);if(g)return g;a.set(e,o),Ud(e)?e.forEach(function(v){o.add(mr(v,t,r,v,e,a))}):kd(e)&&e.forEach(function(v,y){o.set(y,mr(v,t,r,y,e,a))});var p=f?u?zf:Tn:u?ni:ri,b=c?void 0:p(e);return tc(b||e,function(v,y){b&&(y=v,v=e[y]),Vo(o,y,mr(v,t,r,y,e,a))}),o}var pg=1,hg=4;function is(e){return mr(e,pg|hg)}var mg="__lodash_hash_undefined__";function vg(e){return this.__data__.set(e,mg),this}function yg(e){return this.__data__.has(e)}function Tr(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new wt;++t<r;)this.add(e[t])}Tr.prototype.add=Tr.prototype.push=vg;Tr.prototype.has=yg;function bg(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 Sg(e,t){return e.has(t)}var Og=1,wg=2;function as(e,t,r,n,i,a){var o=r&Og,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&wg?new Tr:void 0;for(a.set(e,t),a.set(t,e);++l<s;){var p=e[l],b=t[l];if(n)var v=o?n(b,p,l,t,e,a):n(p,b,l,e,t,a);if(v!==void 0){if(v)continue;d=!1;break}if(g){if(!bg(t,function(y,h){if(!Sg(g,h)&&(p===y||i(p,y,r,n,a)))return g.push(h)})){d=!1;break}}else if(!(p===b||i(p,b,r,n,a))){d=!1;break}}return a.delete(e),a.delete(t),d}function Eg(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function Pg(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var xg=1,Ag=2,Cg="[object Boolean]",_g="[object Date]",Tg="[object Error]",Ng="[object Map]",Ig="[object Number]",$g="[object RegExp]",Lg="[object Set]",Rg="[object String]",Fg="[object Symbol]",Mg="[object ArrayBuffer]",kg="[object DataView]",fa=ft?ft.prototype:void 0,hn=fa?fa.valueOf:void 0;function Dg(e,t,r,n,i,a,o){switch(r){case kg:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Mg:return!(e.byteLength!=t.byteLength||!a(new _r(e),new _r(t)));case Cg:case _g:case Ig:return Zn(+e,+t);case Tg:return e.name==t.name&&e.message==t.message;case $g:case Rg:return e==t+"";case Ng:var s=Eg;case Lg:var u=n&xg;if(s||(s=Pg),e.size!=t.size&&!u)return!1;var f=o.get(e);if(f)return f==t;n|=Ag,o.set(e,t);var c=as(s(e),s(t),n,i,a,o);return o.delete(e),c;case Fg:if(hn)return hn.call(e)==hn.call(t)}return!1}var jg=1,Vg=Object.prototype,Ug=Vg.hasOwnProperty;function Bg(e,t,r,n,i,a){var o=r&jg,s=Tn(e),u=s.length,f=Tn(t),c=f.length;if(u!=c&&!o)return!1;for(var l=u;l--;){var d=s[l];if(!(o?d in t:Ug.call(t,d)))return!1}var g=a.get(e),p=a.get(t);if(g&&p)return g==t&&p==e;var b=!0;a.set(e,t),a.set(t,e);for(var v=o;++l<u;){d=s[l];var y=e[d],h=t[d];if(n)var E=o?n(h,y,d,t,e,a):n(y,h,d,e,t,a);if(!(E===void 0?y===h||i(y,h,r,n,a):E)){b=!1;break}v||(v=d=="constructor")}if(b&&!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)&&(b=!1)}return a.delete(e),a.delete(t),b}var Hg=1,da="[object Arguments]",ga="[object Array]",fr="[object Object]",Wg=Object.prototype,pa=Wg.hasOwnProperty;function Gg(e,t,r,n,i,a){var o=Nt(e),s=Nt(t),u=o?ga:$t(e),f=s?ga:$t(t);u=u==da?fr:u,f=f==da?fr:f;var c=u==fr,l=f==fr,d=u==f;if(d&&Zt(e)){if(!Zt(t))return!1;o=!0,c=!1}if(d&&!c)return a||(a=new Je),o||ti(e)?as(e,t,r,n,i,a):Dg(e,t,u,r,n,i,a);if(!(r&Hg)){var g=c&&pa.call(e,"__wrapped__"),p=l&&pa.call(t,"__wrapped__");if(g||p){var b=g?e.value():e,v=p?t.value():t;return a||(a=new Je),i(b,v,r,n,a)}}return d?(a||(a=new Je),Bg(e,t,r,n,i,a)):!1}function os(e,t,r,n,i){return e===t?!0:e==null||t==null||!dt(e)&&!dt(t)?e!==e&&t!==t:Gg(e,t,r,n,os,i)}var Kg=Math.max,Yg=Math.min;function zg(e,t,r){return e>=Yg(t,r)&&e<Kg(t,r)}function Nr(e,t,r){return t=Wi(t),r===void 0?(r=t,t=0):r=Wi(r),e=ko(e),zg(e,t,r)}var Qg="[object Map]",qg="[object Set]",Jg=Object.prototype,Zg=Jg.hasOwnProperty;function De(e){if(e==null)return!0;if(Xn(e)&&(Nt(e)||typeof e=="string"||typeof e.splice=="function"||Zt(e)||ti(e)||Ho(e)))return!e.length;var t=$t(e);if(t==Qg||t==qg)return!e.size;if(Vr(e))return!zo(e).length;for(var r in e)if(Zg.call(e,r))return!1;return!0}function Xg(e,t){return os(e,t)}const ep=["id","selCtx","fltCtx"],ss=".",us="#dot",ls="#FIX_NUMBER",tp=e=>fs(is(e),ip),rp=e=>{const t=e.replaceAll(ss,us);return/^\d+$/.test(t)?`${ls}${t}`:t},np=e=>e.replaceAll(us,ss).replaceAll(ls,""),ip=(e,t)=>cs(e,t,rp),ap=(e,t)=>cs(e,t,np),cs=(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 ep.includes(e)&&(typeof t=="string"||t instanceof String)&&(n=r(t)),(e==="selected"||e==="filter")&&(n=i(t)),n},fs=(e,t)=>(Object.keys(e).forEach(r=>{const n=e[r];e[r]=t(r,n),typeof n=="object"&&n!==null&&fs(n,t)}),e),ds=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},op=e=>ap("selected",e);var ha;(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"})(ha||(ha={}));var ma;(function(e){e.CAROUSEL="carousel",e.NORMAL="normal",e.IMAGE="image"})(ma||(ma={}));var We;(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"})(We||(We={}));var va;(function(e){e.GROUP="group",e.PRODUCT="product"})(va||(va={}));var ya;(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"})(ya||(ya={}));var ba;(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"})(ba||(ba={}));var Sa;(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"})(Sa||(Sa={}));var Oa;(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"})(Oa||(Oa={}));var wa;(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"})(wa||(wa={}));var Ea;(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"})(Ea||(Ea={}));var Pa;(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"})(Pa||(Pa={}));var xa;(function(e){e.NEW="NEW",e.TECHNICAL="TECHNICAL",e.CONFIRMED="CONFIRMED",e.PROCESSING="PROCESSING",e.PROCESSED="PROCESSED",e.VOID="VOID",e.WASTE="WASTE"})(xa||(xa={}));var Aa;(function(e){e.GROUP="group",e.PRODUCT="product"})(Aa||(Aa={}));var Ca;(function(e){e.ORDER_EVENT_ERROR="OrderEventError",e.ORDER_APPLIED_EVENTS="OrderAppliedEvents",e.ORDER_EVENT_FISCAL="OrderEventFiscal",e.ORDER_UPSELL="OrderUpsell"})(Ca||(Ca={}));const sp=e=>e==="true"||e===!0,up=e=>`options--${e}`,gs=e=>{const{details:{media:t=[]}={}}=e,r=t.find(n=>n.name==="MAIN_IMG")||t[0]||{};return(r==null?void 0:r.url)||""},_a=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 ps(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===We.OPTIONS)return i;if(i.items&&i.items.length>0){const a=ps(e,i);if(a)return a}}return null}function lp(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 b=d;f(d=p,b)}}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 cp=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Ta=cp?S.useEffect:S.useLayoutEffect;function fp(e){const t=typeof e=="function"?lp(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)),Ta(()=>{g&&(l.current=d),s.current=o,u.current=n,f.current=i,c.current=!1});const p=S.useRef(o);Ta(()=>{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()}},y=t.subscribe(v);return t.getState()!==p.current&&v(),y},[]);const b=g?d:l.current;return S.useDebugValue(b),b};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 dp=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}}}))}}),gp=(e,t)=>Ir(e,t,"isSelCntAllowedToIncrement")&&Ir(e,t,"isQtyCntAllowedToIncrement")&&Ln(e,t,"isQtyCntAllowedToIncrement")&&Ln(e,t,"isQtyCntAllowedToIncrement"),pp=(e,t,r)=>{var a;const{selCtx:n}=e;return((a=r==null?void 0:r[n])==null?void 0:a.parentKind)===qn.PRODUCT?Na(e,t)&&Ir(e,r,"isQtyCntAllowedToIncrement"):Na(e,t)&&Ir(e,r,"isQtyCntAllowedToIncrement")&&Ln(e,r,"isQtyCntAllowedToIncrement")},Na=(e,t)=>{const{qtyMax:r}=e;return Number(t)<Number(r||Number.MAX_SAFE_INTEGER)},Ir=(e,t,r)=>{var a;const{selCtx:n}=e,i=(a=t==null?void 0:t[n])==null?void 0:a[r];return hs(i)?!0:i},Ln=(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 hs(o)?!0:o},hs=e=>typeof e=="undefined",ms=(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]},hp=(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)},mp=(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:Nr(a,Number(g||0),Number(p||Number.MAX_SAFE_INTEGER)+1)&&Nr(o,Number(l||0),Number(d||Number.MAX_SAFE_INTEGER)+1),isPassedFiltering:s}}}))},isInputEnabled:r=>{const n=t().validationMap;return gp(r,n)},isInputCounterIncrementEnabled:(r,n)=>{const i=t().validationMap,a=hp(r,n);return pp(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}`}))}}),vp=(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:{}}))}}),oe=fp((e,t)=>({...dp(e),...mp(e,t),...vp(e,t)}));function vs(e,t){if(!t)return null;for(const r of t){if(r.id===e)return r;if(r.items){const n=vs(e,r.items);if(n)return n}}return null}function yp(e,t){return vs(e,t)!==null}function bp(e,t){if(t==null||De(t))return{};try{const r=is(t);for(const[n,i]of Object.entries(r))i&&typeof i=="object"&&!Array.isArray(i)&&Object.keys(i).forEach(a=>{yp(a,e.items)||(console.warn(`deleting selected selCtx ${n} id ${a}, not found in product`),delete r[n][a])});return ds(r)}catch(r){return console.error(r),t}}function Sp(e){var y;const[t,r]=S.useState(Number(e.quantity)||1),n=tp(e),{state:{filter:i={}}={}}=n,a=bp(n,(y=n.state)==null?void 0:y.selected),o=oe(h=>h.setInitialFilter),s=oe(h=>h.setInitialSelected),u=oe(h=>h.setInitialValidate),f=oe(h=>h.resetExpanded),c=oe(h=>h.filter),l=oe(h=>h.setCurrency),d=oe(h=>h.setIsOnSubmittedOnTrue),g=oe(h=>h.refreshFormDt),p=oe(h=>h.getInvalidSelCtxArray),b=()=>{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:p,productQuantity:t,increaseProductQuantity:b,decreaseProductQuantity:v,refreshFormDt:g}}const Hr=(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},ys=(e,t)=>{const{items:r,filter:n}=e,i=[],a=[],o=s=>{s&&!De(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}},Op=(e,t)=>{console.log("LOG1 productsToUnselect",e),e.map(({selCtx:r,id:n})=>{t(`selected.${r}.${n}`,!1)})},bs=(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 Ss(e,t,r,n){const{selCtx:i,attrs:a={}}=e,o=oe(y=>y.initialSelected),s=oe(y=>y.currency),{setValue:u,getValues:f}=ze(),{selected:c={},filter:l={}}=f(),d=Hr(e,l),g=oe(y=>y.isOnSubmitted),p=oe(y=>y.setValidationMap),[b,v]=ms(e.selCtx,c,e.items);return p({productSelCtx:i,attrs:a,actualQtyCnt:v,actualSelCnt:b,nestedLvl:t,isPassedFiltering:d,parentSelCtx:n,parentKind:r}),S.useEffect(()=>{const{productsToSelect:y,productsToUnselect:h}=ys(e,d);bs(y,u,o)},[d]),{isFilterValidated:d,selected:c,isOnSubmitted:g,selCnt:b,qtyCnt:v,currency:s}}var Wr={exports:{}},Gr={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.min.js
|
|
5
5
|
*
|
|
@@ -8,8 +8,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/var wp=T.default,Ep=Symbol.for("react.element"),Pp=Symbol.for("react.fragment"),xp=Object.prototype.hasOwnProperty,Ap=wp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Cp={key:!0,ref:!0,__self:!0,__source:!0};function Os(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)xp.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:Ep,type:e,key:a,ref:o,props:i,_owner:Ap.current}}Gr.Fragment=Pp;Gr.jsx=Os;Gr.jsxs=Os;Wr.exports=Gr;const A=Wr.exports.jsx,U=Wr.exports.jsxs,Ke=Wr.exports.Fragment;function Ia(e){const{isOk:t,isErr:r,info:n}=e;return U("p",{className:`${t?"text-green-600":r&&"text-red-600"} ml-1 flex`,children:[t&&_p,r&&Tp,n]})}const _p=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"})}),Tp=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 Np={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},Ip={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 Jt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Jt=function(t){return typeof t}:Jt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jt(e)}function $a(e){return $p(e)||Lp(e)||Rp(e)||Fp()}function $p(e){if(Array.isArray(e))return e}function Lp(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function Rp(e,t){if(!!e){if(typeof e=="string")return La(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 La(e,t)}}function La(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 Fp(){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 Mp={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=$a(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=$a(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.greaterThan(o)?a:o}),a}};function ws(e){return!isNaN(parseInt(e))&&isFinite(e)}function kp(e){return ws(e)&&e<=100&&e>=0}function Dp(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function Ra(e){return e%2===0}function Fa(e){return ws(e)&&!Number.isInteger(e)}function jp(){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 Ut(e){return Math.abs(e)%1===.5}function Vp(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),Up(i,t.headers),i.send()})}function Up(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 Yt(e){return typeof e=="undefined"}function Es(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(n){if(Jt(n[1])==="object"){var i=Es(n[1]);Object.entries(i).forEach(function(a){r[n[0]+t+a[0]]=a[1]})}else r[n[0]]=n[1]}),r}function Bp(e){return Boolean(e)&&(Jt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function Ps(){var e=function(n,i){var a=function(u){return Math.pow(10,jp(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 Ut(n)&&Ra(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return Ut(n)?Ra(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return Ut(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return Ut(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return Ut(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 Fa(n)||Fa(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 Hp=Ps();function Wp(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!Yt(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return Yt(this.getMatches().find(n))?0:this.getMatches()[Hp.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 Yt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Yt(this.getMatches().find(function(n){return n===","}))}}}function Gp(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 Vp(t(e.endpoint,{from:i,to:a}),{headers:e.headers})};return{getExchangeRate:function(i,a){return(Bp(e.endpoint)?e.endpoint:r(i,a)).then(function(o){return Es(o)[t(e.propertyPath,{from:i,to:a})]})}}}function tr(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function Kp(e){tr(kp(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Yp(e){tr(Dp(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function mn(e){tr(Number.isInteger(e),"You must provide an integer.",TypeError)}var ee=Ps(),zp=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;mn(n),mn(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){tr(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;mn(p);var v=this.getPrecision(),b=p>v,m=b?ee.multiply:ee.divide,E=b?[p,v]:[v,p],C=Math.pow(10,ee.subtract.apply(ee,E));return l.call(this,{amount:ee.round(m(this.getAmount(),C),y),precision:p})},add:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return l.call(this,{amount:ee.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:ee.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:ee.round(ee.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:ee.round(ee.divide(this.getAmount(),p),y)})},percentage:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return Kp(p),this.multiply(ee.divide(p,100),y)},allocate:function(p){var y=this;Yp(p);for(var v=p.reduce(function(C,w){return ee.add(C,w)}),b=this.getAmount(),m=p.map(function(C){var w=Math.floor(ee.divide(ee.multiply(y.getAmount(),C),v));return b=ee.subtract(b,w),l.call(y,{amount:w})}),E=0;b>0;)p[E]>0&&(m[E]=m[E].add(l.call(this,{amount:1})),b=ee.subtract(b,1)),E+=1;return m},convert:function(p){var y=this,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b=v.endpoint,m=b===void 0?c.endpoint:b,E=v.propertyPath,C=E===void 0?c.propertyPath||"rates.{{to}}":E,w=v.headers,x=w===void 0?c.headers:w,_=v.roundingMode,$=_===void 0?u:_,F=Object.assign({},{endpoint:m,propertyPath:C,headers:x,roundingMode:$});return Gp(F).getExchangeRate(this.getCurrency(),p).then(function(k){return tr(!Yt(k),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(y,{amount:ee.round(ee.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 ee.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return ee.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=Wp(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 ee.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 ee.divide(ee.round(ee.multiply(this.toUnit(),v),y),v)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},qp=Object.assign(zp,Np,Ip,Mp);const vr=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),n=Number(r)*100;return isNaN(n)?"0.00":qp({amount:Math.round(n),currency:t}).toFormat("0,0.00")},Qp=(e,t,r=1)=>{const n=parseFloat(e.toString());let i=!1,a=vr(`${r*n}`);const o=`${vr(`${a}`)}`;return n<parseFloat(t)&&(i=!0,a=`${vr(`${t}`)}`),{displayPriceFrom:i,formattedEndPriceWithPriceMin:a,formattedEndPrice:o}};function Kr(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=vr(`${u}`);return!t&&i===!1?null:r?U("span",{style:{visibility:`${!t&&o?"hidden":"visible"}`},className:"",children:["\xA0",`+${f}`]}):t<s?U("span",{className:"",children:["\xA0",`od ${f}`]}):A("span",{className:"",children:f})}function Jp(e,t){const{selCtx:r,id:n}=e,i=oe(s=>s.expanded),a=S.useMemo(()=>Zp(r,n,t,i),[r,n,t,i]),o=oe(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 Xp=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,eh={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026","/":"/","/":"/"},th=function(t){return eh[t]},rh=function(t){return t.replace(Xp,th)};function Ma(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 ka(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ma(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ma(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Rn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:rh},xs,nh=S.createContext();function ih(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Rn=ka(ka({},Rn),e)}function ah(){return Rn}var oh=function(){function e(){Le(this,e),this.usedNamespaces={}}return Re(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 sh(e){xs=e}function uh(){return xs}var lh={type:"3rdParty",init:function(t){ih(t.options.react),sh(t)}};function ch(){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 Da={};function Fn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&Da[t[0]]||(typeof t[0]=="string"&&(Da[t[0]]=new Date),ch.apply(void 0,t))}function ja(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 fh(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 dh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Fn("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}}):fh(e,t,r)}function gh(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 ph(e,t){return eo(e)||gh(e,t)||to(e,t)||ro()}function Va(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 vn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Va(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Va(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var hh=function(t,r){var n=S.useRef();return S.useEffect(function(){n.current=r?n.current:t},[t,r]),n.current};function oi(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,n=S.useContext(nh)||{},i=n.i18n,a=n.defaultNS,o=r||i||uh();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new oh),!o){Fn("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&&Fn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var f=vn(vn(vn({},ah()),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($){return dh($,o,f)});function p(){return o.getFixedT(null,f.nsMode==="fallback"?d:d[0],l)}var y=S.useState(p),v=ph(y,2),b=v[0],m=v[1],E=d.join(),C=hh(E),w=S.useRef(!0);S.useEffect(function(){var $=f.bindI18n,F=f.bindI18nStore;w.current=!0,!g&&!c&&ja(o,d,function(){w.current&&m(p)}),g&&C&&C!==E&&w.current&&m(p);function k(){w.current&&m(p)}return $&&o&&o.on($,k),F&&o&&o.store.on(F,k),function(){w.current=!1,$&&o&&$.split(" ").forEach(function(H){return o.off(H,k)}),F&&o&&F.split(" ").forEach(function(H){return o.store.off(H,k)})}},[o,E]);var x=S.useRef(!0);S.useEffect(function(){w.current&&!x.current&&m(p),x.current=!1},[o,l]);var _=[b,o,g];if(_.t=b,_.i18n=o,_.ready=g,g||!g&&!c)return _;throw new Promise(function($){ja(o,d,function(){$()})})}var As=[],mh=As.forEach,vh=As.slice;function yh(e){return mh.call(vh.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var Ua=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,bh=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(!Ua.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(i.domain)}if(i.path){if(!Ua.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},Ba={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=bh(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)}},Sh={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var n=Ba.read(t.lookupCookie);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&Ba.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},Oh={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}},Bt=null,Ha=function(){if(Bt!==null)return Bt;try{Bt=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Bt=!1}return Bt},wh={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&Ha()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&Ha()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},Ht=null,Wa=function(){if(Ht!==null)return Ht;try{Ht=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Ht=!1}return Ht},Eh={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&Wa()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&Wa()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},Ph={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}},xh={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}},Ah={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 _h(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Cs=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Le(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return Re(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=yh(n,this.options||{},_h()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(Sh),this.addDetector(Oh),this.addDetector(wh),this.addDetector(Eh),this.addDetector(Ph),this.addDetector(xh),this.addDetector(Ah),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(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}();Cs.type="languageDetector";const Th={"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"},Nh={"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"},Ih={"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"};Se.use(Cs).use(lh).init({resources:{pl:{translation:Th},en:{translation:Nh},de:{translation:Ih},cs:{translation:$h}}});const Lh=(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=Ie.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(a=Ie.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=Ie.IGNORE),r>=o&&r<=s&&(a=Ie.OK),{message:i,validationStatus:a}},Rh=(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=Ie.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(a=Ie.TOO_MUCH)),o>=0||s>=0?(i=`${n("OS.ProductConfigurator.Selected.Message.Choose")}${i}`,i+=` ${n("OS.ProductConfigurator.Selected.Message.Options")}`):(i="",a=Ie.IGNORE),o===1&&s===1&&(i=`${n("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=o&&r<=s&&(a=Ie.OK),{message:i,validationStatus:a}},Fh=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:m}=oi(),{isExpanded:E,toggleExpanded:C}=Jp(t,r),{validationStatus:w,message:x}=Rh(p,y,o,m),{validationStatus:_,message:$}=Lh(d,g,a,m),F=w===Ie.OK,k=_===Ie.OK,H=!F&&i&&!!x,M=!k&&i&&!!$;return U("div",{className:"pt-1 mb-3",id:up(u),children:[U("div",{className:"flex text-xl font-semibold",children:[A("p",{className:"",children:v}),v&&v!==" "&&U(Ke,{children:[A("div",{className:"ml-auto",children:A(Kr,{price:Jn(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:U("div",{children:[A(Ia,{isOk:F,isErr:H,info:x}),A(Ia,{isOk:k,isErr:M,info:$})]})}),A("div",{className:`${E?"block":"hidden"}`,children:s})]})},_s=T.default.createContext(null);function Yr(){const e=S.useContext(_s);if(!e)throw new Error("Missing ComponentsContext");return e}const Mh=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}=Ss(t),{MenuOptionsUI:d}=Yr();if(!o)return null;const g=A(si,{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(Fh,{...p,children:g})},kh=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=Ro(t),l=gs(t);return U("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:U("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(Kr,{price:parseFloat(c),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})},Dh=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=Ro(t),d=gs(t);return U("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:U("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(Kr,{price:parseFloat(l||"0"),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})};function Ts(e){const{value:t=0,add:r,subtract:n,disabledSubtract:i,disabledAdd:a,size:o="md"}=e;return U("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:U("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:U("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 jh(e,t,r){const{watch:n,setValue:i,getValues:a,unregister:o}=ze(),{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(De(f)){const m=a(g);(y=Object.keys(m||{}))==null||y.forEach(E=>{o(`${g}.${E}`);const C=Object.keys(a(d)||{});De(C)?o(`${p}.${E}`):C.forEach(w=>{w!==u&&!a(`${d}.${w}.${E}`)&&o(`${p}.${E}`)})});return}else{const m=a(g),E=a(d);(v=Object.keys(f))==null||v.forEach(C=>{var w;(w=Object.keys(m||{}))==null||w.forEach(x=>{f[x]||(o(`${p}.${x}`),o(`${g}.${x}`))}),Object.keys(E||{}).forEach(x=>{x!==u&&C in a(d==null?void 0:d[x])&&o(`${d}.${x}.${C}`)}),i(`${p}.${C}`,f[C]),i(`${g}.${C}`,{cnt:1,value:f[C]})});return}l&&c&&!De(f)&&((b=Object.keys(f))==null||b.forEach(m=>{i(`filter.${c}.${m}`,f[m]);const E=a(`${g}.${m}.cnt`)||0;i(`${g}.${m}`,{cnt:E+1,value:f[m]})}))},[l]),{}}function Vh(){const e=oe(n=>n.getInvalidSelCtxArray),t=oe(n=>n.isInputEnabled),r=oe(n=>n.isInputCounterIncrementEnabled);return{getInvalidSelCtxArray:e,isInputEnabled:t,isInputCounterIncrementEnabled:r}}const Ga=(e,t)=>{Object.keys(e).forEach(r=>{t(`selected.${r}`,e[r])})},Mn=(e,t,r)=>{const n=t(`selected.${e}`);console.log("changedSelCtx",n),r(`selected.${e}`,Object.keys(n).reduce((i,a)=>(i[a]=!1,i),{}))},Uh=(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){Ga(l,e);const p=y=>{var v;!Array.isArray(y)||De(s==null?void 0:s.selected)||(v=y==null?void 0:y.filter(b=>{var m,E;return!!((E=(m=s.selected)==null?void 0:m[`${b.selCtx}`])!=null&&E[`${b.id}`])}))==null||v.map(b=>{if(b.state&&"selected"in b.state){const{state:{selected:m}}=b;Ga(m,e)}Array.isArray(b.items)&&p(b.items)})};p(o)}else{Object.keys(l).forEach(y=>{Mn(y,t,e)});const p=y=>{!Array.isArray(y)||y.map(v=>{const{selCtx:b}=v;t(`selected.${b}`)&&Mn(b,t,e),p(v.items)})};if(p(o),a&&a<2&&!De(u)){(d=Object.keys(u))==null||d.forEach(m=>{const E=`filterWithCnt.${f}.${m}.${u[m]}`,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(m=>{var C,w,x;const E=t(`${v}.${m}`)||0;if(E)if(E>1)e(`${v}.${m}`,E-1);else{i(`${v}.${m}`);const _=t(y)||{},$=(C=Object.keys(_))==null?void 0:C.filter(F=>F!==c);if(!$)i(`${b}.${m}`);else{const F=$==null?void 0:$.find(k=>{var H;return!!((H=_==null?void 0:_[`${k}`])!=null&&H[`${m}`])});if(!F)i(`${b}.${m}`);else{const k=(x=(w=_==null?void 0:_[`${F}`])==null?void 0:w[`${m}`])==null?void 0:x.value;e(`${b}.${m}`,k)}}}})}}},yr=(e,t)=>{var r;if(!e.items||De(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===We.PRODUCT)return i;if(i.kind===We.OPTIONS&&i.items&&i.items.length>0){const a=yr(i,t);if(a)return a}}return null};function Bh(e,t,r,n){var ye;const{id:i,selCtx:a,emit:o={},fltCtx:s}=e,{allowMultiple:u,selMin:f,selMax:c}=t,{isInputEnabled:l,isInputCounterIncrementEnabled:d}=Vh(),g=oe(K=>K.refreshForm),p=oe(K=>K.currency),{watch:y,getValues:v,setValue:b,register:m,unregister:E}=ze(),C=y(`selected.${a}.${i}`),{selected:w={}}=v(),x=Number(C||0),_=f==="1"&&c==="1";jh(e,_,r);const $=!_,F=sp(u),k=x>(_?1:0),H=d(e,w)&&(l(e)||x),M=Number(((ye=w==null?void 0:w[a])==null?void 0:ye[i])||0)>0,j=l(e)||x,V=`${_?"radio":"selected"}.${a}.${i}`,W=m(V,{onChange:K=>{he(K)}}),X=()=>{var ie,ae;b(`selected.${a}.${i}`,`${x+1}`);const K=(ae=(ie=Object.keys(w))==null?void 0:ie.map(se=>{var q;return{key:se,subProductId:(q=yr(e,se))==null?void 0:q.id}}))==null?void 0:ae.filter(se=>!!se.subProductId);K==null||K.forEach(se=>{b(`selected.${se.key}.${se.subProductId}`,`${x+1}`)})},G=()=>{var ae,se,q,xe;const K=x-1;b(`selected.${a}.${i}`,`${K}`);const ie=(se=(ae=Object.keys(w))==null?void 0:ae.map(re=>{var Q;return{key:re,subProductId:(Q=yr(e,re))==null?void 0:Q.id}}))==null?void 0:se.filter(re=>!!re.subProductId);if(ie==null||ie.forEach(re=>{b(`selected.${re.key}.${re.subProductId}`,`${K}`)}),$&&K===0){b(`selected.${a}.${i}`,!1),(q=Object.keys(o))==null||q.forEach(Q=>{const ue=`filterWithCnt.${s}.${Q}.${o[Q]}`,ce=v(ue)||0;ce<2?E(ue):b(ue,ce-1)});const re=Q=>{!Array.isArray(Q)||Q.map(ue=>{const{selCtx:ce}=ue;v(`selected.${ce}`)&&Mn(ce,v,b),re(ue.items)})};if(re(e.items),r&&r<2&&!De(o)){const Q=`filterWithCnt.${s}`,ue=`filterWithCnt.${s}.${a}`,ce=`filter.${s}`;(xe=Object.keys(o))==null||xe.forEach(ve=>{var me,le,Ae;const B=v(`${ue}.${ve}`)||0;if(B)if(B>1)b(`${ue}.${ve}`,B-1);else{E(`${ue}.${ve}`);const tt=v(Q)||{},Mt=(me=Object.keys(tt))==null?void 0:me.filter(kt=>kt!==a);if(!Mt)E(`${ce}.${ve}`);else{const kt=Mt==null?void 0:Mt.find(h=>{var O;return!!((O=tt==null?void 0:tt[`${h}`])!=null&&O[`${ve}`])});if(!kt)E(`${ce}.${ve}`);else{const h=(Ae=(le=tt==null?void 0:tt[`${kt}`])==null?void 0:le[`${ve}`])==null?void 0:Ae.value;b(`${ce}.${ve}`,h)}}}})}}},he=K=>{var q;const{target:{checked:ie,name:ae,defaultValue:se}}=K;if(Uh(b,v,e,ie,E,r),_){console.log("handleOnInputChange radio",ae,se);const xe=(q=n==null?void 0:n.items)==null?void 0:q.filter(Q=>Q.id!==e.id);for(const Q of Object.keys(w||{}))(xe!=null&&xe.some(ce=>!!yr(ce,Q))?Q:!1)&&b(`selected.${Q}`,!1);const re="selected."+ae.replace("radio.","").split(".")[0];b(re,{[se]:"1"}),g()}};return{registerProps:W,isRadio:_,isCheckbox:$,isCounter:F,isDecrementEnabled:k,isIncrementEnabled:H,isChecked:M,isCheckboxEnabled:j,handleCounterIncrementQty:X,handleCounterDecrementQty:G,counterValue:x,handleOnInputChange:he,inputId:`${a}.${i}`,radioInputValue:i,currency:p}}const Hh=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:m,currency:E}=Bh(t,r,n,i),{MenuProductUI:C}=Yr(),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:m,currency:E,parentProduct:i},x=A(si,{productItems:t.items,parentProduct:t,nestedLvl:n+1,rootProduct:a});return C?A(C,{...w,children:x}):A(Wh,{...w,children:x})},Wh=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(Ts,{value:g,add:p,subtract:y,disabledSubtract:!f,disabledAdd:!c}),m=()=>o?A(Dh,{product:t,inputId:i,inputValue:a,registerProps:n,isChecked:l,children:A(Ke,{children:u&&b})}):s?A(kh,{product:t,inputId:i,registerProps:n,isDisabled:!d,children:A(Ke,{children:u&&b})}):null,E=!De(t.items)&&g,C=mi.useTransition(E,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});return U("div",{children:[m(),E?C((w,x)=>x&&A(mi.animated.div,{className:`border-l-[2px] border-gray-300 ${r>=1&&"ml-4 pl-4"}`,style:w,children:v},r+1)):null]})};function Gh(){return{isMenuProductToShow:r=>r.kind===We.PRODUCT&&_a(r),isMenuOptionsToShow:r=>[We.OPTIONS,We.CONFIG].includes(r.kind)&&_a(r)}}function si(e){const{productItems:t,nestedLvl:r=1,parentProduct:n,rootProduct:i}=e,{attrs:a={},selCtx:o,kind:s}=n,{isMenuProductToShow:u,isMenuOptionsToShow:f}=Gh(),{MenuItemsUI:c}=Yr(),d={productItems:t,parentProduct:n,renderMenuItem:g=>f(g)?A(Mh,{optionsItem:g,parentSelCtx:o,parentKind:s,nestedLvl:r,rootProduct:i}):u(g)?A(Hh,{product:g,parentAttrs:a,parentProduct:n,nestedLvl:r,rootProduct:i}):A(Ke,{}),rootProduct:i};return c?A(c,{...d}):A(Kh,{...d})}function Kh(e){const{productItems:t,parentProduct:r,renderMenuItem:n}=e,i=r.kind!==We.PRODUCT,a=99,o=3,[s,u]=S.useState(i?o:a),{t:f}=oi(),c=()=>{u(a)},l=()=>{u(o)};return A(Ke,{children:t.map((d,g)=>{if(g<s)return U("div",{children:[n(d),s===a&&i&&t.length===g+1&&Ka(f("OS.ProductConfigurator.ShowLess"),l,!1)]},`${r.id}--${d.id}--${g}`);if(g===s)return Ka(f("OS.ProductConfigurator.ShowMore"),c,!0)})})}const Ka=(e,t,r)=>A("div",{className:"flex justify-center w-full",children:U("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:t,children:[e,U("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}`),Ns=()=>{const{watch:e}=ze(),t=e("selected"),r=e("filter"),n=e("filterWithCnt"),i=oe(a=>a.validationMap);return console.log({selected:t,validationMap:i,filter:r,filterWithCnt:n}),U("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&&U(Ke,{children:[U("p",{className:"text-lg font-semibold",children:[a,":"]}),Object.keys(t[a]).map(o=>A(T.default.Fragment,{children:t[a][o]&&U("p",{children:[o,":",t[a][o].toString()]})},o))]})},a))]})};function Ya(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:n,displayPriceFrom:i=!1,productQuantity:a,increaseProductQuantity:o,decreaseProductQuantity:s,handleOnSubmit:u}=e,{t:f}=oi();return U("div",{className:"flex items-center justify-around w-full h-16 px-4",children:[r&&U("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:[U("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(Ts,{value:a,add:o,subtract:s,disabledSubtract:a===1,size:"lg"})}),U("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:[U("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 dr=640,Is=e=>{const{isModal:t=!1}=e,[r,n]=S.useState(window.innerWidth),[i,a]=S.useState(window.innerHeight),[o,s]=S.useState(window.innerWidth<=dr),[u,f]=S.useState(window.innerWidth>dr&&!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>dr&&!t),s(window.innerWidth<=dr)},[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 Wt(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=$s(e))&&(n&&(n+=" "),n+=t);return n}var Yh=Object.defineProperty,zh=(e,t,r)=>t in e?Yh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yn=(e,t,r)=>(zh(e,typeof t!="symbol"?t+"":t,r),r);class qh{constructor(){yn(this,"current",this.detect()),yn(this,"handoffState","pending"),yn(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 Ze=new qh,$e=(e,t)=>{Ze.isServer?S.useEffect(e,t):S.useLayoutEffect(e,t)};function Xe(e){let t=S.useRef(e);return $e(()=>{t.current=e},[e]),t}let ne=function(e){let t=Xe(e);return T.default.useCallback((...r)=>t.current(...r),[t])};function zr(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Et(){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 zr(()=>{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=Et();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 ui(){let[e]=S.useState(Et);return S.useEffect(()=>()=>e.dispose(),[e]),e}function Qh(){let e=typeof document=="undefined";return"useSyncExternalStore"in ut?(t=>t.useSyncExternalStore)(ut)(()=>()=>{},()=>!1,()=>!e):!1}function Rt(){let e=Qh(),[t,r]=ut.useState(Ze.isHandoffComplete);return t&&Ze.isHandoffComplete===!1&&r(!1),ut.useEffect(()=>{t!==!0&&r(!0)},[t]),ut.useEffect(()=>Ze.handoff(),[]),e?!1:t}var za;let Ft=(za=T.default.useId)!=null?za:function(){let e=Rt(),[t,r]=T.default.useState(e?()=>Ze.nextId():null);return $e(()=>{t===null&&r(Ze.nextId())},[t]),t!=null?""+t:void 0};function be(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,be),n}function Ls(e){return Ze.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let kn=["[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 pt=(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))(pt||{}),Rs=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Rs||{}),Jh=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Jh||{});function Zh(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(kn)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var Fs=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Fs||{});function Xh(e,t=0){var r;return e===((r=Ls(e))==null?void 0:r.body)?!1:be(t,{[0](){return e.matches(kn)},[1](){let n=e;for(;n!==null;){if(n.matches(kn))return!0;n=n.parentElement}return!1}})}var em=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(em||{});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 vt(e){e==null||e.focus({preventScroll:!0})}let tm=["textarea","input"].join(",");function rm(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,tm))!=null?r:!1}function nm(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 br(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?nm(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&&rm(d)&&d.select(),2}function Ms(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function im(){return/Android/gi.test(window.navigator.userAgent)}function am(){return Ms()||im()}function gr(e,t,r){let n=Xe(t);S.useEffect(()=>{function i(a){n.current(a)}return document.addEventListener(e,i,r),()=>document.removeEventListener(e,i,r)},[e,r])}function ks(e,t,r){let n=Xe(t);S.useEffect(()=>{function i(a){n.current(a)}return window.addEventListener(e,i,r),()=>window.removeEventListener(e,i,r)},[e,r])}function om(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!Xh(u,Fs.Loose)&&u.tabIndex!==-1&&o.preventDefault(),t(o,u)}let a=S.useRef(null);gr("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),gr("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),gr("click",o=>{am()||a.current&&(i(o,()=>a.current),a.current=null)},!0),gr("touchend",o=>i(o,()=>o.target instanceof HTMLElement?o.target:null),!0),ks("blur",o=>i(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function ar(...e){return S.useMemo(()=>Ls(...e),[...e])}let Ds=Symbol();function sm(e,t=!0){return Object.assign(e,{[Ds]:t})}function je(...e){let t=S.useRef(e);S.useEffect(()=>{t.current=e},[e]);let r=ne(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[Ds]))?void 0:r}function li(e,t){let r=S.useRef([]),n=ne(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 $r(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Lr=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Lr||{}),st=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(st||{});function Fe({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:a=!0,name:o,mergeRefs:s}){s=s!=null?s:um;let u=js(t,e);if(a)return pr(u,r,n,o,s);let f=i!=null?i:0;if(f&2){let{static:c=!1,...l}=u;if(c)return pr(l,r,n,o,s)}if(f&1){let{unmount:c=!0,...l}=u;return be(c?0:1,{[0](){return null},[1](){return pr({...l,hidden:!0,style:{display:"none"}},r,n,o,s)}})}return pr(u,r,n,o,s)}function pr(e,t={},r,n,i){let{as:a=r,children:o,refName:s="ref",...u}=bn(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(qa(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(
|
|
11
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Mp={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=$a(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=$a(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.greaterThan(o)?a:o}),a}};function ws(e){return!isNaN(parseInt(e))&&isFinite(e)}function kp(e){return ws(e)&&e<=100&&e>=0}function Dp(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function Ra(e){return e%2===0}function Fa(e){return ws(e)&&!Number.isInteger(e)}function jp(){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 Ut(e){return Math.abs(e)%1===.5}function Vp(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),Up(i,t.headers),i.send()})}function Up(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 Yt(e){return typeof e=="undefined"}function Es(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(n){if(Jt(n[1])==="object"){var i=Es(n[1]);Object.entries(i).forEach(function(a){r[n[0]+t+a[0]]=a[1]})}else r[n[0]]=n[1]}),r}function Bp(e){return Boolean(e)&&(Jt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function Ps(){var e=function(n,i){var a=function(u){return Math.pow(10,jp(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 Ut(n)&&Ra(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return Ut(n)?Ra(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return Ut(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return Ut(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return Ut(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 Fa(n)||Fa(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 Hp=Ps();function Wp(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!Yt(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return Yt(this.getMatches().find(n))?0:this.getMatches()[Hp.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 Yt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Yt(this.getMatches().find(function(n){return n===","}))}}}function Gp(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 Vp(t(e.endpoint,{from:i,to:a}),{headers:e.headers})};return{getExchangeRate:function(i,a){return(Bp(e.endpoint)?e.endpoint:r(i,a)).then(function(o){return Es(o)[t(e.propertyPath,{from:i,to:a})]})}}}function tr(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function Kp(e){tr(kp(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Yp(e){tr(Dp(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function mn(e){tr(Number.isInteger(e),"You must provide an integer.",TypeError)}var ee=Ps(),zp=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;mn(n),mn(a);var o=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,f=e.globalFormatRoundingMode,c=Object.assign({},e.globalExchangeRatesApi),l=function(p){var b=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},p),Object.assign({},{locale:this.locale},p));return Object.assign(e({amount:b.amount,currency:b.currency,precision:b.precision}),{locale:b.locale})},d=function(p){tr(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 b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;mn(p);var v=this.getPrecision(),y=p>v,h=y?ee.multiply:ee.divide,E=y?[p,v]:[v,p],C=Math.pow(10,ee.subtract.apply(ee,E));return l.call(this,{amount:ee.round(h(this.getAmount(),C),b),precision:p})},add:function(p){d.call(this,p);var b=e.normalizePrecision([this,p]);return l.call(this,{amount:ee.add(b[0].getAmount(),b[1].getAmount()),precision:b[0].getPrecision()})},subtract:function(p){d.call(this,p);var b=e.normalizePrecision([this,p]);return l.call(this,{amount:ee.subtract(b[0].getAmount(),b[1].getAmount()),precision:b[0].getPrecision()})},multiply:function(p){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:ee.round(ee.multiply(this.getAmount(),p),b)})},divide:function(p){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:ee.round(ee.divide(this.getAmount(),p),b)})},percentage:function(p){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return Kp(p),this.multiply(ee.divide(p,100),b)},allocate:function(p){var b=this;Yp(p);for(var v=p.reduce(function(C,w){return ee.add(C,w)}),y=this.getAmount(),h=p.map(function(C){var w=Math.floor(ee.divide(ee.multiply(b.getAmount(),C),v));return y=ee.subtract(y,w),l.call(b,{amount:w})}),E=0;y>0;)p[E]>0&&(h[E]=h[E].add(l.call(this,{amount:1})),y=ee.subtract(y,1)),E+=1;return h},convert:function(p){var b=this,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=v.endpoint,h=y===void 0?c.endpoint:y,E=v.propertyPath,C=E===void 0?c.propertyPath||"rates.{{to}}":E,w=v.headers,x=w===void 0?c.headers:w,_=v.roundingMode,$=_===void 0?u:_,F=Object.assign({},{endpoint:h,propertyPath:C,headers:x,roundingMode:$});return Gp(F).getExchangeRate(this.getCurrency(),p).then(function(k){return tr(!Yt(k),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(b,{amount:ee.round(ee.multiply(b.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 b=e.normalizePrecision([this,p]);return b[0].getAmount()<b[1].getAmount()},lessThanOrEqual:function(p){d.call(this,p);var b=e.normalizePrecision([this,p]);return b[0].getAmount()<=b[1].getAmount()},greaterThan:function(p){d.call(this,p);var b=e.normalizePrecision([this,p]);return b[0].getAmount()>b[1].getAmount()},greaterThanOrEqual:function(p){d.call(this,p);var b=e.normalizePrecision([this,p]);return b[0].getAmount()>=b[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return ee.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return ee.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var b=e.normalizePrecision([this,p]);return b[0].getAmount()===b[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,v=Wp(p);return this.toRoundedUnit(v.getMinimumFractionDigits(),b).toLocaleString(this.getLocale(),{currencyDisplay:v.getCurrencyDisplay(),useGrouping:v.getUseGrouping(),minimumFractionDigits:v.getMinimumFractionDigits(),style:v.getStyle(),currency:this.getCurrency()})},toUnit:function(){return ee.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(p){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,v=Math.pow(10,p);return ee.divide(ee.round(ee.multiply(this.toUnit(),v),b),v)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},Qp=Object.assign(zp,Np,Ip,Mp);const vr=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),n=Number(r)*100;return isNaN(n)?"0.00":Qp({amount:Math.round(n),currency:t}).toFormat("0,0.00")},qp=(e,t,r=1)=>{const n=parseFloat(e.toString());let i=!1,a=vr(`${r*n}`);const o=`${vr(`${a}`)}`;return n<parseFloat(t)&&(i=!0,a=`${vr(`${t}`)}`),{displayPriceFrom:i,formattedEndPriceWithPriceMin:a,formattedEndPrice:o}};function Kr(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=vr(`${u}`);return!t&&i===!1?null:r?U("span",{style:{visibility:`${!t&&o?"hidden":"visible"}`},className:"",children:["\xA0",`+${f}`]}):t<s?U("span",{className:"",children:["\xA0",`od ${f}`]}):A("span",{className:"",children:f})}function Jp(e,t){const{selCtx:r,id:n}=e,i=oe(s=>s.expanded),a=S.useMemo(()=>Zp(r,n,t,i),[r,n,t,i]),o=oe(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 Xp=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,eh={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026","/":"/","/":"/"},th=function(t){return eh[t]},rh=function(t){return t.replace(Xp,th)};function Ma(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 ka(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ma(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ma(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Rn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:rh},xs,nh=S.createContext();function ih(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Rn=ka(ka({},Rn),e)}function ah(){return Rn}var oh=function(){function e(){Le(this,e),this.usedNamespaces={}}return Re(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 sh(e){xs=e}function uh(){return xs}var lh={type:"3rdParty",init:function(t){ih(t.options.react),sh(t)}};function ch(){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 Da={};function Fn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&Da[t[0]]||(typeof t[0]=="string"&&(Da[t[0]]=new Date),ch.apply(void 0,t))}function ja(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 fh(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 dh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Fn("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}}):fh(e,t,r)}function gh(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 ph(e,t){return eo(e)||gh(e,t)||to(e,t)||ro()}function Va(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 vn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Va(Object(r),!0).forEach(function(n){Ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Va(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var hh=function(t,r){var n=S.useRef();return S.useEffect(function(){n.current=r?n.current:t},[t,r]),n.current};function oi(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,n=S.useContext(nh)||{},i=n.i18n,a=n.defaultNS,o=r||i||uh();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new oh),!o){Fn("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&&Fn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var f=vn(vn(vn({},ah()),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($){return dh($,o,f)});function p(){return o.getFixedT(null,f.nsMode==="fallback"?d:d[0],l)}var b=S.useState(p),v=ph(b,2),y=v[0],h=v[1],E=d.join(),C=hh(E),w=S.useRef(!0);S.useEffect(function(){var $=f.bindI18n,F=f.bindI18nStore;w.current=!0,!g&&!c&&ja(o,d,function(){w.current&&h(p)}),g&&C&&C!==E&&w.current&&h(p);function k(){w.current&&h(p)}return $&&o&&o.on($,k),F&&o&&o.store.on(F,k),function(){w.current=!1,$&&o&&$.split(" ").forEach(function(H){return o.off(H,k)}),F&&o&&F.split(" ").forEach(function(H){return o.store.off(H,k)})}},[o,E]);var x=S.useRef(!0);S.useEffect(function(){w.current&&!x.current&&h(p),x.current=!1},[o,l]);var _=[y,o,g];if(_.t=y,_.i18n=o,_.ready=g,g||!g&&!c)return _;throw new Promise(function($){ja(o,d,function(){$()})})}var As=[],mh=As.forEach,vh=As.slice;function yh(e){return mh.call(vh.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var Ua=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,bh=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(!Ua.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(i.domain)}if(i.path){if(!Ua.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},Ba={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=bh(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)}},Sh={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var n=Ba.read(t.lookupCookie);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&Ba.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},Oh={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}},Bt=null,Ha=function(){if(Bt!==null)return Bt;try{Bt=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Bt=!1}return Bt},wh={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&Ha()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&Ha()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},Ht=null,Wa=function(){if(Ht!==null)return Ht;try{Ht=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Ht=!1}return Ht},Eh={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&Wa()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&Wa()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},Ph={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}},xh={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}},Ah={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 _h(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Cs=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Le(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return Re(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=yh(n,this.options||{},_h()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(Sh),this.addDetector(Oh),this.addDetector(wh),this.addDetector(Eh),this.addDetector(Ph),this.addDetector(xh),this.addDetector(Ah),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(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}();Cs.type="languageDetector";const Th={"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"},Nh={"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"},Ih={"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"};Se.use(Cs).use(lh).init({resources:{pl:{translation:Th},en:{translation:Nh},de:{translation:Ih},cs:{translation:$h}}});const Lh=(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=Ie.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(a=Ie.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=Ie.IGNORE),r>=o&&r<=s&&(a=Ie.OK),{message:i,validationStatus:a}},Rh=(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=Ie.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(a=Ie.TOO_MUCH)),o>=0||s>=0?(i=`${n("OS.ProductConfigurator.Selected.Message.Choose")}${i}`,i+=` ${n("OS.ProductConfigurator.Selected.Message.Options")}`):(i="",a=Ie.IGNORE),o===1&&s===1&&(i=`${n("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=o&&r<=s&&(a=Ie.OK),{message:i,validationStatus:a}},Fh=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:b}=l,{name:v,description:y}=f.literals||{},{t:h}=oi(),{isExpanded:E,toggleExpanded:C}=Jp(t,r),{validationStatus:w,message:x}=Rh(p,b,o,h),{validationStatus:_,message:$}=Lh(d,g,a,h),F=w===Ie.OK,k=_===Ie.OK,H=!F&&i&&!!x,M=!k&&i&&!!$;return U("div",{className:"pt-1 mb-3",id:up(u),children:[U("div",{className:"flex text-xl font-semibold",children:[A("p",{className:"",children:v}),v&&v!==" "&&U(Ke,{children:[A("div",{className:"ml-auto",children:A(Kr,{price:Jn(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:`${y&&"mb-2"}`,children:y}),!1,A("div",{className:"flex",children:U("div",{children:[A(Ia,{isOk:F,isErr:H,info:x}),A(Ia,{isOk:k,isErr:M,info:$})]})}),A("div",{className:`${E?"block":"hidden"}`,children:s})]})},_s=T.default.createContext(null);function Yr(){const e=S.useContext(_s);if(!e)throw new Error("Missing ComponentsContext");return e}const Mh=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}=Ss(t,n,i,r),{MenuOptionsUI:d}=Yr();if(!o)return null;const g=A(si,{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(Fh,{...p,children:g})},kh=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=Ro(t),l=gs(t);return U("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:U("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(Kr,{price:parseFloat(c),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})},Dh=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=Ro(t),d=gs(t);return U("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:U("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(Kr,{price:parseFloat(l||"0"),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})};function Ts(e){const{value:t=0,add:r,subtract:n,disabledSubtract:i,disabledAdd:a,size:o="md"}=e;return U("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:U("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:U("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 jh(e,t,r){const{watch:n,setValue:i,getValues:a,unregister:o}=ze(),{id:s,selCtx:u,emit:f={},fltCtx:c}=e,l=n(`selected.${u}.${s}`);return S.useEffect(()=>{var b,v,y;if(!r||r>1)return;const d=`filterWithCnt.${c}`,g=`filterWithCnt.${c}.${u}`,p=`filter.${c}`;if(t&&l&&c)if(De(f)){const h=a(g);(b=Object.keys(h||{}))==null||b.forEach(E=>{o(`${g}.${E}`);const C=Object.keys(a(d)||{});De(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(x=>{f[x]||(o(`${p}.${x}`),o(`${g}.${x}`))}),Object.keys(E||{}).forEach(x=>{x!==u&&C in a(d==null?void 0:d[x])&&o(`${d}.${x}.${C}`)}),i(`${p}.${C}`,f[C]),i(`${g}.${C}`,{cnt:1,value:f[C]})});return}l&&c&&!De(f)&&((y=Object.keys(f))==null||y.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 Vh(){const e=oe(n=>n.getInvalidSelCtxArray),t=oe(n=>n.isInputEnabled),r=oe(n=>n.isInputCounterIncrementEnabled);return{getInvalidSelCtxArray:e,isInputEnabled:t,isInputCounterIncrementEnabled:r}}const Ga=(e,t)=>{Object.keys(e).forEach(r=>{t(`selected.${r}`,e[r])})},Mn=(e,t,r)=>{const n=t(`selected.${e}`);console.log("changedSelCtx",n),r(`selected.${e}`,Object.keys(n).reduce((i,a)=>(i[a]=!1,i),{}))},Uh=(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){Ga(l,e);const p=b=>{var v;!Array.isArray(b)||De(s==null?void 0:s.selected)||(v=b==null?void 0:b.filter(y=>{var h,E;return!!((E=(h=s.selected)==null?void 0:h[`${y.selCtx}`])!=null&&E[`${y.id}`])}))==null||v.map(y=>{if(y.state&&"selected"in y.state){const{state:{selected:h}}=y;Ga(h,e)}Array.isArray(y.items)&&p(y.items)})};p(o)}else{Object.keys(l).forEach(b=>{Mn(b,t,e)});const p=b=>{!Array.isArray(b)||b.map(v=>{const{selCtx:y}=v;t(`selected.${y}`)&&Mn(y,t,e),p(v.items)})};if(p(o),a&&a<2&&!De(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 b=`filterWithCnt.${f}`,v=`filterWithCnt.${f}.${c}`,y=`filter.${f}`;(g=Object.keys(u))==null||g.forEach(h=>{var C,w,x;const E=t(`${v}.${h}`)||0;if(E)if(E>1)e(`${v}.${h}`,E-1);else{i(`${v}.${h}`);const _=t(b)||{},$=(C=Object.keys(_))==null?void 0:C.filter(F=>F!==c);if(!$)i(`${y}.${h}`);else{const F=$==null?void 0:$.find(k=>{var H;return!!((H=_==null?void 0:_[`${k}`])!=null&&H[`${h}`])});if(!F)i(`${y}.${h}`);else{const k=(x=(w=_==null?void 0:_[`${F}`])==null?void 0:w[`${h}`])==null?void 0:x.value;e(`${y}.${h}`,k)}}}})}}},yr=(e,t)=>{var r;if(!e.items||De(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===We.PRODUCT)return i;if(i.kind===We.OPTIONS&&i.items&&i.items.length>0){const a=yr(i,t);if(a)return a}}return null};function Bh(e,t,r,n){var ye;const{id:i,selCtx:a,emit:o={},fltCtx:s}=e,{allowMultiple:u,selMin:f,selMax:c}=t,{isInputEnabled:l,isInputCounterIncrementEnabled:d}=Vh(),g=oe(K=>K.refreshForm),p=oe(K=>K.currency),{watch:b,getValues:v,setValue:y,register:h,unregister:E}=ze(),C=b(`selected.${a}.${i}`),{selected:w={}}=v(),x=Number(C||0),_=f==="1"&&c==="1";jh(e,_,r);const $=!_,F=sp(u),k=x>(_?1:0),H=d(e,w)&&(l(e)||x),M=Number(((ye=w==null?void 0:w[a])==null?void 0:ye[i])||0)>0,j=l(e)||x,V=`${_?"radio":"selected"}.${a}.${i}`,W=h(V,{onChange:K=>{he(K)}}),X=()=>{var ie,ae;y(`selected.${a}.${i}`,`${x+1}`);const K=(ae=(ie=Object.keys(w))==null?void 0:ie.map(se=>{var Q;return{key:se,subProductId:(Q=yr(e,se))==null?void 0:Q.id}}))==null?void 0:ae.filter(se=>!!se.subProductId);K==null||K.forEach(se=>{y(`selected.${se.key}.${se.subProductId}`,`${x+1}`)})},G=()=>{var ae,se,Q,xe;const K=x-1;y(`selected.${a}.${i}`,`${K}`);const ie=(se=(ae=Object.keys(w))==null?void 0:ae.map(re=>{var q;return{key:re,subProductId:(q=yr(e,re))==null?void 0:q.id}}))==null?void 0:se.filter(re=>!!re.subProductId);if(ie==null||ie.forEach(re=>{y(`selected.${re.key}.${re.subProductId}`,`${K}`)}),$&&K===0){y(`selected.${a}.${i}`,!1),(Q=Object.keys(o))==null||Q.forEach(q=>{const ue=`filterWithCnt.${s}.${q}.${o[q]}`,ce=v(ue)||0;ce<2?E(ue):y(ue,ce-1)});const re=q=>{!Array.isArray(q)||q.map(ue=>{const{selCtx:ce}=ue;v(`selected.${ce}`)&&Mn(ce,v,y),re(ue.items)})};if(re(e.items),r&&r<2&&!De(o)){const q=`filterWithCnt.${s}`,ue=`filterWithCnt.${s}.${a}`,ce=`filter.${s}`;(xe=Object.keys(o))==null||xe.forEach(ve=>{var me,le,Ae;const B=v(`${ue}.${ve}`)||0;if(B)if(B>1)y(`${ue}.${ve}`,B-1);else{E(`${ue}.${ve}`);const tt=v(q)||{},Mt=(me=Object.keys(tt))==null?void 0:me.filter(kt=>kt!==a);if(!Mt)E(`${ce}.${ve}`);else{const kt=Mt==null?void 0:Mt.find(m=>{var O;return!!((O=tt==null?void 0:tt[`${m}`])!=null&&O[`${ve}`])});if(!kt)E(`${ce}.${ve}`);else{const m=(Ae=(le=tt==null?void 0:tt[`${kt}`])==null?void 0:le[`${ve}`])==null?void 0:Ae.value;y(`${ce}.${ve}`,m)}}}})}}},he=K=>{var Q;const{target:{checked:ie,name:ae,defaultValue:se}}=K;if(Uh(y,v,e,ie,E,r),_){console.log("handleOnInputChange radio",ae,se);const xe=(Q=n==null?void 0:n.items)==null?void 0:Q.filter(q=>q.id!==e.id);for(const q of Object.keys(w||{}))(xe!=null&&xe.some(ce=>!!yr(ce,q))?q:!1)&&y(`selected.${q}`,!1);const re="selected."+ae.replace("radio.","").split(".")[0];y(re,{[se]:"1"}),g()}};return{registerProps:W,isRadio:_,isCheckbox:$,isCounter:F,isDecrementEnabled:k,isIncrementEnabled:H,isChecked:M,isCheckboxEnabled:j,handleCounterIncrementQty:X,handleCounterDecrementQty:G,counterValue:x,handleOnInputChange:he,inputId:`${a}.${i}`,radioInputValue:i,currency:p}}const Hh=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:b,counterValue:v,handleCounterIncrementQty:y,handleCounterDecrementQty:h,currency:E}=Bh(t,r,n,i),{MenuProductUI:C}=Yr(),w={product:t,nestedLvl:n,registerProps:o,inputId:s,radioInputValue:u,isRadio:f,isCheckbox:c,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:g,isChecked:p,isCheckboxEnabled:b,counterValue:v,handleCounterIncrementQty:y,handleCounterDecrementQty:h,currency:E,parentProduct:i},x=A(si,{productItems:t.items,parentProduct:t,nestedLvl:n+1,rootProduct:a});return C?A(C,{...w,children:x}):A(Wh,{...w,children:x})},Wh=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:b,children:v}=e,y=A(Ts,{value:g,add:p,subtract:b,disabledSubtract:!f,disabledAdd:!c}),h=()=>o?A(Dh,{product:t,inputId:i,inputValue:a,registerProps:n,isChecked:l,children:A(Ke,{children:u&&y})}):s?A(kh,{product:t,inputId:i,registerProps:n,isDisabled:!d,children:A(Ke,{children:u&&y})}):null,E=!De(t.items)&&g,C=mi.useTransition(E,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});return U("div",{children:[h(),E?C((w,x)=>x&&A(mi.animated.div,{className:`border-l-[2px] border-gray-300 ${r>=1&&"ml-4 pl-4"}`,style:w,children:v},r+1)):null]})};function Gh(){return{isMenuProductToShow:r=>r.kind===We.PRODUCT&&_a(r),isMenuOptionsToShow:r=>[We.OPTIONS,We.CONFIG].includes(r.kind)&&_a(r)}}function si(e){const{productItems:t,nestedLvl:r=1,parentProduct:n,rootProduct:i}=e,{attrs:a={},selCtx:o,kind:s}=n,{isMenuProductToShow:u,isMenuOptionsToShow:f}=Gh(),{MenuItemsUI:c}=Yr(),d={productItems:t,parentProduct:n,renderMenuItem:g=>f(g)?A(Mh,{optionsItem:g,parentSelCtx:o,parentKind:s,nestedLvl:r,rootProduct:i}):u(g)?A(Hh,{product:g,parentAttrs:a,parentProduct:n,nestedLvl:r,rootProduct:i}):A(Ke,{}),rootProduct:i};return c?A(c,{...d}):A(Kh,{...d})}function Kh(e){const{productItems:t,parentProduct:r,renderMenuItem:n}=e,i=r.kind!==We.PRODUCT,a=99,o=3,[s,u]=S.useState(i?o:a),{t:f}=oi(),c=()=>{u(a)},l=()=>{u(o)};return A(Ke,{children:t.map((d,g)=>{if(g<s)return U("div",{children:[n(d),s===a&&i&&t.length===g+1&&Ka(f("OS.ProductConfigurator.ShowLess"),l,!1)]},`${r.id}--${d.id}--${g}`);if(g===s)return Ka(f("OS.ProductConfigurator.ShowMore"),c,!0)})})}const Ka=(e,t,r)=>A("div",{className:"flex justify-center w-full",children:U("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:t,children:[e,U("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}`),Ns=()=>{const{watch:e}=ze(),t=e("selected"),r=e("filter"),n=e("filterWithCnt"),i=oe(a=>a.validationMap);return console.log({selected:t,validationMap:i,filter:r,filterWithCnt:n}),U("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&&U(Ke,{children:[U("p",{className:"text-lg font-semibold",children:[a,":"]}),Object.keys(t[a]).map(o=>A(T.default.Fragment,{children:t[a][o]&&U("p",{children:[o,":",t[a][o].toString()]})},o))]})},a))]})};function Ya(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:n,displayPriceFrom:i=!1,productQuantity:a,increaseProductQuantity:o,decreaseProductQuantity:s,handleOnSubmit:u}=e,{t:f}=oi();return U("div",{className:"flex items-center justify-around w-full h-16 px-4",children:[r&&U("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:[U("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(Ts,{value:a,add:o,subtract:s,disabledSubtract:a===1,size:"lg"})}),U("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:[U("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 dr=640,Is=e=>{const{isModal:t=!1}=e,[r,n]=S.useState(window.innerWidth),[i,a]=S.useState(window.innerHeight),[o,s]=S.useState(window.innerWidth<=dr),[u,f]=S.useState(window.innerWidth>dr&&!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>dr&&!t),s(window.innerWidth<=dr)},[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 Wt(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=$s(e))&&(n&&(n+=" "),n+=t);return n}var Yh=Object.defineProperty,zh=(e,t,r)=>t in e?Yh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yn=(e,t,r)=>(zh(e,typeof t!="symbol"?t+"":t,r),r);class Qh{constructor(){yn(this,"current",this.detect()),yn(this,"handoffState","pending"),yn(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 Ze=new Qh,$e=(e,t)=>{Ze.isServer?S.useEffect(e,t):S.useLayoutEffect(e,t)};function Xe(e){let t=S.useRef(e);return $e(()=>{t.current=e},[e]),t}let ne=function(e){let t=Xe(e);return T.default.useCallback((...r)=>t.current(...r),[t])};function zr(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Et(){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 zr(()=>{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=Et();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 ui(){let[e]=S.useState(Et);return S.useEffect(()=>()=>e.dispose(),[e]),e}function qh(){let e=typeof document=="undefined";return"useSyncExternalStore"in ut?(t=>t.useSyncExternalStore)(ut)(()=>()=>{},()=>!1,()=>!e):!1}function Rt(){let e=qh(),[t,r]=ut.useState(Ze.isHandoffComplete);return t&&Ze.isHandoffComplete===!1&&r(!1),ut.useEffect(()=>{t!==!0&&r(!0)},[t]),ut.useEffect(()=>Ze.handoff(),[]),e?!1:t}var za;let Ft=(za=T.default.useId)!=null?za:function(){let e=Rt(),[t,r]=T.default.useState(e?()=>Ze.nextId():null);return $e(()=>{t===null&&r(Ze.nextId())},[t]),t!=null?""+t:void 0};function be(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,be),n}function Ls(e){return Ze.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let kn=["[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 pt=(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))(pt||{}),Rs=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Rs||{}),Jh=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Jh||{});function Zh(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(kn)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var Fs=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Fs||{});function Xh(e,t=0){var r;return e===((r=Ls(e))==null?void 0:r.body)?!1:be(t,{[0](){return e.matches(kn)},[1](){let n=e;for(;n!==null;){if(n.matches(kn))return!0;n=n.parentElement}return!1}})}var em=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(em||{});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 vt(e){e==null||e.focus({preventScroll:!0})}let tm=["textarea","input"].join(",");function rm(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,tm))!=null?r:!1}function nm(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 br(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?nm(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&&rm(d)&&d.select(),2}function Ms(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function im(){return/Android/gi.test(window.navigator.userAgent)}function am(){return Ms()||im()}function gr(e,t,r){let n=Xe(t);S.useEffect(()=>{function i(a){n.current(a)}return document.addEventListener(e,i,r),()=>document.removeEventListener(e,i,r)},[e,r])}function ks(e,t,r){let n=Xe(t);S.useEffect(()=>{function i(a){n.current(a)}return window.addEventListener(e,i,r),()=>window.removeEventListener(e,i,r)},[e,r])}function om(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!Xh(u,Fs.Loose)&&u.tabIndex!==-1&&o.preventDefault(),t(o,u)}let a=S.useRef(null);gr("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),gr("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),gr("click",o=>{am()||a.current&&(i(o,()=>a.current),a.current=null)},!0),gr("touchend",o=>i(o,()=>o.target instanceof HTMLElement?o.target:null),!0),ks("blur",o=>i(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function ar(...e){return S.useMemo(()=>Ls(...e),[...e])}let Ds=Symbol();function sm(e,t=!0){return Object.assign(e,{[Ds]:t})}function je(...e){let t=S.useRef(e);S.useEffect(()=>{t.current=e},[e]);let r=ne(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[Ds]))?void 0:r}function li(e,t){let r=S.useRef([]),n=ne(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 $r(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Lr=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Lr||{}),st=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(st||{});function Fe({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:a=!0,name:o,mergeRefs:s}){s=s!=null?s:um;let u=js(t,e);if(a)return pr(u,r,n,o,s);let f=i!=null?i:0;if(f&2){let{static:c=!1,...l}=u;if(c)return pr(l,r,n,o,s)}if(f&1){let{unmount:c=!0,...l}=u;return be(c?0:1,{[0](){return null},[1](){return pr({...l,hidden:!0,style:{display:"none"}},r,n,o,s)}})}return pr(u,r,n,o,s)}function pr(e,t={},r,n,i){let{as:a=r,children:o,refName:s="ref",...u}=bn(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,b]of Object.entries(t))typeof b=="boolean"&&(d=!0),b===!0&&g.push(p);d&&(l["data-headlessui-state"]=g.join(" "))}if(a===S.Fragment&&Object.keys(Qa(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(b=>` - ${b}`).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(b=>` - ${b}`).join(`
|
|
13
13
|
`)].join(`
|
|
14
|
-
`));let d=c.props,g=typeof(d==null?void 0:d.className)=="function"?(...y)=>$r(d==null?void 0:d.className(...y),u.className):$r(d==null?void 0:d.className,u.className),p=g?{className:g}:{};return S.cloneElement(c,Object.assign({},js(c.props,qa(bn(u,["ref"]))),l,f,{ref:i(c.ref,f.ref)},p))}return S.createElement(a,Object.assign({},bn(u,["ref"]),a!==S.Fragment&&f,a!==S.Fragment&&l),c)}function um(...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 js(...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 Te(e){var t;return Object.assign(S.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function qa(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function bn(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}let lm="div";var Rr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Rr||{});function cm(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 Fe({ourProps:a,theirProps:i,slot:{},defaultTag:lm,name:"Hidden"})}let Dn=Te(cm),ci=S.createContext(null);ci.displayName="OpenClosedContext";var _e=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(_e||{});function fi(){return S.useContext(ci)}function fm({value:e,children:t}){return T.default.createElement(ci.Provider,{value:e},t)}function dm(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window!="undefined"&&typeof document!="undefined"&&(document.addEventListener("DOMContentLoaded",t),t())}let at=[];dm(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&at[0]!==t.target&&(at.unshift(t.target),at=at.filter(r=>r!=null&&r.isConnected),at.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 gm(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&&pm(r)?!1:n}function pm(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}var Vs=(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))(Vs||{});function Us(e,t,r,n){let i=Xe(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 or(){let e=S.useRef(!1);return $e(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Bs(e){let t=ne(e),r=S.useRef(!1);S.useEffect(()=>(r.current=!1,()=>{r.current=!0,zr(()=>{r.current&&t()})}),[t])}var zt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(zt||{});function hm(){let e=S.useRef(0);return ks("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Hs(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 mm="div";var Ws=(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))(Ws||{});function vm(e,t){let r=S.useRef(null),n=je(r,t),{initialFocus:i,containers:a,features:o=30,...s}=e;Rt()||(o=1);let u=ar(r);Sm({ownerDocument:u},Boolean(o&16));let f=Om({ownerDocument:u,container:r,initialFocus:i},Boolean(o&2));wm({ownerDocument:u,container:r,containers:a,previousActiveElement:f},Boolean(o&8));let c=hm(),l=ne(y=>{let v=r.current;!v||(b=>b())(()=>{be(c.current,{[zt.Forwards]:()=>{br(v,pt.First,{skipElements:[y.relatedTarget]})},[zt.Backwards]:()=>{br(v,pt.Last,{skipElements:[y.relatedTarget]})}})})}),d=ui(),g=S.useRef(!1),p={ref:n,onKeyDown(y){y.key=="Tab"&&(g.current=!0,d.requestAnimationFrame(()=>{g.current=!1}))},onBlur(y){let v=Hs(a);r.current instanceof HTMLElement&&v.add(r.current);let b=y.relatedTarget;b instanceof HTMLElement&&b.dataset.headlessuiFocusGuard!=="true"&&(Gs(v,b)||(g.current?br(r.current,be(c.current,{[zt.Forwards]:()=>pt.Next,[zt.Backwards]:()=>pt.Previous})|pt.WrapAround,{relativeTo:y.target}):y.target instanceof HTMLElement&&vt(y.target)))}};return T.default.createElement(T.default.Fragment,null,Boolean(o&4)&&T.default.createElement(Dn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:l,features:Rr.Focusable}),Fe({ourProps:p,theirProps:s,defaultTag:mm,name:"FocusTrap"}),Boolean(o&4)&&T.default.createElement(Dn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:l,features:Rr.Focusable}))}let ym=Te(vm),Gt=Object.assign(ym,{features:Ws});function bm(e=!0){let t=S.useRef(at.slice());return li(([r],[n])=>{n===!0&&r===!1&&zr(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=at.slice())},[e,at,t]),ne(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function Sm({ownerDocument:e},t){let r=bm(t);li(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&vt(r())},[t]),Bs(()=>{t&&vt(r())})}function Om({ownerDocument:e,container:t,initialFocus:r},n){let i=S.useRef(null),a=or();return li(()=>{if(!n)return;let o=t.current;o&&zr(()=>{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?vt(r.current):br(o,pt.First)===Rs.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=e==null?void 0:e.activeElement})},[n]),i}function wm({ownerDocument:e,container:t,containers:r,previousActiveElement:n},i){let a=or();Us(e==null?void 0:e.defaultView,"focus",o=>{if(!i||!a.current)return;let s=Hs(r);t.current instanceof HTMLElement&&s.add(t.current);let u=n.current;if(!u)return;let f=o.target;f&&f instanceof HTMLElement?Gs(s,f)?(n.current=f,vt(f)):(o.preventDefault(),o.stopPropagation(),vt(u)):vt(n.current)},!0)}function Gs(e,t){for(let r of e)if(r.contains(t))return!0;return!1}let Ks=S.createContext(!1);function Em(){return S.useContext(Ks)}function jn(e){return T.default.createElement(Ks.Provider,{value:e.force},e.children)}function Pm(e){let t=Em(),r=S.useContext(Ys),n=ar(e),[i,a]=S.useState(()=>{if(!t&&r!==null||Ze.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 xm=S.Fragment;function Am(e,t){let r=e,n=S.useRef(null),i=je(sm(c=>{n.current=c}),t),a=ar(n),o=Pm(n),[s]=S.useState(()=>{var c;return Ze.isServer?null:(c=a==null?void 0:a.createElement("div"))!=null?c:null}),u=S.useContext(Vn),f=Rt();return $e(()=>{!o||!s||o.contains(s)||(s.setAttribute("data-headlessui-portal",""),o.appendChild(s))},[o,s]),$e(()=>{if(s&&u)return u.register(s)},[u,s]),Bs(()=>{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:iu.createPortal(Fe({ourProps:{ref:i},theirProps:r,defaultTag:xm,name:"Portal"}),s):null}let Cm=S.Fragment,Ys=S.createContext(null);function _m(e,t){let{target:r,...n}=e,i={ref:je(t)};return T.default.createElement(Ys.Provider,{value:r},Fe({ourProps:i,theirProps:n,defaultTag:Cm,name:"Popover.Group"}))}let Vn=S.createContext(null);function Tm(){let e=S.useContext(Vn),t=S.useRef([]),r=ne(a=>(t.current.push(a),e&&e.register(a),()=>n(a))),n=ne(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(Vn.Provider,{value:i},a)},[i])]}let Nm=Te(Am),Im=Te(_m),Un=Object.assign(Nm,{Group:Im});function $m(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const Lm=typeof Object.is=="function"?Object.is:$m,{useState:Rm,useEffect:Fm,useLayoutEffect:Mm,useDebugValue:km}=ut;function Dm(e,t,r){const n=t(),[{inst:i},a]=Rm({inst:{value:n,getSnapshot:t}});return Mm(()=>{i.value=n,i.getSnapshot=t,Sn(i)&&a({inst:i})},[e,n,t]),Fm(()=>(Sn(i)&&a({inst:i}),e(()=>{Sn(i)&&a({inst:i})})),[e]),km(n),n}function Sn(e){const t=e.getSnapshot,r=e.value;try{const n=t();return!Lm(r,n)}catch{return!0}}function jm(e,t,r){return t()}const Vm=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",Um=!Vm,Bm=Um?jm:Dm,Hm="useSyncExternalStore"in ut?(e=>e.useSyncExternalStore)(ut):Bm;function Wm(e){return Hm(e.subscribe,e.getSnapshot,e.getSnapshot)}function Gm(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 Km(){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 Ym(){return Ms()?{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=Et();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 zm(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function qm(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let mt=Gm(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:Et(),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:qm(r)},i=[Ym(),Km(),zm()];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)}});mt.subscribe(()=>{let e=mt.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)&&mt.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&mt.dispatch("TEARDOWN",r)}});function Qm(e,t,r){let n=Wm(mt),i=e?n.get(e):void 0,a=i?i.count>0:!1;return $e(()=>{if(!(!e||!t))return mt.dispatch("PUSH",e,r),()=>mt.dispatch("POP",e,r)},[t,e]),a}let On=new Map,Kt=new Map;function Qa(e,t=!0){$e(()=>{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=Kt.get(n))!=null?o:1;if(s===1?Kt.delete(n):Kt.set(n,s-1),s!==1)return;let u=On.get(n);u&&(u["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",u["aria-hidden"]),n.inert=u.inert,On.delete(n))}let a=(r=Kt.get(n))!=null?r:0;return Kt.set(n,a+1),a!==0||(On.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0),i},[e,t])}function Jm({defaultContainers:e=[],portals:t,mainTreeNodeRef:r}={}){var n;let i=S.useRef((n=r==null?void 0:r.current)!=null?n:null),a=ar(i),o=ne(()=>{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:ne(s=>o().some(u=>u.contains(s))),mainTreeNodeRef:i,MainTreeNode:S.useMemo(()=>function(){return r!=null?null:T.default.createElement(Dn,{features:Rr.Hidden,ref:i})},[i,r])}}let di=S.createContext(()=>{});di.displayName="StackContext";var Bn=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Bn||{});function Zm(){return S.useContext(di)}function Xm({children:e,onUpdate:t,type:r,element:n,enabled:i}){let a=Zm(),o=ne((...s)=>{t==null||t(...s),a(...s)});return $e(()=>{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(di.Provider,{value:o},e)}let zs=S.createContext(null);function qs(){let e=S.useContext(zs);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,qs),t}return e}function ev(){let[e,t]=S.useState([]);return[e.length>0?e.join(" "):void 0,S.useMemo(()=>function(r){let n=ne(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(zs.Provider,{value:i},r.children)},[t])]}let tv="p";function rv(e,t){let r=Ft(),{id:n=`headlessui-description-${r}`,...i}=e,a=qs(),o=je(t);$e(()=>a.register(n),[n,a.register]);let s={ref:o,...a.props,id:n};return Fe({ourProps:s,theirProps:i,slot:a.slot||{},defaultTag:tv,name:a.name||"Description"})}let nv=Te(rv),iv=Object.assign(nv,{});var av=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(av||{}),ov=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(ov||{});let sv={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Fr=S.createContext(null);Fr.displayName="DialogContext";function sr(e){let t=S.useContext(Fr);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,sr),r}return t}function uv(e,t,r=()=>[document.body]){Qm(e,t,n=>{var i;return{containers:[...(i=n.containers)!=null?i:[],r]}})}function lv(e,t){return be(t.type,sv,e,t)}let cv="div",fv=Lr.RenderStrategy|Lr.Static;function dv(e,t){let r=Ft(),{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=fi();i===void 0&&g!==null&&(i=(g&_e.Open)===_e.Open);let p=S.useRef(null),y=je(p,t),v=ar(p),b=e.hasOwnProperty("open")||g!==null,m=e.hasOwnProperty("onClose");if(!b&&!m)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(!m)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(lv,{titleId:null,descriptionId:null,panelRef:S.createRef()}),x=ne(()=>a(!1)),_=ne(B=>w({type:0,id:B})),$=Rt()?u?!1:E===0:!1,F=c>1,k=S.useContext(Fr)!==null,[H,M]=Tm(),j={get current(){var B;return(B=C.panelRef.current)!=null?B:p.current}},{resolveContainers:V,mainTreeNodeRef:W,MainTreeNode:X}=Jm({portals:H,defaultContainers:[j]}),G=F?"parent":"leaf",he=g!==null?(g&_e.Closing)===_e.Closing:!1,ye=(()=>k||he?!1:$)(),K=S.useCallback(()=>{var B,me;return(me=Array.from((B=v==null?void 0:v.querySelectorAll("body > *"))!=null?B:[]).find(le=>le.id==="headlessui-portal-root"?!1:le.contains(W.current)&&le instanceof HTMLElement))!=null?me:null},[W]);Qa(K,ye);let ie=(()=>F?!0:$)(),ae=S.useCallback(()=>{var B,me;return(me=Array.from((B=v==null?void 0:v.querySelectorAll("[data-headlessui-portal]"))!=null?B:[]).find(le=>le.contains(W.current)&&le instanceof HTMLElement))!=null?me:null},[W]);Qa(ae,ie);let se=(()=>!(!$||F))();om(V,B=>{B.preventDefault(),x()},se);let q=(()=>!(F||E!==0))();Us(v==null?void 0:v.defaultView,"keydown",B=>{q&&(B.defaultPrevented||B.key===Vs.Escape&&(B.preventDefault(),B.stopPropagation(),x()))});let xe=(()=>!(he||E!==0||k))();uv(v,xe,V),S.useEffect(()=>{if(E!==0||!p.current)return;let B=new ResizeObserver(me=>{for(let le of me){let Ae=le.target.getBoundingClientRect();Ae.x===0&&Ae.y===0&&Ae.width===0&&Ae.height===0&&x()}});return B.observe(p.current),()=>B.disconnect()},[E,p,x]);let[re,Q]=ev(),ue=S.useMemo(()=>[{dialogState:E,close:x,setTitleId:_},C],[E,C,x,_]),ce=S.useMemo(()=>({open:E===0}),[E]),ve={ref:y,id:n,role:s,"aria-modal":E===0?!0:void 0,"aria-labelledby":C.titleId,"aria-describedby":re};return T.default.createElement(Xm,{type:"Dialog",enabled:E===0,element:p,onUpdate:ne((B,me)=>{me==="Dialog"&&be(B,{[Bn.Add]:()=>l(le=>le+1),[Bn.Remove]:()=>l(le=>le-1)})})},T.default.createElement(jn,{force:!0},T.default.createElement(Un,null,T.default.createElement(Fr.Provider,{value:ue},T.default.createElement(Un.Group,{target:p},T.default.createElement(jn,{force:!1},T.default.createElement(Q,{slot:ce,name:"Dialog.Description"},T.default.createElement(Gt,{initialFocus:o,containers:V,features:$?be(G,{parent:Gt.features.RestoreFocus,leaf:Gt.features.All&~Gt.features.FocusLock}):Gt.features.None},T.default.createElement(M,null,Fe({ourProps:ve,theirProps:f,slot:ce,defaultTag:cv,features:fv,visible:E===0,name:"Dialog"}))))))))),T.default.createElement(X,null))}let gv="div";function pv(e,t){let r=Ft(),{id:n=`headlessui-dialog-overlay-${r}`,...i}=e,[{dialogState:a,close:o}]=sr("Dialog.Overlay"),s=je(t),u=ne(c=>{if(c.target===c.currentTarget){if(gm(c.currentTarget))return c.preventDefault();c.preventDefault(),c.stopPropagation(),o()}}),f=S.useMemo(()=>({open:a===0}),[a]);return Fe({ourProps:{ref:s,id:n,"aria-hidden":!0,onClick:u},theirProps:i,slot:f,defaultTag:gv,name:"Dialog.Overlay"})}let hv="div";function mv(e,t){let r=Ft(),{id:n=`headlessui-dialog-backdrop-${r}`,...i}=e,[{dialogState:a},o]=sr("Dialog.Backdrop"),s=je(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(jn,{force:!0},T.default.createElement(Un,null,Fe({ourProps:{ref:s,id:n,"aria-hidden":!0},theirProps:i,slot:u,defaultTag:hv,name:"Dialog.Backdrop"})))}let vv="div";function yv(e,t){let r=Ft(),{id:n=`headlessui-dialog-panel-${r}`,...i}=e,[{dialogState:a},o]=sr("Dialog.Panel"),s=je(t,o.panelRef),u=S.useMemo(()=>({open:a===0}),[a]),f=ne(c=>{c.stopPropagation()});return Fe({ourProps:{ref:s,id:n,onClick:f},theirProps:i,slot:u,defaultTag:vv,name:"Dialog.Panel"})}let bv="h2";function Sv(e,t){let r=Ft(),{id:n=`headlessui-dialog-title-${r}`,...i}=e,[{dialogState:a,setTitleId:o}]=sr("Dialog.Title"),s=je(t);S.useEffect(()=>(o(n),()=>o(null)),[n,o]);let u=S.useMemo(()=>({open:a===0}),[a]);return Fe({ourProps:{ref:s,id:n},theirProps:i,slot:u,defaultTag:bv,name:"Dialog.Title"})}let Ov=Te(dv),wv=Te(mv),Ev=Te(yv),Pv=Te(pv),xv=Te(Sv),Ja=Object.assign(Ov,{Backdrop:wv,Panel:Ev,Overlay:Pv,Title:xv,Description:iv});function Av(e=0){let[t,r]=S.useState(e),n=or(),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 Cv(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function wn(e,...t){e&&t.length>0&&e.classList.add(...t)}function En(e,...t){e&&t.length>0&&e.classList.remove(...t)}function _v(e,t){let r=Et();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 Tv(e,t,r,n){let i=r?"enter":"leave",a=Et(),o=n!==void 0?Cv(n):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=be(i,{enter:()=>t.enter,leave:()=>t.leave}),u=be(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),f=be(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return En(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),wn(e,...t.base,...s,...f),a.nextFrame(()=>{En(e,...t.base,...s,...f),wn(e,...t.base,...s,...u),_v(e,()=>(En(e,...t.base,...s),wn(e,...t.base,...t.entered),o()))}),a.dispose}function Nv({immediate:e,container:t,direction:r,classes:n,onStart:i,onStop:a}){let o=or(),s=ui(),u=Xe(r);$e(()=>{e&&(u.current="enter")},[e]),$e(()=>{let f=Et();s.add(f.dispose);let c=t.current;if(c&&u.current!=="idle"&&o.current)return f.dispose(),i.current(u.current),f.add(Tv(c,n.current,u.current==="enter",()=>{f.dispose(),a.current(u.current)})),f.dispose},[r])}function it(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let qr=S.createContext(null);qr.displayName="TransitionContext";var Iv=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Iv||{});function $v(){let e=S.useContext(qr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Lv(){let e=S.useContext(Qr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Qr=S.createContext(null);Qr.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 Qs(e,t){let r=Xe(e),n=S.useRef([]),i=or(),a=ui(),o=ne((g,p=st.Hidden)=>{let y=n.current.findIndex(({el:v})=>v===g);y!==-1&&(be(p,{[st.Unmount](){n.current.splice(y,1)},[st.Hidden](){n.current[y].state="hidden"}}),a.microTask(()=>{var v;!Jr(n)&&i.current&&((v=r.current)==null||v.call(r))}))}),s=ne(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,st.Unmount)}),u=S.useRef([]),f=S.useRef(Promise.resolve()),c=S.useRef({enter:[],leave:[],idle:[]}),l=ne((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,m])=>m)).then(()=>v())})]),p==="enter"?f.current=f.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(p)):y(p)}),d=ne((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 Rv(){}let Fv=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Za(e){var t;let r={};for(let n of Fv)r[n]=(t=e[n])!=null?t:Rv;return r}function Mv(e){let t=S.useRef(Za(e));return S.useEffect(()=>{t.current=Za(e)},[e]),t}let kv="div",Js=Lr.RenderStrategy;function Dv(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=je(v,t),m=(r=y.unmount)==null||r?st.Unmount:st.Hidden,{show:E,appear:C,initial:w}=$v(),[x,_]=S.useState(E?"visible":"hidden"),$=Lv(),{register:F,unregister:k}=$;S.useEffect(()=>F(v),[F,v]),S.useEffect(()=>{if(m===st.Hidden&&v.current){if(E&&x!=="visible"){_("visible");return}return be(x,{hidden:()=>k(v),visible:()=>F(v)})}},[x,v,F,k,E,m]);let H=Xe({base:it(y.className),enter:it(u),enterFrom:it(f),enterTo:it(c),entered:it(l),leave:it(d),leaveFrom:it(g),leaveTo:it(p)}),M=Mv({beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s}),j=Rt();S.useEffect(()=>{if(j&&x==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,x,j]);let V=w&&!C,W=C&&E&&w,X=(()=>!j||V?"idle":E?"enter":"leave")(),G=Av(0),he=ne(q=>be(q,{enter:()=>{G.addFlag(_e.Opening),M.current.beforeEnter()},leave:()=>{G.addFlag(_e.Closing),M.current.beforeLeave()},idle:()=>{}})),ye=ne(q=>be(q,{enter:()=>{G.removeFlag(_e.Opening),M.current.afterEnter()},leave:()=>{G.removeFlag(_e.Closing),M.current.afterLeave()},idle:()=>{}})),K=Qs(()=>{_("hidden"),k(v)},$),ie=S.useRef(!1);Nv({immediate:W,container:v,classes:H,direction:X,onStart:Xe(q=>{ie.current=!0,K.onStart(v,q,he)}),onStop:Xe(q=>{ie.current=!1,K.onStop(v,q,ye),q==="leave"&&!Jr(K)&&(_("hidden"),k(v))})});let ae=y,se={ref:b};return W?ae={...ae,className:$r(y.className,...H.current.enter,...H.current.enterFrom)}:ie.current&&(ae.className=$r(y.className,(n=v.current)==null?void 0:n.className),ae.className===""&&delete ae.className),T.default.createElement(Qr.Provider,{value:K},T.default.createElement(fm,{value:be(x,{visible:_e.Open,hidden:_e.Closed})|G.flags},Fe({ourProps:se,theirProps:ae,defaultTag:kv,features:Js,visible:x==="visible",name:"Transition.Child"})))}function jv(e,t){let{show:r,appear:n=!1,unmount:i=!0,...a}=e,o=S.useRef(null),s=je(o,t);Rt();let u=fi();if(r===void 0&&u!==null&&(r=(u&_e.Open)===_e.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=Qs(()=>{c("hidden")}),[d,g]=S.useState(!0),p=S.useRef([r]);$e(()=>{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(!Jr(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=ne(()=>{var E;d&&g(!1),(E=e.beforeEnter)==null||E.call(e)}),m=ne(()=>{var E;d&&g(!1),(E=e.beforeLeave)==null||E.call(e)});return T.default.createElement(Qr.Provider,{value:l},T.default.createElement(qr.Provider,{value:y},Fe({ourProps:{...v,as:S.Fragment,children:T.default.createElement(Zs,{ref:s,...v,...a,beforeEnter:b,beforeLeave:m})},theirProps:{},defaultTag:S.Fragment,features:Js,visible:f==="visible",name:"Transition"})))}function Vv(e,t){let r=S.useContext(qr)!==null,n=fi()!==null;return T.default.createElement(T.default.Fragment,null,!r&&n?T.default.createElement(Hn,{ref:t,...e}):T.default.createElement(Zs,{ref:t,...e}))}let Hn=Te(jv),Zs=Te(Dv),Uv=Te(Vv),Pn=Object.assign(Hn,{Child:Uv,Root:Hn});function Bv(e){const{children:t,isOpen:r,handleClose:n}=e,{isMobile:i}=Is({isModal:!0});return A(Ke,{children:A(Pn,{appear:!0,show:r,as:S.Fragment,children:A(Ja,{as:"div",className:"fixed inset-0 z-10 overflow-y-auto",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:n,children:U("div",{className:"min-h-screen text-center sm:px-4",children:[A(Pn.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(Ja.Overlay,{className:"fixed inset-0"})}),A("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),A(Pn.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:U("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:U("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 Hv(e){var V,W,X,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 he=setTimeout(()=>{w||y(2)},250);return()=>{clearTimeout(he)}},[]);const{displayPriceFrom:v,formattedEndPrice:b}=Qp(a,l,o),m=S.useRef(),E=S.useRef(),{isSm:C,isMobile:w,windowHeight:x}=Is({isModal:!0}),_=U(Ke,{children:[U("div",{className:Wt("px-4 w-full",C&&"sm:sticky sm:top-0 sm:w-2/5"),ref:m,children:[t.details.media&&t.details.media[0].url&&A("img",{className:Wt("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:Wt(!i&&"hidden"),children:A(Ns,{})})]}),U("div",{className:Wt("w-full",C&&"sm:w-3/5"),ref:E,children:[U("div",{className:"items-center w-full p-4",children:[U("div",{className:"flex justify-between w-full mb-4 text-2xl font-semibold",children:[U("span",{className:"",children:[t.details.literals.name," "]}),A(Kr,{price:e.countedProductPrice,minPrice:l})]}),A("span",{className:"text-gray-600",children:(W=t.details.literals)==null?void 0:W.description})]}),U("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(Ya,{finalPrice:b,isBackIcon:!1,handleGoBack:n,displayPriceFrom:v})})]})]}),$=(X=m==null?void 0:m.current)==null?void 0:X.clientHeight,F=(G=E==null?void 0:E.current)==null?void 0:G.clientHeight,k=$+F;k>window.innerHeight*.8||isNaN(k)?d!=="80vh"&&g("80vh"):d!=="auto"&&g("auto");const H=`${x-64-56}px`,M=!C,j={"--mobile-submit-row-top":`${x-64-80}px`};return A(Bv,{isOpen:Boolean(r),handleClose:n,children:U("div",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},children:[A("div",{className:Wt("flex relative flex-col items-start w-full form-body stretch",!M&&"sm:flex-row-reverse sm:pb-0",!w&&"mobile-scrollbar"),style:{height:`${w?H:d}`,minHeight:"400px",overflowY:"scroll"},children:_}),M&&A("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${w?"submit-row-mobile":"submit-row"}`,style:j,children:A(Ya,{handleGoBack:n,finalPrice:b,isBackIcon:!1,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:f})})]})})}const gi=(e,t={},r,n,i=0)=>{var o,s;const a=n||{};return(i===0||((o=t[e.selCtx])==null?void 0:o[e.id]))&&((s=e==null?void 0:e.items)==null||s.forEach(u=>{var f,c,l,d,g,p,y,v,b,m,E,C,w,x,_,$;if(u.kind===We.OPTIONS&&(((f=u.attrs)==null?void 0:f.vital)||((c=u==null?void 0:u.attrs)==null?void 0:c.selMin)||((l=u.attrs)==null?void 0:l.selMax)||((d=u.attrs)==null?void 0:d.qtyMin)||((g=u.attrs)==null?void 0:g.qtyMax)||((p=u.attrs)==null?void 0:p.allowMultiple))){const[F,k]=ms(u.selCtx,t,u.items),H=Hr(e,r);a[u.selCtx]={isSelCntAllowedToIncrement:F<Number(((y=u==null?void 0:u.attrs)==null?void 0:y.selMax)||Number.MAX_SAFE_INTEGER),isQtyCntAllowedToIncrement:k<Number(((v=u==null?void 0:u.attrs)==null?void 0:v.qtyMax)||Number.MAX_SAFE_INTEGER),nestedLvl:i,isPassedFiltering:H,isValid:Nr(F,Number(((b=u.attrs)==null?void 0:b.selMin)||0),Number(((m=u.attrs)==null?void 0:m.selMax)||Number.MAX_SAFE_INTEGER)+1)&&Nr(k,Number(((E=u.attrs)==null?void 0:E.qtyMin)||0),Number(((C=u.attrs)==null?void 0:C.qtyMax)||Number.MAX_SAFE_INTEGER)+1)&&(((w=u.attrs)==null?void 0:w.vital)!==!0||F>0)&&(((x=u.attrs)==null?void 0:x.allowMultiple)===!0||k-F===0)}}(u==null?void 0:u.items)&&((_=u.items)==null?void 0:_.length)>0&&(($=u.items)==null||$.forEach(F=>{gi(F,t,r,a,i+1)}))})),a},Xs=T.default.createContext(null);function Wv({rootProduct:e,children:t}){return A(Xs.Provider,{value:{rootProduct:e},children:t})}function Gv(e){const t=S.useContext(Xs),r=Er({name:"selected"}),n=Er({name:"filter"}),[i,a]=S.useState(void 0);if(!t)throw new Error("Missing ComponentsContext");return S.useEffect(()=>{console.log("useGroupsValidation validationMap2 change")},[i]),S.useEffect(()=>{const o=gi(e,r,n);Xg(o,i)||a(o)},[r,n]),{validationMap2:i}}const Kv=e=>{const{product:t}=e,{MenuProductRootUI:r}=Yr(),{validationMap2:n}=Gv(t),i=De(t.items)?A(Ke,{}):A(si,{productItems:t.items,parentProduct:t,rootProduct:t});return r?A(r,{...e,validationMap:n||{},children:i}):A(Hv,{...e,validationMap:n||{},children:i})};const eu=T.default.createContext(null);function Yv({rootProduct:e,children:t}){return A(eu.Provider,{value:{rootProduct:e},children:t})}function zv(){const e=S.useContext(eu);if(!e)throw new Error("Missing ComponentsContext");return e}function qv(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,increaseProductQuantity:v,decreaseProductQuantity:b,setCurrency:m}=Sp(t);S.useEffect(()=>{Se.changeLanguage(r)},[r]),S.useEffect(()=>{m(s)},[s]);const E=Co({defaultValues:{selected:l,filter:d}}),{getValues:C}=E,w=Number((parseFloat(f||"0")+Jn(C("selected"),c)).toFixed(2)),x=()=>{var k;p();const $=gi(t,C("selected"),C("filter"));if(console.log("onSubmit product-configurator",$),Object.keys($).some(function(H){return $[H].isValid===!1}))console.warn("INVALID VALIDATION MAP product-configurator",$);else{console.log("selected",C("selected"));const H=op(ds(C("selected"))),M=C("filter");(k=Object.keys(H||{}))==null||k.forEach(j=>{const V=ps(j,t);V&&(Hr(V,M)||delete H[j])}),console.log("decodedCleanedSelected product-configurator: ",H),n({price:w,quantity:g,selected:H,filter:M})}},_=()=>x();return A(Ke,{children:A(Yv,{rootProduct:t,children:A(_s.Provider,{value:e.components,children:A(fo,{...E,children:U("form",{children:[u&&A("div",{className:"hidden",children:A(Ns,{})}),A(Wv,{rootProduct:c,children:A(Kv,{product:c,productQuantity:g,isOpen:a,handleClose:o,handleGoBack:i,handleOnSubmit:_,countedProductPrice:w,countedProductTotalPrice:w*g,increaseProductQuantity:v,decreaseProductQuantity:b,currency:s})})]})})})})})}exports.ContextType=qn;exports.MainView=_o;exports.ProductConfigurator=qv;exports.ProductKinds=Qn;exports.ProductTypes=To;exports.SelMinSelMaxStatus=Ie;exports.getProductToChangeInForm=ys;exports.hookForm=rl;exports.selectProductsInForm=bs;exports.unselectProductsInForm=Op;exports.useMenuOptions=Ss;exports.useProductData=zv;exports.useStore=oe;exports.validateProductFilter=Hr;
|
|
14
|
+
`));let d=c.props,g=typeof(d==null?void 0:d.className)=="function"?(...b)=>$r(d==null?void 0:d.className(...b),u.className):$r(d==null?void 0:d.className,u.className),p=g?{className:g}:{};return S.cloneElement(c,Object.assign({},js(c.props,Qa(bn(u,["ref"]))),l,f,{ref:i(c.ref,f.ref)},p))}return S.createElement(a,Object.assign({},bn(u,["ref"]),a!==S.Fragment&&f,a!==S.Fragment&&l),c)}function um(...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 js(...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 Te(e){var t;return Object.assign(S.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Qa(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function bn(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}let lm="div";var Rr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Rr||{});function cm(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 Fe({ourProps:a,theirProps:i,slot:{},defaultTag:lm,name:"Hidden"})}let Dn=Te(cm),ci=S.createContext(null);ci.displayName="OpenClosedContext";var _e=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(_e||{});function fi(){return S.useContext(ci)}function fm({value:e,children:t}){return T.default.createElement(ci.Provider,{value:e},t)}function dm(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window!="undefined"&&typeof document!="undefined"&&(document.addEventListener("DOMContentLoaded",t),t())}let at=[];dm(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&at[0]!==t.target&&(at.unshift(t.target),at=at.filter(r=>r!=null&&r.isConnected),at.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 gm(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&&pm(r)?!1:n}function pm(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}var Vs=(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))(Vs||{});function Us(e,t,r,n){let i=Xe(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 or(){let e=S.useRef(!1);return $e(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Bs(e){let t=ne(e),r=S.useRef(!1);S.useEffect(()=>(r.current=!1,()=>{r.current=!0,zr(()=>{r.current&&t()})}),[t])}var zt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(zt||{});function hm(){let e=S.useRef(0);return ks("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Hs(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 mm="div";var Ws=(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))(Ws||{});function vm(e,t){let r=S.useRef(null),n=je(r,t),{initialFocus:i,containers:a,features:o=30,...s}=e;Rt()||(o=1);let u=ar(r);Sm({ownerDocument:u},Boolean(o&16));let f=Om({ownerDocument:u,container:r,initialFocus:i},Boolean(o&2));wm({ownerDocument:u,container:r,containers:a,previousActiveElement:f},Boolean(o&8));let c=hm(),l=ne(b=>{let v=r.current;!v||(y=>y())(()=>{be(c.current,{[zt.Forwards]:()=>{br(v,pt.First,{skipElements:[b.relatedTarget]})},[zt.Backwards]:()=>{br(v,pt.Last,{skipElements:[b.relatedTarget]})}})})}),d=ui(),g=S.useRef(!1),p={ref:n,onKeyDown(b){b.key=="Tab"&&(g.current=!0,d.requestAnimationFrame(()=>{g.current=!1}))},onBlur(b){let v=Hs(a);r.current instanceof HTMLElement&&v.add(r.current);let y=b.relatedTarget;y instanceof HTMLElement&&y.dataset.headlessuiFocusGuard!=="true"&&(Gs(v,y)||(g.current?br(r.current,be(c.current,{[zt.Forwards]:()=>pt.Next,[zt.Backwards]:()=>pt.Previous})|pt.WrapAround,{relativeTo:b.target}):b.target instanceof HTMLElement&&vt(b.target)))}};return T.default.createElement(T.default.Fragment,null,Boolean(o&4)&&T.default.createElement(Dn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:l,features:Rr.Focusable}),Fe({ourProps:p,theirProps:s,defaultTag:mm,name:"FocusTrap"}),Boolean(o&4)&&T.default.createElement(Dn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:l,features:Rr.Focusable}))}let ym=Te(vm),Gt=Object.assign(ym,{features:Ws});function bm(e=!0){let t=S.useRef(at.slice());return li(([r],[n])=>{n===!0&&r===!1&&zr(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=at.slice())},[e,at,t]),ne(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function Sm({ownerDocument:e},t){let r=bm(t);li(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&vt(r())},[t]),Bs(()=>{t&&vt(r())})}function Om({ownerDocument:e,container:t,initialFocus:r},n){let i=S.useRef(null),a=or();return li(()=>{if(!n)return;let o=t.current;o&&zr(()=>{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?vt(r.current):br(o,pt.First)===Rs.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=e==null?void 0:e.activeElement})},[n]),i}function wm({ownerDocument:e,container:t,containers:r,previousActiveElement:n},i){let a=or();Us(e==null?void 0:e.defaultView,"focus",o=>{if(!i||!a.current)return;let s=Hs(r);t.current instanceof HTMLElement&&s.add(t.current);let u=n.current;if(!u)return;let f=o.target;f&&f instanceof HTMLElement?Gs(s,f)?(n.current=f,vt(f)):(o.preventDefault(),o.stopPropagation(),vt(u)):vt(n.current)},!0)}function Gs(e,t){for(let r of e)if(r.contains(t))return!0;return!1}let Ks=S.createContext(!1);function Em(){return S.useContext(Ks)}function jn(e){return T.default.createElement(Ks.Provider,{value:e.force},e.children)}function Pm(e){let t=Em(),r=S.useContext(Ys),n=ar(e),[i,a]=S.useState(()=>{if(!t&&r!==null||Ze.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 xm=S.Fragment;function Am(e,t){let r=e,n=S.useRef(null),i=je(sm(c=>{n.current=c}),t),a=ar(n),o=Pm(n),[s]=S.useState(()=>{var c;return Ze.isServer?null:(c=a==null?void 0:a.createElement("div"))!=null?c:null}),u=S.useContext(Vn),f=Rt();return $e(()=>{!o||!s||o.contains(s)||(s.setAttribute("data-headlessui-portal",""),o.appendChild(s))},[o,s]),$e(()=>{if(s&&u)return u.register(s)},[u,s]),Bs(()=>{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:iu.createPortal(Fe({ourProps:{ref:i},theirProps:r,defaultTag:xm,name:"Portal"}),s):null}let Cm=S.Fragment,Ys=S.createContext(null);function _m(e,t){let{target:r,...n}=e,i={ref:je(t)};return T.default.createElement(Ys.Provider,{value:r},Fe({ourProps:i,theirProps:n,defaultTag:Cm,name:"Popover.Group"}))}let Vn=S.createContext(null);function Tm(){let e=S.useContext(Vn),t=S.useRef([]),r=ne(a=>(t.current.push(a),e&&e.register(a),()=>n(a))),n=ne(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(Vn.Provider,{value:i},a)},[i])]}let Nm=Te(Am),Im=Te(_m),Un=Object.assign(Nm,{Group:Im});function $m(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const Lm=typeof Object.is=="function"?Object.is:$m,{useState:Rm,useEffect:Fm,useLayoutEffect:Mm,useDebugValue:km}=ut;function Dm(e,t,r){const n=t(),[{inst:i},a]=Rm({inst:{value:n,getSnapshot:t}});return Mm(()=>{i.value=n,i.getSnapshot=t,Sn(i)&&a({inst:i})},[e,n,t]),Fm(()=>(Sn(i)&&a({inst:i}),e(()=>{Sn(i)&&a({inst:i})})),[e]),km(n),n}function Sn(e){const t=e.getSnapshot,r=e.value;try{const n=t();return!Lm(r,n)}catch{return!0}}function jm(e,t,r){return t()}const Vm=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",Um=!Vm,Bm=Um?jm:Dm,Hm="useSyncExternalStore"in ut?(e=>e.useSyncExternalStore)(ut):Bm;function Wm(e){return Hm(e.subscribe,e.getSnapshot,e.getSnapshot)}function Gm(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 Km(){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 Ym(){return Ms()?{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=Et();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 zm(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Qm(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let mt=Gm(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:Et(),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:Qm(r)},i=[Ym(),Km(),zm()];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)}});mt.subscribe(()=>{let e=mt.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)&&mt.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&mt.dispatch("TEARDOWN",r)}});function qm(e,t,r){let n=Wm(mt),i=e?n.get(e):void 0,a=i?i.count>0:!1;return $e(()=>{if(!(!e||!t))return mt.dispatch("PUSH",e,r),()=>mt.dispatch("POP",e,r)},[t,e]),a}let On=new Map,Kt=new Map;function qa(e,t=!0){$e(()=>{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=Kt.get(n))!=null?o:1;if(s===1?Kt.delete(n):Kt.set(n,s-1),s!==1)return;let u=On.get(n);u&&(u["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",u["aria-hidden"]),n.inert=u.inert,On.delete(n))}let a=(r=Kt.get(n))!=null?r:0;return Kt.set(n,a+1),a!==0||(On.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0),i},[e,t])}function Jm({defaultContainers:e=[],portals:t,mainTreeNodeRef:r}={}){var n;let i=S.useRef((n=r==null?void 0:r.current)!=null?n:null),a=ar(i),o=ne(()=>{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:ne(s=>o().some(u=>u.contains(s))),mainTreeNodeRef:i,MainTreeNode:S.useMemo(()=>function(){return r!=null?null:T.default.createElement(Dn,{features:Rr.Hidden,ref:i})},[i,r])}}let di=S.createContext(()=>{});di.displayName="StackContext";var Bn=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Bn||{});function Zm(){return S.useContext(di)}function Xm({children:e,onUpdate:t,type:r,element:n,enabled:i}){let a=Zm(),o=ne((...s)=>{t==null||t(...s),a(...s)});return $e(()=>{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(di.Provider,{value:o},e)}let zs=S.createContext(null);function Qs(){let e=S.useContext(zs);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,Qs),t}return e}function ev(){let[e,t]=S.useState([]);return[e.length>0?e.join(" "):void 0,S.useMemo(()=>function(r){let n=ne(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(zs.Provider,{value:i},r.children)},[t])]}let tv="p";function rv(e,t){let r=Ft(),{id:n=`headlessui-description-${r}`,...i}=e,a=Qs(),o=je(t);$e(()=>a.register(n),[n,a.register]);let s={ref:o,...a.props,id:n};return Fe({ourProps:s,theirProps:i,slot:a.slot||{},defaultTag:tv,name:a.name||"Description"})}let nv=Te(rv),iv=Object.assign(nv,{});var av=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(av||{}),ov=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(ov||{});let sv={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Fr=S.createContext(null);Fr.displayName="DialogContext";function sr(e){let t=S.useContext(Fr);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,sr),r}return t}function uv(e,t,r=()=>[document.body]){qm(e,t,n=>{var i;return{containers:[...(i=n.containers)!=null?i:[],r]}})}function lv(e,t){return be(t.type,sv,e,t)}let cv="div",fv=Lr.RenderStrategy|Lr.Static;function dv(e,t){let r=Ft(),{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=fi();i===void 0&&g!==null&&(i=(g&_e.Open)===_e.Open);let p=S.useRef(null),b=je(p,t),v=ar(p),y=e.hasOwnProperty("open")||g!==null,h=e.hasOwnProperty("onClose");if(!y&&!h)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!y)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(lv,{titleId:null,descriptionId:null,panelRef:S.createRef()}),x=ne(()=>a(!1)),_=ne(B=>w({type:0,id:B})),$=Rt()?u?!1:E===0:!1,F=c>1,k=S.useContext(Fr)!==null,[H,M]=Tm(),j={get current(){var B;return(B=C.panelRef.current)!=null?B:p.current}},{resolveContainers:V,mainTreeNodeRef:W,MainTreeNode:X}=Jm({portals:H,defaultContainers:[j]}),G=F?"parent":"leaf",he=g!==null?(g&_e.Closing)===_e.Closing:!1,ye=(()=>k||he?!1:$)(),K=S.useCallback(()=>{var B,me;return(me=Array.from((B=v==null?void 0:v.querySelectorAll("body > *"))!=null?B:[]).find(le=>le.id==="headlessui-portal-root"?!1:le.contains(W.current)&&le instanceof HTMLElement))!=null?me:null},[W]);qa(K,ye);let ie=(()=>F?!0:$)(),ae=S.useCallback(()=>{var B,me;return(me=Array.from((B=v==null?void 0:v.querySelectorAll("[data-headlessui-portal]"))!=null?B:[]).find(le=>le.contains(W.current)&&le instanceof HTMLElement))!=null?me:null},[W]);qa(ae,ie);let se=(()=>!(!$||F))();om(V,B=>{B.preventDefault(),x()},se);let Q=(()=>!(F||E!==0))();Us(v==null?void 0:v.defaultView,"keydown",B=>{Q&&(B.defaultPrevented||B.key===Vs.Escape&&(B.preventDefault(),B.stopPropagation(),x()))});let xe=(()=>!(he||E!==0||k))();uv(v,xe,V),S.useEffect(()=>{if(E!==0||!p.current)return;let B=new ResizeObserver(me=>{for(let le of me){let Ae=le.target.getBoundingClientRect();Ae.x===0&&Ae.y===0&&Ae.width===0&&Ae.height===0&&x()}});return B.observe(p.current),()=>B.disconnect()},[E,p,x]);let[re,q]=ev(),ue=S.useMemo(()=>[{dialogState:E,close:x,setTitleId:_},C],[E,C,x,_]),ce=S.useMemo(()=>({open:E===0}),[E]),ve={ref:b,id:n,role:s,"aria-modal":E===0?!0:void 0,"aria-labelledby":C.titleId,"aria-describedby":re};return T.default.createElement(Xm,{type:"Dialog",enabled:E===0,element:p,onUpdate:ne((B,me)=>{me==="Dialog"&&be(B,{[Bn.Add]:()=>l(le=>le+1),[Bn.Remove]:()=>l(le=>le-1)})})},T.default.createElement(jn,{force:!0},T.default.createElement(Un,null,T.default.createElement(Fr.Provider,{value:ue},T.default.createElement(Un.Group,{target:p},T.default.createElement(jn,{force:!1},T.default.createElement(q,{slot:ce,name:"Dialog.Description"},T.default.createElement(Gt,{initialFocus:o,containers:V,features:$?be(G,{parent:Gt.features.RestoreFocus,leaf:Gt.features.All&~Gt.features.FocusLock}):Gt.features.None},T.default.createElement(M,null,Fe({ourProps:ve,theirProps:f,slot:ce,defaultTag:cv,features:fv,visible:E===0,name:"Dialog"}))))))))),T.default.createElement(X,null))}let gv="div";function pv(e,t){let r=Ft(),{id:n=`headlessui-dialog-overlay-${r}`,...i}=e,[{dialogState:a,close:o}]=sr("Dialog.Overlay"),s=je(t),u=ne(c=>{if(c.target===c.currentTarget){if(gm(c.currentTarget))return c.preventDefault();c.preventDefault(),c.stopPropagation(),o()}}),f=S.useMemo(()=>({open:a===0}),[a]);return Fe({ourProps:{ref:s,id:n,"aria-hidden":!0,onClick:u},theirProps:i,slot:f,defaultTag:gv,name:"Dialog.Overlay"})}let hv="div";function mv(e,t){let r=Ft(),{id:n=`headlessui-dialog-backdrop-${r}`,...i}=e,[{dialogState:a},o]=sr("Dialog.Backdrop"),s=je(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(jn,{force:!0},T.default.createElement(Un,null,Fe({ourProps:{ref:s,id:n,"aria-hidden":!0},theirProps:i,slot:u,defaultTag:hv,name:"Dialog.Backdrop"})))}let vv="div";function yv(e,t){let r=Ft(),{id:n=`headlessui-dialog-panel-${r}`,...i}=e,[{dialogState:a},o]=sr("Dialog.Panel"),s=je(t,o.panelRef),u=S.useMemo(()=>({open:a===0}),[a]),f=ne(c=>{c.stopPropagation()});return Fe({ourProps:{ref:s,id:n,onClick:f},theirProps:i,slot:u,defaultTag:vv,name:"Dialog.Panel"})}let bv="h2";function Sv(e,t){let r=Ft(),{id:n=`headlessui-dialog-title-${r}`,...i}=e,[{dialogState:a,setTitleId:o}]=sr("Dialog.Title"),s=je(t);S.useEffect(()=>(o(n),()=>o(null)),[n,o]);let u=S.useMemo(()=>({open:a===0}),[a]);return Fe({ourProps:{ref:s,id:n},theirProps:i,slot:u,defaultTag:bv,name:"Dialog.Title"})}let Ov=Te(dv),wv=Te(mv),Ev=Te(yv),Pv=Te(pv),xv=Te(Sv),Ja=Object.assign(Ov,{Backdrop:wv,Panel:Ev,Overlay:Pv,Title:xv,Description:iv});function Av(e=0){let[t,r]=S.useState(e),n=or(),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 Cv(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function wn(e,...t){e&&t.length>0&&e.classList.add(...t)}function En(e,...t){e&&t.length>0&&e.classList.remove(...t)}function _v(e,t){let r=Et();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 Tv(e,t,r,n){let i=r?"enter":"leave",a=Et(),o=n!==void 0?Cv(n):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=be(i,{enter:()=>t.enter,leave:()=>t.leave}),u=be(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),f=be(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return En(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),wn(e,...t.base,...s,...f),a.nextFrame(()=>{En(e,...t.base,...s,...f),wn(e,...t.base,...s,...u),_v(e,()=>(En(e,...t.base,...s),wn(e,...t.base,...t.entered),o()))}),a.dispose}function Nv({immediate:e,container:t,direction:r,classes:n,onStart:i,onStop:a}){let o=or(),s=ui(),u=Xe(r);$e(()=>{e&&(u.current="enter")},[e]),$e(()=>{let f=Et();s.add(f.dispose);let c=t.current;if(c&&u.current!=="idle"&&o.current)return f.dispose(),i.current(u.current),f.add(Tv(c,n.current,u.current==="enter",()=>{f.dispose(),a.current(u.current)})),f.dispose},[r])}function it(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Qr=S.createContext(null);Qr.displayName="TransitionContext";var Iv=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Iv||{});function $v(){let e=S.useContext(Qr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Lv(){let e=S.useContext(qr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let qr=S.createContext(null);qr.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 qs(e,t){let r=Xe(e),n=S.useRef([]),i=or(),a=ui(),o=ne((g,p=st.Hidden)=>{let b=n.current.findIndex(({el:v})=>v===g);b!==-1&&(be(p,{[st.Unmount](){n.current.splice(b,1)},[st.Hidden](){n.current[b].state="hidden"}}),a.microTask(()=>{var v;!Jr(n)&&i.current&&((v=r.current)==null||v.call(r))}))}),s=ne(g=>{let p=n.current.find(({el:b})=>b===g);return p?p.state!=="visible"&&(p.state="visible"):n.current.push({el:g,state:"visible"}),()=>o(g,st.Unmount)}),u=S.useRef([]),f=S.useRef(Promise.resolve()),c=S.useRef({enter:[],leave:[],idle:[]}),l=ne((g,p,b)=>{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(([y,h])=>h)).then(()=>v())})]),p==="enter"?f.current=f.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(p)):b(p)}),d=ne((g,p,b)=>{Promise.all(c.current[p].splice(0).map(([v,y])=>y)).then(()=>{var v;(v=u.current.shift())==null||v()}).then(()=>b(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 Rv(){}let Fv=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Za(e){var t;let r={};for(let n of Fv)r[n]=(t=e[n])!=null?t:Rv;return r}function Mv(e){let t=S.useRef(Za(e));return S.useEffect(()=>{t.current=Za(e)},[e]),t}let kv="div",Js=Lr.RenderStrategy;function Dv(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,...b}=e,v=S.useRef(null),y=je(v,t),h=(r=b.unmount)==null||r?st.Unmount:st.Hidden,{show:E,appear:C,initial:w}=$v(),[x,_]=S.useState(E?"visible":"hidden"),$=Lv(),{register:F,unregister:k}=$;S.useEffect(()=>F(v),[F,v]),S.useEffect(()=>{if(h===st.Hidden&&v.current){if(E&&x!=="visible"){_("visible");return}return be(x,{hidden:()=>k(v),visible:()=>F(v)})}},[x,v,F,k,E,h]);let H=Xe({base:it(b.className),enter:it(u),enterFrom:it(f),enterTo:it(c),entered:it(l),leave:it(d),leaveFrom:it(g),leaveTo:it(p)}),M=Mv({beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s}),j=Rt();S.useEffect(()=>{if(j&&x==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,x,j]);let V=w&&!C,W=C&&E&&w,X=(()=>!j||V?"idle":E?"enter":"leave")(),G=Av(0),he=ne(Q=>be(Q,{enter:()=>{G.addFlag(_e.Opening),M.current.beforeEnter()},leave:()=>{G.addFlag(_e.Closing),M.current.beforeLeave()},idle:()=>{}})),ye=ne(Q=>be(Q,{enter:()=>{G.removeFlag(_e.Opening),M.current.afterEnter()},leave:()=>{G.removeFlag(_e.Closing),M.current.afterLeave()},idle:()=>{}})),K=qs(()=>{_("hidden"),k(v)},$),ie=S.useRef(!1);Nv({immediate:W,container:v,classes:H,direction:X,onStart:Xe(Q=>{ie.current=!0,K.onStart(v,Q,he)}),onStop:Xe(Q=>{ie.current=!1,K.onStop(v,Q,ye),Q==="leave"&&!Jr(K)&&(_("hidden"),k(v))})});let ae=b,se={ref:y};return W?ae={...ae,className:$r(b.className,...H.current.enter,...H.current.enterFrom)}:ie.current&&(ae.className=$r(b.className,(n=v.current)==null?void 0:n.className),ae.className===""&&delete ae.className),T.default.createElement(qr.Provider,{value:K},T.default.createElement(fm,{value:be(x,{visible:_e.Open,hidden:_e.Closed})|G.flags},Fe({ourProps:se,theirProps:ae,defaultTag:kv,features:Js,visible:x==="visible",name:"Transition.Child"})))}function jv(e,t){let{show:r,appear:n=!1,unmount:i=!0,...a}=e,o=S.useRef(null),s=je(o,t);Rt();let u=fi();if(r===void 0&&u!==null&&(r=(u&_e.Open)===_e.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=qs(()=>{c("hidden")}),[d,g]=S.useState(!0),p=S.useRef([r]);$e(()=>{d!==!1&&p.current[p.current.length-1]!==r&&(p.current.push(r),g(!1))},[p,r]);let b=S.useMemo(()=>({show:r,appear:n,initial:d}),[r,n,d]);S.useEffect(()=>{if(r)c("visible");else if(!Jr(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},y=ne(()=>{var E;d&&g(!1),(E=e.beforeEnter)==null||E.call(e)}),h=ne(()=>{var E;d&&g(!1),(E=e.beforeLeave)==null||E.call(e)});return T.default.createElement(qr.Provider,{value:l},T.default.createElement(Qr.Provider,{value:b},Fe({ourProps:{...v,as:S.Fragment,children:T.default.createElement(Zs,{ref:s,...v,...a,beforeEnter:y,beforeLeave:h})},theirProps:{},defaultTag:S.Fragment,features:Js,visible:f==="visible",name:"Transition"})))}function Vv(e,t){let r=S.useContext(Qr)!==null,n=fi()!==null;return T.default.createElement(T.default.Fragment,null,!r&&n?T.default.createElement(Hn,{ref:t,...e}):T.default.createElement(Zs,{ref:t,...e}))}let Hn=Te(jv),Zs=Te(Dv),Uv=Te(Vv),Pn=Object.assign(Hn,{Child:Uv,Root:Hn});function Bv(e){const{children:t,isOpen:r,handleClose:n}=e,{isMobile:i}=Is({isModal:!0});return A(Ke,{children:A(Pn,{appear:!0,show:r,as:S.Fragment,children:A(Ja,{as:"div",className:"fixed inset-0 z-10 overflow-y-auto",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:n,children:U("div",{className:"min-h-screen text-center sm:px-4",children:[A(Pn.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(Ja.Overlay,{className:"fixed inset-0"})}),A("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),A(Pn.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:U("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:U("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 Hv(e){var V,W,X,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,b]=S.useState(0);S.useEffect(()=>{b(1);const he=setTimeout(()=>{w||b(2)},250);return()=>{clearTimeout(he)}},[]);const{displayPriceFrom:v,formattedEndPrice:y}=qp(a,l,o),h=S.useRef(),E=S.useRef(),{isSm:C,isMobile:w,windowHeight:x}=Is({isModal:!0}),_=U(Ke,{children:[U("div",{className:Wt("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:Wt("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:Wt(!i&&"hidden"),children:A(Ns,{})})]}),U("div",{className:Wt("w-full",C&&"sm:w-3/5"),ref:E,children:[U("div",{className:"items-center w-full p-4",children:[U("div",{className:"flex justify-between w-full mb-4 text-2xl font-semibold",children:[U("span",{className:"",children:[t.details.literals.name," "]}),A(Kr,{price:e.countedProductPrice,minPrice:l})]}),A("span",{className:"text-gray-600",children:(W=t.details.literals)==null?void 0:W.description})]}),U("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(Ya,{finalPrice:y,isBackIcon:!1,handleGoBack:n,displayPriceFrom:v})})]})]}),$=(X=h==null?void 0:h.current)==null?void 0:X.clientHeight,F=(G=E==null?void 0:E.current)==null?void 0:G.clientHeight,k=$+F;k>window.innerHeight*.8||isNaN(k)?d!=="80vh"&&g("80vh"):d!=="auto"&&g("auto");const H=`${x-64-56}px`,M=!C,j={"--mobile-submit-row-top":`${x-64-80}px`};return A(Bv,{isOpen:Boolean(r),handleClose:n,children:U("div",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},children:[A("div",{className:Wt("flex relative flex-col items-start w-full form-body stretch",!M&&"sm:flex-row-reverse sm:pb-0",!w&&"mobile-scrollbar"),style:{height:`${w?H:d}`,minHeight:"400px",overflowY:"scroll"},children:_}),M&&A("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${w?"submit-row-mobile":"submit-row"}`,style:j,children:A(Ya,{handleGoBack:n,finalPrice:y,isBackIcon:!1,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:f})})]})})}const gi=(e,t={},r,n,i=0)=>{var o,s;const a=n||{};return(i===0||((o=t[e.selCtx])==null?void 0:o[e.id]))&&((s=e==null?void 0:e.items)==null||s.forEach(u=>{var f,c,l,d,g,p,b,v,y,h,E,C,w,x,_,$;if(u.kind===We.OPTIONS&&(((f=u.attrs)==null?void 0:f.vital)||((c=u==null?void 0:u.attrs)==null?void 0:c.selMin)||((l=u.attrs)==null?void 0:l.selMax)||((d=u.attrs)==null?void 0:d.qtyMin)||((g=u.attrs)==null?void 0:g.qtyMax)||((p=u.attrs)==null?void 0:p.allowMultiple))){const[F,k]=ms(u.selCtx,t,u.items),H=Hr(e,r);a[u.selCtx]={isSelCntAllowedToIncrement:F<Number(((b=u==null?void 0:u.attrs)==null?void 0:b.selMax)||Number.MAX_SAFE_INTEGER),isQtyCntAllowedToIncrement:k<Number(((v=u==null?void 0:u.attrs)==null?void 0:v.qtyMax)||Number.MAX_SAFE_INTEGER),nestedLvl:i,isPassedFiltering:H,isValid:Nr(F,Number(((y=u.attrs)==null?void 0:y.selMin)||0),Number(((h=u.attrs)==null?void 0:h.selMax)||Number.MAX_SAFE_INTEGER)+1)&&Nr(k,Number(((E=u.attrs)==null?void 0:E.qtyMin)||0),Number(((C=u.attrs)==null?void 0:C.qtyMax)||Number.MAX_SAFE_INTEGER)+1)&&(((w=u.attrs)==null?void 0:w.vital)!==!0||F>0)&&(((x=u.attrs)==null?void 0:x.allowMultiple)===!0||k-F===0)}}(u==null?void 0:u.items)&&((_=u.items)==null?void 0:_.length)>0&&(($=u.items)==null||$.forEach(F=>{gi(F,t,r,a,i+1)}))})),a},Xs=T.default.createContext(null);function Wv({rootProduct:e,children:t}){return A(Xs.Provider,{value:{rootProduct:e},children:t})}function Gv(e){const t=S.useContext(Xs),r=Er({name:"selected"}),n=Er({name:"filter"}),[i,a]=S.useState(void 0);if(!t)throw new Error("Missing ComponentsContext");return S.useEffect(()=>{console.log("useGroupsValidation validationMap2 change")},[i]),S.useEffect(()=>{const o=gi(e,r,n);Xg(o,i)||a(o)},[r,n]),{validationMap2:i}}const Kv=e=>{const{product:t}=e,{MenuProductRootUI:r}=Yr(),{validationMap2:n}=Gv(t),i=De(t.items)?A(Ke,{}):A(si,{productItems:t.items,parentProduct:t,rootProduct:t});return r?A(r,{...e,validationMap:n||{},children:i}):A(Hv,{...e,validationMap:n||{},children:i})};const eu=T.default.createContext(null);function Yv({rootProduct:e,children:t}){return A(eu.Provider,{value:{rootProduct:e},children:t})}function zv(){const e=S.useContext(eu);if(!e)throw new Error("Missing ComponentsContext");return e}function Qv(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:b,increaseProductQuantity:v,decreaseProductQuantity:y,setCurrency:h}=Sp(t);S.useEffect(()=>{Se.changeLanguage(r)},[r]),S.useEffect(()=>{h(s)},[s]);const E=Co({defaultValues:{selected:l,filter:d}}),{getValues:C}=E,w=Number((parseFloat(f||"0")+Jn(C("selected"),c)).toFixed(2)),x=()=>{var k;p();const $=gi(t,C("selected"),C("filter"));if(console.log("onSubmit product-configurator",$),Object.keys($).some(function(H){return $[H].isValid===!1}))console.warn("INVALID VALIDATION MAP product-configurator",$);else{console.log("selected",C("selected"));const H=op(ds(C("selected"))),M=C("filter");(k=Object.keys(H||{}))==null||k.forEach(j=>{const V=ps(j,t);V&&(Hr(V,M)||delete H[j])}),console.log("decodedCleanedSelected product-configurator: ",H),n({price:w,quantity:g,selected:H,filter:M})}},_=()=>x();return A(Ke,{children:A(Yv,{rootProduct:t,children:A(_s.Provider,{value:e.components,children:A(fo,{...E,children:U("form",{children:[u&&A("div",{className:"hidden",children:A(Ns,{})}),A(Wv,{rootProduct:c,children:A(Kv,{product:c,productQuantity:g,isOpen:a,handleClose:o,handleGoBack:i,handleOnSubmit:_,countedProductPrice:w,countedProductTotalPrice:w*g,increaseProductQuantity:v,decreaseProductQuantity:y,currency:s})})]})})})})})}exports.ContextType=Qn;exports.MainView=_o;exports.ProductConfigurator=Qv;exports.ProductKinds=qn;exports.ProductTypes=To;exports.SelMinSelMaxStatus=Ie;exports.getProductToChangeInForm=ys;exports.hookForm=rl;exports.selectProductsInForm=bs;exports.unselectProductsInForm=Op;exports.useMenuOptions=Ss;exports.useProductData=zv;exports.useStore=oe;exports.validateProductFilter=Hr;
|
|
15
15
|
//# sourceMappingURL=index.cjs.js.map
|