@saasquatch/mint-components 1.8.0-93 → 1.8.0-94

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.
@@ -1447,7 +1447,7 @@ function parseImpactThreshold(threshold) {
1447
1447
  return parsed.toString();
1448
1448
  }
1449
1449
  function useBankingInfoForm(props) {
1450
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1450
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1451
1451
  const locale = index_module.N();
1452
1452
  const user = index_module.H();
1453
1453
  const formRef = stencilHooks_module.useRef(null);
@@ -1489,17 +1489,16 @@ function useBankingInfoForm(props) {
1489
1489
  name,
1490
1490
  };
1491
1491
  };
1492
- const topCountries = (_f = (_e = ["CA", "GB", "US"]) === null || _e === void 0 ? void 0 : _e.filter((value) => Array.from(availableCountries).includes(value))) === null || _f === void 0 ? void 0 : _f.map((country) => {
1493
- return getCountryObj(country);
1494
- });
1495
- // build list of country codes and names
1496
- const countries = [
1497
- ...new Set(topCountries.concat((_g = Array.from(availableCountries)) === null || _g === void 0 ? void 0 : _g.map((country) => {
1498
- return getCountryObj(country);
1499
- }).sort((a, b) => {
1500
- return a.name < b.name ? -1 : 1;
1501
- }))),
1502
- ];
1492
+ const sortByName = (a, b) => a.name < b.name ? -1 : 1;
1493
+ const _topCountries = ["CA", "GB", "US"];
1494
+ const countries = Array.from(availableCountries)
1495
+ .map((c) => getCountryObj(c))
1496
+ .sort(sortByName)
1497
+ .reduce((prev, countryObj) => {
1498
+ if (_topCountries.includes(countryObj.code))
1499
+ return [countryObj, ...prev];
1500
+ return [...prev, countryObj];
1501
+ }, []);
1503
1502
  const hasPayPal = !!(paymentOptions === null || paymentOptions === void 0 ? void 0 : paymentOptions.find((option) => option.defaultFinancePaymentMethodId === PAYPAL_PAYMENT_METHOD));
1504
1503
  const paymentMethodChecked = !hasPayPal
1505
1504
  ? "toBankAccount"
