paymob-pixel-alpha 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +9 -3
  2. package/main.js +2114 -2068
  3. package/package.json +1 -1
  4. package/styles.css +32 -0
package/main.js CHANGED
@@ -6501,1039 +6501,911 @@ axios_axios.default = axios_axios;
6501
6501
  // this module should only have a default export
6502
6502
  /* harmony default export */ const lib_axios = (axios_axios);
6503
6503
 
6504
- // EXTERNAL MODULE: ../../node_modules/void-elements/index.js
6505
- var void_elements = __webpack_require__(9002);
6506
- var void_elements_default = /*#__PURE__*/__webpack_require__.n(void_elements);
6507
- ;// CONCATENATED MODULE: ../../node_modules/html-parse-stringify/dist/html-parse-stringify.module.js
6508
- var t=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n(n){var r={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},i=n.match(/<\/?([^\s]+?)[/\s>]/);if(i&&(r.name=i[1],((void_elements_default())[i[1]]||"/"===n.charAt(n.length-2))&&(r.voidElement=!0),r.name.startsWith("!--"))){var s=n.indexOf("--\x3e");return{type:"comment",comment:-1!==s?n.slice(4,s):""}}for(var a=new RegExp(t),c=null;null!==(c=a.exec(n));)if(c[0].trim())if(c[1]){var o=c[1].trim(),l=[o,""];o.indexOf("=")>-1&&(l=o.split("=")),r.attrs[l[0]]=l[1],a.lastIndex--}else c[2]&&(r.attrs[c[2]]=c[3].trim().substring(1,c[3].length-1));return r}var r=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i=/^\s*$/,s=Object.create(null);function a(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(a,"")+"</"+t.name+">";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var c={parse:function(e,t){t||(t={}),t.components||(t.components=s);var a,c=[],o=[],l=-1,m=!1;if(0!==e.indexOf("<")){var u=e.indexOf("<");c.push({type:"text",content:-1===u?e:e.substring(0,u)})}return e.replace(r,function(r,s){if(m){if(r!=="</"+a.name+">")return;m=!1}var u,f="/"!==r.charAt(1),h=r.startsWith("\x3c!--"),p=s+r.length,d=e.charAt(p);if(h){var v=n(r);return l<0?(c.push(v),c):((u=o[l]).children.push(v),c)}if(f&&(l++,"tag"===(a=n(r)).type&&t.components[a.name]&&(a.type="component",m=!0),a.voidElement||m||!d||"<"===d||a.children.push({type:"text",content:e.slice(p,e.indexOf("<",p))}),0===l&&c.push(a),(u=o[l-1])&&u.children.push(a),o[l]=a),(!f||a.voidElement)&&(l>-1&&(a.voidElement||a.name===r.slice(2,-1))&&(l--,a=-1===l?c:o[l]),!m&&"<"!==d&&d)){u=-1===l?c:o[l].children;var x=e.indexOf("<",p),g=e.slice(p,-1===x?void 0:x);i.test(g)&&(g=" "),(x>-1&&l+u.length>=0||" "!==g)&&u.push({type:"text",content:g})}}),c},stringify:function(e){return e.reduce(function(e,t){return e+a("",t)},"")}};/* harmony default export */ const html_parse_stringify_module = ((/* unused pure expression or super */ null && (c)));
6509
- //# sourceMappingURL=html-parse-stringify.module.js.map
6504
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Input/input.module.scss
6505
+ // extracted by mini-css-extract-plugin
6506
+ /* harmony default export */ const input_module = ({"container":"input_container__jJNTc","input-container":"input_input-container__VJgnA","input-container-new":"input_input-container-new__nDtFv","input-container-new-reverse":"input_input-container-new-reverse__vtQte","input-filled":"input_input-filled__XXPf+","downpayment-filled":"input_downpayment-filled__-DUjp","input-container-reverse":"input_input-container-reverse__8jy-R"});
6507
+ // EXTERNAL MODULE: ../../node_modules/react/jsx-runtime.js
6508
+ var jsx_runtime = __webpack_require__(1085);
6509
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Input/index.tsx
6510
6510
 
6511
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/utils.js
6512
- function utils_warn() {
6513
- if (console && console.warn) {
6514
- var _console;
6515
6511
 
6516
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6517
- args[_key] = arguments[_key];
6512
+ function Input_Input(props) {
6513
+ const {
6514
+ name,
6515
+ placeholder,
6516
+ label,
6517
+ onChange,
6518
+ onFocus,
6519
+ onBlur,
6520
+ value,
6521
+ maxLength,
6522
+ className,
6523
+ newDesign,
6524
+ type,
6525
+ error,
6526
+ logoOnRight,
6527
+ inputMode,
6528
+ autoFocus,
6529
+ disabled,
6530
+ customStyle
6531
+ } = props;
6532
+ const handleChange = e => {
6533
+ const regexIsNumber = /^\d+$/;
6534
+ const isInputEmpty = e.target.value === '';
6535
+ if (type === 'tel' && !isInputEmpty && !regexIsNumber.test(e.target.value)) {
6536
+ return;
6537
+ } else {
6538
+ onChange && onChange(e);
6518
6539
  }
6519
-
6520
- if (typeof args[0] === 'string') args[0] = "react-i18next:: ".concat(args[0]);
6521
-
6522
- (_console = console).warn.apply(_console, args);
6523
- }
6540
+ };
6541
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
6542
+ className: input_module['container'],
6543
+ children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
6544
+ className: [input_module['input-container'], className, newDesign ? input_module['input-container-new'] : '', logoOnRight ? input_module['input-container-reverse'] : '', value && newDesign ? input_module['input-container-reverse'] : ''].join(' '),
6545
+ style: customStyle,
6546
+ children: [label && /*#__PURE__*/(0,jsx_runtime.jsx)("label", {
6547
+ className: value ? input_module['input-filled'] : '',
6548
+ htmlFor: name,
6549
+ children: label
6550
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)("input", {
6551
+ id: name,
6552
+ name: name,
6553
+ type: type,
6554
+ onChange: handleChange,
6555
+ onFocus: onFocus,
6556
+ onBlur: onBlur,
6557
+ placeholder: placeholder ? placeholder : '',
6558
+ maxLength: maxLength,
6559
+ value: value,
6560
+ autoComplete: "off",
6561
+ inputMode: inputMode,
6562
+ autoFocus: autoFocus,
6563
+ disabled: disabled
6564
+ })]
6565
+ }), error && /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
6566
+ children: error
6567
+ })]
6568
+ });
6524
6569
  }
6525
- var alreadyWarned = {};
6526
- function utils_warnOnce() {
6527
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
6528
- args[_key2] = arguments[_key2];
6529
- }
6570
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/assets/icons/error.png
6571
+ const error_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAADsOAAA7DgHMtqGDAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABxJJREFUaIHlmm2MVGcVx3/nuXd2+7bLDLNLeAmJtPJiTVvKLAViWRkWu43GSFILES3Eag2tEtGKSY2f1KhIQ6NRDFRtI5EgNPUlakCWLq2NAruzQIkFLClqRCz7DrsiO/fe44cd4M4zM7szdxck8f9t/ufc8zL3uc895zlXVJWxIlPfOAXfTSNmAcpsRO9EqQPuABQYROlE5IyKnjDIQXfIab334t7zY/UtURPI1KbrcGQVRlajpCKYUOCwINtjweUd9/T9oTdKHBUn0JZsnm7U2wB8CrgtitMiGEDZGsSCZ+efb/1XJReWnUBGGmLE408h+g2Gl8b1wL9V2HRbT/Kbd+uuoXIuKCuBTF16DoHZBdwziqoPnBSVk4ieUxgEELg9EKaKMgeYDTgjGVGRdnxZ2dC37+0xJ9CeXPZRUX2B0v/6oMDLwO6sVL+6oPt3F0aydzSRjvs4SxBdASwHbi2h2g/68VTPK7+NnEBmYtOTwPcBU0TcBboZnC2pnn39IzkphT9NeHhitcmuU+HzQKKIiifKE/N6979YykbJBHLBbykiUkG3xYLsM1F3DhtHahrrgyp3EyprivpTHi+VRNEE2pNLHxGVn1O4VrtB14x2W6Mi5/fHwARL5IEuL+a3IIGjEx6a6Tt+BqixdP/qO9L8QGfLX8Y1agsddR94jwb+XpDplqhPA5OyH+y8tf2mrKjyHX83BcHrGdfw4PUOHmBe174TRmUx8A9LFDcS7DwgaTdM5iVwKdH9ReA+68Jux3eb7+vaf3b8wy2O+3v3/y0QfRjI2xxUmF8bN58Lc1eX0LG6pmlewCng9vA1oB+OsuYziWVrEL4FGijypYaelp2V2sht4bst+oIXk1kL3ml5B0J3wFM2WMEj6LYowbdNSk9G9HnQKcA0QV98o6Z5UqV2GrpbXgL5qUXXOlmevvLDQK4wU56wFLsu+1VfqdQpgJs1s4BYiKr2XW9OFFuxrLMB6Atzgq49Hl+cgCt3wJFVWIWZIM8t6t/TE8Wpjyl48RXjysG9F/eeR/R7Fl0zZKpWQi4BNeYxS2FQkR9EcXg9MORVfRe4FOYUVgOYTH3jFFHNq+cFXo5aHlwPLOrf06Por8OcwMIjNY31Rv3YkuHfebCf/P85jLLLoiSoii0xIrLQEniKee1GBVYuYpptZbhcvwoJWGRQZlu6J2+m5XMFucIxrxJQYbYBnRkmReXUDY2sMuTHJsw0QDzMqeg/b2RElUDRsxaRMFidlqIXb2RQlUAwdrdXE+nlcjPBAANhQhC7D7hpoAS1FnXRYNcZKlPH6sioX2wZjnlnE7FiE3oNcDrMqai9rVYM7b/wBnA8RHUM9HnHS+mXbzh/yxfltMHemmDOoeQH7VtVEVLanvWk+kFF1orwmVvd4P1LtNUbi82jiXQc8hMIhFMu6EGQdSHejelQI/CbsTjMnQ9tHYuNMHycJaB5hwwGOWhwvFZbWUUfGS/H4wbRRy1Gsy4HRFXJTGzKAPNCwoH/OJenvq/z9cjvhDdlRdWlZNf9iuhAd9AxliV0NJGO+2LOkt+zHEr17F9oAETZbl1zR7V/y5NRHWbiTXddSnQfI5CDEnCoJuG0tU1KT45qzx9e4nbDtR1yDY3ruTuwGgYRfTr34FQOwxYg1ELqXOM5G6OYOly7LInIeose9Dx2DrtiuG1T9Cd5KsqkQMzXozgFFhUwooVcGXCcYCMwMd8U2x640NINoVMJwfkOhW3bU5lk00OVOlUpUtFqwXY9KtoTSz+CyOMWPaBudtOVH1cTSPXs+zsq37aUDbD9cLx5RiWOReULQLjw6laCZyqx0V6/dLaIvIDVLQr6tVTna+eu+QqdjR6Ykb6lpt9kgLvzI+Itz5XFVw6TysGxuqZpvuqHQNQdcn9VyUAvd8j2OvAuS3SE3v4FKW3PFk0AoC259L1G5TCF86+3xQ+a5/W3nuY6IhNvugvDHuDdlmgAE8xPdbWeDJMF5fT87lf+rPBpILBEd6pj/tiRXNo8viFfQyaxbDmGNgqD91F5zA4eRhhwdCSa1qvwXBFRoOgPXdWvzu1t7SsirxiZ2nSdOM5GFf0khSckKLK2oaelaFky4ogpl8TmYkaBTmCzJ9VbRpuLlcLx+OLEkFSvQ3Q9xUdMviKfLRU8lDPkm9j0MYEfUXomPCDwi0D1JRHn1dFONI4m0vEAk1bhUUYe8l1EZXWqt+WXI9kra8yae7B3Ye9OhfCBkyqcQvWcILluT2oQncLwmHUWo4xZgSOO76yc2//7t0aL7f9j0B1GW7J5uqPel3X4U4NSt79SDKK6Fdd7NvySKgeRP/Y4UtNYH7hVq9TwCVFtiGBCQQ4p+rOsH9sR9Sg/cgJhtE1KTxbPpEVYgMocVGcg1HNt4jMAdCp6xqicwOhBdyh2YDw+t/kvOZjs8Q9V7ZMAAAAASUVORK5CYII=";
6572
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/constants/borderStyle.ts
6573
+ const borderStyle_borderStyleConstants = {
6574
+ ROUNDED: 'ROUNDED',
6575
+ RECTANGULAR: 'RECTANGULAR'
6576
+ };
6577
+ // EXTERNAL MODULE: ../../node_modules/use-sync-external-store/shim/index.js
6578
+ var shim = __webpack_require__(8139);
6579
+ // EXTERNAL MODULE: ../../node_modules/use-sync-external-store/shim/with-selector.js
6580
+ var with_selector = __webpack_require__(7121);
6581
+ // EXTERNAL MODULE: ../../node_modules/react-dom/index.js
6582
+ var react_dom = __webpack_require__(3144);
6583
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/utils/reactBatchedUpdates.js
6530
6584
 
6531
- if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;
6532
- if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
6533
- utils_warn.apply(void 0, args);
6585
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/utils/batch.js
6586
+ // Default to a dummy "batch" implementation that just runs the callback
6587
+ function defaultNoopBatch(callback) {
6588
+ callback();
6534
6589
  }
6535
6590
 
6536
- var loadedClb = function loadedClb(i18n, cb) {
6537
- return function () {
6538
- if (i18n.isInitialized) {
6539
- cb();
6540
- } else {
6541
- var initialized = function initialized() {
6542
- setTimeout(function () {
6543
- i18n.off('initialized', initialized);
6544
- }, 0);
6545
- cb();
6546
- };
6591
+ let batch = (/* unused pure expression or super */ null && (defaultNoopBatch)); // Allow injecting another batching function later
6547
6592
 
6548
- i18n.on('initialized', initialized);
6549
- }
6550
- };
6551
- };
6593
+ const setBatch = newBatch => batch = newBatch; // Supply a getter just to skip dealing with ESM bindings
6552
6594
 
6553
- function loadNamespaces(i18n, ns, cb) {
6554
- i18n.loadNamespaces(ns, loadedClb(i18n, cb));
6555
- }
6556
- function loadLanguages(i18n, lng, ns, cb) {
6557
- if (typeof ns === 'string') ns = [ns];
6558
- ns.forEach(function (n) {
6559
- if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
6560
- });
6561
- i18n.loadLanguages(lng, loadedClb(i18n, cb));
6562
- }
6595
+ const batch_getBatch = () => batch;
6596
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/components/Context.js
6563
6597
 
6564
- function oldI18nextHasLoadedNamespace(ns, i18n) {
6565
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6566
- var lng = i18n.languages[0];
6567
- var fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
6568
- var lastLng = i18n.languages[i18n.languages.length - 1];
6569
- if (lng.toLowerCase() === 'cimode') return true;
6598
+ const Context_ReactReduxContext = /*#__PURE__*/(0,react.createContext)(null);
6570
6599
 
6571
- var loadNotPending = function loadNotPending(l, n) {
6572
- var loadState = i18n.services.backendConnector.state["".concat(l, "|").concat(n)];
6573
- return loadState === -1 || loadState === 2;
6574
- };
6600
+ if (false) {}
6575
6601
 
6576
- if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
6577
- if (i18n.hasResourceBundle(lng, ns)) return true;
6578
- if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
6579
- if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
6580
- return false;
6581
- }
6602
+ /* harmony default export */ const Context = ((/* unused pure expression or super */ null && (Context_ReactReduxContext)));
6603
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/hooks/useReduxContext.js
6582
6604
 
6583
- function hasLoadedNamespace(ns, i18n) {
6584
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6585
6605
 
6586
- if (!i18n.languages || !i18n.languages.length) {
6587
- utils_warnOnce('i18n.languages were undefined or empty', i18n.languages);
6588
- return true;
6589
- }
6590
6606
 
6591
- var isNewerI18next = i18n.options.ignoreJSONStructure !== undefined;
6607
+ /**
6608
+ * A hook to access the value of the `ReactReduxContext`. This is a low-level
6609
+ * hook that you should usually not need to call directly.
6610
+ *
6611
+ * @returns {any} the value of the `ReactReduxContext`
6612
+ *
6613
+ * @example
6614
+ *
6615
+ * import React from 'react'
6616
+ * import { useReduxContext } from 'react-redux'
6617
+ *
6618
+ * export const CounterComponent = () => {
6619
+ * const { store } = useReduxContext()
6620
+ * return <div>{store.getState()}</div>
6621
+ * }
6622
+ */
6623
+ function useReduxContext_useReduxContext() {
6624
+ const contextValue = (0,react.useContext)(Context_ReactReduxContext);
6592
6625
 
6593
- if (!isNewerI18next) {
6594
- return oldI18nextHasLoadedNamespace(ns, i18n, options);
6595
- }
6626
+ if (false) {}
6596
6627
 
6597
- return i18n.hasLoadedNamespace(ns, {
6598
- lng: options.lng,
6599
- precheck: function precheck(i18nInstance, loadNotPending) {
6600
- if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
6601
- }
6602
- });
6603
- }
6604
- function utils_getDisplayName(Component) {
6605
- return Component.displayName || Component.name || (typeof Component === 'string' && Component.length > 0 ? Component : 'Unknown');
6628
+ return contextValue;
6606
6629
  }
6607
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
6608
- function typeof_typeof(o) {
6609
- "@babel/helpers - typeof";
6630
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/utils/useSyncExternalStore.js
6631
+ const useSyncExternalStore_notInitialized = () => {
6632
+ throw new Error('uSES not initialized!');
6633
+ };
6634
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/hooks/useSelector.js
6610
6635
 
6611
- return typeof_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
6612
- return typeof o;
6613
- } : function (o) {
6614
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
6615
- }, typeof_typeof(o);
6616
- }
6617
6636
 
6618
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
6619
6637
 
6620
- function toPrimitive(t, r) {
6621
- if ("object" != typeof_typeof(t) || !t) return t;
6622
- var e = t[Symbol.toPrimitive];
6623
- if (void 0 !== e) {
6624
- var i = e.call(t, r || "default");
6625
- if ("object" != typeof_typeof(i)) return i;
6626
- throw new TypeError("@@toPrimitive must return a primitive value.");
6627
- }
6628
- return ("string" === r ? String : Number)(t);
6629
- }
6630
6638
 
6631
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
6639
+ let useSyncExternalStoreWithSelector = useSyncExternalStore_notInitialized;
6640
+ const initializeUseSelector = fn => {
6641
+ useSyncExternalStoreWithSelector = fn;
6642
+ };
6632
6643
 
6644
+ const refEquality = (a, b) => a === b;
6645
+ /**
6646
+ * Hook factory, which creates a `useSelector` hook bound to a given context.
6647
+ *
6648
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
6649
+ * @returns {Function} A `useSelector` hook bound to the specified context.
6650
+ */
6633
6651
 
6634
- function toPropertyKey(t) {
6635
- var i = toPrimitive(t, "string");
6636
- return "symbol" == typeof_typeof(i) ? i : i + "";
6637
- }
6638
6652
 
6639
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
6653
+ function createSelectorHook(context = Context_ReactReduxContext) {
6654
+ const useReduxContext = context === Context_ReactReduxContext ? useReduxContext_useReduxContext : () => (0,react.useContext)(context);
6655
+ return function useSelector(selector, equalityFn = refEquality) {
6656
+ if (false) {}
6640
6657
 
6641
- function defineProperty_defineProperty(e, r, t) {
6642
- return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
6643
- value: t,
6644
- enumerable: !0,
6645
- configurable: !0,
6646
- writable: !0
6647
- }) : e[r] = t, e;
6658
+ const {
6659
+ store,
6660
+ subscription,
6661
+ getServerState
6662
+ } = useReduxContext();
6663
+ const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, selector, equalityFn);
6664
+ (0,react.useDebugValue)(selectedState);
6665
+ return selectedState;
6666
+ };
6648
6667
  }
6668
+ /**
6669
+ * A hook to access the redux store's state. This hook takes a selector function
6670
+ * as an argument. The selector is called with the store state.
6671
+ *
6672
+ * This hook takes an optional equality comparison function as the second parameter
6673
+ * that allows you to customize the way the selected state is compared to determine
6674
+ * whether the component needs to be re-rendered.
6675
+ *
6676
+ * @param {Function} selector the selector function
6677
+ * @param {Function=} equalityFn the function that will be used to determine equality
6678
+ *
6679
+ * @returns {any} the selected state
6680
+ *
6681
+ * @example
6682
+ *
6683
+ * import React from 'react'
6684
+ * import { useSelector } from 'react-redux'
6685
+ *
6686
+ * export const CounterComponent = () => {
6687
+ * const counter = useSelector(state => state.counter)
6688
+ * return <div>{counter}</div>
6689
+ * }
6690
+ */
6649
6691
 
6650
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/unescape.js
6651
- var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
6652
- var htmlEntities = {
6653
- '&amp;': '&',
6654
- '&#38;': '&',
6655
- '&lt;': '<',
6656
- '&#60;': '<',
6657
- '&gt;': '>',
6658
- '&#62;': '>',
6659
- '&apos;': "'",
6660
- '&#39;': "'",
6661
- '&quot;': '"',
6662
- '&#34;': '"',
6663
- '&nbsp;': ' ',
6664
- '&#160;': ' ',
6665
- '&copy;': '©',
6666
- '&#169;': '©',
6667
- '&reg;': '®',
6668
- '&#174;': '®',
6669
- '&hellip;': '…',
6670
- '&#8230;': '…',
6671
- '&#x2F;': '/',
6672
- '&#47;': '/'
6673
- };
6674
-
6675
- var unescapeHtmlEntity = function unescapeHtmlEntity(m) {
6676
- return htmlEntities[m];
6677
- };
6692
+ const useSelector_useSelector = /*#__PURE__*/createSelectorHook();
6693
+ // EXTERNAL MODULE: ../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
6694
+ var hoist_non_react_statics_cjs = __webpack_require__(5985);
6695
+ // EXTERNAL MODULE: ../../node_modules/react-redux/node_modules/react-is/index.js
6696
+ var react_is = __webpack_require__(1524);
6697
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/utils/Subscription.js
6698
+ // encapsulates the subscription logic for connecting a component to the redux store, as
6699
+ // well as nesting subscriptions of descendant components, so that we can ensure the
6700
+ // ancestor components re-render before descendants
6678
6701
 
6679
- var unescape_unescape = function unescape(text) {
6680
- return text.replace(matchHtmlEntity, unescapeHtmlEntity);
6681
- };
6682
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/defaults.js
6702
+ function createListenerCollection() {
6703
+ const batch = getBatch();
6704
+ let first = null;
6705
+ let last = null;
6706
+ return {
6707
+ clear() {
6708
+ first = null;
6709
+ last = null;
6710
+ },
6683
6711
 
6712
+ notify() {
6713
+ batch(() => {
6714
+ let listener = first;
6684
6715
 
6685
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
6716
+ while (listener) {
6717
+ listener.callback();
6718
+ listener = listener.next;
6719
+ }
6720
+ });
6721
+ },
6686
6722
 
6687
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6723
+ get() {
6724
+ let listeners = [];
6725
+ let listener = first;
6688
6726
 
6727
+ while (listener) {
6728
+ listeners.push(listener);
6729
+ listener = listener.next;
6730
+ }
6689
6731
 
6690
- var defaultOptions = {
6691
- bindI18n: 'languageChanged',
6692
- bindI18nStore: '',
6693
- transEmptyNodeValue: '',
6694
- transSupportBasicHtmlNodes: true,
6695
- transWrapTextNodes: '',
6696
- transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
6697
- useSuspense: true,
6698
- unescape: unescape_unescape
6699
- };
6700
- function setDefaults() {
6701
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6702
- defaultOptions = _objectSpread(_objectSpread({}, defaultOptions), options);
6703
- }
6704
- function defaults_getDefaults() {
6705
- return defaultOptions;
6706
- }
6707
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/TransWithoutContext.js
6732
+ return listeners;
6733
+ },
6708
6734
 
6735
+ subscribe(callback) {
6736
+ let isSubscribed = true;
6737
+ let listener = last = {
6738
+ callback,
6739
+ next: null,
6740
+ prev: last
6741
+ };
6709
6742
 
6743
+ if (listener.prev) {
6744
+ listener.prev.next = listener;
6745
+ } else {
6746
+ first = listener;
6747
+ }
6710
6748
 
6711
- var _excluded = (/* unused pure expression or super */ null && (["format"])),
6712
- _excluded2 = (/* unused pure expression or super */ null && (["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"]));
6749
+ return function unsubscribe() {
6750
+ if (!isSubscribed || first === null) return;
6751
+ isSubscribed = false;
6713
6752
 
6714
- function TransWithoutContext_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
6753
+ if (listener.next) {
6754
+ listener.next.prev = listener.prev;
6755
+ } else {
6756
+ last = listener.prev;
6757
+ }
6715
6758
 
6716
- function TransWithoutContext_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { TransWithoutContext_ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { TransWithoutContext_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6759
+ if (listener.prev) {
6760
+ listener.prev.next = listener.next;
6761
+ } else {
6762
+ first = listener.next;
6763
+ }
6764
+ };
6765
+ }
6717
6766
 
6767
+ };
6768
+ }
6718
6769
 
6770
+ const nullListeners = {
6771
+ notify() {},
6719
6772
 
6773
+ get: () => []
6774
+ };
6775
+ function Subscription_createSubscription(store, parentSub) {
6776
+ let unsubscribe;
6777
+ let listeners = nullListeners;
6720
6778
 
6779
+ function addNestedSub(listener) {
6780
+ trySubscribe();
6781
+ return listeners.subscribe(listener);
6782
+ }
6721
6783
 
6784
+ function notifyNestedSubs() {
6785
+ listeners.notify();
6786
+ }
6722
6787
 
6788
+ function handleChangeWrapper() {
6789
+ if (subscription.onStateChange) {
6790
+ subscription.onStateChange();
6791
+ }
6792
+ }
6723
6793
 
6724
- function hasChildren(node, checkLength) {
6725
- if (!node) return false;
6726
- var base = node.props ? node.props.children : node.children;
6727
- if (checkLength) return base.length > 0;
6728
- return !!base;
6729
- }
6794
+ function isSubscribed() {
6795
+ return Boolean(unsubscribe);
6796
+ }
6730
6797
 
6731
- function getChildren(node) {
6732
- if (!node) return [];
6733
- return node.props ? node.props.children : node.children;
6734
- }
6798
+ function trySubscribe() {
6799
+ if (!unsubscribe) {
6800
+ unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);
6801
+ listeners = createListenerCollection();
6802
+ }
6803
+ }
6735
6804
 
6736
- function hasValidReactChildren(children) {
6737
- if (Object.prototype.toString.call(children) !== '[object Array]') return false;
6738
- return children.every(function (child) {
6739
- return isValidElement(child);
6740
- });
6741
- }
6805
+ function tryUnsubscribe() {
6806
+ if (unsubscribe) {
6807
+ unsubscribe();
6808
+ unsubscribe = undefined;
6809
+ listeners.clear();
6810
+ listeners = nullListeners;
6811
+ }
6812
+ }
6742
6813
 
6743
- function getAsArray(data) {
6744
- return Array.isArray(data) ? data : [data];
6814
+ const subscription = {
6815
+ addNestedSub,
6816
+ notifyNestedSubs,
6817
+ handleChangeWrapper,
6818
+ isSubscribed,
6819
+ trySubscribe,
6820
+ tryUnsubscribe,
6821
+ getListeners: () => listeners
6822
+ };
6823
+ return subscription;
6745
6824
  }
6825
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js
6826
+ // React currently throws a warning when using useLayoutEffect on the server.
6827
+ // To get around it, we can conditionally useEffect on the server (no-op) and
6828
+ // useLayoutEffect in the browser. We need useLayoutEffect to ensure the store
6829
+ // subscription callback always has the selector from the latest render commit
6830
+ // available, otherwise a store update may happen between render and the effect,
6831
+ // which may cause missed updates; we also must ensure the store subscription
6832
+ // is created synchronously, otherwise a store update may occur before the
6833
+ // subscription is created and an inconsistent state may be observed
6834
+ // Matches logic in React's `shared/ExecutionEnvironment` file
6746
6835
 
6747
- function mergeProps(source, target) {
6748
- var newTarget = TransWithoutContext_objectSpread({}, target);
6836
+ const canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
6837
+ const useIsomorphicLayoutEffect_useIsomorphicLayoutEffect = (/* unused pure expression or super */ null && (canUseDOM ? useLayoutEffect : useEffect));
6838
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/components/connect.js
6749
6839
 
6750
- newTarget.props = Object.assign(source.props, target.props);
6751
- return newTarget;
6752
- }
6753
6840
 
6754
- function nodesToString(children, i18nOptions) {
6755
- if (!children) return '';
6756
- var stringNode = '';
6757
- var childrenArray = getAsArray(children);
6758
- var keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];
6759
- childrenArray.forEach(function (child, childIndex) {
6760
- if (typeof child === 'string') {
6761
- stringNode += "".concat(child);
6762
- } else if (isValidElement(child)) {
6763
- var childPropsCount = Object.keys(child.props).length;
6764
- var shouldKeepChild = keepArray.indexOf(child.type) > -1;
6765
- var childChildren = child.props.children;
6841
+ const _excluded = (/* unused pure expression or super */ null && (["reactReduxForwardedRef"]));
6766
6842
 
6767
- if (!childChildren && shouldKeepChild && childPropsCount === 0) {
6768
- stringNode += "<".concat(child.type, "/>");
6769
- } else if (!childChildren && (!shouldKeepChild || childPropsCount !== 0)) {
6770
- stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
6771
- } else if (child.props.i18nIsDynamicList) {
6772
- stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
6773
- } else if (shouldKeepChild && childPropsCount === 1 && typeof childChildren === 'string') {
6774
- stringNode += "<".concat(child.type, ">").concat(childChildren, "</").concat(child.type, ">");
6775
- } else {
6776
- var content = nodesToString(childChildren, i18nOptions);
6777
- stringNode += "<".concat(childIndex, ">").concat(content, "</").concat(childIndex, ">");
6778
- }
6779
- } else if (child === null) {
6780
- warn("Trans: the passed in value is invalid - seems you passed in a null child.");
6781
- } else if (_typeof(child) === 'object') {
6782
- var format = child.format,
6783
- clone = _objectWithoutProperties(child, _excluded);
6843
+ /* eslint-disable valid-jsdoc, @typescript-eslint/no-unused-vars */
6784
6844
 
6785
- var keys = Object.keys(clone);
6786
6845
 
6787
- if (keys.length === 1) {
6788
- var value = format ? "".concat(keys[0], ", ").concat(format) : keys[0];
6789
- stringNode += "{{".concat(value, "}}");
6790
- } else {
6791
- warn("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.", child);
6792
- }
6793
- } else {
6794
- warn("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.", child);
6795
- }
6796
- });
6797
- return stringNode;
6798
- }
6799
6846
 
6800
- function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {
6801
- if (targetString === '') return [];
6802
- var keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];
6803
- var emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.join('|')).test(targetString);
6804
- if (!children && !emptyChildrenButNeedsHandling) return [targetString];
6805
- var data = {};
6806
6847
 
