@lifi/widget 3.0.2 → 3.1.1

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 (235) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/_esm/components/Card/CardIconButton.js +1 -0
  3. package/_esm/components/Card/CardIconButton.js.map +1 -1
  4. package/_esm/components/Card/CardLabel.d.ts +1 -1
  5. package/_esm/components/Card/CardLabel.js +8 -12
  6. package/_esm/components/Card/CardLabel.js.map +1 -1
  7. package/_esm/components/ChainSelect/ChainSelect.js +1 -1
  8. package/_esm/components/ChainSelect/ChainSelect.js.map +1 -1
  9. package/_esm/components/FeeBreakdownTooltip.d.ts +12 -0
  10. package/_esm/components/FeeBreakdownTooltip.js +13 -0
  11. package/_esm/components/FeeBreakdownTooltip.js.map +1 -0
  12. package/_esm/components/GasMessage/GasRefuelMessage.js +1 -1
  13. package/_esm/components/GasMessage/GasRefuelMessage.js.map +1 -1
  14. package/_esm/components/Header/CloseDrawerButton.js +1 -1
  15. package/_esm/components/Header/CloseDrawerButton.js.map +1 -1
  16. package/_esm/components/Header/SettingsButton.js +1 -1
  17. package/_esm/components/Header/SettingsButton.js.map +1 -1
  18. package/_esm/components/Header/TransactionHistoryButton.js +1 -1
  19. package/_esm/components/Header/TransactionHistoryButton.js.map +1 -1
  20. package/_esm/components/IconTypography.d.ts +3 -0
  21. package/_esm/components/IconTypography.js +8 -0
  22. package/_esm/components/IconTypography.js.map +1 -0
  23. package/_esm/components/PoweredBy/PoweredBy.js +1 -1
  24. package/_esm/components/PoweredBy/PoweredBy.js.map +1 -1
  25. package/_esm/components/ProgressToNextUpdate.js +1 -1
  26. package/_esm/components/ProgressToNextUpdate.js.map +1 -1
  27. package/_esm/components/RouteCard/RouteCard.js +7 -16
  28. package/_esm/components/RouteCard/RouteCard.js.map +1 -1
  29. package/_esm/components/RouteCard/RouteCard.style.d.ts +0 -3
  30. package/_esm/components/RouteCard/RouteCard.style.js +1 -7
  31. package/_esm/components/RouteCard/RouteCard.style.js.map +1 -1
  32. package/_esm/components/RouteCard/RouteCardEssentials.js +13 -14
  33. package/_esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
  34. package/_esm/components/RouteCard/RouteCardEssentialsExpanded.js +4 -20
  35. package/_esm/components/RouteCard/RouteCardEssentialsExpanded.js.map +1 -1
  36. package/_esm/components/RouteCard/types.d.ts +1 -6
  37. package/_esm/components/Routes/RoutesExpanded.js +2 -4
  38. package/_esm/components/Routes/RoutesExpanded.js.map +1 -1
  39. package/_esm/components/SendToWallet/SendToWalletExpandButton.js +1 -1
  40. package/_esm/components/SendToWallet/SendToWalletExpandButton.js.map +1 -1
  41. package/_esm/components/Step/Step.d.ts +1 -0
  42. package/_esm/components/Step/Step.js +2 -2
  43. package/_esm/components/Step/Step.js.map +1 -1
  44. package/_esm/components/Step/StepList.js +16 -7
  45. package/_esm/components/Step/StepList.js.map +1 -1
  46. package/_esm/components/Step/StepTimer.js +3 -3
  47. package/_esm/components/Step/StepTimer.js.map +1 -1
  48. package/_esm/components/StepActions/StepActions.js +5 -4
  49. package/_esm/components/StepActions/StepActions.js.map +1 -1
  50. package/_esm/components/StepActions/StepActions.style.js +4 -4
  51. package/_esm/components/StepActions/StepActions.style.js.map +1 -1
  52. package/_esm/components/Token/Token.d.ts +2 -0
  53. package/_esm/components/Token/Token.js +22 -8
  54. package/_esm/components/Token/Token.js.map +1 -1
  55. package/_esm/components/Token/Token.style.js +1 -0
  56. package/_esm/components/Token/Token.style.js.map +1 -1
  57. package/_esm/components/TokenRate.d.ts +7 -0
  58. package/_esm/components/TokenRate.js +41 -0
  59. package/_esm/components/TokenRate.js.map +1 -0
  60. package/_esm/components/TransactionDetails.d.ts +7 -0
  61. package/_esm/components/TransactionDetails.js +46 -0
  62. package/_esm/components/TransactionDetails.js.map +1 -0
  63. package/_esm/config/version.d.ts +1 -1
  64. package/_esm/config/version.js +1 -1
  65. package/_esm/hooks/timer/useInterval.d.ts +1 -0
  66. package/_esm/hooks/timer/useInterval.js +18 -0
  67. package/_esm/hooks/timer/useInterval.js.map +1 -0
  68. package/_esm/hooks/timer/useTimer.d.ts +18 -0
  69. package/_esm/hooks/timer/useTimer.js +61 -0
  70. package/_esm/hooks/timer/useTimer.js.map +1 -0
  71. package/_esm/hooks/timer/utils.d.ts +11 -0
  72. package/_esm/hooks/timer/utils.js +46 -0
  73. package/_esm/hooks/timer/utils.js.map +1 -0
  74. package/_esm/hooks/useAccount.js +4 -5
  75. package/_esm/hooks/useAccount.js.map +1 -1
  76. package/_esm/hooks/useAvailableChains.js +1 -0
  77. package/_esm/hooks/useAvailableChains.js.map +1 -1
  78. package/_esm/hooks/useGasRecommendation.js +1 -0
  79. package/_esm/hooks/useGasRecommendation.js.map +1 -1
  80. package/_esm/hooks/useProcessMessage.js +8 -0
  81. package/_esm/hooks/useProcessMessage.js.map +1 -1
  82. package/_esm/hooks/useRoutes.d.ts +4 -2
  83. package/_esm/hooks/useRoutes.js +17 -10
  84. package/_esm/hooks/useRoutes.js.map +1 -1
  85. package/_esm/hooks/useTokens.js +1 -0
  86. package/_esm/hooks/useTokens.js.map +1 -1
  87. package/_esm/hooks/useTools.js +1 -0
  88. package/_esm/hooks/useTools.js.map +1 -1
  89. package/_esm/hooks/useTransactionDetails.d.ts +1 -1
  90. package/_esm/hooks/useTransactionDetails.js +1 -1
  91. package/_esm/hooks/useTransactionDetails.js.map +1 -1
  92. package/_esm/hooks/useTransactionHistory.js.map +1 -1
  93. package/_esm/i18n/en.json +19 -21
  94. package/_esm/i18n/index.js +15 -15
  95. package/_esm/i18n/index.js.map +1 -1
  96. package/_esm/index.d.ts +2 -1
  97. package/_esm/index.js +1 -4
  98. package/_esm/index.js.map +1 -1
  99. package/_esm/pages/MainPage/ReviewButton.js +2 -4
  100. package/_esm/pages/MainPage/ReviewButton.js.map +1 -1
  101. package/_esm/pages/RoutesPage/RoutesPage.js +2 -4
  102. package/_esm/pages/RoutesPage/RoutesPage.js.map +1 -1
  103. package/_esm/pages/SelectEnabledToolsPage.js +1 -1
  104. package/_esm/pages/SelectEnabledToolsPage.js.map +1 -1
  105. package/_esm/pages/SendToWallet/SendToWalletPage.js +1 -1
  106. package/_esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
  107. package/_esm/pages/SettingsPage/ThemeSettings.js +1 -1
  108. package/_esm/pages/SettingsPage/ThemeSettings.js.map +1 -1
  109. package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js +5 -7
  110. package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
  111. package/_esm/pages/TransactionHistoryPage/TransactionHistoryItem.js +2 -2
  112. package/_esm/pages/TransactionHistoryPage/TransactionHistoryItem.js.map +1 -1
  113. package/_esm/pages/TransactionPage/ExchangeRateBottomSheet.js +2 -2
  114. package/_esm/pages/TransactionPage/ExchangeRateBottomSheet.js.map +1 -1
  115. package/_esm/pages/TransactionPage/RouteTracker.d.ts +7 -0
  116. package/_esm/pages/TransactionPage/RouteTracker.js +39 -0
  117. package/_esm/pages/TransactionPage/RouteTracker.js.map +1 -0
  118. package/_esm/pages/TransactionPage/StartTransactionButton.d.ts +0 -1
  119. package/_esm/pages/TransactionPage/StartTransactionButton.js +0 -9
  120. package/_esm/pages/TransactionPage/StartTransactionButton.js.map +1 -1
  121. package/_esm/pages/TransactionPage/TransactionPage.js +10 -21
  122. package/_esm/pages/TransactionPage/TransactionPage.js.map +1 -1
  123. package/_esm/pages/TransactionPage/types.d.ts +0 -1
  124. package/_esm/providers/I18nProvider/I18nProvider.js +2 -0
  125. package/_esm/providers/I18nProvider/I18nProvider.js.map +1 -1
  126. package/_esm/providers/I18nProvider/currencyExtendedFormatter.d.ts +1 -0
  127. package/_esm/providers/I18nProvider/currencyExtendedFormatter.js +13 -0
  128. package/_esm/providers/I18nProvider/currencyExtendedFormatter.js.map +1 -0
  129. package/_esm/providers/WalletProvider/EVMBaseProvider.js +18 -12
  130. package/_esm/providers/WalletProvider/EVMBaseProvider.js.map +1 -1
  131. package/_esm/stores/routes/createRouteExecutionStore.js +2 -2
  132. package/_esm/stores/routes/createRouteExecutionStore.js.map +1 -1
  133. package/_esm/stores/routes/types.d.ts +1 -1
  134. package/_esm/stores/routes/useSetExecutableRoute.d.ts +1 -1
  135. package/_esm/themes/createTheme.js +6 -0
  136. package/_esm/themes/createTheme.js.map +1 -1
  137. package/_esm/types/widget.d.ts +1 -2
  138. package/_esm/utils/converters.js +5 -13
  139. package/_esm/utils/converters.js.map +1 -1
  140. package/_esm/utils/fees.d.ts +3 -3
  141. package/_esm/utils/fees.js +22 -14
  142. package/_esm/utils/fees.js.map +1 -1
  143. package/_esm/utils/format.d.ts +13 -4
  144. package/_esm/utils/format.js +51 -13
  145. package/_esm/utils/format.js.map +1 -1
  146. package/components/Card/CardIconButton.tsx +1 -0
  147. package/components/Card/CardLabel.tsx +13 -29
  148. package/components/ChainSelect/ChainSelect.tsx +1 -9
  149. package/components/FeeBreakdownTooltip.tsx +66 -0
  150. package/components/GasMessage/GasRefuelMessage.tsx +1 -1
  151. package/components/Header/CloseDrawerButton.tsx +1 -1
  152. package/components/Header/SettingsButton.tsx +1 -1
  153. package/components/Header/TransactionHistoryButton.tsx +1 -1
  154. package/components/IconTypography.ts +9 -0
  155. package/components/PoweredBy/PoweredBy.tsx +1 -1
  156. package/components/ProgressToNextUpdate.tsx +0 -3
  157. package/components/RouteCard/RouteCard.style.ts +1 -9
  158. package/components/RouteCard/RouteCard.tsx +15 -71
  159. package/components/RouteCard/RouteCardEssentials.tsx +52 -81
  160. package/components/RouteCard/RouteCardEssentialsExpanded.tsx +17 -107
  161. package/components/RouteCard/types.ts +1 -7
  162. package/components/Routes/RoutesExpanded.tsx +3 -4
  163. package/components/SendToWallet/SendToWalletExpandButton.tsx +1 -6
  164. package/components/Step/Step.tsx +11 -2
  165. package/components/Step/StepList.tsx +19 -10
  166. package/components/Step/StepTimer.tsx +9 -6
  167. package/components/StepActions/StepActions.style.tsx +4 -4
  168. package/components/StepActions/StepActions.tsx +11 -14
  169. package/components/Token/Token.style.tsx +1 -0
  170. package/components/Token/Token.tsx +49 -9
  171. package/components/TokenRate.tsx +79 -0
  172. package/components/TransactionDetails.tsx +182 -0
  173. package/config/version.ts +1 -1
  174. package/hooks/timer/useInterval.ts +21 -0
  175. package/hooks/timer/useTimer.ts +91 -0
  176. package/hooks/timer/utils.ts +54 -0
  177. package/hooks/useAccount.ts +8 -5
  178. package/hooks/useAvailableChains.ts +2 -1
  179. package/hooks/useGasRecommendation.ts +1 -0
  180. package/hooks/useProcessMessage.ts +8 -0
  181. package/hooks/useRoutes.ts +23 -13
  182. package/hooks/useTokens.ts +1 -0
  183. package/hooks/useTools.ts +2 -1
  184. package/hooks/useTransactionDetails.ts +3 -3
  185. package/hooks/useTransactionHistory.ts +1 -1
  186. package/i18n/en.json +19 -21
  187. package/i18n/index.ts +15 -15
  188. package/index.ts +2 -5
  189. package/package.json +18 -19
  190. package/pages/MainPage/ReviewButton.tsx +2 -4
  191. package/pages/RoutesPage/RoutesPage.tsx +3 -4
  192. package/pages/SelectEnabledToolsPage.tsx +1 -1
  193. package/pages/SendToWallet/SendToWalletPage.tsx +1 -1
  194. package/pages/SettingsPage/ThemeSettings.tsx +1 -1
  195. package/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +9 -20
  196. package/pages/TransactionHistoryPage/TransactionHistoryItem.tsx +3 -5
  197. package/pages/TransactionPage/ExchangeRateBottomSheet.tsx +0 -2
  198. package/pages/TransactionPage/RouteTracker.tsx +68 -0
  199. package/pages/TransactionPage/StartTransactionButton.tsx +0 -24
  200. package/pages/TransactionPage/TransactionPage.tsx +21 -48
  201. package/pages/TransactionPage/types.ts +0 -1
  202. package/providers/I18nProvider/I18nProvider.tsx +6 -0
  203. package/providers/I18nProvider/currencyExtendedFormatter.ts +15 -0
  204. package/providers/WalletProvider/EVMBaseProvider.tsx +13 -7
  205. package/stores/routes/createRouteExecutionStore.ts +2 -2
  206. package/stores/routes/types.ts +1 -1
  207. package/themes/createTheme.ts +6 -0
  208. package/types/widget.ts +1 -2
  209. package/utils/converters.ts +5 -13
  210. package/utils/fees.ts +30 -25
  211. package/utils/format.ts +67 -20
  212. package/_esm/components/Insurance/Insurance.d.ts +0 -2
  213. package/_esm/components/Insurance/Insurance.js +0 -8
  214. package/_esm/components/Insurance/Insurance.js.map +0 -1
  215. package/_esm/components/Insurance/InsuranceCard.d.ts +0 -2
  216. package/_esm/components/Insurance/InsuranceCard.js +0 -36
  217. package/_esm/components/Insurance/InsuranceCard.js.map +0 -1
  218. package/_esm/components/Insurance/InsuranceCollapsed.d.ts +0 -2
  219. package/_esm/components/Insurance/InsuranceCollapsed.js +0 -29
  220. package/_esm/components/Insurance/InsuranceCollapsed.js.map +0 -1
  221. package/_esm/components/Insurance/types.d.ts +0 -19
  222. package/_esm/components/Insurance/types.js +0 -2
  223. package/_esm/components/Insurance/types.js.map +0 -1
  224. package/_esm/components/StepActions/StepFeeBreakdown.d.ts +0 -4
  225. package/_esm/components/StepActions/StepFeeBreakdown.js +0 -42
  226. package/_esm/components/StepActions/StepFeeBreakdown.js.map +0 -1
  227. package/_esm/icons/InsuraceLogo.d.ts +0 -2
  228. package/_esm/icons/InsuraceLogo.js +0 -8
  229. package/_esm/icons/InsuraceLogo.js.map +0 -1
  230. package/components/Insurance/Insurance.tsx +0 -22
  231. package/components/Insurance/InsuranceCard.tsx +0 -119
  232. package/components/Insurance/InsuranceCollapsed.tsx +0 -59
  233. package/components/Insurance/types.ts +0 -24
  234. package/components/StepActions/StepFeeBreakdown.tsx +0 -108
  235. package/icons/InsuraceLogo.tsx +0 -46