@@ -1640,7 +1639,7 @@ function useBankingInfoForm(props) {
1640
1639
  hideSteps: !!context.hideSteps,
1641
1640
  saveDisabled: !paymentMethodChecked || !paymentScheduleChecked,
1642
1641
  locale,
1643
- isPartner: !!((_k = (_j = (_h = userData === null || userData === void 0 ? void 0 : userData.user) === null || _h === void 0 ? void 0 : _h.impactConnection) === null || _j === void 0 ? void 0 : _j.publisher) === null || _k === void 0 ? void 0 : _k.withdrawalSettings),
1642
+ isPartner: !!((_g = (_f = (_e = userData === null || userData === void 0 ? void 0 : userData.user) === null || _e === void 0 ? void 0 : _e.impactConnection) === null || _f === void 0 ? void 0 : _f.publisher) === null || _g === void 0 ? void 0 : _g.withdrawalSettings),
1644
1643
  feeCap,
1645
1644
  paymentMethodFeeLabel,
1646
1645
  disabled: loading,
@@ -1659,7 +1658,7 @@ function useBankingInfoForm(props) {
1659
1658
  currentPaymentOption,
1660
1659
  bitset: (currentPaymentOption === null || currentPaymentOption === void 0 ? void 0 : currentPaymentOption.withdrawalSettingId) || 0,
1661
1660
  currency,
1662
- thresholds: ((_l = currentPaymentOption === null || currentPaymentOption === void 0 ? void 0 : currentPaymentOption.thresholdOptions) === null || _l === void 0 ? void 0 : _l.split(",")) || [],
1661
+ thresholds: ((_h = currentPaymentOption === null || currentPaymentOption === void 0 ? void 0 : currentPaymentOption.thresholdOptions) === null || _h === void 0 ? void 0 : _h.split(",")) || [],
1663
1662
  countries,
1664
1663
  hasPayPal,
1665
1664
  },
@@ -268,7 +268,7 @@ function parseImpactThreshold(threshold) {
268
268
  return parsed.toString();
269
269
  }
270
270
  export function useBankingInfoForm(props) {
271
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
271
+ var _a, _b, _c, _d, _e, _f, _g, _h;
272
272
  const locale = useLocale();
273
273
  const user = useUserIdentity();
274
274
  const formRef = useRef(null);
@@ -310,17 +310,16 @@ export function useBankingInfoForm(props) {
310
310
  name,
311
311
  };
312
312
  };
313
- const topCountries = (_f = (_e = ["CA", "GB", "US"]) === null || _e === void 0 ? void 0 : _e.filter((value) => Array.from(availableCountries).includes(value))) === null || _f === void 0 ? void 0 : _f.map((country) => {
314
- return getCountryObj(country);
315
- });
316
- // build list of country codes and names
317
- const countries = [
318
- ...new Set(topCountries.concat((_g = Array.from(availableCountries)) === null || _g === void 0 ? void 0 : _g.map((country) => {
319
- return getCountryObj(country);
320
- }).sort((a, b) => {
321
- return a.name < b.name ? -1 : 1;
322
- }))),
323
- ];
313
+ const sortByName = (a, b) => a.name < b.name ? -1 : 1;
314
+ const _topCountries = ["CA", "GB", "US"];
315
+ const countries = Array.from(availableCountries)
316
+ .map((c) => getCountryObj(c))
317
+ .sort(sortByName)
318
+ .reduce((prev, countryObj) => {
319
+ if (_topCountries.includes(countryObj.code))
320
+ return [countryObj, ...prev];
321
+ return [...prev, countryObj];
322
+ }, []);
324
323
  const hasPayPal = !!(paymentOptions === null || paymentOptions === void 0 ? void 0 : paymentOptions.find((option) => option.defaultFinancePaymentMethodId === PAYPAL_PAYMENT_METHOD));
325
324
  const paymentMethodChecked = !hasPayPal
326
325
  ? "toBankAccount"
@@ -461,7 +460,7 @@ export function useBankingInfoForm(props) {
461
460
  hideSteps: !!context.hideSteps,
462
461
  saveDisabled: !paymentMethodChecked || !paymentScheduleChecked,
463
462
  locale,
464
- isPartner: !!((_k = (_j = (_h = userData === null || userData === void 0 ? void 0 : userData.user) === null || _h === void 0 ? void 0 : _h.impactConnection) === null || _j === void 0 ? void 0 : _j.publisher) === null || _k === void 0 ? void 0 : _k.withdrawalSettings),
463
+ isPartner: !!((_g = (_f = (_e = userData === null || userData === void 0 ? void 0 : userData.user) === null || _e === void 0 ? void 0 : _e.impactConnection) === null || _f === void 0 ? void 0 : _f.publisher) === null || _g === void 0 ? void 0 : _g.withdrawalSettings),
465
464
  feeCap,
466
465
  paymentMethodFeeLabel,
467
466
  disabled: loading,
@@ -480,7 +479,7 @@ export function useBankingInfoForm(props) {
480
479
  currentPaymentOption,
481
480
  bitset: (currentPaymentOption === null || currentPaymentOption === void 0 ? void 0 : currentPaymentOption.withdrawalSettingId) || 0,
482
481
  currency,
483
- thresholds: ((_l = currentPaymentOption === null || currentPaymentOption === void 0 ? void 0 : currentPaymentOption.thresholdOptions) === null || _l === void 0 ? void 0 : _l.split(",")) || [],
482
+ thresholds: ((_h = currentPaymentOption === null || currentPaymentOption === void 0 ? void 0 : currentPaymentOption.thresholdOptions) === null || _h === void 0 ? void 0 : _h.split(",")) || [],
484
483
  countries,
485
484
  hasPayPal,
486
485
  },
@@ -1443,7 +1443,7 @@ function parseImpactThreshold(threshold) {
1443
1443
  return parsed.toString();
1444
1444
  }
1445
1445
  function useBankingInfoForm(props) {
1446
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1446
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1447
1447
  const locale = N();
1448
1448
  const user = H();
1449
1449
  const formRef = useRef(null);
@@ -1485,17 +1485,16 @@ function useBankingInfoForm(props) {
1485
1485
  name,
1486
1486
  };
1487
1487
  };
1488
- const topCountries = (_f = (_e = ["CA", "GB", "US"]) === null || _e === void 0 ? void 0 : _e.filter((value) => Array.from(availableCountries).includes(value))) === null || _f === void 0 ? void 0 : _f.map((country) => {
1489
- return getCountryObj(country);
1490
- });
1491
- // build list of country codes and names
1492
- const countries = [
1493
- ...new Set(topCountries.concat((_g = Array.from(availableCountries)) === null || _g === void 0 ? void 0 : _g.map((country) => {
1494
- return getCountryObj(country);
1495
- }).sort((a, b) => {
1496
- return a.name < b.name ? -1 : 1;
1497
- }))),
1498
- ];
1488
+ const sortByName = (a, b) => a.name < b.name ? -1 : 1;
1489
+ const _topCountries = ["CA", "GB", "US"];
1490
+ const countries = Array.from(availableCountries)
1491
+ .map((c) => getCountryObj(c))
1492
+ .sort(sortByName)
1493
+ .reduce((prev, countryObj) => {
1494
+ if (_topCountries.includes(countryObj.code))
1495
+ return [countryObj, ...prev];
1496
+ return [...prev, countryObj];
1497
+ }, []);
1499
1498
  const hasPayPal = !!(paymentOptions === null || paymentOptions === void 0 ? void 0 : paymentOptions.find((option) => option.defaultFinancePaymentMethodId === PAYPAL_PAYMENT_METHOD));
1500
1499
  const paymentMethodChecked = !hasPayPal
1501
1500
  ? "toBankAccount"
@@ -1636,7 +1635,7 @@ function useBankingInfoForm(props) {
1636
1635
  hideSteps: !!context.hideSteps,
1637
1636
  saveDisabled: !paymentMethodChecked || !paymentScheduleChecked,
1638
1637
  locale,
1639
- isPartner: !!((_k = (_j = (_h = userData === null || userData === void 0 ? void 0 : userData.user) === null || _h === void 0 ? void 0 : _h.impactConnection) === null || _j === void 0 ? void 0 : _j.publisher) === null || _k === void 0 ? void 0 : _k.withdrawalSettings),
1638
+ isPartner: !!((_g = (_f = (_e = userData === null || userData === void 0 ? void 0 : userData.user) === null || _e === void 0 ? void 0 : _e.impactConnection) === null || _f === void 0 ? void 0 : _f.publisher) === null || _g === void 0 ? void 0 : _g.withdrawalSettings),
1640
1639
  feeCap,
1641
1640
  paymentMethodFeeLabel,
1642
1641
  disabled: loading,
@@ -1655,7 +1654,7 @@ function useBankingInfoForm(props) {
1655
1654
  currentPaymentOption,
1656
1655
  bitset: (currentPaymentOption === null || currentPaymentOption === void 0 ? void 0 : currentPaymentOption.withdrawalSettingId) || 0,
1657
1656
  currency,
1658
- thresholds: ((_l = currentPaymentOption === null || currentPaymentOption === void 0 ? void 0 : currentPaymentOption.thresholdOptions) === null || _l === void 0 ? void 0 : _l.split(",")) || [],
1657
+ thresholds: ((_h = currentPaymentOption === null || currentPaymentOption === void 0 ? void 0 : currentPaymentOption.thresholdOptions) === null || _h === void 0 ? void 0 : _h.split(",")) || [],
1659
1658
  countries,
1660
1659
  hasPayPal,
1661
1660
  },