6807
- function getData(childs) {
6808
- var childrenArray = getAsArray(childs);
6809
- childrenArray.forEach(function (child) {
6810
- if (typeof child === 'string') return;
6811
- if (hasChildren(child)) getData(getChildren(child));else if (_typeof(child) === 'object' && !isValidElement(child)) Object.assign(data, child);
6812
- });
6813
- }
6814
6848
 
6815
- getData(children);
6816
- var ast = HTML.parse("<0>".concat(targetString, "</0>"));
6817
6849
 
6818
- var opts = TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, data), combinedTOpts);
6819
6850
 
6820
- function renderInner(child, node, rootReactNode) {
6821
- var childs = getChildren(child);
6822
- var mappedChildren = mapAST(childs, node.children, rootReactNode);
6823
- return hasValidReactChildren(childs) && mappedChildren.length === 0 ? childs : mappedChildren;
6824
- }
6825
6851
 
6826
- function pushTranslatedJSX(child, inner, mem, i, isVoid) {
6827
- if (child.dummy) child.children = inner;
6828
- mem.push(cloneElement(child, TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, child.props), {}, {
6829
- key: i
6830
- }), isVoid ? undefined : inner));
6831
- }
6832
6852
 
6833
- function mapAST(reactNode, astNode, rootReactNode) {
6834
- var reactNodes = getAsArray(reactNode);
6835
- var astNodes = getAsArray(astNode);
6836
- return astNodes.reduce(function (mem, node, i) {
6837
- var translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
6838
6853
 
6839
- if (node.type === 'tag') {
6840
- var tmp = reactNodes[parseInt(node.name, 10)];
6841
- if (!tmp && rootReactNode.length === 1 && rootReactNode[0][node.name]) tmp = rootReactNode[0][node.name];
6842
- if (!tmp) tmp = {};
6843
- var child = Object.keys(node.attrs).length !== 0 ? mergeProps({
6844
- props: node.attrs
6845
- }, tmp) : tmp;
6846
- var isElement = isValidElement(child);
6847
- var isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
6848
- var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && _typeof(child) === 'object' && child.dummy && !isElement;
6849
- var isKnownComponent = _typeof(children) === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);
6850
6854
 
6851
- if (typeof child === 'string') {
6852
- var value = i18n.services.interpolator.interpolate(child, opts, i18n.language);
6853
- mem.push(value);
6854
- } else if (hasChildren(child) || isValidTranslationWithChildren) {
6855
- var inner = renderInner(child, node, rootReactNode);
6856
- pushTranslatedJSX(child, inner, mem, i);
6857
- } else if (isEmptyTransWithHTML) {
6858
- var _inner = mapAST(reactNodes, node.children, rootReactNode);
6859
6855
 
6860
- mem.push(cloneElement(child, TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, child.props), {}, {
6861
- key: i
6862
- }), _inner));
6863
- } else if (Number.isNaN(parseFloat(node.name))) {
6864
- if (isKnownComponent) {
6865
- var _inner2 = renderInner(child, node, rootReactNode);
6866
6856
 
6867
- pushTranslatedJSX(child, _inner2, mem, i, node.voidElement);
6868
- } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
6869
- if (node.voidElement) {
6870
- mem.push(createElement(node.name, {
6871
- key: "".concat(node.name, "-").concat(i)
6872
- }));
6873
- } else {
6874
- var _inner3 = mapAST(reactNodes, node.children, rootReactNode);
6857
+ let useSyncExternalStore = (/* unused pure expression or super */ null && (notInitialized));
6858
+ const initializeConnect = fn => {
6859
+ useSyncExternalStore = fn;
6860
+ }; // Define some constant arrays just to avoid re-creating these
6875
6861
 
6876
- mem.push(createElement(node.name, {
6877
- key: "".concat(node.name, "-").concat(i)
6878
- }, _inner3));
6879
- }
6880
- } else if (node.voidElement) {
6881
- mem.push("<".concat(node.name, " />"));
6882
- } else {
6883
- var _inner4 = mapAST(reactNodes, node.children, rootReactNode);
6862
+ const EMPTY_ARRAY = (/* unused pure expression or super */ null && ([null, 0]));
6863
+ const NO_SUBSCRIPTION_ARRAY = (/* unused pure expression or super */ null && ([null, null])); // Attempts to stringify whatever not-really-a-component value we were given
6864
+ // for logging in an error message
6884
6865
 
6885
- mem.push("<".concat(node.name, ">").concat(_inner4, "</").concat(node.name, ">"));
6886
- }
6887
- } else if (_typeof(child) === 'object' && !isElement) {
6888
- var content = node.children[0] ? translationContent : null;
6889
- if (content) mem.push(content);
6890
- } else if (node.children.length === 1 && translationContent) {
6891
- mem.push(cloneElement(child, TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, child.props), {}, {
6892
- key: i
6893
- }), translationContent));
6894
- } else {
6895
- mem.push(cloneElement(child, TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, child.props), {}, {
6896
- key: i
6897
- })));
6898
- }
6899
- } else if (node.type === 'text') {
6900
- var wrapTextNodes = i18nOptions.transWrapTextNodes;
6866
+ const stringifyComponent = Comp => {
6867
+ try {
6868
+ return JSON.stringify(Comp);
6869
+ } catch (err) {
6870
+ return String(Comp);
6871
+ }
6872
+ };
6901
6873
 
6902
- var _content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
6874
+ // This is "just" a `useLayoutEffect`, but with two modifications:
6875
+ // - we need to fall back to `useEffect` in SSR to avoid annoying warnings
6876
+ // - we extract this to a separate function to avoid closing over values
6877
+ // and causing memory leaks
6878
+ function useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {
6879
+ useIsomorphicLayoutEffect(() => effectFunc(...effectArgs), dependencies);
6880
+ } // Effect callback, extracted: assign the latest props values to refs for later usage
6903
6881
 
6904
- if (wrapTextNodes) {
6905
- mem.push(createElement(wrapTextNodes, {
6906
- key: "".concat(node.name, "-").concat(i)
6907
- }, _content));
6908
- } else {
6909
- mem.push(_content);
6910
- }
6911
- }
6912
6882
 
6913
- return mem;
6914
- }, []);
6883
+ function captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, // actualChildProps: unknown,
6884
+ childPropsFromStoreUpdate, notifyNestedSubs) {
6885
+ // We want to capture the wrapper props and child props we used for later comparisons
6886
+ lastWrapperProps.current = wrapperProps;
6887
+ renderIsScheduled.current = false; // If the render was from a store update, clear out that reference and cascade the subscriber update
6888
+
6889
+ if (childPropsFromStoreUpdate.current) {
6890
+ childPropsFromStoreUpdate.current = null;
6891
+ notifyNestedSubs();
6915
6892
  }
6893
+ } // Effect callback, extracted: subscribe to the Redux store or nearest connected ancestor,
6894
+ // check for updates after dispatched actions, and trigger re-renders.
6916
6895
 
6917
- var result = mapAST([{
6918
- dummy: true,
6919
- children: children || []
6920
- }], ast, getAsArray(children || []));
6921
- return getChildren(result[0]);
6922
- }
6923
6896
 
6924
- function Trans(_ref) {
6925
- var children = _ref.children,
6926
- count = _ref.count,
6927
- parent = _ref.parent,
6928
- i18nKey = _ref.i18nKey,
6929
- context = _ref.context,
6930
- _ref$tOptions = _ref.tOptions,
6931
- tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions,
6932
- values = _ref.values,
6933
- defaults = _ref.defaults,
6934
- components = _ref.components,
6935
- ns = _ref.ns,
6936
- i18nFromProps = _ref.i18n,
6937
- tFromProps = _ref.t,
6938
- shouldUnescape = _ref.shouldUnescape,
6939
- additionalProps = _objectWithoutProperties(_ref, _excluded2);
6897
+ function subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, // forceComponentUpdateDispatch: React.Dispatch<any>,
6898
+ additionalSubscribeListener) {
6899
+ // If we're not subscribed to the store, nothing to do here
6900
+ if (!shouldHandleStateChanges) return () => {}; // Capture values for checking if and when this component unmounts
6940
6901
 
6941
- var i18n = i18nFromProps || getI18n();
6902
+ let didUnsubscribe = false;
6903
+ let lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component
6942
6904
 
6943
- if (!i18n) {
6944
- warnOnce('You will need to pass in an i18next instance by using i18nextReactModule');
6945
- return children;
6946
- }
6905
+ const checkForUpdates = () => {
6906
+ if (didUnsubscribe || !isMounted.current) {
6907
+ // Don't run stale listeners.
6908
+ // Redux doesn't guarantee unsubscriptions happen until next dispatch.
6909
+ return;
6910
+ } // TODO We're currently calling getState ourselves here, rather than letting `uSES` do it
6947
6911
 
6948
- var t = tFromProps || i18n.t.bind(i18n) || function (k) {
6949
- return k;
6950
- };
6951
6912
 
6952
- if (context) tOptions.context = context;
6913
+ const latestStoreState = store.getState();
6914
+ let newChildProps, error;
6953
6915
 
6954
- var reactI18nextOptions = TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, getDefaults()), i18n.options && i18n.options.react);
6916
+ try {
6917
+ // Actually run the selector with the most recent store state and wrapper props
6918
+ // to determine what the child props should be
6919
+ newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);
6920
+ } catch (e) {
6921
+ error = e;
6922
+ lastThrownError = e;
6923
+ }
6955
6924
 
6956
- var namespaces = ns || t.ns || i18n.options && i18n.options.defaultNS;
6957
- namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
6958
- var defaultValue = defaults || nodesToString(children, reactI18nextOptions) || reactI18nextOptions.transEmptyNodeValue || i18nKey;
6959
- var hashTransKey = reactI18nextOptions.hashTransKey;
6960
- var key = i18nKey || (hashTransKey ? hashTransKey(defaultValue) : defaultValue);
6961
- var interpolationOverride = values ? tOptions.interpolation : {
6962
- interpolation: TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, tOptions.interpolation), {}, {
6963
- prefix: '#$?',
6964
- suffix: '?$#'
6965
- })
6966
- };
6925
+ if (!error) {
6926
+ lastThrownError = null;
6927
+ } // If the child props haven't changed, nothing to do here - cascade the subscription update
6967
6928
 
6968
- var combinedTOpts = TransWithoutContext_objectSpread(TransWithoutContext_objectSpread(TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, tOptions), {}, {
6969
- count: count
6970
- }, values), interpolationOverride), {}, {
6971
- defaultValue: defaultValue,
6972
- ns: namespaces
6973
- });
6974
6929
 
6975
- var translation = key ? t(key, combinedTOpts) : defaultValue;
6976
- var content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
6977
- var useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;
6978
- return useAsParent ? createElement(useAsParent, additionalProps, content) : content;
6979
- }
6980
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
6981
- function _classCallCheck(a, n) {
6982
- if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
6983
- }
6930
+ if (newChildProps === lastChildProps.current) {
6931
+ if (!renderIsScheduled.current) {
6932
+ notifyNestedSubs();
6933
+ }
6934
+ } else {
6935
+ // Save references to the new child props. Note that we track the "child props from store update"
6936
+ // as a ref instead of a useState/useReducer because we need a way to determine if that value has
6937
+ // been processed. If this went into useState/useReducer, we couldn't clear out the value without
6938
+ // forcing another re-render, which we don't want.
6939
+ lastChildProps.current = newChildProps;
6940
+ childPropsFromStoreUpdate.current = newChildProps;
6941
+ renderIsScheduled.current = true; // TODO This is hacky and not how `uSES` is meant to be used
6942
+ // Trigger the React `useSyncExternalStore` subscriber
6984
6943
 
6985
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/createClass.js
6944
+ additionalSubscribeListener();
6945
+ }
6946
+ }; // Actually subscribe to the nearest connected ancestor (or store)
6986
6947
 
6987
- function _defineProperties(e, r) {
6988
- for (var t = 0; t < r.length; t++) {
6989
- var o = r[t];
6990
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
6991
- }
6992
- }
6993
- function _createClass(e, r, t) {
6994
- return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
6995
- writable: !1
6996
- }), e;
6997
- }
6998
6948
 
6999
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/i18nInstance.js
7000
- var i18nInstance;
7001
- function setI18n(instance) {
7002
- i18nInstance = instance;
7003
- }
7004
- function i18nInstance_getI18n() {
7005
- return i18nInstance;
7006
- }
7007
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/initReactI18next.js
6949
+ subscription.onStateChange = checkForUpdates;
6950
+ subscription.trySubscribe(); // Pull data from the store after first render in case the store has
6951
+ // changed since we began.
7008
6952
 
6953
+ checkForUpdates();
7009
6954
 
7010
- var initReactI18next = {
7011
- type: '3rdParty',
7012
- init: function init(instance) {
7013
- setDefaults(instance.options.react);
7014
- setI18n(instance);
7015
- }
7016
- };
7017
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/context.js
6955
+ const unsubscribeWrapper = () => {
6956
+ didUnsubscribe = true;
6957
+ subscription.tryUnsubscribe();
6958
+ subscription.onStateChange = null;
7018
6959
 
6960
+ if (lastThrownError) {
6961
+ // It's possible that we caught an error due to a bad mapState function, but the
6962
+ // parent re-rendered without this component and we're about to unmount.
6963
+ // This shouldn't happen as long as we do top-down subscriptions correctly, but
6964
+ // if we ever do those wrong, this throw will surface the error in our tests.
6965
+ // In that case, throw the error from here so it doesn't get lost.
6966
+ throw lastThrownError;
6967
+ }
6968
+ };
7019
6969
 
6970
+ return unsubscribeWrapper;
6971
+ } // Reducer initial state creation for our update reducer
7020
6972
 
7021
6973
 
7022
- function context_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
6974
+ const initStateUpdates = () => EMPTY_ARRAY;
7023
6975
 