@@ -1,15 +1,15 @@
1
1
  import type { ExchangeRateUpdateParams } from '@lifi/sdk';
2
2
  import { Delete } from '@mui/icons-material';
3
3
  import { Box, Button, Tooltip } from '@mui/material';
4
- import { useEffect, useRef, useState } from 'react';
4
+ import { useEffect, useMemo, useRef, useState } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { useLocation } from 'react-router-dom';
7
7
  import type { BottomSheetBase } from '../../components/BottomSheet/types.js';
8
8
  import { ContractComponent } from '../../components/ContractComponent/ContractComponent.js';
9
9
  import { GasMessage } from '../../components/GasMessage/GasMessage.js';
10
- import { Insurance } from '../../components/Insurance/Insurance.js';
11
10
  import { PageContainer } from '../../components/PageContainer.js';
12
11
  import { getStepList } from '../../components/Step/StepList.js';
12
+ import { TransactionDetails } from '../../components/TransactionDetails.js';
13
13
  import { useHeader } from '../../hooks/useHeader.js';
14
14
  import { useNavigateBack } from '../../hooks/useNavigateBack.js';
15
15
  import { useRouteExecution } from '../../hooks/useRouteExecution.js';
@@ -18,13 +18,10 @@ import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.j
18
18
  import { useFieldActions } from '../../stores/form/useFieldActions.js';
