@moneylion/react-native-offer-carousel 1.0.0 → 1.0.2

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 (773) hide show
  1. package/README.md +44 -0
  2. package/lib/commonjs/builder/builder.js +356 -0
  3. package/lib/commonjs/builder/builder.js.map +1 -0
  4. package/lib/commonjs/builder/config/types.js +2 -0
  5. package/lib/commonjs/builder/config/types.js.map +1 -0
  6. package/lib/commonjs/builder/index.js +28 -0
  7. package/lib/commonjs/builder/index.js.map +1 -0
  8. package/lib/commonjs/capabilities/configuration/src/brands/checkVisualEligibility.js +30 -0
  9. package/lib/commonjs/capabilities/configuration/src/brands/checkVisualEligibility.js.map +1 -0
  10. package/lib/commonjs/capabilities/configuration/src/brands/createDerivedBrands.js +40 -0
  11. package/lib/commonjs/capabilities/configuration/src/brands/createDerivedBrands.js.map +1 -0
  12. package/lib/commonjs/capabilities/configuration/src/brands/index.js +20 -0
  13. package/lib/commonjs/capabilities/configuration/src/brands/index.js.map +1 -0
  14. package/lib/commonjs/capabilities/configuration/src/brands/types.js +13 -0
  15. package/lib/commonjs/capabilities/configuration/src/brands/types.js.map +1 -0
  16. package/lib/commonjs/capabilities/core/src/domain/third-party-search/index.js +17 -0
  17. package/lib/commonjs/capabilities/core/src/domain/third-party-search/index.js.map +1 -0
  18. package/lib/commonjs/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js +33 -0
  19. package/lib/commonjs/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js.map +1 -0
  20. package/lib/commonjs/capabilities/core/src/index.js +17 -0
  21. package/lib/commonjs/capabilities/core/src/index.js.map +1 -0
  22. package/lib/commonjs/capabilities/core/src/system/cnfContext/CnfContext.js +18 -0
  23. package/lib/commonjs/capabilities/core/src/system/cnfContext/CnfContext.js.map +1 -0
  24. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/App.js +18 -0
  25. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/App.js.map +1 -0
  26. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Brand.js +87 -0
  27. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -0
  28. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Configuration.js +41 -0
  29. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Configuration.js.map +1 -0
  30. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Request.js +21 -0
  31. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Request.js.map +1 -0
  32. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Session.js +12 -0
  33. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Session.js.map +1 -0
  34. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Signals.js +41 -0
  35. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Signals.js.map +1 -0
  36. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Subaccount.js +26 -0
  37. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/Subaccount.js.map +1 -0
  38. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/index.js +83 -0
  39. package/lib/commonjs/capabilities/core/src/system/cnfContext/schemas/index.js.map +1 -0
  40. package/lib/commonjs/capabilities/offer-catalog/src/api/offerCatalogApi.js +131 -0
  41. package/lib/commonjs/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -0
  42. package/lib/commonjs/capabilities/offer-catalog/src/index.js +65 -0
  43. package/lib/commonjs/capabilities/offer-catalog/src/index.js.map +1 -0
  44. package/lib/commonjs/capabilities/offer-catalog/src/types/offerCatalogSchema.js +2 -0
  45. package/lib/commonjs/capabilities/offer-catalog/src/types/offerCatalogSchema.js.map +1 -0
  46. package/lib/commonjs/capabilities/offer-catalog/src/utils/arrayToMarkdownList.js +11 -0
  47. package/lib/commonjs/capabilities/offer-catalog/src/utils/arrayToMarkdownList.js.map +1 -0
  48. package/lib/commonjs/capabilities/offer-catalog/src/utils/contextUtil.js +70 -0
  49. package/lib/commonjs/capabilities/offer-catalog/src/utils/contextUtil.js.map +1 -0
  50. package/lib/commonjs/capabilities/offer-catalog/src/utils/errorUtil.js +21 -0
  51. package/lib/commonjs/capabilities/offer-catalog/src/utils/errorUtil.js.map +1 -0
  52. package/lib/commonjs/capabilities/offer-catalog/src/utils/formatUtils.js +161 -0
  53. package/lib/commonjs/capabilities/offer-catalog/src/utils/formatUtils.js.map +1 -0
  54. package/lib/commonjs/capabilities/offer-catalog/src/utils/getOfferUrl.js +44 -0
  55. package/lib/commonjs/capabilities/offer-catalog/src/utils/getOfferUrl.js.map +1 -0
  56. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.js +78 -0
  57. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.js.map +1 -0
  58. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/boolean.js +22 -0
  59. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/boolean.js.map +1 -0
  60. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.js +60 -0
  61. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.js.map +1 -0
  62. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/common.js +20 -0
  63. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/common.js.map +1 -0
  64. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.js +62 -0
  65. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.js.map +1 -0
  66. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.js +32 -0
  67. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.js.map +1 -0
  68. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.js +31 -0
  69. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.js.map +1 -0
  70. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/currency.js +22 -0
  71. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/currency.js.map +1 -0
  72. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.js +46 -0
  73. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.js.map +1 -0
  74. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.js +208 -0
  75. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.js.map +1 -0
  76. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.js +20 -0
  77. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.js.map +1 -0
  78. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.js +24 -0
  79. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.js.map +1 -0
  80. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.js +21 -0
  81. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.js.map +1 -0
  82. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.js +40 -0
  83. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.js.map +1 -0
  84. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/index.js +204 -0
  85. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/index.js.map +1 -0
  86. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.js +35 -0
  87. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.js.map +1 -0
  88. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.js +43 -0
  89. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.js.map +1 -0
  90. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/percentage.js +21 -0
  91. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/percentage.js.map +1 -0
  92. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.js +32 -0
  93. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.js.map +1 -0
  94. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.js +76 -0
  95. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.js.map +1 -0
  96. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.js +69 -0
  97. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.js.map +1 -0
  98. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.js +23 -0
  99. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.js.map +1 -0
  100. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.js +47 -0
  101. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.js.map +1 -0
  102. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.js +72 -0
  103. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.js.map +1 -0
  104. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.js +23 -0
  105. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.js.map +1 -0
  106. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.js +29 -0
  107. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.js.map +1 -0
  108. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.js +53 -0
  109. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.js.map +1 -0
  110. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.js +46 -0
  111. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.js.map +1 -0
  112. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.js +26 -0
  113. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.js.map +1 -0
  114. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.js +83 -0
  115. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.js.map +1 -0
  116. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.js +28 -0
  117. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.js.map +1 -0
  118. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.js +28 -0
  119. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.js.map +1 -0
  120. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.js +21 -0
  121. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.js.map +1 -0
  122. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.js +30 -0
  123. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.js.map +1 -0
  124. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/index.js +48 -0
  125. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/index.js.map +1 -0
  126. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/types.js +6 -0
  127. package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/types.js.map +1 -0
  128. package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.js +6 -0
  129. package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.js.map +1 -0
  130. package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.js +2 -0
  131. package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.js.map +1 -0
  132. package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/types/PublicApi.d.js +2 -0
  133. package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/types/PublicApi.d.js.map +1 -0
  134. package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/types/index.js +6 -0
  135. package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/types/index.js.map +1 -0
  136. package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.js +74 -0
  137. package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.js.map +1 -0
  138. package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.js +61 -0
  139. package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.js.map +1 -0
  140. package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/components.js +141 -0
  141. package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/components.js.map +1 -0
  142. package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/index.js +54 -0
  143. package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/index.js.map +1 -0
  144. package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.js +122 -0
  145. package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.js.map +1 -0
  146. package/lib/commonjs/capabilities/ui/elements/src/components/index.js +13 -0
  147. package/lib/commonjs/capabilities/ui/elements/src/components/index.js.map +1 -0
  148. package/lib/commonjs/capabilities/ui/elements/src/components/thumbor/index.js +110 -0
  149. package/lib/commonjs/capabilities/ui/elements/src/components/thumbor/index.js.map +1 -0
  150. package/lib/commonjs/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.js +91 -0
  151. package/lib/commonjs/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.js.map +1 -0
  152. package/lib/commonjs/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.js +44 -0
  153. package/lib/commonjs/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.js.map +1 -0
  154. package/lib/commonjs/capabilities/ui/elements/src/index.js +28 -0
  155. package/lib/commonjs/capabilities/ui/elements/src/index.js.map +1 -0
  156. package/lib/commonjs/capabilities/ui/elements/src/offerCardAttributes.js +23 -0
  157. package/lib/commonjs/capabilities/ui/elements/src/offerCardAttributes.js.map +1 -0
  158. package/lib/commonjs/components/Cards/VideosCard/VideoContent.js +35 -37
  159. package/lib/commonjs/components/Cards/VideosCard/VideoContent.js.map +1 -1
  160. package/lib/commonjs/components/Cards/VideosCard/VideosCard.js +1 -1
  161. package/lib/commonjs/components/Common/BaseOfferCard/Stat/Stat.js +1 -1
  162. package/lib/commonjs/components/Common/BaseOfferCard/Stat/Stat.js.map +1 -1
  163. package/lib/commonjs/components/Common/BaseOfferCard/index.js +4 -4
  164. package/lib/commonjs/components/Common/BaseOfferCard/index.js.map +1 -1
  165. package/lib/commonjs/components/DynamicOffers/DynamicOffers.js +1 -1
  166. package/lib/commonjs/components/DynamicOffers/Render/DynamicOffersRender.js +1 -1
  167. package/lib/commonjs/components/Layouts/CreditCardOfferCard/statsBuilder.js +1 -1
  168. package/lib/commonjs/components/Layouts/DefaultOfferCard/statsBuilder.js +1 -1
  169. package/lib/commonjs/components/Modal/DescriptionPoints.js +3 -3
  170. package/lib/commonjs/components/Modal/DescriptionPoints.js.map +1 -1
  171. package/lib/commonjs/components/Modal/Disclaimer.js +1 -1
  172. package/lib/commonjs/components/Modal/Disclaimer.js.map +1 -1
  173. package/lib/commonjs/components/MoneyLionOfferCarousel.js +1 -1
  174. package/lib/commonjs/config/mocks/cnfContext.js +143 -0
  175. package/lib/commonjs/config/mocks/cnfContext.js.map +1 -0
  176. package/lib/commonjs/pageData.js +1 -1
  177. package/lib/commonjs/services/getProductTypesByQuery.js +1 -1
  178. package/lib/commonjs/utils/formatOfferUrl.js +1 -1
  179. package/lib/commonjs/utils/getOffersByProductTypes.js +2 -2
  180. package/lib/module/builder/builder.js +350 -0
  181. package/lib/module/builder/builder.js.map +1 -0
  182. package/lib/module/builder/config/types.js +2 -0
  183. package/lib/module/builder/config/types.js.map +1 -0
  184. package/lib/module/builder/index.js +3 -0
  185. package/lib/module/builder/index.js.map +1 -0
  186. package/lib/module/capabilities/configuration/src/brands/checkVisualEligibility.js +24 -0
  187. package/lib/module/capabilities/configuration/src/brands/checkVisualEligibility.js.map +1 -0
  188. package/lib/module/capabilities/configuration/src/brands/createDerivedBrands.js +34 -0
  189. package/lib/module/capabilities/configuration/src/brands/createDerivedBrands.js.map +1 -0
  190. package/lib/module/capabilities/configuration/src/brands/index.js +3 -0
  191. package/lib/module/capabilities/configuration/src/brands/index.js.map +1 -0
  192. package/lib/module/capabilities/configuration/src/brands/types.js +6 -0
  193. package/lib/module/capabilities/configuration/src/brands/types.js.map +1 -0
  194. package/lib/module/capabilities/core/src/domain/third-party-search/index.js +2 -0
  195. package/lib/module/capabilities/core/src/domain/third-party-search/index.js.map +1 -0
  196. package/lib/module/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js +26 -0
  197. package/lib/module/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.js.map +1 -0
  198. package/lib/module/capabilities/core/src/index.js +2 -0
  199. package/lib/module/capabilities/core/src/index.js.map +1 -0
  200. package/lib/module/capabilities/core/src/system/cnfContext/CnfContext.js +12 -0
  201. package/lib/module/capabilities/core/src/system/cnfContext/CnfContext.js.map +1 -0
  202. package/lib/module/capabilities/core/src/system/cnfContext/schemas/App.js +12 -0
  203. package/lib/module/capabilities/core/src/system/cnfContext/schemas/App.js.map +1 -0
  204. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Brand.js +81 -0
  205. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Brand.js.map +1 -0
  206. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Configuration.js +35 -0
  207. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Configuration.js.map +1 -0
  208. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Request.js +15 -0
  209. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Request.js.map +1 -0
  210. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Session.js +6 -0
  211. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Session.js.map +1 -0
  212. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Signals.js +35 -0
  213. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Signals.js.map +1 -0
  214. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Subaccount.js +20 -0
  215. package/lib/module/capabilities/core/src/system/cnfContext/schemas/Subaccount.js.map +1 -0
  216. package/lib/module/capabilities/core/src/system/cnfContext/schemas/index.js +8 -0
  217. package/lib/module/capabilities/core/src/system/cnfContext/schemas/index.js.map +1 -0
  218. package/lib/module/capabilities/offer-catalog/src/api/offerCatalogApi.js +122 -0
  219. package/lib/module/capabilities/offer-catalog/src/api/offerCatalogApi.js.map +1 -0
  220. package/lib/module/capabilities/offer-catalog/src/index.js +5 -0
  221. package/lib/module/capabilities/offer-catalog/src/index.js.map +1 -0
  222. package/lib/module/capabilities/offer-catalog/src/types/offerCatalogSchema.js +2 -0
  223. package/lib/module/capabilities/offer-catalog/src/types/offerCatalogSchema.js.map +1 -0
  224. package/lib/module/capabilities/offer-catalog/src/utils/arrayToMarkdownList.js +4 -0
  225. package/lib/module/capabilities/offer-catalog/src/utils/arrayToMarkdownList.js.map +1 -0
  226. package/lib/module/capabilities/offer-catalog/src/utils/contextUtil.js +58 -0
  227. package/lib/module/capabilities/offer-catalog/src/utils/contextUtil.js.map +1 -0
  228. package/lib/module/capabilities/offer-catalog/src/utils/errorUtil.js +15 -0
  229. package/lib/module/capabilities/offer-catalog/src/utils/errorUtil.js.map +1 -0
  230. package/lib/module/capabilities/offer-catalog/src/utils/formatUtils.js +151 -0
  231. package/lib/module/capabilities/offer-catalog/src/utils/formatUtils.js.map +1 -0
  232. package/lib/module/capabilities/offer-catalog/src/utils/getOfferUrl.js +37 -0
  233. package/lib/module/capabilities/offer-catalog/src/utils/getOfferUrl.js.map +1 -0
  234. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.js +71 -0
  235. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.js.map +1 -0
  236. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/boolean.js +15 -0
  237. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/boolean.js.map +1 -0
  238. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.js +59 -0
  239. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.js.map +1 -0
  240. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/common.js +13 -0
  241. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/common.js.map +1 -0
  242. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.js +61 -0
  243. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.js.map +1 -0
  244. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.js +25 -0
  245. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.js.map +1 -0
  246. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.js +30 -0
  247. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.js.map +1 -0
  248. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/currency.js +15 -0
  249. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/currency.js.map +1 -0
  250. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.js +39 -0
  251. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.js.map +1 -0
  252. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.js +207 -0
  253. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.js.map +1 -0
  254. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.js +13 -0
  255. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.js.map +1 -0
  256. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.js +23 -0
  257. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.js.map +1 -0
  258. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.js +14 -0
  259. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.js.map +1 -0
  260. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.js +39 -0
  261. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.js.map +1 -0
  262. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/index.js +20 -0
  263. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/index.js.map +1 -0
  264. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.js +28 -0
  265. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.js.map +1 -0
  266. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.js +42 -0
  267. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.js.map +1 -0
  268. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/percentage.js +14 -0
  269. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/percentage.js.map +1 -0
  270. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.js +31 -0
  271. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.js.map +1 -0
  272. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.js +69 -0
  273. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.js.map +1 -0
  274. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.js +68 -0
  275. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.js.map +1 -0
  276. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.js +16 -0
  277. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.js.map +1 -0
  278. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.js +40 -0
  279. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.js.map +1 -0
  280. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.js +71 -0
  281. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.js.map +1 -0
  282. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.js +16 -0
  283. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.js.map +1 -0
  284. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.js +28 -0
  285. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.js.map +1 -0
  286. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.js +46 -0
  287. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.js.map +1 -0
  288. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.js +45 -0
  289. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.js.map +1 -0
  290. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.js +19 -0
  291. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.js.map +1 -0
  292. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.js +82 -0
  293. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.js.map +1 -0
  294. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.js +21 -0
  295. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.js.map +1 -0
  296. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.js +27 -0
  297. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.js.map +1 -0
  298. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.js +14 -0
  299. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.js.map +1 -0
  300. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.js +29 -0
  301. package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.js.map +1 -0
  302. package/lib/module/capabilities/offer-catalog/src/utils/stats/index.js +41 -0
  303. package/lib/module/capabilities/offer-catalog/src/utils/stats/index.js.map +1 -0
  304. package/lib/module/capabilities/offer-catalog/src/utils/stats/types.js +2 -0
  305. package/lib/module/capabilities/offer-catalog/src/utils/stats/types.js.map +1 -0
  306. package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.js +2 -0
  307. package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.js.map +1 -0
  308. package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.js +2 -0
  309. package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.js.map +1 -0
  310. package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/types/PublicApi.d.js +2 -0
  311. package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/types/PublicApi.d.js.map +1 -0
  312. package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/types/index.js +2 -0
  313. package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/types/index.js.map +1 -0
  314. package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.js +65 -0
  315. package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.js.map +1 -0
  316. package/lib/module/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.js +50 -0
  317. package/lib/module/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.js.map +1 -0
  318. package/lib/module/capabilities/ui/elements/src/components/MarkdownText/components.js +133 -0
  319. package/lib/module/capabilities/ui/elements/src/components/MarkdownText/components.js.map +1 -0
  320. package/lib/module/capabilities/ui/elements/src/components/MarkdownText/index.js +46 -0
  321. package/lib/module/capabilities/ui/elements/src/components/MarkdownText/index.js.map +1 -0
  322. package/lib/module/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.js +115 -0
  323. package/lib/module/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.js.map +1 -0
  324. package/lib/module/capabilities/ui/elements/src/components/index.js +2 -0
  325. package/lib/module/capabilities/ui/elements/src/components/index.js.map +1 -0
  326. package/lib/module/capabilities/ui/elements/src/components/thumbor/index.js +103 -0
  327. package/lib/module/capabilities/ui/elements/src/components/thumbor/index.js.map +1 -0
  328. package/lib/module/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.js +86 -0
  329. package/lib/module/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.js.map +1 -0
  330. package/lib/module/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.js +43 -0
  331. package/lib/module/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.js.map +1 -0
  332. package/lib/module/capabilities/ui/elements/src/index.js +3 -0
  333. package/lib/module/capabilities/ui/elements/src/index.js.map +1 -0
  334. package/lib/module/capabilities/ui/elements/src/offerCardAttributes.js +16 -0
  335. package/lib/module/capabilities/ui/elements/src/offerCardAttributes.js.map +1 -0
  336. package/lib/module/components/Cards/VideosCard/VideoContent.js +35 -30
  337. package/lib/module/components/Cards/VideosCard/VideoContent.js.map +1 -1
  338. package/lib/module/components/Cards/VideosCard/VideosCard.js +1 -1
  339. package/lib/module/components/Common/BaseOfferCard/Stat/Stat.js +1 -2
  340. package/lib/module/components/Common/BaseOfferCard/Stat/Stat.js.map +1 -1
  341. package/lib/module/components/Common/BaseOfferCard/index.js +3 -4
  342. package/lib/module/components/Common/BaseOfferCard/index.js.map +1 -1
  343. package/lib/module/components/DynamicOffers/DynamicOffers.js +1 -1
  344. package/lib/module/components/DynamicOffers/DynamicOffers.js.map +1 -1
  345. package/lib/module/components/DynamicOffers/Render/DynamicOffersRender.js +1 -1
  346. package/lib/module/components/DynamicOffers/Render/DynamicOffersRender.js.map +1 -1
  347. package/lib/module/components/Layouts/CreditCardOfferCard/statsBuilder.js +1 -1
  348. package/lib/module/components/Layouts/CreditCardOfferCard/statsBuilder.js.map +1 -1
  349. package/lib/module/components/Layouts/DefaultOfferCard/statsBuilder.js +1 -1
  350. package/lib/module/components/Layouts/DefaultOfferCard/statsBuilder.js.map +1 -1
  351. package/lib/module/components/Modal/DescriptionPoints.js +2 -2
  352. package/lib/module/components/Modal/DescriptionPoints.js.map +1 -1
  353. package/lib/module/components/Modal/Disclaimer.js +1 -1
  354. package/lib/module/components/Modal/Disclaimer.js.map +1 -1
  355. package/lib/module/components/MoneyLionOfferCarousel.js +1 -1
  356. package/lib/module/components/MoneyLionOfferCarousel.js.map +1 -1
  357. package/lib/module/config/mocks/cnfContext.js +137 -0
  358. package/lib/module/config/mocks/cnfContext.js.map +1 -0
  359. package/lib/module/pageData.js +1 -1
  360. package/lib/module/pageData.js.map +1 -1
  361. package/lib/module/services/getProductTypesByQuery.js +1 -1
  362. package/lib/module/services/getProductTypesByQuery.js.map +1 -1
  363. package/lib/module/utils/formatOfferUrl.js +1 -1
  364. package/lib/module/utils/formatOfferUrl.js.map +1 -1
  365. package/lib/module/utils/getOffersByProductTypes.js +2 -2
  366. package/lib/module/utils/getOffersByProductTypes.js.map +1 -1
  367. package/lib/typescript/src/builder/builder.d.ts.map +1 -0
  368. package/lib/typescript/src/builder/config/types.d.ts.map +1 -0
  369. package/lib/typescript/src/builder/index.d.ts.map +1 -0
  370. package/lib/typescript/src/capabilities/configuration/src/brands/checkVisualEligibility.d.ts.map +1 -0
  371. package/lib/typescript/src/capabilities/configuration/src/brands/createDerivedBrands.d.ts.map +1 -0
  372. package/lib/typescript/src/capabilities/configuration/src/brands/index.d.ts.map +1 -0
  373. package/lib/typescript/src/capabilities/configuration/src/brands/types.d.ts.map +1 -0
  374. package/lib/typescript/src/capabilities/core/src/domain/third-party-search/index.d.ts.map +1 -0
  375. package/lib/typescript/src/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.d.ts.map +1 -0
  376. package/lib/typescript/src/capabilities/core/src/index.d.ts.map +1 -0
  377. package/lib/typescript/src/capabilities/core/src/system/cnfContext/CnfContext.d.ts.map +1 -0
  378. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/App.d.ts.map +1 -0
  379. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts.map +1 -0
  380. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Configuration.d.ts.map +1 -0
  381. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Request.d.ts.map +1 -0
  382. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Session.d.ts.map +1 -0
  383. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Signals.d.ts.map +1 -0
  384. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Subaccount.d.ts.map +1 -0
  385. package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/index.d.ts.map +1 -0
  386. package/lib/typescript/src/capabilities/offer-catalog/src/api/offerCatalogApi.d.ts.map +1 -0
  387. package/lib/typescript/src/capabilities/offer-catalog/src/index.d.ts.map +1 -0
  388. package/lib/typescript/src/capabilities/offer-catalog/src/types/offerCatalogSchema.d.ts.map +1 -0
  389. package/lib/typescript/src/capabilities/offer-catalog/src/utils/arrayToMarkdownList.d.ts.map +1 -0
  390. package/lib/typescript/src/capabilities/offer-catalog/src/utils/contextUtil.d.ts.map +1 -0
  391. package/lib/typescript/src/capabilities/offer-catalog/src/utils/errorUtil.d.ts.map +1 -0
  392. package/lib/typescript/src/capabilities/offer-catalog/src/utils/formatUtils.d.ts.map +1 -0
  393. package/lib/typescript/src/capabilities/offer-catalog/src/utils/getOfferUrl.d.ts.map +1 -0
  394. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.d.ts.map +1 -0
  395. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/boolean.d.ts.map +1 -0
  396. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.d.ts.map +1 -0
  397. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/common.d.ts.map +1 -0
  398. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.d.ts.map +1 -0
  399. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.d.ts.map +1 -0
  400. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.d.ts.map +1 -0
  401. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/currency.d.ts.map +1 -0
  402. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.d.ts.map +1 -0
  403. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.d.ts.map +1 -0
  404. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.d.ts.map +1 -0
  405. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.d.ts.map +1 -0
  406. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.d.ts.map +1 -0
  407. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.d.ts.map +1 -0
  408. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/index.d.ts.map +1 -0
  409. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.d.ts.map +1 -0
  410. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.d.ts.map +1 -0
  411. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/percentage.d.ts.map +1 -0
  412. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.d.ts.map +1 -0
  413. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.d.ts.map +1 -0
  414. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.d.ts.map +1 -0
  415. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.d.ts.map +1 -0
  416. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.d.ts.map +1 -0
  417. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.d.ts.map +1 -0
  418. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.d.ts.map +1 -0
  419. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.d.ts.map +1 -0
  420. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.d.ts.map +1 -0
  421. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.d.ts.map +1 -0
  422. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.d.ts.map +1 -0
  423. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.d.ts.map +1 -0
  424. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.d.ts.map +1 -0
  425. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.d.ts.map +1 -0
  426. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.d.ts.map +1 -0
  427. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.d.ts.map +1 -0
  428. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/index.d.ts.map +1 -0
  429. package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/types.d.ts.map +1 -0
  430. package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.d.ts.map +1 -0
  431. package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.d.ts.map +1 -0
  432. package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/types/index.d.ts.map +1 -0
  433. package/lib/typescript/{capabilities → src/capabilities}/offers/pipeline/src/sources/ratetables/withDeviceSignals.d.ts +9 -9
  434. package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.d.ts.map +1 -0
  435. package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.d.ts.map +1 -0
  436. package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/MarkdownText/components.d.ts +1 -1
  437. package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/components.d.ts.map +1 -0
  438. package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/MarkdownText/index.d.ts +1 -1
  439. package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/index.d.ts.map +1 -0
  440. package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.d.ts.map +1 -0
  441. package/lib/typescript/src/capabilities/ui/elements/src/components/index.d.ts.map +1 -0
  442. package/lib/typescript/src/capabilities/ui/elements/src/components/thumbor/index.d.ts.map +1 -0
  443. package/lib/typescript/src/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.d.ts.map +1 -0
  444. package/lib/typescript/src/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.d.ts.map +1 -0
  445. package/lib/typescript/src/capabilities/ui/elements/src/index.d.ts.map +1 -0
  446. package/lib/typescript/src/capabilities/ui/elements/src/offerCardAttributes.d.ts.map +1 -0
  447. package/lib/typescript/src/components/Cards/VideosCard/VideoContent.d.ts +0 -8
  448. package/lib/typescript/src/components/Cards/VideosCard/VideoContent.d.ts.map +1 -1
  449. package/lib/typescript/src/components/Common/BaseOfferCard/Stat/Stat.d.ts +5 -1
  450. package/lib/typescript/src/components/Common/BaseOfferCard/Stat/Stat.d.ts.map +1 -1
  451. package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts +2 -2
  452. package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts.map +1 -1
  453. package/lib/typescript/src/components/Common/DynamicOfferCard/CallToAction.d.ts +1 -1
  454. package/lib/typescript/src/components/Common/DynamicOfferCard/CallToAction.d.ts.map +1 -1
  455. package/lib/typescript/src/components/Common/DynamicOfferCard/SeeMore.d.ts +1 -1
  456. package/lib/typescript/src/components/Common/DynamicOfferCard/SeeMore.d.ts.map +1 -1
  457. package/lib/typescript/src/components/Common/DynamicOfferCard/index.d.ts +1 -1
  458. package/lib/typescript/src/components/Common/DynamicOfferCard/index.d.ts.map +1 -1
  459. package/lib/typescript/src/components/DynamicOffers/Render/DynamicOffersRender.d.ts +2 -2
  460. package/lib/typescript/src/components/DynamicOffers/Render/DynamicOffersRender.d.ts.map +1 -1
  461. package/lib/typescript/src/components/DynamicOffers/Render/FallbackOfferTemplate.d.ts +1 -1
  462. package/lib/typescript/src/components/DynamicOffers/Render/FallbackOfferTemplate.d.ts.map +1 -1
  463. package/lib/typescript/src/components/DynamicOffers/Render/Offer.d.ts +2 -2
  464. package/lib/typescript/src/components/DynamicOffers/Render/Offer.d.ts.map +1 -1
  465. package/lib/typescript/src/components/Layouts/CreditCardOfferCard/index.d.ts +2 -2
  466. package/lib/typescript/src/components/Layouts/CreditCardOfferCard/index.d.ts.map +1 -1
  467. package/lib/typescript/src/components/Layouts/CreditCardOfferCard/statsBuilder.d.ts +3 -3
  468. package/lib/typescript/src/components/Layouts/CreditCardOfferCard/statsBuilder.d.ts.map +1 -1
  469. package/lib/typescript/src/components/Layouts/DefaultOfferCard/index.d.ts +2 -2
  470. package/lib/typescript/src/components/Layouts/DefaultOfferCard/index.d.ts.map +1 -1
  471. package/lib/typescript/src/components/Layouts/DefaultOfferCard/statsBuilder.d.ts +4 -4
  472. package/lib/typescript/src/components/Layouts/DefaultOfferCard/statsBuilder.d.ts.map +1 -1
  473. package/lib/typescript/src/components/Layouts/HeadlineWithDescriptionCard/index.d.ts +2 -2
  474. package/lib/typescript/src/components/Layouts/HeadlineWithDescriptionCard/index.d.ts.map +1 -1
  475. package/lib/typescript/src/components/Modal/OfferDetailsModal.d.ts +1 -1
  476. package/lib/typescript/src/components/Modal/OfferDetailsModal.d.ts.map +1 -1
  477. package/lib/typescript/src/config/mocks/cnfContext.d.ts.map +1 -0
  478. package/lib/typescript/src/context/EventHandlerProvider.d.ts +1 -1
  479. package/lib/typescript/src/context/EventHandlerProvider.d.ts.map +1 -1
  480. package/lib/typescript/src/pageData.d.ts +2 -2
  481. package/lib/typescript/src/pageData.d.ts.map +1 -1
  482. package/lib/typescript/src/services/getDynamicOffers.d.ts +3 -3
  483. package/lib/typescript/src/services/getDynamicOffers.d.ts.map +1 -1
  484. package/lib/typescript/src/utils/addClientTagsToOfferLinks.d.ts +1 -1
  485. package/lib/typescript/src/utils/addClientTagsToOfferLinks.d.ts.map +1 -1
  486. package/lib/typescript/src/utils/formatOfferUrl.d.ts +1 -1
  487. package/lib/typescript/src/utils/formatOfferUrl.d.ts.map +1 -1
  488. package/lib/typescript/src/utils/getDefaultProductType.d.ts +1 -1
  489. package/lib/typescript/src/utils/getDefaultProductType.d.ts.map +1 -1
  490. package/lib/typescript/src/utils/getEnableUseCachedOffers.d.ts +1 -1
  491. package/lib/typescript/src/utils/getEnableUseCachedOffers.d.ts.map +1 -1
  492. package/lib/typescript/src/utils/getOffersBasedOnLayout.d.ts +1 -1
  493. package/lib/typescript/src/utils/getOffersBasedOnLayout.d.ts.map +1 -1
  494. package/lib/typescript/src/utils/getOffersByProductTypes.d.ts +2 -2
  495. package/lib/typescript/src/utils/getOffersByProductTypes.d.ts.map +1 -1
  496. package/lib/typescript/src/utils/getProductTypesDefinition.d.ts +1 -1
  497. package/lib/typescript/src/utils/getProductTypesDefinition.d.ts.map +1 -1
  498. package/lib/typescript/src/utils/selectDynamicOffers.d.ts +1 -1
  499. package/lib/typescript/src/utils/selectDynamicOffers.d.ts.map +1 -1
  500. package/lib/typescript/src/utils/sortOffersByRecommendationScore.d.ts +1 -1
  501. package/lib/typescript/src/utils/sortOffersByRecommendationScore.d.ts.map +1 -1
  502. package/package.json +1 -7
  503. package/src/builder/builder.ts +500 -0
  504. package/src/builder/config/types.ts +107 -0
  505. package/src/builder/index.ts +2 -0
  506. package/src/capabilities/configuration/src/brands/checkVisualEligibility.ts +29 -0
  507. package/src/capabilities/configuration/src/brands/createDerivedBrands.ts +39 -0
  508. package/src/capabilities/configuration/src/brands/index.ts +2 -0
  509. package/src/capabilities/configuration/src/brands/types.ts +8 -0
  510. package/src/capabilities/core/src/domain/third-party-search/index.ts +1 -0
  511. package/src/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.ts +33 -0
  512. package/src/capabilities/core/src/index.ts +1 -0
  513. package/src/capabilities/core/src/system/cnfContext/CnfContext.ts +21 -0
  514. package/src/capabilities/core/src/system/cnfContext/schemas/App.ts +13 -0
  515. package/src/capabilities/core/src/system/cnfContext/schemas/Brand.ts +119 -0
  516. package/src/capabilities/core/src/system/cnfContext/schemas/Configuration.ts +49 -0
  517. package/src/capabilities/core/src/system/cnfContext/schemas/Request.ts +16 -0
  518. package/src/capabilities/core/src/system/cnfContext/schemas/Session.ts +9 -0
  519. package/src/capabilities/core/src/system/cnfContext/schemas/Signals.ts +47 -0
  520. package/src/capabilities/core/src/system/cnfContext/schemas/Subaccount.ts +25 -0
  521. package/src/capabilities/core/src/system/cnfContext/schemas/index.ts +7 -0
  522. package/src/capabilities/offer-catalog/src/api/offerCatalogApi.ts +171 -0
  523. package/src/capabilities/offer-catalog/src/index.ts +10 -0
  524. package/src/capabilities/offer-catalog/src/types/offerCatalogSchema.ts +119 -0
  525. package/src/capabilities/offer-catalog/src/utils/arrayToMarkdownList.ts +3 -0
  526. package/src/capabilities/offer-catalog/src/utils/contextUtil.ts +73 -0
  527. package/src/capabilities/offer-catalog/src/utils/errorUtil.ts +18 -0
  528. package/src/capabilities/offer-catalog/src/utils/formatUtils.ts +168 -0
  529. package/src/capabilities/offer-catalog/src/utils/getOfferUrl.ts +61 -0
  530. package/src/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.ts +103 -0
  531. package/src/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.ts +58 -0
  532. package/src/capabilities/offer-catalog/src/utils/stats/formatters/boolean.ts +31 -0
  533. package/src/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.ts +60 -0
  534. package/src/capabilities/offer-catalog/src/utils/stats/formatters/common.ts +31 -0
  535. package/src/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.ts +29 -0
  536. package/src/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.ts +36 -0
  537. package/src/capabilities/offer-catalog/src/utils/stats/formatters/currency.ts +24 -0
  538. package/src/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.ts +206 -0
  539. package/src/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.ts +83 -0
  540. package/src/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.ts +22 -0
  541. package/src/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.ts +25 -0
  542. package/src/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.ts +38 -0
  543. package/src/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.ts +24 -0
  544. package/src/capabilities/offer-catalog/src/utils/stats/formatters/index.ts +19 -0
  545. package/src/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.ts +41 -0
  546. package/src/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.ts +52 -0
  547. package/src/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.ts +30 -0
  548. package/src/capabilities/offer-catalog/src/utils/stats/formatters/percentage.ts +23 -0
  549. package/src/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.ts +67 -0
  550. package/src/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.ts +92 -0
  551. package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.ts +34 -0
  552. package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.ts +70 -0
  553. package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.ts +71 -0
  554. package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.ts +27 -0
  555. package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.ts +38 -0
  556. package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.ts +44 -0
  557. package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.ts +68 -0
  558. package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.ts +81 -0
  559. package/src/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.ts +38 -0
  560. package/src/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.ts +26 -0
  561. package/src/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.ts +45 -0
  562. package/src/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.ts +28 -0
  563. package/src/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.ts +23 -0
  564. package/src/capabilities/offer-catalog/src/utils/stats/index.ts +141 -0
  565. package/src/capabilities/offer-catalog/src/utils/stats/types.ts +47 -0
  566. package/src/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.ts +6 -0
  567. package/src/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.ts +2272 -0
  568. package/src/capabilities/offers/pipeline/src/sources/ratetables/types/PublicApi.d.ts +1924 -0
  569. package/src/capabilities/offers/pipeline/src/sources/ratetables/types/index.ts +5 -0
  570. package/src/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.ts +83 -0
  571. package/src/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.tsx +66 -0
  572. package/src/capabilities/ui/elements/src/components/MarkdownText/components.tsx +174 -0
  573. package/src/capabilities/ui/elements/src/components/MarkdownText/index.tsx +52 -0
  574. package/src/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.ts +124 -0
  575. package/src/capabilities/ui/elements/src/components/index.ts +1 -0
  576. package/src/capabilities/ui/elements/src/components/thumbor/index.tsx +115 -0
  577. package/src/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.ts +42 -0
  578. package/src/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.ts +110 -0
  579. package/src/capabilities/ui/elements/src/index.ts +3 -0
  580. package/src/capabilities/ui/elements/src/offerCardAttributes.ts +28 -0
  581. package/src/components/Cards/VideosCard/VideoContent.tsx +32 -34
  582. package/src/components/Cards/VideosCard/VideosCard.tsx +1 -1
  583. package/src/components/Common/BaseOfferCard/Stat/Stat.tsx +7 -2
  584. package/src/components/Common/BaseOfferCard/index.tsx +3 -4
  585. package/src/components/Common/DynamicOfferCard/CallToAction.tsx +1 -1
  586. package/src/components/Common/DynamicOfferCard/SeeMore.tsx +1 -1
  587. package/src/components/Common/DynamicOfferCard/index.tsx +1 -1
  588. package/src/components/DynamicOffers/DynamicOffers.tsx +1 -1
  589. package/src/components/DynamicOffers/Render/DynamicOffersRender.tsx +2 -2
  590. package/src/components/DynamicOffers/Render/FallbackOfferTemplate.tsx +1 -1
  591. package/src/components/DynamicOffers/Render/Offer.tsx +2 -2
  592. package/src/components/Layouts/CreditCardOfferCard/index.tsx +2 -2
  593. package/src/components/Layouts/CreditCardOfferCard/statsBuilder.tsx +3 -3
  594. package/src/components/Layouts/DefaultOfferCard/index.tsx +2 -2
  595. package/src/components/Layouts/DefaultOfferCard/statsBuilder.tsx +3 -3
  596. package/src/components/Layouts/HeadlineWithDescriptionCard/index.tsx +2 -2
  597. package/src/components/Modal/DescriptionPoints.tsx +2 -2
  598. package/src/components/Modal/Disclaimer.tsx +1 -1
  599. package/src/components/Modal/OfferDetailsModal.tsx +1 -1
  600. package/src/components/MoneyLionOfferCarousel.tsx +2 -2
  601. package/src/config/mocks/cnfContext.ts +136 -0
  602. package/src/context/EventHandlerProvider.tsx +1 -1
  603. package/src/pageData.ts +2 -2
  604. package/src/services/getDynamicOffers.ts +2 -2
  605. package/src/services/getProductTypesByQuery.ts +1 -1
  606. package/src/utils/addClientTagsToOfferLinks.ts +1 -1
  607. package/src/utils/formatOfferUrl.ts +1 -1
  608. package/src/utils/getDefaultProductType.ts +1 -1
  609. package/src/utils/getEnableUseCachedOffers.ts +1 -1
  610. package/src/utils/getOffersBasedOnLayout.ts +1 -1
  611. package/src/utils/getOffersByProductTypes.ts +3 -3
  612. package/src/utils/getProductTypesDefinition.ts +1 -1
  613. package/src/utils/selectDynamicOffers.ts +1 -1
  614. package/src/utils/sortOffersByRecommendationScore.ts +1 -1
  615. package/lib/typescript/builder/builder.d.ts.map +0 -1
  616. package/lib/typescript/builder/config/types.d.ts.map +0 -1
  617. package/lib/typescript/builder/index.d.ts.map +0 -1
  618. package/lib/typescript/capabilities/configuration/src/brands/checkVisualEligibility.d.ts.map +0 -1
  619. package/lib/typescript/capabilities/configuration/src/brands/createDerivedBrands.d.ts.map +0 -1
  620. package/lib/typescript/capabilities/configuration/src/brands/index.d.ts.map +0 -1
  621. package/lib/typescript/capabilities/configuration/src/brands/types.d.ts.map +0 -1
  622. package/lib/typescript/capabilities/core/src/domain/third-party-search/index.d.ts.map +0 -1
  623. package/lib/typescript/capabilities/core/src/domain/third-party-search/orderProductTypesByRankUtils.d.ts.map +0 -1
  624. package/lib/typescript/capabilities/core/src/index.d.ts.map +0 -1
  625. package/lib/typescript/capabilities/core/src/system/cnfContext/CnfContext.d.ts.map +0 -1
  626. package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/App.d.ts.map +0 -1
  627. package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts.map +0 -1
  628. package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Configuration.d.ts.map +0 -1
  629. package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Request.d.ts.map +0 -1
  630. package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Session.d.ts.map +0 -1
  631. package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Signals.d.ts.map +0 -1
  632. package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Subaccount.d.ts.map +0 -1
  633. package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/index.d.ts.map +0 -1
  634. package/lib/typescript/capabilities/offer-catalog/src/api/offerCatalogApi.d.ts.map +0 -1
  635. package/lib/typescript/capabilities/offer-catalog/src/index.d.ts.map +0 -1
  636. package/lib/typescript/capabilities/offer-catalog/src/types/offerCatalogSchema.d.ts.map +0 -1
  637. package/lib/typescript/capabilities/offer-catalog/src/utils/arrayToMarkdownList.d.ts.map +0 -1
  638. package/lib/typescript/capabilities/offer-catalog/src/utils/contextUtil.d.ts.map +0 -1
  639. package/lib/typescript/capabilities/offer-catalog/src/utils/errorUtil.d.ts.map +0 -1
  640. package/lib/typescript/capabilities/offer-catalog/src/utils/formatUtils.d.ts.map +0 -1
  641. package/lib/typescript/capabilities/offer-catalog/src/utils/getOfferUrl.d.ts.map +0 -1
  642. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.d.ts.map +0 -1
  643. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/boolean.d.ts.map +0 -1
  644. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/boolean.spec.d.ts.map +0 -1
  645. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/common.d.ts.map +0 -1
  646. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/common.spec.d.ts.map +0 -1
  647. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.d.ts.map +0 -1
  648. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.d.ts.map +0 -1
  649. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/currency.d.ts.map +0 -1
  650. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.d.ts.map +0 -1
  651. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.d.ts.map +0 -1
  652. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.d.ts.map +0 -1
  653. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.d.ts.map +0 -1
  654. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.d.ts.map +0 -1
  655. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.d.ts.map +0 -1
  656. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/index.d.ts.map +0 -1
  657. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.d.ts.map +0 -1
  658. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.d.ts.map +0 -1
  659. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/percentage.d.ts.map +0 -1
  660. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/percentage.spec.d.ts.map +0 -1
  661. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.d.ts.map +0 -1
  662. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.d.ts.map +0 -1
  663. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.d.ts.map +0 -1
  664. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.d.ts.map +0 -1
  665. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.d.ts.map +0 -1
  666. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.d.ts.map +0 -1
  667. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.d.ts.map +0 -1
  668. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.d.ts.map +0 -1
  669. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.d.ts.map +0 -1
  670. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.d.ts.map +0 -1
  671. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.spec.d.ts.map +0 -1
  672. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.d.ts.map +0 -1
  673. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.d.ts.map +0 -1
  674. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.d.ts.map +0 -1
  675. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.d.ts.map +0 -1
  676. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/index.d.ts.map +0 -1
  677. package/lib/typescript/capabilities/offer-catalog/src/utils/stats/types.d.ts.map +0 -1
  678. package/lib/typescript/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.d.ts.map +0 -1
  679. package/lib/typescript/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.d.ts.map +0 -1
  680. package/lib/typescript/capabilities/offers/pipeline/src/sources/ratetables/types/index.d.ts.map +0 -1
  681. package/lib/typescript/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.d.ts.map +0 -1
  682. package/lib/typescript/capabilities/offers/ux/src/elements/Stat/HyphenIcon.d.ts +0 -7
  683. package/lib/typescript/capabilities/offers/ux/src/elements/Stat/HyphenIcon.d.ts.map +0 -1
  684. package/lib/typescript/capabilities/offers/ux/src/elements/Stat/Stat.d.ts +0 -12
  685. package/lib/typescript/capabilities/offers/ux/src/elements/Stat/Stat.d.ts.map +0 -1
  686. package/lib/typescript/capabilities/offers/ux/src/elements/Stat/index.d.ts +0 -2
  687. package/lib/typescript/capabilities/offers/ux/src/elements/Stat/index.d.ts.map +0 -1
  688. package/lib/typescript/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.d.ts.map +0 -1
  689. package/lib/typescript/capabilities/ui/elements/src/components/MarkdownText/components.d.ts.map +0 -1
  690. package/lib/typescript/capabilities/ui/elements/src/components/MarkdownText/index.d.ts.map +0 -1
  691. package/lib/typescript/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.d.ts.map +0 -1
  692. package/lib/typescript/capabilities/ui/elements/src/components/index.d.ts.map +0 -1
  693. package/lib/typescript/capabilities/ui/elements/src/components/thumbor/index.d.ts.map +0 -1
  694. package/lib/typescript/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.d.ts.map +0 -1
  695. package/lib/typescript/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.test.d.ts.map +0 -1
  696. package/lib/typescript/capabilities/ui/elements/src/index.d.ts.map +0 -1
  697. package/lib/typescript/capabilities/ui/elements/src/offerCardAttributes.d.ts.map +0 -1
  698. package/lib/typescript/config/mocks/cnfContext.d.ts.map +0 -1
  699. /package/lib/typescript/{builder → src/builder}/builder.d.ts +0 -0
  700. /package/lib/typescript/{builder → src/builder}/config/types.d.ts +0 -0
  701. /package/lib/typescript/{builder → src/builder}/index.d.ts +0 -0
  702. /package/lib/typescript/{capabilities → src/capabilities}/configuration/src/brands/checkVisualEligibility.d.ts +0 -0
  703. /package/lib/typescript/{capabilities → src/capabilities}/configuration/src/brands/createDerivedBrands.d.ts +0 -0
  704. /package/lib/typescript/{capabilities → src/capabilities}/configuration/src/brands/index.d.ts +0 -0
  705. /package/lib/typescript/{capabilities → src/capabilities}/configuration/src/brands/types.d.ts +0 -0
  706. /package/lib/typescript/{capabilities → src/capabilities}/core/src/domain/third-party-search/index.d.ts +0 -0
  707. /package/lib/typescript/{capabilities → src/capabilities}/core/src/domain/third-party-search/orderProductTypesByRankUtils.d.ts +0 -0
  708. /package/lib/typescript/{capabilities → src/capabilities}/core/src/index.d.ts +0 -0
  709. /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/CnfContext.d.ts +0 -0
  710. /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/App.d.ts +0 -0
  711. /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/Brand.d.ts +0 -0
  712. /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/Configuration.d.ts +0 -0
  713. /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/Request.d.ts +0 -0
  714. /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/Session.d.ts +0 -0
  715. /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/Signals.d.ts +0 -0
  716. /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/Subaccount.d.ts +0 -0
  717. /package/lib/typescript/{capabilities → src/capabilities}/core/src/system/cnfContext/schemas/index.d.ts +0 -0
  718. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/api/offerCatalogApi.d.ts +0 -0
  719. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/index.d.ts +0 -0
  720. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/types/offerCatalogSchema.d.ts +0 -0
  721. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/arrayToMarkdownList.d.ts +0 -0
  722. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/contextUtil.d.ts +0 -0
  723. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/errorUtil.d.ts +0 -0
  724. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/formatUtils.d.ts +0 -0
  725. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/getOfferUrl.d.ts +0 -0
  726. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/annualFee.d.ts +0 -0
  727. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/boolean.d.ts +0 -0
  728. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/boolean.spec.d.ts +0 -0
  729. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/common.d.ts +0 -0
  730. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/common.spec.d.ts +0 -0
  731. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/creditBureaus.d.ts +0 -0
  732. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/creditBureaus.spec.d.ts +0 -0
  733. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/currency.d.ts +0 -0
  734. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/currencyOrBasis.d.ts +0 -0
  735. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/currencyOrBasis.spec.d.ts +0 -0
  736. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/freeTrialDays.d.ts +0 -0
  737. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/freeTrialDays.spec.d.ts +0 -0
  738. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.d.ts +0 -0
  739. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.spec.d.ts +0 -0
  740. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/index.d.ts +0 -0
  741. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.d.ts +0 -0
  742. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.spec.d.ts +0 -0
  743. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/percentage.d.ts +0 -0
  744. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/percentage.spec.d.ts +0 -0
  745. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/purchaseApr.d.ts +0 -0
  746. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/purchaseApr.spec.d.ts +0 -0
  747. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeCurrency.d.ts +0 -0
  748. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.d.ts +0 -0
  749. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.spec.d.ts +0 -0
  750. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.d.ts +0 -0
  751. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.spec.d.ts +0 -0
  752. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeMonths.d.ts +0 -0
  753. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangeMonths.spec.d.ts +0 -0
  754. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangePercent.d.ts +0 -0
  755. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rangePercent.spec.d.ts +0 -0
  756. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/recommendedCredit.d.ts +0 -0
  757. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/recommendedCredit.spec.d.ts +0 -0
  758. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rewardsDisplay.d.ts +0 -0
  759. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/formatters/rewardsDisplay.spec.d.ts +0 -0
  760. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/index.d.ts +0 -0
  761. /package/lib/typescript/{capabilities → src/capabilities}/offer-catalog/src/utils/stats/types.d.ts +0 -0
  762. /package/lib/typescript/{capabilities → src/capabilities}/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.d.ts +0 -0
  763. /package/lib/typescript/{capabilities → src/capabilities}/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.d.ts +0 -0
  764. /package/lib/typescript/{capabilities → src/capabilities}/offers/pipeline/src/sources/ratetables/types/index.d.ts +0 -0
  765. /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/MarkdownText/Abbreviation.d.ts +0 -0
  766. /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/MarkdownText/markdownPreprocessor.d.ts +0 -0
  767. /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/index.d.ts +0 -0
  768. /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/thumbor/index.d.ts +0 -0
  769. /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/thumbor/useSvgUriViewBox.d.ts +0 -0
  770. /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/components/thumbor/useSvgUriViewBox.test.d.ts +0 -0
  771. /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/index.d.ts +0 -0
  772. /package/lib/typescript/{capabilities → src/capabilities}/ui/elements/src/offerCardAttributes.d.ts +0 -0
  773. /package/lib/typescript/{config → src/config}/mocks/cnfContext.d.ts +0 -0