7024
- function context_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { context_ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { context_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6976
+ function strictEqual(a, b) {
6977
+ return a === b;
6978
+ }
6979
+ /**
6980
+ * Infers the type of props that a connector will inject into a component.
6981
+ */
7025
6982
 
7026
6983
 
6984
+ let hasWarnedAboutDeprecatedPureOption = false;
6985
+ /**
6986
+ * Connects a React component to a Redux store.
6987
+ *
6988
+ * - Without arguments, just wraps the component, without changing the behavior / props
6989
+ *
6990
+ * - If 2 params are passed (3rd param, mergeProps, is skipped), default behavior
6991
+ * is to override ownProps (as stated in the docs), so what remains is everything that's
6992
+ * not a state or dispatch prop
6993
+ *
6994
+ * - When 3rd param is passed, we don't know if ownProps propagate and whether they
6995
+ * should be valid component props, because it depends on mergeProps implementation.
6996
+ * As such, it is the user's responsibility to extend ownProps interface from state or
6997
+ * dispatch props or both when applicable
6998
+ *
6999
+ * @param mapStateToProps A function that extracts values from state
7000
+ * @param mapDispatchToProps Setup for dispatching actions
7001
+ * @param mergeProps Optional callback to merge state and dispatch props together
7002
+ * @param options Options for configuring the connection
7003
+ *
7004
+ */
7027
7005
 
7006
+ function connect(mapStateToProps, mapDispatchToProps, mergeProps, {
7007
+ // The `pure` option has been removed, so TS doesn't like us destructuring this to check its existence.
7008
+ // @ts-ignore
7009
+ pure,
7010
+ areStatesEqual = strictEqual,
7011
+ areOwnPropsEqual = shallowEqual,
7012
+ areStatePropsEqual = shallowEqual,
7013
+ areMergedPropsEqual = shallowEqual,
7014
+ // use React's forwardRef to expose a ref of the wrapped component
7015
+ forwardRef = false,
7016
+ // the context consumer to use
7017
+ context = ReactReduxContext
7018
+ } = {}) {
7019
+ if (false) {}
7028
7020
 
7021
+ const Context = context;
7022
+ const initMapStateToProps = mapStateToPropsFactory(mapStateToProps);
7023
+ const initMapDispatchToProps = mapDispatchToPropsFactory(mapDispatchToProps);
7024
+ const initMergeProps = mergePropsFactory(mergeProps);
7025
+ const shouldHandleStateChanges = Boolean(mapStateToProps);
7029
7026
 
7027
+ const wrapWithConnect = WrappedComponent => {
7028
+ if (false) {}
7030
7029
 
7031
- var context_I18nContext = (0,react.createContext)();
7032
- var ReportNamespaces = function () {
7033
- function ReportNamespaces() {
7034
- _classCallCheck(this, ReportNamespaces);
7030
+ const wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
7031
+ const displayName = `Connect(${wrappedComponentName})`;
7032
+ const selectorFactoryOptions = {
7033
+ shouldHandleStateChanges,
7034
+ displayName,
7035
+ wrappedComponentName,
7036
+ WrappedComponent,
7037
+ // @ts-ignore
7038
+ initMapStateToProps,
7039
+ // @ts-ignore
7040
+ initMapDispatchToProps,
7041
+ initMergeProps,
7042
+ areStatesEqual,
7043
+ areStatePropsEqual,
7044
+ areOwnPropsEqual,
7045
+ areMergedPropsEqual
7046
+ };
7035
7047
 
7036
- this.usedNamespaces = {};
7037
- }
7048
+ function ConnectFunction(props) {
7049
+ const [propsContext, reactReduxForwardedRef, wrapperProps] = useMemo(() => {
7050
+ // Distinguish between actual "data" props that were passed to the wrapper component,
7051
+ // and values needed to control behavior (forwarded refs, alternate context instances).
7052
+ // To maintain the wrapperProps object reference, memoize this destructuring.
7053
+ const {
7054
+ reactReduxForwardedRef
7055
+ } = props,
7056
+ wrapperProps = _objectWithoutPropertiesLoose(props, _excluded);
7038
7057
 
7039
- _createClass(ReportNamespaces, [{
7040
- key: "addUsedNamespaces",
7041
- value: function addUsedNamespaces(namespaces) {
7042
- var _this = this;
7058
+ return [props.context, reactReduxForwardedRef, wrapperProps];
7059
+ }, [props]);
7060
+ const ContextToUse = useMemo(() => {
7061
+ // Users may optionally pass in a custom context instance to use instead of our ReactReduxContext.
7062
+ // Memoize the check that determines which context instance we should use.
7063
+ return propsContext && propsContext.Consumer && // @ts-ignore
7064
+ isContextConsumer( /*#__PURE__*/React.createElement(propsContext.Consumer, null)) ? propsContext : Context;
7065
+ }, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available
7043
7066
 
7044
- namespaces.forEach(function (ns) {
7045
- if (!_this.usedNamespaces[ns]) _this.usedNamespaces[ns] = true;
7046
- });
7047
- }
7048
- }, {
7049
- key: "getUsedNamespaces",
7050
- value: function getUsedNamespaces() {
7051
- return Object.keys(this.usedNamespaces);
7052
- }
7053
- }]);
7067
+ const contextValue = useContext(ContextToUse); // The store _must_ exist as either a prop or in context.
7068
+ // We'll check to see if it _looks_ like a Redux store first.
7069
+ // This allows us to pass through a `store` prop that is just a plain value.
7054
7070
 
7055
- return ReportNamespaces;
7056
- }();
7057
- function context_composeInitialProps(ForComponent) {
7058
- return function (ctx) {
7059
- return new Promise(function (resolve) {
7060
- var i18nInitialProps = getInitialProps();
7071
+ const didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);
7072
+ const didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);
7061
7073
 
7062
- if (ForComponent.getInitialProps) {
7063
- ForComponent.getInitialProps(ctx).then(function (componentsInitialProps) {
7064
- resolve(context_objectSpread(context_objectSpread({}, componentsInitialProps), i18nInitialProps));
7065
- });
7066
- } else {
7067
- resolve(i18nInitialProps);
7068
- }
7069
- });
7070
- };
7071
- }
7072
- function getInitialProps() {
7073
- var i18n = getI18n();
7074
- var namespaces = i18n.reportNamespaces ? i18n.reportNamespaces.getUsedNamespaces() : [];
7075
- var ret = {};
7076
- var initialI18nStore = {};
7077
- i18n.languages.forEach(function (l) {
7078
- initialI18nStore[l] = {};
7079
- namespaces.forEach(function (ns) {
7080
- initialI18nStore[l][ns] = i18n.getResourceBundle(l, ns) || {};
7081
- });
7082
- });
7083
- ret.initialI18nStore = initialI18nStore;
7084
- ret.initialLanguage = i18n.language;
7085
- return ret;
7086
- }
7087
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/Trans.js
7074
+ if (false) {} // Based on the previous check, one of these must be true
7088
7075
 
7089
7076
 
7090
- var Trans_excluded = (/* unused pure expression or super */ null && (["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"]));
7077
+ const store = didStoreComeFromProps ? props.store : contextValue.store;
7078
+ const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState;
7079
+ const childPropsSelector = useMemo(() => {
7080
+ // The child props selector needs the store reference as an input.
7081
+ // Re-create this selector whenever the store changes.
7082
+ return defaultSelectorFactory(store.dispatch, selectorFactoryOptions);
7083
+ }, [store]);
7084
+ const [subscription, notifyNestedSubs] = useMemo(() => {
7085
+ if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component
7086
+ // connected to the store via props shouldn't use subscription from context, or vice versa.
7091
7087
 
7092
- function Trans_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
7088
+ const subscription = createSubscription(store, didStoreComeFromProps ? undefined : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
7089
+ // the middle of the notification loop, where `subscription` will then be null. This can
7090
+ // probably be avoided if Subscription's listeners logic is changed to not call listeners
7091
+ // that have been unsubscribed in the middle of the notification loop.
7093
7092
 
7094
- function Trans_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { Trans_ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { Trans_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7093
+ const notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription);
7094
+ return [subscription, notifyNestedSubs];
7095
+ }, [store, didStoreComeFromProps, contextValue]); // Determine what {store, subscription} value should be put into nested context, if necessary,
7096
+ // and memoize that value to avoid unnecessary context updates.
7095
7097
 
7098
+ const overriddenContextValue = useMemo(() => {
7099
+ if (didStoreComeFromProps) {
7100
+ // This component is directly subscribed to a store from props.
7101
+ // We don't want descendants reading from this store - pass down whatever
7102
+ // the existing context value is from the nearest connected ancestor.
7103
+ return contextValue;
7104
+ } // Otherwise, put this component's subscription instance into context, so that
7105
+ // connected descendants won't update until after this component is done
7096
7106
 
7097
7107
 
7108
+ return _extends({}, contextValue, {
7109
+ subscription
7110
+ });
7111
+ }, [didStoreComeFromProps, contextValue, subscription]); // Set up refs to coordinate values between the subscription effect and the render logic
7098
7112
 
7113
+ const lastChildProps = useRef();
7114
+ const lastWrapperProps = useRef(wrapperProps);
7115
+ const childPropsFromStoreUpdate = useRef();
7116
+ const renderIsScheduled = useRef(false);
7117
+ const isProcessingDispatch = useRef(false);
7118
+ const isMounted = useRef(false);
7119
+ const latestSubscriptionCallbackError = useRef();
7120
+ useIsomorphicLayoutEffect(() => {
7121
+ isMounted.current = true;
7122
+ return () => {
7123
+ isMounted.current = false;
7124
+ };
7125
+ }, []);
7126
+ const actualChildPropsSelector = useMemo(() => {
7127
+ const selector = () => {
7128
+ // Tricky logic here:
7129
+ // - This render may have been triggered by a Redux store update that produced new child props
7130
+ // - However, we may have gotten new wrapper props after that
7131
+ // If we have new child props, and the same wrapper props, we know we should use the new child props as-is.
7132
+ // But, if we have new wrapper props, those might change the child props, so we have to recalculate things.
7133
+ // So, we'll use the child props from store update only if the wrapper props are the same as last time.
7134
+ if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {
7135
+ return childPropsFromStoreUpdate.current;
7136
+ } // TODO We're reading the store directly in render() here. Bad idea?
7137
+ // This will likely cause Bad Things (TM) to happen in Concurrent Mode.
7138
+ // Note that we do this because on renders _not_ caused by store updates, we need the latest store state
7139
+ // to determine what the child props should be.
7099
7140
 
7100
- function Trans_Trans(_ref) {
7101
- var children = _ref.children,
7102
- count = _ref.count,
7103
- parent = _ref.parent,
7104
- i18nKey = _ref.i18nKey,
7105
- context = _ref.context,
7106
- _ref$tOptions = _ref.tOptions,
7107
- tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions,
7108
- values = _ref.values,
7109
- defaults = _ref.defaults,
7110
- components = _ref.components,
7111
- ns = _ref.ns,
7112
- i18nFromProps = _ref.i18n,
7113
- tFromProps = _ref.t,
7114
- shouldUnescape = _ref.shouldUnescape,
7115
- additionalProps = _objectWithoutProperties(_ref, Trans_excluded);
7116
7141
 
7117
- var _ref2 = useContext(I18nContext) || {},
7118
- i18nFromContext = _ref2.i18n,
7119
- defaultNSFromContext = _ref2.defaultNS;
7142
+ return childPropsSelector(store.getState(), wrapperProps);
7143
+ };
7120
7144
 
7121
- var i18n = i18nFromProps || i18nFromContext || getI18n();
7122
- var t = tFromProps || i18n && i18n.t.bind(i18n);
7123
- return TransWithoutContext(Trans_objectSpread({
7124
- children: children,
7125
- count: count,
7126
- parent: parent,
7127
- i18nKey: i18nKey,
7128
- context: context,
7129
- tOptions: tOptions,
7130
- values: values,
7131
- defaults: defaults,
7132
- components: components,
7133
- ns: ns || t && t.ns || defaultNSFromContext || i18n && i18n.options && i18n.options.defaultNS,
7134
- i18n: i18n,
7135
- t: tFromProps,
7136
- shouldUnescape: shouldUnescape
7137
- }, additionalProps));
7138
- }
7139
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
7140
- function _arrayWithHoles(r) {
7141
- if (Array.isArray(r)) return r;
7142
- }
7143
-
7144
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
7145
- function _iterableToArrayLimit(r, l) {
7146
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
7147
- if (null != t) {
7148
- var e,
7149
- n,
7150
- i,
7151
- u,
7152
- a = [],
7153
- f = !0,
7154
- o = !1;
7155
- try {
7156
- if (i = (t = t.call(r)).next, 0 === l) {
7157
- if (Object(t) !== t) return;
7158
- f = !1;
7159
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
7160
- } catch (r) {
7161
- o = !0, n = r;
7162
- } finally {
7163
- try {
7164
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
7165
- } finally {
7166
- if (o) throw n;
7167
- }
7168
- }
7169
- return a;
7170
- }
7171
- }
7172
-
7173
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
7174
- function _arrayLikeToArray(r, a) {
7175
- (null == a || a > r.length) && (a = r.length);
7176
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
7177
- return n;
7178
- }
7179
-
7180
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
7145
+ return selector;
7146
+ }, [store, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns
7147
+ // about useLayoutEffect in SSR, so we try to detect environment and fall back to
7148
+ // just useEffect instead to avoid the warning, since neither will run anyway.
7181
7149
 
7182
- function _unsupportedIterableToArray(r, a) {
7183
- if (r) {
7184
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
7185
- var t = {}.toString.call(r).slice(8, -1);
7186
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
7187
- }
7188
- }
7150
+ const subscribeForReact = useMemo(() => {
7151
+ const subscribe = reactListener => {
7152
+ if (!subscription) {
7153
+ return () => {};
7154
+ }
7189
7155
 
7190
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
7191
- function _nonIterableRest() {
7192
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7193
- }
7156
+ return subscribeUpdates(shouldHandleStateChanges, store, subscription, // @ts-ignore
7157
+ childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, reactListener);
7158
+ };
7194
7159
 
7195
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
7160
+ return subscribe;
7161
+ }, [subscription]);
7162
+ useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs]);
7163
+ let actualChildProps;
7196
7164
 
7165
+ try {
7166
+ actualChildProps = useSyncExternalStore( // TODO We're passing through a big wrapper that does a bunch of extra side effects besides subscribing
7167
+ subscribeForReact, // TODO This is incredibly hacky. We've already processed the store update and calculated new child props,
7168
+ // TODO and we're just passing that through so it triggers a re-render for us rather than relying on `uSES`.
7169
+ actualChildPropsSelector, getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector);
7170
+ } catch (err) {
7171
+ if (latestSubscriptionCallbackError.current) {
7172
+ ;
7173
+ err.message += `\nThe error may be correlated with this previous error:\n${latestSubscriptionCallbackError.current.stack}\n\n`;
7174
+ }
7197
7175
 
7176
+ throw err;
7177
+ }
7198
7178
 
7179
+ useIsomorphicLayoutEffect(() => {
7180
+ latestSubscriptionCallbackError.current = undefined;
7181
+ childPropsFromStoreUpdate.current = undefined;
7182
+ lastChildProps.current = actualChildProps;
7183
+ }); // Now that all that's done, we can finally try to actually render the child component.
7184
+ // We memoize the elements for the rendered child component as an optimization.
7199
7185
 
7200
- function slicedToArray_slicedToArray(r, e) {
7201
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
7202
- }
7186
+ const renderedWrappedComponent = useMemo(() => {
7187
+ return (
7188
+ /*#__PURE__*/
7189
+ // @ts-ignore
7190
+ React.createElement(WrappedComponent, _extends({}, actualChildProps, {
7191
+ ref: reactReduxForwardedRef
7192
+ }))
7193
+ );
7194
+ }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering
7195
+ // that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate.
7203
7196
 
7204
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/useTranslation.js
7197
+ const renderedChild = useMemo(() => {
7198
+ if (shouldHandleStateChanges) {
7199
+ // If this component is subscribed to store updates, we need to pass its own
7200
+ // subscription instance down to our descendants. That means rendering the same
7201
+ // Context instance, and putting a different value into the context.
7202
+ return /*#__PURE__*/React.createElement(ContextToUse.Provider, {
7203
+ value: overriddenContextValue
7204
+ }, renderedWrappedComponent);
7205
+ }
7205
7206
 
7207
+ return renderedWrappedComponent;
7208
+ }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);
7209
+ return renderedChild;
7210
+ }
7206
7211
 
7212
+ const _Connect = React.memo(ConnectFunction);
7207
7213
 
7214
+ // Add a hacky cast to get the right output type
7215
+ const Connect = _Connect;
7216
+ Connect.WrappedComponent = WrappedComponent;
7217
+ Connect.displayName = ConnectFunction.displayName = displayName;
7208
7218
 
7209
- function useTranslation_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
7219
+ if (forwardRef) {
7220
+ const _forwarded = React.forwardRef(function forwardConnectRef(props, ref) {
7221
+ // @ts-ignore
7222
+ return /*#__PURE__*/React.createElement(Connect, _extends({}, props, {
7223
+ reactReduxForwardedRef: ref
7224
+ }));
7225
+ });
7210
7226
 
7211
- function useTranslation_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { useTranslation_ownKeys(Object(source), true).forEach(function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { useTranslation_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7227
+ const forwarded = _forwarded;
7228
+ forwarded.displayName = displayName;
7229
+ forwarded.WrappedComponent = WrappedComponent;
7230
+ return hoistStatics(forwarded, WrappedComponent);
7231
+ }
7212
7232
 
7233
+ return hoistStatics(Connect, WrappedComponent);
7234
+ };
7213
7235
 
7236
+ return wrapWithConnect;
7237
+ }
7214
7238
 
7239
+ /* harmony default export */ const components_connect = ((/* unused pure expression or super */ null && (connect)));
7240
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/components/Provider.js
7215
7241
 
7216
7242
 
7217
- var usePrevious = function usePrevious(value, ignore) {
7218
- var ref = (0,react.useRef)();
7219
- (0,react.useEffect)(function () {
7220
- ref.current = ignore ? ref.current : value;
7221
- }, [value, ignore]);
7222
- return ref.current;
7223
- };
7224
7243
 
7225
- function useTranslation_useTranslation(ns) {
7226
- var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7227
- var i18nFromProps = props.i18n;
7228
7244
 
7229
- var _ref = (0,react.useContext)(context_I18nContext) || {},
7230
- i18nFromContext = _ref.i18n,
7231
- defaultNSFromContext = _ref.defaultNS;
7232
7245
 
7233
- var i18n = i18nFromProps || i18nFromContext || i18nInstance_getI18n();
7234
- if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
7246
+ function Provider({
7247
+ store,
7248
+ context,
7249
+ children,
7250
+ serverState
7251
+ }) {
7252
+ const contextValue = useMemo(() => {
7253
+ const subscription = createSubscription(store);
7254
+ return {
7255
+ store,
7256
+ subscription,
7257
+ getServerState: serverState ? () => serverState : undefined
7258
+ };
7259
+ }, [store, serverState]);
7260
+ const previousState = useMemo(() => store.getState(), [store]);
7261
+ useIsomorphicLayoutEffect(() => {
7262
+ const {
7263
+ subscription
7264
+ } = contextValue;
7265
+ subscription.onStateChange = subscription.notifyNestedSubs;
7266
+ subscription.trySubscribe();
7235
7267
 
7236
- if (!i18n) {
7237
- utils_warnOnce('You will need to pass in an i18next instance by using initReactI18next');
7268
+ if (previousState !== store.getState()) {
7269
+ subscription.notifyNestedSubs();
7270
+ }
7238
7271
 
7239
- var notReadyT = function notReadyT(k, optsOrDefaultValue) {
7240
- if (typeof optsOrDefaultValue === 'string') return optsOrDefaultValue;
7241
- if (optsOrDefaultValue && typeof_typeof(optsOrDefaultValue) === 'object' && typeof optsOrDefaultValue.defaultValue === 'string') return optsOrDefaultValue.defaultValue;
7242
- return Array.isArray(k) ? k[k.length - 1] : k;
7272
+ return () => {
7273
+ subscription.tryUnsubscribe();
7274
+ subscription.onStateChange = undefined;
7243
7275
  };
7276
+ }, [contextValue, previousState]);
7277
+ const Context = context || ReactReduxContext; // @ts-ignore 'AnyAction' is assignable to the constraint of type 'A', but 'A' could be instantiated with a different subtype
7244
7278
 
7245
- var retNotReady = [notReadyT, {}, false];
7246
- retNotReady.t = notReadyT;
7247
- retNotReady.i18n = {};
7248
- retNotReady.ready = false;
7249
- return retNotReady;
7250
- }
7279
+ return /*#__PURE__*/React.createElement(Context.Provider, {
7280
+ value: contextValue
7281
+ }, children);
7282
+ }
7251
7283
 
7252
- if (i18n.options.react && i18n.options.react.wait !== undefined) utils_warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');
7284
+ /* harmony default export */ const components_Provider = ((/* unused pure expression or super */ null && (Provider)));
7285
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/hooks/useStore.js
7253
7286
 
7254
- var i18nOptions = useTranslation_objectSpread(useTranslation_objectSpread(useTranslation_objectSpread({}, defaults_getDefaults()), i18n.options.react), props);
7255
7287
 
7256
- var useSuspense = i18nOptions.useSuspense,
7257
- keyPrefix = i18nOptions.keyPrefix;
7258
- var namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
7259
- namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
7260
- if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
7261
- var ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(function (n) {
7262
- return hasLoadedNamespace(n, i18n, i18nOptions);
7263
- });
7264
7288
 
7265
- function getT() {
7266
- return i18n.getFixedT(props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
7267
- }
7289
+ /**
7290
+ * Hook factory, which creates a `useStore` hook bound to a given context.
7291
+ *
7292
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
7293
+ * @returns {Function} A `useStore` hook bound to the specified context.
7294
+ */
7268
7295
 
7269
- var _useState = (0,react.useState)(getT),
7270
- _useState2 = slicedToArray_slicedToArray(_useState, 2),
7271
- t = _useState2[0],
7272
- setT = _useState2[1];
7296
+ function createStoreHook(context = Context_ReactReduxContext) {
7297
+ const useReduxContext = // @ts-ignore
7298
+ context === Context_ReactReduxContext ? useReduxContext_useReduxContext : () => (0,react.useContext)(context);
7299
+ return function useStore() {
7300
+ const {
7301
+ store
7302
+ } = useReduxContext(); // @ts-ignore
7273
7303
 
7274
- var joinedNS = namespaces.join();
7275
- if (props.lng) joinedNS = "".concat(props.lng).concat(joinedNS);
7276
- var previousJoinedNS = usePrevious(joinedNS);
7277
- var isMounted = (0,react.useRef)(true);
7278
- (0,react.useEffect)(function () {
7279
- var bindI18n = i18nOptions.bindI18n,
7280
- bindI18nStore = i18nOptions.bindI18nStore;
7281
- isMounted.current = true;
7282
-
7283
- if (!ready && !useSuspense) {
7284
- if (props.lng) {
7285
- loadLanguages(i18n, props.lng, namespaces, function () {
7286
- if (isMounted.current) setT(getT);
7287
- });
7288
- } else {
7289
- loadNamespaces(i18n, namespaces, function () {
7290
- if (isMounted.current) setT(getT);
7291
- });
7292
- }
7293
- }
7294
-
7295
- if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
7296
- setT(getT);
7297
- }
7298
-
7299
- function boundReset() {
7300
- if (isMounted.current) setT(getT);
7301
- }
7302
-
7303
- if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
7304
- if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
7305
- return function () {
7306
- isMounted.current = false;
7307
- if (bindI18n && i18n) bindI18n.split(' ').forEach(function (e) {
7308
- return i18n.off(e, boundReset);
7309
- });
7310
- if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(function (e) {
7311
- return i18n.store.off(e, boundReset);
7312
- });
7313
- };
7314
- }, [i18n, joinedNS]);
7315
- var isInitial = (0,react.useRef)(true);
7316
- (0,react.useEffect)(function () {
7317
- if (isMounted.current && !isInitial.current) {
7318
- setT(getT);
7319
- }
7320
-
7321
- isInitial.current = false;
7322
- }, [i18n, keyPrefix]);
7323
- var ret = [t, i18n, ready];
7324
- ret.t = t;
7325
- ret.i18n = i18n;
7326
- ret.ready = ready;
7327
- if (ready) return ret;
7328
- if (!ready && !useSuspense) return ret;
7329
- throw new Promise(function (resolve) {
7330
- if (props.lng) {
7331
- loadLanguages(i18n, props.lng, namespaces, function () {
7332
- return resolve();
7333
- });
7334
- } else {
7335
- loadNamespaces(i18n, namespaces, function () {
7336
- return resolve();
7337
- });
7338
- }
7339
- });
7304
+ return store;
7305
+ };
7340
7306
  }
7341
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/withTranslation.js
7342
-
7343
-
7344
-
7345
- var withTranslation_excluded = (/* unused pure expression or super */ null && (["forwardedRef"]));
7346
-
7347
- function withTranslation_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
7348
-
7349
- function withTranslation_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { withTranslation_ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { withTranslation_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7350
-
7351
-
7352
-
7353
-
7354
- function withTranslation(ns) {
7355
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7356
- return function Extend(WrappedComponent) {
7357
- function I18nextWithTranslation(_ref) {
7358
- var forwardedRef = _ref.forwardedRef,
7359
- rest = _objectWithoutProperties(_ref, withTranslation_excluded);
7360
-
7361
- var _useTranslation = useTranslation(ns, withTranslation_objectSpread(withTranslation_objectSpread({}, rest), {}, {
7362
- keyPrefix: options.keyPrefix
7363
- })),
7364
- _useTranslation2 = _slicedToArray(_useTranslation, 3),
7365
- t = _useTranslation2[0],
7366
- i18n = _useTranslation2[1],
7367
- ready = _useTranslation2[2];
7368
-
7369
- var passDownProps = withTranslation_objectSpread(withTranslation_objectSpread({}, rest), {}, {
7370
- t: t,
7371
- i18n: i18n,
7372
- tReady: ready
7373
- });
7307
+ /**
7308
+ * A hook to access the redux store.
7309
+ *
7310
+ * @returns {any} the redux store
7311
+ *
7312
+ * @example
7313
+ *
7314
+ * import React from 'react'
7315
+ * import { useStore } from 'react-redux'
7316
+ *
7317
+ * export const ExampleComponent = () => {
7318
+ * const store = useStore()
7319
+ * return <div>{store.getState()}</div>
7320
+ * }
7321
+ */
7374
7322
 
7375
- if (options.withRef && forwardedRef) {
7376
- passDownProps.ref = forwardedRef;
7377
- } else if (!options.withRef && forwardedRef) {
7378
- passDownProps.forwardedRef = forwardedRef;
7379
- }
7323
+ const useStore_useStore = /*#__PURE__*/createStoreHook();
7324
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/hooks/useDispatch.js
7380
7325
 
7381
- return createElement(WrappedComponent, passDownProps);
7382
- }
7383
7326
 
7384
- I18nextWithTranslation.displayName = "withI18nextTranslation(".concat(getDisplayName(WrappedComponent), ")");
7385
- I18nextWithTranslation.WrappedComponent = WrappedComponent;
7327
+ /**
7328
+ * Hook factory, which creates a `useDispatch` hook bound to a given context.
7329
+ *
7330
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
7331
+ * @returns {Function} A `useDispatch` hook bound to the specified context.
7332
+ */
7386
7333
 
7387
- var forwardRef = function forwardRef(props, ref) {
7388
- return createElement(I18nextWithTranslation, Object.assign({}, props, {
7389
- forwardedRef: ref
7390
- }));
7391
- };
7334
+ function createDispatchHook(context = Context_ReactReduxContext) {
7335
+ const useStore = // @ts-ignore
7336
+ context === Context_ReactReduxContext ? useStore_useStore : createStoreHook(context);
7337
+ return function useDispatch() {
7338
+ const store = useStore(); // @ts-ignore
7392
7339
 
7393
- return options.withRef ? forwardRefReact(forwardRef) : I18nextWithTranslation;
7340
+ return store.dispatch;
7394
7341
  };
7395
7342
  }
7396
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/Translation.js
7397
-
7398
-
7399
- var Translation_excluded = (/* unused pure expression or super */ null && (["ns", "children"]));
7343
+ /**
7344
+ * A hook to access the redux `dispatch` function.
7345
+ *
7346
+ * @returns {any|function} redux store's `dispatch` function
7347
+ *
7348
+ * @example
7349
+ *
7350
+ * import React, { useCallback } from 'react'
7351
+ * import { useDispatch } from 'react-redux'
7352
+ *
7353
+ * export const CounterComponent = ({ value }) => {
7354
+ * const dispatch = useDispatch()
7355
+ * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])
7356
+ * return (
7357
+ * <div>
7358
+ * <span>{value}</span>
7359
+ * <button onClick={increaseCounter}>Increase counter</button>
7360
+ * </div>
7361
+ * )
7362
+ * }
7363
+ */
7400
7364
 
7401
- function Translation(props) {
7402
- var ns = props.ns,
7403
- children = props.children,
7404
- options = _objectWithoutProperties(props, Translation_excluded);
7365
+ const useDispatch_useDispatch = /*#__PURE__*/createDispatchHook();
7366
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/exports.js
7405
7367
 
7406
- var _useTranslation = useTranslation(ns, options),
7407
- _useTranslation2 = _slicedToArray(_useTranslation, 3),
7408
- t = _useTranslation2[0],
7409
- i18n = _useTranslation2[1],
7410
- ready = _useTranslation2[2];
7411
7368
 
7412
- return children(t, {
7413
- i18n: i18n,
7414
- lng: i18n.language
7415
- }, ready);
7416
- }
7417
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/I18nextProvider.js
7418
7369
 
7419
7370
 
7420
- function I18nextProvider(_ref) {
7421
- var i18n = _ref.i18n,
7422
- defaultNS = _ref.defaultNS,
7423
- children = _ref.children;
7424
- var value = useMemo(function () {
7425
- return {
7426
- i18n: i18n,
7427
- defaultNS: defaultNS
7428
- };
7429
- }, [i18n, defaultNS]);
7430
- return createElement(I18nContext.Provider, {
7431
- value: value
7432
- }, children);
7433
- }
7434
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/useSSR.js
7435
7371
 
7436
7372
 
7437
- function useSSR_useSSR(initialI18nStore, initialLanguage) {
7438
- var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
7439
- var i18nFromProps = props.i18n;
7440
7373
 
7441
- var _ref = useContext(I18nContext) || {},
7442
- i18nFromContext = _ref.i18n;
7443
7374
 
7444
- var i18n = i18nFromProps || i18nFromContext || getI18n();
7445
- if (i18n.options && i18n.options.isClone) return;
7446
7375
 
7447
- if (initialI18nStore && !i18n.initializedStoreOnce) {
7448
- i18n.services.resourceStore.data = initialI18nStore;
7449
- i18n.options.ns = Object.values(initialI18nStore).reduce(function (mem, lngResources) {
7450
- Object.keys(lngResources).forEach(function (ns) {
7451
- if (mem.indexOf(ns) < 0) mem.push(ns);
7452
- });
7453
- return mem;
7454
- }, i18n.options.ns);
7455
- i18n.initializedStoreOnce = true;
7456
- i18n.isInitialized = true;
7457
- }
7376
+ ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/index.js
7377
+ // The primary entry point assumes we're working with standard ReactDOM/RN, but
7378
+ // older versions that do not include `useSyncExternalStore` (React 16.9 - 17.x).
7379
+ // Because of that, the useSyncExternalStore compat shim is needed.
7458
7380
 
7459
- if (initialLanguage && !i18n.initializedLanguageOnce) {
7460
- i18n.changeLanguage(initialLanguage);
7461
- i18n.initializedLanguageOnce = true;
7462
- }
7463
- }
7464
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/withSSR.js
7465
7381
 
7466
7382
 
7467
- var withSSR_excluded = (/* unused pure expression or super */ null && (["initialI18nStore", "initialLanguage"]));
7468
7383
 
7469
- function withSSR_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
7470
7384
 
7471
- function withSSR_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { withSSR_ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { withSSR_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7472
7385
 
7386
+ initializeUseSelector(with_selector.useSyncExternalStoreWithSelector);
7387
+ initializeConnect(shim.useSyncExternalStore); // Enable batched updates in our subscriptions for use
7388
+ // with standard React renderers (ReactDOM, React Native)
7473
7389
 
7390
+ setBatch(react_dom.unstable_batchedUpdates);
7474
7391
 
7475
7392
 
7393
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/hooks/useSafeSelector.ts
7476
7394
 
7477
- function withSSR() {
7478
- return function Extend(WrappedComponent) {
7479
- function I18nextWithSSR(_ref) {
7480
- var initialI18nStore = _ref.initialI18nStore,
7481
- initialLanguage = _ref.initialLanguage,
7482
- rest = _objectWithoutProperties(_ref, withSSR_excluded);
7395
+ const useSafeSelector = selector => {
7396
+ try {
7397
+ return useSelector_useSelector(selector);
7398
+ } catch (error) {
7399
+ return {};
7400
+ }
7401
+ };
7402
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Input/InputViewTwo.tsx
7483
7403
 
7484
- useSSR(initialI18nStore, initialLanguage);
7485
- return createElement(WrappedComponent, withSSR_objectSpread({}, rest));
7486
- }
7487
7404
 
7488
- I18nextWithSSR.getInitialProps = composeInitialProps(WrappedComponent);
7489
- I18nextWithSSR.displayName = "withI18nextSSR(".concat(getDisplayName(WrappedComponent), ")");
7490
- I18nextWithSSR.WrappedComponent = WrappedComponent;
7491
- return I18nextWithSSR;
7492
- };
7493
- }
7494
- ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/index.js
7495
7405
 
7496
7406
 
7497
-
7498
-
7499
-
7500
-
7501
-
7502
-
7503
-
7504
-
7505
-
7506
-
7507
- var date = function date() {
7508
- return '';
7509
- };
7510
- var time = function time() {
7511
- return '';
7512
- };
7513
- var number = function number() {
7514
- return '';
7515
- };
7516
- var es_select = function select() {
7517
- return '';
7518
- };
7519
- var plural = function plural() {
7520
- return '';
7521
- };
7522
- var selectOrdinal = function selectOrdinal() {
7523
- return '';
7524
- };
7525
- // EXTERNAL MODULE: ../../node_modules/card-validator/dist/index.js
7526
- var dist = __webpack_require__(9344);
7527
- var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
7528
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Input/input.module.scss
7529
- // extracted by mini-css-extract-plugin
7530
- /* harmony default export */ const input_module = ({"container":"input_container__jJNTc","input-container":"input_input-container__VJgnA","input-container-new":"input_input-container-new__nDtFv","input-container-new-reverse":"input_input-container-new-reverse__vtQte","input-filled":"input_input-filled__XXPf+","downpayment-filled":"input_downpayment-filled__-DUjp","input-container-reverse":"input_input-container-reverse__8jy-R"});
7531
- // EXTERNAL MODULE: ../../node_modules/react/jsx-runtime.js
7532
- var jsx_runtime = __webpack_require__(1085);
7533
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Input/index.tsx
7534
-
7535
-
7536
- function Input_Input(props) {
7407
+ function InputViewTwo_InputViewTwo(props) {
7408
+ var _customStyle$placehol;
7537
7409
  const {
7538
7410
  name,
7539
7411
  placeholder,
@@ -7544,15 +7416,18 @@ function Input_Input(props) {
7544
7416
  value,
7545
7417
  maxLength,
7546
7418
  className,
7547
- newDesign,
7419
+ borderStyle,
7548
7420
  type,
7421
+ icon,
7549
7422
  error,
7550
- logoOnRight,
7551
7423
  inputMode,
7552
7424
  autoFocus,
7553
7425
  disabled,
7554
7426
  customStyle
7555
7427
  } = props;
7428
+ const {
7429
+ borderStyle: borderStyleState = borderStyle
7430
+ } = useSafeSelector(state => state.customization);
7556
7431
  const handleChange = e => {
7557
7432
  const regexIsNumber = /^\d+$/;
7558
7433
  const isInputEmpty = e.target.value === '';
@@ -7562,16 +7437,22 @@ function Input_Input(props) {
7562
7437
  onChange && onChange(e);
7563
7438
  }
7564
7439
  };
7565
- return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
7566
- className: input_module['container'],
7567
- children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
7568
- className: [input_module['input-container'], className, newDesign ? input_module['input-container-new'] : '', logoOnRight ? input_module['input-container-reverse'] : '', value && newDesign ? input_module['input-container-reverse'] : ''].join(' '),
7569
- style: customStyle,
7440
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
7441
+ className: "flex flex-col w-full [&_*]:border-box relative",
7442
+ children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
7443
+ className: [`flex justify-between items-center gap-2 py-2.5 px-3 w-full h-10 relative overflow-hidden border border-gray-300 ${borderStyleState === borderStyle_borderStyleConstants.RECTANGULAR ? 'rounded-none' : 'rounded-lg'} bg-white`, className].join(' '),
7444
+ style: customStyle != null && customStyle.input ? customStyle == null ? void 0 : customStyle.input : customStyle,
7570
7445
  children: [label && /*#__PURE__*/(0,jsx_runtime.jsx)("label", {
7571
- className: value ? input_module['input-filled'] : '',
7446
+ className: "w-5 h-5 text-sm flex justify-start items-center whitespace-nowrap text-end",
7572
7447
  htmlFor: name,
7573
7448
  children: label
7574
7449
  }), /*#__PURE__*/(0,jsx_runtime.jsx)("input", {
7450
+ className: "w-full !rounded-none border-none focus:outline-none [&::placeholder]:text-[var(--placeholder-color)]",
7451
+ style: {
7452
+ paddingInlineEnd: '1rem',
7453
+ backgroundColor: 'inherit',
7454
+ '--placeholder-color': (customStyle == null || (_customStyle$placehol = customStyle.placeholder) == null ? void 0 : _customStyle$placehol.color) || '#667085'
7455
+ },
7575
7456
  id: name,
7576
7457
  name: name,
7577
7458
  type: type,
@@ -7585,1294 +7466,1410 @@ function Input_Input(props) {
7585
7466
  inputMode: inputMode,
7586
7467
  autoFocus: autoFocus,
7587
7468
  disabled: disabled
7469
+ }), icon && icon, error && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
7470
+ className: "w-3 h-3",
7471
+ src: error_namespaceObject,
7472
+ alt: "error"
7588
7473
  })]
7589
- }), error && /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
7590
- children: error
7591
- })]
7474
+ })
7592
7475
  });
7593
7476
  }
7594
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/assets/icons/error.png
7595
- const error_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAADsOAAA7DgHMtqGDAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABxJJREFUaIHlmm2MVGcVx3/nuXd2+7bLDLNLeAmJtPJiTVvKLAViWRkWu43GSFILES3Eag2tEtGKSY2f1KhIQ6NRDFRtI5EgNPUlakCWLq2NAruzQIkFLClqRCz7DrsiO/fe44cd4M4zM7szdxck8f9t/ufc8zL3uc895zlXVJWxIlPfOAXfTSNmAcpsRO9EqQPuABQYROlE5IyKnjDIQXfIab334t7zY/UtURPI1KbrcGQVRlajpCKYUOCwINtjweUd9/T9oTdKHBUn0JZsnm7U2wB8CrgtitMiGEDZGsSCZ+efb/1XJReWnUBGGmLE408h+g2Gl8b1wL9V2HRbT/Kbd+uuoXIuKCuBTF16DoHZBdwziqoPnBSVk4ieUxgEELg9EKaKMgeYDTgjGVGRdnxZ2dC37+0xJ9CeXPZRUX2B0v/6oMDLwO6sVL+6oPt3F0aydzSRjvs4SxBdASwHbi2h2g/68VTPK7+NnEBmYtOTwPcBU0TcBboZnC2pnn39IzkphT9NeHhitcmuU+HzQKKIiifKE/N6979YykbJBHLBbykiUkG3xYLsM1F3DhtHahrrgyp3EyprivpTHi+VRNEE2pNLHxGVn1O4VrtB14x2W6Mi5/fHwARL5IEuL+a3IIGjEx6a6Tt+BqixdP/qO9L8QGfLX8Y1agsddR94jwb+XpDplqhPA5OyH+y8tf2mrKjyHX83BcHrGdfw4PUOHmBe174TRmUx8A9LFDcS7DwgaTdM5iVwKdH9ReA+68Jux3eb7+vaf3b8wy2O+3v3/y0QfRjI2xxUmF8bN58Lc1eX0LG6pmlewCng9vA1oB+OsuYziWVrEL4FGijypYaelp2V2sht4bst+oIXk1kL3ml5B0J3wFM2WMEj6LYowbdNSk9G9HnQKcA0QV98o6Z5UqV2GrpbXgL5qUXXOlmevvLDQK4wU56wFLsu+1VfqdQpgJs1s4BYiKr2XW9OFFuxrLMB6Atzgq49Hl+cgCt3wJFVWIWZIM8t6t/TE8Wpjyl48RXjysG9F/eeR/R7Fl0zZKpWQi4BNeYxS2FQkR9EcXg9MORVfRe4FOYUVgOYTH3jFFHNq+cFXo5aHlwPLOrf06Por8OcwMIjNY31Rv3YkuHfebCf/P85jLLLoiSoii0xIrLQEniKee1GBVYuYpptZbhcvwoJWGRQZlu6J2+m5XMFucIxrxJQYbYBnRkmReXUDY2sMuTHJsw0QDzMqeg/b2RElUDRsxaRMFidlqIXb2RQlUAwdrdXE+nlcjPBAANhQhC7D7hpoAS1FnXRYNcZKlPH6sioX2wZjnlnE7FiE3oNcDrMqai9rVYM7b/wBnA8RHUM9HnHS+mXbzh/yxfltMHemmDOoeQH7VtVEVLanvWk+kFF1orwmVvd4P1LtNUbi82jiXQc8hMIhFMu6EGQdSHejelQI/CbsTjMnQ9tHYuNMHycJaB5hwwGOWhwvFZbWUUfGS/H4wbRRy1Gsy4HRFXJTGzKAPNCwoH/OJenvq/z9cjvhDdlRdWlZNf9iuhAd9AxliV0NJGO+2LOkt+zHEr17F9oAETZbl1zR7V/y5NRHWbiTXddSnQfI5CDEnCoJuG0tU1KT45qzx9e4nbDtR1yDY3ruTuwGgYRfTr34FQOwxYg1ELqXOM5G6OYOly7LInIeose9Dx2DrtiuG1T9Cd5KsqkQMzXozgFFhUwooVcGXCcYCMwMd8U2x640NINoVMJwfkOhW3bU5lk00OVOlUpUtFqwXY9KtoTSz+CyOMWPaBudtOVH1cTSPXs+zsq37aUDbD9cLx5RiWOReULQLjw6laCZyqx0V6/dLaIvIDVLQr6tVTna+eu+QqdjR6Ykb6lpt9kgLvzI+Itz5XFVw6TysGxuqZpvuqHQNQdcn9VyUAvd8j2OvAuS3SE3v4FKW3PFk0AoC259L1G5TCF86+3xQ+a5/W3nuY6IhNvugvDHuDdlmgAE8xPdbWeDJMF5fT87lf+rPBpILBEd6pj/tiRXNo8viFfQyaxbDmGNgqD91F5zA4eRhhwdCSa1qvwXBFRoOgPXdWvzu1t7SsirxiZ2nSdOM5GFf0khSckKLK2oaelaFky4ogpl8TmYkaBTmCzJ9VbRpuLlcLx+OLEkFSvQ3Q9xUdMviKfLRU8lDPkm9j0MYEfUXomPCDwi0D1JRHn1dFONI4m0vEAk1bhUUYe8l1EZXWqt+WXI9kra8yae7B3Ye9OhfCBkyqcQvWcILluT2oQncLwmHUWo4xZgSOO76yc2//7t0aL7f9j0B1GW7J5uqPel3X4U4NSt79SDKK6Fdd7NvySKgeRP/Y4UtNYH7hVq9TwCVFtiGBCQQ4p+rOsH9sR9Sg/cgJhtE1KTxbPpEVYgMocVGcg1HNt4jMAdCp6xqicwOhBdyh2YDw+t/kvOZjs8Q9V7ZMAAAAASUVORK5CYII=";
7596
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/constants/borderStyle.ts
7597
- const borderStyle_borderStyleConstants = {
7598
- ROUNDED: 'ROUNDED',
7599
- RECTANGULAR: 'RECTANGULAR'
7600
- };
7601
- // EXTERNAL MODULE: ../../node_modules/use-sync-external-store/shim/index.js
7602
- var shim = __webpack_require__(8139);
7603
- // EXTERNAL MODULE: ../../node_modules/use-sync-external-store/shim/with-selector.js
7604
- var with_selector = __webpack_require__(7121);
7605
- // EXTERNAL MODULE: ../../node_modules/react-dom/index.js
7606
- var react_dom = __webpack_require__(3144);
7607
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/utils/reactBatchedUpdates.js
7608
-
7609
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/utils/batch.js
7610
- // Default to a dummy "batch" implementation that just runs the callback
7611
- function defaultNoopBatch(callback) {
7612
- callback();
7613
- }
7614
-
7615
- let batch = (/* unused pure expression or super */ null && (defaultNoopBatch)); // Allow injecting another batching function later
7616
-
7617
- const setBatch = newBatch => batch = newBatch; // Supply a getter just to skip dealing with ESM bindings
7618
-
7619
- const batch_getBatch = () => batch;
7620
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/components/Context.js
7621
-
7622
- const Context_ReactReduxContext = /*#__PURE__*/(0,react.createContext)(null);
7623
-
7624
- if (false) {}
7477
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Loader/loader.module.scss
7478
+ // extracted by mini-css-extract-plugin
7479
+ /* harmony default export */ const loader_module = ({"loader":"loader_loader__Vp1Wk","spinner":"loader_spinner__AvfnA"});
7480
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Loader/index.tsx
7625
7481
 
7626
- /* harmony default export */ const Context = ((/* unused pure expression or super */ null && (Context_ReactReduxContext)));
7627
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/hooks/useReduxContext.js
7628
7482
 
7483
+ function Loader(props) {
7484
+ const {
7485
+ size
7486
+ } = props;
7487
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
7488
+ style: {
7489
+ width: size,
7490
+ height: size
7491
+ },
7492
+ className: loader_module['loader']
7493
+ });
7494
+ }
7495
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Button/button.module.scss
7496
+ // extracted by mini-css-extract-plugin
7497
+ /* harmony default export */ const button_module = ({"container":"button_container__Wx2Jn","btn-text":"button_btn-text__rtmpL","fullWidth":"button_fullWidth__ECvUG","primary":"button_primary__q9Ttu","secondary":"button_secondary__8nAxD","customized":"button_customized__U5VRL"});
7498
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Button/index.tsx
7629
7499
 
7630
7500
 
7631
- /**
7632
- * A hook to access the value of the `ReactReduxContext`. This is a low-level
7633
- * hook that you should usually not need to call directly.
7634
- *
7635
- * @returns {any} the value of the `ReactReduxContext`
7636
- *
7637
- * @example
7638
- *
7639
- * import React from 'react'
7640
- * import { useReduxContext } from 'react-redux'
7641
- *
7642
- * export const CounterComponent = () => {
7643
- * const { store } = useReduxContext()
7644
- * return <div>{store.getState()}</div>
7645
- * }
7646
- */
7647
- function useReduxContext_useReduxContext() {
7648
- const contextValue = (0,react.useContext)(Context_ReactReduxContext);
7649
7501
 
7650
- if (false) {}
7651
7502
 
7652
- return contextValue;
7503
+ function Button_Button(props) {
7504
+ const {
7505
+ loading,
7506
+ disabled,
7507
+ label,
7508
+ id,
7509
+ color,
7510
+ icon,
7511
+ onClick,
7512
+ type,
7513
+ fullWidth,
7514
+ customStyle,
7515
+ className
7516
+ } = props;
7517
+ const customStyleToApply = disabled && customStyle != null && customStyle.disabled ? Object.assign({}, customStyle, customStyle.disabled) : customStyle;
7518
+ const {
7519
+ colors,
7520
+ borderStyle
7521
+ } = useSafeSelector(state => state.customization);
7522
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("button", {
7523
+ style: Object.assign({
7524
+ opacity: disabled && ((colors == null ? void 0 : colors.action) || customStyleToApply) && '0.4',
7525
+ borderRadius: borderStyle === 'ROUNDED' ? '0.5rem' : !borderStyle ? 'revert-layer' : 0
7526
+ }, customStyleToApply, {
7527
+ background: id !== 'apple-pay-button' ? (colors == null ? void 0 : colors.action) || (customStyleToApply == null ? void 0 : customStyleToApply.backgroundColor) : '#000'
7528
+ }),
7529
+ className: [button_module['container'], button_module[color || 'primary'], fullWidth ? button_module['fullWidth'] : '', 'mt-4', ...(className ? [className] : [])].join(' '),
7530
+ onClick: onClick,
7531
+ disabled: disabled,
7532
+ type: type && type,
7533
+ id: id,
7534
+ children: loading ? /*#__PURE__*/(0,jsx_runtime.jsx)(Loader, {
7535
+ size: 16
7536
+ }) : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
7537
+ children: [icon && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
7538
+ src: icon,
7539
+ alt: label
7540
+ }), label && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
7541
+ className: `${button_module['btn-text']} !border-none`,
7542
+ style: Object.assign({}, (customStyleToApply == null ? void 0 : customStyleToApply['fontSize']) && {
7543
+ fontSize: customStyleToApply['fontSize']
7544
+ }, (customStyleToApply == null ? void 0 : customStyleToApply['fontWeight']) && {
7545
+ fontWeight: customStyleToApply['fontWeight']
7546
+ }),
7547
+ children: label
7548
+ })]
7549
+ })
7550
+ });
7653
7551
  }
7654
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/utils/useSyncExternalStore.js
7655
- const useSyncExternalStore_notInitialized = () => {
7656
- throw new Error('uSES not initialized!');
7657
- };
7658
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/hooks/useSelector.js
7659
-
7660
-
7552
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/assets/icons/circle.svg
7553
+ var _path;
7554
+ var circle_excluded = (/* unused pure expression or super */ null && (["title", "titleId"]));
7555
+ function circle_extends() { return circle_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, circle_extends.apply(null, arguments); }
7556
+ function circle_objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = circle_objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
7557
+ function circle_objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
7661
7558
 
7662
7559
 
7663
- let useSyncExternalStoreWithSelector = useSyncExternalStore_notInitialized;
7664
- const initializeUseSelector = fn => {
7665
- useSyncExternalStoreWithSelector = fn;
7560
+ var SvgCircle = function SvgCircle(_ref, ref) {
7561
+ var title = _ref.title,
7562
+ titleId = _ref.titleId,
7563
+ props = circle_objectWithoutProperties(_ref, circle_excluded);
7564
+ return /*#__PURE__*/React.createElement("svg", circle_extends({
7565
+ width: 24,
7566
+ height: 24,
7567
+ viewBox: "0 0 24 24",
7568
+ fill: "none",
7569
+ xmlns: "http://www.w3.org/2000/svg",
7570
+ ref: ref,
7571
+ "aria-labelledby": titleId
7572
+ }, props), title ? /*#__PURE__*/React.createElement("title", {
7573
+ id: titleId
7574
+ }, title) : null, _path || (_path = /*#__PURE__*/React.createElement("path", {
7575
+ d: "M21 12C21 16.9922 16.957 21 12 21C7.00781 21 3 16.9922 3 12C3 7.04297 7.00781 3 12 3C16.957 3 21 7.04297 21 12ZM12 4.6875C7.95703 4.6875 4.6875 7.99219 4.6875 12C4.6875 16.043 7.95703 19.3125 12 19.3125C16.0078 19.3125 19.3125 16.043 19.3125 12C19.3125 7.99219 16.0078 4.6875 12 4.6875Z",
7576
+ fill: "#667085"
7577
+ })));
7666
7578
  };
7579
+ var ForwardRef = /*#__PURE__*/(/* unused pure expression or super */ null && (forwardRef(SvgCircle)));
7667
7580
 
7668
- const refEquality = (a, b) => a === b;
7669
- /**
7670
- * Hook factory, which creates a `useSelector` hook bound to a given context.
7671
- *
7672
- * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
7673
- * @returns {Function} A `useSelector` hook bound to the specified context.
7674
- */
7675
-
7581
+ /* harmony default export */ const circle = (__webpack_require__.p + "circle.22e1a0a2a35306fe278668ddabc49974.svg");
7582
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/assets/icons/check.svg
7583
+ var check_path;
7584
+ var check_excluded = (/* unused pure expression or super */ null && (["title", "titleId"]));
7585
+ function check_extends() { return check_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, check_extends.apply(null, arguments); }
7586
+ function check_objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = check_objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
7587
+ function check_objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
7676
7588
 
7677
- function createSelectorHook(context = Context_ReactReduxContext) {
7678
- const useReduxContext = context === Context_ReactReduxContext ? useReduxContext_useReduxContext : () => (0,react.useContext)(context);
7679
- return function useSelector(selector, equalityFn = refEquality) {
7680
- if (false) {}
7681
7589
 
7682
- const {
7683
- store,
7684
- subscription,
7685
- getServerState
7686
- } = useReduxContext();
7687
- const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, selector, equalityFn);
7688
- (0,react.useDebugValue)(selectedState);
7689
- return selectedState;
7590
+ var SvgCheck = function SvgCheck(_ref, ref) {
7591
+ var title = _ref.title,
7592
+ titleId = _ref.titleId,
7593
+ props = check_objectWithoutProperties(_ref, check_excluded);
7594
+ return /*#__PURE__*/React.createElement("svg", check_extends({
7595
+ xmlns: "http://www.w3.org/2000/svg",
7596
+ width: 12.87,
7597
+ height: 9.101,
7598
+ viewBox: "0 0 12.87 9.101",
7599
+ ref: ref,
7600
+ "aria-labelledby": titleId
7601
+ }, props), title ? /*#__PURE__*/React.createElement("title", {
7602
+ id: titleId
7603
+ }, title) : null, check_path || (check_path = /*#__PURE__*/React.createElement("path", {
7604
+ id: "Vector",
7605
+ d: "M0,3.343,3.343,6.686,10.042,0",
7606
+ transform: "translate(1.414 1.414)",
7607
+ fill: "none",
7608
+ stroke: "#1782fb",
7609
+ strokeLinecap: "round",
7610
+ strokeLinejoin: "round",
7611
+ strokeWidth: 2
7612
+ })));
7613
+ };
7614
+ var check_ForwardRef = /*#__PURE__*/(/* unused pure expression or super */ null && (forwardRef(SvgCheck)));
7615
+
7616
+ /* harmony default export */ const icons_check = (__webpack_require__.p + "check.021d9dd3dee18e90e138da39f88ef694.svg");
7617
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/assets/icons/chevron-down.svg
7618
+ var chevron_down_path;
7619
+ var chevron_down_excluded = (/* unused pure expression or super */ null && (["title", "titleId"]));
7620
+ function chevron_down_extends() { return chevron_down_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, chevron_down_extends.apply(null, arguments); }
7621
+ function chevron_down_objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = chevron_down_objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
7622
+ function chevron_down_objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
7623
+
7624
+
7625
+ var SvgChevronDown = function SvgChevronDown(_ref, ref) {
7626
+ var title = _ref.title,
7627
+ titleId = _ref.titleId,
7628
+ props = chevron_down_objectWithoutProperties(_ref, chevron_down_excluded);
7629
+ return /*#__PURE__*/React.createElement("svg", chevron_down_extends({
7630
+ width: 12,
7631
+ height: 12,
7632
+ viewBox: "0 0 12 12",
7633
+ fill: "none",
7634
+ xmlns: "http://www.w3.org/2000/svg",
7635
+ ref: ref,
7636
+ "aria-labelledby": titleId
7637
+ }, props), title ? /*#__PURE__*/React.createElement("title", {
7638
+ id: titleId
7639
+ }, title) : null, chevron_down_path || (chevron_down_path = /*#__PURE__*/React.createElement("path", {
7640
+ d: "M9.66488 4.69564L6.30746 7.91244C6.20199 8.00033 6.09652 8.03549 6.00863 8.03549C5.90316 8.03549 5.79769 8.00033 5.7098 7.93002L2.3348 4.69564C2.15902 4.53744 2.15902 4.25619 2.31723 4.09799C2.47543 3.92221 2.75668 3.92221 2.91488 4.08041L6.00863 7.03353L9.0848 4.08041C9.24301 3.92221 9.52426 3.92221 9.68246 4.09799C9.84066 4.25619 9.84066 4.53744 9.66488 4.69564Z",
7641
+ fill: "#667085"
7642
+ })));
7643
+ };
7644
+ var chevron_down_ForwardRef = /*#__PURE__*/(/* unused pure expression or super */ null && (forwardRef(SvgChevronDown)));
7645
+
7646
+ /* harmony default export */ const chevron_down = (__webpack_require__.p + "chevron-down.413212cab44b2a7ef0f299360be6f2b1.svg");
7647
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/hooks/useCloseDropdown.ts
7648
+
7649
+ function useCloseDropdown_useCloseDropdown(setShowDropdown) {
7650
+ const inputContainerRef = (0,react.useRef)(null);
7651
+ (0,react.useEffect)(() => {
7652
+ function handleClickOutside(e) {
7653
+ if (inputContainerRef.current && !inputContainerRef.current.contains(e.target)) {
7654
+ setShowDropdown(false);
7655
+ }
7656
+ }
7657
+ document.addEventListener('mousedown', handleClickOutside);
7658
+ return () => document.removeEventListener('mousedown', handleClickOutside);
7659
+ }, []);
7660
+ return inputContainerRef;
7661
+ }
7662
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Dropdown/DropdownViewTwo.tsx
7663
+
7664
+
7665
+
7666
+
7667
+
7668
+
7669
+
7670
+
7671
+ function DropdownViewTwo_Dropdown(props) {
7672
+ const [option, setOptin] = (0,react.useState)(null);
7673
+ const {
7674
+ label,
7675
+ options,
7676
+ onChange,
7677
+ customStyle
7678
+ } = props;
7679
+ const [show, setShow] = (0,react.useState)(false);
7680
+ const {
7681
+ borderStyle
7682
+ } = useSelector_useSelector(state => state.customization);
7683
+ const inputContainerRef = useCloseDropdown_useCloseDropdown(setShow);
7684
+ const selectOption = option => {
7685
+ setOptin(option);
7686
+ onChange(option);
7687
+ setShow(false);
7690
7688
  };
7689
+ const removeSelectedOption = e => {
7690
+ e.stopPropagation();
7691
+ setOptin(null);
7692
+ onChange();
7693
+ };
7694
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
7695
+ ref: inputContainerRef,
7696
+ className: "h-10",
7697
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
7698
+ className: `
7699
+ h-10 box-border flex items-center border px-2 relative cursor-pointer border-gray-300
7700
+ ${show ? 'border-[#7294FF] shadow-[0_0_2px_4px_#B9CAFF]' : ''}
7701
+ ${borderStyle === borderStyle_borderStyleConstants.RECTANGULAR ? 'rounded-none' : 'rounded-lg'}
7702
+ `,
7703
+ onClick: () => setShow(prev => !prev),
7704
+ style: customStyle,
7705
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
7706
+ className: "text-sm font-normal",
7707
+ children: option && option.label ? /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
7708
+ children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
7709
+ className: "flex items-center h-8 cursor-pointer",
7710
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
7711
+ className: "w-auto h-6 mr-2",
7712
+ src: circle,
7713
+ alt: option.label
7714
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)("h6", {
7715
+ className: "text-sm block my-auto mx-0 text-gray-900",
7716
+ children: option.label
7717
+ })]
7718
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
7719
+ className: "absolute right-4 top-1/2 -translate-y-1/2 h-5 w-5 text-center text-gray-700 transition-all",
7720
+ onClick: removeSelectedOption,
7721
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
7722
+ children: "\u2716"
7723
+ })
7724
+ })]
7725
+ }) : /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
7726
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
7727
+ className: "text-sm font-normal text-gray-500",
7728
+ children: label
7729
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
7730
+ className: `
7731
+ absolute right-4 top-1/2 -translate-y-1/2 h-5 w-5 text-center text-gray-700 transition-all
7732
+ ${show ? 'rotate-180' : 'rotate-0'}
7733
+ `,
7734
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
7735
+ className: "w-5 h-5 object-contain",
7736
+ src: chevron_down,
7737
+ alt: "down arrow"
7738
+ })
7739
+ })]
7740
+ })
7741
+ })
7742
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
7743
+ className: `
7744
+ relative invisible border border-gray-300 opacity-0 -translate-y-8 -z-10 transition-all bg-white
7745
+ ${show ? '!opacity-100 translate-y-0 !visible !z-10' : ''}
7746
+ ${borderStyle === 'RECTANGULAR' ? 'rounded-none' : 'rounded-lg'}
7747
+ `,
7748
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("ul", {
7749
+ className: "list-none max-h-80 overflow-y-scroll",
7750
+ children: options != null && options.length ? options.map(dropDownOption => {
7751
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
7752
+ className: `
7753
+ relative p-3 flex cursor-pointer hover:bg-gray-50
7754
+ ${(option == null ? void 0 : option.value) === dropDownOption.value ? 'bg-gray-50 hover:bg-gray-50' : ''}
7755
+ `,
7756
+ onClick: () => selectOption(dropDownOption),
7757
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
7758
+ className: "w-auto h-6 mr-2",
7759
+ src: circle,
7760
+ alt: dropDownOption.label
7761
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
7762
+ className: "text-sm font-medium block my-auto mx-0 text-gray-900",
7763
+ children: dropDownOption.label
7764
+ }), (option == null ? void 0 : option.value) === dropDownOption.value && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
7765
+ className: "absolute right-4 top-1/2 -translate-y-1/2",
7766
+ src: icons_check,
7767
+ alt: "checked"
7768
+ })]
7769
+ }, dropDownOption.value);
7770
+ }) : /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
7771
+ className: "py-3 px-4 flex h-8 cursor-pointer hover:bg-[#eeeff4] bg-[#eeeff4] justify-center",
7772
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
7773
+ className: "flex items-center",
7774
+ children: "No options"
7775
+ })
7776
+ })
7777
+ })
7778
+ })]
7779
+ });
7691
7780
  }