19
19
  import { RouteExecutionStatus } from '../../stores/routes/types.js';
20
20
  import { WidgetEvent } from '../../types/events.js';
21
- import { formatTokenAmount } from '../../utils/format.js';
22
21
  import type { ExchangeRateBottomSheetBase } from './ExchangeRateBottomSheet.js';
23
22
  import { ExchangeRateBottomSheet } from './ExchangeRateBottomSheet.js';
24
- import {
25
- StartInsurableTransactionButton,
26
- StartTransactionButton,
27
- } from './StartTransactionButton.js';
23
+ import { RouteTracker } from './RouteTracker.js';
24
+ import { StartTransactionButton } from './StartTransactionButton.js';
28
25
  import { StatusBottomSheet } from './StatusBottomSheet.js';
29
26
  import {
30
27
  TokenValueBottomSheet,
@@ -37,11 +34,11 @@ export const TransactionPage: React.FC = () => {
37
34
  const { setFieldValue } = useFieldActions();
38
35
  const emitter = useWidgetEvents();
39
36
  const { navigateBack } = useNavigateBack();
40
- const { subvariant, insurance, contractSecondaryComponent } =
41
- useWidgetConfig();
37
+ const { subvariant, contractSecondaryComponent } = useWidgetConfig();
42
38
  const { state }: any = useLocation();
43
39
  const stateRouteId = state?.routeId;
44
40
  const [routeId, setRouteId] = useState<string>(stateRouteId);
41
+ const [routeRefreshing, setRouteRefreshing] = useState(false);
45
42
 
46
43
  const tokenValueBottomSheetRef = useRef<BottomSheetBase>(null);
47
44
  const exchangeRateBottomSheetRef = useRef<ExchangeRateBottomSheetBase>(null);
@@ -76,9 +73,19 @@ export const TransactionPage: React.FC = () => {
76
73
  return t(`header.exchange`);
77
74
  };
78
75
 
79
- const title = getHeaderTitle();
76
+ const headerAction = useMemo(
77
+ () =>
78
+ status === RouteExecutionStatus.Idle ? (
79
+ <RouteTracker
80
+ observableRouteId={stateRouteId}
81
+ onChange={setRouteId}
82
+ onFetching={setRouteRefreshing}
83
+ />
84
+ ) : undefined,
85
+ [stateRouteId, status],
86
+ );
80
87
 
81
- useHeader(title);
88
+ useHeader(getHeaderTitle(), headerAction);
82
89
 
83
90
  useEffect(() => {
84
91
  if (status === RouteExecutionStatus.Idle) {
@@ -150,24 +157,6 @@ export const TransactionPage: React.FC = () => {
150
157
  }
151
158
  };
152
159
 
153
- const insuredRoute = route.insurance?.state === 'INSURED';
154
- const insurableRoute =
155
- insurance &&
156
- subvariant !== 'refuel' &&
157
- status === RouteExecutionStatus.Idle &&
158
- route.insurance?.state === 'INSURABLE';
159
-
160
- const insuranceAvailable = insuredRoute || insurableRoute;
161
-
162
- const StartButton = insurableRoute
163
- ? StartInsurableTransactionButton
164
- : StartTransactionButton;
165
-
166
- const getInsuranceCoverageId = () =>
167
- route.steps[0].execution?.process
168
- .filter((process) => process.type !== 'TOKEN_ALLOWANCE')
169
- .find((process) => process.txHash)?.txHash ?? route.fromAddress;
170
-
171
160
  return (
172
161
  <PageContainer bottomGutters>
173
162
  {getStepList(route, subvariant)}
@@ -176,38 +165,22 @@ export const TransactionPage: React.FC = () => {
176
165
  {contractSecondaryComponent}
177
166
  </ContractComponent>
178
167
  ) : null}
179
- {insuranceAvailable ? (
180
- <Insurance
181
- status={status}
182
- insurableRouteId={stateRouteId}
183
- feeAmountUsd={route.insurance.feeAmountUsd}
184
- insuredAmount={formatTokenAmount(
185
- BigInt(route.toAmountMin),
186
- route.toToken.decimals,
187
- )}
188
- insuredTokenSymbol={route.toToken.symbol}
189
- insuranceCoverageId={getInsuranceCoverageId()}
190
- onChange={setRouteId}
191
- sx={{ marginTop: 2 }}
192
- />
193
- ) : null}
168
+ <TransactionDetails route={route} sx={{ marginTop: 2 }} />
194
169
  {status === RouteExecutionStatus.Idle ||
195
170
  status === RouteExecutionStatus.Failed ? (
196
171
  <>
197
172
  <GasMessage mt={2} route={route} />
198
173
  <Box mt={2} display="flex">
199
- <StartButton
174
+ <StartTransactionButton
200
175
  text={getButtonText()}
201
176
  onClick={handleStartClick}
202
177
  route={route}
203
- insurableRouteId={stateRouteId}
178
+ loading={routeRefreshing}
204
179
  />
205
180
  {status === RouteExecutionStatus.Failed ? (
206
181
  <Tooltip
207
182
  title={t('button.removeTransaction')}
208
183
  placement="bottom-end"
209
- enterDelay={400}
210
- arrow
211
184
  >
212
185
  <Button
213
186
  onClick={handleRemoveRoute}
@@ -4,5 +4,4 @@ import type { BaseTransactionButtonProps } from '../../components/BaseTransactio
4
4
  export interface StartTransactionButtonProps
5
5
  extends BaseTransactionButtonProps {
6
6
  route?: Route;
7
- insurableRouteId: string;
8
7
  }
@@ -7,6 +7,7 @@ import { useSettings } from '../../stores/settings/useSettings.js';
7
7
  import { deepMerge } from '../../utils/deepMerge.js';
8
8
  import { isItemAllowed } from '../../utils/item.js';
9
9
  import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js';
10
+ import { currencyExtendedFormatter } from './currencyExtendedFormatter.js';
10
11
  import type { LanguageKey, LanguageTranslationResources } from './types.js';
11
12
 
12
13
  export const I18nProvider: React.FC<React.PropsWithChildren> = ({
@@ -61,6 +62,11 @@ export const I18nProvider: React.FC<React.PropsWithChildren> = ({
61
62
 
62
63
  i18n.init();
63
64
 
65
+ i18n.services.formatter?.addCached(
66
+ 'currencyExt',
67
+ currencyExtendedFormatter,
68
+ );
69
+
64
70
  return i18n;
65
71
  }, [language, languageResources, languages]);
66
72
 
@@ -0,0 +1,15 @@
1
+ export const currencyExtendedFormatter = (
2
+ lng: string | undefined,
3
+ options: any,
4
+ ) => {
5
+ const formatter = new Intl.NumberFormat(lng, {
6
+ ...options,
7
+ style: 'currency',
8
+ });
9
+ return (value: any) => {
10
+ if (value > 0 && value < 0.01) {
11
+ return `<${formatter.format(0.01)}`;
12
+ }
13
+ return formatter.format(value);
14
+ };
15
+ };
@@ -1,8 +1,9 @@
1
+ import type { DefaultWagmiConfigResult } from '@lifi/wallet-management';
1
2
  import {
2
3
  createDefaultWagmiConfig,
3
4
  useSyncWagmiConfig,
4
5
  } from '@lifi/wallet-management';
5
- import { useState, type FC, type PropsWithChildren } from 'react';
6
+ import { useRef, type FC, type PropsWithChildren } from 'react';
6
7
  import { WagmiProvider } from 'wagmi';
7
8
  import { defaultWalletConnectProjectId } from '../../config/walletConnect.js';
8
9
  import { useAvailableChains } from '../../hooks/useAvailableChains.js';
@@ -12,8 +13,10 @@ import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js';
12
13
  export const EVMBaseProvider: FC<PropsWithChildren> = ({ children }) => {
13
14
  const { walletConfig } = useWidgetConfig();
14
15
  const { chains } = useAvailableChains();
15
- const [wagmi] = useState(() =>
16
- createDefaultWagmiConfig({
16
+ const wagmi = useRef<DefaultWagmiConfigResult>();
17
+
18
+ if (!wagmi.current) {
19
+ wagmi.current = createDefaultWagmiConfig({
17
20
  walletConnect: walletConfig?.walletConnect ?? {
18
21
  projectId: defaultWalletConnectProjectId,
19
22
  },
@@ -21,13 +24,16 @@ export const EVMBaseProvider: FC<PropsWithChildren> = ({ children }) => {
21
24
  appName: 'LI.FI',
22
25
  appLogoUrl: LiFiToolLogo,
23
26
  },
24
- }),
25
- );
27
+ wagmiConfig: {
28
+ ssr: true,
29
+ },
30
+ });
31
+ }
26
32
 
27
- useSyncWagmiConfig(wagmi.config, wagmi.connectors, chains);
33
+ useSyncWagmiConfig(wagmi.current.config, wagmi.current.connectors, chains);
28
34
 
29
35
  return (
30
- <WagmiProvider config={wagmi.config} reconnectOnMount={false}>
36
+ <WagmiProvider config={wagmi.current.config} reconnectOnMount={false}>
31
37
  {children}
32
38
  </WagmiProvider>
33
39
  );
@@ -18,7 +18,7 @@ export const createRouteExecutionStore = ({ namePrefix }: PersistStoreProps) =>
18
18
  persist(
19
19
  (set, get) => ({
20
20
  routes: {},
21
- setExecutableRoute: (route: Route, insurableRouteId?: string) => {
21
+ setExecutableRoute: (route: Route, observableRouteIds?: string[]) => {
22
22
  if (!get().routes[route.id]) {
23
23
  set((state: RouteExecutionState) => {
24
24
  const routes = { ...state.routes };
@@ -26,7 +26,7 @@ export const createRouteExecutionStore = ({ namePrefix }: PersistStoreProps) =>
26
26
  Object.keys(routes)
27
27
  .filter(
28
28
  (routeId) =>
29
- (routeId !== insurableRouteId &&
29
+ (!observableRouteIds?.includes(routeId) &&
30
30
  hasEnumFlag(
31
31
  routes[routeId]!.status,
32
32
  RouteExecutionStatus.Idle,
@@ -7,7 +7,7 @@ export interface RouteExecution {
7
7
 
8
8
  export interface RouteExecutionState {
9
9
  routes: Partial<Record<string, RouteExecution>>;
10
- setExecutableRoute: (route: Route, insurableRouteId?: string) => void;
10
+ setExecutableRoute: (route: Route, observableRouteIds?: string[]) => void;
11
11
  updateRoute: (route: Route) => void;
12
12
  restartRoute: (routeId: string) => void;
13
13
  deleteRoute: (routeId: string) => void;
@@ -347,6 +347,12 @@ export const createTheme = (
347
347
  },
348
348
  },
349
349
  MuiTooltip: {
350
+ defaultProps: {
351
+ enterDelay: 400,
352
+ disableInteractive: true,
353
+ arrow: true,
354
+ placement: 'top',
355
+ },
350
356
  styleOverrides: {
351
357
  tooltip: ({ theme }) => ({
352
358
  backgroundColor: 'rgb(0 0 0 / 64%)',
package/types/widget.ts CHANGED
@@ -106,7 +106,7 @@ export interface WidgetSDKConfig
106
106
  | 'routeOptions'
107
107
  | 'widgetVersion'
108
108
  > {
109
- routeOptions?: Omit<RouteOptions, 'bridges' | 'exchanges' | 'insurance'>;
109
+ routeOptions?: Omit<RouteOptions, 'bridges' | 'exchanges'>;
110
110
  }
111
111
 
112
112
  export interface WidgetContractTool {
@@ -149,7 +149,6 @@ export interface WidgetConfig {
149
149
 
150
150
  routePriority?: Order;
151
151
  slippage?: number;
152
- insurance?: boolean;
153
152
 
154
153
  variant?: WidgetVariant;
155
154
  subvariant?: WidgetSubvariant;
@@ -8,6 +8,7 @@ import type {
8
8
  TokenAmount,
9
9
  ToolsResponse,
10
10
  } from '@lifi/sdk';
11
+ import { v4 as uuidv4 } from 'uuid';
11
12
  import { formatUnits } from 'viem';
12
13
  import type { RouteExecution } from '../stores/routes/types.js';
13
14
 
@@ -93,21 +94,11 @@ export const buildRouteFromTxHistory = (
93
94
  const fromToken: TokenAmount = {
94
95
  ...sending.token,
95
96
  amount: BigInt(sending.amount ?? 0),
96
- priceUSD: sending.amountUSD ?? '0',
97
- symbol: sending.token?.symbol ?? '',
98
- decimals: sending.token?.decimals ?? 0,
99
- name: sending.token?.name ?? '',
100
- chainId: sending.token?.chainId,
101
97
  };
102
98
 
103
99
  const toToken: TokenAmount = {
104
100
  ...receiving.token,
105
101
  amount: BigInt(receiving.amount ?? 0),
106
- priceUSD: receiving.amountUSD ?? '0',
107
- symbol: receiving.token?.symbol ?? '',
108
- decimals: receiving.token?.decimals ?? 0,
109
- name: receiving.token?.name ?? '',
110
- chainId: receiving.token?.chainId,
111
102
  };
112
103
 
113
104
  const sendingValue = sending.value ? BigInt(sending.value) : 0n;
@@ -121,7 +112,7 @@ export const buildRouteFromTxHistory = (
121
112
  parseFloat(sending.gasToken.priceUSD)
122
113
  : 0;
123
114
 
124
- const feeCosts: FeeCost[] | undefined = sendingValue
115
+ const feeCosts: FeeCost[] | undefined = sendingFeeAmount
125
116
  ? [
126
117
  {
127
118
  amount: sendingFeeAmount.toString(),
@@ -151,9 +142,10 @@ export const buildRouteFromTxHistory = (
151
142
  toChainId: receiving.chainId,
152
143
  fromToken,
153
144
  toToken,
145
+ gasCostUSD: sending.gasAmountUSD,
154
146
  steps: [
155
147
  {
156
- id: '',
148
+ id: uuidv4(),
157
149
  type: 'lifi',
158
150
  tool: tx.tool,
159
151
  toolDetails: usedTool,
@@ -203,7 +195,7 @@ export const buildRouteFromTxHistory = (
203
195
  toolDetails: usedTool,
204
196
  },
205
197
  ],
206
- integrator: '',
198
+ integrator: tx.metadata?.integrator ?? '',
207
199
  execution: {
208
200
  status: 'DONE', // can be FAILED
209
201
  process: buildProcessFromTxHistory(tx),
package/utils/fees.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { FeeCost, GasCost, Route, Token } from '@lifi/sdk';
1
+ import type { FeeCost, GasCost, RouteExtended, Token } from '@lifi/sdk';
2
+ import { formatUnits } from 'viem';
2
3
 
3
4
  export interface FeesBreakdown {
4
5
  amount: bigint;
@@ -6,45 +7,45 @@ export interface FeesBreakdown {
6
7
  token: Token;
7
8
  }
8
9
 
9
- export const getGasCostsBreakdown = (route: Route): FeesBreakdown[] => {
10
- return Object.values(
11
- route.steps.reduce(
12
- (groupedGasCosts, step) => {
13
- if (step.estimate.gasCosts?.length) {
10
+ export const getGasCostsBreakdown = (route: RouteExtended): FeesBreakdown[] => {
11
+ return Array.from(
12
+ route.steps
13
+ .reduce((groupedGasCosts, step) => {
14
+ const gasCosts = step.execution?.gasCosts ?? step.estimate.gasCosts;
15
+ if (gasCosts?.length) {
14
16
  const {
15
17
  token,
16
18
  amount: gasCostAmount,
17
19
  amountUSD: gasCostAmountUSD,
18
- } = getStepFeeCostsBreakdown(step.estimate.gasCosts);
19
- const groupedGasCost = groupedGasCosts[token.chainId];
20
+ } = getStepFeeCostsBreakdown(gasCosts);
21
+ const groupedGasCost = groupedGasCosts.get(token.chainId);
20
22
  const amount = groupedGasCost
21
23
  ? groupedGasCost.amount + gasCostAmount
22
24
  : gasCostAmount;
23
25
  const amountUSD = groupedGasCost
24
26
  ? groupedGasCost.amountUSD + gasCostAmountUSD
25
27
  : gasCostAmountUSD;
26
- groupedGasCosts[token.chainId] = {
28
+ groupedGasCosts.set(token.chainId, {
27
29
  amount,
28
30
  amountUSD,
29
31
  token,
30
- };
32
+ });
31
33
  return groupedGasCosts;
32
34
  }
33
35
  return groupedGasCosts;
34
- },
35
- {} as Record<number, FeesBreakdown>,
36
- ),
36
+ }, new Map<number, FeesBreakdown>())
37
+ .values(),
37
38
  );
38
39
  };
39
40
 
40
41
  export const getFeeCostsBreakdown = (
41
- route: Route,
42
+ route: RouteExtended,
42
43
  included?: boolean,
43
44
  ): FeesBreakdown[] => {
44
- return Object.values(
45
- route.steps.reduce(
46
- (groupedFeeCosts, step) => {
47
- let feeCosts = step.estimate.feeCosts;
45
+ return Array.from(
46
+ route.steps
47
+ .reduce((groupedFeeCosts, step) => {
48
+ let feeCosts = step.execution?.feeCosts ?? step.estimate.feeCosts;
48
49
  if (typeof included === 'boolean') {
49
50
  feeCosts = feeCosts?.filter(
50
51
  (feeCost) => feeCost.included === included,
@@ -56,24 +57,23 @@ export const getFeeCostsBreakdown = (
56
57
  amount: feeCostAmount,
57
58
  amountUSD: feeCostAmountUSD,
58
59
  } = getStepFeeCostsBreakdown(feeCosts);
59
- const groupedFeeCost = groupedFeeCosts[token.chainId];
60
+ const groupedFeeCost = groupedFeeCosts.get(token.chainId);
60
61
  const amount = groupedFeeCost
61
62
  ? groupedFeeCost.amount + feeCostAmount
62
63
  : feeCostAmount;
63
64
  const amountUSD = groupedFeeCost
64
65
  ? groupedFeeCost.amountUSD + feeCostAmountUSD
65
66
  : feeCostAmountUSD;
66
- groupedFeeCosts[token.chainId] = {
67
+ groupedFeeCosts.set(token.chainId, {
67
68
  amount,
68
69
  amountUSD,
69
70
  token,
70
- };
71
+ });
71
72
  return groupedFeeCosts;
72
73
  }
73
74
  return groupedFeeCosts;
74
- },
75
- {} as Record<number, FeesBreakdown>,
76
- ),
75
+ }, new Map<number, FeesBreakdown>())
76
+ .values(),
77
77
  );
78
78
  };
79
79
 
@@ -86,7 +86,12 @@ export const getStepFeeCostsBreakdown = (
86
86
  0n,
87
87
  );
88
88
  const amountUSD = feeCosts.reduce(
89
- (amount, feeCost) => amount + parseFloat(feeCost.amountUSD || '0'),
89
+ (amount, feeCost) =>
90
+ amount +
91
+ parseFloat(feeCost.token.priceUSD || '0') *
92
+ parseFloat(
93
+ formatUnits(BigInt(feeCost.amount || 0), feeCost.token.decimals),
94
+ ),
90
95
  0,
91
96
  );
92
97
  return {
package/utils/format.ts CHANGED
@@ -1,34 +1,35 @@
1
1
  import { formatUnits } from 'viem';
2
2
 
3
+ const subscriptMap = ['₀', '₁', '₂', '₃', '₄', '₅', '₆', '₇', '₈', '₉'];
4
+
5
+ export const precisionFormatter = new Intl.NumberFormat('en', {
6
+ notation: 'standard',
7
+ roundingPriority: 'morePrecision',
8
+ maximumSignificantDigits: 4,
9
+ maximumFractionDigits: 4,
10
+ useGrouping: false,
11
+ });
12
+
3
13
  /**
4
14
  * Format token amount to at least 4 decimals.
5
15
  * @param amount amount to format.
6
16
  * @returns formatted amount.
7
17
  */
8
- export const formatTokenAmount = (
9
- amount: bigint = 0n,
10
- decimals: number,
11
- decimalPlaces: number = 3,
12
- ) => {
18
+ export function formatTokenAmount(amount: bigint = 0n, decimals: number) {
13
19
  const formattedAmount = amount ? formatUnits(amount, decimals) : '0';
14
20
  const parsedAmount = parseFloat(formattedAmount);
15
21
  if (parsedAmount === 0 || isNaN(Number(formattedAmount))) {
16
22
  return '0';
17
23
  }
18
24
 
19
- const absAmount = Math.abs(parsedAmount);
20
- while (absAmount < 1 / 10 ** decimalPlaces) {
21
- decimalPlaces++;
22
- }
23
-
24
- return parsedAmount.toFixed(decimalPlaces + 1);
25
- };
25
+ return precisionFormatter.format(parsedAmount);
26
+ }
26
27
 
27
- export const formatSlippage = (
28
+ export function formatSlippage(
28
29
  slippage: string = '',
29
30
  defaultValue: string = '',
30
31
  returnInitial: boolean = false,
31
- ): string => {
32
+ ): string {
32
33
  if (!slippage) {
33
34
  return slippage;
34
35
  }
@@ -49,13 +50,13 @@ export const formatSlippage = (
49
50
  return slippage;
50
51
  }
51
52
  return parsedSlippage.toString();
52
- };
53
+ }
53
54
 
54
- export const formatInputAmount = (
55
+ export function formatInputAmount(
55
56
  amount: string,
56
57
  decimals: number | null = null,
57
58
  returnInitial: boolean = false,
58
- ) => {
59
+ ) {
59
60
  if (!amount) {
60
61
  return amount;
61
62
  }
@@ -80,9 +81,9 @@ export const formatInputAmount = (
80
81
  integer = integer.replace(/^0+|-/, '');
81
82
  fraction = fraction.replace(/(0+)$/, '');
82
83
  return `${integer || (fraction ? '0' : '')}${fraction ? `.${fraction}` : ''}`;
83
- };
84
+ }
84
85
 
85
- export const formatTokenPrice = (amount?: string, price?: string) => {
86
+ export function formatTokenPrice(amount?: string, price?: string) {
86
87
  if (!amount || !price) {
87
88
  return 0;
88
89
  }
@@ -90,4 +91,50 @@ export const formatTokenPrice = (amount?: string, price?: string) => {
90
91
  return 0;
91
92
  }
92
93
  return parseFloat(amount) * parseFloat(price);
93
- };
94
+ }
95
+
96
+ /**
97
+ * Converts a number to a subscript format if it contains leading zeros in the fractional part.
98
+ *
99
+ * @param {number} value - The number to be converted.
100
+ * @param {Intl.NumberFormatOptions} options An object that contains one or more properties that specify comparison options.
101
+ * @returns {string} - The number formatted as a string, with subscripts for leading zeros if applicable.
102
+ */
103
+ export function convertToSubscriptFormat(
104
+ value: number,
105
+ options?: Intl.NumberFormatOptions,
106
+ ): string {
107
+ let formattedValue;
108
+ if (options) {
109
+ formattedValue = value.toLocaleString('en', options);
110
+ } else {
111
+ formattedValue = precisionFormatter.format(value);
112
+ }
113
+
114
+ // Calculate the number of zeros after the decimal point
115
+ const d = Math.ceil(Math.log10(Math.abs(value)));
116
+
117
+ // If the value does not have significant leading zeros in the fractional part, return the formatted value as is
118
+ if (d > -3 || !value) {
119
+ return formattedValue;
120
+ }
121
+
122
+ // Calculate the number of leading zeros in the fractional part
123
+ const leadingZeros = Math.abs(d);
124
+
125
+ const fractionalPartExtractor = value > 0 ? 2 : 3;
126
+
127
+ // Extract the fractional part of the formatted value, excluding the leading zeros and "0." or "-0."
128
+ const fractionalPart = formattedValue.slice(
129
+ leadingZeros + fractionalPartExtractor,
130
+ );
131
+
132
+ // Convert the number of leading zeros to their corresponding Unicode subscript characters
133
+ const subscript = leadingZeros
134
+ .toString()
135
+ .split('')
136
+ .map((digit) => subscriptMap[digit as any])
137
+ .join('');
138
+
139
+ return `${value > 0 ? '' : '-'}0.0${subscript}${fractionalPart}`;
140
+ }
@@ -1,2 +0,0 @@
1
- import type { InsuranceProps } from './types.js';
2
- export declare const Insurance: React.FC<InsuranceProps>;
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { RouteExecutionStatus } from '../../stores/routes/types.js';
3
- import { InsuranceCard } from './InsuranceCard.js';
4
- import { InsuranceCollapsed } from './InsuranceCollapsed.js';
5
- export const Insurance = ({ status, insurableRouteId, onChange, ...props }) => {
6
- return status === RouteExecutionStatus.Idle ? (_jsx(InsuranceCollapsed, { status: status, insurableRouteId: insurableRouteId, onChange: onChange, ...props })) : (_jsx(InsuranceCard, { status: status, ...props }));
7
- };
8
- //# sourceMappingURL=Insurance.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Insurance.js","sourceRoot":"","sources":["../../../components/Insurance/Insurance.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,MAAM,CAAC,MAAM,SAAS,GAA6B,CAAC,EAClD,MAAM,EACN,gBAAgB,EAChB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,EAAE;IACH,OAAO,MAAM,KAAK,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5C,KAAC,kBAAkB,IACjB,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,QAAQ,KACd,KAAK,GACT,CACH,CAAC,CAAC,CAAC,CACF,KAAC,aAAa,IAAC,MAAM,EAAE,MAAM,KAAM,KAAK,GAAI,CAC7C,CAAC;AACJ,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { InsuranceCardProps } from './types.js';
2
- export declare const InsuranceCard: React.FC<InsuranceCardProps>;
@@ -1,36 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { VerifiedUser } from '@mui/icons-material';
3
- import { Box, Collapse, Link, Typography } from '@mui/material';
4
- import { useState } from 'react';
5
- import { Trans, useTranslation } from 'react-i18next';
6
- import { InsuraceLogo } from '../../icons/InsuraceLogo.js';
7
- import { RouteExecutionStatus } from '../../stores/routes/types.js';
8
- import { Card } from '../Card/Card.js';
9
- import { CardLabel, CardLabelTypography } from '../Card/CardLabel.js';
10
- import { Switch } from '../Switch.js';
11
- export const InsuranceCard = ({ status, feeAmountUsd, insuredAmount, insuredTokenSymbol, insuranceCoverageId, onChange, ...props }) => {
12
- const { t } = useTranslation();
13
- const [enabled, setEnabled] = useState(false);
14
- const handleSwitch = (_, checked) => {
15
- setEnabled(checked);
16
- onChange?.(checked);
17
- };
18
- return (_jsxs(Card, { selectionColor: "secondary", indented: true, ...props, children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", children: [_jsxs(CardLabel, { type: 'insurance', children: [_jsx(VerifiedUser, { fontSize: "inherit" }), _jsx(CardLabelTypography, { type: "icon", children: status === RouteExecutionStatus.Idle
19
- ? t('main.tags.insurance')
20
- : t('main.tags.insured') })] }), _jsx(Switch, { onChange: handleSwitch, value: enabled })] }), _jsx(Collapse, { timeout: 225, in: enabled, mountOnEnter: true, unmountOnExit: true, children: _jsxs(Box, { mt: 2, children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [_jsx(Typography, { fontSize: 24, fontWeight: 700, lineHeight: 1, children: t('format.currency', {
21
- value: feeAmountUsd,
22
- }) }), _jsx(InsuraceLogo, {})] }), _jsxs(Box, { children: [_jsx(Typography, { fontSize: 14, children: _jsx(Trans, { i18nKey: status === RouteExecutionStatus.Idle
23
- ? 'insurance.insure'
24
- : 'insurance.insured', values: {
25
- amount: insuredAmount,
26
- tokenSymbol: insuredTokenSymbol,
27
- }, components: [_jsx("strong", {})] }) }), _jsx(Collapse, { timeout: 225, in: enabled || status !== RouteExecutionStatus.Idle, mountOnEnter: true, unmountOnExit: true, children: _jsxs(Box, { sx: {
28
- listStyleType: 'disc',
29
- pl: 2,
30
- }, children: [_jsx(Typography, { fontSize: 14, display: "list-item", children: t('insurance.bridgeExploits') }), _jsx(Typography, { fontSize: 14, display: "list-item", children: t('insurance.slippageError') })] }) }), _jsx(Link, { href: status === RouteExecutionStatus.Idle
31
- ? 'https://docs.insurace.io/landing-page/documentation/cover-products/bridge-cover/li.fi'
32
- : `https://app.insurace.io/bridge-cover?search=${insuranceCoverageId}`, target: "_blank", underline: "none", color: "text.primary", children: _jsx(Typography, { pt: 0.5, color: "primary", fontSize: 14, fontWeight: 600, children: status === RouteExecutionStatus.Idle
33
- ? t('button.learnMore')
34
- : t('button.viewCoverage') }) })] })] }) })] }));
35
- };
36
- //# sourceMappingURL=InsuranceCard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InsuranceCard.js","sourceRoot":"","sources":["../../../components/Insurance/InsuranceCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAC1D,MAAM,EACN,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;IAC/B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,YAAY,GAAG,CAAC,CAAgC,EAAE,OAAgB,EAAE,EAAE;QAC1E,UAAU,CAAC,OAAO,CAAC,CAAC;QACpB,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,IAAI,IAAC,cAAc,EAAC,WAAW,EAAC,QAAQ,WAAK,KAAK,aACjD,MAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,cAAc,EAAC,eAAe,aACpE,MAAC,SAAS,IAAC,IAAI,EAAE,WAAW,aAC1B,KAAC,YAAY,IAAC,QAAQ,EAAC,SAAS,GAAG,EACnC,KAAC,mBAAmB,IAAC,IAAI,EAAC,MAAM,YAC7B,MAAM,KAAK,oBAAoB,CAAC,IAAI;oCACnC,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC;oCAC1B,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,GACN,IACZ,EACZ,KAAC,MAAM,IAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,GAAI,IAC9C,EACN,KAAC,QAAQ,IAAC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,QAAC,aAAa,kBAC7D,MAAC,GAAG,IAAC,EAAE,EAAE,CAAC,aACR,MAAC,GAAG,IACF,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,cAAc,EAAC,eAAe,EAC9B,EAAE,EAAE,CAAC,aAEL,KAAC,UAAU,IAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,YACrD,CAAC,CAAC,iBAAiB,EAAE;wCACpB,KAAK,EAAE,YAAY;qCACpB,CAAC,GACS,EACb,KAAC,YAAY,KAAG,IACZ,EACN,MAAC,GAAG,eACF,KAAC,UAAU,IAAC,QAAQ,EAAE,EAAE,YACtB,KAAC,KAAK,IACJ,OAAO,EACL,MAAM,KAAK,oBAAoB,CAAC,IAAI;4CAClC,CAAC,CAAC,kBAAkB;4CACpB,CAAC,CAAC,mBAAmB,EAEzB,MAAM,EAAE;4CACN,MAAM,EAAE,aAAa;4CACrB,WAAW,EAAE,kBAAkB;yCAChC,EACD,UAAU,EAAE,CAAC,kBAAU,CAAC,GACxB,GACS,EACb,KAAC,QAAQ,IACP,OAAO,EAAE,GAAG,EACZ,EAAE,EAAE,OAAO,IAAI,MAAM,KAAK,oBAAoB,CAAC,IAAI,EACnD,YAAY,QACZ,aAAa,kBAEb,MAAC,GAAG,IACF,EAAE,EAAE;4CACF,aAAa,EAAE,MAAM;4CACrB,EAAE,EAAE,CAAC;yCACN,aAED,KAAC,UAAU,IAAC,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAC,WAAW,YAC1C,CAAC,CAAC,0BAA0B,CAAC,GACnB,EACb,KAAC,UAAU,IAAC,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAC,WAAW,YAC1C,CAAC,CAAC,yBAAyB,CAAC,GAClB,IACT,GACG,EACX,KAAC,IAAI,IACH,IAAI,EACF,MAAM,KAAK,oBAAoB,CAAC,IAAI;wCAClC,CAAC,CAAC,uFAAuF;wCACzF,CAAC,CAAC,+CAA+C,mBAAmB,EAAE,EAE1E,MAAM,EAAC,QAAQ,EACf,SAAS,EAAC,MAAM,EAChB,KAAK,EAAC,cAAc,YAEpB,KAAC,UAAU,IACT,EAAE,EAAE,GAAG,EACP,KAAK,EAAC,SAAS,EACf,QAAQ,EAAE,EAAE,EACZ,UAAU,EAAE,GAAG,YAEd,MAAM,KAAK,oBAAoB,CAAC,IAAI;4CACnC,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC;4CACvB,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,GACjB,GACR,IACH,IACF,GACG,IACN,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { InsuranceProps } from './types.js';
2
- export declare const InsuranceCollapsed: React.FC<InsuranceProps>;