@@ -0,0 +1,92 @@
1
+ import { get } from "radash";
2
+ import { P, match } from "ts-pattern";
3
+ import type { StatElementProps } from "../types";
4
+ import { formatRange } from "../../formatUtils";
5
+ import type { BaseOffer } from "../../../types/offerCatalogSchema";
6
+
7
+ export type PurchaseAprStat = {
8
+ format: "purchaseApr";
9
+ label: string;
10
+ purchaseAprTextField: string;
11
+ minPurchaseAprField: string;
12
+ maxPurchaseAprField: string;
13
+ aprTypeField: string;
14
+ };
15
+
16
+ /**
17
+ * Determine the content of the purchaseApr stat
18
+ * @param params {purchaseAprValue, minPurchaseAprValue, maxPurchaseAprValue}
19
+ * @returns {string}
20
+ * @example
21
+ * determineContent({ purchaseAprValue: '10%', minPurchaseAprValue: null, maxPurchaseAprValue: null })
22
+ * // returns '10%'
23
+ * determineContent({ purchaseAprValue: null, minPurchaseAprValue: 5, maxPurchaseAprValue: 10 })
24
+ * // returns '5% - 10%'
25
+ * determineContent({ purchaseAprValue: null, minPurchaseAprValue: null, maxPurchaseAprValue: null })
26
+ * // returns 'See Terms'
27
+ */
28
+ const determineContent = ({
29
+ purchaseAprValue,
30
+ minPurchaseAprValue,
31
+ maxPurchaseAprValue,
32
+ }: {
33
+ purchaseAprValue?: string;
34
+ minPurchaseAprValue?: number;
35
+ maxPurchaseAprValue?: number;
36
+ }) => {
37
+ return match({ purchaseAprValue, minPurchaseAprValue, maxPurchaseAprValue })
38
+ .with(
39
+ { purchaseAprValue: P.not(undefined) },
40
+ ({ purchaseAprValue }) => purchaseAprValue
41
+ )
42
+ .with(
43
+ {
44
+ minPurchaseAprValue: P.not(undefined),
45
+ maxPurchaseAprValue: P.not(undefined),
46
+ },
47
+ ({ minPurchaseAprValue, maxPurchaseAprValue }) =>
48
+ formatRange(minPurchaseAprValue, maxPurchaseAprValue, "percentage")
49
+ )
50
+ .otherwise(() => "See Terms");
51
+ };
52
+
53
+ /**
54
+ * Determine the label of the purchaseApr stat
55
+ * @param aprType {string}
56
+ * @param label {string}
57
+ * @returns {string}
58
+ */
59
+ const determineLabel = (aprType: string, label: string) => {
60
+ return match(aprType)
61
+ .with("variable", () => "Variable APR:")
62
+ .with("fixed", () => "Fixed APR:")
63
+ .otherwise(() => label);
64
+ };
65
+
66
+ export const purchaseApr =
67
+ (offer: BaseOffer) =>
68
+ ({
69
+ label: defaultLabel,
70
+ purchaseAprTextField,
71
+ minPurchaseAprField,
72
+ maxPurchaseAprField,
73
+ aprTypeField,
74
+ }: PurchaseAprStat): StatElementProps => {
75
+ const purchaseAprValue = get<string>(offer, purchaseAprTextField);
76
+ const minPurchaseAprValue = get<number>(offer, minPurchaseAprField);
77
+ const maxPurchaseAprValue = get<number>(offer, maxPurchaseAprField);
78
+ const aprTypeValue = get<string>(offer, aprTypeField);
79
+
80
+ const content = determineContent({
81
+ purchaseAprValue,
82
+ minPurchaseAprValue,
83
+ maxPurchaseAprValue,
84
+ }).replace(/ Variable APR| Fixed APR/g, "");
85
+
86
+ const label = determineLabel(aprTypeValue, defaultLabel);
87
+
88
+ return {
89
+ label,
90
+ content,
91
+ };
92
+ };
@@ -0,0 +1,34 @@
1
+
2
+ import { get } from "radash";
3
+ import type { StatElementProps } from "../types";
4
+ import type { BaseOffer } from "../../../types/offerCatalogSchema";
5
+ import { formatRange } from "../../formatUtils";
6
+
7
+ export type RangeCurrencyStat = {
8
+ format: "rangeCurrency";
9
+ label: string;
10
+ initialFieldName: string;
11
+ endFieldName: string;
12
+ };
13
+
14
+ export const fromRangeCurrencyStat =
15
+ (offer: BaseOffer) =>
16
+ ({
17
+ label,
18
+ initialFieldName,
19
+ endFieldName,
20
+ }: RangeCurrencyStat): StatElementProps => {
21
+ const initialValue = get<number | undefined>(
22
+ offer,
23
+ initialFieldName,
24
+ undefined
25
+ );
26
+ const endValue = get<number | undefined>(offer, endFieldName, undefined);
27
+
28
+ const content = formatRange(initialValue, endValue, "amount");
29
+
30
+ return {
31
+ label,
32
+ content,
33
+ };
34
+ };
@@ -0,0 +1,70 @@
1
+ // import type { BaseOffer } from '@capabilities/offer-catalog'
2
+ // import { fromRangeCurrencyByTimeStat } from './rangeCurrencyByTime'
3
+
4
+ // describe('fromRangeCurrencyByTimeStat', () => {
5
+ // it.each([
6
+ // // Test case: All values undefined
7
+ // [{}, 'Price Range', 'N/A'],
8
+ // // Test case: All values zero
9
+ // [
10
+ // {
11
+ // initialPriceByMonth: 0,
12
+ // endPriceByMonth: 0,
13
+ // initialPriceByYear: 0,
14
+ // endPriceByYear: 0,
15
+ // },
16
+ // 'Price Range',
17
+ // 'FREE',
18
+ // ],
19
+ // [
20
+ // {
21
+ // initialPriceByYear: 0,
22
+ // endPriceByYear: 0,
23
+ // },
24
+ // 'Price Range',
25
+ // 'FREE',
26
+ // ],
27
+ // [{ initialPriceByMonth: 1000 }, 'Price Range', 'N/A'],
28
+ // [{ endPriceByMonth: 2000 }, 'Price Range', 'N/A'],
29
+ // [
30
+ // { initialPriceByMonth: 1000, endPriceByMonth: 2000 },
31
+ // 'Price Range',
32
+ // '$10 - $20 / Month',
33
+ // ],
34
+ // [{ initialPriceByYear: 500 }, 'Discount Range', 'N/A'],
35
+ // [{ endPriceByYear: 1500 }, 'Discount Range', 'N/A'],
36
+ // [
37
+ // { initialPriceByYear: 500, endPriceByYear: 1500 },
38
+ // 'Discount Range',
39
+ // '5% - 15% / Year',
40
+ // ],
41
+ // [
42
+ // {
43
+ // initialPriceByMonth: 1000,
44
+ // endPriceByMonth: 2000,
45
+ // initialPriceByYear: 500,
46
+ // endPriceByYear: 1500,
47
+ // },
48
+ // 'Price Range',
49
+ // '$10 - $20 / Month',
50
+ // ],
51
+ // [{ initialPriceByMonth: 0 }, 'Price Range', 'N/A'],
52
+ // [{ initialPriceByYear: 0 }, 'Price Range', 'N/A'],
53
+ // ])(
54
+ // 'should return the correct content for offer %j',
55
+ // (offer, label, expectedContent) => {
56
+ // const result = fromRangeCurrencyByTimeStat(offer as BaseOffer)({
57
+ // format: 'rangeCurrencyByTime',
58
+ // label,
59
+ // initialFieldNameByMonths: 'initialPriceByMonth',
60
+ // endFieldNameByMonths: 'endPriceByMonth',
61
+ // initialFieldNameByYears: 'initialPriceByYear',
62
+ // endFieldNameByYears: 'endPriceByYear',
63
+ // })
64
+ // expect(result).toEqual({
65
+ // label,
66
+ // content: expectedContent,
67
+ // })
68
+ // },
69
+ // )
70
+ // })
@@ -0,0 +1,71 @@
1
+ import { get } from "radash";
2
+ import type { StatElementProps } from "../types";
3
+ import type { BaseOffer } from "../../../types/offerCatalogSchema";
4
+ import { formatRange } from "../../formatUtils";
5
+
6
+ export type RangeCurrencyByTimeStat = {
7
+ format: "rangeCurrencyByTime";
8
+ label: string;
9
+ initialFieldNameByMonths: string;
10
+ endFieldNameByMonths: string;
11
+ initialFieldNameByYears: string;
12
+ endFieldNameByYears: string;
13
+ };
14
+
15
+ export const fromRangeCurrencyByTimeStat =
16
+ (offer: BaseOffer) =>
17
+ ({
18
+ label,
19
+ initialFieldNameByMonths,
20
+ endFieldNameByMonths,
21
+ initialFieldNameByYears,
22
+ endFieldNameByYears,
23
+ }: RangeCurrencyByTimeStat): StatElementProps => {
24
+ const initialValueByMonths = get<number | undefined>(
25
+ offer,
26
+ initialFieldNameByMonths
27
+ );
28
+ const endValueByMonths = get<number | undefined>(
29
+ offer,
30
+ endFieldNameByMonths
31
+ );
32
+ const initialValueByYears = get<number | undefined>(
33
+ offer,
34
+ initialFieldNameByYears
35
+ );
36
+ const endValueByYears = get<number | undefined>(offer, endFieldNameByYears);
37
+
38
+ const values = [
39
+ initialValueByMonths,
40
+ endValueByMonths,
41
+ initialValueByYears,
42
+ endValueByYears,
43
+ ];
44
+
45
+ const definedValues = values.filter((value) => value !== undefined);
46
+ const definedValuesCount = definedValues.length;
47
+
48
+ if (definedValuesCount < 2) {
49
+ return { label, content: "N/A" };
50
+ }
51
+
52
+ if (definedValues.every((value) => value === 0)) {
53
+ return { label, content: "FREE" };
54
+ }
55
+
56
+ const hasMonthlyValues = initialValueByMonths || endValueByMonths;
57
+
58
+ const initialValue = hasMonthlyValues
59
+ ? initialValueByMonths
60
+ : initialValueByYears;
61
+ const endValue = hasMonthlyValues ? endValueByMonths : endValueByYears;
62
+ const timeUnit = hasMonthlyValues ? "/ Month" : "/ Year";
63
+ const formatType = hasMonthlyValues ? "amount" : "percentage";
64
+
65
+ const content = formatRange(initialValue, endValue, formatType);
66
+
67
+ return {
68
+ label,
69
+ content: `${content} ${timeUnit}`,
70
+ };
71
+ };
@@ -0,0 +1,27 @@
1
+ // import type { BaseOffer } from '@capabilities/offer-catalog'
2
+ // import { describe, expect, it } from 'vitest'
3
+ // import { fromRangeCurrencyUnabbreviatedStat } from './rangeCurrencyUnabbreviated'
4
+
5
+ // describe('fromRangeCurrencyUnabbreviatedStat', () => {
6
+ // it.each([
7
+ // [{ amountCentsMin: 500, amountCentsMax: 500000 }, 'Amount', '$5 - $5,000'],
8
+ // [{ amountCentsMin: 0, amountCentsMax: 500000 }, 'Amount', 'Up to $5,000'],
9
+ // [{ amountCentsMin: 1, amountCentsMax: 500000 }, 'Amount', 'Up to $5,000'],
10
+ // [{ amountCentsMax: 500000 }, 'Amount', 'N/A'],
11
+ // [{ amountCentsMin: 5000 }, 'Amount', 'N/A'],
12
+ // ])(
13
+ // 'should return correct label and content for offer %j',
14
+ // (offer: unknown, label: string, expectedContent: string) => {
15
+ // const result = fromRangeCurrencyUnabbreviatedStat(offer as BaseOffer)({
16
+ // format: 'rangeCurrencyUnabbreviated',
17
+ // label,
18
+ // initialFieldName: 'amountCentsMin',
19
+ // endFieldName: 'amountCentsMax',
20
+ // })
21
+ // expect(result).toEqual({
22
+ // label: 'Amount',
23
+ // content: expectedContent,
24
+ // })
25
+ // },
26
+ // )
27
+ // })
@@ -0,0 +1,38 @@
1
+ import { get } from "radash";
2
+ import type { StatElementProps } from "../types";
3
+ import { formatRange } from "../../formatUtils";
4
+ import type { BaseOffer } from "../../../types/offerCatalogSchema";
5
+
6
+ export type RangeCurrencyUnabbreviatedStat = {
7
+ format: "rangeCurrencyUnabbreviated";
8
+ label: string;
9
+ initialFieldName: string;
10
+ endFieldName: string;
11
+ };
12
+
13
+ export const fromRangeCurrencyUnabbreviatedStat =
14
+ (offer: BaseOffer) =>
15
+ ({
16
+ label,
17
+ initialFieldName,
18
+ endFieldName,
19
+ }: RangeCurrencyUnabbreviatedStat): StatElementProps => {
20
+ const initialValue = get<number | undefined>(
21
+ offer,
22
+ initialFieldName,
23
+ undefined
24
+ );
25
+ const endValue = get<number | undefined>(offer, endFieldName, undefined);
26
+
27
+ const content = formatRange(
28
+ initialValue,
29
+ endValue,
30
+ "amount",
31
+ "unabbreviated"
32
+ );
33
+
34
+ return {
35
+ label,
36
+ content,
37
+ };
38
+ };
@@ -0,0 +1,44 @@
1
+ // import type { BaseOffer } from '@capabilities/offer-catalog'
2
+ // import { describe, expect, it } from 'vitest'
3
+ // import { fromRangeMonthsStat } from './rangeMonths'
4
+
5
+ // describe('fromRangeMonthsStat util', () => {
6
+ // it.each([
7
+ // [{ initialTerm: 0, endTerm: 0 }, 'Term Length', 'OPEN'],
8
+ // [{ initialTerm: 12, endTerm: 12 }, 'Term Length', '1 year'],
9
+ // [{ initialTerm: 18, endTerm: 18 }, 'Term Length', '18 months'],
10
+ // [{ initialTerm: 1, endTerm: 12 }, 'Term Length', '1 - 12 months'],
11
+ // [{ initialTerm: 24, endTerm: 36 }, 'Term Length', '2 - 3 years'],
12
+ // [{ initialTerm: 0, endTerm: 12 }, 'Term Length', '0 - 12 months'],
13
+ // [{ initialTerm: 24, endTerm: 12 }, 'Term Length', 'Invalid case'],
14
+ // ])(
15
+ // 'when initialFieldName is %p and endFieldName is %p, should return %s',
16
+ // (offer: unknown, label: string, expectedContent: string) => {
17
+ // const result = fromRangeMonthsStat(offer as BaseOffer)({
18
+ // label,
19
+ // initialFieldName: 'initialTerm',
20
+ // endFieldName: 'endTerm',
21
+ // format: 'rangeMonths',
22
+ // })
23
+
24
+ // expect(result).toEqual({ label, content: expectedContent })
25
+ // },
26
+ // )
27
+
28
+ // it.each([
29
+ // [{ initialTerm: undefined, endTerm: undefined }, 'Test Label', 'OPEN'],
30
+ // [{ initialTerm: 0, endTerm: undefined }, 'Test Label', 'OPEN'],
31
+ // [{ initialTerm: undefined, endTerm: 12 }, 'Test Label', 'OPEN'],
32
+ // ])(
33
+ // 'should return "-" when initialFieldName or endFieldName is undefined',
34
+ // (offer, label, expectedContent) => {
35
+ // const result = fromRangeMonthsStat(offer as unknown as BaseOffer)({
36
+ // label,
37
+ // initialFieldName: 'initialTerm',
38
+ // endFieldName: 'endTerm',
39
+ // format: 'rangeMonths',
40
+ // })
41
+ // expect(result).toEqual({ label, content: expectedContent })
42
+ // },
43
+ // )
44
+ // })
@@ -0,0 +1,68 @@
1
+ import { get } from "radash";
2
+ import type { StatElementProps } from "../types";
3
+ import type { BaseOffer } from "../../../types/offerCatalogSchema";
4
+
5
+ export type RangeMonthsStat = {
6
+ format: "rangeMonths";
7
+ label: string;
8
+ initialFieldName: string;
9
+ endFieldName: string;
10
+ };
11
+
12
+ const formatTermDuration = (
13
+ months: number,
14
+ unit: "years" | "months"
15
+ ): string => {
16
+ if (unit === "years") {
17
+ return (months / 12).toString();
18
+ }
19
+ return months.toString();
20
+ };
21
+
22
+ const determineUnit = (
23
+ startMonths: number,
24
+ endMonths: number
25
+ ): "years" | "months" => {
26
+ const isNonZeroDivisibleBy12 = (months: number) =>
27
+ months > 0 && months % 12 === 0;
28
+ return isNonZeroDivisibleBy12(startMonths) &&
29
+ isNonZeroDivisibleBy12(endMonths)
30
+ ? "years"
31
+ : "months";
32
+ };
33
+
34
+ export const fromRangeMonthsStat =
35
+ (offer: BaseOffer) =>
36
+ ({
37
+ label,
38
+ initialFieldName,
39
+ endFieldName,
40
+ }: RangeMonthsStat): StatElementProps => {
41
+ const startTermDuration = get<number | undefined>(offer, initialFieldName);
42
+ const endTermDuration = get<number | undefined>(offer, endFieldName);
43
+
44
+ if (
45
+ typeof startTermDuration === "undefined" ||
46
+ typeof endTermDuration === "undefined" ||
47
+ (startTermDuration === 0 && endTermDuration === 0)
48
+ ) {
49
+ return { label, content: "OPEN" };
50
+ }
51
+
52
+ if (startTermDuration > endTermDuration) {
53
+ return { label, content: "Invalid case" };
54
+ }
55
+
56
+ const unit = determineUnit(startTermDuration, endTermDuration);
57
+
58
+ const startFormatted = formatTermDuration(startTermDuration, unit);
59
+ const endFormatted = formatTermDuration(endTermDuration, unit);
60
+
61
+ if (startTermDuration === endTermDuration) {
62
+ const unitLabel =
63
+ unit === "years" && startFormatted === "1" ? "year" : unit;
64
+ return { label, content: `${startFormatted} ${unitLabel}` };
65
+ }
66
+
67
+ return { label, content: `${startFormatted} - ${endFormatted} ${unit}` };
68
+ };
@@ -0,0 +1,81 @@
1
+ // import type { BaseOffer } from '@capabilities/offer-catalog'
2
+ // import { describe, expect, it } from 'vitest'
3
+ // import { fromRangePercentStat } from './rangePercent'
4
+
5
+ // describe('fromRangePercentStat function', () => {
6
+ // it.each([
7
+ // [{}, 'Interest Rate', 'Interest Rate', 'N/A', undefined],
8
+ // [
9
+ // { minRate: 100, maxRate: 500 },
10
+ // 'Interest Rate',
11
+ // 'Interest Rate',
12
+ // '1% - 5%',
13
+ // undefined,
14
+ // ],
15
+ // [{ minRate: 0, maxRate: 0 }, 'Interest Rate', 'Interest Rate', '0%', undefined],
16
+ // [{ minRate: 150 }, 'Interest Rate', 'Interest Rate', 'N/A', undefined],
17
+ // [{ maxRate: 450 }, 'Interest Rate', 'Interest Rate', 'N/A', undefined],
18
+ // // Test case with dynamic label value
19
+ // [
20
+ // { minRate: 100, maxRate: 500, duration: '12 months' },
21
+ // 'Interest over ${duration}',
22
+ // 'Interest over 12 months',
23
+ // '1% - 5%',
24
+ // 'duration',
25
+ // ],
26
+ // [
27
+ // { minRate: 200, maxRate: 800, term: '6 months' },
28
+ // 'Interest over ${term}',
29
+ // 'Interest over 6 months',
30
+ // '2% - 8%',
31
+ // 'term',
32
+ // ],
33
+ // // Edge case: dynamicValue is not provided in offer
34
+ // [
35
+ // { minRate: 100, maxRate: 500 },
36
+ // 'Interest over ${duration}',
37
+ // 'Interest over Undefined',
38
+ // '1% - 5%',
39
+ // 'duration',
40
+ // ],
41
+ // // Edge case: dynamicValue is a number
42
+ // [
43
+ // { minRate: 100, maxRate: 500, months: 12 },
44
+ // 'Interest over ${months} months',
45
+ // 'Interest over 12 months',
46
+ // '1% - 5%',
47
+ // 'months',
48
+ // ],
49
+ // // Edge case: Both initial and end values undefined
50
+ // [{}, 'Interest Rate', 'Interest Rate', 'N/A', undefined],
51
+ // // Edge case: Both initial and end values null
52
+ // [
53
+ // { minRate: null, maxRate: null },
54
+ // 'Interest Rate',
55
+ // 'Interest Rate',
56
+ // 'N/A',
57
+ // undefined,
58
+ // ],
59
+ // ])(
60
+ // 'should return correct label and content for offer %j',
61
+ // (
62
+ // offer: unknown,
63
+ // label: string,
64
+ // expectedLabel: string,
65
+ // expectedContent: string,
66
+ // dynamicLabelValue?: string,
67
+ // ) => {
68
+ // const result = fromRangePercentStat(offer as BaseOffer)({
69
+ // format: 'rangePercent',
70
+ // label,
71
+ // initialFieldName: 'minRate',
72
+ // endFieldName: 'maxRate',
73
+ // dynamicLabelValue,
74
+ // })
75
+ // expect(result).toEqual({
76
+ // label: expectedLabel,
77
+ // content: expectedContent,
78
+ // })
79
+ // },
80
+ // )
81
+ // })
@@ -0,0 +1,38 @@
1
+
2
+ import { capitalize, get } from "radash";
3
+ import type { StatElementProps } from "../types";
4
+ import type { BaseOffer } from "../../../types/offerCatalogSchema";
5
+ import { formatRange } from "../../formatUtils";
6
+
7
+ export type RangePercentStat = {
8
+ format: "rangePercent";
9
+ label: string;
10
+ initialFieldName: string;
11
+ endFieldName: string;
12
+ dynamicLabelValue?: string;
13
+ };
14
+
15
+ export const fromRangePercentStat =
16
+ (offer: BaseOffer) =>
17
+ ({
18
+ label,
19
+ initialFieldName,
20
+ endFieldName,
21
+ dynamicLabelValue,
22
+ }: RangePercentStat): StatElementProps => {
23
+ const initialValue = get<number>(offer, initialFieldName);
24
+ const endValue = get<number>(offer, endFieldName);
25
+ const dynamicValue = get<number>(offer, dynamicLabelValue || "");
26
+
27
+ const content = formatRange(initialValue, endValue, "percentage");
28
+
29
+ const processedLabel = label.replace(
30
+ /\$\{(\w+)\}/g,
31
+ capitalize(`${dynamicValue}`)
32
+ );
33
+
34
+ return {
35
+ label: processedLabel,
36
+ content,
37
+ };
38
+ };
@@ -0,0 +1,26 @@
1
+ // import type { BaseOffer } from '@capabilities/offer-catalog'
2
+ // import { describe, expect, it } from 'vitest'
3
+ // import { recommendedCredit } from './recommendedCredit'
4
+
5
+ // describe('recommendedCredit', () => {
6
+ // it.each([
7
+ // [
8
+ // { recommendedCreditRatings: ['limited', 'poor', 'fair', 'good', 'excellent'] },
9
+ // 'Any',
10
+ // ],
11
+ // [{ recommendedCreditRatings: ['limited', 'poor', 'fair'] }, 'limited, poor & fair'],
12
+ // [{ recommendedCreditRatings: ['good', 'excellent'] }, 'good & excellent'],
13
+ // ])('returns %s when recommendedCreditRatings is %s', (offer, expected) => {
14
+ // const result = recommendedCredit(offer as unknown as BaseOffer)({
15
+ // format: 'recommendedCredit',
16
+ // label: 'Recommended Credit',
17
+ // fieldName: 'recommendedCreditRatings',
18
+ // })
19
+
20
+ // expect(result).toEqual({
21
+ // label: 'Recommended Credit',
22
+ // content: expected,
23
+ // isHighlighted: true,
24
+ // })
25
+ // })
26
+ // })
@@ -0,0 +1,45 @@
1
+
2
+ import { get } from "radash";
3
+ import { P, match } from "ts-pattern";
4
+ import type { StatElementProps } from "../types";
5
+ import { formatStringListWithAnd } from "../../formatUtils";
6
+ import type { BaseOffer } from "../../../types/offerCatalogSchema";
7
+
8
+ export type RecommendedCreditStat = {
9
+ format: "recommendedCredit";
10
+ label: string;
11
+ fieldName: string;
12
+ };
13
+
14
+ const RECOMMENDED_RATINGS = ["limited", "poor", "fair", "good", "excellent"];
15
+
16
+ const orderRecommendedRatings = (recommendedCreditValue: string[]) => {
17
+ return recommendedCreditValue.sort(
18
+ (a, b) => RECOMMENDED_RATINGS.indexOf(a) - RECOMMENDED_RATINGS.indexOf(b)
19
+ );
20
+ };
21
+
22
+ const hasAllRecommendedRatings = (recommendedCreditValue: string[]) =>
23
+ RECOMMENDED_RATINGS.every((rating) =>
24
+ recommendedCreditValue.includes(rating)
25
+ );
26
+
27
+ export const recommendedCredit =
28
+ (offer: BaseOffer) =>
29
+ ({ label, fieldName }: RecommendedCreditStat): StatElementProps => {
30
+ const recommendedCreditValue = get<string[]>(offer, fieldName);
31
+
32
+ const content = match(recommendedCreditValue)
33
+ .with(P.array(), (value) =>
34
+ hasAllRecommendedRatings(value)
35
+ ? "Any"
36
+ : formatStringListWithAnd(orderRecommendedRatings(value))
37
+ )
38
+ .otherwise(() => "See Terms");
39
+
40
+ return {
41
+ label,
42
+ content,
43
+ isHighlighted: true,
44
+ };
45
+ };
@@ -0,0 +1,28 @@
1
+ // import type { BaseOffer } from '@capabilities/offer-catalog'
2
+ // import { describe, expect, it } from 'vitest'
3
+ // import { rewardsDisplay } from './rewardsDisplay'
4
+
5
+ // describe('rewardsDisplay', () => {
6
+ // it.each([
7
+ // [
8
+ // { rewardsDescription: 'Cash Back & Travel Rewards' },
9
+ // 'Cash Back & Travel Rewards',
10
+ // false,
11
+ // ],
12
+ // [{ rewardsDescription: 'Cash Back' }, 'Cash Back', false],
13
+ // [{ rewardsDescription: 'Travel Rewards' }, 'Travel Rewards', false],
14
+ // [{ rewardsDescription: null }, 'None', true],
15
+ // ])('returns %s when rewards is %s', (offer, expected, isNull) => {
16
+ // const result = rewardsDisplay(offer as unknown as BaseOffer)({
17
+ // format: 'rewardsDisplay',
18
+ // label: 'Bonus',
19
+ // fieldName: 'rewardsDescription',
20
+ // })
21
+
22
+ // expect(result).toEqual({
23
+ // label: 'Bonus',
24
+ // content: expected,
25
+ // isNull,
26
+ // })
27
+ // })
28
+ // })