7692
- /**
7693
- * A hook to access the redux store's state. This hook takes a selector function
7694
- * as an argument. The selector is called with the store state.
7695
- *
7696
- * This hook takes an optional equality comparison function as the second parameter
7697
- * that allows you to customize the way the selected state is compared to determine
7698
- * whether the component needs to be re-rendered.
7699
- *
7700
- * @param {Function} selector the selector function
7701
- * @param {Function=} equalityFn the function that will be used to determine equality
7702
- *
7703
- * @returns {any} the selected state
7704
- *
7705
- * @example
7706
- *
7707
- * import React from 'react'
7708
- * import { useSelector } from 'react-redux'
7709
- *
7710
- * export const CounterComponent = () => {
7711
- * const counter = useSelector(state => state.counter)
7712
- * return <div>{counter}</div>
7713
- * }
7714
- */
7781
+ // EXTERNAL MODULE: ../../node_modules/react-phone-input-2/lib/lib.js
7782
+ var lib = __webpack_require__(3305);
7783
+ var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
7784
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Phone/phone.module.scss
7785
+ // extracted by mini-css-extract-plugin
7786
+ /* harmony default export */ const phone_module = ({"container":"phone_container__GZ4Zc","phone-input-container":"phone_phone-input-container__Jagi-","phone-input":"phone_phone-input__MR5FU","flags-button-dropdown":"phone_flags-button-dropdown__neYpm","countries-dropdown":"phone_countries-dropdown__J3Ovy"});
7787
+ ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Phone/index.tsx
7715
7788
 
7716
- const useSelector_useSelector = /*#__PURE__*/createSelectorHook();
7717
- // EXTERNAL MODULE: ../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
7718
- var hoist_non_react_statics_cjs = __webpack_require__(5985);
7719
- // EXTERNAL MODULE: ../../node_modules/react-redux/node_modules/react-is/index.js
7720
- var react_is = __webpack_require__(1524);
7721
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/utils/Subscription.js
7722
- // encapsulates the subscription logic for connecting a component to the redux store, as
7723
- // well as nesting subscriptions of descendant components, so that we can ensure the
7724
- // ancestor components re-render before descendants
7725
7789
 
7726
- function createListenerCollection() {
7727
- const batch = getBatch();
7728
- let first = null;
7729
- let last = null;
7730
- return {
7731
- clear() {
7732
- first = null;
7733
- last = null;
7734
- },
7735
7790
 
7736
- notify() {
7737
- batch(() => {
7738
- let listener = first;
7739
7791
 
7740
- while (listener) {
7741
- listener.callback();
7742
- listener = listener.next;
7743
- }
7744
- });
7745
- },
7746
7792
 
7747
- get() {
7748
- let listeners = [];
7749
- let listener = first;
7793
+ const getRegexPhoneTemp = countryName => {
7794
+ switch (countryName) {
7795
+ case 'Jordan':
7796
+ return /^(962)[3]{0,1}[7]{1}[7-9]{1}[0-9]{7}$/;
7797
+ case 'Pakistan':
7798
+ return /^(92)[0-9]{10}$/;
7799
+ case 'Saudi Arabia':
7800
+ return /^(966)[0-9]{9}$/;
7801
+ case 'United Arab Emirates':
7802
+ return /^(971)?(?:50|51|52|55|56|58|2|3|4|6|7|9)\d{7}$/;
7803
+ default:
7804
+ return /^(20)1[0125][0-9]{8}$/;
7805
+ }
7806
+ };
7807
+ const validatePhone = (value, countryName) => {
7808
+ const regexTemp = getRegexPhoneTemp(countryName);
7809
+ return value.match(regexTemp) ? '' : 'Please enter a valid number';
7810
+ };
7811
+ function Phone(props) {
7812
+ const {
7813
+ name,
7814
+ value,
7815
+ onChange,
7816
+ error,
7817
+ country,
7818
+ customStyle,
7819
+ disabled
7820
+ } = props;
7821
+ const [phoneError, setPhoneError] = react.useState(error);
7822
+ react.useEffect(() => {
7823
+ setPhoneError(error);
7824
+ }, [error]);
7825
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
7826
+ className: phone_module['container'],
7827
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)((lib_default()), {
7828
+ containerStyle: customStyle,
7829
+ inputProps: {
7830
+ name,
7831
+ required: true,
7832
+ autoFocus: false
7833
+ },
7834
+ onlyCountries: ['eg', 'ae', 'sa', 'jo', 'pk'],
7835
+ containerClass: phone_module['phone-input-container'],
7836
+ inputClass: phone_module['phone-input'],
7837
+ dropdownClass: phone_module['countries-dropdown'],
7838
+ buttonClass: phone_module['flags-button-dropdown'],
7839
+ country: country || 'eg',
7840
+ value: value,
7841
+ onChange: (value, data, e) => {
7842
+ e.target.value = '+' + value;
7843
+ setPhoneError(validatePhone(value, data.name));
7844
+ return onChange(e);
7845
+ },
7846
+ disabled: disabled
7847
+ }), phoneError && /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
7848
+ children: phoneError
7849
+ })]
7850
+ });
7851
+ }
7852
+ // EXTERNAL MODULE: ../../node_modules/void-elements/index.js
7853
+ var void_elements = __webpack_require__(9002);
7854
+ var void_elements_default = /*#__PURE__*/__webpack_require__.n(void_elements);
7855
+ ;// CONCATENATED MODULE: ../../node_modules/html-parse-stringify/dist/html-parse-stringify.module.js
7856
+ var t=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n(n){var r={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},i=n.match(/<\/?([^\s]+?)[/\s>]/);if(i&&(r.name=i[1],((void_elements_default())[i[1]]||"/"===n.charAt(n.length-2))&&(r.voidElement=!0),r.name.startsWith("!--"))){var s=n.indexOf("--\x3e");return{type:"comment",comment:-1!==s?n.slice(4,s):""}}for(var a=new RegExp(t),c=null;null!==(c=a.exec(n));)if(c[0].trim())if(c[1]){var o=c[1].trim(),l=[o,""];o.indexOf("=")>-1&&(l=o.split("=")),r.attrs[l[0]]=l[1],a.lastIndex--}else c[2]&&(r.attrs[c[2]]=c[3].trim().substring(1,c[3].length-1));return r}var r=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i=/^\s*$/,s=Object.create(null);function a(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(a,"")+"</"+t.name+">";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var c={parse:function(e,t){t||(t={}),t.components||(t.components=s);var a,c=[],o=[],l=-1,m=!1;if(0!==e.indexOf("<")){var u=e.indexOf("<");c.push({type:"text",content:-1===u?e:e.substring(0,u)})}return e.replace(r,function(r,s){if(m){if(r!=="</"+a.name+">")return;m=!1}var u,f="/"!==r.charAt(1),h=r.startsWith("\x3c!--"),p=s+r.length,d=e.charAt(p);if(h){var v=n(r);return l<0?(c.push(v),c):((u=o[l]).children.push(v),c)}if(f&&(l++,"tag"===(a=n(r)).type&&t.components[a.name]&&(a.type="component",m=!0),a.voidElement||m||!d||"<"===d||a.children.push({type:"text",content:e.slice(p,e.indexOf("<",p))}),0===l&&c.push(a),(u=o[l-1])&&u.children.push(a),o[l]=a),(!f||a.voidElement)&&(l>-1&&(a.voidElement||a.name===r.slice(2,-1))&&(l--,a=-1===l?c:o[l]),!m&&"<"!==d&&d)){u=-1===l?c:o[l].children;var x=e.indexOf("<",p),g=e.slice(p,-1===x?void 0:x);i.test(g)&&(g=" "),(x>-1&&l+u.length>=0||" "!==g)&&u.push({type:"text",content:g})}}),c},stringify:function(e){return e.reduce(function(e,t){return e+a("",t)},"")}};/* harmony default export */ const html_parse_stringify_module = ((/* unused pure expression or super */ null && (c)));
7857
+ //# sourceMappingURL=html-parse-stringify.module.js.map
7858
+
7859
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/utils.js
7860
+ function utils_warn() {
7861
+ if (console && console.warn) {
7862
+ var _console;
7863
+
7864
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
7865
+ args[_key] = arguments[_key];
7866
+ }
7867
+
7868
+ if (typeof args[0] === 'string') args[0] = "react-i18next:: ".concat(args[0]);
7750
7869
 
7751
- while (listener) {
7752
- listeners.push(listener);
7753
- listener = listener.next;
7754
- }
7870
+ (_console = console).warn.apply(_console, args);
7871
+ }
7872
+ }
7873
+ var alreadyWarned = {};
7874
+ function utils_warnOnce() {
7875
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
7876
+ args[_key2] = arguments[_key2];
7877
+ }
7755
7878
 
7756
- return listeners;
7757
- },
7879
+ if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;
7880
+ if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
7881
+ utils_warn.apply(void 0, args);
7882
+ }
7758
7883
 
7759
- subscribe(callback) {
7760
- let isSubscribed = true;
7761
- let listener = last = {
7762
- callback,
7763
- next: null,
7764
- prev: last
7884
+ var loadedClb = function loadedClb(i18n, cb) {
7885
+ return function () {
7886
+ if (i18n.isInitialized) {
7887
+ cb();
7888
+ } else {
7889
+ var initialized = function initialized() {
7890
+ setTimeout(function () {
7891
+ i18n.off('initialized', initialized);
7892
+ }, 0);
7893
+ cb();
7765
7894
  };
7766
7895
 
7767
- if (listener.prev) {
7768
- listener.prev.next = listener;
7769
- } else {
7770
- first = listener;
7771
- }
7772
-
7773
- return function unsubscribe() {
7774
- if (!isSubscribed || first === null) return;
7775
- isSubscribed = false;
7896
+ i18n.on('initialized', initialized);
7897
+ }
7898
+ };
7899
+ };
7776
7900
 
7777
- if (listener.next) {
7778
- listener.next.prev = listener.prev;
7779
- } else {
7780
- last = listener.prev;
7781
- }
7901
+ function loadNamespaces(i18n, ns, cb) {
7902
+ i18n.loadNamespaces(ns, loadedClb(i18n, cb));
7903
+ }
7904
+ function loadLanguages(i18n, lng, ns, cb) {
7905
+ if (typeof ns === 'string') ns = [ns];
7906
+ ns.forEach(function (n) {
7907
+ if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
7908
+ });
7909
+ i18n.loadLanguages(lng, loadedClb(i18n, cb));
7910
+ }
7782
7911
 
7783
- if (listener.prev) {
7784
- listener.prev.next = listener.next;
7785
- } else {
7786
- first = listener.next;
7787
- }
7788
- };
7789
- }
7912
+ function oldI18nextHasLoadedNamespace(ns, i18n) {
7913
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
7914
+ var lng = i18n.languages[0];
7915
+ var fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
7916
+ var lastLng = i18n.languages[i18n.languages.length - 1];
7917
+ if (lng.toLowerCase() === 'cimode') return true;
7790
7918
 
7919
+ var loadNotPending = function loadNotPending(l, n) {
7920
+ var loadState = i18n.services.backendConnector.state["".concat(l, "|").concat(n)];
7921
+ return loadState === -1 || loadState === 2;
7791
7922
  };
7792
- }
7793
7923
 
7794
- const nullListeners = {
7795
- notify() {},
7924
+ if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
7925
+ if (i18n.hasResourceBundle(lng, ns)) return true;
7926
+ if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
7927
+ if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
7928
+ return false;
7929
+ }
7796
7930
 
7797
- get: () => []
7798
- };
7799
- function Subscription_createSubscription(store, parentSub) {
7800
- let unsubscribe;
7801
- let listeners = nullListeners;
7931
+ function hasLoadedNamespace(ns, i18n) {
7932
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
7802
7933
 
7803
- function addNestedSub(listener) {
7804
- trySubscribe();
7805
- return listeners.subscribe(listener);
7934
+ if (!i18n.languages || !i18n.languages.length) {
7935
+ utils_warnOnce('i18n.languages were undefined or empty', i18n.languages);
7936
+ return true;
7806
7937
  }
7807
7938
 
7808
- function notifyNestedSubs() {
7809
- listeners.notify();
7939
+ var isNewerI18next = i18n.options.ignoreJSONStructure !== undefined;
7940
+
7941
+ if (!isNewerI18next) {
7942
+ return oldI18nextHasLoadedNamespace(ns, i18n, options);
7810
7943
  }
7811
7944
 
7812
- function handleChangeWrapper() {
7813
- if (subscription.onStateChange) {
7814
- subscription.onStateChange();
7945
+ return i18n.hasLoadedNamespace(ns, {
7946
+ lng: options.lng,
7947
+ precheck: function precheck(i18nInstance, loadNotPending) {
7948
+ if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
7815
7949
  }
7816
- }
7950
+ });
7951
+ }
7952
+ function utils_getDisplayName(Component) {
7953
+ return Component.displayName || Component.name || (typeof Component === 'string' && Component.length > 0 ? Component : 'Unknown');
7954
+ }
7955
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
7956
+ function typeof_typeof(o) {
7957
+ "@babel/helpers - typeof";
7817
7958
 
7818
- function isSubscribed() {
7819
- return Boolean(unsubscribe);
7820
- }
7959
+ return typeof_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
7960
+ return typeof o;
7961
+ } : function (o) {
7962
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
7963
+ }, typeof_typeof(o);
7964
+ }
7821
7965
 
7822
- function trySubscribe() {
7823
- if (!unsubscribe) {
7824
- unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);
7825
- listeners = createListenerCollection();
7826
- }
7827
- }
7966
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
7828
7967
 
7829
- function tryUnsubscribe() {
7830
- if (unsubscribe) {
7831
- unsubscribe();
7832
- unsubscribe = undefined;
7833
- listeners.clear();
7834
- listeners = nullListeners;
7835
- }
7968
+ function toPrimitive(t, r) {
7969
+ if ("object" != typeof_typeof(t) || !t) return t;
7970
+ var e = t[Symbol.toPrimitive];
7971
+ if (void 0 !== e) {
7972
+ var i = e.call(t, r || "default");
7973
+ if ("object" != typeof_typeof(i)) return i;
7974
+ throw new TypeError("@@toPrimitive must return a primitive value.");
7836
7975
  }
7976
+ return ("string" === r ? String : Number)(t);
7977
+ }
7837
7978
 
7838
- const subscription = {
7839
- addNestedSub,
7840
- notifyNestedSubs,
7841
- handleChangeWrapper,
7842
- isSubscribed,
7843
- trySubscribe,
7844
- tryUnsubscribe,
7845
- getListeners: () => listeners
7846
- };
7847
- return subscription;
7979
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
7980
+
7981
+
7982
+ function toPropertyKey(t) {
7983
+ var i = toPrimitive(t, "string");
7984
+ return "symbol" == typeof_typeof(i) ? i : i + "";
7848
7985
  }
7849
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js
7850
- // React currently throws a warning when using useLayoutEffect on the server.
7851
- // To get around it, we can conditionally useEffect on the server (no-op) and
7852
- // useLayoutEffect in the browser. We need useLayoutEffect to ensure the store
7853
- // subscription callback always has the selector from the latest render commit
7854
- // available, otherwise a store update may happen between render and the effect,
7855
- // which may cause missed updates; we also must ensure the store subscription
7856
- // is created synchronously, otherwise a store update may occur before the
7857
- // subscription is created and an inconsistent state may be observed
7858
- // Matches logic in React's `shared/ExecutionEnvironment` file
7859
7986
 
7860
- const canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
7861
- const useIsomorphicLayoutEffect_useIsomorphicLayoutEffect = (/* unused pure expression or super */ null && (canUseDOM ? useLayoutEffect : useEffect));
7862
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/components/connect.js
7987
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
7988
+
7989
+ function defineProperty_defineProperty(e, r, t) {
7990
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
7991
+ value: t,
7992
+ enumerable: !0,
7993
+ configurable: !0,
7994
+ writable: !0
7995
+ }) : e[r] = t, e;
7996
+ }
7863
7997
 
7998
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/unescape.js
7999
+ var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
8000
+ var htmlEntities = {
8001
+ '&amp;': '&',
8002
+ '&#38;': '&',
8003
+ '&lt;': '<',
8004
+ '&#60;': '<',
8005
+ '&gt;': '>',
8006
+ '&#62;': '>',
8007
+ '&apos;': "'",
8008
+ '&#39;': "'",
8009
+ '&quot;': '"',
8010
+ '&#34;': '"',
8011
+ '&nbsp;': ' ',
8012
+ '&#160;': ' ',
8013
+ '&copy;': '©',
8014
+ '&#169;': '©',
8015
+ '&reg;': '®',
8016
+ '&#174;': '®',
8017
+ '&hellip;': '…',
8018
+ '&#8230;': '…',
8019
+ '&#x2F;': '/',
8020
+ '&#47;': '/'
8021
+ };
7864
8022
 
7865
- const connect_excluded = (/* unused pure expression or super */ null && (["reactReduxForwardedRef"]));
8023
+ var unescapeHtmlEntity = function unescapeHtmlEntity(m) {
8024
+ return htmlEntities[m];
8025
+ };
7866
8026
 
7867
- /* eslint-disable valid-jsdoc, @typescript-eslint/no-unused-vars */
8027
+ var unescape_unescape = function unescape(text) {
8028
+ return text.replace(matchHtmlEntity, unescapeHtmlEntity);
8029
+ };
8030
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/defaults.js
7868
8031
 
7869
8032
 
8033
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
7870
8034
 
8035
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7871
8036
 
7872
8037
 
8038
+ var defaultOptions = {
8039
+ bindI18n: 'languageChanged',
8040
+ bindI18nStore: '',
8041
+ transEmptyNodeValue: '',
8042
+ transSupportBasicHtmlNodes: true,
8043
+ transWrapTextNodes: '',
8044
+ transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
8045
+ useSuspense: true,
8046
+ unescape: unescape_unescape
8047
+ };
8048
+ function setDefaults() {
8049
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8050
+ defaultOptions = _objectSpread(_objectSpread({}, defaultOptions), options);
8051
+ }
8052
+ function defaults_getDefaults() {
8053
+ return defaultOptions;
8054
+ }
8055
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/TransWithoutContext.js
7873
8056
 
7874
8057
 
7875
8058
 
8059
+ var TransWithoutContext_excluded = (/* unused pure expression or super */ null && (["format"])),
8060
+ _excluded2 = (/* unused pure expression or super */ null && (["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"]));
7876
8061
 
8062
+ function TransWithoutContext_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
7877
8063
 
8064
+ function TransWithoutContext_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { TransWithoutContext_ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { TransWithoutContext_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7878
8065
 
7879
8066
 
7880
8067
 
7881
- let useSyncExternalStore = (/* unused pure expression or super */ null && (notInitialized));
7882
- const initializeConnect = fn => {
7883
- useSyncExternalStore = fn;
7884
- }; // Define some constant arrays just to avoid re-creating these
7885
8068
 
7886
- const EMPTY_ARRAY = (/* unused pure expression or super */ null && ([null, 0]));
7887
- const NO_SUBSCRIPTION_ARRAY = (/* unused pure expression or super */ null && ([null, null])); // Attempts to stringify whatever not-really-a-component value we were given
7888
- // for logging in an error message
7889
8069
 
7890
- const stringifyComponent = Comp => {
7891
- try {
7892
- return JSON.stringify(Comp);
7893
- } catch (err) {
7894
- return String(Comp);
7895
- }
7896
- };
7897
8070
 
7898
- // This is "just" a `useLayoutEffect`, but with two modifications:
7899
- // - we need to fall back to `useEffect` in SSR to avoid annoying warnings
7900
- // - we extract this to a separate function to avoid closing over values
7901
- // and causing memory leaks
7902
- function useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {
7903
- useIsomorphicLayoutEffect(() => effectFunc(...effectArgs), dependencies);
7904
- } // Effect callback, extracted: assign the latest props values to refs for later usage
7905
8071
 
8072
+ function hasChildren(node, checkLength) {
8073
+ if (!node) return false;
8074
+ var base = node.props ? node.props.children : node.children;
8075
+ if (checkLength) return base.length > 0;
8076
+ return !!base;
8077
+ }
7906
8078
 
7907
- function captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, // actualChildProps: unknown,
7908
- childPropsFromStoreUpdate, notifyNestedSubs) {
7909
- // We want to capture the wrapper props and child props we used for later comparisons
7910
- lastWrapperProps.current = wrapperProps;
7911
- renderIsScheduled.current = false; // If the render was from a store update, clear out that reference and cascade the subscriber update
8079
+ function getChildren(node) {
8080
+ if (!node) return [];
8081
+ return node.props ? node.props.children : node.children;
8082
+ }
7912
8083
 
7913
- if (childPropsFromStoreUpdate.current) {
7914
- childPropsFromStoreUpdate.current = null;
7915
- notifyNestedSubs();
7916
- }
7917
- } // Effect callback, extracted: subscribe to the Redux store or nearest connected ancestor,
7918
- // check for updates after dispatched actions, and trigger re-renders.
8084
+ function hasValidReactChildren(children) {
8085
+ if (Object.prototype.toString.call(children) !== '[object Array]') return false;
8086
+ return children.every(function (child) {
8087
+ return isValidElement(child);
8088
+ });
8089
+ }
7919
8090
 
8091
+ function getAsArray(data) {
8092
+ return Array.isArray(data) ? data : [data];
8093
+ }
7920
8094
 
7921
- function subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, // forceComponentUpdateDispatch: React.Dispatch<any>,
7922
- additionalSubscribeListener) {
7923
- // If we're not subscribed to the store, nothing to do here
7924
- if (!shouldHandleStateChanges) return () => {}; // Capture values for checking if and when this component unmounts
8095
+ function mergeProps(source, target) {
8096
+ var newTarget = TransWithoutContext_objectSpread({}, target);
7925
8097
 
7926
- let didUnsubscribe = false;
7927
- let lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component
8098
+ newTarget.props = Object.assign(source.props, target.props);
8099
+ return newTarget;
8100
+ }
7928
8101
 
7929
- const checkForUpdates = () => {
7930
- if (didUnsubscribe || !isMounted.current) {
7931
- // Don't run stale listeners.
7932
- // Redux doesn't guarantee unsubscriptions happen until next dispatch.
7933
- return;
7934
- } // TODO We're currently calling getState ourselves here, rather than letting `uSES` do it
8102
+ function nodesToString(children, i18nOptions) {
8103
+ if (!children) return '';
8104
+ var stringNode = '';
8105
+ var childrenArray = getAsArray(children);
8106
+ var keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];
8107
+ childrenArray.forEach(function (child, childIndex) {
8108
+ if (typeof child === 'string') {
8109
+ stringNode += "".concat(child);
8110
+ } else if (isValidElement(child)) {
8111
+ var childPropsCount = Object.keys(child.props).length;
8112
+ var shouldKeepChild = keepArray.indexOf(child.type) > -1;
8113
+ var childChildren = child.props.children;
7935
8114
 
8115
+ if (!childChildren && shouldKeepChild && childPropsCount === 0) {
8116
+ stringNode += "<".concat(child.type, "/>");
8117
+ } else if (!childChildren && (!shouldKeepChild || childPropsCount !== 0)) {
8118
+ stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
8119
+ } else if (child.props.i18nIsDynamicList) {
8120
+ stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
8121
+ } else if (shouldKeepChild && childPropsCount === 1 && typeof childChildren === 'string') {
8122
+ stringNode += "<".concat(child.type, ">").concat(childChildren, "</").concat(child.type, ">");
8123
+ } else {
8124
+ var content = nodesToString(childChildren, i18nOptions);
8125
+ stringNode += "<".concat(childIndex, ">").concat(content, "</").concat(childIndex, ">");
8126
+ }
8127
+ } else if (child === null) {
8128
+ warn("Trans: the passed in value is invalid - seems you passed in a null child.");
8129
+ } else if (_typeof(child) === 'object') {
8130
+ var format = child.format,
8131
+ clone = _objectWithoutProperties(child, TransWithoutContext_excluded);
7936
8132
 
7937
- const latestStoreState = store.getState();
7938
- let newChildProps, error;
8133
+ var keys = Object.keys(clone);
7939
8134
 
7940
- try {
7941
- // Actually run the selector with the most recent store state and wrapper props
7942
- // to determine what the child props should be
7943
- newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);
7944
- } catch (e) {
7945
- error = e;
7946
- lastThrownError = e;
8135
+ if (keys.length === 1) {
8136
+ var value = format ? "".concat(keys[0], ", ").concat(format) : keys[0];
8137
+ stringNode += "{{".concat(value, "}}");
8138
+ } else {
8139
+ warn("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.", child);
8140
+ }
8141
+ } else {
8142
+ warn("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.", child);
7947
8143
  }
8144
+ });
8145
+ return stringNode;
8146
+ }
7948
8147
 
7949
- if (!error) {
7950
- lastThrownError = null;
7951
- } // If the child props haven't changed, nothing to do here - cascade the subscription update
8148
+ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {
8149
+ if (targetString === '') return [];
8150
+ var keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];
8151
+ var emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.join('|')).test(targetString);
8152
+ if (!children && !emptyChildrenButNeedsHandling) return [targetString];
8153
+ var data = {};
7952
8154
 
8155
+ function getData(childs) {
8156
+ var childrenArray = getAsArray(childs);
8157
+ childrenArray.forEach(function (child) {
8158
+ if (typeof child === 'string') return;
8159
+ if (hasChildren(child)) getData(getChildren(child));else if (_typeof(child) === 'object' && !isValidElement(child)) Object.assign(data, child);
8160
+ });
8161
+ }
7953
8162
 
7954
- if (newChildProps === lastChildProps.current) {
7955
- if (!renderIsScheduled.current) {
7956
- notifyNestedSubs();
7957
- }
7958
- } else {
7959
- // Save references to the new child props. Note that we track the "child props from store update"
7960
- // as a ref instead of a useState/useReducer because we need a way to determine if that value has
7961
- // been processed. If this went into useState/useReducer, we couldn't clear out the value without
7962
- // forcing another re-render, which we don't want.
7963
- lastChildProps.current = newChildProps;
7964
- childPropsFromStoreUpdate.current = newChildProps;
7965
- renderIsScheduled.current = true; // TODO This is hacky and not how `uSES` is meant to be used
7966
- // Trigger the React `useSyncExternalStore` subscriber
8163
+ getData(children);
8164
+ var ast = HTML.parse("<0>".concat(targetString, "</0>"));
7967
8165
 
7968
- additionalSubscribeListener();
7969
- }
7970
- }; // Actually subscribe to the nearest connected ancestor (or store)
8166
+ var opts = TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, data), combinedTOpts);
7971
8167
 
8168
+ function renderInner(child, node, rootReactNode) {
8169
+ var childs = getChildren(child);
8170
+ var mappedChildren = mapAST(childs, node.children, rootReactNode);
8171
+ return hasValidReactChildren(childs) && mappedChildren.length === 0 ? childs : mappedChildren;
8172
+ }
7972
8173
 
7973
- subscription.onStateChange = checkForUpdates;
7974
- subscription.trySubscribe(); // Pull data from the store after first render in case the store has
7975
- // changed since we began.
8174
+ function pushTranslatedJSX(child, inner, mem, i, isVoid) {
8175
+ if (child.dummy) child.children = inner;
8176
+ mem.push(cloneElement(child, TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, child.props), {}, {
8177
+ key: i
8178
+ }), isVoid ? undefined : inner));
8179
+ }
7976
8180
 
7977
- checkForUpdates();
8181
+ function mapAST(reactNode, astNode, rootReactNode) {
8182
+ var reactNodes = getAsArray(reactNode);
8183
+ var astNodes = getAsArray(astNode);
8184
+ return astNodes.reduce(function (mem, node, i) {
8185
+ var translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
7978
8186
 
7979
- const unsubscribeWrapper = () => {
7980
- didUnsubscribe = true;
7981
- subscription.tryUnsubscribe();
7982
- subscription.onStateChange = null;
8187
+ if (node.type === 'tag') {
8188
+ var tmp = reactNodes[parseInt(node.name, 10)];
8189
+ if (!tmp && rootReactNode.length === 1 && rootReactNode[0][node.name]) tmp = rootReactNode[0][node.name];
8190
+ if (!tmp) tmp = {};
8191
+ var child = Object.keys(node.attrs).length !== 0 ? mergeProps({
8192
+ props: node.attrs
8193
+ }, tmp) : tmp;
8194
+ var isElement = isValidElement(child);
8195
+ var isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
8196
+ var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && _typeof(child) === 'object' && child.dummy && !isElement;
8197
+ var isKnownComponent = _typeof(children) === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);
7983
8198
 
7984
- if (lastThrownError) {
7985
- // It's possible that we caught an error due to a bad mapState function, but the
7986
- // parent re-rendered without this component and we're about to unmount.
7987
- // This shouldn't happen as long as we do top-down subscriptions correctly, but
7988
- // if we ever do those wrong, this throw will surface the error in our tests.
7989
- // In that case, throw the error from here so it doesn't get lost.
7990
- throw lastThrownError;
7991
- }
7992
- };
8199
+ if (typeof child === 'string') {
8200
+ var value = i18n.services.interpolator.interpolate(child, opts, i18n.language);
8201
+ mem.push(value);
8202
+ } else if (hasChildren(child) || isValidTranslationWithChildren) {
8203
+ var inner = renderInner(child, node, rootReactNode);
8204
+ pushTranslatedJSX(child, inner, mem, i);
8205
+ } else if (isEmptyTransWithHTML) {
8206
+ var _inner = mapAST(reactNodes, node.children, rootReactNode);
7993
8207
 
7994
- return unsubscribeWrapper;
7995
- } // Reducer initial state creation for our update reducer
8208
+ mem.push(cloneElement(child, TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, child.props), {}, {
8209
+ key: i
8210
+ }), _inner));
8211
+ } else if (Number.isNaN(parseFloat(node.name))) {
8212
+ if (isKnownComponent) {
8213
+ var _inner2 = renderInner(child, node, rootReactNode);
7996
8214
 
8215
+ pushTranslatedJSX(child, _inner2, mem, i, node.voidElement);
8216
+ } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
8217
+ if (node.voidElement) {
8218
+ mem.push(createElement(node.name, {
8219
+ key: "".concat(node.name, "-").concat(i)
8220
+ }));
8221
+ } else {
8222
+ var _inner3 = mapAST(reactNodes, node.children, rootReactNode);
7997
8223
 
7998
- const initStateUpdates = () => EMPTY_ARRAY;
8224
+ mem.push(createElement(node.name, {
8225
+ key: "".concat(node.name, "-").concat(i)
8226
+ }, _inner3));
8227
+ }
8228
+ } else if (node.voidElement) {
8229
+ mem.push("<".concat(node.name, " />"));
8230
+ } else {
8231
+ var _inner4 = mapAST(reactNodes, node.children, rootReactNode);
7999
8232
 
8000
- function strictEqual(a, b) {
8001
- return a === b;
8002
- }
8003
- /**
8004
- * Infers the type of props that a connector will inject into a component.
8005
- */
8233
+ mem.push("<".concat(node.name, ">").concat(_inner4, "</").concat(node.name, ">"));
8234
+ }
8235
+ } else if (_typeof(child) === 'object' && !isElement) {
8236
+ var content = node.children[0] ? translationContent : null;
8237
+ if (content) mem.push(content);
8238
+ } else if (node.children.length === 1 && translationContent) {
8239
+ mem.push(cloneElement(child, TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, child.props), {}, {
8240
+ key: i
8241
+ }), translationContent));
8242
+ } else {
8243
+ mem.push(cloneElement(child, TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, child.props), {}, {
8244
+ key: i
8245
+ })));
8246
+ }
8247
+ } else if (node.type === 'text') {
8248
+ var wrapTextNodes = i18nOptions.transWrapTextNodes;
8006
8249
 
8250
+ var _content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
8007
8251
 
8008
- let hasWarnedAboutDeprecatedPureOption = false;
8009
- /**
8010
- * Connects a React component to a Redux store.
8011
- *
8012
- * - Without arguments, just wraps the component, without changing the behavior / props
8013
- *
8014
- * - If 2 params are passed (3rd param, mergeProps, is skipped), default behavior
8015
- * is to override ownProps (as stated in the docs), so what remains is everything that's
8016
- * not a state or dispatch prop
8017
- *
8018
- * - When 3rd param is passed, we don't know if ownProps propagate and whether they
8019
- * should be valid component props, because it depends on mergeProps implementation.
8020
- * As such, it is the user's responsibility to extend ownProps interface from state or
8021
- * dispatch props or both when applicable
8022
- *
8023
- * @param mapStateToProps A function that extracts values from state
8024
- * @param mapDispatchToProps Setup for dispatching actions
8025
- * @param mergeProps Optional callback to merge state and dispatch props together
8026
- * @param options Options for configuring the connection
8027
- *
8028
- */
8252
+ if (wrapTextNodes) {
8253
+ mem.push(createElement(wrapTextNodes, {
8254
+ key: "".concat(node.name, "-").concat(i)
8255
+ }, _content));
8256
+ } else {
8257
+ mem.push(_content);
8258
+ }
8259
+ }
8029
8260
 
8030
- function connect(mapStateToProps, mapDispatchToProps, mergeProps, {
8031
- // The `pure` option has been removed, so TS doesn't like us destructuring this to check its existence.
8032
- // @ts-ignore
8033
- pure,
8034
- areStatesEqual = strictEqual,
8035
- areOwnPropsEqual = shallowEqual,
8036
- areStatePropsEqual = shallowEqual,
8037
- areMergedPropsEqual = shallowEqual,
8038
- // use React's forwardRef to expose a ref of the wrapped component
8039
- forwardRef = false,
8040
- // the context consumer to use
8041
- context = ReactReduxContext
8042
- } = {}) {
8043
- if (false) {}
8261
+ return mem;
8262
+ }, []);
8263
+ }
8044
8264
 
8045
- const Context = context;
8046
- const initMapStateToProps = mapStateToPropsFactory(mapStateToProps);
8047
- const initMapDispatchToProps = mapDispatchToPropsFactory(mapDispatchToProps);
8048
- const initMergeProps = mergePropsFactory(mergeProps);
8049
- const shouldHandleStateChanges = Boolean(mapStateToProps);
8265
+ var result = mapAST([{
8266
+ dummy: true,
8267
+ children: children || []
8268
+ }], ast, getAsArray(children || []));
8269
+ return getChildren(result[0]);
8270
+ }
8050
8271
 
8051
- const wrapWithConnect = WrappedComponent => {
8052
- if (false) {}
8272
+ function Trans(_ref) {
8273
+ var children = _ref.children,
8274
+ count = _ref.count,
8275
+ parent = _ref.parent,
8276
+ i18nKey = _ref.i18nKey,
8277
+ context = _ref.context,
8278
+ _ref$tOptions = _ref.tOptions,
8279
+ tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions,
8280
+ values = _ref.values,
8281
+ defaults = _ref.defaults,
8282
+ components = _ref.components,
8283
+ ns = _ref.ns,
8284
+ i18nFromProps = _ref.i18n,
8285
+ tFromProps = _ref.t,
8286
+ shouldUnescape = _ref.shouldUnescape,
8287
+ additionalProps = _objectWithoutProperties(_ref, _excluded2);
8053
8288
 
8054
- const wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
8055
- const displayName = `Connect(${wrappedComponentName})`;
8056
- const selectorFactoryOptions = {
8057
- shouldHandleStateChanges,
8058
- displayName,
8059
- wrappedComponentName,
8060
- WrappedComponent,
8061
- // @ts-ignore
8062
- initMapStateToProps,
8063
- // @ts-ignore
8064
- initMapDispatchToProps,
8065
- initMergeProps,
8066
- areStatesEqual,
8067
- areStatePropsEqual,
8068
- areOwnPropsEqual,
8069
- areMergedPropsEqual
8070
- };
8289
+ var i18n = i18nFromProps || getI18n();
8071
8290
 
8072
- function ConnectFunction(props) {
8073
- const [propsContext, reactReduxForwardedRef, wrapperProps] = useMemo(() => {
8074
- // Distinguish between actual "data" props that were passed to the wrapper component,
8075
- // and values needed to control behavior (forwarded refs, alternate context instances).
8076
- // To maintain the wrapperProps object reference, memoize this destructuring.
8077
- const {
8078
- reactReduxForwardedRef
8079
- } = props,
8080
- wrapperProps = _objectWithoutPropertiesLoose(props, connect_excluded);
8291
+ if (!i18n) {
8292
+ warnOnce('You will need to pass in an i18next instance by using i18nextReactModule');
8293
+ return children;
8294
+ }
8081
8295
 
8082
- return [props.context, reactReduxForwardedRef, wrapperProps];
8083
- }, [props]);
8084
- const ContextToUse = useMemo(() => {
8085
- // Users may optionally pass in a custom context instance to use instead of our ReactReduxContext.
8086
- // Memoize the check that determines which context instance we should use.
8087
- return propsContext && propsContext.Consumer && // @ts-ignore
8088
- isContextConsumer( /*#__PURE__*/React.createElement(propsContext.Consumer, null)) ? propsContext : Context;
8089
- }, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available
8296
+ var t = tFromProps || i18n.t.bind(i18n) || function (k) {
8297
+ return k;
8298
+ };
8090
8299
 
8091
- const contextValue = useContext(ContextToUse); // The store _must_ exist as either a prop or in context.
8092
- // We'll check to see if it _looks_ like a Redux store first.
8093
- // This allows us to pass through a `store` prop that is just a plain value.
8300
+ if (context) tOptions.context = context;
8094
8301
 
8095
- const didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);
8096
- const didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);
8302
+ var reactI18nextOptions = TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, getDefaults()), i18n.options && i18n.options.react);
8097
8303
 
8098
- if (false) {} // Based on the previous check, one of these must be true
8304
+ var namespaces = ns || t.ns || i18n.options && i18n.options.defaultNS;
8305
+ namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
8306
+ var defaultValue = defaults || nodesToString(children, reactI18nextOptions) || reactI18nextOptions.transEmptyNodeValue || i18nKey;
8307
+ var hashTransKey = reactI18nextOptions.hashTransKey;
8308
+ var key = i18nKey || (hashTransKey ? hashTransKey(defaultValue) : defaultValue);
8309
+ var interpolationOverride = values ? tOptions.interpolation : {
8310
+ interpolation: TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, tOptions.interpolation), {}, {
8311
+ prefix: '#$?',
8312
+ suffix: '?$#'
8313
+ })
8314
+ };
8315
+
8316
+ var combinedTOpts = TransWithoutContext_objectSpread(TransWithoutContext_objectSpread(TransWithoutContext_objectSpread(TransWithoutContext_objectSpread({}, tOptions), {}, {
8317
+ count: count
8318
+ }, values), interpolationOverride), {}, {
8319
+ defaultValue: defaultValue,
8320
+ ns: namespaces
8321
+ });
8099
8322
 
8323
+ var translation = key ? t(key, combinedTOpts) : defaultValue;
8324
+ var content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
8325
+ var useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;
8326
+ return useAsParent ? createElement(useAsParent, additionalProps, content) : content;
8327
+ }
8328
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
8329
+ function _classCallCheck(a, n) {
8330
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
8331
+ }
8100
8332
 
8101
- const store = didStoreComeFromProps ? props.store : contextValue.store;
8102
- const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState;
8103
- const childPropsSelector = useMemo(() => {
8104
- // The child props selector needs the store reference as an input.
8105
- // Re-create this selector whenever the store changes.
8106
- return defaultSelectorFactory(store.dispatch, selectorFactoryOptions);
8107
- }, [store]);
8108
- const [subscription, notifyNestedSubs] = useMemo(() => {
8109
- if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component
8110
- // connected to the store via props shouldn't use subscription from context, or vice versa.
8333
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/createClass.js
8111
8334
 
8112
- const subscription = createSubscription(store, didStoreComeFromProps ? undefined : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
8113
- // the middle of the notification loop, where `subscription` will then be null. This can
8114
- // probably be avoided if Subscription's listeners logic is changed to not call listeners
8115
- // that have been unsubscribed in the middle of the notification loop.
8335
+ function _defineProperties(e, r) {
8336
+ for (var t = 0; t < r.length; t++) {
8337
+ var o = r[t];
8338
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
8339
+ }
8340
+ }
8341
+ function _createClass(e, r, t) {
8342
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
8343
+ writable: !1
8344
+ }), e;
8345
+ }
8116
8346
 
8117
- const notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription);
8118
- return [subscription, notifyNestedSubs];
8119
- }, [store, didStoreComeFromProps, contextValue]); // Determine what {store, subscription} value should be put into nested context, if necessary,
8120
- // and memoize that value to avoid unnecessary context updates.
8347
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/i18nInstance.js
8348
+ var i18nInstance;
8349
+ function setI18n(instance) {
8350
+ i18nInstance = instance;
8351
+ }
8352
+ function i18nInstance_getI18n() {
8353
+ return i18nInstance;
8354
+ }
8355
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/initReactI18next.js
8121
8356
 
8122
- const overriddenContextValue = useMemo(() => {
8123
- if (didStoreComeFromProps) {
8124
- // This component is directly subscribed to a store from props.
8125
- // We don't want descendants reading from this store - pass down whatever
8126
- // the existing context value is from the nearest connected ancestor.
8127
- return contextValue;
8128
- } // Otherwise, put this component's subscription instance into context, so that
8129
- // connected descendants won't update until after this component is done
8130
8357
 
8358
+ var initReactI18next = {
8359
+ type: '3rdParty',
8360
+ init: function init(instance) {
8361
+ setDefaults(instance.options.react);
8362
+ setI18n(instance);
8363
+ }
8364
+ };
8365
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/context.js
8131
8366
 
8132
- return _extends({}, contextValue, {
8133
- subscription
8134
- });
8135
- }, [didStoreComeFromProps, contextValue, subscription]); // Set up refs to coordinate values between the subscription effect and the render logic
8136
8367
 
8137
- const lastChildProps = useRef();
8138
- const lastWrapperProps = useRef(wrapperProps);
8139
- const childPropsFromStoreUpdate = useRef();
8140
- const renderIsScheduled = useRef(false);
8141
- const isProcessingDispatch = useRef(false);
8142
- const isMounted = useRef(false);
8143
- const latestSubscriptionCallbackError = useRef();
8144
- useIsomorphicLayoutEffect(() => {
8145
- isMounted.current = true;
8146
- return () => {
8147
- isMounted.current = false;
8148
- };
8149
- }, []);
8150
- const actualChildPropsSelector = useMemo(() => {
8151
- const selector = () => {
8152
- // Tricky logic here:
8153
- // - This render may have been triggered by a Redux store update that produced new child props
8154
- // - However, we may have gotten new wrapper props after that
8155
- // If we have new child props, and the same wrapper props, we know we should use the new child props as-is.
8156
- // But, if we have new wrapper props, those might change the child props, so we have to recalculate things.
8157
- // So, we'll use the child props from store update only if the wrapper props are the same as last time.
8158
- if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {
8159
- return childPropsFromStoreUpdate.current;
8160
- } // TODO We're reading the store directly in render() here. Bad idea?
8161
- // This will likely cause Bad Things (TM) to happen in Concurrent Mode.
8162
- // Note that we do this because on renders _not_ caused by store updates, we need the latest store state
8163
- // to determine what the child props should be.
8164
8368
 
8165
8369
 
8166
- return childPropsSelector(store.getState(), wrapperProps);
8167
- };
8370
+ function context_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
8168
8371
 
8169
- return selector;
8170
- }, [store, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns
8171
- // about useLayoutEffect in SSR, so we try to detect environment and fall back to
8172
- // just useEffect instead to avoid the warning, since neither will run anyway.
8372
+ function context_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { context_ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { context_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
8173
8373
 
8174
- const subscribeForReact = useMemo(() => {
8175
- const subscribe = reactListener => {
8176
- if (!subscription) {
8177
- return () => {};
8178
- }
8179
8374
 
8180
- return subscribeUpdates(shouldHandleStateChanges, store, subscription, // @ts-ignore
8181
- childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, reactListener);
8182
- };
8183
8375
 
8184
- return subscribe;
8185
- }, [subscription]);
8186
- useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs]);
8187
- let actualChildProps;
8188
8376
 
8189
- try {
8190
- actualChildProps = useSyncExternalStore( // TODO We're passing through a big wrapper that does a bunch of extra side effects besides subscribing
8191
- subscribeForReact, // TODO This is incredibly hacky. We've already processed the store update and calculated new child props,
8192
- // TODO and we're just passing that through so it triggers a re-render for us rather than relying on `uSES`.
8193
- actualChildPropsSelector, getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector);
8194
- } catch (err) {
8195
- if (latestSubscriptionCallbackError.current) {
8196
- ;
8197
- err.message += `\nThe error may be correlated with this previous error:\n${latestSubscriptionCallbackError.current.stack}\n\n`;
8198
- }
8199
8377
 
8200
- throw err;
8201
- }
8202
8378
 
8203
- useIsomorphicLayoutEffect(() => {
8204
- latestSubscriptionCallbackError.current = undefined;
8205
- childPropsFromStoreUpdate.current = undefined;
8206
- lastChildProps.current = actualChildProps;
8207
- }); // Now that all that's done, we can finally try to actually render the child component.
8208
- // We memoize the elements for the rendered child component as an optimization.
8379
+ var context_I18nContext = (0,react.createContext)();
8380
+ var ReportNamespaces = function () {
8381
+ function ReportNamespaces() {
8382
+ _classCallCheck(this, ReportNamespaces);
8209
8383
 
8210
- const renderedWrappedComponent = useMemo(() => {
8211
- return (
8212
- /*#__PURE__*/
8213
- // @ts-ignore
8214
- React.createElement(WrappedComponent, _extends({}, actualChildProps, {
8215
- ref: reactReduxForwardedRef
8216
- }))
8217
- );
8218
- }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering
8219
- // that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate.
8384
+ this.usedNamespaces = {};
8385
+ }
8220
8386
 
8221
- const renderedChild = useMemo(() => {
8222
- if (shouldHandleStateChanges) {
8223
- // If this component is subscribed to store updates, we need to pass its own
8224
- // subscription instance down to our descendants. That means rendering the same
8225
- // Context instance, and putting a different value into the context.
8226
- return /*#__PURE__*/React.createElement(ContextToUse.Provider, {
8227
- value: overriddenContextValue
8228
- }, renderedWrappedComponent);
8229
- }
8387
+ _createClass(ReportNamespaces, [{
8388
+ key: "addUsedNamespaces",
8389
+ value: function addUsedNamespaces(namespaces) {
8390
+ var _this = this;
8230
8391
 
8231
- return renderedWrappedComponent;
8232
- }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);
8233
- return renderedChild;
8392
+ namespaces.forEach(function (ns) {
8393
+ if (!_this.usedNamespaces[ns]) _this.usedNamespaces[ns] = true;
8394
+ });
8395
+ }
8396
+ }, {
8397
+ key: "getUsedNamespaces",
8398
+ value: function getUsedNamespaces() {
8399
+ return Object.keys(this.usedNamespaces);
8234
8400
  }
8401
+ }]);
8235
8402
 
8236
- const _Connect = React.memo(ConnectFunction);
8403
+ return ReportNamespaces;
8404
+ }();
8405
+ function context_composeInitialProps(ForComponent) {
8406
+ return function (ctx) {
8407
+ return new Promise(function (resolve) {
8408
+ var i18nInitialProps = getInitialProps();
8237
8409
 
8238
- // Add a hacky cast to get the right output type
8239
- const Connect = _Connect;
8240
- Connect.WrappedComponent = WrappedComponent;
8241
- Connect.displayName = ConnectFunction.displayName = displayName;
8410
+ if (ForComponent.getInitialProps) {
8411
+ ForComponent.getInitialProps(ctx).then(function (componentsInitialProps) {
8412
+ resolve(context_objectSpread(context_objectSpread({}, componentsInitialProps), i18nInitialProps));
8413
+ });
8414
+ } else {
8415
+ resolve(i18nInitialProps);
8416
+ }
8417
+ });
8418
+ };
8419
+ }
8420
+ function getInitialProps() {
8421
+ var i18n = getI18n();
8422
+ var namespaces = i18n.reportNamespaces ? i18n.reportNamespaces.getUsedNamespaces() : [];
8423
+ var ret = {};
8424
+ var initialI18nStore = {};
8425
+ i18n.languages.forEach(function (l) {
8426
+ initialI18nStore[l] = {};
8427
+ namespaces.forEach(function (ns) {
8428
+ initialI18nStore[l][ns] = i18n.getResourceBundle(l, ns) || {};
8429
+ });
8430
+ });
8431
+ ret.initialI18nStore = initialI18nStore;
8432
+ ret.initialLanguage = i18n.language;
8433
+ return ret;
8434
+ }
8435
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/Trans.js
8242
8436
 
8243
- if (forwardRef) {
8244
- const _forwarded = React.forwardRef(function forwardConnectRef(props, ref) {
8245
- // @ts-ignore
8246
- return /*#__PURE__*/React.createElement(Connect, _extends({}, props, {
8247
- reactReduxForwardedRef: ref
8248
- }));
8249
- });
8250
8437
 
8251
- const forwarded = _forwarded;
8252
- forwarded.displayName = displayName;
8253
- forwarded.WrappedComponent = WrappedComponent;
8254
- return hoistStatics(forwarded, WrappedComponent);
8255
- }
8438
+ var Trans_excluded = (/* unused pure expression or super */ null && (["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"]));
8256
8439
 
8257
- return hoistStatics(Connect, WrappedComponent);
8258
- };
8440
+ function Trans_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
8259
8441
 
8260
- return wrapWithConnect;
8261
- }
8442
+ function Trans_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { Trans_ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { Trans_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
8262
8443
 
8263
- /* harmony default export */ const components_connect = ((/* unused pure expression or super */ null && (connect)));
8264
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/components/Provider.js
8265
8444
 
8266
8445
 
8267
8446
 
8268
8447
 
8448
+ function Trans_Trans(_ref) {
8449
+ var children = _ref.children,
8450
+ count = _ref.count,
8451
+ parent = _ref.parent,
8452
+ i18nKey = _ref.i18nKey,
8453
+ context = _ref.context,
8454
+ _ref$tOptions = _ref.tOptions,
8455
+ tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions,
8456
+ values = _ref.values,
8457
+ defaults = _ref.defaults,
8458
+ components = _ref.components,
8459
+ ns = _ref.ns,
8460
+ i18nFromProps = _ref.i18n,
8461
+ tFromProps = _ref.t,
8462
+ shouldUnescape = _ref.shouldUnescape,
8463
+ additionalProps = _objectWithoutProperties(_ref, Trans_excluded);
8269
8464
 
8270
- function Provider({
8271
- store,
8272
- context,
8273
- children,
8274
- serverState
8275
- }) {
8276
- const contextValue = useMemo(() => {
8277
- const subscription = createSubscription(store);
8278
- return {
8279
- store,
8280
- subscription,
8281
- getServerState: serverState ? () => serverState : undefined
8282
- };
8283
- }, [store, serverState]);
8284
- const previousState = useMemo(() => store.getState(), [store]);
8285
- useIsomorphicLayoutEffect(() => {
8286
- const {
8287
- subscription
8288
- } = contextValue;
8289
- subscription.onStateChange = subscription.notifyNestedSubs;
8290
- subscription.trySubscribe();
8465
+ var _ref2 = useContext(I18nContext) || {},
8466
+ i18nFromContext = _ref2.i18n,
8467
+ defaultNSFromContext = _ref2.defaultNS;
8291
8468
 
8292
- if (previousState !== store.getState()) {
8293
- subscription.notifyNestedSubs();
8469
+ var i18n = i18nFromProps || i18nFromContext || getI18n();
8470
+ var t = tFromProps || i18n && i18n.t.bind(i18n);
8471
+ return TransWithoutContext(Trans_objectSpread({
8472
+ children: children,
8473
+ count: count,
8474
+ parent: parent,
8475
+ i18nKey: i18nKey,
8476
+ context: context,
8477
+ tOptions: tOptions,
8478
+ values: values,
8479
+ defaults: defaults,
8480
+ components: components,
8481
+ ns: ns || t && t.ns || defaultNSFromContext || i18n && i18n.options && i18n.options.defaultNS,
8482
+ i18n: i18n,
8483
+ t: tFromProps,
8484
+ shouldUnescape: shouldUnescape
8485
+ }, additionalProps));
8486
+ }
8487
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
8488
+ function _arrayWithHoles(r) {
8489
+ if (Array.isArray(r)) return r;
8490
+ }
8491
+
8492
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
8493
+ function _iterableToArrayLimit(r, l) {
8494
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
8495
+ if (null != t) {
8496
+ var e,
8497
+ n,
8498
+ i,
8499
+ u,
8500
+ a = [],
8501
+ f = !0,
8502
+ o = !1;
8503
+ try {
8504
+ if (i = (t = t.call(r)).next, 0 === l) {
8505
+ if (Object(t) !== t) return;
8506
+ f = !1;
8507
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
8508
+ } catch (r) {
8509
+ o = !0, n = r;
8510
+ } finally {
8511
+ try {
8512
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
8513
+ } finally {
8514
+ if (o) throw n;
8515
+ }
8294
8516
  }
8517
+ return a;
8518
+ }
8519
+ }
8295
8520
 
8296
- return () => {
8297
- subscription.tryUnsubscribe();
8298
- subscription.onStateChange = undefined;
8299
- };
8300
- }, [contextValue, previousState]);
8301
- const Context = context || ReactReduxContext; // @ts-ignore 'AnyAction' is assignable to the constraint of type 'A', but 'A' could be instantiated with a different subtype
8521
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
8522
+ function _arrayLikeToArray(r, a) {
8523
+ (null == a || a > r.length) && (a = r.length);
8524
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
8525
+ return n;
8526
+ }
8302
8527
 
8303
- return /*#__PURE__*/React.createElement(Context.Provider, {
8304
- value: contextValue
8305
- }, children);
8528
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
8529
+
8530
+ function _unsupportedIterableToArray(r, a) {
8531
+ if (r) {
8532
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
8533
+ var t = {}.toString.call(r).slice(8, -1);
8534
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
8535
+ }
8306
8536
  }
8307
8537
 
8308
- /* harmony default export */ const components_Provider = ((/* unused pure expression or super */ null && (Provider)));
8309
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/hooks/useStore.js
8538
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
8539
+ function _nonIterableRest() {
8540
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8541
+ }
8310
8542
 
8543
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
8311
8544
 
8312
8545
 
8313
- /**
8314
- * Hook factory, which creates a `useStore` hook bound to a given context.
8315
- *
8316
- * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
8317
- * @returns {Function} A `useStore` hook bound to the specified context.
8318
- */
8319
8546
 
8320
- function createStoreHook(context = Context_ReactReduxContext) {
8321
- const useReduxContext = // @ts-ignore
8322
- context === Context_ReactReduxContext ? useReduxContext_useReduxContext : () => (0,react.useContext)(context);
8323
- return function useStore() {
8324
- const {
8325
- store
8326
- } = useReduxContext(); // @ts-ignore
8327
8547
 
8328
- return store;
8329
- };
8548
+ function slicedToArray_slicedToArray(r, e) {
8549
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
8330
8550
  }
8331
- /**
8332
- * A hook to access the redux store.
8333
- *
8334
- * @returns {any} the redux store
8335
- *
8336
- * @example
8337
- *
8338
- * import React from 'react'
8339
- * import { useStore } from 'react-redux'
8340
- *
8341
- * export const ExampleComponent = () => {
8342
- * const store = useStore()
8343
- * return <div>{store.getState()}</div>
8344
- * }
8345
- */
8346
-
8347
- const useStore_useStore = /*#__PURE__*/createStoreHook();
8348
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/hooks/useDispatch.js
8349
8551
 
8552
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/useTranslation.js
8350
8553
 
8351
- /**
8352
- * Hook factory, which creates a `useDispatch` hook bound to a given context.
8353
- *
8354
- * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
8355
- * @returns {Function} A `useDispatch` hook bound to the specified context.
8356
- */
8357
8554
 
8358
- function createDispatchHook(context = Context_ReactReduxContext) {
8359
- const useStore = // @ts-ignore
8360
- context === Context_ReactReduxContext ? useStore_useStore : createStoreHook(context);
8361
- return function useDispatch() {
8362
- const store = useStore(); // @ts-ignore
8363
8555
 
8364
- return store.dispatch;
8365
- };
8366
- }
8367
- /**
8368
- * A hook to access the redux `dispatch` function.
8369
- *
8370
- * @returns {any|function} redux store's `dispatch` function
8371
- *
8372
- * @example
8373
- *
8374
- * import React, { useCallback } from 'react'
8375
- * import { useDispatch } from 'react-redux'
8376
- *
8377
- * export const CounterComponent = ({ value }) => {
8378
- * const dispatch = useDispatch()
8379
- * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])
8380
- * return (
8381
- * <div>
8382
- * <span>{value}</span>
8383
- * <button onClick={increaseCounter}>Increase counter</button>
8384
- * </div>
8385
- * )
8386
- * }
8387
- */
8388
8556
 
8389
- const useDispatch_useDispatch = /*#__PURE__*/createDispatchHook();
8390
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/exports.js
8557
+ function useTranslation_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
8391
8558
 
8559
+ function useTranslation_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { useTranslation_ownKeys(Object(source), true).forEach(function (key) { defineProperty_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { useTranslation_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
8392
8560
 
8393
8561
 
8394
8562
 
8395
8563
 
8396
8564
 
8565
+ var usePrevious = function usePrevious(value, ignore) {
8566
+ var ref = (0,react.useRef)();
8567
+ (0,react.useEffect)(function () {
8568
+ ref.current = ignore ? ref.current : value;
8569
+ }, [value, ignore]);
8570
+ return ref.current;
8571
+ };
8397
8572
 
8573
+ function useTranslation_useTranslation(ns) {
8574
+ var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8575
+ var i18nFromProps = props.i18n;
8398
8576
 
8577
+ var _ref = (0,react.useContext)(context_I18nContext) || {},
8578
+ i18nFromContext = _ref.i18n,
8579
+ defaultNSFromContext = _ref.defaultNS;
8399
8580
 
8400
- ;// CONCATENATED MODULE: ../../node_modules/react-redux/es/index.js
8401
- // The primary entry point assumes we're working with standard ReactDOM/RN, but
8402
- // older versions that do not include `useSyncExternalStore` (React 16.9 - 17.x).
8403
- // Because of that, the useSyncExternalStore compat shim is needed.
8581
+ var i18n = i18nFromProps || i18nFromContext || i18nInstance_getI18n();
8582
+ if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
8404
8583
 
8584
+ if (!i18n) {
8585
+ utils_warnOnce('You will need to pass in an i18next instance by using initReactI18next');
8405
8586
 
8587
+ var notReadyT = function notReadyT(k, optsOrDefaultValue) {
8588
+ if (typeof optsOrDefaultValue === 'string') return optsOrDefaultValue;
8589
+ if (optsOrDefaultValue && typeof_typeof(optsOrDefaultValue) === 'object' && typeof optsOrDefaultValue.defaultValue === 'string') return optsOrDefaultValue.defaultValue;
8590
+ return Array.isArray(k) ? k[k.length - 1] : k;
8591
+ };
8406
8592
 
8593
+ var retNotReady = [notReadyT, {}, false];
8594
+ retNotReady.t = notReadyT;
8595
+ retNotReady.i18n = {};
8596
+ retNotReady.ready = false;
8597
+ return retNotReady;
8598
+ }
8407
8599
 
8600
+ if (i18n.options.react && i18n.options.react.wait !== undefined) utils_warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');
8408
8601
 
8602
+ var i18nOptions = useTranslation_objectSpread(useTranslation_objectSpread(useTranslation_objectSpread({}, defaults_getDefaults()), i18n.options.react), props);
8409
8603
 
8410
- initializeUseSelector(with_selector.useSyncExternalStoreWithSelector);
8411
- initializeConnect(shim.useSyncExternalStore); // Enable batched updates in our subscriptions for use
8412
- // with standard React renderers (ReactDOM, React Native)
8604
+ var useSuspense = i18nOptions.useSuspense,
8605
+ keyPrefix = i18nOptions.keyPrefix;
8606
+ var namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
8607
+ namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
8608
+ if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
8609
+ var ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(function (n) {
8610
+ return hasLoadedNamespace(n, i18n, i18nOptions);
8611
+ });
8413
8612
 
8414
- setBatch(react_dom.unstable_batchedUpdates);
8613
+ function getT() {
8614
+ return i18n.getFixedT(props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
8615
+ }
8415
8616
 
8617
+ var _useState = (0,react.useState)(getT),
8618
+ _useState2 = slicedToArray_slicedToArray(_useState, 2),
8619
+ t = _useState2[0],
8620
+ setT = _useState2[1];
8416
8621
 
8417
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/hooks/useSafeSelector.ts
8622
+ var joinedNS = namespaces.join();
8623
+ if (props.lng) joinedNS = "".concat(props.lng).concat(joinedNS);
8624
+ var previousJoinedNS = usePrevious(joinedNS);
8625
+ var isMounted = (0,react.useRef)(true);
8626
+ (0,react.useEffect)(function () {
8627
+ var bindI18n = i18nOptions.bindI18n,
8628
+ bindI18nStore = i18nOptions.bindI18nStore;
8629
+ isMounted.current = true;
8418
8630
 
8419
- const useSafeSelector = selector => {
8420
- try {
8421
- return useSelector_useSelector(selector);
8422
- } catch (error) {
8423
- return {};
8424
- }
8425
- };
8426
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Input/InputViewTwo.tsx
8631
+ if (!ready && !useSuspense) {
8632
+ if (props.lng) {
8633
+ loadLanguages(i18n, props.lng, namespaces, function () {
8634
+ if (isMounted.current) setT(getT);
8635
+ });
8636
+ } else {
8637
+ loadNamespaces(i18n, namespaces, function () {
8638
+ if (isMounted.current) setT(getT);
8639
+ });
8640
+ }
8641
+ }
8427
8642
 
8643
+ if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
8644
+ setT(getT);
8645
+ }
8428
8646
 
8647
+ function boundReset() {
8648
+ if (isMounted.current) setT(getT);
8649
+ }
8429
8650
 
8651
+ if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
8652
+ if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
8653
+ return function () {
8654
+ isMounted.current = false;
8655
+ if (bindI18n && i18n) bindI18n.split(' ').forEach(function (e) {
8656
+ return i18n.off(e, boundReset);
8657
+ });
8658
+ if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(function (e) {
8659
+ return i18n.store.off(e, boundReset);
8660
+ });
8661
+ };
8662
+ }, [i18n, joinedNS]);
8663
+ var isInitial = (0,react.useRef)(true);
8664
+ (0,react.useEffect)(function () {
8665
+ if (isMounted.current && !isInitial.current) {
8666
+ setT(getT);
8667
+ }
8430
8668
 
8431
- function InputViewTwo_InputViewTwo(props) {
8432
- var _customStyle$placehol;
8433
- const {
8434
- name,
8435
- placeholder,
8436
- label,
8437
- onChange,
8438
- onFocus,
8439
- onBlur,
8440
- value,
8441
- maxLength,
8442
- className,
8443
- borderStyle,
8444
- type,
8445
- icon,
8446
- error,
8447
- inputMode,
8448
- autoFocus,
8449
- disabled,
8450
- customStyle
8451
- } = props;
8452
- const {
8453
- borderStyle: borderStyleState = borderStyle
8454
- } = useSafeSelector(state => state.customization);
8455
- const handleChange = e => {
8456
- const regexIsNumber = /^\d+$/;
8457
- const isInputEmpty = e.target.value === '';
8458
- if (type === 'tel' && !isInputEmpty && !regexIsNumber.test(e.target.value)) {
8459
- return;
8669
+ isInitial.current = false;
8670
+ }, [i18n, keyPrefix]);
8671
+ var ret = [t, i18n, ready];
8672
+ ret.t = t;
8673
+ ret.i18n = i18n;
8674
+ ret.ready = ready;
8675
+ if (ready) return ret;
8676
+ if (!ready && !useSuspense) return ret;
8677
+ throw new Promise(function (resolve) {
8678
+ if (props.lng) {
8679
+ loadLanguages(i18n, props.lng, namespaces, function () {
8680
+ return resolve();
8681
+ });
8460
8682
  } else {
8461
- onChange && onChange(e);
8683
+ loadNamespaces(i18n, namespaces, function () {
8684
+ return resolve();
8685
+ });
8462
8686
  }
8463
- };
8464
- return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
8465
- className: "flex flex-col w-full [&_*]:border-box relative",
8466
- children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
8467
- className: [`flex justify-between items-center gap-2 py-2.5 px-3 w-full h-10 relative overflow-hidden border border-gray-300 ${borderStyleState === borderStyle_borderStyleConstants.RECTANGULAR ? 'rounded-none' : 'rounded-lg'} bg-white`, className].join(' '),
8468
- style: customStyle != null && customStyle.input ? customStyle == null ? void 0 : customStyle.input : customStyle,
8469
- children: [label && /*#__PURE__*/(0,jsx_runtime.jsx)("label", {
8470
- className: "w-5 h-5 text-sm flex justify-start items-center whitespace-nowrap text-end",
8471
- htmlFor: name,
8472
- children: label
8473
- }), /*#__PURE__*/(0,jsx_runtime.jsx)("input", {
8474
- className: "w-full !rounded-none border-none focus:outline-none [&::placeholder]:text-[var(--placeholder-color)]",
8475
- style: {
8476
- paddingInlineEnd: '1rem',
8477
- backgroundColor: 'inherit',
8478
- '--placeholder-color': (customStyle == null || (_customStyle$placehol = customStyle.placeholder) == null ? void 0 : _customStyle$placehol.color) || '#667085'
8479
- },
8480
- id: name,
8481
- name: name,
8482
- type: type,
8483
- onChange: handleChange,
8484
- onFocus: onFocus,
8485
- onBlur: onBlur,
8486
- placeholder: placeholder ? placeholder : '',
8487
- maxLength: maxLength,
8488
- value: value,
8489
- autoComplete: "off",
8490
- inputMode: inputMode,
8491
- autoFocus: autoFocus,
8492
- disabled: disabled
8493
- }), icon && icon, error && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
8494
- className: "w-3 h-3",
8495
- src: error_namespaceObject,
8496
- alt: "error"
8497
- })]
8498
- })
8499
8687
  });
8500
8688
  }
8501
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Loader/loader.module.scss
8502
- // extracted by mini-css-extract-plugin
8503
- /* harmony default export */ const loader_module = ({"loader":"loader_loader__Vp1Wk","spinner":"loader_spinner__AvfnA"});
8504
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Loader/index.tsx
8689
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/withTranslation.js
8505
8690
 
8506
8691
 
8507
- function Loader(props) {
8508
- const {
8509
- size
8510
- } = props;
8511
- return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
8512
- style: {
8513
- width: size,
8514
- height: size
8515
- },
8516
- className: loader_module['loader']
8517
- });
8518
- }
8519
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Button/button.module.scss
8520
- // extracted by mini-css-extract-plugin
8521
- /* harmony default export */ const button_module = ({"container":"button_container__Wx2Jn","btn-text":"button_btn-text__rtmpL","fullWidth":"button_fullWidth__ECvUG","primary":"button_primary__q9Ttu","secondary":"button_secondary__8nAxD","customized":"button_customized__U5VRL"});
8522
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Button/index.tsx
8523
8692
 
8693
+ var withTranslation_excluded = (/* unused pure expression or super */ null && (["forwardedRef"]));
8694
+
8695
+ function withTranslation_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
8524
8696
 
8697
+ function withTranslation_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { withTranslation_ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { withTranslation_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
8525
8698
 
8526
8699
 
8527
- function Button_Button(props) {
8528
- const {
8529
- loading,
8530
- disabled,
8531
- label,
8532
- id,
8533
- color,
8534
- icon,
8535
- onClick,
8536
- type,
8537
- fullWidth,
8538
- customStyle,
8539
- className
8540
- } = props;
8541
- const customStyleToApply = disabled && customStyle != null && customStyle.disabled ? Object.assign({}, customStyle, customStyle.disabled) : customStyle;
8542
- const {
8543
- colors,
8544
- borderStyle
8545
- } = useSafeSelector(state => state.customization);
8546
- return /*#__PURE__*/(0,jsx_runtime.jsx)("button", {
8547
- style: Object.assign({
8548
- opacity: disabled && ((colors == null ? void 0 : colors.action) || customStyleToApply) && '0.4',
8549
- borderRadius: borderStyle === 'ROUNDED' ? '0.5rem' : !borderStyle ? 'revert-layer' : 0
8550
- }, customStyleToApply, {
8551
- background: id !== 'apple-pay-button' ? (colors == null ? void 0 : colors.action) || (customStyleToApply == null ? void 0 : customStyleToApply.backgroundColor) : '#000'
8552
- }),
8553
- className: [button_module['container'], button_module[color || 'primary'], fullWidth ? button_module['fullWidth'] : '', 'w-full', 'mt-4', ...(className ? [className] : [])].join(' '),
8554
- onClick: onClick,
8555
- disabled: disabled,
8556
- type: type && type,
8557
- id: id,
8558
- children: loading ? /*#__PURE__*/(0,jsx_runtime.jsx)(Loader, {
8559
- size: 16
8560
- }) : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
8561
- children: [icon && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
8562
- src: icon,
8563
- alt: label
8564
- }), label && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
8565
- className: `${button_module['btn-text']} !border-none`,
8566
- style: Object.assign({}, (customStyleToApply == null ? void 0 : customStyleToApply['fontSize']) && {
8567
- fontSize: customStyleToApply['fontSize']
8568
- }, (customStyleToApply == null ? void 0 : customStyleToApply['fontWeight']) && {
8569
- fontWeight: customStyleToApply['fontWeight']
8570
- }),
8571
- children: label
8572
- })]
8573
- })
8574
- });
8700
+
8701
+
8702
+ function withTranslation(ns) {
8703
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8704
+ return function Extend(WrappedComponent) {
8705
+ function I18nextWithTranslation(_ref) {
8706
+ var forwardedRef = _ref.forwardedRef,
8707
+ rest = _objectWithoutProperties(_ref, withTranslation_excluded);
8708
+
8709
+ var _useTranslation = useTranslation(ns, withTranslation_objectSpread(withTranslation_objectSpread({}, rest), {}, {
8710
+ keyPrefix: options.keyPrefix
8711
+ })),
8712
+ _useTranslation2 = _slicedToArray(_useTranslation, 3),
8713
+ t = _useTranslation2[0],
8714
+ i18n = _useTranslation2[1],
8715
+ ready = _useTranslation2[2];
8716
+
8717
+ var passDownProps = withTranslation_objectSpread(withTranslation_objectSpread({}, rest), {}, {
8718
+ t: t,
8719
+ i18n: i18n,
8720
+ tReady: ready
8721
+ });
8722
+
8723
+ if (options.withRef && forwardedRef) {
8724
+ passDownProps.ref = forwardedRef;
8725
+ } else if (!options.withRef && forwardedRef) {
8726
+ passDownProps.forwardedRef = forwardedRef;
8727
+ }
8728
+
8729
+ return createElement(WrappedComponent, passDownProps);
8730
+ }
8731
+
8732
+ I18nextWithTranslation.displayName = "withI18nextTranslation(".concat(getDisplayName(WrappedComponent), ")");
8733
+ I18nextWithTranslation.WrappedComponent = WrappedComponent;
8734
+
8735
+ var forwardRef = function forwardRef(props, ref) {
8736
+ return createElement(I18nextWithTranslation, Object.assign({}, props, {
8737
+ forwardedRef: ref
8738
+ }));
8739
+ };
8740
+
8741
+ return options.withRef ? forwardRefReact(forwardRef) : I18nextWithTranslation;
8742
+ };
8575
8743
  }
8576
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/assets/icons/circle.svg
8577
- var _path;
8578
- var circle_excluded = (/* unused pure expression or super */ null && (["title", "titleId"]));
8579
- function circle_extends() { return circle_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, circle_extends.apply(null, arguments); }
8580
- function circle_objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = circle_objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
8581
- function circle_objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
8744
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/Translation.js
8582
8745
 
8583
8746
 
8584
- var SvgCircle = function SvgCircle(_ref, ref) {
8585
- var title = _ref.title,
8586
- titleId = _ref.titleId,
8587
- props = circle_objectWithoutProperties(_ref, circle_excluded);
8588
- return /*#__PURE__*/React.createElement("svg", circle_extends({
8589
- width: 24,
8590
- height: 24,
8591
- viewBox: "0 0 24 24",
8592
- fill: "none",
8593
- xmlns: "http://www.w3.org/2000/svg",
8594
- ref: ref,
8595
- "aria-labelledby": titleId
8596
- }, props), title ? /*#__PURE__*/React.createElement("title", {
8597
- id: titleId
8598
- }, title) : null, _path || (_path = /*#__PURE__*/React.createElement("path", {
8599
- d: "M21 12C21 16.9922 16.957 21 12 21C7.00781 21 3 16.9922 3 12C3 7.04297 7.00781 3 12 3C16.957 3 21 7.04297 21 12ZM12 4.6875C7.95703 4.6875 4.6875 7.99219 4.6875 12C4.6875 16.043 7.95703 19.3125 12 19.3125C16.0078 19.3125 19.3125 16.043 19.3125 12C19.3125 7.99219 16.0078 4.6875 12 4.6875Z",
8600
- fill: "#667085"
8601
- })));
8602
- };
8603
- var ForwardRef = /*#__PURE__*/(/* unused pure expression or super */ null && (forwardRef(SvgCircle)));
8747
+ var Translation_excluded = (/* unused pure expression or super */ null && (["ns", "children"]));
8604
8748
 
8605
- /* harmony default export */ const circle = (__webpack_require__.p + "circle.22e1a0a2a35306fe278668ddabc49974.svg");
8606
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/assets/icons/check.svg
8607
- var check_path;
8608
- var check_excluded = (/* unused pure expression or super */ null && (["title", "titleId"]));
8609
- function check_extends() { return check_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, check_extends.apply(null, arguments); }
8610
- function check_objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = check_objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
8611
- function check_objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
8749
+ function Translation(props) {
8750
+ var ns = props.ns,
8751
+ children = props.children,
8752
+ options = _objectWithoutProperties(props, Translation_excluded);
8612
8753
 
8754
+ var _useTranslation = useTranslation(ns, options),
8755
+ _useTranslation2 = _slicedToArray(_useTranslation, 3),
8756
+ t = _useTranslation2[0],
8757
+ i18n = _useTranslation2[1],
8758
+ ready = _useTranslation2[2];
8613
8759
 
8614
- var SvgCheck = function SvgCheck(_ref, ref) {
8615
- var title = _ref.title,
8616
- titleId = _ref.titleId,
8617
- props = check_objectWithoutProperties(_ref, check_excluded);
8618
- return /*#__PURE__*/React.createElement("svg", check_extends({
8619
- xmlns: "http://www.w3.org/2000/svg",
8620
- width: 12.87,
8621
- height: 9.101,
8622
- viewBox: "0 0 12.87 9.101",
8623
- ref: ref,
8624
- "aria-labelledby": titleId
8625
- }, props), title ? /*#__PURE__*/React.createElement("title", {
8626
- id: titleId
8627
- }, title) : null, check_path || (check_path = /*#__PURE__*/React.createElement("path", {
8628
- id: "Vector",
8629
- d: "M0,3.343,3.343,6.686,10.042,0",
8630
- transform: "translate(1.414 1.414)",
8631
- fill: "none",
8632
- stroke: "#1782fb",
8633
- strokeLinecap: "round",
8634
- strokeLinejoin: "round",
8635
- strokeWidth: 2
8636
- })));
8637
- };
8638
- var check_ForwardRef = /*#__PURE__*/(/* unused pure expression or super */ null && (forwardRef(SvgCheck)));
8760
+ return children(t, {
8761
+ i18n: i18n,
8762
+ lng: i18n.language
8763
+ }, ready);
8764
+ }
8765
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/I18nextProvider.js
8639
8766
 
8640
- /* harmony default export */ const icons_check = (__webpack_require__.p + "check.021d9dd3dee18e90e138da39f88ef694.svg");
8641
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/assets/icons/chevron-down.svg
8642
- var chevron_down_path;
8643
- var chevron_down_excluded = (/* unused pure expression or super */ null && (["title", "titleId"]));
8644
- function chevron_down_extends() { return chevron_down_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, chevron_down_extends.apply(null, arguments); }
8645
- function chevron_down_objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = chevron_down_objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
8646
- function chevron_down_objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
8647
8767
 
8768
+ function I18nextProvider(_ref) {
8769
+ var i18n = _ref.i18n,
8770
+ defaultNS = _ref.defaultNS,
8771
+ children = _ref.children;
8772
+ var value = useMemo(function () {
8773
+ return {
8774
+ i18n: i18n,
8775
+ defaultNS: defaultNS
8776
+ };
8777
+ }, [i18n, defaultNS]);
8778
+ return createElement(I18nContext.Provider, {
8779
+ value: value
8780
+ }, children);
8781
+ }
8782
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/useSSR.js
8783
+
8784
+
8785
+ function useSSR_useSSR(initialI18nStore, initialLanguage) {
8786
+ var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
8787
+ var i18nFromProps = props.i18n;
8788
+
8789
+ var _ref = useContext(I18nContext) || {},
8790
+ i18nFromContext = _ref.i18n;
8648
8791
 
8649
- var SvgChevronDown = function SvgChevronDown(_ref, ref) {
8650
- var title = _ref.title,
8651
- titleId = _ref.titleId,
8652
- props = chevron_down_objectWithoutProperties(_ref, chevron_down_excluded);
8653
- return /*#__PURE__*/React.createElement("svg", chevron_down_extends({
8654
- width: 12,
8655
- height: 12,
8656
- viewBox: "0 0 12 12",
8657
- fill: "none",
8658
- xmlns: "http://www.w3.org/2000/svg",
8659
- ref: ref,
8660
- "aria-labelledby": titleId
8661
- }, props), title ? /*#__PURE__*/React.createElement("title", {
8662
- id: titleId
8663
- }, title) : null, chevron_down_path || (chevron_down_path = /*#__PURE__*/React.createElement("path", {
8664
- d: "M9.66488 4.69564L6.30746 7.91244C6.20199 8.00033 6.09652 8.03549 6.00863 8.03549C5.90316 8.03549 5.79769 8.00033 5.7098 7.93002L2.3348 4.69564C2.15902 4.53744 2.15902 4.25619 2.31723 4.09799C2.47543 3.92221 2.75668 3.92221 2.91488 4.08041L6.00863 7.03353L9.0848 4.08041C9.24301 3.92221 9.52426 3.92221 9.68246 4.09799C9.84066 4.25619 9.84066 4.53744 9.66488 4.69564Z",
8665
- fill: "#667085"
8666
- })));
8667
- };
8668
- var chevron_down_ForwardRef = /*#__PURE__*/(/* unused pure expression or super */ null && (forwardRef(SvgChevronDown)));
8792
+ var i18n = i18nFromProps || i18nFromContext || getI18n();
8793
+ if (i18n.options && i18n.options.isClone) return;
8669
8794
 
8670
- /* harmony default export */ const chevron_down = (__webpack_require__.p + "chevron-down.413212cab44b2a7ef0f299360be6f2b1.svg");
8671
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/hooks/useCloseDropdown.ts
8795
+ if (initialI18nStore && !i18n.initializedStoreOnce) {
8796
+ i18n.services.resourceStore.data = initialI18nStore;
8797
+ i18n.options.ns = Object.values(initialI18nStore).reduce(function (mem, lngResources) {
8798
+ Object.keys(lngResources).forEach(function (ns) {
8799
+ if (mem.indexOf(ns) < 0) mem.push(ns);
8800
+ });
8801
+ return mem;
8802
+ }, i18n.options.ns);
8803
+ i18n.initializedStoreOnce = true;
8804
+ i18n.isInitialized = true;
8805
+ }
8672
8806
 
8673
- function useCloseDropdown_useCloseDropdown(setShowDropdown) {
8674
- const inputContainerRef = (0,react.useRef)(null);
8675
- (0,react.useEffect)(() => {
8676
- function handleClickOutside(e) {
8677
- if (inputContainerRef.current && !inputContainerRef.current.contains(e.target)) {
8678
- setShowDropdown(false);
8679
- }
8680
- }
8681
- document.addEventListener('mousedown', handleClickOutside);
8682
- return () => document.removeEventListener('mousedown', handleClickOutside);
8683
- }, []);
8684
- return inputContainerRef;
8807
+ if (initialLanguage && !i18n.initializedLanguageOnce) {
8808
+ i18n.changeLanguage(initialLanguage);
8809
+ i18n.initializedLanguageOnce = true;
8810
+ }
8685
8811
  }
8686
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Dropdown/DropdownViewTwo.tsx
8812
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/withSSR.js
8687
8813
 
8688
8814
 
8815
+ var withSSR_excluded = (/* unused pure expression or super */ null && (["initialI18nStore", "initialLanguage"]));
8689
8816
 
8817
+ function withSSR_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
8690
8818
 
8819
+ function withSSR_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { withSSR_ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { withSSR_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
8691
8820
 
8692
8821
 
8693
8822
 
8694
8823
 
8695
- function DropdownViewTwo_Dropdown(props) {
8696
- const [option, setOptin] = (0,react.useState)(null);
8697
- const {
8698
- label,
8699
- options,
8700
- onChange,
8701
- customStyle
8702
- } = props;
8703
- const [show, setShow] = (0,react.useState)(false);
8704
- const {
8705
- borderStyle
8706
- } = useSelector_useSelector(state => state.customization);
8707
- const inputContainerRef = useCloseDropdown_useCloseDropdown(setShow);
8708
- const selectOption = option => {
8709
- setOptin(option);
8710
- onChange(option);
8711
- setShow(false);
8712
- };
8713
- const removeSelectedOption = e => {
8714
- e.stopPropagation();
8715
- setOptin(null);
8716
- onChange();
8824
+
8825
+ function withSSR() {
8826
+ return function Extend(WrappedComponent) {
8827
+ function I18nextWithSSR(_ref) {
8828
+ var initialI18nStore = _ref.initialI18nStore,
8829
+ initialLanguage = _ref.initialLanguage,
8830
+ rest = _objectWithoutProperties(_ref, withSSR_excluded);
8831
+
8832
+ useSSR(initialI18nStore, initialLanguage);
8833
+ return createElement(WrappedComponent, withSSR_objectSpread({}, rest));
8834
+ }
8835
+
8836
+ I18nextWithSSR.getInitialProps = composeInitialProps(WrappedComponent);
8837
+ I18nextWithSSR.displayName = "withI18nextSSR(".concat(getDisplayName(WrappedComponent), ")");
8838
+ I18nextWithSSR.WrappedComponent = WrappedComponent;
8839
+ return I18nextWithSSR;
8717
8840
  };
8718
- return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
8719
- ref: inputContainerRef,
8720
- className: "h-10",
8721
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
8722
- className: `
8723
- h-10 box-border flex items-center border px-2 relative cursor-pointer border-gray-300
8724
- ${show ? 'border-[#7294FF] shadow-[0_0_2px_4px_#B9CAFF]' : ''}
8725
- ${borderStyle === borderStyle_borderStyleConstants.RECTANGULAR ? 'rounded-none' : 'rounded-lg'}
8726
- `,
8727
- onClick: () => setShow(prev => !prev),
8728
- style: customStyle,
8729
- children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
8730
- className: "text-sm font-normal",
8731
- children: option && option.label ? /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
8732
- children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
8733
- className: "flex items-center h-8 cursor-pointer",
8734
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
8735
- className: "w-auto h-6 mr-2",
8736
- src: circle,
8737
- alt: option.label
8738
- }), /*#__PURE__*/(0,jsx_runtime.jsx)("h6", {
8739
- className: "text-sm block my-auto mx-0 text-gray-900",
8740
- children: option.label
8741
- })]
8742
- }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
8743
- className: "absolute right-4 top-1/2 -translate-y-1/2 h-5 w-5 text-center text-gray-700 transition-all",
8744
- onClick: removeSelectedOption,
8745
- children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
8746
- children: "\u2716"
8747
- })
8748
- })]
8749
- }) : /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
8750
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
8751
- className: "text-sm font-normal text-gray-500",
8752
- children: label
8753
- }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
8754
- className: `
8755
- absolute right-4 top-1/2 -translate-y-1/2 h-5 w-5 text-center text-gray-700 transition-all
8756
- ${show ? 'rotate-180' : 'rotate-0'}
8757
- `,
8758
- children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
8759
- className: "w-5 h-5 object-contain",
8760
- src: chevron_down,
8761
- alt: "down arrow"
8762
- })
8763
- })]
8764
- })
8765
- })
8766
- }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
8767
- className: `
8768
- relative invisible border border-gray-300 opacity-0 -translate-y-8 -z-10 transition-all bg-white
8769
- ${show ? '!opacity-100 translate-y-0 !visible !z-10' : ''}
8770
- ${borderStyle === 'RECTANGULAR' ? 'rounded-none' : 'rounded-lg'}
8771
- `,
8772
- children: /*#__PURE__*/(0,jsx_runtime.jsx)("ul", {
8773
- className: "list-none max-h-80 overflow-y-scroll",
8774
- children: options != null && options.length ? options.map(dropDownOption => {
8775
- return /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
8776
- className: `
8777
- relative p-3 flex cursor-pointer hover:bg-gray-50
8778
- ${(option == null ? void 0 : option.value) === dropDownOption.value ? 'bg-gray-50 hover:bg-gray-50' : ''}
8779
- `,
8780
- onClick: () => selectOption(dropDownOption),
8781
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
8782
- className: "w-auto h-6 mr-2",
8783
- src: circle,
8784
- alt: dropDownOption.label
8785
- }), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
8786
- className: "text-sm font-medium block my-auto mx-0 text-gray-900",
8787
- children: dropDownOption.label
8788
- }), (option == null ? void 0 : option.value) === dropDownOption.value && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
8789
- className: "absolute right-4 top-1/2 -translate-y-1/2",
8790
- src: icons_check,
8791
- alt: "checked"
8792
- })]
8793
- }, dropDownOption.value);
8794
- }) : /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
8795
- className: "py-3 px-4 flex h-8 cursor-pointer hover:bg-[#eeeff4] bg-[#eeeff4] justify-center",
8796
- children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
8797
- className: "flex items-center",
8798
- children: "No options"
8799
- })
8800
- })
8801
- })
8802
- })]
8803
- });
8804
8841
  }
8805
- // EXTERNAL MODULE: ../../node_modules/react-phone-input-2/lib/lib.js
8806
- var lib = __webpack_require__(3305);
8807
- var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
8808
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Phone/phone.module.scss
8809
- // extracted by mini-css-extract-plugin
8810
- /* harmony default export */ const phone_module = ({"container":"phone_container__GZ4Zc","phone-input-container":"phone_phone-input-container__Jagi-","phone-input":"phone_phone-input__MR5FU","flags-button-dropdown":"phone_flags-button-dropdown__neYpm","countries-dropdown":"phone_countries-dropdown__J3Ovy"});
8811
- ;// CONCATENATED MODULE: ../../libs/kit-components/src/components/Phone/index.tsx
8842
+ ;// CONCATENATED MODULE: ../../node_modules/react-i18next/dist/es/index.js
8812
8843
 
8813
8844
 
8814
8845
 
8815
8846
 
8816
8847
 
8817
- const getRegexPhoneTemp = countryName => {
8818
- switch (countryName) {
8819
- case 'Jordan':
8820
- return /^(962)[3]{0,1}[7]{1}[7-9]{1}[0-9]{7}$/;
8821
- case 'Pakistan':
8822
- return /^(92)[0-9]{10}$/;
8823
- case 'Saudi Arabia':
8824
- return /^(966)[0-9]{9}$/;
8825
- case 'United Arab Emirates':
8826
- return /^(971)?(?:50|51|52|55|56|58|2|3|4|6|7|9)\d{7}$/;
8827
- default:
8828
- return /^(20)1[0125][0-9]{8}$/;
8829
- }
8830
- };
8831
- const validatePhone = (value, countryName) => {
8832
- const regexTemp = getRegexPhoneTemp(countryName);
8833
- return value.match(regexTemp) ? '' : 'Please enter a valid number';
8834
- };
8835
- function Phone(props) {
8836
- const {
8837
- name,
8838
- value,
8839
- onChange,
8840
- error,
8841
- country,
8842
- customStyle,
8843
- disabled
8844
- } = props;
8845
- const [phoneError, setPhoneError] = react.useState(error);
8846
- react.useEffect(() => {
8847
- setPhoneError(error);
8848
- }, [error]);
8849
- return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
8850
- className: phone_module['container'],
8851
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)((lib_default()), {
8852
- containerStyle: customStyle,
8853
- inputProps: {
8854
- name,
8855
- required: true,
8856
- autoFocus: false
8857
- },
8858
- onlyCountries: ['eg', 'ae', 'sa', 'jo', 'pk'],
8859
- containerClass: phone_module['phone-input-container'],
8860
- inputClass: phone_module['phone-input'],
8861
- dropdownClass: phone_module['countries-dropdown'],
8862
- buttonClass: phone_module['flags-button-dropdown'],
8863
- country: country || 'eg',
8864
- value: value,
8865
- onChange: (value, data, e) => {
8866
- e.target.value = '+' + value;
8867
- setPhoneError(validatePhone(value, data.name));
8868
- return onChange(e);
8869
- },
8870
- disabled: disabled
8871
- }), phoneError && /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
8872
- children: phoneError
8873
- })]
8874
- });
8875
- }
8848
+
8849
+
8850
+
8851
+
8852
+
8853
+
8854
+
8855
+ var date = function date() {
8856
+ return '';
8857
+ };
8858
+ var time = function time() {
8859
+ return '';
8860
+ };
8861
+ var number = function number() {
8862
+ return '';
8863
+ };
8864
+ var es_select = function select() {
8865
+ return '';
8866
+ };
8867
+ var plural = function plural() {
8868
+ return '';
8869
+ };
8870
+ var selectOrdinal = function selectOrdinal() {
8871
+ return '';
8872
+ };
8876
8873
  ;// CONCATENATED MODULE: ../../libs/kit-components/src/assets/icons/payment-succesful-1.png
8877
8874
  const payment_succesful_1_namespaceObject = __webpack_require__.p + "payment-succesful-1.dd6ee56033bac452.png";
8878
8875
  ;// CONCATENATED MODULE: ../../libs/kit-components/src/assets/icons/payment-succesful-2.png
@@ -17642,6 +17639,110 @@ function TermsConditions_TermsConditions() {
17642
17639
 
17643
17640
 
17644
17641
 
17642
+ ;// CONCATENATED MODULE: ../../node_modules/react-loading-skeleton/dist/index.js
17643
+ 'use client';
17644
+
17645
+
17646
+ /**
17647
+ * @internal
17648
+ */
17649
+ const SkeletonThemeContext = react.createContext({});
17650
+
17651
+ /* eslint-disable react/no-array-index-key */
17652
+ const defaultEnableAnimation = true;
17653
+ // For performance & cleanliness, don't add any inline styles unless we have to
17654
+ function styleOptionsToCssProperties({ baseColor, highlightColor, width, height, borderRadius, circle, direction, duration, enableAnimation = defaultEnableAnimation, }) {
17655
+ const style = {};
17656
+ if (direction === 'rtl')
17657
+ style['--animation-direction'] = 'reverse';
17658
+ if (typeof duration === 'number')
17659
+ style['--animation-duration'] = `${duration}s`;
17660
+ if (!enableAnimation)
17661
+ style['--pseudo-element-display'] = 'none';
17662
+ if (typeof width === 'string' || typeof width === 'number')
17663
+ style.width = width;
17664
+ if (typeof height === 'string' || typeof height === 'number')
17665
+ style.height = height;
17666
+ if (typeof borderRadius === 'string' || typeof borderRadius === 'number')
17667
+ style.borderRadius = borderRadius;
17668
+ if (circle)
17669
+ style.borderRadius = '50%';
17670
+ if (typeof baseColor !== 'undefined')
17671
+ style['--base-color'] = baseColor;
17672
+ if (typeof highlightColor !== 'undefined')
17673
+ style['--highlight-color'] = highlightColor;
17674
+ return style;
17675
+ }
17676
+ function dist_Skeleton({ count = 1, wrapper: Wrapper, className: customClassName, containerClassName, containerTestId, circle = false, style: styleProp, ...originalPropsStyleOptions }) {
17677
+ var _a, _b, _c;
17678
+ const contextStyleOptions = react.useContext(SkeletonThemeContext);
17679
+ const propsStyleOptions = { ...originalPropsStyleOptions };
17680
+ // DO NOT overwrite style options from the context if `propsStyleOptions`
17681
+ // has properties explicity set to undefined
17682
+ for (const [key, value] of Object.entries(originalPropsStyleOptions)) {
17683
+ if (typeof value === 'undefined') {
17684
+ delete propsStyleOptions[key];
17685
+ }
17686
+ }
17687
+ // Props take priority over context
17688
+ const styleOptions = {
17689
+ ...contextStyleOptions,
17690
+ ...propsStyleOptions,
17691
+ circle,
17692
+ };
17693
+ // `styleProp` has the least priority out of everything
17694
+ const style = {
17695
+ ...styleProp,
17696
+ ...styleOptionsToCssProperties(styleOptions),
17697
+ };
17698
+ let className = 'react-loading-skeleton';
17699
+ if (customClassName)
17700
+ className += ` ${customClassName}`;
17701
+ const inline = (_a = styleOptions.inline) !== null && _a !== void 0 ? _a : false;
17702
+ const elements = [];
17703
+ const countCeil = Math.ceil(count);
17704
+ for (let i = 0; i < countCeil; i++) {
17705
+ let thisStyle = style;
17706
+ if (countCeil > count && i === countCeil - 1) {
17707
+ // count is not an integer and we've reached the last iteration of
17708
+ // the loop, so add a "fractional" skeleton.
17709
+ //
17710
+ // For example, if count is 3.5, we've already added 3 full
17711
+ // skeletons, so now we add one more skeleton that is 0.5 times the
17712
+ // original width.
17713
+ const width = (_b = thisStyle.width) !== null && _b !== void 0 ? _b : '100%'; // 100% is the default since that's what's in the CSS
17714
+ const fractionalPart = count % 1;
17715
+ const fractionalWidth = typeof width === 'number'
17716
+ ? width * fractionalPart
17717
+ : `calc(${width} * ${fractionalPart})`;
17718
+ thisStyle = { ...thisStyle, width: fractionalWidth };
17719
+ }
17720
+ const skeletonSpan = (react.createElement("span", { className: className, style: thisStyle, key: i }, "\u200C"));
17721
+ if (inline) {
17722
+ elements.push(skeletonSpan);
17723
+ }
17724
+ else {
17725
+ // Without the <br />, the skeleton lines will all run together if
17726
+ // `width` is specified
17727
+ elements.push(react.createElement(react.Fragment, { key: i },
17728
+ skeletonSpan,
17729
+ react.createElement("br", null)));
17730
+ }
17731
+ }
17732
+ return (react.createElement("span", { className: containerClassName, "data-testid": containerTestId, "aria-live": "polite", "aria-busy": (_c = styleOptions.enableAnimation) !== null && _c !== void 0 ? _c : defaultEnableAnimation }, Wrapper
17733
+ ? elements.map((el, i) => react.createElement(Wrapper, { key: i }, el))
17734
+ : elements));
17735
+ }
17736
+
17737
+ function SkeletonTheme({ children, ...styleOptions }) {
17738
+ return (React.createElement(SkeletonThemeContext.Provider, { value: styleOptions }, children));
17739
+ }
17740
+
17741
+
17742
+
17743
+ // EXTERNAL MODULE: ../../node_modules/card-validator/dist/index.js
17744
+ var dist = __webpack_require__(9344);
17745
+ var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
17645
17746
  ;// CONCATENATED MODULE: ../../libs/card/src/assets/icons/visa.png
17646
17747
  const visa_namespaceObject = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAE5klEQVRoge2WW2xUVRSGv7VnoOUiaYq1M0NnWhQVuZlUQDARExONl4SYkEY0EkiIxWhnWhJIeCCmPpKI0IuRVDAkJmqEBJ8QgUSDD4BIDKSNkgi0M+1Mi1xKKrW3c5YPnTNzzqHl3Xj+p73WXpf/P/tyNgQIECBAgAABAgQIEOD/ColUp3YYZRUgvql7qP11NtN20p8Uize9gdhvF0PlTLanpT0WT36sIk877rDamzOZ9qxjP1zdFA1jvWPUvKDoY8BM4CaQBk7l0q0d9/VKNL6k2HWClAHYylB/pnVroTVAPN4Qs0Q2KXwAEnflj5QYE+3u3j/oLhpNJC+C1BaLyMvZdMupSCLVJxDLu0dz6fK50DwBEKtubFDVPcDsaT7m77l06xK3I5JILhHkEhB2+42l8b6+tl4AA5DJtGez6bY9JWboCUX/dMWWjk7Ya7zkU8+4yYN2ZdMtp6uqtpe7yIPyh0M+mkjVq2rbA8ij6GW/z2B2+skDWCGzthjjQnf34RGj8p2nsNHV3nR512OJ7Ad0gonl3jA6JwfNYeAjH9vdITtUNRIeKZOQLBbRrSJ86w55ZGFjpaIb/eQne2pBwH3qRDihsKOoUFY544qK9+eCvuUKv834yFcAhGQZ6uYvnQDRhX8twApFXDn2uDFf5Hr25QDuwF3gip9HyNYkUJo3h4AMsARAbKZeAYCyh8p/Bv52bBWedcYzZoc3AvNcLD/LZjuGAURZ5q5jMbkCIzI+KDDumjIz1P4lkkhthub7+gPEYvWzUd4revQbUX50caqtqdlSOqWArq7mMaUYjFIRqWmqAVClsH0Exs2EHnClegSImVyBO9c67irs9bWpEjgcqb79W2V1w4t+DnZo1hZgfoGCms/V6FlXyMwxnVc7pYC8xBPeivbqqqrGFUDhPKhyxLkJ8nDfIEP93ft7HCOXzu1WZA9ge0QqK4yak9FEo+tcNRsRTRapcLk/03LBsjnnoQTPTStAjfW92zaqq23Rek8BlVZnvGBBsgooL+SjneA+EUes/nTLLhPSWuC4r10ItDVfg1h8cD2w2DXfAXAj03YVGCiIt2UtTHGIAQZ62q9HE6krwJMAKrIOeLyQrJwb6G0579hWWJeLFv+DgnMDedF3ve0S8HqkOvWaKEeBWfmpUivEGuCoir3dk6T6fDSRWpGvaztfxbmJpt5Ck3Bvo1VAmWPYwj5vqHj3f15A+aLkvMrKHXP8hft7Wo8D3d4Sei8ab1gJrPPWkjeBeqBeIVrQBdFITVPNlCsAoGL/IGoap5jq668YOUba3dt3A4l2ApSOmle1ZOxQLJE6boucF9UbIjJTbTaAPuVKGdSR0jOUjB7yvWceCGNZa6cVELZm/GQZaxjf31PQNi52jPvCPQIIT3QC6KR/jkKdqNYBqKr/1WUpbAvNGZ+vE7LB5b+myC4PYdWQCl+S3/q2yPQCenv3/ROtTp1BecXlHhbLPuiNrAuBuL/mzYGrB25MDvXR6ern57sEmnLpttPR6tRevGfyYH+65Yg/I5pI7nSeMsIDBACoLR+K6LGCLfT29X16yx2zdOnS0J2hW+sd27LNkDPOZco3RRO3PwFdqUjEiFRi28OI9KjaZ3OZ9l+dWLG5oMK2Qq+xYl83bNGdRmURgKj6d0KAAAECBAgQIECAAAEC/HfwLxE/1z0yRxeCAAAAAElFTkSuQmCC";
17647
17748
  ;// CONCATENATED MODULE: ../../libs/card/src/assets/icons/mastercard.png
@@ -18089,9 +18190,7 @@ function cardFormViewTwo_Card(props) {
18089
18190
  if (isValidVisa) setIsValidVisa == null || setIsValidVisa(true);else setIsValidVisa == null || setIsValidVisa(false);
18090
18191
  }, [isValidVisa]);
18091
18192
  useEffect(() => {
18092
- if (cardType && setIsOmanNetCard) {
18093
- setIsOmanNetCard(cardType === CARD_TYPES.OMAN);
18094
- }
18193
+ setIsOmanNetCard == null || setIsOmanNetCard(cardType === CARD_TYPES.OMAN);
18095
18194
  }, [cardType, setIsOmanNetCard]);
18096
18195
  return /*#__PURE__*/_jsxs("form", {
18097
18196
  onSubmit: handleSubmit(onSubmit),
@@ -18418,9 +18517,7 @@ function mobileCardFormViewTwo_MobileCard(props) {
18418
18517
  if (isValidVisa) setIsValidVisa(true);else setIsValidVisa(false);
18419
18518
  }, [isValidVisa]);
18420
18519
  useEffect(() => {
18421
- if (cardType && setIsOmanNetCard) {
18422
- setIsOmanNetCard(cardType === CARD_TYPES.OMAN);
18423
- }
18520
+ setIsOmanNetCard == null || setIsOmanNetCard(cardType === CARD_TYPES.OMAN);
18424
18521
  }, [cardType, setIsOmanNetCard]);
18425
18522
  useEffect(() => {
18426
18523
  if (numberWatch) {
@@ -19753,6 +19850,7 @@ const payWithSavedCard = payload => {
19753
19850
 
19754
19851
 
19755
19852
 
19853
+
19756
19854
  // import { DeleteCard } from '@unified-checkout/card';
19757
19855
 
19758
19856
 
@@ -19789,7 +19887,7 @@ function CardElement({
19789
19887
  const [isActionBtnDisabled, setIsActionBtnDisabled] = (0,react.useState)(false);
19790
19888
  const [shouldSubmitData, setShouldSubmitData] = (0,react.useState)(false);
19791
19889
  const [saveCard, setSaveCard] = (0,react.useState)(false);
19792
- const [height, setHeight] = (0,react.useState)();
19890
+ const [height, setHeight] = (0,react.useState)(80.5);
19793
19891
  const [errorMessage, setErrorMessage] = (0,react.useState)('');
19794
19892
  const iframeRef = (0,react.useRef)(null);
19795
19893
  const [errors, setErrors] = (0,react.useState)({});
@@ -19819,7 +19917,7 @@ function CardElement({
19819
19917
  }
19820
19918
  }
19821
19919
  if (event.data.iframeCardHight) {
19822
- setHeight(event.data.iframeCardHight);
19920
+ setHeight(event.data.iframeCardHight + 0.5);
19823
19921
  }
19824
19922
  if (event.data.selectedCardCVV) {
19825
19923
  setSelectedCardCVV(event.data.selectedCardCVV);
@@ -19845,6 +19943,7 @@ function CardElement({
19845
19943
  };
19846
19944
  const handlePaymentResponse = res => {
19847
19945
  var _res$data, _res$data2;
19946
+ setShouldSubmitData(false);
19848
19947
  const cardHolderInput = document.getElementById('name');
19849
19948
  if (cardHolderInput) {
19850
19949
  setTimeout(() => cardHolderInput.disabled = false, 1000);
@@ -19908,6 +20007,7 @@ function CardElement({
19908
20007
  if (iframe && shouldSubmitData) {
19909
20008
  const handlePay = async () => {
19910
20009
  var _iframe$contentWindow;
20010
+ if (loading) return;
19911
20011
  const cardHolderInput = document.getElementById('name');
19912
20012
  if (cardHolderInput) {
19913
20013
  cardHolderInput.disabled = true;
@@ -20021,6 +20121,7 @@ function CardElement({
20021
20121
  setSelectedDeleteCard(card);
20022
20122
  };
20023
20123
  const handleSavedCardSubmit = async () => {
20124
+ if (loading) return;
20024
20125
  setLoading(true);
20025
20126
  if (onBeforePaymentComplete) {
20026
20127
  const result = await onBeforePaymentComplete();
@@ -20115,7 +20216,21 @@ function CardElement({
20115
20216
  })]
20116
20217
  }), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
20117
20218
  className: "[&>div:nth-child(even)]:w-[calc(100%-1px)]",
20118
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
20219
+ children: [!isIframeLoaded && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
20220
+ className: "-mt-1",
20221
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)(dist_Skeleton, {
20222
+ height: 37
20223
+ }), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
20224
+ className: "flex gap-1 [&>*]:flex-1",
20225
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)(dist_Skeleton, {
20226
+ height: 37
20227
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)(dist_Skeleton, {
20228
+ height: 37
20229
+ })]
20230
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)(dist_Skeleton, {
20231
+ height: 37
20232
+ })]
20233
+ }), /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
20119
20234
  title: 'Elements',
20120
20235
  id: "iFrame",
20121
20236
  ref: iframeRef,
@@ -20130,7 +20245,7 @@ function CardElement({
20130
20245
  frameBorder: "0",
20131
20246
  scrolling: "no",
20132
20247
  width: "100%",
20133
- height: height && height + 0.5,
20248
+ height: height,
20134
20249
  onLoad: () => setIsIframeLoaded(true)
20135
20250
  }), isIframeLoaded && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
20136
20251
  children: [!hideCardHolderName && /*#__PURE__*/(0,jsx_runtime.jsx)(components_CardHolder_CardHolder, {
@@ -20153,7 +20268,7 @@ function CardElement({
20153
20268
  })]
20154
20269
  })]
20155
20270
  })]
20156
- }), isIframeLoaded && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
20271
+ }), /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
20157
20272
  children: [forceSaveCard && /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
20158
20273
  style: customStyle == null ? void 0 : customStyle.label,
20159
20274
  className: "flex h-4 flex-col justify-center text-gray-700 text-sm font-medium leading-6 tracking-[0.01rem]",
@@ -20455,107 +20570,6 @@ function BankDetails(props) {
20455
20570
  });
20456
20571
  }
20457
20572
  /* harmony default export */ const components_BankDetails = (BankDetails);
20458
- ;// CONCATENATED MODULE: ../../node_modules/react-loading-skeleton/dist/index.js
20459
- 'use client';
20460
-
20461
-
20462
- /**
20463
- * @internal
20464
- */
20465
- const SkeletonThemeContext = react.createContext({});
20466
-
20467
- /* eslint-disable react/no-array-index-key */
20468
- const defaultEnableAnimation = true;
20469
- // For performance & cleanliness, don't add any inline styles unless we have to
20470
- function styleOptionsToCssProperties({ baseColor, highlightColor, width, height, borderRadius, circle, direction, duration, enableAnimation = defaultEnableAnimation, }) {
20471
- const style = {};
20472
- if (direction === 'rtl')
20473
- style['--animation-direction'] = 'reverse';
20474
- if (typeof duration === 'number')
20475
- style['--animation-duration'] = `${duration}s`;
20476
- if (!enableAnimation)
20477
- style['--pseudo-element-display'] = 'none';
20478
- if (typeof width === 'string' || typeof width === 'number')
20479
- style.width = width;
20480
- if (typeof height === 'string' || typeof height === 'number')
20481
- style.height = height;
20482
- if (typeof borderRadius === 'string' || typeof borderRadius === 'number')
20483
- style.borderRadius = borderRadius;
20484
- if (circle)
20485
- style.borderRadius = '50%';
20486
- if (typeof baseColor !== 'undefined')
20487
- style['--base-color'] = baseColor;
20488
- if (typeof highlightColor !== 'undefined')
20489
- style['--highlight-color'] = highlightColor;
20490
- return style;
20491
- }
20492
- function dist_Skeleton({ count = 1, wrapper: Wrapper, className: customClassName, containerClassName, containerTestId, circle = false, style: styleProp, ...originalPropsStyleOptions }) {
20493
- var _a, _b, _c;
20494
- const contextStyleOptions = react.useContext(SkeletonThemeContext);
20495
- const propsStyleOptions = { ...originalPropsStyleOptions };
20496
- // DO NOT overwrite style options from the context if `propsStyleOptions`
20497
- // has properties explicity set to undefined
20498
- for (const [key, value] of Object.entries(originalPropsStyleOptions)) {
20499
- if (typeof value === 'undefined') {
20500
- delete propsStyleOptions[key];
20501
- }
20502
- }
20503
- // Props take priority over context
20504
- const styleOptions = {
20505
- ...contextStyleOptions,
20506
- ...propsStyleOptions,
20507
- circle,
20508
- };
20509
- // `styleProp` has the least priority out of everything
20510
- const style = {
20511
- ...styleProp,
20512
- ...styleOptionsToCssProperties(styleOptions),
20513
- };
20514
- let className = 'react-loading-skeleton';
20515
- if (customClassName)
20516
- className += ` ${customClassName}`;
20517
- const inline = (_a = styleOptions.inline) !== null && _a !== void 0 ? _a : false;
20518
- const elements = [];
20519
- const countCeil = Math.ceil(count);
20520
- for (let i = 0; i < countCeil; i++) {
20521
- let thisStyle = style;
20522
- if (countCeil > count && i === countCeil - 1) {
20523
- // count is not an integer and we've reached the last iteration of
20524
- // the loop, so add a "fractional" skeleton.
20525
- //
20526
- // For example, if count is 3.5, we've already added 3 full
20527
- // skeletons, so now we add one more skeleton that is 0.5 times the
20528
- // original width.
20529
- const width = (_b = thisStyle.width) !== null && _b !== void 0 ? _b : '100%'; // 100% is the default since that's what's in the CSS
20530
- const fractionalPart = count % 1;
20531
- const fractionalWidth = typeof width === 'number'
20532
- ? width * fractionalPart
20533
- : `calc(${width} * ${fractionalPart})`;
20534
- thisStyle = { ...thisStyle, width: fractionalWidth };
20535
- }
20536
- const skeletonSpan = (react.createElement("span", { className: className, style: thisStyle, key: i }, "\u200C"));
20537
- if (inline) {
20538
- elements.push(skeletonSpan);
20539
- }
20540
- else {
20541
- // Without the <br />, the skeleton lines will all run together if
20542
- // `width` is specified
20543
- elements.push(react.createElement(react.Fragment, { key: i },
20544
- skeletonSpan,
20545
- react.createElement("br", null)));
20546
- }
20547
- }
20548
- return (react.createElement("span", { className: containerClassName, "data-testid": containerTestId, "aria-live": "polite", "aria-busy": (_c = styleOptions.enableAnimation) !== null && _c !== void 0 ? _c : defaultEnableAnimation }, Wrapper
20549
- ? elements.map((el, i) => react.createElement(Wrapper, { key: i }, el))
20550
- : elements));
20551
- }
20552
-
20553
- function SkeletonTheme({ children, ...styleOptions }) {
20554
- return (React.createElement(SkeletonThemeContext.Provider, { value: styleOptions }, children));
20555
- }
20556
-
20557
-
20558
-
20559
20573
  ;// CONCATENATED MODULE: ../../libs/nift/src/components/BankSelection/bank-selection.module.scss
20560
20574
  // extracted by mini-css-extract-plugin
20561
20575
  /* harmony default export */ const bank_selection_module = ({"actions":"bank-selection_actions__fy7Ox"});
@@ -30882,11 +30896,11 @@ const halan_en_namespaceObject = /*#__PURE__*/JSON.parse('{"HALAN_TITLE":"Halan"
30882
30896
  ;// CONCATENATED MODULE: ../../localization/apps/flash/halan/ur.json
30883
30897
  const halan_ur_namespaceObject = /*#__PURE__*/JSON.parse('{"HALAN_TITLE":"Halan","ERR_MSG_INVALID_DATA":"The given data is not valid please check your information","ERR_MSG_SOMETHING_WENT_WRONG":"Something went wrong","ERR_MSG_MINIMUM_LOAN_AMOUNT":"The minimum loan amount is EGP 500"}');
30884
30898
  ;// CONCATENATED MODULE: ../../localization/apps/flash/instapay/ar.json
30885
- const instapay_ar_namespaceObject = /*#__PURE__*/JSON.parse('{"LOADING_MODAL_MESSAGE":"Loading...","ERR_MSG_SOMETHING_WENT_WRONG":"Something went wrong"}');
30899
+ const instapay_ar_namespaceObject = /*#__PURE__*/JSON.parse('{"INSTAPAY_TITLE":"InstaPay","LOADING_MODAL_MESSAGE":"Loading...","ERR_MSG_SOMETHING_WENT_WRONG":"Something went wrong"}');
30886
30900
  ;// CONCATENATED MODULE: ../../localization/apps/flash/instapay/en.json
30887
- const instapay_en_namespaceObject = /*#__PURE__*/JSON.parse('{"LOADING_MODAL_MESSAGE":"Loading...","ERR_MSG_SOMETHING_WENT_WRONG":"Something went wrong"}');
30901
+ const instapay_en_namespaceObject = /*#__PURE__*/JSON.parse('{"INSTAPAY_TITLE":"InstaPay","LOADING_MODAL_MESSAGE":"Loading...","ERR_MSG_SOMETHING_WENT_WRONG":"Something went wrong"}');
30888
30902
  ;// CONCATENATED MODULE: ../../localization/apps/flash/instapay/ur.json
30889
- const instapay_ur_namespaceObject = /*#__PURE__*/JSON.parse('{"LOADING_MODAL_MESSAGE":"Loading...","ERR_MSG_SOMETHING_WENT_WRONG":"Something went wrong"}');
30903
+ const instapay_ur_namespaceObject = /*#__PURE__*/JSON.parse('{"INSTAPAY_TITLE":"InstaPay","LOADING_MODAL_MESSAGE":"Loading...","ERR_MSG_SOMETHING_WENT_WRONG":"Something went wrong"}');
30890
30904
  ;// CONCATENATED MODULE: ../../localization/apps/flash/symplv3/ar.json
30891
30905
  const symplv3_ar_namespaceObject = /*#__PURE__*/JSON.parse('{"ERR_MSG_SOMETHING_WENT_WRONG":"Something went wrong"}');
30892
30906
  ;// CONCATENATED MODULE: ../../localization/apps/flash/symplv3/en.json
@@ -31366,6 +31380,7 @@ i18next.use(initReactI18next).init({
31366
31380
 
31367
31381
 
31368
31382
 
31383
+
31369
31384
  class Pixel {
31370
31385
  constructor(options) {
31371
31386
  var _options$showPaymobLo;
@@ -31375,6 +31390,8 @@ class Pixel {
31375
31390
  this._baseURL = void 0;
31376
31391
  this._savedCards = void 0;
31377
31392
  this._showSaveCard = void 0;
31393
+ this._root = null;
31394
+ this._error = null;
31378
31395
  this._options = Object.assign({}, options, {
31379
31396
  showPaymobLogo: (_options$showPaymobLo = options.showPaymobLogo) != null ? _options$showPaymobLo : true
31380
31397
  });
@@ -31390,18 +31407,34 @@ class Pixel {
31390
31407
  const publicKey = this._options['publicKey'];
31391
31408
  const clientSecret = this._options['clientSecret'];
31392
31409
  const paymentMethods = this._options['paymentMethods'];
31393
- const {
31394
- res,
31395
- paymentList,
31396
- savedCards
31397
- } = await fetchPayments(publicKey, clientSecret, paymentMethods);
31398
- if (res.status === 200) {
31399
- this._paymentList = paymentList;
31400
- this._savedCards = savedCards;
31410
+ const defaultErrorMsg = 'Something went wrong while retrieving payment data.';
31411
+ const containsCardPayment = paymentMethods.some(payment => payment.toLowerCase() === 'card');
31412
+ if (containsCardPayment) {
31413
+ this._paymentList = [{
31414
+ name: 'card',
31415
+ type: 'card',
31416
+ amount: '',
31417
+ currency: ''
31418
+ }];
31401
31419
  this.render();
31402
31420
  }
31403
- if (res.status === 410 || res.status === 403) {
31404
- //navigate('/payment-status', { state: { status: 'declined' } });
31421
+ try {
31422
+ const {
31423
+ res,
31424
+ paymentList,
31425
+ savedCards
31426
+ } = await fetchPayments(publicKey, clientSecret, paymentMethods);
31427
+ if (res.status === 200) {
31428
+ this._paymentList = paymentList;
31429
+ this._savedCards = savedCards;
31430
+ } else {
31431
+ var _res$data;
31432
+ this._error = (res == null || (_res$data = res.data) == null ? void 0 : _res$data.msg) || defaultErrorMsg;
31433
+ }
31434
+ } catch (e) {
31435
+ this._error = defaultErrorMsg;
31436
+ } finally {
31437
+ this.render();
31405
31438
  }
31406
31439
  }
31407
31440
  async handleBeforePaymentComplete() {
@@ -31427,8 +31460,21 @@ class Pixel {
31427
31460
  }
31428
31461
  }
31429
31462
  render() {
31430
- const root = client/* createRoot */.H(document.getElementById(this._options['elementId']));
31431
- root.render( /*#__PURE__*/(0,jsx_runtime.jsx)(react.StrictMode, {
31463
+ const container = document.getElementById(this._options['elementId']);
31464
+ if (!container) {
31465
+ console.error(`Container with ID ${this._options['elementId']} not found`);
31466
+ return;
31467
+ }
31468
+ if (!this._root) {
31469
+ this._root = client/* createRoot */.H(container);
31470
+ }
31471
+ if (this._error) {
31472
+ this._root.render( /*#__PURE__*/(0,jsx_runtime.jsx)(ErrorMessageViewTwo_ErrorMessage, {
31473
+ errorMessage: this._error
31474
+ }));
31475
+ return;
31476
+ }
31477
+ this._root.render( /*#__PURE__*/(0,jsx_runtime.jsx)(react.StrictMode, {
31432
31478
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(components_Payments, Object.assign({
31433
31479
  baseUrl: this._baseURL,
31434
31480
  paymentList: this._paymentList,
@@ -31451,7 +31497,7 @@ class Pixel {
31451
31497
  onPaymentCancel: this.handleOnPaymentCancel.bind(this)
31452
31498
  }, this._options.cardValidationChanged && {
31453
31499
  onCardValidationChanged: this.handleCardValidationChanged.bind(this)
31454
- }))
31500
+ }), Date.now())
31455
31501
  }));
31456
31502
  }
31457
31503
  }