@hhgtech/hhg-components 1.29.467 → 1.29.469

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 (583) hide show
  1. package/build/{InputDate-9b287d31.js → InputDate-8958fc82.js} +5 -5
  2. package/build/{LastPeriod-a0ecbab4.js → LastPeriod-71c00f4a.js} +1 -1
  3. package/build/{MobileBottomNavigationIcon-fbbcb45e.js → MobileBottomNavigationIcon-668dc7e6.js} +3 -3
  4. package/build/{Spinner-a712cfcb.js → Spinner-a66ec1c0.js} +1 -1
  5. package/build/{WhatsApp-9cf7b0ec.js → WhatsApp-eaa42743.js} +1 -1
  6. package/build/adapters.js +20 -20
  7. package/build/atoms.js +50 -50
  8. package/build/babyGrowth.js +86 -86
  9. package/build/cache.js +2 -2
  10. package/build/care.js +18 -18
  11. package/build/careBookingSearchBar.js +14 -14
  12. package/build/careBookingSearchBarV2.js +15 -15
  13. package/build/components.js +104 -104
  14. package/build/{constants-304f9adf.js → constants-0c17ce2d.js} +1 -1
  15. package/build/constants.js +3 -3
  16. package/build/constantsDomainLocales.js +1 -1
  17. package/build/constantsRiskScreener.js +2 -2
  18. package/build/constantsSite.js +2 -2
  19. package/build/{core-f6662dae.js → core-5efb50a1.js} +1 -1
  20. package/build/{dataTransform-5fe88f23.js → dataTransform-55c11c61.js} +1 -1
  21. package/build/ecom.js +5 -5
  22. package/build/{editor-2f5c609e.js → editor-23f9a74c.js} +11 -11
  23. package/build/embeddedHeathToolCards_babyGrowth.js +25 -25
  24. package/build/embeddedHeathToolCards_babyPoop.js +22 -22
  25. package/build/embeddedHeathToolCards_babyVaccine.js +24 -24
  26. package/build/embeddedHeathToolCards_bmi_bmi.js +27 -27
  27. package/build/embeddedHeathToolCards_bmrBmr.js +27 -27
  28. package/build/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  29. package/build/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  30. package/build/embeddedHeathToolCards_pwg_pwg.js +28 -28
  31. package/build/embeddedHeathToolCards_targetHeartRate.js +29 -29
  32. package/build/esm/{InputDate-e16912cb.js → InputDate-d1be3b58.js} +5 -5
  33. package/build/esm/{LastPeriod-b6ca67de.js → LastPeriod-5ba0b85b.js} +1 -1
  34. package/build/esm/{MobileBottomNavigationIcon-d74e19c7.js → MobileBottomNavigationIcon-bffc63c4.js} +3 -3
  35. package/build/esm/{Spinner-87a04254.js → Spinner-82c410df.js} +1 -1
  36. package/build/esm/{WhatsApp-352685d9.js → WhatsApp-6bea76cd.js} +1 -1
  37. package/build/esm/adapters.js +20 -20
  38. package/build/esm/atoms.js +50 -50
  39. package/build/esm/babyGrowth.js +86 -86
  40. package/build/esm/cache.js +2 -2
  41. package/build/esm/care.js +18 -18
  42. package/build/esm/careBookingSearchBar.js +14 -14
  43. package/build/esm/careBookingSearchBarV2.js +15 -15
  44. package/build/esm/components.js +104 -104
  45. package/build/esm/{constants-3c64b5a9.js → constants-f18ad4d6.js} +1 -1
  46. package/build/esm/constants.js +3 -3
  47. package/build/esm/constantsDomainLocales.js +1 -1
  48. package/build/esm/constantsRiskScreener.js +2 -2
  49. package/build/esm/constantsSite.js +2 -2
  50. package/build/esm/{core-b8082a96.js → core-ff1bd0a7.js} +1 -1
  51. package/build/esm/{dataTransform-cf78356f.js → dataTransform-308dca7a.js} +1 -1
  52. package/build/esm/ecom.js +5 -5
  53. package/build/esm/{editor-3d887dc2.js → editor-ef9e201a.js} +11 -11
  54. package/build/esm/embeddedHeathToolCards_babyGrowth.js +25 -25
  55. package/build/esm/embeddedHeathToolCards_babyPoop.js +22 -22
  56. package/build/esm/embeddedHeathToolCards_babyVaccine.js +24 -24
  57. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +27 -27
  58. package/build/esm/embeddedHeathToolCards_bmrBmr.js +27 -27
  59. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  60. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  61. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +28 -28
  62. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +29 -29
  63. package/build/esm/footer.js +22 -22
  64. package/build/esm/gAssets.js +2 -2
  65. package/build/esm/{healthTools-61e6142d.js → healthTools-feca879c.js} +1 -1
  66. package/build/esm/healthToolsCardWrapper.js +20 -20
  67. package/build/esm/healthToolsForm.js +35 -35
  68. package/build/esm/hooks.js +13 -13
  69. package/build/esm/i18n.js +2 -2
  70. package/build/esm/i18nV2.js +2 -2
  71. package/build/esm/{index-efe669b5.js → index-0b6383bc.js} +8 -8
  72. package/build/esm/{index-7e2d76fe.js → index-1bfbac3f.js} +16 -16
  73. package/build/esm/{index-d6f80ae6.js → index-1d1c49e4.js} +7 -7
  74. package/build/esm/{index-724ca7b9.js → index-1f4d6c0d.js} +1 -1
  75. package/build/esm/{index-8c18d5bb.js → index-20ba9181.js} +3 -3
  76. package/build/esm/{index-98fdc97e.js → index-21671645.js} +3 -3
  77. package/build/esm/{index-1c505e14.js → index-2599903c.js} +2 -2
  78. package/build/esm/{index-5ac64220.js → index-2639fa1b.js} +21 -21
  79. package/build/esm/{index-d5d194d0.js → index-2737e5f3.js} +2 -2
  80. package/build/esm/{index-a03eec47.js → index-29982f98.js} +5 -5
  81. package/build/esm/{index-3cc386b3.js → index-322458fe.js} +2 -2
  82. package/build/esm/{index-354dab4a.js → index-353c0290.js} +1 -1
  83. package/build/esm/{index-769b62ac.js → index-376c1dda.js} +14 -14
  84. package/build/esm/{index-1a58120d.js → index-3920ffed.js} +30 -30
  85. package/build/esm/{index-be022759.js → index-395e5105.js} +1 -1
  86. package/build/esm/{index-f5971067.js → index-3ea41dd5.js} +15 -15
  87. package/build/esm/{index-0d3e8462.js → index-3f422b4c.js} +16 -16
  88. package/build/esm/{index-35cf65df.js → index-41febb35.js} +6 -6
  89. package/build/esm/{index-07b31406.js → index-43f97caf.js} +8 -8
  90. package/build/esm/{index-a18953c2.js → index-4623506f.js} +25 -25
  91. package/build/esm/{index-ed0d11fc.js → index-46f0a990.js} +2 -2
  92. package/build/esm/{index-537ec13d.js → index-47236ad2.js} +16 -16
  93. package/build/esm/{index-1318bcfa.js → index-4ab97103.js} +10 -10
  94. package/build/esm/{index-a9b12d78.js → index-4b057d00.js} +1 -1
  95. package/build/esm/{index-fa02dd81.js → index-4f7b25f7.js} +3 -3
  96. package/build/esm/{index-05f5dbbe.js → index-5efe59bc.js} +1 -1
  97. package/build/esm/{index-f2917d18.js → index-6099603c.js} +14 -14
  98. package/build/esm/{index-2f9ac679.js → index-633dd69f.js} +22 -22
  99. package/build/esm/{index-df493292.js → index-63fd1f03.js} +2 -2
  100. package/build/esm/{index-2afb5a3b.js → index-647a6ddf.js} +3 -3
  101. package/build/esm/index-670c92f6.js +16 -0
  102. package/build/esm/{index-00a475d5.js → index-6d1ee7ce.js} +18 -18
  103. package/build/esm/{index-49895d0e.js → index-721dab35.js} +2 -2
  104. package/build/esm/{index-43921892.js → index-74884ca0.js} +4 -4
  105. package/build/esm/{index-1150c067.js → index-7c18cf47.js} +21 -21
  106. package/build/esm/{index-2528aaf0.js → index-8b5f556a.js} +2 -2
  107. package/build/esm/{index-5d98bd65.js → index-8b9e5146.js} +2 -2
  108. package/build/esm/{index-c1864b5d.js → index-8bb8b7d3.js} +2 -2
  109. package/build/esm/{index-20657236.js → index-8ed6550a.js} +6 -6
  110. package/build/esm/{index-ee24dd2f.js → index-8f2ff9c6.js} +2 -2
  111. package/build/esm/{index-2bc75ec0.js → index-916c6433.js} +11 -11
  112. package/build/esm/{index-527a9e64.js → index-9859d1d3.js} +13 -13
  113. package/build/esm/{index-04c83109.js → index-9cff3556.js} +6 -6
  114. package/build/esm/{index-2e1c57f3.js → index-9e18891a.js} +32 -32
  115. package/build/esm/{index-edb9db3c.js → index-9ef8cd0e.js} +2 -2
  116. package/build/esm/{index-062cab04.js → index-a1d00d40.js} +6 -6
  117. package/build/esm/{index-4f5b5d16.js → index-ac8d248d.js} +3 -3
  118. package/build/esm/{index-ea352220.js → index-b3db4dc2.js} +1 -1
  119. package/build/esm/{index-a011aa7b.js → index-b5e98972.js} +3 -3
  120. package/build/esm/{index-76c321f2.js → index-b5ee1a5c.js} +14 -14
  121. package/build/esm/{index-8694e811.js → index-b5fc7b0d.js} +19 -19
  122. package/build/esm/{index-28698234.js → index-b60dbee6.js} +2 -2
  123. package/build/esm/{index-4903fcd9.js → index-b6fefce3.js} +15 -15
  124. package/build/esm/{index-2adab8d2.js → index-bc332e72.js} +3 -3
  125. package/build/esm/{index-e21ee0c8.js → index-bf15a821.js} +18 -18
  126. package/build/esm/{index-700cfcb4.js → index-c83f3c21.js} +2 -2
  127. package/build/esm/{index-b12bf0d8.js → index-c8f69605.js} +2 -2
  128. package/build/esm/{index-195b6f59.js → index-c9acd51a.js} +1 -1
  129. package/build/esm/{index-3b3d0e53.js → index-cbb32607.js} +4 -4
  130. package/build/esm/{index-2f6f0fb3.js → index-cf99a12e.js} +5 -5
  131. package/build/esm/{index-2d0e3c8c.js → index-d0b0ba5f.js} +9 -9
  132. package/build/esm/{index-992d17b3.js → index-dd55af3a.js} +2 -2
  133. package/build/esm/{index-1d2a3f31.js → index-e0c8b05a.js} +2 -2
  134. package/build/esm/{index-11e21357.js → index-e12b4e34.js} +26 -26
  135. package/build/esm/{index-d183af3b.js → index-e6175baa.js} +3 -3
  136. package/build/esm/{index-a24ad065.js → index-eed46f9d.js} +13 -13
  137. package/build/esm/{index-aa28c9b7.js → index-f62aa0ef.js} +2 -2
  138. package/build/esm/{index-65caf623.js → index-f8d39802.js} +14 -14
  139. package/build/esm/{index-3a690064.js → index-f9375fd1.js} +17 -17
  140. package/build/esm/{index-29b9ef83.js → index-f95021d9.js} +7 -7
  141. package/build/esm/{index-4148f726.js → index-f978381a.js} +16 -16
  142. package/build/esm/{index-250dd77e.js → index-fe271be5.js} +32 -32
  143. package/build/esm/index.js +124 -124
  144. package/build/esm/{labelSorting-ccf7795b.js → labelSorting-1e28e62c.js} +4 -4
  145. package/build/esm/lead.js +35 -35
  146. package/build/esm/{logoIcon-30072aaa.js → logoIcon-64767fa6.js} +2 -2
  147. package/build/esm/mantine.js +29 -38
  148. package/build/esm/misc.js +19 -19
  149. package/build/esm/miscGetDynamicHealthTool.js +4 -4
  150. package/build/esm/miscGetSocialList.js +8 -8
  151. package/build/esm/miscScreenSizeContext.js +1 -1
  152. package/build/esm/mobileBottomNavigation.js +5 -5
  153. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  154. package/build/esm/molecules.js +78 -78
  155. package/build/esm/moleculesArticleCard.js +6 -6
  156. package/build/esm/moleculesArticleCardV2.js +17 -17
  157. package/build/esm/navigation.js +47 -47
  158. package/build/esm/navigationLogoutPopup.js +11 -11
  159. package/build/esm/navigationProfileButton.js +27 -27
  160. package/build/esm/onboardingV2.js +30 -30
  161. package/build/esm/organisms.js +57 -57
  162. package/build/esm/{post-c41d8344.js → post-f2f68375.js} +2 -2
  163. package/build/esm/profileNavigation.js +20 -20
  164. package/build/esm/progressBar.js +1 -1
  165. package/build/esm/pwg.js +23 -23
  166. package/build/esm/ssoV2.js +31 -31
  167. package/build/esm/{store-790acf6f.js → store-b92fcec8.js} +3 -3
  168. package/build/esm/subot/hooks/useVerifyPhoneNumber.d.ts +1 -0
  169. package/build/esm/subot/index.d.ts +1 -0
  170. package/build/esm/subot/subotInline/assets/arrow-down.d.ts +3 -0
  171. package/build/esm/subot/subotInline/assets/arrow-left.d.ts +3 -0
  172. package/build/esm/subot/subotInline/assets/arrow-right.d.ts +3 -0
  173. package/build/esm/subot/subotInline/assets/arrow-up.d.ts +3 -0
  174. package/build/esm/subot/subotInline/assets/check.d.ts +3 -0
  175. package/build/esm/subot/subotInline/assets/checkbox.d.ts +3 -0
  176. package/build/esm/subot/subotInline/assets/chevronRightActive.d.ts +3 -0
  177. package/build/esm/subot/subotInline/assets/dislike-article.d.ts +3 -0
  178. package/build/esm/subot/subotInline/assets/index.d.ts +10 -0
  179. package/build/esm/subot/subotInline/assets/like-article.d.ts +3 -0
  180. package/build/esm/subot/subotInline/assets/rotate-left.d.ts +3 -0
  181. package/build/esm/subot/subotInline/index.d.ts +4 -0
  182. package/build/esm/subot/subotInline/index.styled.d.ts +67 -0
  183. package/build/esm/subot/subotInline/subotInline.config.d.ts +37 -0
  184. package/build/esm/subot/subotInline/subotInlineAction/index.d.ts +25 -0
  185. package/build/esm/subot/subotInline/subotInlineAction/subotInlineAction.d.ts +4 -0
  186. package/build/esm/subot/subotInline/subotInlineAction/subotInlineAction.styled.d.ts +54 -0
  187. package/build/esm/subot/subotInline/subotInlineFooter.d.ts +17 -0
  188. package/build/esm/subot/subotInline/subotInlineHeader.d.ts +3 -0
  189. package/build/esm/subot/subotInline/subotInlineIntent/index.d.ts +100 -0
  190. package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntent.d.ts +4 -0
  191. package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntent.styled.d.ts +159 -0
  192. package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntentFinal.d.ts +4 -0
  193. package/build/esm/subot/subotInline/subotInlineNode/SubotInlineNodeResultPoll.d.ts +4 -0
  194. package/build/esm/subot/subotInline/subotInlineNode/index.d.ts +15 -0
  195. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNode.d.ts +5 -0
  196. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNode.styled.d.ts +74 -0
  197. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeFinal.d.ts +4 -0
  198. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeFinalThankYou.d.ts +4 -0
  199. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeForm.d.ts +4 -0
  200. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeImage.d.ts +4 -0
  201. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeMultiple.d.ts +4 -0
  202. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeOTP.d.ts +4 -0
  203. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodePoll.d.ts +4 -0
  204. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeRating.d.ts +4 -0
  205. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeReaction.d.ts +4 -0
  206. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeReview.d.ts +4 -0
  207. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeSSO.d.ts +4 -0
  208. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeStart.d.ts +4 -0
  209. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeText.d.ts +4 -0
  210. package/build/esm/subot.js +3265 -109
  211. package/build/esm/surveyOrPremiumBanner.js +34 -34
  212. package/build/esm/surveyQuestionCard.js +11 -11
  213. package/build/esm/{surveyThankyouCard-553005a6.js → surveyThankyouCard-5ad7aa59.js} +5 -5
  214. package/build/esm/together/togetherComponentGlobalContext.d.ts +2 -0
  215. package/build/esm/together.js +57 -57
  216. package/build/esm/togetherApiUtils.js +4 -4
  217. package/build/esm/togetherAtoms.js +31 -31
  218. package/build/esm/togetherComponentGlobalContext.js +4 -4
  219. package/build/esm/togetherMolecules.js +52 -52
  220. package/build/esm/togetherMoleculesCardAuthor.js +29 -29
  221. package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
  222. package/build/esm/togetherMoleculesProfileDetail.js +40 -40
  223. package/build/esm/togetherOrganisms.js +51 -51
  224. package/build/esm/togetherRichTextEditor.js +18 -18
  225. package/build/esm/togetherShareBox.js +10 -10
  226. package/build/esm/{translationsProvider-4c36d2fb.js → translationsProvider-3894469e.js} +1 -1
  227. package/build/esm/{treePopoverMenu-79e1e714.js → treePopoverMenu-0129f8c8.js} +19 -19
  228. package/build/esm/types.js +2 -2
  229. package/build/esm/{useHealthToolCache-1a5355d6.js → useHealthToolCache-8e343907.js} +1 -1
  230. package/build/esm/{usePhoneValidator-71043279.js → usePhoneValidator-4e281bf2.js} +5 -5
  231. package/build/esm/{usePlacesAutocomplete-f1eff124.js → usePlacesAutocomplete-c30d831b.js} +1 -1
  232. package/build/esm/useTogetherAuthRequiredAction.js +10 -10
  233. package/build/esm/{utils-76f8ba20.js → utils-101a5a7d.js} +2 -2
  234. package/build/esm/{utils-b8e92437.js → utils-7af762a6.js} +2 -2
  235. package/build/esm/{utils-5e1d66a7.js → utils-8c6702a2.js} +3 -3
  236. package/build/esm/{utils-389a9a3d.js → utils-d0f2d84f.js} +5 -5
  237. package/build/esm/vaccination.js +22 -22
  238. package/build/footer.js +22 -22
  239. package/build/gAssets.js +2 -2
  240. package/build/{healthTools-ed870a63.js → healthTools-9fec8e6f.js} +1 -1
  241. package/build/healthToolsCardWrapper.js +20 -20
  242. package/build/healthToolsForm.js +35 -35
  243. package/build/hooks.js +13 -13
  244. package/build/i18n.js +2 -2
  245. package/build/i18nV2.js +1 -1
  246. package/build/{index-21958e45.js → index-02ccdfa5.js} +6 -6
  247. package/build/{index-7e39e6a6.js → index-051d6036.js} +1 -1
  248. package/build/{index-8108704a.js → index-0da93b0a.js} +3 -3
  249. package/build/{index-946b2e46.js → index-1300797e.js} +3 -3
  250. package/build/{index-6469782f.js → index-150f8c44.js} +1 -1
  251. package/build/{index-d517782d.js → index-17b678a7.js} +10 -10
  252. package/build/{index-719007b0.js → index-17fed731.js} +16 -16
  253. package/build/index-1832d185.js +22 -0
  254. package/build/{index-6c1b94f3.js → index-1980f860.js} +4 -4
  255. package/build/{index-217b689e.js → index-1f0ff43b.js} +2 -2
  256. package/build/{index-def5ee14.js → index-20d96c56.js} +2 -2
  257. package/build/{index-6779bac2.js → index-222eb4cd.js} +3 -3
  258. package/build/{index-ac43ab0e.js → index-23ce8082.js} +19 -19
  259. package/build/{index-15939a6f.js → index-243fd9ef.js} +26 -26
  260. package/build/{index-54bf0581.js → index-2d6389fd.js} +14 -14
  261. package/build/{index-2fd0bd40.js → index-2fcfe806.js} +1 -1
  262. package/build/{index-df7d0642.js → index-31af2a9a.js} +3 -3
  263. package/build/{index-7e0680d7.js → index-370a663a.js} +30 -30
  264. package/build/{index-4040161e.js → index-3e196568.js} +32 -32
  265. package/build/{index-3ddbaf17.js → index-41eb5886.js} +2 -2
  266. package/build/{index-13132196.js → index-444bced3.js} +4 -4
  267. package/build/{index-bb7de61b.js → index-46a1e934.js} +7 -7
  268. package/build/{index-7bacda36.js → index-4a5919ec.js} +18 -18
  269. package/build/{index-47d16e49.js → index-4c7226b2.js} +2 -2
  270. package/build/{index-3ab101ed.js → index-516ba779.js} +13 -13
  271. package/build/{index-46dfbbd5.js → index-59351f77.js} +2 -2
  272. package/build/{index-ad5795d1.js → index-5c18697f.js} +32 -32
  273. package/build/{index-c7ab1e76.js → index-5c950351.js} +21 -21
  274. package/build/{index-d5784094.js → index-69a30343.js} +14 -14
  275. package/build/{index-162d2bea.js → index-6d45d1af.js} +1 -1
  276. package/build/{index-6f142d1b.js → index-6d7aebfe.js} +1 -1
  277. package/build/{index-4328a910.js → index-6d9ba8ec.js} +2 -2
  278. package/build/{index-2d77bc32.js → index-72d92210.js} +25 -25
  279. package/build/{index-2dac7c43.js → index-76d98abe.js} +14 -14
  280. package/build/{index-483806a7.js → index-7820f042.js} +17 -17
  281. package/build/{index-9ea1ba65.js → index-79475efb.js} +5 -5
  282. package/build/{index-5a4a811f.js → index-7aca9976.js} +11 -11
  283. package/build/{index-39056b0e.js → index-7e69055a.js} +6 -6
  284. package/build/{index-1e457fd7.js → index-83c928d4.js} +2 -2
  285. package/build/{index-e6a9ba99.js → index-85dd6528.js} +3 -3
  286. package/build/{index-1d2d9ed8.js → index-8b82d7a6.js} +15 -15
  287. package/build/{index-b1b1b93f.js → index-8ba96324.js} +2 -2
  288. package/build/{index-04224e03.js → index-987ab412.js} +2 -2
  289. package/build/{index-a3b70bfb.js → index-997511c6.js} +7 -7
  290. package/build/{index-8587c0ab.js → index-9d5eb7d4.js} +2 -2
  291. package/build/{index-dea56f05.js → index-9e1854fc.js} +14 -14
  292. package/build/{index-7f919539.js → index-9f4688ef.js} +2 -2
  293. package/build/{index-16d895f3.js → index-a037041c.js} +2 -2
  294. package/build/{index-c7abb03e.js → index-a12b1b41.js} +2 -2
  295. package/build/{index-de3c3162.js → index-a212631d.js} +22 -22
  296. package/build/{index-db49933a.js → index-a3a8298a.js} +5 -5
  297. package/build/{index-167f677c.js → index-ac2cf1f0.js} +3 -3
  298. package/build/{index-9436a1d2.js → index-b0f93846.js} +6 -6
  299. package/build/{index-23182871.js → index-b2e41e39.js} +1 -1
  300. package/build/{index-f3e59e17.js → index-b4053d50.js} +15 -15
  301. package/build/{index-768497f0.js → index-b701af5e.js} +16 -16
  302. package/build/{index-ecaba738.js → index-be45ccb3.js} +3 -3
  303. package/build/{index-c297bc45.js → index-c0e193fd.js} +3 -3
  304. package/build/{index-66f15d67.js → index-c6cb8a8b.js} +6 -6
  305. package/build/{index-9d6878a5.js → index-c70814d1.js} +13 -13
  306. package/build/{index-7ebe364e.js → index-cb8d0724.js} +8 -8
  307. package/build/{index-d9cca0f6.js → index-d0b44a07.js} +2 -2
  308. package/build/{index-e06a414d.js → index-dbd704e5.js} +2 -2
  309. package/build/{index-804e1385.js → index-dcb746c8.js} +16 -16
  310. package/build/{index-1e844902.js → index-df385abb.js} +9 -9
  311. package/build/{index-c3c15baa.js → index-e74b8b7e.js} +18 -18
  312. package/build/{index-cae3aba1.js → index-e936ea09.js} +8 -8
  313. package/build/{index-97d2d7f0.js → index-eb3af8da.js} +16 -16
  314. package/build/{index-130342fa.js → index-ef17abd3.js} +2 -2
  315. package/build/{index-1dbecf82.js → index-f288a7cd.js} +21 -21
  316. package/build/{index-03714c69.js → index-f700bf59.js} +1 -1
  317. package/build/{index-ce5ae067.js → index-fe0feabe.js} +2 -2
  318. package/build/index.js +124 -124
  319. package/build/{labelSorting-116025fe.js → labelSorting-e9ba00cd.js} +4 -4
  320. package/build/lead.js +35 -35
  321. package/build/{logoIcon-e50fa661.js → logoIcon-337e4cc4.js} +2 -2
  322. package/build/mantine.js +40 -48
  323. package/build/misc.js +19 -19
  324. package/build/miscGetDynamicHealthTool.js +4 -4
  325. package/build/miscGetSocialList.js +8 -8
  326. package/build/miscScreenSizeContext.js +1 -1
  327. package/build/mobileBottomNavigation.js +5 -5
  328. package/build/mobileBottomNavigationIcon.js +5 -5
  329. package/build/molecules.js +78 -78
  330. package/build/moleculesArticleCard.js +6 -6
  331. package/build/moleculesArticleCardV2.js +17 -17
  332. package/build/navigation.js +47 -47
  333. package/build/navigationLogoutPopup.js +11 -11
  334. package/build/navigationProfileButton.js +27 -27
  335. package/build/onboardingV2.js +29 -29
  336. package/build/organisms.js +57 -57
  337. package/build/{post-a7d14fbe.js → post-8b642c89.js} +2 -2
  338. package/build/profileNavigation.js +20 -20
  339. package/build/progressBar.js +1 -1
  340. package/build/pwg.js +23 -23
  341. package/build/ssoV2.js +29 -29
  342. package/build/{store-60aef577.js → store-02cc282f.js} +3 -3
  343. package/build/subot/hooks/useVerifyPhoneNumber.d.ts +1 -0
  344. package/build/subot/index.d.ts +1 -0
  345. package/build/subot/subotInline/assets/arrow-down.d.ts +3 -0
  346. package/build/subot/subotInline/assets/arrow-left.d.ts +3 -0
  347. package/build/subot/subotInline/assets/arrow-right.d.ts +3 -0
  348. package/build/subot/subotInline/assets/arrow-up.d.ts +3 -0
  349. package/build/subot/subotInline/assets/check.d.ts +3 -0
  350. package/build/subot/subotInline/assets/checkbox.d.ts +3 -0
  351. package/build/subot/subotInline/assets/chevronRightActive.d.ts +3 -0
  352. package/build/subot/subotInline/assets/dislike-article.d.ts +3 -0
  353. package/build/subot/subotInline/assets/index.d.ts +10 -0
  354. package/build/subot/subotInline/assets/like-article.d.ts +3 -0
  355. package/build/subot/subotInline/assets/rotate-left.d.ts +3 -0
  356. package/build/subot/subotInline/index.d.ts +4 -0
  357. package/build/subot/subotInline/index.styled.d.ts +67 -0
  358. package/build/subot/subotInline/subotInline.config.d.ts +37 -0
  359. package/build/subot/subotInline/subotInlineAction/index.d.ts +25 -0
  360. package/build/subot/subotInline/subotInlineAction/subotInlineAction.d.ts +4 -0
  361. package/build/subot/subotInline/subotInlineAction/subotInlineAction.styled.d.ts +54 -0
  362. package/build/subot/subotInline/subotInlineFooter.d.ts +17 -0
  363. package/build/subot/subotInline/subotInlineHeader.d.ts +3 -0
  364. package/build/subot/subotInline/subotInlineIntent/index.d.ts +100 -0
  365. package/build/subot/subotInline/subotInlineIntent/subotInlineIntent.d.ts +4 -0
  366. package/build/subot/subotInline/subotInlineIntent/subotInlineIntent.styled.d.ts +159 -0
  367. package/build/subot/subotInline/subotInlineIntent/subotInlineIntentFinal.d.ts +4 -0
  368. package/build/subot/subotInline/subotInlineNode/SubotInlineNodeResultPoll.d.ts +4 -0
  369. package/build/subot/subotInline/subotInlineNode/index.d.ts +15 -0
  370. package/build/subot/subotInline/subotInlineNode/subotInlineNode.d.ts +5 -0
  371. package/build/subot/subotInline/subotInlineNode/subotInlineNode.styled.d.ts +74 -0
  372. package/build/subot/subotInline/subotInlineNode/subotInlineNodeFinal.d.ts +4 -0
  373. package/build/subot/subotInline/subotInlineNode/subotInlineNodeFinalThankYou.d.ts +4 -0
  374. package/build/subot/subotInline/subotInlineNode/subotInlineNodeForm.d.ts +4 -0
  375. package/build/subot/subotInline/subotInlineNode/subotInlineNodeImage.d.ts +4 -0
  376. package/build/subot/subotInline/subotInlineNode/subotInlineNodeMultiple.d.ts +4 -0
  377. package/build/subot/subotInline/subotInlineNode/subotInlineNodeOTP.d.ts +4 -0
  378. package/build/subot/subotInline/subotInlineNode/subotInlineNodePoll.d.ts +4 -0
  379. package/build/subot/subotInline/subotInlineNode/subotInlineNodeRating.d.ts +4 -0
  380. package/build/subot/subotInline/subotInlineNode/subotInlineNodeReaction.d.ts +4 -0
  381. package/build/subot/subotInline/subotInlineNode/subotInlineNodeReview.d.ts +4 -0
  382. package/build/subot/subotInline/subotInlineNode/subotInlineNodeSSO.d.ts +4 -0
  383. package/build/subot/subotInline/subotInlineNode/subotInlineNodeStart.d.ts +4 -0
  384. package/build/subot/subotInline/subotInlineNode/subotInlineNodeText.d.ts +4 -0
  385. package/build/subot.js +3268 -110
  386. package/build/surveyOrPremiumBanner.js +34 -34
  387. package/build/surveyQuestionCard.js +11 -11
  388. package/build/{surveyThankyouCard-4af08559.js → surveyThankyouCard-51d3a60f.js} +5 -5
  389. package/build/together/togetherComponentGlobalContext.d.ts +2 -0
  390. package/build/together.js +57 -57
  391. package/build/togetherApiUtils.js +4 -4
  392. package/build/togetherAtoms.js +31 -31
  393. package/build/togetherComponentGlobalContext.js +4 -4
  394. package/build/togetherMolecules.js +52 -52
  395. package/build/togetherMoleculesCardAuthor.js +29 -29
  396. package/build/togetherMoleculesPostImagePreview.js +11 -11
  397. package/build/togetherMoleculesProfileDetail.js +40 -40
  398. package/build/togetherOrganisms.js +51 -51
  399. package/build/togetherRichTextEditor.js +18 -18
  400. package/build/togetherShareBox.js +10 -10
  401. package/build/{translationsProvider-81882033.js → translationsProvider-c01dcab1.js} +1 -1
  402. package/build/{treePopoverMenu-26a49c1d.js → treePopoverMenu-90eb76e1.js} +19 -19
  403. package/build/types.js +2 -2
  404. package/build/{useHealthToolCache-8a0b6046.js → useHealthToolCache-545121a9.js} +1 -1
  405. package/build/{usePhoneValidator-00b1affb.js → usePhoneValidator-a211b1d2.js} +5 -5
  406. package/build/{usePlacesAutocomplete-a22b305a.js → usePlacesAutocomplete-e7c267ce.js} +1 -1
  407. package/build/useTogetherAuthRequiredAction.js +10 -10
  408. package/build/{utils-9d6706a9.js → utils-1accb4c2.js} +2 -2
  409. package/build/{utils-3cb3da06.js → utils-6262a168.js} +2 -2
  410. package/build/{utils-5012b8fe.js → utils-6cae04b9.js} +5 -5
  411. package/build/{utils-9181c2cb.js → utils-f61d5359.js} +3 -3
  412. package/build/vaccination.js +22 -22
  413. package/package.json +3 -1
  414. /package/build/{BMI_BOYS.percentile.monthly-417e2d86.js → BMI_BOYS.percentile.monthly-987a4c21.js} +0 -0
  415. /package/build/{BMI_BOYS.percentile.weekly-bf4ddf0d.js → BMI_BOYS.percentile.weekly-e5f8ea59.js} +0 -0
  416. /package/build/{BMI_BOYS.percentile.yearly-05068392.js → BMI_BOYS.percentile.yearly-874a947b.js} +0 -0
  417. /package/build/{BMI_BOYS.zscore.monthly-ff8cbff5.js → BMI_BOYS.zscore.monthly-3c2e08f1.js} +0 -0
  418. /package/build/{BMI_BOYS.zscore.weekly-15139146.js → BMI_BOYS.zscore.weekly-8a296715.js} +0 -0
  419. /package/build/{BMI_BOYS.zscore.yearly-55f3ab70.js → BMI_BOYS.zscore.yearly-0787d9dc.js} +0 -0
  420. /package/build/{BMI_GIRLS.percentile.monthly-487b0dd8.js → BMI_GIRLS.percentile.monthly-73a7d746.js} +0 -0
  421. /package/build/{BMI_GIRLS.percentile.weekly-42a579c3.js → BMI_GIRLS.percentile.weekly-8c3f6952.js} +0 -0
  422. /package/build/{BMI_GIRLS.percentile.yearly-34a0d28b.js → BMI_GIRLS.percentile.yearly-4974ac22.js} +0 -0
  423. /package/build/{BMI_GIRLS.zscore.monthly-22a2fe5b.js → BMI_GIRLS.zscore.monthly-046de89b.js} +0 -0
  424. /package/build/{BMI_GIRLS.zscore.weekly-c247f7d5.js → BMI_GIRLS.zscore.weekly-3503533f.js} +0 -0
  425. /package/build/{BMI_GIRLS.zscore.yearly-41cb6cd5.js → BMI_GIRLS.zscore.yearly-97b13f85.js} +0 -0
  426. /package/build/{ChevronDown-57f98bfb.js → ChevronDown-a29c5dbd.js} +0 -0
  427. /package/build/{Close-00932092.js → Close-32efb83e.js} +0 -0
  428. /package/build/{Google-70df0aff.js → Google-4d147c96.js} +0 -0
  429. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-f1a4e5e2.js → HEAD CIRCUM_BOYS.percentile.monthly-769ab158.js} +0 -0
  430. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-0be0e8f9.js → HEAD CIRCUM_BOYS.percentile.weekly-ce8747a4.js} +0 -0
  431. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-f4475c99.js → HEAD CIRCUM_BOYS.percentile.yearly-39ba1442.js} +0 -0
  432. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-2efd0f92.js → HEAD CIRCUM_BOYS.zscore.monthly-df37430b.js} +0 -0
  433. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-ec8629ed.js → HEAD CIRCUM_BOYS.zscore.weekly-48f0b6e0.js} +0 -0
  434. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-b8fabe78.js → HEAD CIRCUM_BOYS.zscore.yearly-5a55d520.js} +0 -0
  435. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-4d0f46bf.js → HEAD CIRCUM_GIRLS.percentile.monthly-3161852a.js} +0 -0
  436. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-5002dffa.js → HEAD CIRCUM_GIRLS.percentile.weekly-97c0dcc3.js} +0 -0
  437. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-16a8c4e6.js → HEAD CIRCUM_GIRLS.percentile.yearly-05eb43f1.js} +0 -0
  438. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-714a7240.js → HEAD CIRCUM_GIRLS.zscore.monthly-6a5cbfbd.js} +0 -0
  439. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-bd7ee5a0.js → HEAD CIRCUM_GIRLS.zscore.weekly-3518e49c.js} +0 -0
  440. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-857a28d1.js → HEAD CIRCUM_GIRLS.zscore.yearly-72db00cb.js} +0 -0
  441. /package/build/{HEIGHT_BOYS.percentile.monthly-2d5211e5.js → HEIGHT_BOYS.percentile.monthly-3d745393.js} +0 -0
  442. /package/build/{HEIGHT_BOYS.percentile.weekly-7af4168c.js → HEIGHT_BOYS.percentile.weekly-ca30d3e2.js} +0 -0
  443. /package/build/{HEIGHT_BOYS.percentile.yearly-82ffc316.js → HEIGHT_BOYS.percentile.yearly-63ae1251.js} +0 -0
  444. /package/build/{HEIGHT_BOYS.zscore.monthly-01ad1306.js → HEIGHT_BOYS.zscore.monthly-12457457.js} +0 -0
  445. /package/build/{HEIGHT_BOYS.zscore.weekly-74be5005.js → HEIGHT_BOYS.zscore.weekly-02d1984b.js} +0 -0
  446. /package/build/{HEIGHT_BOYS.zscore.yearly-9ff520ad.js → HEIGHT_BOYS.zscore.yearly-270cfae9.js} +0 -0
  447. /package/build/{HEIGHT_GIRLS.percentile.monthly-c1e02d60.js → HEIGHT_GIRLS.percentile.monthly-19b36688.js} +0 -0
  448. /package/build/{HEIGHT_GIRLS.percentile.weekly-a2f7e077.js → HEIGHT_GIRLS.percentile.weekly-48a450e4.js} +0 -0
  449. /package/build/{HEIGHT_GIRLS.percentile.yearly-c7a14f59.js → HEIGHT_GIRLS.percentile.yearly-46fe01c8.js} +0 -0
  450. /package/build/{HEIGHT_GIRLS.zscore.monthly-9159de1b.js → HEIGHT_GIRLS.zscore.monthly-a50048ea.js} +0 -0
  451. /package/build/{HEIGHT_GIRLS.zscore.weekly-79d534f8.js → HEIGHT_GIRLS.zscore.weekly-fb7a4e89.js} +0 -0
  452. /package/build/{HEIGHT_GIRLS.zscore.yearly-330604fe.js → HEIGHT_GIRLS.zscore.yearly-2e489d90.js} +0 -0
  453. /package/build/{Locale-7b990ab4.js → Locale-9df5cd35.js} +0 -0
  454. /package/build/{Visible-cc6da38a.js → Visible-1b495734.js} +0 -0
  455. /package/build/{WEIGHT_BOYS.percentile.monthly-cee34f73.js → WEIGHT_BOYS.percentile.monthly-f8994e5b.js} +0 -0
  456. /package/build/{WEIGHT_BOYS.percentile.weekly-27f569a4.js → WEIGHT_BOYS.percentile.weekly-ef4328b9.js} +0 -0
  457. /package/build/{WEIGHT_BOYS.percentile.yearly-2696ecab.js → WEIGHT_BOYS.percentile.yearly-024c4568.js} +0 -0
  458. /package/build/{WEIGHT_BOYS.zscore.monthly-7a005e60.js → WEIGHT_BOYS.zscore.monthly-a020598b.js} +0 -0
  459. /package/build/{WEIGHT_BOYS.zscore.weekly-5dc7bce7.js → WEIGHT_BOYS.zscore.weekly-16d45df3.js} +0 -0
  460. /package/build/{WEIGHT_BOYS.zscore.yearly-db25b379.js → WEIGHT_BOYS.zscore.yearly-f2a934e2.js} +0 -0
  461. /package/build/{WEIGHT_GIRLS.percentile.monthly-656b101c.js → WEIGHT_GIRLS.percentile.monthly-c2d3f6c7.js} +0 -0
  462. /package/build/{WEIGHT_GIRLS.percentile.weekly-27b1829a.js → WEIGHT_GIRLS.percentile.weekly-36861d3c.js} +0 -0
  463. /package/build/{WEIGHT_GIRLS.percentile.yearly-032f81f4.js → WEIGHT_GIRLS.percentile.yearly-129db734.js} +0 -0
  464. /package/build/{WEIGHT_GIRLS.zscore.monthly-d4f312f8.js → WEIGHT_GIRLS.zscore.monthly-3c1629db.js} +0 -0
  465. /package/build/{WEIGHT_GIRLS.zscore.weekly-49dac6e3.js → WEIGHT_GIRLS.zscore.weekly-31dbbe09.js} +0 -0
  466. /package/build/{WEIGHT_GIRLS.zscore.yearly-27b2871a.js → WEIGHT_GIRLS.zscore.yearly-c302182e.js} +0 -0
  467. /package/build/{ageGenerate-bdba9999.js → ageGenerate-cb0f8606.js} +0 -0
  468. /package/build/{animation-ab0621b4.js → animation-6626fd28.js} +0 -0
  469. /package/build/{constants-1f3e27ab.js → constants-120c30b2.js} +0 -0
  470. /package/build/{constants-fe99309f.js → constants-4f44efeb.js} +0 -0
  471. /package/build/{constants-8e74d640.js → constants-d5cd0bf0.js} +0 -0
  472. /package/build/{context-48ea9a83.js → context-bf9e83c0.js} +0 -0
  473. /package/build/{dataTransform-494f33e3.js → dataTransform-83075921.js} +0 -0
  474. /package/build/esm/{BMI_BOYS.percentile.monthly-696a9d40.js → BMI_BOYS.percentile.monthly-58cf82bc.js} +0 -0
  475. /package/build/esm/{BMI_BOYS.percentile.weekly-dcb4886c.js → BMI_BOYS.percentile.weekly-84f25c74.js} +0 -0
  476. /package/build/esm/{BMI_BOYS.percentile.yearly-c00c093b.js → BMI_BOYS.percentile.yearly-a2d2fe97.js} +0 -0
  477. /package/build/esm/{BMI_BOYS.zscore.monthly-2ebacf43.js → BMI_BOYS.zscore.monthly-bee58569.js} +0 -0
  478. /package/build/esm/{BMI_BOYS.zscore.weekly-3242aab7.js → BMI_BOYS.zscore.weekly-6e4f8761.js} +0 -0
  479. /package/build/esm/{BMI_BOYS.zscore.yearly-63156b13.js → BMI_BOYS.zscore.yearly-80b4ddc7.js} +0 -0
  480. /package/build/esm/{BMI_GIRLS.percentile.monthly-61a72917.js → BMI_GIRLS.percentile.monthly-d937908a.js} +0 -0
  481. /package/build/esm/{BMI_GIRLS.percentile.weekly-02dc31c9.js → BMI_GIRLS.percentile.weekly-08c357cd.js} +0 -0
  482. /package/build/esm/{BMI_GIRLS.percentile.yearly-f92f1a43.js → BMI_GIRLS.percentile.yearly-4fd498da.js} +0 -0
  483. /package/build/esm/{BMI_GIRLS.zscore.monthly-33a87fec.js → BMI_GIRLS.zscore.monthly-2fd594f5.js} +0 -0
  484. /package/build/esm/{BMI_GIRLS.zscore.weekly-5f2d7eca.js → BMI_GIRLS.zscore.weekly-2375e042.js} +0 -0
  485. /package/build/esm/{BMI_GIRLS.zscore.yearly-4919570a.js → BMI_GIRLS.zscore.yearly-c21bacd1.js} +0 -0
  486. /package/build/esm/{ChevronDown-362b50db.js → ChevronDown-805a93c9.js} +0 -0
  487. /package/build/esm/{Close-53a16568.js → Close-80cfdc88.js} +0 -0
  488. /package/build/esm/{Google-fb800329.js → Google-45ffe0bd.js} +0 -0
  489. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-10dc1268.js → HEAD CIRCUM_BOYS.percentile.monthly-1d5fe9c5.js} +0 -0
  490. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-f15accb0.js → HEAD CIRCUM_BOYS.percentile.weekly-a6fc07d4.js} +0 -0
  491. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-e3e2264e.js → HEAD CIRCUM_BOYS.percentile.yearly-0d421941.js} +0 -0
  492. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-b6ba2db3.js → HEAD CIRCUM_BOYS.zscore.monthly-89354167.js} +0 -0
  493. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-d3d58c76.js → HEAD CIRCUM_BOYS.zscore.weekly-30f0695e.js} +0 -0
  494. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-f9768ce8.js → HEAD CIRCUM_BOYS.zscore.yearly-43a9f7a4.js} +0 -0
  495. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-16e9a43b.js → HEAD CIRCUM_GIRLS.percentile.monthly-658891ab.js} +0 -0
  496. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-62c042a5.js → HEAD CIRCUM_GIRLS.percentile.weekly-bf29f435.js} +0 -0
  497. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-36ce99b2.js → HEAD CIRCUM_GIRLS.percentile.yearly-a46c1b6a.js} +0 -0
  498. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-52dd8a7f.js → HEAD CIRCUM_GIRLS.zscore.monthly-d3c74684.js} +0 -0
  499. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-a5923b9c.js → HEAD CIRCUM_GIRLS.zscore.weekly-61e75add.js} +0 -0
  500. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-638305ff.js → HEAD CIRCUM_GIRLS.zscore.yearly-d2a629c4.js} +0 -0
  501. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-3be20837.js → HEIGHT_BOYS.percentile.monthly-bca5c1e9.js} +0 -0
  502. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-e782d119.js → HEIGHT_BOYS.percentile.weekly-f7368d57.js} +0 -0
  503. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-e6c88cd2.js → HEIGHT_BOYS.percentile.yearly-8195d9ec.js} +0 -0
  504. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-ae6b9660.js → HEIGHT_BOYS.zscore.monthly-37bbb945.js} +0 -0
  505. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-a0d9b7ff.js → HEIGHT_BOYS.zscore.weekly-d433467a.js} +0 -0
  506. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-d5c88cfd.js → HEIGHT_BOYS.zscore.yearly-c378be06.js} +0 -0
  507. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-348342d5.js → HEIGHT_GIRLS.percentile.monthly-b18994fd.js} +0 -0
  508. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-16653ea6.js → HEIGHT_GIRLS.percentile.weekly-8edc04fc.js} +0 -0
  509. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-e1f75bf8.js → HEIGHT_GIRLS.percentile.yearly-5d3288eb.js} +0 -0
  510. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-6562df05.js → HEIGHT_GIRLS.zscore.monthly-60732d0e.js} +0 -0
  511. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-d5a7e47f.js → HEIGHT_GIRLS.zscore.weekly-e0492ab8.js} +0 -0
  512. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-e7c8e0b7.js → HEIGHT_GIRLS.zscore.yearly-9f072818.js} +0 -0
  513. /package/build/esm/{Locale-5d8124a4.js → Locale-91630424.js} +0 -0
  514. /package/build/esm/{Visible-b1803552.js → Visible-c5521a2e.js} +0 -0
  515. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-bcf253ab.js → WEIGHT_BOYS.percentile.monthly-7d1d0494.js} +0 -0
  516. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-46c295ad.js → WEIGHT_BOYS.percentile.weekly-3f2546e3.js} +0 -0
  517. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-b7c98edf.js → WEIGHT_BOYS.percentile.yearly-dc3a69b2.js} +0 -0
  518. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-531fc7b4.js → WEIGHT_BOYS.zscore.monthly-23c7d55f.js} +0 -0
  519. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-662d1cb9.js → WEIGHT_BOYS.zscore.weekly-c6fad72f.js} +0 -0
  520. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-04c464ec.js → WEIGHT_BOYS.zscore.yearly-816d167e.js} +0 -0
  521. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-6a60b578.js → WEIGHT_GIRLS.percentile.monthly-bfa6d398.js} +0 -0
  522. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-382aebe3.js → WEIGHT_GIRLS.percentile.weekly-f59017d9.js} +0 -0
  523. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-74185978.js → WEIGHT_GIRLS.percentile.yearly-406741b1.js} +0 -0
  524. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-877f15bf.js → WEIGHT_GIRLS.zscore.monthly-7d4ad39a.js} +0 -0
  525. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-d6b735cc.js → WEIGHT_GIRLS.zscore.weekly-d18b50e7.js} +0 -0
  526. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-57e3dfff.js → WEIGHT_GIRLS.zscore.yearly-8ca32620.js} +0 -0
  527. /package/build/esm/{ageGenerate-5b698977.js → ageGenerate-11afff34.js} +0 -0
  528. /package/build/esm/{animation-24ef5f79.js → animation-360b3646.js} +0 -0
  529. /package/build/esm/{constants-a1dd8e93.js → constants-514d6022.js} +0 -0
  530. /package/build/esm/{constants-d765889a.js → constants-97dd25f2.js} +0 -0
  531. /package/build/esm/{constants-45df2f47.js → constants-b4cb9bb7.js} +0 -0
  532. /package/build/esm/{context-b27aa296.js → context-504ce070.js} +0 -0
  533. /package/build/esm/{dataTransform-f482058f.js → dataTransform-61849904.js} +0 -0
  534. /package/build/esm/{index-7580fce8.js → index-08874a2d.js} +0 -0
  535. /package/build/esm/{index-a605fbe4.js → index-3ec423f6.js} +0 -0
  536. /package/build/esm/{index-58421748.js → index-497308bd.js} +0 -0
  537. /package/build/esm/{index-7b5c4e24.js → index-784699d1.js} +0 -0
  538. /package/build/esm/{index-ed89d1f8.js → index-7ba790ad.js} +0 -0
  539. /package/build/esm/{index-3bcd4576.js → index-92873b3c.js} +0 -0
  540. /package/build/esm/{index-2ed6bbe5.js → index-b34b0c78.js} +0 -0
  541. /package/build/esm/{index-5f783e60.js → index-ee99d772.js} +0 -0
  542. /package/build/esm/{index-cdad251f.js → index-f524340c.js} +0 -0
  543. /package/build/esm/{index.styles-fd8ca959.js → index.styles-4ef2c941.js} +0 -0
  544. /package/build/esm/{localizeNumberFormat-dfa14a2e.js → localizeNumberFormat-c4126573.js} +0 -0
  545. /package/build/esm/{normalizeLink-8b7abc30.js → normalizeLink-a011d7fe.js} +0 -0
  546. /package/build/esm/{number-46ee7fdc.js → number-b87c7e17.js} +0 -0
  547. /package/build/esm/{paths-2756cf85.js → paths-4c25df91.js} +0 -0
  548. /package/build/esm/{shared-9faeef87.js → shared-836db619.js} +0 -0
  549. /package/build/esm/{translationsContext-1f975c56.js → translationsContext-58d9fc6a.js} +0 -0
  550. /package/build/esm/{tslib.es6-b2e6926b.js → tslib.es6-78db4368.js} +0 -0
  551. /package/build/esm/{types-4b82e4ca.js → types-11515f9b.js} +0 -0
  552. /package/build/esm/{types-1e82d2e8.js → types-925ecb40.js} +0 -0
  553. /package/build/esm/{useIsInit-10c4dfab.js → useIsInit-cf13c4e7.js} +0 -0
  554. /package/build/esm/{useOutsideClick-169ecf84.js → useOutsideClick-7f0c4ae1.js} +0 -0
  555. /package/build/esm/{useScrollbarSize-ee66489a.js → useScrollbarSize-1a7561f0.js} +0 -0
  556. /package/build/esm/{useUniqueId-ffebef23.js → useUniqueId-a7205f7e.js} +0 -0
  557. /package/build/esm/{utils-6bd52394.js → utils-0ca6e9e6.js} +0 -0
  558. /package/build/esm/{utils-c2efefae.js → utils-f6ac2285.js} +0 -0
  559. /package/build/{index-85b8fcec.js → index-19b5ac4a.js} +0 -0
  560. /package/build/{index-e20b6ca5.js → index-242ff84e.js} +0 -0
  561. /package/build/{index-497eb2b6.js → index-38aa2c5e.js} +0 -0
  562. /package/build/{index-c895c0f8.js → index-46adef58.js} +0 -0
  563. /package/build/{index-68e254aa.js → index-54a33ddb.js} +0 -0
  564. /package/build/{index-293f23b0.js → index-8aaca86d.js} +0 -0
  565. /package/build/{index-5c7163c5.js → index-aa90dcf3.js} +0 -0
  566. /package/build/{index-41d5792a.js → index-ddde3b74.js} +0 -0
  567. /package/build/{index-b1238965.js → index-f71bcdf9.js} +0 -0
  568. /package/build/{index.styles-1cdd9f45.js → index.styles-925fa616.js} +0 -0
  569. /package/build/{localizeNumberFormat-f340227f.js → localizeNumberFormat-634dbcd1.js} +0 -0
  570. /package/build/{normalizeLink-c361c763.js → normalizeLink-0fde7b8b.js} +0 -0
  571. /package/build/{number-52f0fdb9.js → number-ce405c99.js} +0 -0
  572. /package/build/{paths-41552867.js → paths-544b8cbd.js} +0 -0
  573. /package/build/{shared-9f20667d.js → shared-d26a6abc.js} +0 -0
  574. /package/build/{translationsContext-dc7418e5.js → translationsContext-fa010d5c.js} +0 -0
  575. /package/build/{tslib.es6-be2cf26c.js → tslib.es6-4d105ce2.js} +0 -0
  576. /package/build/{types-cee006c6.js → types-a5674f4b.js} +0 -0
  577. /package/build/{types-bbb47a5b.js → types-ecca1cd3.js} +0 -0
  578. /package/build/{useIsInit-21624600.js → useIsInit-be15eee8.js} +0 -0
  579. /package/build/{useOutsideClick-7b190179.js → useOutsideClick-27ea16bc.js} +0 -0
  580. /package/build/{useScrollbarSize-f29bd511.js → useScrollbarSize-6d07336d.js} +0 -0
  581. /package/build/{useUniqueId-e1bffd87.js → useUniqueId-5ca32ab7.js} +0 -0
  582. /package/build/{utils-dcc2d7a0.js → utils-1123a4e7.js} +0 -0
  583. /package/build/{utils-08864c1c.js → utils-1e78807c.js} +0 -0
package/build/subot.js CHANGED
@@ -3,77 +3,82 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var index$2 = require('./index-23182871.js');
7
- var tslib_es6 = require('./tslib.es6-be2cf26c.js');
8
- var index$3 = require('./index-def5ee14.js');
6
+ var index$2 = require('./index-b2e41e39.js');
7
+ var tslib_es6 = require('./tslib.es6-4d105ce2.js');
8
+ var index$3 = require('./index-20d96c56.js');
9
9
  var Cookies = require('js-cookie');
10
10
  var fd = require('fastdom');
11
11
  var fastdomPromised = require('fastdom/extensions/fastdom-promised');
12
- var togetherComponentGlobalContext = require('./utils-9181c2cb.js');
12
+ var togetherComponentGlobalContext = require('./utils-f61d5359.js');
13
13
  var formatString = require('string-format');
14
- var index$1 = require('./index-167f677c.js');
14
+ var index$1 = require('./index-ac2cf1f0.js');
15
15
  var dayjs = require('dayjs');
16
16
  var constantsDomainLocales = require('./constantsDomainLocales.js');
17
17
  var classNames = require('classnames');
18
- var index$b = require('./index-5c7163c5.js');
19
- var index$a = require('./index-ce5ae067.js');
18
+ var index$b = require('./index-aa90dcf3.js');
19
+ var index$a = require('./index-fe0feabe.js');
20
20
  var framerMotion = require('framer-motion');
21
21
  var styled = require('@emotion/styled');
22
- var utils = require('./utils-08864c1c.js');
23
- var index$4 = require('./index-ecaba738.js');
22
+ var utils = require('./utils-1e78807c.js');
23
+ var index$4 = require('./index-be45ccb3.js');
24
24
  var remarkable = require('remarkable');
25
25
  var other = require('@hhgtech/icons/other');
26
26
  var reactIntersectionObserver = require('react-intersection-observer');
27
27
  var core = require('@mantine/core');
28
- var index$5 = require('./index-497eb2b6.js');
28
+ var index$5 = require('./index-38aa2c5e.js');
29
29
  var isSameOrBefore = require('dayjs/plugin/isSameOrBefore');
30
- var constants = require('./constants-1f3e27ab.js');
30
+ var constants = require('./constants-120c30b2.js');
31
31
  var uuid = require('uuid');
32
- var index$6 = require('./index-7f919539.js');
32
+ var index$6 = require('./index-9f4688ef.js');
33
33
  var miscTheme = require('./miscTheme.js');
34
34
  var constantsIsProduction = require('./constantsIsProduction.js');
35
- var index$7 = require('./index-cae3aba1.js');
35
+ var index$7 = require('./index-e936ea09.js');
36
36
  require('@mantine/dates');
37
- require('./index-7ebe364e.js');
38
- require('./index-85b8fcec.js');
39
- require('./index.styles-1cdd9f45.js');
40
- require('./translationsContext-dc7418e5.js');
37
+ require('./index-cb8d0724.js');
38
+ require('./index-19b5ac4a.js');
39
+ require('./index.styles-925fa616.js');
40
+ require('./translationsContext-fa010d5c.js');
41
41
  require('@mantine/hooks');
42
- require('./index-c297bc45.js');
42
+ require('./index-c0e193fd.js');
43
43
  var isEmpty = require('lodash/isEmpty');
44
44
  var reactHookForm = require('react-hook-form');
45
45
  var PhoneInputBase = require('react-phone-number-input');
46
46
  var api = require('@react-google-maps/api');
47
- var usePlacesAutocomplete = require('./usePlacesAutocomplete-a22b305a.js');
47
+ var usePlacesAutocomplete = require('./usePlacesAutocomplete-e7c267ce.js');
48
48
  var miscDefaultClassWrapper = require('./miscDefaultClassWrapper.js');
49
- var Locale = require('./Locale-7b990ab4.js');
50
- var InputDate = require('./InputDate-9b287d31.js');
51
- var index$8 = require('./index-4328a910.js');
52
- var index$9 = require('./index-41d5792a.js');
53
- var store = require('./store-60aef577.js');
54
- var utils$1 = require('./utils-5012b8fe.js');
49
+ var Locale = require('./Locale-9df5cd35.js');
50
+ var InputDate = require('./InputDate-8958fc82.js');
51
+ var index$8 = require('./index-6d9ba8ec.js');
52
+ var index$9 = require('./index-ddde3b74.js');
53
+ var store = require('./store-02cc282f.js');
54
+ var utils$1 = require('./utils-6cae04b9.js');
55
+ var index$c = require('./index-1832d185.js');
56
+ var StarRatings = require('react-star-ratings');
57
+ var moleculesArticleCard = require('./moleculesArticleCard.js');
58
+ var index$d = require('./index-c70814d1.js');
59
+ var index$e = require('./index-8ba96324.js');
55
60
  require('date-fns/locale');
56
61
  require('./constantsSite.js');
57
62
  require('./constantsRiskScreener.js');
58
- require('./index-e20b6ca5.js');
63
+ require('./index-242ff84e.js');
59
64
  require('./miscCookieHelper.js');
60
65
  require('slugify');
61
66
  require('./togetherApiPaths.js');
62
- require('./index-8108704a.js');
63
- require('./WhatsApp-9cf7b0ec.js');
64
- require('./Spinner-a712cfcb.js');
65
- require('./index-7e39e6a6.js');
66
- require('./shared-9f20667d.js');
67
- require('./index-217b689e.js');
67
+ require('./index-0da93b0a.js');
68
+ require('./WhatsApp-eaa42743.js');
69
+ require('./Spinner-a66ec1c0.js');
70
+ require('./index-051d6036.js');
71
+ require('./shared-d26a6abc.js');
72
+ require('./index-1f0ff43b.js');
68
73
  require('@mantine/carousel');
69
- require('./useUniqueId-e1bffd87.js');
74
+ require('./useUniqueId-5ca32ab7.js');
70
75
  require('@emotion/react');
71
76
  require('@hhgtech/icons/core');
72
77
  require('@mantine/notifications');
73
78
  require('zustand');
74
- require('./index-13132196.js');
75
- require('./normalizeLink-c361c763.js');
76
- require('./healthTools-ed870a63.js');
79
+ require('./index-444bced3.js');
80
+ require('./normalizeLink-0fde7b8b.js');
81
+ require('./healthTools-9fec8e6f.js');
77
82
 
78
83
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
79
84
 
@@ -88,6 +93,7 @@ var styled__default = /*#__PURE__*/_interopDefault(styled);
88
93
  var isSameOrBefore__default = /*#__PURE__*/_interopDefault(isSameOrBefore);
89
94
  var isEmpty__default = /*#__PURE__*/_interopDefault(isEmpty);
90
95
  var PhoneInputBase__default = /*#__PURE__*/_interopDefault(PhoneInputBase);
96
+ var StarRatings__default = /*#__PURE__*/_interopDefault(StarRatings);
91
97
 
92
98
  // extend fastdom
93
99
  const fastdom = fd__default["default"].extend(fastdomPromised__default["default"]);
@@ -169,7 +175,7 @@ const getSubotApiPath = (path, params) => {
169
175
  return apiUrl + formatString__default["default"](path, Object.assign({}, params));
170
176
  };
171
177
  /** inline message */
172
- const subotInlineMessage = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
178
+ const subotInlineMessage$1 = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
173
179
  try {
174
180
  return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_MESSAGE), 'POST', {
175
181
  data,
@@ -177,7 +183,7 @@ const subotInlineMessage = (data) => tslib_es6.__awaiter(void 0, void 0, void 0,
177
183
  }
178
184
  catch (error) { }
179
185
  });
180
- const computeExtraSettingsForBot = (data) => {
186
+ const computeExtraSettingsForBot$1 = (data) => {
181
187
  var _a;
182
188
  if ((data === null || data === void 0 ? void 0 : data._status) === 1 && ((_a = data === null || data === void 0 ? void 0 : data._data) === null || _a === void 0 ? void 0 : _a.extra_settings)) {
183
189
  try {
@@ -200,11 +206,11 @@ const computeExtraSettingsForBot = (data) => {
200
206
  return data;
201
207
  };
202
208
  /** inline first node */
203
- const subotInlineFirstNode = (id) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
209
+ const subotInlineFirstNode$1 = (id) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
204
210
  try {
205
211
  const data = yield CachedSystem.withCached('SubotInlineFirstNode/' + id, () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
206
212
  const response = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_FIRST_NODE) + `/${id}`, 'GET');
207
- computeExtraSettingsForBot(response);
213
+ computeExtraSettingsForBot$1(response);
208
214
  return response;
209
215
  }));
210
216
  return data;
@@ -214,7 +220,7 @@ const subotInlineFirstNode = (id) => tslib_es6.__awaiter(void 0, void 0, void 0,
214
220
  }
215
221
  });
216
222
  /** inline click */
217
- const subotInlineClick = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
223
+ const subotInlineClick$1 = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
218
224
  try {
219
225
  return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_CLICK), 'POST', {
220
226
  data,
@@ -223,7 +229,7 @@ const subotInlineClick = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, f
223
229
  catch (error) { }
224
230
  });
225
231
  /** inline impression */
226
- const subotInlineImpression = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
232
+ const subotInlineImpression$1 = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
227
233
  try {
228
234
  return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_IMPRESSION), 'POST', {
229
235
  data,
@@ -822,7 +828,7 @@ const detectToSkipNodeStart = (botItem, currentActiveId, currentListNodes) => {
822
828
  return [currentActiveId, currentListNodes];
823
829
  };
824
830
 
825
- const SubotInlineContext = React.createContext({
831
+ const SubotInlineContext$1 = React.createContext({
826
832
  activeId: '',
827
833
  params: {},
828
834
  listNodes: [],
@@ -935,7 +941,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
935
941
  let newActiveId = '';
936
942
  let nodes = [];
937
943
  setLoading(true);
938
- const resFirst = yield subotInlineFirstNode(params.bot_id);
944
+ const resFirst = yield subotInlineFirstNode$1(params.bot_id);
939
945
  if ((resFirst === null || resFirst === void 0 ? void 0 : resFirst._status) === 1) {
940
946
  newActiveId = resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.id.toString();
941
947
  nodes.push(resFirst === null || resFirst === void 0 ? void 0 : resFirst._data, resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.first_node);
@@ -953,7 +959,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
953
959
  if (previousState &&
954
960
  previousState.params.action_id &&
955
961
  previousState.params.action_value) {
956
- const resResultInline = yield subotInlineMessage(previousState.params);
962
+ const resResultInline = yield subotInlineMessage$1(previousState.params);
957
963
  if ((resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._status) === 1 && (resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node)) {
958
964
  newActiveId = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node.id;
959
965
  nodes = previousState.listNodes;
@@ -1022,7 +1028,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
1022
1028
  const onNext = React.useCallback((messageParams) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1023
1029
  if (messageParams === null || messageParams === void 0 ? void 0 : messageParams.node_id) {
1024
1030
  const newMessage = Object.assign(Object.assign({}, messageParams), getCurrentTotalDynamicScore(listNodes, activeId, messageParams.action_id));
1025
- const res = yield subotInlineMessage(newMessage);
1031
+ const res = yield subotInlineMessage$1(newMessage);
1026
1032
  setLoading(false);
1027
1033
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
1028
1034
  const _b = res === null || res === void 0 ? void 0 : res._data, { node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
@@ -1170,7 +1176,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
1170
1176
  if (!listNodes.length) {
1171
1177
  return null;
1172
1178
  }
1173
- return (React__default["default"].createElement(SubotInlineContext.Provider, { value: value },
1179
+ return (React__default["default"].createElement(SubotInlineContext$1.Provider, { value: value },
1174
1180
  React__default["default"].createElement("div", { ref: ref }, children)));
1175
1181
  };
1176
1182
 
@@ -1674,7 +1680,7 @@ const Container$u = () => {
1674
1680
  var _a, _b, _c;
1675
1681
  const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
1676
1682
  const currentUrl = useCurrentUrl();
1677
- const { listNodes, activeId, isShowFooter, onNext, onPrev, params, onStartOver, loading, } = React.useContext(SubotInlineContext);
1683
+ const { listNodes, activeId, isShowFooter, onNext, onPrev, params, onStartOver, loading, } = React.useContext(SubotInlineContext$1);
1678
1684
  const { value } = React.useContext(NodeContext);
1679
1685
  const validation = useValidationMultiOption();
1680
1686
  const botItem = listNodes[0];
@@ -2066,7 +2072,7 @@ const Container$s = ({ node, onClickStart }) => {
2066
2072
  const refImpression = React.useRef(false);
2067
2073
  const { ref, inView } = reactIntersectionObserver.useInView();
2068
2074
  const currentUrl = useCurrentUrl();
2069
- const { params, getParams, onNext, setIsShowFooter, listNodes } = React.useContext(SubotInlineContext);
2075
+ const { params, getParams, onNext, setIsShowFooter, listNodes } = React.useContext(SubotInlineContext$1);
2070
2076
  const botItem = listNodes[0];
2071
2077
  const botType = (_a = botItem === null || botItem === void 0 ? void 0 : botItem.extra_settings) === null || _a === void 0 ? void 0 : _a.subot_type;
2072
2078
  React.useMemo(() => {
@@ -2076,14 +2082,14 @@ const Container$s = ({ node, onClickStart }) => {
2076
2082
  if (!inView || refImpression.current) {
2077
2083
  return;
2078
2084
  }
2079
- subotInlineImpression(getParams());
2085
+ subotInlineImpression$1(getParams());
2080
2086
  refImpression.current = true;
2081
2087
  }, [inView]);
2082
2088
  const handleClickStart = () => {
2083
2089
  // 1. Tracking Event Click
2084
2090
  const params = getParams();
2085
2091
  params.device_id = index$1.checkMobile(window.navigator.userAgent) ? 2 : 1;
2086
- subotInlineClick(params);
2092
+ subotInlineClick$1(params);
2087
2093
  // 2. Call API to fetch next node
2088
2094
  onNext();
2089
2095
  onClickStart === null || onClickStart === void 0 ? void 0 : onClickStart();
@@ -2362,7 +2368,7 @@ const handleFrisoRedirecition = (listNode) => {
2362
2368
 
2363
2369
  const Container$r = ({ intent }) => {
2364
2370
  var _a;
2365
- const { listNodes } = React.useContext(SubotInlineContext);
2371
+ const { listNodes } = React.useContext(SubotInlineContext$1);
2366
2372
  const handleOnClick = () => {
2367
2373
  var _a;
2368
2374
  if ((_a = intent.url) === null || _a === void 0 ? void 0 : _a.includes('{{.frisoRedirectUrl}}')) {
@@ -2418,7 +2424,7 @@ const Container$q = ({ intent }) => {
2418
2424
  Container$q.displayName = 'SubotInlineIntentBotImage';
2419
2425
 
2420
2426
  const Container$p = ({ intent, indexNumber }) => {
2421
- const { listNodes } = React.useContext(SubotInlineContext);
2427
+ const { listNodes } = React.useContext(SubotInlineContext$1);
2422
2428
  const isShowLabel = ![index$2.NodeIntentType.SSO_INTENT].includes(intent === null || intent === void 0 ? void 0 : intent.type);
2423
2429
  const isText = [
2424
2430
  index$2.NodeIntentType.BOT_TEXT,
@@ -2452,7 +2458,7 @@ Container$p.displayName = 'SubotInlineIntentBotTitle';
2452
2458
 
2453
2459
  const Container$o = ({ intent }) => {
2454
2460
  const currentUrl = useCurrentUrl();
2455
- const { listNodes, activeId, params } = React.useContext(SubotInlineContext);
2461
+ const { listNodes, activeId, params } = React.useContext(SubotInlineContext$1);
2456
2462
  const foundNode = listNodes.find((n) => n.id == activeId);
2457
2463
  if (!intent.label || !foundNode) {
2458
2464
  return null;
@@ -2793,7 +2799,7 @@ const StyledWrap$e = styled__default["default"].div `
2793
2799
  `;
2794
2800
 
2795
2801
  const Container$k = ({ intent }) => {
2796
- const { listNodes } = React.useContext(SubotInlineContext);
2802
+ const { listNodes } = React.useContext(SubotInlineContext$1);
2797
2803
  if (!(intent === null || intent === void 0 ? void 0 : intent.label)) {
2798
2804
  return null;
2799
2805
  }
@@ -2854,15 +2860,15 @@ const Container$j = ({ intent }) => {
2854
2860
  };
2855
2861
  Container$j.displayName = 'SubotInlineIntentSSO';
2856
2862
 
2857
- var _a$1;
2858
- const SubotInlineIntentCol = styled__default["default"].div `
2863
+ var _a$2;
2864
+ const SubotInlineIntentCol$1 = styled__default["default"].div `
2859
2865
  width: ${({ width }) => width || '100%'};
2860
2866
  padding: 4px;
2861
2867
  ${utils.MediaQueries.mbDown} {
2862
2868
  width: 100%;
2863
2869
  }
2864
2870
  `;
2865
- const SubotInlineIntentUrlContainer = styled__default["default"].div `
2871
+ const SubotInlineIntentUrlContainer$1 = styled__default["default"].div `
2866
2872
  display: flex;
2867
2873
  .feature {
2868
2874
  width: 30%;
@@ -2890,7 +2896,7 @@ const SubotInlineIntentUrlContainer = styled__default["default"].div `
2890
2896
  margin-left: 10px;
2891
2897
  line-height: 1.5;
2892
2898
  a {
2893
- color: ${((_a$1 = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _a$1 === void 0 ? void 0 : _a$1.gray800) || '#262626'};
2899
+ color: ${((_a$2 = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _a$2 === void 0 ? void 0 : _a$2.gray800) || '#262626'};
2894
2900
  text-decoration: none;
2895
2901
  }
2896
2902
  }
@@ -2900,8 +2906,8 @@ const Container$i = ({ intent, }) => {
2900
2906
  const article = React.useMemo(() => intent.label.includes('{')
2901
2907
  ? JSON.parse(intent.label)
2902
2908
  : {}, [intent.label]);
2903
- return (React__default["default"].createElement(React__default["default"].Fragment, null, !!Object.keys(article).length && (React__default["default"].createElement(SubotInlineIntentCol, null,
2904
- React__default["default"].createElement(SubotInlineIntentUrlContainer, null,
2909
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, !!Object.keys(article).length && (React__default["default"].createElement(SubotInlineIntentCol$1, null,
2910
+ React__default["default"].createElement(SubotInlineIntentUrlContainer$1, null,
2905
2911
  React__default["default"].createElement("div", { className: "feature" },
2906
2912
  React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature-wrapper" },
2907
2913
  React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title, className: "feature-img" }))),
@@ -2938,7 +2944,7 @@ const SubotInlineIntentBaseTarget = {
2938
2944
  /** intents fake for sso block */
2939
2945
  [index$2.NodeIntentType.SSO_INTENT]: Container$j,
2940
2946
  };
2941
- const SubotInlineIntentBase = new Proxy(SubotInlineIntentBaseTarget, {
2947
+ const SubotInlineIntentBase$1 = new Proxy(SubotInlineIntentBaseTarget, {
2942
2948
  get(_, prop) {
2943
2949
  const UnknowComponent = () => {
2944
2950
  if (constantsIsProduction.isProduction)
@@ -2965,7 +2971,7 @@ const Container$h = ({ intents: intentsProp, indexNumber, }) => {
2965
2971
  const intentType = (intent === null || intent === void 0 ? void 0 : intent.type) || '';
2966
2972
  if (excludeIntents.includes(intentType))
2967
2973
  return null;
2968
- const NodeIntent = SubotInlineIntentBase[intentType];
2974
+ const NodeIntent = SubotInlineIntentBase$1[intentType];
2969
2975
  return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
2970
2976
  })))));
2971
2977
  };
@@ -2973,7 +2979,7 @@ Container$h.displayName = 'SubotInlineIntent';
2973
2979
 
2974
2980
  const Container$g = ({ node }) => {
2975
2981
  var _a, _b;
2976
- const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext);
2982
+ const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext$1);
2977
2983
  const botItem = listNodes[0];
2978
2984
  React.useMemo(() => {
2979
2985
  setIsShowFooter(true);
@@ -3164,7 +3170,7 @@ const SubInlineIntent = ({ subIntents }) => {
3164
3170
  React__default["default"].createElement(ChevronDown, { className: "si-chevron-down" })),
3165
3171
  React__default["default"].createElement(framerMotion.motion.div, { className: "si-sub-intent-expand", animate: isShow ? { height: 'auto' } : { height: 0 }, transition: { duration: 0.3 }, "data-show": isShow }, restSubIntents.map((intent) => {
3166
3172
  const intentType = (intent === null || intent === void 0 ? void 0 : intent.type) || '';
3167
- const NodeIntent = SubotInlineIntentBase[intentType];
3173
+ const NodeIntent = SubotInlineIntentBase$1[intentType];
3168
3174
  return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
3169
3175
  }))));
3170
3176
  };
@@ -3175,7 +3181,7 @@ const Container$f = ({ node }) => {
3175
3181
  // const isMobile = useGetIsMobile(true)
3176
3182
  const refMainIntents = React.useRef(null);
3177
3183
  const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
3178
- const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext);
3184
+ const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext$1);
3179
3185
  const [isShowMore, setIsShowMore] = React.useState(false);
3180
3186
  React.useEffect(() => {
3181
3187
  var _a;
@@ -3280,11 +3286,11 @@ const Container$f = ({ node }) => {
3280
3286
  defaultMessage: 'See more',
3281
3287
  }))),
3282
3288
  React__default["default"].createElement("div", { className: "wrap-main-button-intent" }, (_a = [...mainButtonIntents, ...bookingButtonIntents]) === null || _a === void 0 ? void 0 : _a.map((intent) => {
3283
- const NodeIntent = SubotInlineIntentBase[intent.type || ''];
3289
+ const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
3284
3290
  return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
3285
3291
  })),
3286
3292
  (suggestedServiceIntents === null || suggestedServiceIntents === void 0 ? void 0 : suggestedServiceIntents.length) > 0 && (React__default["default"].createElement("div", null, suggestedServiceIntents.map((intent) => {
3287
- const NodeIntent = SubotInlineIntentBase[intent.type || ''];
3293
+ const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
3288
3294
  return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
3289
3295
  }))),
3290
3296
  (relatedArticleIntents === null || relatedArticleIntents === void 0 ? void 0 : relatedArticleIntents.length) > 0 && (React__default["default"].createElement("div", { style: { marginTop: 24 } },
@@ -3293,7 +3299,7 @@ const Container$f = ({ node }) => {
3293
3299
  defaultMessage: 'Related Articles',
3294
3300
  })),
3295
3301
  React__default["default"].createElement("div", { style: { padding: '8px 0' } }, relatedArticleIntents.map((intent) => {
3296
- const NodeIntent = SubotInlineIntentBase[intent.type || ''];
3302
+ const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
3297
3303
  return (NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent }));
3298
3304
  })))),
3299
3305
  React__default["default"].createElement(SubInlineIntent, { subIntents: subIntents })));
@@ -3307,7 +3313,7 @@ const StyledWrap$b = styled__default["default"].div `
3307
3313
  `;
3308
3314
 
3309
3315
  const Container$e = ({ node }) => {
3310
- const { params, onNext, setIsShowFooter } = React.useContext(SubotInlineContext);
3316
+ const { params, onNext, setIsShowFooter } = React.useContext(SubotInlineContext$1);
3311
3317
  React.useMemo(() => {
3312
3318
  setIsShowFooter(true);
3313
3319
  }, []);
@@ -3719,7 +3725,7 @@ const CountDown = ({ onFinish, onClick, isFinished, resendLabel, className }, re
3719
3725
  };
3720
3726
  var CountDown$1 = React.forwardRef(CountDown);
3721
3727
 
3722
- styled__default["default"].div `
3728
+ const StyledUserInfoFormContainer$1 = styled__default["default"].div `
3723
3729
  margin: 0 auto;
3724
3730
  background: #f7f9fc;
3725
3731
  border-radius: ${miscTheme.theme.borderRadius};
@@ -4651,7 +4657,7 @@ const OTP_VERIFIED_MSG_CODE = {
4651
4657
  },
4652
4658
  };
4653
4659
 
4654
- var _a, _b, _c, _d, _e;
4660
+ var _a$1, _b$1, _c$1, _d$1, _e$1;
4655
4661
  const StyledPhoneCode = styled__default["default"].div `
4656
4662
  display: flex;
4657
4663
  align-items: center;
@@ -4663,21 +4669,21 @@ const StyledPhoneCode = styled__default["default"].div `
4663
4669
  border-radius: 2px;
4664
4670
  }
4665
4671
  > div {
4666
- color: ${((_a = miscTheme.theme.colors) === null || _a === void 0 ? void 0 : _a.gray800) || ''};
4672
+ color: ${((_a$1 = miscTheme.theme.colors) === null || _a$1 === void 0 ? void 0 : _a$1.gray800) || ''};
4667
4673
  white-space: nowrap;
4668
4674
  }
4669
4675
  `;
4670
4676
  styled__default["default"](PhoneInputBase__default["default"]) `
4671
4677
  display: flex;
4672
- border: 1px solid ${((_b = miscTheme.theme.colors) === null || _b === void 0 ? void 0 : _b.gray200) || ''};
4678
+ border: 1px solid ${((_b$1 = miscTheme.theme.colors) === null || _b$1 === void 0 ? void 0 : _b$1.gray200) || ''};
4673
4679
  border-radius: ${miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.borderRadius};
4674
4680
  .PhoneInputCountry {
4675
4681
  position: relative;
4676
4682
  padding: 12px 8px 12px 16px;
4677
- border-right: 1px solid ${((_c = miscTheme.theme.colors) === null || _c === void 0 ? void 0 : _c.gray200) || ''};
4678
- background-color: ${((_d = miscTheme.theme.colors) === null || _d === void 0 ? void 0 : _d.gray100) || ''};
4683
+ border-right: 1px solid ${((_c$1 = miscTheme.theme.colors) === null || _c$1 === void 0 ? void 0 : _c$1.gray200) || ''};
4684
+ background-color: ${((_d$1 = miscTheme.theme.colors) === null || _d$1 === void 0 ? void 0 : _d$1.gray100) || ''};
4679
4685
  border-radius: 6px 0 0 6px;
4680
- color: ${((_e = miscTheme.theme.colors) === null || _e === void 0 ? void 0 : _e.gray800) || ''};
4686
+ color: ${((_e$1 = miscTheme.theme.colors) === null || _e$1 === void 0 ? void 0 : _e$1.gray800) || ''};
4681
4687
  .PhoneInputCountrySelect {
4682
4688
  position: absolute;
4683
4689
  top: 0;
@@ -5514,14 +5520,14 @@ const StyledWrap$a = styled__default["default"].div `
5514
5520
  const Container$d = ({ node, indexNumber }) => {
5515
5521
  var _a;
5516
5522
  const locale = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.locale;
5517
- const { params, listNodes, activeId, onSubmit, setIsShowFooter } = React.useContext(SubotInlineContext);
5523
+ const { params, listNodes, activeId, onSubmit, setIsShowFooter } = React.useContext(SubotInlineContext$1);
5518
5524
  React.useMemo(() => {
5519
5525
  setIsShowFooter(true);
5520
5526
  }, []);
5521
5527
  const handleSubmit = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
5522
5528
  checkSyncDataOnFrisoCampaign(listNodes[0], data.form_submit_meta);
5523
5529
  const _message = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, params), node._message), data), getCurrentTotalDynamicScore(listNodes, activeId, data.action_id, data.form_submit_meta)), { node_id: node.id });
5524
- const res = yield subotInlineMessage(_message);
5530
+ const res = yield subotInlineMessage$1(_message);
5525
5531
  // asking
5526
5532
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
5527
5533
  const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
@@ -5686,7 +5692,7 @@ const StyledWrap$7 = styled__default["default"].div `
5686
5692
  `;
5687
5693
  const Container$c = ({ action, active, onChange, htmlType, }) => {
5688
5694
  const currentUrl = useCurrentUrl();
5689
- const { params } = React.useContext(SubotInlineContext);
5695
+ const { params } = React.useContext(SubotInlineContext$1);
5690
5696
  return (React__default["default"].createElement(StyledWrap$7, { className: "si-action-img-choice", onClick: () => onChange && onChange(action), active: !!active, "data-event-category": "Service Connection", "data-event-action": "Risk Screening Answer Click", "data-event-label": currentUrl, "data-bot-id": params.bot_id },
5691
5697
  React__default["default"].createElement("div", { className: "si-action-image-wrap" },
5692
5698
  React__default["default"].createElement("img", { loading: "lazy", src: action === null || action === void 0 ? void 0 : action.url, alt: action === null || action === void 0 ? void 0 : action.label })),
@@ -5702,7 +5708,7 @@ const StyledWrap$6 = styled__default["default"].div `
5702
5708
  `;
5703
5709
  const Container$b = ({ action, onChange }) => {
5704
5710
  const currentUrl = useCurrentUrl();
5705
- const { params, activeId } = React.useContext(SubotInlineContext);
5711
+ const { params, activeId } = React.useContext(SubotInlineContext$1);
5706
5712
  return (React__default["default"].createElement(StyledWrap$6, null,
5707
5713
  React__default["default"].createElement(index$4.Button, { onClick: () => onChange && onChange(action), size: "lg", "data-event-category": "Service Connection", "data-event-action": "Risk Screening Sign Up for Result", "data-event-label": currentUrl, "data-bot-id": params.bot_id, "data-event-question-id": activeId, styles: {
5708
5714
  root: {
@@ -5764,7 +5770,7 @@ const Container$a = ({ action, onChange, active, htmlType, formSubmitMeta, }) =>
5764
5770
  const currentUrl = useCurrentUrl();
5765
5771
  const inputRef = React.useRef(null);
5766
5772
  const [otherText, setOtherText] = React.useState('');
5767
- const { params } = React.useContext(SubotInlineContext);
5773
+ const { params } = React.useContext(SubotInlineContext$1);
5768
5774
  const isActionPollWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
5769
5775
  const isActionSelectWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
5770
5776
  isActionPollWithOther;
@@ -5848,7 +5854,7 @@ const SubotInlineActionBaseTarget = {
5848
5854
  // [NodeActionType.RESULT_BUTTON]: SubotInlineActionTextChoice,
5849
5855
  // [NodeActionType.POLL_RESULT]: SubotInlinePollResult,
5850
5856
  };
5851
- const SubotInlineActionBase = new Proxy(SubotInlineActionBaseTarget, {
5857
+ const SubotInlineActionBase$1 = new Proxy(SubotInlineActionBaseTarget, {
5852
5858
  get(_, prop) {
5853
5859
  const UnknowComponent = () => {
5854
5860
  if (constantsIsProduction.isProduction)
@@ -5879,14 +5885,14 @@ const Container$7 = ({ actions, value, onChange, htmlType, node_type, formSubmit
5879
5885
  const actionType = action.type;
5880
5886
  if (excludeActions.includes(actionType))
5881
5887
  return null;
5882
- const NodeAction = SubotInlineActionBase[action.type];
5888
+ const NodeAction = SubotInlineActionBase$1[action.type];
5883
5889
  return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: onChange, active: value === null || value === void 0 ? void 0 : value.includes(action.id), htmlType: htmlType, formSubmitMeta: formSubmitMeta })));
5884
5890
  })));
5885
5891
  };
5886
5892
  Container$7.displayName = 'SubotInlineAction';
5887
5893
 
5888
5894
  const Container$6 = ({ node, indexNumber }) => {
5889
- const { params, listNodes, activeId, onSubmit, setIsShowFooter, setLoading } = React.useContext(SubotInlineContext);
5895
+ const { params, listNodes, activeId, onSubmit, setIsShowFooter, setLoading } = React.useContext(SubotInlineContext$1);
5890
5896
  const { value, setValue } = React.useContext(NodeContext);
5891
5897
  React.useMemo(() => {
5892
5898
  setIsShowFooter(true);
@@ -5901,7 +5907,7 @@ const Container$6 = ({ node, indexNumber }) => {
5901
5907
  setValue(Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }));
5902
5908
  const newParams = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }), getCurrentTotalDynamicScore(listNodes, activeId, action.id));
5903
5909
  setLoading(true);
5904
- const res = yield subotInlineMessage(newParams);
5910
+ const res = yield subotInlineMessage$1(newParams);
5905
5911
  setLoading(false);
5906
5912
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
5907
5913
  const _a = res === null || res === void 0 ? void 0 : res._data, { node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
@@ -5926,7 +5932,7 @@ const StyledWrap$3 = styled__default["default"].div `
5926
5932
 
5927
5933
  const Container$5 = ({ node, indexNumber }) => {
5928
5934
  var _a;
5929
- const { setIsShowFooter, onChange } = React.useContext(SubotInlineContext);
5935
+ const { setIsShowFooter, onChange } = React.useContext(SubotInlineContext$1);
5930
5936
  const { value, setValue } = React.useContext(NodeContext);
5931
5937
  React.useMemo(() => {
5932
5938
  setIsShowFooter(true);
@@ -6038,7 +6044,7 @@ const StyledWrap$2 = styled__default["default"].div `
6038
6044
  `;
6039
6045
 
6040
6046
  const Container$4 = ({ node, indexNumber }) => {
6041
- const { onChange, setIsShowFooter } = React.useContext(SubotInlineContext);
6047
+ const { onChange, setIsShowFooter } = React.useContext(SubotInlineContext$1);
6042
6048
  const { value, setValue } = React.useContext(NodeContext);
6043
6049
  const descriptionNode = useDescriptionPollNode({ node });
6044
6050
  React.useMemo(() => {
@@ -6113,7 +6119,7 @@ const StyledWrap$1 = styled__default["default"].div ``;
6113
6119
  const Container$3 = ({ node }) => {
6114
6120
  const refIsTrigger = React.useRef(false);
6115
6121
  const { formatMessage: f, data: { userInfo }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
6116
- const { params, setIsShowFooter, listNodes, activeId } = React.useContext(SubotInlineContext);
6122
+ const { params, setIsShowFooter, listNodes, activeId } = React.useContext(SubotInlineContext$1);
6117
6123
  React.useMemo(() => {
6118
6124
  setIsShowFooter(true);
6119
6125
  }, []);
@@ -6175,7 +6181,7 @@ const StyledWrap = styled__default["default"].div `
6175
6181
  `;
6176
6182
 
6177
6183
  const Container$2 = ({ node, indexNumber }) => {
6178
- const { params, onSubmit, setIsShowFooter, listNodes, activeId, setLoading, onChange, } = React.useContext(SubotInlineContext);
6184
+ const { params, onSubmit, setIsShowFooter, listNodes, activeId, setLoading, onChange, } = React.useContext(SubotInlineContext$1);
6179
6185
  const { value, setValue } = React.useContext(NodeContext);
6180
6186
  React.useMemo(() => {
6181
6187
  setIsShowFooter(true);
@@ -6191,7 +6197,7 @@ const Container$2 = ({ node, indexNumber }) => {
6191
6197
  const handleOnChangeNormal = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
6192
6198
  const newParams = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, form_submit_meta: undefined }), getCurrentTotalDynamicScore(listNodes, activeId, action.id));
6193
6199
  setLoading(true);
6194
- const res = yield subotInlineMessage(newParams);
6200
+ const res = yield subotInlineMessage$1(newParams);
6195
6201
  setLoading(false);
6196
6202
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
6197
6203
  const _a = res === null || res === void 0 ? void 0 : res._data, { node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
@@ -6239,7 +6245,7 @@ const SubotInlineNodeBaseTarget = {
6239
6245
  // RESULT_RATING = 12,
6240
6246
  // RESULT_REACTION = 13,
6241
6247
  };
6242
- const SubotInlineNodeBase = new Proxy(SubotInlineNodeBaseTarget, {
6248
+ const SubotInlineNodeBase$1 = new Proxy(SubotInlineNodeBaseTarget, {
6243
6249
  get(_, prop) {
6244
6250
  const UnknowComponent = () => {
6245
6251
  if (constantsIsProduction.isProduction)
@@ -6254,7 +6260,7 @@ const SubotInlineNodeBase = new Proxy(SubotInlineNodeBaseTarget, {
6254
6260
 
6255
6261
  const Container$1 = ({ onClickStart }) => {
6256
6262
  var _a;
6257
- const { listNodes, activeId, isDisabledAnimationOnMobile } = React.useContext(SubotInlineContext);
6263
+ const { listNodes, activeId, isDisabledAnimationOnMobile } = React.useContext(SubotInlineContext$1);
6258
6264
  const foundIdx = React.useMemo(() => {
6259
6265
  return listNodes.findIndex((n) => n.id == activeId);
6260
6266
  }, [listNodes, activeId]);
@@ -6275,10 +6281,10 @@ const Container$1 = ({ onClickStart }) => {
6275
6281
  const nodeType = index$2.NodeType[node.type].valueOf();
6276
6282
  const nodeTypeSSO = (_a = index$2.NodePosition[node.position]) === null || _a === void 0 ? void 0 : _a.valueOf();
6277
6283
  let NodeComponent = node.position === index$2.NodePosition.SSO
6278
- ? SubotInlineNodeBase[nodeTypeSSO]
6279
- : SubotInlineNodeBase[nodeType];
6284
+ ? SubotInlineNodeBase$1[nodeTypeSSO]
6285
+ : SubotInlineNodeBase$1[nodeType];
6280
6286
  if (node.is_multi_select && node.type !== index$2.NodeType.POLL) {
6281
- NodeComponent = SubotInlineNodeBase['MULTIPLE'];
6287
+ NodeComponent = SubotInlineNodeBase$1['MULTIPLE'];
6282
6288
  }
6283
6289
  return (React__default["default"].createElement(framerMotion.motion.div, { key: node.id, initial: { opacity: 1, y: -300 }, animate: { opacity: 1, y: 0 }, transition: {
6284
6290
  y: { type: 'spring', stiffness: 300, damping: 30 },
@@ -6316,7 +6322,7 @@ const View = ({ loading, backgroundImage, isShowFooter, isFullContainer, isDisab
6316
6322
  backgroundRepeat: 'no-repeat',
6317
6323
  backgroundPosition: 'center',
6318
6324
  }), [backgroundImage]);
6319
- const { isMobile, locale } = React.useContext(SubotInlineContext);
6325
+ const { isMobile, locale } = React.useContext(SubotInlineContext$1);
6320
6326
  const [isDisplayFullMobile, setIsDisplayFullMobile] = React.useState(false);
6321
6327
  React.useEffect(() => {
6322
6328
  if (isDisplayFullMobile) {
@@ -6379,7 +6385,7 @@ const ViewWithMemo = React.memo(View);
6379
6385
  ViewWithMemo.displayName = 'SubotInlineRevampView';
6380
6386
 
6381
6387
  const Container = () => {
6382
- const { loading, listNodes, isShowFooter, activeId, isFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, bgImgFullContainer, typeFormProps, } = React.useContext(SubotInlineContext);
6388
+ const { loading, listNodes, isShowFooter, activeId, isFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, bgImgFullContainer, typeFormProps, } = React.useContext(SubotInlineContext$1);
6383
6389
  const backgroundImage = React.useMemo(() => {
6384
6390
  var _a, _b;
6385
6391
  const foundNode = listNodes.find((n) => n.id == activeId);
@@ -6436,6 +6442,3156 @@ const SubotInlineRevampWithTheme = (props) => {
6436
6442
  return (React__default["default"].createElement(ContainerWithProvider, Object.assign({}, props, { primaryColor: (_b = (_a = botData.extra_settings) === null || _a === void 0 ? void 0 : _a.inline_styles) === null || _b === void 0 ? void 0 : _b.primary_color, textColor: (_d = (_c = botData.extra_settings) === null || _c === void 0 ? void 0 : _c.inline_styles) === null || _d === void 0 ? void 0 : _d.text_color, textButtonColor: (_f = (_e = botData.extra_settings) === null || _e === void 0 ? void 0 : _e.inline_styles) === null || _f === void 0 ? void 0 : _f.text_button_color, bgColor: (_h = (_g = botData.extra_settings) === null || _g === void 0 ? void 0 : _g.inline_styles) === null || _h === void 0 ? void 0 : _h.container_bg_color, bgContentColor: (_k = (_j = botData.extra_settings) === null || _j === void 0 ? void 0 : _j.inline_styles) === null || _k === void 0 ? void 0 : _k.content_bg_color, bgImgFullContainer: (_m = (_l = botData.extra_settings) === null || _l === void 0 ? void 0 : _l.inline_styles) === null || _m === void 0 ? void 0 : _m.container_bg_image })));
6437
6443
  };
6438
6444
 
6445
+ const SubotInlineContext = React.createContext({
6446
+ activeId: '',
6447
+ params: {},
6448
+ nodes: [],
6449
+ getParams: () => ({}),
6450
+ trackingCommonInline: {},
6451
+ });
6452
+ /** inline click */
6453
+ const subotInlineClick = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
6454
+ try {
6455
+ return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_CLICK), 'POST', {
6456
+ data,
6457
+ });
6458
+ }
6459
+ catch (error) { }
6460
+ });
6461
+ /** inline impression */
6462
+ const subotInlineImpression = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
6463
+ try {
6464
+ return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_IMPRESSION), 'POST', {
6465
+ data,
6466
+ });
6467
+ }
6468
+ catch (error) { }
6469
+ });
6470
+ /** inline message */
6471
+ const subotInlineMessage = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
6472
+ try {
6473
+ return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_MESSAGE), 'POST', {
6474
+ data,
6475
+ });
6476
+ }
6477
+ catch (error) { }
6478
+ });
6479
+ const computeExtraSettingsForBot = (data) => {
6480
+ var _a;
6481
+ if ((data === null || data === void 0 ? void 0 : data._status) === 1 && ((_a = data === null || data === void 0 ? void 0 : data._data) === null || _a === void 0 ? void 0 : _a.extra_settings)) {
6482
+ try {
6483
+ const extraSettingsObj = JSON.parse(data._data.extra_settings);
6484
+ if (typeof extraSettingsObj === 'object') {
6485
+ data._data.extra_settings = extraSettingsObj;
6486
+ }
6487
+ else {
6488
+ data._data.extra_settings = {
6489
+ sync_data_friso_campaign: false,
6490
+ };
6491
+ }
6492
+ }
6493
+ catch (err) {
6494
+ data._data.extra_settings = {
6495
+ sync_data_friso_campaign: false,
6496
+ };
6497
+ }
6498
+ }
6499
+ return data;
6500
+ };
6501
+ /** inline first node */
6502
+ const subotInlineFirstNode = (id) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
6503
+ try {
6504
+ const data = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_FIRST_NODE) + `/${id}`, 'GET');
6505
+ computeExtraSettingsForBot(data);
6506
+ return data;
6507
+ }
6508
+ catch (error) { }
6509
+ });
6510
+
6511
+ const SubotInlineFormContainer = styled__default["default"].div `
6512
+ margin-top: 2rem;
6513
+ .form {
6514
+ background-color: ${miscTheme.theme.colors.white || '#fff'};
6515
+ }
6516
+ `;
6517
+ const SubotInlineIntentContainer = styled__default["default"].div ``;
6518
+ const SubotInlineActionContainer = styled__default["default"].div `
6519
+ margin-top: 1.25rem;
6520
+ `;
6521
+ const SubotInlineReviewContainer = styled__default["default"].div `
6522
+ margin-bottom: 1rem;
6523
+ `;
6524
+ const SubotInlineDescription$1 = styled__default["default"].div `
6525
+ font-weight: 400;
6526
+ font-size: 16px;
6527
+ line-height: 24px;
6528
+ color: #595959;
6529
+ font-style: italic;
6530
+ `;
6531
+ const SubotInlineFinalButton = styled__default["default"](index$8.Button) `
6532
+ position: relative;
6533
+ min-width: 180px;
6534
+ svg {
6535
+ path {
6536
+ stroke: currentColor;
6537
+ }
6538
+ }
6539
+ &:hover {
6540
+ svg {
6541
+ path {
6542
+ stroke: currentColor;
6543
+ }
6544
+ }
6545
+ }
6546
+ `;
6547
+ const SubotInlineFinalMoreContainer = styled__default["default"].div `
6548
+ display: flex;
6549
+ align-items: center;
6550
+ justify-content: center;
6551
+ `;
6552
+ const SubotInlineFinalWrapper = styled__default["default"].div `
6553
+ position: relative;
6554
+ overflow: ${({ isMore }) => (isMore ? 'unset' : 'hidden')};
6555
+ max-height: ${({ maxHeight }) => (maxHeight ? maxHeight + 'px' : 'auto')};
6556
+ margin-bottom: 8px;
6557
+ transition: 0.25s all linear;
6558
+ &:before {
6559
+ position: absolute;
6560
+ z-index: 1;
6561
+ top: 50%;
6562
+ right: 0;
6563
+ bottom: 0;
6564
+ left: 0;
6565
+ background-image: linear-gradient(
6566
+ to top,
6567
+ ${miscTheme.theme.colors.neutral50 || '#F7F9FC'} 0%,
6568
+ transparent 100%
6569
+ );
6570
+ content: '';
6571
+ pointer-events: none;
6572
+ ${({ isMore }) => isMore && `opacity: 0;`}
6573
+ }
6574
+ `;
6575
+ const SubotInlineFinalContainer = styled__default["default"].div `
6576
+ position: relative;
6577
+ padding: 32px 32px 16px;
6578
+ background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
6579
+ border-radius: ${miscTheme.theme.borderRadius};
6580
+ ${utils.MediaQueries.tdDown} {
6581
+ padding: 24px 24px 16px;
6582
+ }
6583
+ ${utils.MediaQueries.mbDown} {
6584
+ padding: 16px;
6585
+ border-radius: 0px;
6586
+ }
6587
+ `;
6588
+ const SubotInlineWrapper$1 = styled__default["default"].div `
6589
+ padding: 12px 32px 32px;
6590
+ ${utils.MediaQueries.tdDown} {
6591
+ padding: 12px 24px 24px;
6592
+ }
6593
+ ${utils.MediaQueries.mbDown} {
6594
+ padding: 12px 16px 16px;
6595
+ }
6596
+ `;
6597
+ const SubotInlineContainer$1 = styled__default["default"].div `
6598
+ border: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
6599
+ background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
6600
+ border-radius: ${miscTheme.theme.borderRadius};
6601
+ ${utils.MediaQueries.mbDown} {
6602
+ border: none;
6603
+ }
6604
+ `;
6605
+
6606
+ const CheckboxIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6607
+ React__default["default"].createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11 21C16.5228 21 21 16.5228 21 11C21 5.47715 16.5228 1 11 1C5.47715 1 1 5.47715 1 11C1 16.5228 5.47715 21 11 21Z", fill: "#2D87F3", stroke: "#2D87F3", strokeWidth: "2" }),
6608
+ React__default["default"].createElement("path", { d: "M15.5714 8L9.67857 14L7 11.2727", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })));
6609
+
6610
+ const CheckIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6611
+ React__default["default"].createElement("path", { d: "M13.3346 4L6.0013 11.3333L2.66797 8", stroke: "#737373", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })));
6612
+
6613
+ const LikeIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6614
+ React__default["default"].createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.0521 5.70293L11.8834 2L12.6635 2.03149C12.6635 2.03149 13.5407 2.05593 14.4487 2.51311C15.3568 2.9703 16.375 4.04935 16.375 5.69552C16.375 6.76085 16.1102 7.83874 15.8458 8.67047H20.125C21.1497 8.67047 22 9.53063 22 10.5673V12.8847C22 13.1046 21.9497 13.3294 21.8462 13.533L18.6437 19.9571C18.3261 20.5939 17.6767 21 16.9701 21H8.875C7.85025 21 7 20.1398 7 19.1031V10.0579C7 9.50164 7.24299 8.97147 7.66284 8.61119L11.0521 5.70293ZM13.4432 4.15712C13.4125 4.15279 13.3784 4.14799 13.3263 4.1321L12.7422 6.73842L8.875 10.0579V19.1031H16.9701L20.125 12.7717V10.5673H13.0864L13.6357 9.25027C13.6357 9.25027 14.5 7.01241 14.5 5.69552C14.5 4.74112 14.1119 4.46257 13.6138 4.21176C13.5294 4.16929 13.4902 4.16376 13.4432 4.15712Z", fill: "#595959" }),
6615
+ React__default["default"].createElement("path", { d: "M2 10.5C2 9.672 2.672 9 3.5 9C4.328 9 5 9.672 5 10.5V19.5C5 20.328 4.328 21 3.5 21C2.672 21 2 20.328 2 19.5V10.5Z", fill: "#595959" })));
6616
+
6617
+ const DislikeIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6618
+ React__default["default"].createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.0521 17.2971L11.8834 21L12.6635 20.9685C12.6635 20.9685 13.5407 20.9441 14.4487 20.4869C15.3568 20.0297 16.375 18.9507 16.375 17.3045C16.375 16.2391 16.1102 15.1613 15.8458 14.3295H20.125C21.1497 14.3295 22 13.4694 22 12.4327V10.1153C22 9.89545 21.9497 9.6706 21.8462 9.467L18.6437 3.0429C18.3261 2.40607 17.6767 2 16.9701 2H8.875C7.85025 2 7 2.86016 7 3.89685V12.9421C7 13.4984 7.24299 14.0285 7.66284 14.3888L11.0521 17.2971ZM13.4432 18.8429C13.4125 18.8472 13.3784 18.852 13.3263 18.8679L12.7422 16.2616L8.875 12.9421V3.89685H16.9701L20.125 10.2283V12.4327H13.0864L13.6357 13.7497C13.6357 13.7497 14.5 15.9876 14.5 17.3045C14.5 18.2589 14.1119 18.5374 13.6138 18.7882C13.5294 18.8307 13.4902 18.8362 13.4432 18.8429Z", fill: "#595959" }),
6619
+ React__default["default"].createElement("path", { d: "M2 12.5C2 13.328 2.672 14 3.5 14C4.328 14 5 13.328 5 12.5V3.5C5 2.672 4.328 2 3.5 2C2.672 2 2 2.672 2 3.5V12.5Z", fill: "#595959" })));
6620
+
6621
+ const ArrowDown = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6622
+ React__default["default"].createElement("path", { d: "M1 1L5 5L9 1", stroke: "#595959", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
6623
+
6624
+ const ArrowLeft = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "7", height: "10", viewBox: "0 0 7 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6625
+ React__default["default"].createElement("path", { d: "M5.5 9L1.5 5L5.5 1", stroke: "#2D87F3", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
6626
+
6627
+ const ArrowRight = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "7", height: "10", viewBox: "0 0 7 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6628
+ React__default["default"].createElement("path", { d: "M1.5 9L5.5 5L1.5 1", stroke: "#2D87F3", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
6629
+
6630
+ const ArrowUp = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6631
+ React__default["default"].createElement("path", { d: "M1 5L5 1L9 5", stroke: "#FC5D9A", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
6632
+
6633
+ const ChevronRightActive = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6634
+ React__default["default"].createElement("path", { d: "M6 12L10 8L6 4", stroke: "#2D87F3", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })));
6635
+
6636
+ const RotateLeft = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6637
+ React__default["default"].createElement("g", { clipPath: "url(#clip0)" },
6638
+ React__default["default"].createElement("path", { d: "M0.666626 2.6665V6.6665H4.66663", stroke: "#737373", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }),
6639
+ React__default["default"].createElement("path", { d: "M2.33996 10.0001C2.77222 11.227 3.59152 12.2802 4.6744 13.001C5.75728 13.7218 7.04508 14.0712 8.34377 13.9964C9.64246 13.9217 10.8817 13.4269 11.8747 12.5866C12.8677 11.7464 13.5608 10.6061 13.8494 9.3377C14.1381 8.06929 14.0067 6.74143 13.475 5.55419C12.9434 4.36696 12.0403 3.38466 10.9018 2.7553C9.76339 2.12595 8.45123 1.88364 7.16308 2.06487C5.87493 2.24611 4.68057 2.84108 3.75996 3.76013L0.666626 6.6668", stroke: "#737373", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })),
6640
+ React__default["default"].createElement("defs", null,
6641
+ React__default["default"].createElement("clipPath", { id: "clip0" },
6642
+ React__default["default"].createElement("rect", { width: "16", height: "16", fill: "white" })))));
6643
+
6644
+ var _a, _b, _c, _d, _e, _f, _g;
6645
+ const SubotInlineButtonReaction = styled__default["default"].div `
6646
+ display: flex;
6647
+ align-items: center;
6648
+ justify-content: center;
6649
+ padding: 12px 24px;
6650
+ border: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
6651
+ background-color: ${miscTheme.theme.colors.white || 'white'};
6652
+ border-radius: 32px;
6653
+ cursor: pointer;
6654
+ transition: 0.25s all linear;
6655
+ svg {
6656
+ height: 16px;
6657
+ margin-right: 3px;
6658
+ }
6659
+ &:hover {
6660
+ background-color: ${miscTheme.theme.colors.neutral100};
6661
+ }
6662
+ &.active {
6663
+ background-color: ${miscTheme.theme.colors.primaryActive};
6664
+ color: ${miscTheme.theme.colors.white || '#fff'};
6665
+ svg {
6666
+ stroke: ${miscTheme.theme.colors.white || '#fff'};
6667
+ }
6668
+ }
6669
+ `;
6670
+ const SubotInlineButtonReview = styled__default["default"].div `
6671
+ padding: 12px 24px;
6672
+ border: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
6673
+ background-color: ${miscTheme.theme.colors.white || 'white'};
6674
+ border-radius: 32px;
6675
+ cursor: pointer;
6676
+ transition: 0.25s all linear;
6677
+ &.active {
6678
+ background-color: ${(_a = miscTheme.theme.colors) === null || _a === void 0 ? void 0 : _a.primaryActive};
6679
+ color: ${miscTheme.theme.colors.white || '#fff'};
6680
+ svg {
6681
+ stroke: ${miscTheme.theme.colors.white || '#fff'};
6682
+ }
6683
+ }
6684
+ `;
6685
+ const SubotInlineActionText = styled__default["default"].div `
6686
+ display: flex;
6687
+ align-items: center;
6688
+ padding: 16px 24px;
6689
+ border: 1px solid
6690
+ ${({ active }) => active
6691
+ ? miscTheme.theme.colors.primaryBase || '#2685F1'
6692
+ : miscTheme.theme.colors.white || '#fff'};
6693
+ background-color: ${miscTheme.theme.colors.white || '#fff'};
6694
+ border-radius: ${miscTheme.theme.borderRadius};
6695
+ cursor: pointer;
6696
+ transition: 0.25s all linear;
6697
+ .label {
6698
+ flex: 1;
6699
+ }
6700
+ .icon {
6701
+ position: relative;
6702
+ z-index: 0;
6703
+ display: flex;
6704
+ width: 24px;
6705
+ height: 24px;
6706
+ align-items: center;
6707
+ justify-content: center;
6708
+ padding: 1px;
6709
+ transition: 0.2s linear all;
6710
+ .icon-checkbox {
6711
+ width: 100%;
6712
+ height: 100%;
6713
+ opacity: 0;
6714
+ ${({ active }) => active && `opacity: 1`};
6715
+ transition: 0.25s all linear;
6716
+ }
6717
+ &:before {
6718
+ position: absolute;
6719
+ top: 50%;
6720
+ left: 50%;
6721
+ width: 22px;
6722
+ height: 22px;
6723
+ border: 2px solid
6724
+ ${({ active }) => active
6725
+ ? miscTheme.theme.colors.primaryBase || '#2685F1'
6726
+ : miscTheme.theme.colors.gray600 || '#595959'};
6727
+ border-radius: 50%;
6728
+ content: '';
6729
+ transform: translate(-50%, -50%);
6730
+ transition: 0.25s all linear;
6731
+ }
6732
+ &:after {
6733
+ position: absolute;
6734
+ z-index: -1;
6735
+ top: 50%;
6736
+ left: 50%;
6737
+ width: 10px;
6738
+ height: 10px;
6739
+ background-color: ${miscTheme.theme.colors.primaryBase || '#2685F1'};
6740
+ border-radius: 50%;
6741
+ content: '';
6742
+ opacity: 0;
6743
+ ${({ active }) => active && `opacity: 1`};
6744
+ transform: translate(-50%, -50%);
6745
+ transition: 0.25s all linear;
6746
+ }
6747
+ }
6748
+ &:hover {
6749
+ border-color: ${((_b = miscTheme.theme.colors) === null || _b === void 0 ? void 0 : _b.primaryBase) || '#2685F1'};
6750
+ .icon {
6751
+ &:before {
6752
+ border-color: ${((_c = miscTheme.theme.colors) === null || _c === void 0 ? void 0 : _c.primaryBase) || '#2685F1'};
6753
+ transition: 0.2s linear all;
6754
+ }
6755
+ }
6756
+ }
6757
+ ${utils.MediaQueries.tdDown} {
6758
+ padding: 16px 20px;
6759
+ }
6760
+ `;
6761
+ const SubotInlineActionImage = styled__default["default"](SubotInlineActionText) `
6762
+ position: relative;
6763
+ flex-wrap: wrap;
6764
+ padding: 16px;
6765
+ background-color: ${((_d = miscTheme.theme.colors) === null || _d === void 0 ? void 0 : _d.white) || '#fff'};
6766
+ .image-container {
6767
+ position: relative;
6768
+ overflow: hidden;
6769
+ width: 100%;
6770
+ padding-top: 67%;
6771
+ border-radius: 10px;
6772
+ .image {
6773
+ position: absolute;
6774
+ top: 50%;
6775
+ left: 50%;
6776
+ width: 100%;
6777
+ min-width: 100%;
6778
+ height: auto;
6779
+ min-height: 100%;
6780
+ transform: translate(-50%, -50%);
6781
+ }
6782
+ }
6783
+ .label {
6784
+ margin-top: 16px;
6785
+ }
6786
+ .icon {
6787
+ position: absolute;
6788
+ top: 1.75rem;
6789
+ right: 1.75rem;
6790
+ &:before {
6791
+ z-index: -1;
6792
+ background-color: #fff;
6793
+ }
6794
+ }
6795
+ ${utils.MediaQueries.tdDown} {
6796
+ padding: 12px;
6797
+ .label {
6798
+ margin-top: 12px;
6799
+ }
6800
+ .icon {
6801
+ top: 1.3rem;
6802
+ right: 1.3rem;
6803
+ }
6804
+ }
6805
+ ${utils.MediaQueries.tdDown} {
6806
+ padding: 8px;
6807
+ .label {
6808
+ margin-top: 8px;
6809
+ }
6810
+ .icon {
6811
+ top: 0.9rem;
6812
+ right: 0.9rem;
6813
+ }
6814
+ }
6815
+ `;
6816
+ const SubotInlineActionRatingStartContainer = styled__default["default"].div `
6817
+ display: flex;
6818
+ align-items: center;
6819
+ justify-content: flex-start;
6820
+ ${utils.MediaQueries.tdDown} {
6821
+ justify-content: center;
6822
+ }
6823
+ `;
6824
+ const SubotInlineActionRatingDescriptionContainer = styled__default["default"].div `
6825
+ textarea {
6826
+ background-color: ${((_e = miscTheme.theme.colors) === null || _e === void 0 ? void 0 : _e.white) || '#fff'};
6827
+ }
6828
+ `;
6829
+ const SubotInlineActionPollResult = styled__default["default"].div `
6830
+ margin-top: 20px;
6831
+ color: ${((_f = miscTheme.theme.colors) === null || _f === void 0 ? void 0 : _f.gray500) || '#737373'};
6832
+ font-weight: 600;
6833
+ `;
6834
+ const SubotInlineActionPollChoiceResult = styled__default["default"].div `
6835
+ position: relative;
6836
+ z-index: 0;
6837
+ display: flex;
6838
+ overflow: hidden;
6839
+ align-items: center;
6840
+ padding: 16px 20px;
6841
+ border-radius: ${miscTheme.theme.borderRadius};
6842
+ .number {
6843
+ width: 32px;
6844
+ margin-right: 14px;
6845
+ font-weight: 600;
6846
+ }
6847
+ .content {
6848
+ flex: 1;
6849
+ }
6850
+ .icon {
6851
+ width: 16px;
6852
+ margin-left: 8px;
6853
+ }
6854
+ &:before {
6855
+ position: absolute;
6856
+ z-index: -1;
6857
+ top: 0;
6858
+ right: ${({ percent }) => (percent ? `${100 - percent}%` : '100%')};
6859
+ bottom: 0;
6860
+ left: 0;
6861
+ background-color: ${({ is_chosen }) => is_chosen
6862
+ ? miscTheme.theme.colors.primary50 || '#E3F2FF'
6863
+ : miscTheme.theme.colors.neutral100 || '#E4E8EC'};
6864
+ content: '';
6865
+ transition: 0.3s all linear;
6866
+ }
6867
+ &:after {
6868
+ position: absolute;
6869
+ z-index: -2;
6870
+ top: 0;
6871
+ right: 0;
6872
+ bottom: 0;
6873
+ left: 0;
6874
+ background-color: ${((_g = miscTheme.theme.colors) === null || _g === void 0 ? void 0 : _g.white) || '#fff'};
6875
+ content: '';
6876
+ }
6877
+ ${utils.MediaQueries.mbDown} {
6878
+ padding: 6px 16px;
6879
+ }
6880
+ `;
6881
+ const SubotInlineActionItemContainer = styled__default["default"].div `
6882
+ width: ${({ width }) => width || '100%'};
6883
+ padding: 4px;
6884
+ &.item-image-container {
6885
+ padding: 16px;
6886
+ ${utils.MediaQueries.tdDown} {
6887
+ padding: 7.5px;
6888
+ }
6889
+ ${utils.MediaQueries.mbDown} {
6890
+ width: 50%;
6891
+ }
6892
+ }
6893
+ `;
6894
+ const SubotInlineActionListContainer = styled__default["default"].div `
6895
+ display: flex;
6896
+ flex-wrap: wrap;
6897
+ align-items: flex-start;
6898
+ justify-content: center;
6899
+ margin: -4px;
6900
+
6901
+ &.list-container {
6902
+ margin: -16px;
6903
+ ${utils.MediaQueries.tdDown} {
6904
+ margin: -7.5px;
6905
+ }
6906
+ }
6907
+
6908
+ &.review-container {
6909
+ margin: -8px;
6910
+ ${SubotInlineActionItemContainer} {
6911
+ padding: 8px;
6912
+ }
6913
+ }
6914
+ `;
6915
+
6916
+ const SubotInlineAction = ({ actions, value, onChange, htmlType, node_type, formSubmitMeta, }) => {
6917
+ const className = React.useMemo(() => {
6918
+ switch (node_type) {
6919
+ case index$2.NodeType.IMAGE:
6920
+ case index$2.NodeType.REACTION:
6921
+ return 'list-container';
6922
+ default:
6923
+ return '';
6924
+ }
6925
+ }, [node_type]);
6926
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, actions && !!(actions === null || actions === void 0 ? void 0 : actions.length) && (React__default["default"].createElement(SubotInlineActionListContainer, { className: className }, actions === null || actions === void 0 ? void 0 : actions.map((action) => {
6927
+ const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
6928
+ return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: onChange, active: value === null || value === void 0 ? void 0 : value.includes(action.id), htmlType: htmlType, formSubmitMeta: formSubmitMeta })));
6929
+ })))));
6930
+ };
6931
+
6932
+ const ButtonStyled = styled__default["default"](index$8.Button) `
6933
+ &:disabled {
6934
+ background-color: rgb(242, 242, 242);
6935
+ color: rgb(140, 140, 140);
6936
+
6937
+ &:hover {
6938
+ border: 0;
6939
+ }
6940
+ }
6941
+ svg {
6942
+ path {
6943
+ stroke: currentColor;
6944
+ }
6945
+ }
6946
+ `;
6947
+ const ButtonBackStyled = styled__default["default"](ButtonStyled) `
6948
+ &:disabled {
6949
+ background-color: rgb(242, 242, 242);
6950
+ color: rgb(140, 140, 140);
6951
+ &:hover {
6952
+ border: 0;
6953
+ }
6954
+ }
6955
+ svg {
6956
+ path {
6957
+ stroke: currentColor;
6958
+ }
6959
+ }
6960
+ `;
6961
+ const SubotInlineFooterStyled = styled__default["default"].div `
6962
+ display: flex;
6963
+ align-items: center;
6964
+ justify-content: flex-end;
6965
+ padding: 16px 32px;
6966
+ border-top: 4px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
6967
+ ${ButtonStyled} {
6968
+ + ${ButtonStyled} {
6969
+ margin-left: 8px;
6970
+ }
6971
+ }
6972
+ ${utils.MediaQueries.tdDown} {
6973
+ padding: 12px 24px;
6974
+ }
6975
+ ${utils.MediaQueries.mbDown} {
6976
+ padding: 12px 16px;
6977
+ }
6978
+ `;
6979
+
6980
+ const SubotInlineActionTextChoice = ({ action, onChange, active, htmlType, formSubmitMeta, }) => {
6981
+ const { trackingCommonInline } = React.useContext(SubotInlineContext);
6982
+ const inputRef = React.useRef(null);
6983
+ const [otherText, setOtherText] = React.useState('');
6984
+ const isActionPollWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
6985
+ const isActionSelectWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
6986
+ isActionPollWithOther;
6987
+ const onChangeTextArea = (evt) => {
6988
+ setOtherText(evt.target.value);
6989
+ if (isActionSelectWithOther) {
6990
+ onChange === null || onChange === void 0 ? void 0 : onChange(action, [
6991
+ {
6992
+ key: KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD,
6993
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type] || 'text',
6994
+ value: evt.target.value,
6995
+ action_id: action.id,
6996
+ },
6997
+ ]);
6998
+ }
6999
+ };
7000
+ React.useEffect(() => {
7001
+ var _a, _b;
7002
+ if (active) {
7003
+ setOtherText(((_a = formSubmitMeta === null || formSubmitMeta === void 0 ? void 0 : formSubmitMeta.find((f) => f.key === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD)) === null || _a === void 0 ? void 0 : _a.value) || '');
7004
+ (_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
7005
+ }
7006
+ }, [active, formSubmitMeta]);
7007
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
7008
+ React__default["default"].createElement(SubotInlineActionText, Object.assign({ active: !!active, onClick: () => onChange === null || onChange === void 0 ? void 0 : onChange(action), className: "pointer-event-child-none" }, trackingCommonInline, { "data-response-id": action === null || action === void 0 ? void 0 : action.id, "data-event-action": "Answer Click" }),
7009
+ React__default["default"].createElement("div", { className: "label" },
7010
+ React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label)),
7011
+ React__default["default"].createElement("div", { className: "icon" }, htmlType === 'checkbox' && (React__default["default"].createElement(CheckboxIcon, { className: "icon-checkbox", viewBox: "0 0 22 22" })))),
7012
+ isActionSelectWithOther && active && (React__default["default"].createElement(core.Box, { mt: "6px", style: { textAlign: 'right' } },
7013
+ React__default["default"].createElement(core.Textarea, { ref: inputRef, placeholder: action === null || action === void 0 ? void 0 : action.label, styles: {
7014
+ input: {
7015
+ paddingLeft: '24px',
7016
+ paddingRight: '24px',
7017
+ boxShadow: 'none',
7018
+ ':focus': { boxShadow: 'none' },
7019
+ },
7020
+ }, value: otherText, onChange: onChangeTextArea, maxLength: 360 })))));
7021
+ };
7022
+ const SubotInlineActionImageChoice = ({ action, onChange, active, htmlType, }) => {
7023
+ const { trackingCommonInline } = React.useContext(SubotInlineContext);
7024
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "45%", className: 'item-image-container' },
7025
+ React__default["default"].createElement(SubotInlineActionImage, Object.assign({ onClick: () => onChange && onChange(action), active: !!active }, trackingCommonInline, { "data-response-id": action === null || action === void 0 ? void 0 : action.id, "data-event-action": "Answer Click" }),
7026
+ React__default["default"].createElement("div", { className: "image-container" },
7027
+ React__default["default"].createElement("img", { loading: "lazy", src: action === null || action === void 0 ? void 0 : action.url, alt: action === null || action === void 0 ? void 0 : action.label, className: "image" })),
7028
+ (action === null || action === void 0 ? void 0 : action.label) && (React__default["default"].createElement("div", { className: "label" },
7029
+ React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))),
7030
+ React__default["default"].createElement("div", { className: "icon" }, htmlType === 'checkbox' && (React__default["default"].createElement(CheckboxIcon, { className: "icon-checkbox", viewBox: "0 0 22 22" }))))));
7031
+ };
7032
+ const SubotInlineActionSSO = ({ action, onChange, }) => {
7033
+ const { trackingCommonInline } = React.useContext(SubotInlineContext);
7034
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "50%", style: { alignSelf: 'center' } },
7035
+ React__default["default"].createElement(ButtonStyled, Object.assign({ onClick: () => onChange && onChange(action), size: "lg", isBlock: true }, trackingCommonInline, { className: "pointer-event-child-none", "data-event-action": "Login Click", "data-response-id": action === null || action === void 0 ? void 0 : action.id }),
7036
+ React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
7037
+ };
7038
+ const SubotInlinePollChoice = ({ active, action, onChange, htmlType, node_type, }) => {
7039
+ const handleOnChange = (action) => {
7040
+ if (action)
7041
+ onChange &&
7042
+ onChange({
7043
+ key: (action === null || action === void 0 ? void 0 : action.key) || '',
7044
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7045
+ value: '',
7046
+ action_id: action === null || action === void 0 ? void 0 : action.id,
7047
+ });
7048
+ };
7049
+ if (node_type === index$2.NodeType.RESULT_POLL)
7050
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
7051
+ React__default["default"].createElement(SubotInlineActionPollChoiceResult, { percent: (action === null || action === void 0 ? void 0 : action.percent) || 0, is_chosen: action === null || action === void 0 ? void 0 : action.is_chosen },
7052
+ React__default["default"].createElement("div", { className: "number" }, action === null || action === void 0 ? void 0 :
7053
+ action.percent,
7054
+ "%"),
7055
+ React__default["default"].createElement("div", { className: "content" }, action === null || action === void 0 ? void 0 : action.label),
7056
+ React__default["default"].createElement("div", { className: "icon" }, (action === null || action === void 0 ? void 0 : action.is_chosen) && React__default["default"].createElement(CheckIcon, { viewBox: "0 0 16 16" })))));
7057
+ return (React__default["default"].createElement(SubotInlineActionTextChoice, { active: !!active, action: action, onChange: handleOnChange, htmlType: htmlType }));
7058
+ };
7059
+ const SubotInlinePollChoiceImage = ({ active, action, onChange, htmlType, node_type, }) => {
7060
+ const handleOnChange = (action) => {
7061
+ if (action)
7062
+ onChange &&
7063
+ onChange({
7064
+ key: action === null || action === void 0 ? void 0 : action.key,
7065
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7066
+ value: '',
7067
+ action_id: action === null || action === void 0 ? void 0 : action.id,
7068
+ });
7069
+ };
7070
+ if (node_type === index$2.NodeType.RESULT_POLL)
7071
+ // TODO: Update layout result poll image
7072
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
7073
+ React__default["default"].createElement(SubotInlineActionPollChoiceResult, { percent: (action === null || action === void 0 ? void 0 : action.percent) || 0, is_chosen: action === null || action === void 0 ? void 0 : action.is_chosen },
7074
+ React__default["default"].createElement("div", { className: "number" }, action === null || action === void 0 ? void 0 :
7075
+ action.percent,
7076
+ "%"),
7077
+ React__default["default"].createElement("div", { className: "content" }, action === null || action === void 0 ? void 0 : action.label),
7078
+ React__default["default"].createElement("div", { className: "icon" }, (action === null || action === void 0 ? void 0 : action.is_chosen) && React__default["default"].createElement(CheckIcon, { viewBox: "0 0 16 16" })))));
7079
+ return (React__default["default"].createElement(SubotInlineActionImageChoice, { active: !!active, action: action, onChange: handleOnChange, htmlType: htmlType }));
7080
+ };
7081
+ const SubotInlineRatingStar = ({ action, value, onChange, }) => {
7082
+ var _a, _b;
7083
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
7084
+ React__default["default"].createElement(SubotInlineActionRatingStartContainer, null,
7085
+ React__default["default"].createElement(StarRatings__default["default"], { rating: value && typeof value !== 'string' && (value === null || value === void 0 ? void 0 : value.value)
7086
+ ? parseInt(value === null || value === void 0 ? void 0 : value.value)
7087
+ : 0, changeRating: (star) => {
7088
+ const _value = {
7089
+ key: action === null || action === void 0 ? void 0 : action.key,
7090
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7091
+ value: star.toString(),
7092
+ action_id: action === null || action === void 0 ? void 0 : action.id,
7093
+ };
7094
+ onChange && onChange(_value);
7095
+ }, starHoverColor: (_a = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _a === void 0 ? void 0 : _a.yellow600, starRatedColor: (_b = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _b === void 0 ? void 0 : _b.yellow600, starDimension: "48" }))));
7096
+ };
7097
+ const SubotInlineTextArea = ({ action, value, onChange, }) => {
7098
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
7099
+ React__default["default"].createElement(SubotInlineActionRatingDescriptionContainer, null,
7100
+ React__default["default"].createElement(index$c.TextArea, { placeholder: action === null || action === void 0 ? void 0 : action.label, value: value && typeof value !== 'string' && (value === null || value === void 0 ? void 0 : value.value)
7101
+ ? value === null || value === void 0 ? void 0 : value.value
7102
+ : '', onChange: (evt) => {
7103
+ const _value = {
7104
+ key: action === null || action === void 0 ? void 0 : action.key,
7105
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7106
+ value: evt.target.value,
7107
+ action_id: action === null || action === void 0 ? void 0 : action.id,
7108
+ };
7109
+ onChange && onChange(_value);
7110
+ } }))));
7111
+ };
7112
+ const SubotInlineLikeChoice = ({ action, active, onChange, }) => {
7113
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "40%", className: 'item-image-container' },
7114
+ React__default["default"].createElement(SubotInlineButtonReaction, { className: classNames__default["default"](!!active && 'active'), onClick: () => onChange && onChange(action) },
7115
+ React__default["default"].createElement(LikeIcon, { viewBox: "0 0 24 24" }),
7116
+ React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
7117
+ };
7118
+ const SubotInlineDislikeChoice = ({ action, active, onChange, }) => {
7119
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "40%", className: 'item-image-container' },
7120
+ React__default["default"].createElement(SubotInlineButtonReaction, { className: classNames__default["default"](!!active && 'active'), onClick: () => onChange && onChange(action) },
7121
+ React__default["default"].createElement(DislikeIcon, { viewBox: "0 0 24 24" }),
7122
+ React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
7123
+ };
7124
+ const SubotInlineReviewChoice = ({ active, action, onChange, }) => (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "auto", className: "review-choice" },
7125
+ React__default["default"].createElement(SubotInlineButtonReview, { className: classNames__default["default"](!!active && 'active'), onClick: () => onChange &&
7126
+ onChange({
7127
+ key: action === null || action === void 0 ? void 0 : action.key,
7128
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7129
+ value: '',
7130
+ action_id: action === null || action === void 0 ? void 0 : action.id,
7131
+ }) },
7132
+ React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
7133
+ const SubotInlinePollResult = ({ action, }) => (React__default["default"].createElement(SubotInlineActionItemContainer, null,
7134
+ React__default["default"].createElement(SubotInlineActionPollResult, null, action === null || action === void 0 ? void 0 : action.label)));
7135
+ const SubotInlineActionBase = {
7136
+ 'user-image': SubotInlineActionImageChoice,
7137
+ [index$2.NodeActionType.USER_CHOICE_TEXT]: SubotInlineActionTextChoice,
7138
+ [index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT]: SubotInlineActionTextChoice,
7139
+ [index$2.NodeActionType.USER_CHOICE_IMAGE]: SubotInlineActionImageChoice,
7140
+ [index$2.NodeActionType.ACTION_SSO_REDIRECT]: SubotInlineActionSSO,
7141
+ [index$2.NodeActionType.POLL_CHOICE]: SubotInlinePollChoice,
7142
+ [index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT]: SubotInlineActionTextChoice,
7143
+ [index$2.NodeActionType.POLL_CHOICE_IMAGE]: SubotInlinePollChoiceImage,
7144
+ [index$2.NodeActionType.RATING_STAR]: SubotInlineRatingStar,
7145
+ [index$2.NodeActionType.RATING_DESCRIPTION]: SubotInlineTextArea,
7146
+ [index$2.NodeActionType.LIKE_CHOICE]: SubotInlineLikeChoice,
7147
+ [index$2.NodeActionType.DISLIKE_CHOICE]: SubotInlineDislikeChoice,
7148
+ [index$2.NodeActionType.REVIEW_CHOICE]: SubotInlineReviewChoice,
7149
+ [index$2.NodeActionType.REVIEW_DESCRIPTION]: SubotInlineTextArea,
7150
+ [index$2.NodeActionType.RESULT_BUTTON]: SubotInlineActionTextChoice,
7151
+ [index$2.NodeActionType.POLL_RESULT]: SubotInlinePollResult,
7152
+ };
7153
+
7154
+ const SubotInlineFooter = ({ onBack, onNext: onSubmit, hideBack, hideNext, nextText, backProps, nextProps, }) => {
7155
+ var _a, _b, _c;
7156
+ const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
7157
+ const { nodes: listNodes, activeId, params, onNext, trackingCommonInline, } = React.useContext(SubotInlineContext);
7158
+ const nodeMessage = listNodes.find((nodeItem) => nodeItem.id == activeId);
7159
+ const actionNextChoice = (_a = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage.actions) === null || _a === void 0 ? void 0 : _a.find((act) => act.type === index$2.NodeActionType.USER_CHOICE_NEXT);
7160
+ const handleNextChoice = () => {
7161
+ if (nodeMessage && actionNextChoice) {
7162
+ const nextValue = {
7163
+ node_id: nodeMessage.id,
7164
+ action_id: actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.id,
7165
+ action_value: actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.key,
7166
+ };
7167
+ onNext === null || onNext === void 0 ? void 0 : onNext(Object.assign(Object.assign(Object.assign({}, params), nextValue), nodeMessage._message));
7168
+ }
7169
+ };
7170
+ const actionSubmitMultiple = (_b = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage.actions) === null || _b === void 0 ? void 0 : _b.find((act) => act.type === index$2.NodeActionType.ACTION_MULTIPLE_BUTTON);
7171
+ return (React__default["default"].createElement(SubotInlineFooterStyled, null,
7172
+ !hideBack && (React__default["default"].createElement(ButtonBackStyled, Object.assign({ size: "md", color: "secondary", onClick: onBack }, backProps, { className: classNames__default["default"]('pointer-event-child-none', backProps === null || backProps === void 0 ? void 0 : backProps.className) }, trackingCommonInline, { "data-event-action": "Back Click" }),
7173
+ React__default["default"].createElement(ArrowLeft, { style: { marginRight: 10 } }),
7174
+ f({
7175
+ id: 'riskScreener.back',
7176
+ defaultMessage: 'Back',
7177
+ }))),
7178
+ !hideNext && (React__default["default"].createElement(ButtonStyled, Object.assign({ size: "md", color: "primary", onClick: actionNextChoice ? handleNextChoice : onSubmit }, nextProps, { className: classNames__default["default"]('pointer-event-child-none', nextProps === null || nextProps === void 0 ? void 0 : nextProps.className) }, trackingCommonInline, { "data-event-action": "Answer Click", "data-response-id": (actionSubmitMultiple === null || actionSubmitMultiple === void 0 ? void 0 : actionSubmitMultiple.id) ||
7179
+ (actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.id) ||
7180
+ ((_c = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage._message) === null || _c === void 0 ? void 0 : _c.action_id) }),
7181
+ !nextText
7182
+ ? f({
7183
+ id: 'riskScreener.next',
7184
+ defaultMessage: 'Next',
7185
+ })
7186
+ : nextText,
7187
+ React__default["default"].createElement(ArrowRight, { style: { marginLeft: 10 } })))));
7188
+ };
7189
+ var SubotInlineFooter$1 = React.memo(SubotInlineFooter);
7190
+
7191
+ const SubotInlineHeadline = styled__default["default"].h4 `
7192
+ padding: 32px 0px 12px;
7193
+ border-bottom: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
7194
+ margin: 0px 32px;
7195
+ color: ${miscTheme.theme.colors.gray500 || '#737373'};
7196
+ font-size: 14px;
7197
+ font-weight: 700;
7198
+ line-height: 1.5;
7199
+ ${utils.MediaQueries.tdDown} {
7200
+ padding: 24px 0px 12px;
7201
+ margin: 0px 24px;
7202
+ }
7203
+ ${utils.MediaQueries.mbDown} {
7204
+ padding: 16px 0px 12px;
7205
+ margin: 0px 16px;
7206
+ }
7207
+ `;
7208
+ const SubotInlineHeader = () => {
7209
+ const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
7210
+ const { nodes } = React.useContext(SubotInlineContext);
7211
+ const headline = React.useMemo(() => { var _a; return (_a = nodes[0]) === null || _a === void 0 ? void 0 : _a.inline_headline; }, [nodes]);
7212
+ return (React__default["default"].createElement(SubotInlineHeadline, null, headline ||
7213
+ f({
7214
+ id: 'subotInline.quote',
7215
+ defaultMessage: 'HAVE TIME FOR A QUICK QUESTION?',
7216
+ })));
7217
+ };
7218
+ var SubotInlineHeader$1 = React.memo(SubotInlineHeader);
7219
+
7220
+ const SubotInlineIntentTitle = styled__default["default"].h3 `
7221
+ margin-bottom: 0px;
7222
+ font-size: 22px;
7223
+ font-weight: bold;
7224
+ line-height: 1.45;
7225
+ ${utils.MediaQueries.tdDown} {
7226
+ font-size: 20px;
7227
+ }
7228
+ `;
7229
+ const SubotInlineRecalculateButton = styled__default["default"](index$8.Button) `
7230
+ &.bot-recalculate {
7231
+ svg {
7232
+ path {
7233
+ stroke: ${miscTheme.theme.colors.primaryBase || '#2685F1'} !important;
7234
+ }
7235
+ }
7236
+ &:hover {
7237
+ svg {
7238
+ path {
7239
+ stroke: #fff !important;
7240
+ }
7241
+ }
7242
+ }
7243
+ }
7244
+ `;
7245
+ const SubotInlineIntentButton = styled__default["default"](index$8.Button) `
7246
+ border: 2px solid transparent;
7247
+ `;
7248
+ const SubotInlineItemIcon = styled__default["default"].div `
7249
+ display: flex;
7250
+ padding-top: 10px;
7251
+ padding-bottom: 10px;
7252
+ .icon {
7253
+ width: 64px;
7254
+ height: 64px;
7255
+ margin-right: 16px;
7256
+ object-fit: contain;
7257
+ object-position: center;
7258
+ }
7259
+ .content {
7260
+ flex: 1;
7261
+ .title {
7262
+ margin-top: 0;
7263
+ margin-bottom: 0;
7264
+ font-size: inherit;
7265
+ font-weight: 700;
7266
+ line-height: 1.4;
7267
+ }
7268
+ .description {
7269
+ color: ${miscTheme.theme.colors.gray700 || '#404040'};
7270
+ line-height: 1.4;
7271
+ }
7272
+ }
7273
+ ${utils.MediaQueries.mbDown} {
7274
+ .icon {
7275
+ width: 47px;
7276
+ height: 47px;
7277
+ margin-right: 16px;
7278
+ }
7279
+ .content {
7280
+ .title {
7281
+ font-size: 14px;
7282
+ }
7283
+ .description {
7284
+ font-size: 14px;
7285
+ }
7286
+ }
7287
+ }
7288
+ `;
7289
+ styled__default["default"](index$8.Button) ``;
7290
+ const SubotInlineIntentFirstTextWrapper = styled__default["default"].div `
7291
+ display: flex;
7292
+ align-items: flex-start;
7293
+ color: ${miscTheme.theme.colors.gray800 || '#262626'};
7294
+ font-size: 22px;
7295
+ font-weight: 700;
7296
+ letter-space: -0.6px;
7297
+ line-height: 1.45;
7298
+ .number {
7299
+ margin-right: 3px;
7300
+ }
7301
+ .title {
7302
+ flex: 1;
7303
+ }
7304
+ ${utils.MediaQueries.tdDown} {
7305
+ font-size: 20px;
7306
+ }
7307
+ ${utils.MediaQueries.mbDown} {
7308
+ font-size: 18px;
7309
+ }
7310
+ `;
7311
+ const SubotInlineIntentFirstImageWrapper = styled__default["default"].div `
7312
+ display: flex;
7313
+ justify-content: center;
7314
+ `;
7315
+ const SubotInlineIntentFirstTextContainer = styled__default["default"].div ``;
7316
+ const SubotInlineIntentTextContainer = styled__default["default"].div `
7317
+ padding: 12px 16px;
7318
+ border: 1px solid ${miscTheme.theme.colors.gray200 || '#D9D9D9'};
7319
+ background-color: ${miscTheme.theme.colors.white || '#fff'};
7320
+ border-radius: ${miscTheme.theme.borderRadius};
7321
+ line-height: 1.5;
7322
+ `;
7323
+ const SubotInlineIntentImageContainer = styled__default["default"].div `
7324
+ border: ${miscTheme.theme.colors.gray200 || '#D9D9D9'};
7325
+ background-color: ${miscTheme.theme.colors.white || '#FFF'};
7326
+ border-radius: ${miscTheme.theme.borderRadius};
7327
+ .intent-img {
7328
+ border-radius: ${miscTheme.theme.borderRadius};
7329
+ &.has-label {
7330
+ border-bottom-left-radius: 0px;
7331
+ border-bottom-right-radius: 0px;
7332
+ }
7333
+ }
7334
+ .intent-img-label {
7335
+ padding: 5px 10px;
7336
+ font-size: 0.8em;
7337
+ font-style: italic;
7338
+ font-weight: 400;
7339
+ }
7340
+ `;
7341
+ const SubotInlineIntentUrlContainer = styled__default["default"].div `
7342
+ display: flex;
7343
+ .feature {
7344
+ width: 30%;
7345
+ .feature-wrapper {
7346
+ position: relative;
7347
+ display: block;
7348
+ overflow: hidden;
7349
+ width: 100%;
7350
+ padding-top: 66%;
7351
+ border-radius: ${miscTheme.theme.borderRadius};
7352
+ .feature-img {
7353
+ position: absolute;
7354
+ top: 50%;
7355
+ left: 50%;
7356
+ width: 100%;
7357
+ min-width: 100%;
7358
+ height: auto;
7359
+ min-height: 100%;
7360
+ transform: translate(-50%, -50%);
7361
+ }
7362
+ }
7363
+ }
7364
+ .body {
7365
+ flex: 1;
7366
+ margin-left: 10px;
7367
+ line-height: 1.5;
7368
+ a {
7369
+ color: ${miscTheme.theme.colors.gray800 || '#262626'};
7370
+ text-decoration: none;
7371
+ }
7372
+ }
7373
+ `;
7374
+ const SubotInlineIntentRiskScreenerContainer = styled__default["default"].div `
7375
+ display: flex;
7376
+ align-items: center;
7377
+ justify-content: space-between;
7378
+ padding: 20px 40px 20px 16px;
7379
+ background-color: #fff;
7380
+ border-radius: ${miscTheme.theme.borderRadius};
7381
+ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 2px rgba(0, 0, 0, 0.06),
7382
+ 0px 0px 1px rgba(0, 0, 0, 0.04);
7383
+ .feature {
7384
+ display: block;
7385
+ overflow: hidden;
7386
+ width: 72px;
7387
+ height: 72px;
7388
+ margin-right: 16px;
7389
+ border-radius: ${miscTheme.theme.borderRadius};
7390
+ img {
7391
+ width: 100%;
7392
+ height: 100%;
7393
+ object-fit: cover;
7394
+ object-position: center;
7395
+ }
7396
+ }
7397
+ .title-container {
7398
+ display: flex;
7399
+ flex: 1;
7400
+ align-items: center;
7401
+ justify-content: space-between;
7402
+ a {
7403
+ font-size: 16px;
7404
+ line-height: 1.5em;
7405
+ text-decoration: none;
7406
+ .title {
7407
+ padding: 0;
7408
+ color: #262626;
7409
+ font-size: inherit;
7410
+ line-height: inherit;
7411
+ }
7412
+ &.link {
7413
+ display: flex;
7414
+ align-items: center;
7415
+ justify-content: center;
7416
+ margin-left: 20px;
7417
+ color: #2d87f3;
7418
+ font-weight: 700;
7419
+ }
7420
+ }
7421
+ }
7422
+ @media screen and (max-width: 769px) {
7423
+ padding: 16px 12px;
7424
+ .feature {
7425
+ width: 50px;
7426
+ height: 50px;
7427
+ }
7428
+ .title-container {
7429
+ a {
7430
+ font-size: 13px;
7431
+ line-height: 20px;
7432
+ &.link {
7433
+ margin-left: 10px;
7434
+ }
7435
+ }
7436
+ }
7437
+ }
7438
+ `;
7439
+ const SubotInlineIntentFinalButtonContainer = styled__default["default"].div `
7440
+ display: flex;
7441
+ align-items: center;
7442
+ justify-content: center;
7443
+ `;
7444
+ styled__default["default"].div `
7445
+ padding: 16px;
7446
+ margin-top: 32px;
7447
+ margin-bottom: 32px;
7448
+ background-color: ${miscTheme.theme.colors.primary50 || ''};
7449
+ border-radius: ${miscTheme.theme.borderRadius};
7450
+ .item-grid {
7451
+ > div {
7452
+ box-shadow: none;
7453
+ }
7454
+ }
7455
+ .lp--affiliate-product {
7456
+ .arrow-left {
7457
+ left: -20px;
7458
+ }
7459
+ .arrow-right {
7460
+ right: -16px;
7461
+ }
7462
+ }
7463
+ .bullet-nav {
7464
+ bottom: -10px;
7465
+ }
7466
+ `;
7467
+ const SubotInlineIntentFinalCol = styled__default["default"].div `
7468
+ width: ${({ width }) => width || '100%'};
7469
+ padding: 8px;
7470
+ ${utils.MediaQueries.mbDown} {
7471
+ width: 100%;
7472
+ }
7473
+ `;
7474
+ const SubotInlineIntentFinalRow = styled__default["default"].div `
7475
+ display: flex;
7476
+ flex-wrap: wrap;
7477
+ align-items: flex-start;
7478
+ justify-content: center;
7479
+ margin: 0 -8px;
7480
+ `;
7481
+ const SubotInlineIntentCol = styled__default["default"].div `
7482
+ width: ${({ width }) => width || '100%'};
7483
+ padding: 4px;
7484
+ ${utils.MediaQueries.mbDown} {
7485
+ width: 100%;
7486
+ }
7487
+ `;
7488
+ const SubotInlineIntentRow = styled__default["default"].div `
7489
+ display: flex;
7490
+ flex-wrap: wrap;
7491
+ align-items: flex-start;
7492
+ justify-content: center;
7493
+ margin: 0 -4px;
7494
+ `;
7495
+ const SubotInlineIntentList = styled__default["default"].div `
7496
+ margin-top: 20px;
7497
+ `;
7498
+
7499
+ const SubotInlineIntent = ({ intents, indexNumber, }) => {
7500
+ var _a, _b;
7501
+ const title = React.useMemo(() => {
7502
+ const _title = intents && intents[0];
7503
+ if (_title)
7504
+ return _title;
7505
+ return null;
7506
+ }, []);
7507
+ if (!intents.length)
7508
+ return React__default["default"].createElement(SubotInlineIntentBotTitle, { indexNumber: indexNumber });
7509
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
7510
+ title && (React__default["default"].createElement(SubotInlineIntentBotTitle, { intent: title, indexNumber: indexNumber })),
7511
+ !!((_a = intents.slice(1)) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineIntentList, null,
7512
+ React__default["default"].createElement(SubotInlineIntentRow, null, (_b = intents.slice(1)) === null || _b === void 0 ? void 0 : _b.map((intent) => {
7513
+ const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
7514
+ return (NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent }));
7515
+ }))))));
7516
+ };
7517
+
7518
+ const SubotInlineIntentFinal = ({ intents: intentsProps, }) => {
7519
+ const intents = React.useMemo(() => {
7520
+ const mainIntents = [];
7521
+ const subIntents = [];
7522
+ const rest = [];
7523
+ intentsProps === null || intentsProps === void 0 ? void 0 : intentsProps.map((intent) => {
7524
+ switch (intent === null || intent === void 0 ? void 0 : intent.type) {
7525
+ case index$2.NodeIntentType.BOT_MAIN_IMAGE:
7526
+ mainIntents.push(intent);
7527
+ break;
7528
+ case index$2.NodeIntentType.BOT_MAIN_TITLE:
7529
+ mainIntents.push(intent);
7530
+ break;
7531
+ case index$2.NodeIntentType.BOT_MAIN_BODY:
7532
+ mainIntents.push(intent);
7533
+ break;
7534
+ case index$2.NodeIntentType.BOT_MAIN_BUTTON:
7535
+ mainIntents.push(intent);
7536
+ break;
7537
+ case index$2.NodeIntentType.BOT_RECALCULATE:
7538
+ mainIntents.push(intent);
7539
+ break;
7540
+ case index$2.NodeIntentType.BOT_SUB_TITLE:
7541
+ subIntents.push(intent);
7542
+ break;
7543
+ case index$2.NodeIntentType.BOT_SUB_BODY:
7544
+ subIntents.push(intent);
7545
+ break;
7546
+ default:
7547
+ rest.push(intent);
7548
+ break;
7549
+ }
7550
+ });
7551
+ return {
7552
+ mainIntents,
7553
+ subIntents,
7554
+ intents: rest,
7555
+ };
7556
+ }, []);
7557
+ if (!(intentsProps === null || intentsProps === void 0 ? void 0 : intentsProps.length)) {
7558
+ return null;
7559
+ }
7560
+ function renderIntent(intent) {
7561
+ const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
7562
+ if (!NodeIntent) {
7563
+ return null;
7564
+ }
7565
+ return React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
7566
+ }
7567
+ return (React__default["default"].createElement(SubotInlineIntentRow, null,
7568
+ React__default["default"].createElement(SubotInlineIntentCol, null,
7569
+ React__default["default"].createElement(SubotInlineIntentFinalRow, null,
7570
+ intents.mainIntents.map(renderIntent),
7571
+ intents.subIntents.map(renderIntent),
7572
+ intents.intents.map(renderIntent)))));
7573
+ };
7574
+
7575
+ /*******************************************************************************/
7576
+ /*************************** NodeIntentType: 'bot-text' ************************/
7577
+ //#region
7578
+ const SubotInlineIntentBotText = ({ intent, }) => {
7579
+ if (!(intent === null || intent === void 0 ? void 0 : intent.label))
7580
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7581
+ return (React__default["default"].createElement(SubotInlineIntentCol, null,
7582
+ React__default["default"].createElement(SubotInlineIntentTextContainer, null,
7583
+ React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
7584
+ };
7585
+ //#endregion
7586
+ /*************************** END - NodeIntentType: 'bot-text' ******************/
7587
+ /*******************************************************************************/
7588
+ /*******************************************************************************/
7589
+ /*************************** NodeIntentType: 'bot-image' ***********************/
7590
+ //#region
7591
+ const SubotInlineIntentBotImage = ({ intent, }) => {
7592
+ if (!intent.url)
7593
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7594
+ const isObject = (() => {
7595
+ try {
7596
+ return Boolean(JSON.parse((intent === null || intent === void 0 ? void 0 : intent.label) || ''));
7597
+ }
7598
+ catch (err) {
7599
+ return false;
7600
+ }
7601
+ })();
7602
+ return (React__default["default"].createElement(SubotInlineIntentCol, { width: "50%" },
7603
+ React__default["default"].createElement(SubotInlineIntentImageContainer, null,
7604
+ React__default["default"].createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
7605
+ isObject && (React__default["default"].createElement("h4", { className: "intent-img-label" },
7606
+ React__default["default"].createElement(Markdown, null, intent.label))))));
7607
+ };
7608
+ //#endregion
7609
+ /*************************** END - NodeIntentType: 'bot-image' *****************/
7610
+ /*******************************************************************************/
7611
+ /*******************************************************************************/
7612
+ /*************************** NodeIntentType: 'bot-button' **********************/
7613
+ //#region
7614
+ const SubotInlineIntentBotButton = ({ intent, }) => {
7615
+ const { trackingCommonInline } = React.useContext(SubotInlineContext);
7616
+ const handleOnClick = () => {
7617
+ window.location.href = intent.url;
7618
+ };
7619
+ if (!(intent === null || intent === void 0 ? void 0 : intent.label))
7620
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7621
+ return (React__default["default"].createElement(SubotInlineIntentCol, { width: "60%" },
7622
+ React__default["default"].createElement(SubotInlineIntentButton, Object.assign({ size: "lg", color: "primary", onClick: handleOnClick, isBlock: true }, trackingCommonInline, { "data-event-action": "Click CTA", "data-response-id": intent.id }),
7623
+ React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
7624
+ };
7625
+ //#endregion
7626
+ /*************************** END - NodeIntentType: 'bot-button' ****************/
7627
+ /*******************************************************************************/
7628
+ /*******************************************************************************/
7629
+ /*************************** NodeIntentType: 'bot-url' *************************/
7630
+ //#region
7631
+ const SubotInlineIntentUrl = ({ intent, }) => {
7632
+ const article = React.useMemo(() => intent.label.includes('{')
7633
+ ? JSON.parse(intent.label)
7634
+ : {}, [intent.label]);
7635
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, !!Object.keys(article).length && (React__default["default"].createElement(SubotInlineIntentCol, null,
7636
+ React__default["default"].createElement(SubotInlineIntentUrlContainer, null,
7637
+ React__default["default"].createElement("div", { className: "feature" },
7638
+ React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature-wrapper" },
7639
+ React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title, className: "feature-img" }))),
7640
+ React__default["default"].createElement("div", { className: "body" },
7641
+ React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url },
7642
+ React__default["default"].createElement("h5", { className: "title" },
7643
+ React__default["default"].createElement(Markdown, null, article === null || article === void 0 ? void 0 : article.title)))))))));
7644
+ };
7645
+ //#endregion
7646
+ /*************************** END - NodeIntentType: 'bot-url' *******************/
7647
+ /*******************************************************************************/
7648
+ /*******************************************************************************/
7649
+ /*************************** NodeIntentType: 'sso-intent' *************************/
7650
+ //#region
7651
+ const SubotInlineIntentSSO = ({ intent, }) => {
7652
+ const info = (() => {
7653
+ try {
7654
+ return (intent === null || intent === void 0 ? void 0 : intent.label) ? JSON.parse(intent === null || intent === void 0 ? void 0 : intent.label) : {};
7655
+ }
7656
+ catch (err) {
7657
+ return {};
7658
+ }
7659
+ })();
7660
+ if (!info || !info.title)
7661
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7662
+ return (React__default["default"].createElement(SubotInlineIntentCol, null,
7663
+ React__default["default"].createElement(SubotInlineItemIcon, null,
7664
+ React__default["default"].createElement("img", { loading: "lazy", src: intent === null || intent === void 0 ? void 0 : intent.url, className: "icon", alt: "" }),
7665
+ React__default["default"].createElement("div", { className: "content" },
7666
+ React__default["default"].createElement("h3", { className: "title" }, info.title),
7667
+ React__default["default"].createElement("div", { className: "description" }, info === null || info === void 0 ? void 0 : info.description)))));
7668
+ };
7669
+ //#endregion
7670
+ /*************************** END - NodeIntentType: 'sso-intent' *******************/
7671
+ /*******************************************************************************/
7672
+ /*******************************************************************************/
7673
+ /*************************** NodeIntentType: 'bot-title' ***********************/
7674
+ //#region
7675
+ const SubotInlineIntentBotTitle = ({ intent, indexNumber, }) => {
7676
+ const isShowLabel = ![index$2.NodeIntentType.SSO_INTENT].includes(intent === null || intent === void 0 ? void 0 : intent.type);
7677
+ return (React__default["default"].createElement(SubotInlineIntentFirstTextContainer, null,
7678
+ React__default["default"].createElement(SubotInlineIntentFirstTextWrapper, null,
7679
+ indexNumber && (React__default["default"].createElement("div", { className: "number" },
7680
+ indexNumber < 10 ? `0${indexNumber}` : indexNumber,
7681
+ ".")),
7682
+ isShowLabel &&
7683
+ intent &&
7684
+ [index$2.NodeIntentType.BOT_TEXT, index$2.NodeIntentType.BOT_BUTTON].includes(intent === null || intent === void 0 ? void 0 : intent.type) && React__default["default"].createElement(Markdown, { className: "title" }, intent.label)),
7685
+ intent &&
7686
+ [index$2.NodeIntentType.BOT_IMAGE].includes(intent === null || intent === void 0 ? void 0 : intent.type) && (React__default["default"].createElement(SubotInlineIntentFirstImageWrapper, null,
7687
+ React__default["default"].createElement(SubotInlineIntentBotImage, { intent: intent })))));
7688
+ };
7689
+ //#endregion
7690
+ /*************************** END - NodeIntentType: 'bot-title' *****************/
7691
+ /*******************************************************************************/
7692
+ /*******************************************************************************/
7693
+ /*************************** NodeIntentType: 'bot-main-title' ******************/
7694
+ //#region
7695
+ const SubotInlineIntentBotMainTitle = ({ intent, }) => {
7696
+ if (!intent.label ||
7697
+ intent.label === 'Sub title' ||
7698
+ intent.label === 'Main title') {
7699
+ return null;
7700
+ }
7701
+ return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7702
+ React__default["default"].createElement(SubotInlineIntentTitle, null,
7703
+ React__default["default"].createElement(Markdown, null, intent.label))));
7704
+ };
7705
+ //#endregion
7706
+ /*************************** END - NodeIntentType: 'bot-main-title' ************/
7707
+ /*******************************************************************************/
7708
+ /*******************************************************************************/
7709
+ /*************************** NodeIntentType: 'bot-main-image' ******************/
7710
+ //#region
7711
+ const SubotInlineIntentBotMainImage = ({ intent, }) => {
7712
+ if (!intent.url)
7713
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7714
+ return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7715
+ React__default["default"].createElement(SubotInlineIntentImageContainer, null,
7716
+ React__default["default"].createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
7717
+ intent.label && (React__default["default"].createElement("h4", { className: "intent-img-label" },
7718
+ React__default["default"].createElement(Markdown, null, intent.label))))));
7719
+ };
7720
+ //#endregion
7721
+ /*************************** END - NodeIntentType: 'bot-main-image' ************/
7722
+ /*******************************************************************************/
7723
+ /*******************************************************************************/
7724
+ /*************************** NodeIntentType: 'bot-main-body' ******************/
7725
+ //#region
7726
+ const SubotInlineIntentBotMainBody = ({ intent, }) => {
7727
+ if (!intent.label ||
7728
+ intent.label === 'Main body' ||
7729
+ intent.label === 'Sub body') {
7730
+ return null;
7731
+ }
7732
+ return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7733
+ React__default["default"].createElement("div", { className: "intents__item markdown" },
7734
+ React__default["default"].createElement(Markdown, null, intent.label))));
7735
+ };
7736
+ //#endregion
7737
+ /*************************** END - NodeIntentType: 'bot-main-body' ************/
7738
+ /*******************************************************************************/
7739
+ /*******************************************************************************/
7740
+ /*************************** NodeIntentType: 'bot-main-button' *****************/
7741
+ //#region
7742
+ const SubotInlineIntentBotMainButton = ({ intent, }) => {
7743
+ const { trackingCommonInline } = React.useContext(SubotInlineContext);
7744
+ const handleOnClick = () => {
7745
+ window.location.href = intent.url;
7746
+ };
7747
+ if (!intent.label)
7748
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7749
+ return (React__default["default"].createElement(SubotInlineIntentCol, { width: "auto" },
7750
+ React__default["default"].createElement(SubotInlineIntentFinalButtonContainer, null,
7751
+ React__default["default"].createElement(SubotInlineIntentButton, Object.assign({ size: "lg", color: "primary", onClick: handleOnClick, className: "pointer-event-child-none" }, trackingCommonInline, { "data-event-action": "Click CTA", "data-response-id": intent.id }),
7752
+ React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label)))));
7753
+ };
7754
+ //#endregion
7755
+ /*************************** END - NodeIntentType: 'bot-main-button' ***********/
7756
+ /*******************************************************************************/
7757
+ /*******************************************************************************/
7758
+ /*************************** NodeIntentType: 'bot-recalculate' *****************/
7759
+ //#region
7760
+ const SubotInlineIntentBotRecalculate = ({ intent }) => {
7761
+ const { onReset } = React.useContext(SubotInlineContext);
7762
+ const handleOnClick = () => {
7763
+ onReset && onReset();
7764
+ };
7765
+ if (!(intent === null || intent === void 0 ? void 0 : intent.label))
7766
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7767
+ return (React__default["default"].createElement(SubotInlineIntentCol, { width: "auto", style: { justifyContent: 'center', display: 'flex' } },
7768
+ React__default["default"].createElement(SubotInlineRecalculateButton, { size: "lg", color: "secondary", onClick: handleOnClick, icon: React__default["default"].createElement(RotateLeft, null), className: "bot-recalculate" },
7769
+ React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
7770
+ };
7771
+ //#endregion
7772
+ /*************************** END - NodeIntentType: 'bot-recalculate' ***********/
7773
+ /*******************************************************************************/
7774
+ /*******************************************************************************/
7775
+ /*************************** NodeIntentType: 'bot-risk-screener' ***************/
7776
+ //#region
7777
+ const SubotInlineIntentBotRiskScreener = ({ intent }) => {
7778
+ const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
7779
+ const article = React.useMemo(() => {
7780
+ if (intent.label && intent.label.includes('{')) {
7781
+ return JSON.parse(intent.label);
7782
+ }
7783
+ return {};
7784
+ }, [intent, intent === null || intent === void 0 ? void 0 : intent.label]);
7785
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, !!(article === null || article === void 0 ? void 0 : article.title) && !!(article === null || article === void 0 ? void 0 : article.thumbnail) && !!(article === null || article === void 0 ? void 0 : article.url) && (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7786
+ React__default["default"].createElement(SubotInlineIntentRiskScreenerContainer, null,
7787
+ React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature" },
7788
+ React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title })),
7789
+ React__default["default"].createElement("div", { className: "title-container" },
7790
+ React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url },
7791
+ React__default["default"].createElement("h5", { className: "title" }, article === null || article === void 0 ? void 0 : article.title)),
7792
+ React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "link" },
7793
+ f({
7794
+ id: 'riskScreener.start',
7795
+ defaultMessage: 'Start',
7796
+ }),
7797
+ React__default["default"].createElement(ChevronRightActive, { style: { marginLeft: 10 } }))))))));
7798
+ };
7799
+ //#endregion
7800
+ /*************************** END - NodeIntentType: 'bot-risk-screener' *********/
7801
+ /*******************************************************************************/
7802
+ /*******************************************************************************/
7803
+ /*************************** NodeIntentType: 'bot-related-article' *************/
7804
+ //#region
7805
+ const SubotInlineIntentBotRelatedArticle = ({ intent }) => {
7806
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
7807
+ const article = React.useMemo(() => {
7808
+ if (intent.label && intent.label.includes('{')) {
7809
+ const _article = JSON.parse(intent.label);
7810
+ if (_article.meta) {
7811
+ const tmp = {};
7812
+ _article.meta.map(({ key, value }) => {
7813
+ if (key && value)
7814
+ tmp[key] = value;
7815
+ });
7816
+ _article.meta = Object.assign({}, tmp);
7817
+ }
7818
+ return Object.assign({}, _article);
7819
+ }
7820
+ return {};
7821
+ }, [intent, intent === null || intent === void 0 ? void 0 : intent.label]);
7822
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, !!(article === null || article === void 0 ? void 0 : article.title) &&
7823
+ !!(article === null || article === void 0 ? void 0 : article.thumbnail) &&
7824
+ !!(article === null || article === void 0 ? void 0 : article.url) &&
7825
+ !!(article === null || article === void 0 ? void 0 : article.meta) &&
7826
+ !!((_a = article === null || article === void 0 ? void 0 : article.meta) === null || _a === void 0 ? void 0 : _a.post_modified) &&
7827
+ !!((_b = article === null || article === void 0 ? void 0 : article.meta) === null || _b === void 0 ? void 0 : _b.reviewed_display_name) &&
7828
+ !!((_c = article === null || article === void 0 ? void 0 : article.meta) === null || _c === void 0 ? void 0 : _c.reviewed_url) &&
7829
+ !!((_d = article === null || article === void 0 ? void 0 : article.meta) === null || _d === void 0 ? void 0 : _d.reviewed_avatar_thumbnail) &&
7830
+ !!((_e = article === null || article === void 0 ? void 0 : article.meta) === null || _e === void 0 ? void 0 : _e.category_url) &&
7831
+ !!((_f = article === null || article === void 0 ? void 0 : article.meta) === null || _f === void 0 ? void 0 : _f.category_name) && (React__default["default"].createElement(SubotInlineIntentFinalCol, { width: "40%" },
7832
+ React__default["default"].createElement(moleculesArticleCard.ArticleCard, { title: article === null || article === void 0 ? void 0 : article.title, uploadTime: dayjs__default["default"]((_g = article === null || article === void 0 ? void 0 : article.meta) === null || _g === void 0 ? void 0 : _g.post_modified).format('DD/MM/YYYY'), authorName: (_h = article === null || article === void 0 ? void 0 : article.meta) === null || _h === void 0 ? void 0 : _h.reviewed_display_name, authorLink: (_j = article === null || article === void 0 ? void 0 : article.meta) === null || _j === void 0 ? void 0 : _j.reviewed_url, avatarImg: React__default["default"].createElement("img", { loading: "lazy", src: (_k = article === null || article === void 0 ? void 0 : article.meta) === null || _k === void 0 ? void 0 : _k.reviewed_avatar_thumbnail, alt: (_l = article === null || article === void 0 ? void 0 : article.meta) === null || _l === void 0 ? void 0 : _l.reviewed_display_name }), categoryLink: (_m = article === null || article === void 0 ? void 0 : article.meta) === null || _m === void 0 ? void 0 : _m.category_url, categoryName: (_o = article === null || article === void 0 ? void 0 : article.meta) === null || _o === void 0 ? void 0 : _o.category_name, banner: React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title }), text: "", size: "sm", direction: "vertical" })))));
7833
+ };
7834
+ //#endregion
7835
+ /*************************** END - NodeIntentType: 'bot-related-article' *******/
7836
+ /*******************************************************************************/
7837
+ /*******************************************************************************/
7838
+ /*************************** NodeIntentType: 'thank-you-image' *****************/
7839
+ //#region
7840
+ const SubotInlineIntentThankYouImage = ({ intent, }) => {
7841
+ if (!intent.url)
7842
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7843
+ return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7844
+ React__default["default"].createElement(SubotInlineIntentImageContainer, null,
7845
+ React__default["default"].createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
7846
+ intent.label && (React__default["default"].createElement("h4", { className: "intent-img-label" },
7847
+ React__default["default"].createElement(Markdown, null, intent.label))))));
7848
+ };
7849
+ //#endregion
7850
+ /*************************** END - NodeIntentType: 'thank-you-image' ***********/
7851
+ /*******************************************************************************/
7852
+ /*******************************************************************************/
7853
+ /*************************** NodeIntentType: 'thank-you-title' *****************/
7854
+ //#region
7855
+ const SubotInlineIntentThankYouTitle = ({ intent, }) => {
7856
+ if (!intent.label)
7857
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7858
+ return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7859
+ React__default["default"].createElement(SubotInlineIntentTitle, null,
7860
+ React__default["default"].createElement(Markdown, null, intent.label))));
7861
+ };
7862
+ //#endregion
7863
+ /*************************** END - NodeIntentType: 'thank-you-title' ***********/
7864
+ /*******************************************************************************/
7865
+ /*******************************************************************************/
7866
+ /*************************** NodeIntentType: 'thank-you-body' ******************/
7867
+ //#region
7868
+ const SubotInlineIntentThankYouBody = ({ intent, }) => {
7869
+ if (!intent.label)
7870
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7871
+ return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7872
+ React__default["default"].createElement("div", { className: "intents__item markdown" },
7873
+ React__default["default"].createElement(Markdown, null, intent.label))));
7874
+ };
7875
+ //#endregion
7876
+ /*************************** END - NodeIntentType: 'thank-you-body' ************/
7877
+ /*******************************************************************************/
7878
+ const SubotInlineIntentBase = {
7879
+ [index$2.NodeIntentType.BOT_TEXT]: SubotInlineIntentBotText,
7880
+ [index$2.NodeIntentType.BOT_IMAGE]: SubotInlineIntentBotImage,
7881
+ [index$2.NodeIntentType.BOT_BUTTON]: SubotInlineIntentBotButton,
7882
+ [index$2.NodeIntentType.BOT_URL]: SubotInlineIntentUrl,
7883
+ [index$2.NodeIntentType.BOT_RECALCULATE]: SubotInlineIntentBotRecalculate,
7884
+ [index$2.NodeIntentType.BOT_MAIN_TITLE]: SubotInlineIntentBotMainTitle,
7885
+ [index$2.NodeIntentType.BOT_MAIN_IMAGE]: SubotInlineIntentBotMainImage,
7886
+ [index$2.NodeIntentType.BOT_MAIN_BODY]: SubotInlineIntentBotMainBody,
7887
+ [index$2.NodeIntentType.BOT_MAIN_BUTTON]: SubotInlineIntentBotMainButton,
7888
+ [index$2.NodeIntentType.BOT_SUB_TITLE]: SubotInlineIntentBotMainTitle,
7889
+ [index$2.NodeIntentType.BOT_SUB_BODY]: SubotInlineIntentBotMainBody,
7890
+ [index$2.NodeIntentType.BOT_LANDING_PAGE_URL]: SubotInlineIntentBotText,
7891
+ [index$2.NodeIntentType.BOT_LANDING_PAGE_BUTTON]: SubotInlineIntentBotText,
7892
+ [index$2.NodeIntentType.BOT_RISK_SCREEN]: SubotInlineIntentBotRiskScreener,
7893
+ [index$2.NodeIntentType.BOT_RELATED_ARTICLE]: SubotInlineIntentBotRelatedArticle,
7894
+ [index$2.NodeIntentType.THANK_YOU_IMAGE]: SubotInlineIntentThankYouImage,
7895
+ [index$2.NodeIntentType.THANK_YOU_TITLE]: SubotInlineIntentThankYouTitle,
7896
+ [index$2.NodeIntentType.THANK_YOU_BODY]: SubotInlineIntentThankYouBody,
7897
+ /** intents fake for sso block */
7898
+ [index$2.NodeIntentType.SSO_INTENT]: SubotInlineIntentSSO,
7899
+ };
7900
+
7901
+ /***************** type: TEXT, IMAGE ***************/
7902
+ const SubotInlineNode = ({ node, indexNumber, }) => {
7903
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
7904
+ const { params, onChange, onSubmit, onPrev, onNext, nodes, activeId } = React.useContext(SubotInlineContext);
7905
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
7906
+ const handleOnChangeNormal = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
7907
+ const _message = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }), getCurrentTotalDynamicScore(nodes, activeId, action.id));
7908
+ delete _message.form_submit_meta;
7909
+ const res = yield subotInlineMessage(_message);
7910
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
7911
+ const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
7912
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
7913
+ delete _nextNode._message.form_submit_meta;
7914
+ onSubmit && onSubmit(_nextNode, _message);
7915
+ }
7916
+ });
7917
+ const handleOnChange = (action, formSubmitMeta) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
7918
+ if (!action)
7919
+ return;
7920
+ const actionWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
7921
+ (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
7922
+ const newValue = Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, form_submit_meta: formSubmitMeta });
7923
+ if (actionWithOther) {
7924
+ setValue(newValue);
7925
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
7926
+ return;
7927
+ }
7928
+ delete newValue.form_submit_meta;
7929
+ setValue(newValue);
7930
+ handleOnChangeNormal(action);
7931
+ });
7932
+ const handleOnNext = () => {
7933
+ const newMessage = JSON.parse(JSON.stringify(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value)));
7934
+ if ((value === null || value === void 0 ? void 0 : value.action_id) &&
7935
+ (value === null || value === void 0 ? void 0 : value.action_value) === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD) {
7936
+ onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
7937
+ return;
7938
+ }
7939
+ if (!(value === null || value === void 0 ? void 0 : value.action_id) || !(value === null || value === void 0 ? void 0 : value.action_value)) {
7940
+ pushNotifications({
7941
+ title: '',
7942
+ message: f({
7943
+ id: 'multiSelectError.required',
7944
+ defaultMessage: `There is no answer!`,
7945
+ }),
7946
+ type: 'warning', // "success" | "danger" | "info" | "warning"
7947
+ });
7948
+ }
7949
+ else {
7950
+ delete newMessage.form_submit_meta;
7951
+ onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
7952
+ }
7953
+ };
7954
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
7955
+ React__default["default"].createElement(SubotInlineHeader$1, null),
7956
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
7957
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
7958
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
7959
+ React__default["default"].createElement(SubotInlineActionContainer, null,
7960
+ React__default["default"].createElement(SubotInlineAction, { value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange, formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta }))),
7961
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
7962
+ };
7963
+
7964
+ const SubotInlineNodeFinal = ({ node, }) => {
7965
+ var _a, _b;
7966
+ const fixHeight = 350;
7967
+ const { nodes } = React.useContext(SubotInlineContext);
7968
+ const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
7969
+ const flag = React.useRef(null);
7970
+ const wrapper = React.useRef(null);
7971
+ const [height, setHeight] = React.useState(fixHeight);
7972
+ const [showMore, setShowMore] = React.useState(true);
7973
+ const [isMore, setIsMore] = React.useState(false);
7974
+ const handleOnClick = React.useCallback(() => {
7975
+ fastdom.measure(() => {
7976
+ var _a;
7977
+ if (wrapper.current) {
7978
+ const wrapperHeight = (_a = wrapper.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
7979
+ if (height && height < wrapperHeight) {
7980
+ setHeight(wrapperHeight);
7981
+ setIsMore(true);
7982
+ }
7983
+ else {
7984
+ setHeight(fixHeight);
7985
+ setIsMore(false);
7986
+ }
7987
+ flag.current &&
7988
+ flag.current.scrollIntoView({
7989
+ behavior: 'smooth',
7990
+ block: 'start',
7991
+ inline: 'start',
7992
+ });
7993
+ }
7994
+ });
7995
+ }, [height]);
7996
+ React.useLayoutEffect(() => {
7997
+ fastdom.measure(() => {
7998
+ if (wrapper.current) {
7999
+ setTimeout(() => {
8000
+ var _a;
8001
+ const wrapperHeight = (_a = wrapper.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
8002
+ if (wrapperHeight && height > wrapperHeight) {
8003
+ setShowMore(false);
8004
+ setIsMore(false);
8005
+ }
8006
+ }, 400);
8007
+ }
8008
+ });
8009
+ }, []);
8010
+ const botItem = nodes[0];
8011
+ const botType = (_a = botItem === null || botItem === void 0 ? void 0 : botItem.extra_settings) === null || _a === void 0 ? void 0 : _a.subot_type;
8012
+ const suggestedServiceIntents = React.useMemo(() => {
8013
+ var _a;
8014
+ return (((_a = node === null || node === void 0 ? void 0 : node.intents) === null || _a === void 0 ? void 0 : _a.filter((i) => i.type === index$2.NodeIntentType.BOT_SUGGESTED_SERVICE)) || []);
8015
+ }, []);
8016
+ return (React__default["default"].createElement(SubotInlineFinalContainer, null,
8017
+ React__default["default"].createElement("div", { ref: flag, className: "hhg-flag", style: {
8018
+ position: 'absolute',
8019
+ top: -100,
8020
+ left: 0,
8021
+ pointerEvents: 'none',
8022
+ } }),
8023
+ React__default["default"].createElement(SubotInlineFinalWrapper, { maxHeight: height, isMore: isMore },
8024
+ React__default["default"].createElement("div", { ref: wrapper },
8025
+ React__default["default"].createElement(SubotInlineIntentFinal, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [] }),
8026
+ suggestedServiceIntents.length > 0 && (React__default["default"].createElement("div", null, suggestedServiceIntents.map((intent) => {
8027
+ const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
8028
+ return (NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent }));
8029
+ }))))),
8030
+ showMore && (React__default["default"].createElement(SubotInlineFinalMoreContainer, null,
8031
+ React__default["default"].createElement(SubotInlineFinalButton, { size: "md", color: "secondary", onClick: handleOnClick }, !isMore ? (React__default["default"].createElement(React__default["default"].Fragment, null,
8032
+ f({ id: 'subotInline.showMore', defaultMessage: 'Show more' }),
8033
+ React__default["default"].createElement(ArrowDown, { style: { marginLeft: 10 } }))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
8034
+ f({ id: 'subotInline.showLess', defaultMessage: 'Show less' }),
8035
+ React__default["default"].createElement(ArrowUp, { style: { marginLeft: 10 } })))))),
8036
+ botType === index$2.SubotType.voucherAcuvue && (React__default["default"].createElement(SubotInlineVoucherLeftUI, { clientId: (_b = botItem.extra_settings) === null || _b === void 0 ? void 0 : _b.client_id, voucherAnswers: extractVoucherAnswers(nodes, botItem) }))));
8037
+ };
8038
+
8039
+ const SubotInlineResultButton = styled__default["default"].span `
8040
+ display: inline-block;
8041
+ margin-top: 20px;
8042
+ color: ${miscTheme.theme.colors.primaryBase || '#2D87F3'};
8043
+ cursor: pointer;
8044
+ transition: 0.3 all ease;
8045
+ &:hover {
8046
+ color: ${miscTheme.theme.colors.primaryHover || '#2D87F3'};
8047
+ }
8048
+ ${utils.MediaQueries.tdDown} {
8049
+ margin-top: 16px;
8050
+ }
8051
+ ${utils.MediaQueries.mbDown} {
8052
+ margin-top: 12px;
8053
+ }
8054
+ `;
8055
+ const SubotInlineWrapper = styled__default["default"].div `
8056
+ max-width: 430px;
8057
+ margin-right: auto;
8058
+ margin-left: auto;
8059
+ `;
8060
+ const SubotInlineContainer = styled__default["default"].div `
8061
+ padding: 44px 16px 32px;
8062
+ background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
8063
+ border-radius: ${miscTheme.theme.borderRadius};
8064
+ position: relative;
8065
+ text-align: center;
8066
+ ${utils.MediaQueries.tdDown} {
8067
+ padding: 36px 16px 24px;
8068
+ }
8069
+ ${utils.MediaQueries.mbDown} {
8070
+ padding: 16px;
8071
+ border-radius: 0px;
8072
+ }
8073
+ `;
8074
+ const SubotInlineNodeFinalThankYou = ({ node, }) => {
8075
+ var _a;
8076
+ const { params, onNext } = React.useContext(SubotInlineContext);
8077
+ const resultButton = React.useMemo(() => {
8078
+ var _a;
8079
+ const _resultButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === index$2.NodeActionType.RESULT_BUTTON);
8080
+ if (_resultButton)
8081
+ return _resultButton;
8082
+ return null;
8083
+ }, [node === null || node === void 0 ? void 0 : node.actions]);
8084
+ const handleOnNext = React.useCallback(() => {
8085
+ onNext &&
8086
+ onNext(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), { action_id: resultButton === null || resultButton === void 0 ? void 0 : resultButton.id, action_value: resultButton === null || resultButton === void 0 ? void 0 : resultButton.key }));
8087
+ }, [resultButton]);
8088
+ return (React__default["default"].createElement(SubotInlineContainer, null,
8089
+ React__default["default"].createElement(SubotInlineWrapper, null, (_a = node === null || node === void 0 ? void 0 : node.intents) === null || _a === void 0 ? void 0 :
8090
+ _a.map((intent) => {
8091
+ const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
8092
+ return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
8093
+ }),
8094
+ resultButton && (React__default["default"].createElement(SubotInlineResultButton, { onClick: handleOnNext }, resultButton === null || resultButton === void 0 ? void 0 : resultButton.label)))));
8095
+ };
8096
+
8097
+ const SubotInlineNodeForm = ({ node, indexNumber, }) => {
8098
+ var _a;
8099
+ const { data: { locale }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8100
+ const { params, onPrev, onSubmit, trackingCommonInline, nodes, activeId } = React.useContext(SubotInlineContext);
8101
+ const handleSubmit = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8102
+ const res = yield subotInlineMessage(Object.assign(Object.assign(Object.assign(Object.assign({}, params), node._message), data), getCurrentTotalDynamicScore(nodes, activeId, data.action_id, data.form_submit_meta)));
8103
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8104
+ const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
8105
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8106
+ onSubmit && onSubmit(_nextNode, Object.assign(Object.assign({}, node._message), data));
8107
+ }
8108
+ });
8109
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8110
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8111
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8112
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8113
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8114
+ React__default["default"].createElement(SubotInlineFormContainer, null,
8115
+ React__default["default"].createElement(UserInfoForm, { botId: params.bot_id, nodeId: String(node === null || node === void 0 ? void 0 : node.id), className: "form", actions: (node === null || node === void 0 ? void 0 : node.actions) || [], formSubmitMeta: ((_a = node === null || node === void 0 ? void 0 : node._message) === null || _a === void 0 ? void 0 : _a.form_submit_meta) || null, callBack: handleSubmit, countryCode: (locale === null || locale === void 0 ? void 0 : locale.split('-')[1]) || 'PH', trackingSubmitBtn: Object.assign(Object.assign({}, trackingCommonInline), { 'data-event-action': 'Submit' }) }))),
8116
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
8117
+ };
8118
+
8119
+ const SubotInlineNodeImage = ({ node, indexNumber, }) => {
8120
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8121
+ const { params, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
8122
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8123
+ const handleOnChange = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8124
+ if (action) {
8125
+ setValue(Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }));
8126
+ const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key });
8127
+ const res = yield subotInlineMessage(_message);
8128
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8129
+ const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
8130
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8131
+ onSubmit && onSubmit(_nextNode, _message);
8132
+ }
8133
+ }
8134
+ });
8135
+ const handleOnNext = () => {
8136
+ var _a;
8137
+ if (!(node === null || node === void 0 ? void 0 : node._message) || !((_a = node._message) === null || _a === void 0 ? void 0 : _a.action_id)) {
8138
+ pushNotifications({
8139
+ title: '',
8140
+ message: f({
8141
+ id: 'multiSelectError.required',
8142
+ defaultMessage: `There is no answer!`,
8143
+ }),
8144
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8145
+ });
8146
+ }
8147
+ else {
8148
+ onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
8149
+ }
8150
+ };
8151
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8152
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8153
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8154
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8155
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8156
+ React__default["default"].createElement(SubotInlineActionContainer, null,
8157
+ React__default["default"].createElement(SubotInlineAction, { node_type: node === null || node === void 0 ? void 0 : node.type, value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange }))),
8158
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
8159
+ };
8160
+
8161
+ const SubotInlineNodeMultiple = ({ node, indexNumber, }) => {
8162
+ const { params, onChange, onPrev, onNext } = React.useContext(SubotInlineContext);
8163
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8164
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8165
+ const submitButton = React.useMemo(() => {
8166
+ var _a;
8167
+ const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.ACTION_MULTIPLE_BUTTON);
8168
+ if (_submitButton)
8169
+ return _submitButton;
8170
+ return null;
8171
+ }, [node === null || node === void 0 ? void 0 : node.actions]);
8172
+ const activeActions = React.useMemo(() => {
8173
+ if (value === null || value === void 0 ? void 0 : value.selected_actions) {
8174
+ return Object.keys(value === null || value === void 0 ? void 0 : value.selected_actions);
8175
+ }
8176
+ return [];
8177
+ }, [value, value === null || value === void 0 ? void 0 : value.selected_actions]);
8178
+ const validateSelectActions = (selected_actions, callBack) => {
8179
+ const activeActions = Object.keys(selected_actions);
8180
+ if (!activeActions.length) {
8181
+ pushNotifications({
8182
+ title: '',
8183
+ message: f({
8184
+ id: 'multiSelectError.required',
8185
+ defaultMessage: `There is no answer!`,
8186
+ }),
8187
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8188
+ });
8189
+ return;
8190
+ }
8191
+ else if ((node === null || node === void 0 ? void 0 : node.multi_select_option) === index$2.NodeMultipleOptions.RANGE &&
8192
+ activeActions.length < (node === null || node === void 0 ? void 0 : node.from)) {
8193
+ pushNotifications({
8194
+ title: '',
8195
+ message: f({
8196
+ id: 'multiSelectError.range',
8197
+ defaultMessage: 'You must choose from {from} to {to} answers (Ex: You must choose from 3 to 5 answers)',
8198
+ }, {
8199
+ from: node.from,
8200
+ to: node.to,
8201
+ }),
8202
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8203
+ });
8204
+ return;
8205
+ }
8206
+ else if ((node === null || node === void 0 ? void 0 : node.multi_select_option) === index$2.NodeMultipleOptions.EXACT_NUMBER &&
8207
+ activeActions.length !== (node === null || node === void 0 ? void 0 : node.from)) {
8208
+ pushNotifications({
8209
+ message: f({
8210
+ id: 'multiSelectError.exactNumber',
8211
+ defaultMessage: 'You must choose {from} answers.',
8212
+ }, {
8213
+ from: node.from,
8214
+ }),
8215
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8216
+ });
8217
+ return;
8218
+ }
8219
+ else {
8220
+ callBack();
8221
+ }
8222
+ };
8223
+ const handleOnClick = (action, formSubmitMeta) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8224
+ var _a, _b;
8225
+ if (action) {
8226
+ const _value = JSON.parse(JSON.stringify(Object.assign(Object.assign({}, value), { action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, selected_actions: Object.assign({}, value === null || value === void 0 ? void 0 : value.selected_actions) })));
8227
+ if ((action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT ||
8228
+ (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT) {
8229
+ const isExistedPoll = (_value === null || _value === void 0 ? void 0 : _value.selected_actions) && action.id in _value.selected_actions;
8230
+ if (isExistedPoll) {
8231
+ if (formSubmitMeta) {
8232
+ _value.form_submit_meta = formSubmitMeta;
8233
+ }
8234
+ else {
8235
+ delete _value.form_submit_meta;
8236
+ (_a = _value.selected_actions) === null || _a === void 0 ? true : delete _a[action.id];
8237
+ }
8238
+ }
8239
+ else {
8240
+ if (action === null || action === void 0 ? void 0 : action.id) {
8241
+ _value.selected_actions = Object.assign(Object.assign({}, _value.selected_actions), { [action.id]: action.key || '' });
8242
+ }
8243
+ }
8244
+ setValue(_value);
8245
+ onChange === null || onChange === void 0 ? void 0 : onChange(_value);
8246
+ return;
8247
+ }
8248
+ if (!((_b = _value.selected_actions) === null || _b === void 0 ? void 0 : _b[action.id])) {
8249
+ _value.selected_actions = Object.assign(Object.assign({}, _value.selected_actions), { [action.id]: action.key || '' });
8250
+ onChange && onChange(_value);
8251
+ setValue(_value);
8252
+ return;
8253
+ }
8254
+ if (_value.selected_actions[action.id]) {
8255
+ delete _value.selected_actions[action.id];
8256
+ onChange && onChange(_value);
8257
+ setValue(_value);
8258
+ return;
8259
+ }
8260
+ }
8261
+ });
8262
+ const handleOnNext = React.useCallback(() => {
8263
+ validateSelectActions((value === null || value === void 0 ? void 0 : value.selected_actions) || {}, () => {
8264
+ onNext &&
8265
+ onNext(Object.assign(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value), { node_id: node.id }));
8266
+ });
8267
+ }, [value, value === null || value === void 0 ? void 0 : value.selected_actions, onNext]);
8268
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8269
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8270
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8271
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8272
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8273
+ React__default["default"].createElement(SubotInlineActionContainer, null,
8274
+ React__default["default"].createElement(SubotInlineAction, { value: activeActions, actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnClick, htmlType: "checkbox", formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta }))),
8275
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
8276
+ };
8277
+
8278
+ const OTPInfoForm = ({ className, style, actions, countryCode, phoneNumber, areaCode,
8279
+ // verified,
8280
+ callBack, }) => {
8281
+ const countRef = React.useRef();
8282
+ const [isFinishedCountDown, setIsFinishedCountDown] = React.useState(false);
8283
+ const [isLoading, setIsLoading] = React.useState(false);
8284
+ const [isLoadingVerify, setIsLoadingVerify] = React.useState(false);
8285
+ const [sentOTP, setSentOTP] = React.useState(false);
8286
+ const { register, formState: { errors }, control, trigger, getValues, setValue, } = reactHookForm.useForm();
8287
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8288
+ // useEffect(() => {
8289
+ // const actionPhone = actions.find(
8290
+ // (action) => action.type === NodeActionType.USER_SUBMIT_PHONE,
8291
+ // )
8292
+ // actionPhone?.key && setValue(actionPhone.key, '+84343261825')
8293
+ // setSentOTP(true)
8294
+ // }, [])
8295
+ // const placeholderPhone = useMemo(() => {
8296
+ // return actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_PHONE)
8297
+ // ?.label
8298
+ // }, [actions])
8299
+ // const placeholderOtp = useMemo(() => {
8300
+ // return actions.find(
8301
+ // ({ type }) => type === NodeActionType.USER_SUBMIT_NUMBER,
8302
+ // )?.label
8303
+ // }, [actions])
8304
+ // const labelBtnSendOtp = 'Gửi mã OTP'
8305
+ // const labelBtnVerifyOtp = useMemo(() => {
8306
+ // return (
8307
+ // actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_SEND)
8308
+ // ?.label || 'Xác minh mã OTP'
8309
+ // )
8310
+ // }, [actions])
8311
+ // const labelBtnResendOtp = useMemo(() => {
8312
+ // return (
8313
+ // actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_RESEND)
8314
+ // ?.label || 'Gửi lại mã OTP'
8315
+ // )
8316
+ // }, [actions])
8317
+ const handleSendOTP = (event) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8318
+ var _a;
8319
+ event.preventDefault();
8320
+ const data = getValues();
8321
+ const parsedPhone = PhoneInputBase.parsePhoneNumber(data.phone || '');
8322
+ if (!(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.nationalNumber) || !(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.countryCallingCode)) {
8323
+ return;
8324
+ }
8325
+ setIsLoading(true);
8326
+ try {
8327
+ const result = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.POST_SEND_OTP), 'POST', {
8328
+ data: {
8329
+ phone_number: parsedPhone.nationalNumber,
8330
+ area_code: `+${parsedPhone.countryCallingCode}`,
8331
+ },
8332
+ });
8333
+ setIsLoading(false);
8334
+ if ((result === null || result === void 0 ? void 0 : result._status) === 1) {
8335
+ if (sentOTP) {
8336
+ setIsFinishedCountDown(false);
8337
+ countRef.current.reset();
8338
+ }
8339
+ setSentOTP(true);
8340
+ setTimeout(() => {
8341
+ const input = document.querySelector('.input-otp-code');
8342
+ if (input) {
8343
+ input.focus();
8344
+ input.scrollIntoView({ block: 'center' });
8345
+ }
8346
+ }, 100);
8347
+ return;
8348
+ }
8349
+ if ((result === null || result === void 0 ? void 0 : result._status) === 0 &&
8350
+ ((_a = result === null || result === void 0 ? void 0 : result._messages) === null || _a === void 0 ? void 0 : _a[0]) === 'This phone number was verified') {
8351
+ // const { _messages } = result
8352
+ if (countRef.current) {
8353
+ countRef.current.cancel();
8354
+ }
8355
+ pushNotifications({
8356
+ title: '',
8357
+ message: 'Số điện thoại này đã được xác minh.',
8358
+ type: 'success',
8359
+ });
8360
+ const action = actions.find((action) => action.type === index$2.NodeActionType.USER_SUBMIT_SEND);
8361
+ action && callBack(action, data.phone);
8362
+ return;
8363
+ }
8364
+ throw new Error();
8365
+ }
8366
+ catch (error) {
8367
+ setIsLoading(false);
8368
+ if (countRef.current) {
8369
+ countRef.current.cancel();
8370
+ }
8371
+ showMessageSomethingWrong();
8372
+ }
8373
+ });
8374
+ const handleOnVerify = (event, action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8375
+ event.preventDefault();
8376
+ setIsLoadingVerify(true);
8377
+ yield trigger();
8378
+ if (isEmpty__default["default"](errors)) {
8379
+ const data = getValues();
8380
+ const { number } = data;
8381
+ const parsedPhone = PhoneInputBase.parsePhoneNumber(data.phone || '');
8382
+ if (!(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.nationalNumber) || !(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.countryCallingCode)) {
8383
+ return;
8384
+ }
8385
+ try {
8386
+ const result = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.POST_VERIFY_OTP), 'POST', {
8387
+ data: {
8388
+ phone_number: parsedPhone.nationalNumber,
8389
+ area_code: `+${parsedPhone.countryCallingCode}`,
8390
+ code: number,
8391
+ },
8392
+ });
8393
+ setIsLoadingVerify(false);
8394
+ if ((result === null || result === void 0 ? void 0 : result._status) === 1) {
8395
+ pushNotifications({
8396
+ title: '',
8397
+ message: f({ id: 'subot.verifyOTP.success.message' }),
8398
+ type: 'success',
8399
+ });
8400
+ callBack(action, data.phone);
8401
+ return;
8402
+ }
8403
+ throw new Error();
8404
+ }
8405
+ catch (error) {
8406
+ pushNotifications({
8407
+ title: '',
8408
+ message: f({ id: 'validation.error.validOTP' }),
8409
+ type: 'danger',
8410
+ });
8411
+ setIsLoadingVerify(false);
8412
+ }
8413
+ }
8414
+ else {
8415
+ setIsLoadingVerify(false);
8416
+ }
8417
+ });
8418
+ const showMessageSomethingWrong = () => {
8419
+ pushNotifications({
8420
+ title: '',
8421
+ message: f({ id: 'notification.comment.somethingWrong' }),
8422
+ type: 'danger',
8423
+ });
8424
+ };
8425
+ const renderFormInput = (action) => {
8426
+ if (!action.key) {
8427
+ return null;
8428
+ }
8429
+ switch (action.type) {
8430
+ case index$2.NodeActionType.USER_SUBMIT_PHONE:
8431
+ return (React__default["default"].createElement("div", { className: "input-row", key: action.id },
8432
+ React__default["default"].createElement("label", { htmlFor: action.key }, action.label),
8433
+ React__default["default"].createElement(reactHookForm.Controller, { name: action.key, control: control, rules: {
8434
+ required: true,
8435
+ validate: (value) => PhoneInputBase.isPossiblePhoneNumber(value),
8436
+ }, render: ({ field: { onChange, value } }) => {
8437
+ const disabledPhone = (!isFinishedCountDown && sentOTP) || isLoading;
8438
+ return (React__default["default"].createElement(StyleWrapperPhoneInput, null,
8439
+ React__default["default"].createElement(PhoneInputWithCode, { value: value, defaultValue: phoneNumber, onChange: onChange, defaultCountry: countryCode, id: action.id, className: `input-row ${action.id}`, name: action.key, disabled: disabledPhone, flagComponent: FlagComponent, placeholder: action.label }),
8440
+ disabledPhone && (React__default["default"].createElement(IconEdit, { viewBox: "0 0 24 24", className: "icon-edit-phone", onClick: () => {
8441
+ var _a;
8442
+ onChange('');
8443
+ setSentOTP(false);
8444
+ setIsLoadingVerify(false);
8445
+ (_a = countRef.current) === null || _a === void 0 ? void 0 : _a.cancel();
8446
+ } })),
8447
+ action.key && errors[action.key] && (React__default["default"].createElement("p", { className: "error-message" }, f({
8448
+ id: 'validation.error.validNumber',
8449
+ defaultMessage: 'Please enter a valid number.',
8450
+ }))),
8451
+ React__default["default"].createElement("div", { className: "submit-btn-row", key: action.id },
8452
+ React__default["default"].createElement(index$8.Button, { className: "submit-btn", size: "lg", onClick: handleSendOTP, isDisabled: (!isFinishedCountDown && sentOTP) || isLoading, isLoading: isLoading }, sentOTP ? (React__default["default"].createElement(CountDown$1, { ref: countRef, isFinished: isFinishedCountDown, onFinish: setIsFinishedCountDown })) : (React__default["default"].createElement("span", null, f({
8453
+ id: 'subot.sendOTP.button',
8454
+ defaultMessage: 'Send OTP',
8455
+ })))))));
8456
+ } })));
8457
+ case index$2.NodeActionType.USER_SUBMIT_NUMBER:
8458
+ if (!sentOTP) {
8459
+ return '';
8460
+ }
8461
+ return (React__default["default"].createElement("div", { className: "input-row", key: action.id },
8462
+ React__default["default"].createElement("label", { htmlFor: action.key }, action.label),
8463
+ React__default["default"].createElement("input", Object.assign({ type: "tel", id: action.id, placeholder: action.label }, register(action.key, {
8464
+ required: true,
8465
+ pattern: /^[0-9]{0,6}$/,
8466
+ }), { className: "input-otp-code" })),
8467
+ errors[action.key] && (React__default["default"].createElement("p", { className: "error-message" }, f({
8468
+ id: 'validation.error.validOTP',
8469
+ defaultMessage: 'Invalid OTP provided',
8470
+ })))));
8471
+ default:
8472
+ return '';
8473
+ }
8474
+ };
8475
+ const renderFormSubmitAndTerms = (action) => {
8476
+ switch (action.type) {
8477
+ case index$2.NodeActionType.USER_SUBMIT_SEND:
8478
+ if (!sentOTP)
8479
+ return '';
8480
+ return (React__default["default"].createElement("div", { className: "submit-btn-row", key: action.id },
8481
+ React__default["default"].createElement(index$8.Button, { className: "submit-btn", size: "lg", isDisabled: isLoadingVerify, isLoading: isLoadingVerify, onClick: (event) => handleOnVerify(event, action) }, action.label)));
8482
+ default:
8483
+ return '';
8484
+ }
8485
+ };
8486
+ React.useEffect(() => {
8487
+ if (phoneNumber) {
8488
+ const action = actions.find((action) => action.type === index$2.NodeActionType.USER_SUBMIT_PHONE);
8489
+ if (action && action.key) {
8490
+ setValue(action.key, `+${areaCode}${phoneNumber}`);
8491
+ }
8492
+ }
8493
+ }, [phoneNumber, areaCode]);
8494
+ return (React__default["default"].createElement(StyledUserInfoFormContainer$1, { className: className, style: style },
8495
+ React__default["default"].createElement("form", { className: "user-info-form" },
8496
+ actions.map((action) => renderFormInput(action)),
8497
+ actions.map((action) => renderFormSubmitAndTerms(action)))));
8498
+ };
8499
+
8500
+ const useVerifyPhoneNumber = () => {
8501
+ const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
8502
+ const [verifiedPhone, setVerifiedPhone] = React.useState(false);
8503
+ React.useEffect(() => {
8504
+ if (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone) {
8505
+ if (userInfo.phone_verified_at && userInfo.verify_phone_code) {
8506
+ setVerifiedPhone(true);
8507
+ }
8508
+ }
8509
+ }, [userInfo]);
8510
+ return verifiedPhone;
8511
+ };
8512
+
8513
+ const SubotInlineNodeOTP = ({ node, indexNumber, }) => {
8514
+ const { params, onPrev, onNext } = React.useContext(SubotInlineContext);
8515
+ const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
8516
+ const locale = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.locale;
8517
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8518
+ const verifiedPhone = useVerifyPhoneNumber();
8519
+ const handleOnVerify = (action, phoneNumber) => {
8520
+ var _a;
8521
+ const actionPhone = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === index$2.NodeActionType.USER_SUBMIT_PHONE);
8522
+ if (!action || !actionPhone) {
8523
+ return;
8524
+ }
8525
+ const form_submit_meta = [
8526
+ {
8527
+ key: String(actionPhone.key),
8528
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[index$2.NodeActionType.USER_SUBMIT_PHONE],
8529
+ value: phoneNumber,
8530
+ },
8531
+ ];
8532
+ const newValue = Object.assign(Object.assign({}, value), { form_submit_meta, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key });
8533
+ setValue(newValue);
8534
+ onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), newValue), node === null || node === void 0 ? void 0 : node._message));
8535
+ };
8536
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8537
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8538
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8539
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8540
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8541
+ React__default["default"].createElement(SubotInlineActionContainer, null,
8542
+ React__default["default"].createElement(OTPInfoForm, { phoneNumber: userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone, verified: verifiedPhone, areaCode: userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code, callBack: handleOnVerify, actions: (node === null || node === void 0 ? void 0 : node.actions) || [], countryCode: (locale === null || locale === void 0 ? void 0 : locale.split('-')[1]) || 'PH' }))),
8543
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
8544
+ };
8545
+
8546
+ // Poll Message
8547
+ // {
8548
+ // form_meta: [
8549
+ // { key: "poll4", control: "formmeta", value: "", action_id: "action.id" },
8550
+ // { key: "poll2", control: "formmeta", value: "", action_id: "action.id" },
8551
+ // { key: "poll3", control: "formmeta", value: "", action_id: "action.id" },
8552
+ // { key: 'attribite-description', control:"formmeta-description", value: '', action_id: "action.id"}
8553
+ // ],
8554
+ // action_id: "button_id",
8555
+ // action_value: "button_attribute"
8556
+ // }
8557
+ const SubotInlineNodePoll = ({ node, indexNumber, }) => {
8558
+ var _a, _b;
8559
+ const { params, onChange, onPrev, onNext } = React.useContext(SubotInlineContext);
8560
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8561
+ const validation = useValidationMultiOption();
8562
+ const descriptionNode = useDescriptionPollNode({ node });
8563
+ const submitButton = React.useMemo(() => {
8564
+ var _a;
8565
+ const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.POLL_BUTTON);
8566
+ if (_submitButton)
8567
+ return _submitButton;
8568
+ return null;
8569
+ }, [node === null || node === void 0 ? void 0 : node.actions]);
8570
+ const handleOnChange = (action, formSubmitMeta) => {
8571
+ var _a, _b, _c, _d, _e, _f, _g;
8572
+ const newValue = JSON.parse(JSON.stringify(Object.assign(Object.assign({}, value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: [...((value === null || value === void 0 ? void 0 : value.form_submit_meta) || [])] })));
8573
+ if ((action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT ||
8574
+ (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT) {
8575
+ const isExistedPoll = (_a = newValue.form_submit_meta) === null || _a === void 0 ? void 0 : _a.some(({ action_id }) => action_id === action.id);
8576
+ if (isExistedPoll) {
8577
+ newValue.form_submit_meta =
8578
+ typeof formSubmitMeta === 'undefined'
8579
+ ? (_b = newValue.form_submit_meta) === null || _b === void 0 ? void 0 : _b.filter(({ action_id }) => action_id !== action.id)
8580
+ : (_c = newValue.form_submit_meta) === null || _c === void 0 ? void 0 : _c.filter(({ action_id }) => action_id !== action.id).concat(formSubmitMeta);
8581
+ }
8582
+ else {
8583
+ newValue.form_submit_meta = (_d = newValue.form_submit_meta) === null || _d === void 0 ? void 0 : _d.concat([
8584
+ {
8585
+ key: action === null || action === void 0 ? void 0 : action.key,
8586
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type] || 'text',
8587
+ value: '',
8588
+ action_id: action === null || action === void 0 ? void 0 : action.id,
8589
+ },
8590
+ ]);
8591
+ }
8592
+ setValue(newValue);
8593
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
8594
+ return;
8595
+ }
8596
+ const isPoll = (_e = newValue.form_submit_meta) === null || _e === void 0 ? void 0 : _e.some(({ action_id }) => action_id === (action === null || action === void 0 ? void 0 : action.action_id));
8597
+ if (isPoll) {
8598
+ newValue.form_submit_meta = (_f = newValue.form_submit_meta) === null || _f === void 0 ? void 0 : _f.filter(({ action_id }) => action_id !== (action === null || action === void 0 ? void 0 : action.action_id));
8599
+ }
8600
+ else {
8601
+ newValue.form_submit_meta = (_g = newValue.form_submit_meta) === null || _g === void 0 ? void 0 : _g.concat([action]);
8602
+ }
8603
+ setValue(newValue);
8604
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
8605
+ };
8606
+ const activeActions = React.useMemo(() => {
8607
+ if (value === null || value === void 0 ? void 0 : value.form_submit_meta) {
8608
+ return value === null || value === void 0 ? void 0 : value.form_submit_meta.map(({ action_id }) => action_id);
8609
+ }
8610
+ return [];
8611
+ }, [value, value === null || value === void 0 ? void 0 : value.form_submit_meta]);
8612
+ const handleOnNext = () => {
8613
+ const tmp = {};
8614
+ if (value.form_submit_meta && value.form_submit_meta.length) {
8615
+ tmp[node.id] = value.form_submit_meta.map((_v) => _v.action_id);
8616
+ }
8617
+ const newValue = Object.assign(Object.assign({}, value), { current_polls: tmp });
8618
+ validation.validateSelectActions(activeActions, node, () => {
8619
+ onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), newValue));
8620
+ });
8621
+ };
8622
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8623
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8624
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8625
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8626
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8627
+ React__default["default"].createElement(SubotInlineDescription$1, null, descriptionNode),
8628
+ React__default["default"].createElement(SubotInlineActionContainer, null, (node === null || node === void 0 ? void 0 : node.actions) && !!((_a = node.actions) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== index$2.NodeActionType.POLL_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
8629
+ const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8630
+ return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, active: activeActions.includes(action.id), action: action, onChange: handleOnChange, htmlType: "checkbox", formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta })));
8631
+ }))))),
8632
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
8633
+ };
8634
+
8635
+ // Rating Message
8636
+ // {
8637
+ // form_meta: [
8638
+ // { key: "action.key", control: "star", value: "", action_id: 'action.id' },
8639
+ // { key: 'action.key', control: "text", value: '', action_id: 'action.id' }
8640
+ // ],
8641
+ // action_id: "button_id",
8642
+ // action_value: "button_attribute"
8643
+ // }
8644
+ const SubotInlineNodeRating = ({ node, indexNumber, }) => {
8645
+ var _a, _b;
8646
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8647
+ const { params, onChange, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
8648
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8649
+ const [isSubmit, setIsSubmit] = React.useState(false);
8650
+ const ratingStarValue = React.useMemo(() => {
8651
+ var _a;
8652
+ const _ratingStar = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === index$2.NodeActionType.RATING_STAR);
8653
+ if (value.form_submit_meta && _ratingStar) {
8654
+ const formIndex = value === null || value === void 0 ? void 0 : value.form_submit_meta.findIndex(({ action_id }) => action_id === (_ratingStar === null || _ratingStar === void 0 ? void 0 : _ratingStar.id));
8655
+ if (formIndex !== -1)
8656
+ return parseInt(value === null || value === void 0 ? void 0 : value.form_submit_meta[formIndex].value);
8657
+ }
8658
+ return 0;
8659
+ }, [value === null || value === void 0 ? void 0 : value.form_submit_meta]);
8660
+ const submitButton = React.useMemo(() => {
8661
+ var _a;
8662
+ const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.RATING_BUTTON);
8663
+ if (_submitButton)
8664
+ return _submitButton;
8665
+ return null;
8666
+ }, []);
8667
+ const handleOnChange = (formValue) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8668
+ if (formValue) {
8669
+ const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: (value === null || value === void 0 ? void 0 : value.form_submit_meta)
8670
+ ? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
8671
+ : [] });
8672
+ const tmpFormSubmitMeta = [
8673
+ ..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
8674
+ ];
8675
+ const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
8676
+ if (formUpdateIndex !== -1)
8677
+ tmpFormSubmitMeta[formUpdateIndex] = Object.assign({}, formValue);
8678
+ else
8679
+ tmpFormSubmitMeta.push(formValue);
8680
+ _message.form_submit_meta = [...tmpFormSubmitMeta];
8681
+ setValue(_message);
8682
+ onChange && onChange(_message);
8683
+ }
8684
+ });
8685
+ const handleOnNext = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8686
+ if (!value.form_submit_meta || ratingStarValue === 0) {
8687
+ pushNotifications({
8688
+ title: '',
8689
+ message: f({
8690
+ id: 'multiSelectError.required',
8691
+ defaultMessage: `There is no answer!`,
8692
+ }),
8693
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8694
+ });
8695
+ return;
8696
+ }
8697
+ if (!isSubmit) {
8698
+ const _message = Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value);
8699
+ const res = yield subotInlineMessage(_message);
8700
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8701
+ const _c = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _c, restData = tslib_es6.__rest(_c, ["node"]);
8702
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8703
+ onSubmit && onSubmit(_nextNode, _message);
8704
+ setIsSubmit(true);
8705
+ }
8706
+ }
8707
+ else {
8708
+ onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
8709
+ }
8710
+ });
8711
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8712
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8713
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8714
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8715
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8716
+ React__default["default"].createElement(SubotInlineActionContainer, null, (node === null || node === void 0 ? void 0 : node.actions) && !!((_a = node.actions) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== index$2.NodeActionType.RATING_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
8717
+ var _a;
8718
+ const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8719
+ return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: handleOnChange, value: (value &&
8720
+ (value === null || value === void 0 ? void 0 : value.form_submit_meta) &&
8721
+ ((_a = value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) })));
8722
+ }))))),
8723
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
8724
+ };
8725
+
8726
+ const SubotInlineNodeReaction = ({ node, indexNumber, }) => {
8727
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8728
+ const { params, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
8729
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8730
+ const handleOnChange = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8731
+ if (action) {
8732
+ setValue(Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }));
8733
+ const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key });
8734
+ const res = yield subotInlineMessage(_message);
8735
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8736
+ const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
8737
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8738
+ onSubmit && onSubmit(_nextNode, _message);
8739
+ }
8740
+ }
8741
+ });
8742
+ const handleOnNext = () => {
8743
+ var _a;
8744
+ if (!(node === null || node === void 0 ? void 0 : node._message) || !((_a = node._message) === null || _a === void 0 ? void 0 : _a.action_id)) {
8745
+ pushNotifications({
8746
+ title: '',
8747
+ message: f({
8748
+ id: 'multiSelectError.required',
8749
+ defaultMessage: `There is no answer!`,
8750
+ }),
8751
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8752
+ });
8753
+ }
8754
+ else {
8755
+ onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
8756
+ }
8757
+ };
8758
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8759
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8760
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8761
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8762
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8763
+ React__default["default"].createElement(SubotInlineActionContainer, null,
8764
+ React__default["default"].createElement(SubotInlineAction, { value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: (node === null || node === void 0 ? void 0 : node.actions) || [], onChange: handleOnChange }))),
8765
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
8766
+ };
8767
+
8768
+ const SubotInlineNodeResultPoll = ({ node, }) => {
8769
+ var _a, _b;
8770
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8771
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8772
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8773
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8774
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [] })),
8775
+ React__default["default"].createElement(SubotInlineActionContainer, null, (node === null || node === void 0 ? void 0 : node.actions) && !!((_a = node.actions) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== index$2.NodeActionType.POLL_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
8776
+ const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8777
+ return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, htmlType: "checkbox", node_type: node === null || node === void 0 ? void 0 : node.type })));
8778
+ })))))));
8779
+ };
8780
+
8781
+ // Review Message
8782
+ // {
8783
+ // form_meta: [
8784
+ // { key: "review1", control: "formmeta", value: '', action_id: "action.id" },
8785
+ // { key: "review2", control: "formmeta", value: '', action_id: "action.id" },
8786
+ // { key: "review3", control: "formmeta", value: "" },
8787
+ // { key: "review4", control: "formmeta", value: "" },
8788
+ // { key: "review5", control: "formmeta", value: "" },
8789
+ // {key: 'attribite-description', control:"formmeta-description", value: ''}
8790
+ // ],
8791
+ // action_id: "button_id",
8792
+ // action_value: "button_attribute"
8793
+ // }
8794
+ const SubotInlineNodeReview = ({ node, indexNumber, }) => {
8795
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8796
+ const { params, onChange, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
8797
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8798
+ const [isSubmit, setIsSubmit] = React.useState(false);
8799
+ const reviewChoices = React.useMemo(() => {
8800
+ var _a;
8801
+ return ((_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.filter(({ type }) => type === index$2.NodeActionType.REVIEW_CHOICE)) || [];
8802
+ }, [node === null || node === void 0 ? void 0 : node.actions]);
8803
+ const reviewDescriptions = React.useMemo(() => {
8804
+ var _a;
8805
+ return ((_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.filter(({ type }) => type === index$2.NodeActionType.REVIEW_DESCRIPTION)) || [];
8806
+ }, [node === null || node === void 0 ? void 0 : node.actions]);
8807
+ const submitButton = React.useMemo(() => {
8808
+ var _a;
8809
+ const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.REVIEW_BUTTON);
8810
+ if (_submitButton)
8811
+ return _submitButton;
8812
+ return null;
8813
+ }, [node === null || node === void 0 ? void 0 : node.actions]);
8814
+ const activeActions = React.useMemo(() => {
8815
+ if (value === null || value === void 0 ? void 0 : value.form_submit_meta) {
8816
+ return value === null || value === void 0 ? void 0 : value.form_submit_meta.map(({ action_id }) => action_id).filter((action_id) => !!(reviewChoices === null || reviewChoices === void 0 ? void 0 : reviewChoices.map(({ id }) => id).includes(action_id)));
8817
+ }
8818
+ return [];
8819
+ }, [value, value === null || value === void 0 ? void 0 : value.form_submit_meta]);
8820
+ const handleOnClick = (formValue) => {
8821
+ if (formValue) {
8822
+ const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: (value === null || value === void 0 ? void 0 : value.form_submit_meta)
8823
+ ? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
8824
+ : [] });
8825
+ let tmpFormSubmitMeta = [
8826
+ ..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
8827
+ ];
8828
+ const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
8829
+ if (formUpdateIndex !== -1)
8830
+ tmpFormSubmitMeta = [
8831
+ ...tmpFormSubmitMeta.slice(0, formUpdateIndex),
8832
+ ...tmpFormSubmitMeta.slice(formUpdateIndex + 1),
8833
+ ];
8834
+ else
8835
+ tmpFormSubmitMeta.push(formValue);
8836
+ _message.form_submit_meta = [...tmpFormSubmitMeta];
8837
+ setValue(_message);
8838
+ setIsSubmit(false);
8839
+ onChange && onChange(_message);
8840
+ }
8841
+ };
8842
+ const handleOnChange = (formValue) => {
8843
+ if (formValue) {
8844
+ const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: (value === null || value === void 0 ? void 0 : value.form_submit_meta)
8845
+ ? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
8846
+ : [] });
8847
+ const tmpFormSubmitMeta = [
8848
+ ..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
8849
+ ];
8850
+ const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
8851
+ if (formUpdateIndex !== -1)
8852
+ tmpFormSubmitMeta[formUpdateIndex] = Object.assign({}, formValue);
8853
+ else
8854
+ tmpFormSubmitMeta.push(formValue);
8855
+ _message.form_submit_meta = [...tmpFormSubmitMeta];
8856
+ setValue(_message);
8857
+ setIsSubmit(false);
8858
+ onChange && onChange(_message);
8859
+ }
8860
+ };
8861
+ const handleOnNext = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8862
+ var _a;
8863
+ if (!((_a = node === null || node === void 0 ? void 0 : node._message) === null || _a === void 0 ? void 0 : _a.form_submit_meta) || !activeActions.length) {
8864
+ pushNotifications({
8865
+ title: '',
8866
+ message: f({
8867
+ id: 'multiSelectError.required',
8868
+ defaultMessage: `There is no answer!`,
8869
+ }),
8870
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8871
+ });
8872
+ return;
8873
+ }
8874
+ if (!isSubmit) {
8875
+ const _message = Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value);
8876
+ const res = yield subotInlineMessage(_message);
8877
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8878
+ const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
8879
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8880
+ onSubmit && onSubmit(_nextNode, _message);
8881
+ setIsSubmit(true);
8882
+ }
8883
+ }
8884
+ else {
8885
+ onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
8886
+ }
8887
+ });
8888
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8889
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8890
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8891
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8892
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8893
+ React__default["default"].createElement(SubotInlineActionContainer, null,
8894
+ !!reviewChoices.length && (React__default["default"].createElement(SubotInlineReviewContainer, null,
8895
+ React__default["default"].createElement(SubotInlineActionListContainer, { className: "review-container" }, reviewChoices.map((action) => {
8896
+ var _a;
8897
+ const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8898
+ return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: handleOnClick, active: (value &&
8899
+ !!((_a = value === null || value === void 0 ? void 0 : value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) ||
8900
+ false })));
8901
+ })))),
8902
+ !!(reviewDescriptions === null || reviewDescriptions === void 0 ? void 0 : reviewDescriptions.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, reviewDescriptions.map((action) => {
8903
+ var _a;
8904
+ const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8905
+ return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: handleOnChange, value: (value &&
8906
+ (value === null || value === void 0 ? void 0 : value.form_submit_meta) &&
8907
+ ((_a = value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) })));
8908
+ }))))),
8909
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
8910
+ };
8911
+
8912
+ const SubotInlineNodeSSO = ({ node, indexNumber, }) => {
8913
+ const refIsTrigger = React.useRef(false);
8914
+ const { params, onPrev, nodes, activeId, userInfo } = React.useContext(SubotInlineContext);
8915
+ React.useEffect(() => {
8916
+ var _a;
8917
+ const actionSSO = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find((act) => act.type === index$2.NodeActionType.ACTION_SSO_REDIRECT);
8918
+ if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) && actionSSO && !refIsTrigger.current) {
8919
+ refIsTrigger.current = true;
8920
+ handleOnChange(actionSSO);
8921
+ }
8922
+ }, [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
8923
+ const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8924
+ const handleOnChange = (action) => {
8925
+ if (action && action.type === index$2.NodeActionType.ACTION_SSO_REDIRECT) {
8926
+ const currentState = {
8927
+ params: Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, mode: 'inline' }),
8928
+ listNodes: nodes,
8929
+ activeId,
8930
+ createdAt: new Date().getTime(),
8931
+ botId: params.bot_id,
8932
+ };
8933
+ localStorage.setItem(STATE_SUBOT_INLINE_KEY, JSON.stringify(currentState));
8934
+ const urlObj = utils$1.getURLwithSSOTracking(window.location.href, {
8935
+ botItem: nodes[0],
8936
+ });
8937
+ urlObj.searchParams.set('bot_id', String(params.bot_id));
8938
+ urlObj.searchParams.set('mode', 'inline');
8939
+ urlObj.searchParams.set('source', 'subot-inline');
8940
+ const returnUrl = urlObj.href;
8941
+ if (store.IS_SSOV2_ENABLED()) {
8942
+ store.useSSOV2Store.getState().triggerLogin({
8943
+ returnUrl,
8944
+ source: `subot-inline`,
8945
+ });
8946
+ }
8947
+ else {
8948
+ window.location.href = `${index$3.SSO_URL}?returnUrl=${encodeURIComponent(returnUrl)}`;
8949
+ }
8950
+ }
8951
+ };
8952
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8953
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8954
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8955
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8956
+ React__default["default"].createElement(SubotInlineIntent, { intents: [
8957
+ ...((node === null || node === void 0 ? void 0 : node.intents) || []),
8958
+ ...index$1.ssoIntents(f),
8959
+ ], indexNumber: indexNumber })),
8960
+ React__default["default"].createElement(SubotInlineActionContainer, null,
8961
+ React__default["default"].createElement(SubotInlineAction, { actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange }))),
8962
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
8963
+ };
8964
+
8965
+ const SubotInlineNodeText = ({ node, indexNumber, }) => {
8966
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8967
+ const { nodes, activeId, params, onSubmit, onPrev, onNext, onChange } = React.useContext(SubotInlineContext);
8968
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8969
+ const handleOnChangeNormal = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8970
+ const _message = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }), getCurrentTotalDynamicScore(nodes, activeId, action.id));
8971
+ delete _message.form_submit_meta;
8972
+ const res = yield subotInlineMessage(_message);
8973
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8974
+ const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
8975
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8976
+ onSubmit && onSubmit(_nextNode, _message);
8977
+ }
8978
+ });
8979
+ const handleOnChange = (action, formSubmitMeta) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8980
+ if (!action)
8981
+ return;
8982
+ const actionWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
8983
+ (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
8984
+ const newValue = Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, form_submit_meta: formSubmitMeta });
8985
+ if (actionWithOther) {
8986
+ setValue(newValue);
8987
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
8988
+ return;
8989
+ }
8990
+ delete newValue.form_submit_meta;
8991
+ setValue(newValue);
8992
+ handleOnChangeNormal(action);
8993
+ });
8994
+ const handleOnNext = () => {
8995
+ const newMessage = JSON.parse(JSON.stringify(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value)));
8996
+ if ((value === null || value === void 0 ? void 0 : value.action_id) &&
8997
+ (value === null || value === void 0 ? void 0 : value.action_value) === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD) {
8998
+ onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
8999
+ return;
9000
+ }
9001
+ if (!(value === null || value === void 0 ? void 0 : value.action_id) || !(value === null || value === void 0 ? void 0 : value.action_value)) {
9002
+ pushNotifications({
9003
+ title: '',
9004
+ message: f({
9005
+ id: 'multiSelectError.required',
9006
+ defaultMessage: `There is no answer!`,
9007
+ }),
9008
+ type: 'warning', // "success" | "danger" | "info" | "warning"
9009
+ });
9010
+ }
9011
+ else {
9012
+ delete newMessage.form_submit_meta;
9013
+ onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
9014
+ }
9015
+ };
9016
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
9017
+ React__default["default"].createElement(SubotInlineHeader$1, null),
9018
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
9019
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
9020
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
9021
+ React__default["default"].createElement(SubotInlineActionContainer, null,
9022
+ React__default["default"].createElement(SubotInlineAction, { value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange, formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta }))),
9023
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
9024
+ };
9025
+
9026
+ const SubotInlineNodeBase = {
9027
+ TEXT: SubotInlineNodeText,
9028
+ IMAGE: SubotInlineNodeImage,
9029
+ FORM: SubotInlineNodeForm,
9030
+ CONDITION: SubotInlineNode,
9031
+ FINAL_STANDARD: SubotInlineNodeFinal,
9032
+ FINAL: SubotInlineNodeFinal,
9033
+ FINAL_THANK_YOU: SubotInlineNodeFinalThankYou,
9034
+ SSO: SubotInlineNodeSSO,
9035
+ MULTIPLE: SubotInlineNodeMultiple,
9036
+ POLL: SubotInlineNodePoll,
9037
+ RATING: SubotInlineNodeRating,
9038
+ REACTION: SubotInlineNodeReaction,
9039
+ REVIEW: SubotInlineNodeReview,
9040
+ RESULT_POLL: SubotInlineNodeResultPoll,
9041
+ OTP: SubotInlineNodeOTP,
9042
+ // RESULT_RATING = 12,
9043
+ // RESULT_REACTION = 13,
9044
+ };
9045
+
9046
+ const SubotInlineButton = styled__default["default"](index$8.Button) `
9047
+ margin-top: 24px;
9048
+ ${utils.MediaQueries.mbUp} {
9049
+ margin-top: 16px;
9050
+ }
9051
+ `;
9052
+ const SubotInlineDescription = styled__default["default"].div `
9053
+ margin-top: 24px;
9054
+ `;
9055
+ const SubotInlineReview = styled__default["default"](index$d.Text) `
9056
+ text-align: center;
9057
+ ${utils.MediaQueries.mbUp} {
9058
+ text-align: left;
9059
+ }
9060
+ `;
9061
+ const SubotInlineTitle = styled__default["default"](index$e.Heading) `
9062
+ text-align: center;
9063
+ margin-bottom: 8px;
9064
+
9065
+ ${utils.MediaQueries.mbUp} {
9066
+ margin-bottom: 0;
9067
+ text-align: left;
9068
+ }
9069
+ `;
9070
+ const SubotInlineImage = styled__default["default"].div `
9071
+ background-color: #ffffff;
9072
+ border-radius: 50%;
9073
+ width: 120px;
9074
+ height: 120px;
9075
+ object-fit: contain;
9076
+ overflow: hidden;
9077
+ flex-shrink: 0;
9078
+
9079
+ img {
9080
+ width: 100%;
9081
+ height: 100%;
9082
+ object-fit: cover;
9083
+ }
9084
+ `;
9085
+ const SubotInlineContent = styled__default["default"].div `
9086
+ flex-grow: 1;
9087
+ ${utils.MediaQueries.tdDown} {
9088
+ width: 100%;
9089
+ margin-left: 0;
9090
+ }
9091
+ `;
9092
+ const SubotInlineStartWrapper = styled__default["default"].div `
9093
+ position: relative;
9094
+ display: flex;
9095
+ gap: 24px;
9096
+ ${utils.MediaQueries.mbDown} {
9097
+ flex-wrap: wrap;
9098
+ justify-content: center;
9099
+ }
9100
+ `;
9101
+ const SubotInlineStartContainer = styled__default["default"].div `
9102
+ position: relative;
9103
+ overflow: hidden;
9104
+ background-color: ${miscTheme.theme.colors.primary50};
9105
+ padding: 32px;
9106
+ border-radius: ${miscTheme.theme.borderRadius};
9107
+ background-image: url('/images/subot-bg-transparent.png');
9108
+ background-size: contain;
9109
+ background-repeat: repeat-y;
9110
+ ${utils.MediaQueries.mbDown} {
9111
+ padding: 24px;
9112
+ }
9113
+ `;
9114
+ const SubotInlineNodeStart = ({ node, setLoading, }) => {
9115
+ const startRef = React.useRef({
9116
+ impress: false,
9117
+ });
9118
+ const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
9119
+ const { params, onNext, trackingCommonInline, isMobile } = React.useContext(SubotInlineContext);
9120
+ const handleOnClick = (isCountClick = true) => () => {
9121
+ if (isCountClick) {
9122
+ const queryParams = {
9123
+ cookie_id: params.cookie_id,
9124
+ window_id: params.window_id,
9125
+ bot_id: params.bot_id,
9126
+ title_url: params.title_url,
9127
+ url: params.url,
9128
+ gtm_id: params.gtm_id,
9129
+ ga_client_id: params.ga_client_id,
9130
+ device_id: index$1.checkMobile(window.navigator.userAgent) ? 2 : 1,
9131
+ account_id: params.account_id || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) || null,
9132
+ };
9133
+ subotInlineClick(queryParams);
9134
+ }
9135
+ onNext && onNext();
9136
+ };
9137
+ React.useEffect(() => {
9138
+ const inViewport = (element, callback, options = {}) => {
9139
+ if (!!window.IntersectionObserver && !startRef.current.impress) {
9140
+ const observer = new IntersectionObserver((entries, observer) => {
9141
+ entries.forEach((entry) => callback(entry, observer));
9142
+ }, options);
9143
+ observer.observe(element);
9144
+ }
9145
+ };
9146
+ const eventScrollImpress = () => {
9147
+ if (startRef.current.element) {
9148
+ inViewport(startRef.current.element, (element, observer) => {
9149
+ /** Not in viewport */
9150
+ if (!element.isIntersecting) {
9151
+ if (startRef.current.impress) {
9152
+ startRef.current.impress = false;
9153
+ }
9154
+ return;
9155
+ }
9156
+ if (!startRef.current.impress) {
9157
+ startRef.current.impress = true;
9158
+ if (startRef.current.debounce) {
9159
+ clearTimeout(startRef.current.debounce);
9160
+ }
9161
+ if (!(node === null || node === void 0 ? void 0 : node.inline_start_button)) {
9162
+ setLoading(true);
9163
+ }
9164
+ startRef.current.debounce = setTimeout(() => {
9165
+ const queryParams = {
9166
+ cookie_id: params.cookie_id,
9167
+ window_id: params.window_id,
9168
+ bot_id: params.bot_id,
9169
+ title_url: params.title_url,
9170
+ url: params.url,
9171
+ gtm_id: params.gtm_id,
9172
+ ga_client_id: params.ga_client_id,
9173
+ device_id: index$1.checkMobile(window.navigator.userAgent) ? 2 : 1,
9174
+ account_id: params.account_id || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) || null,
9175
+ };
9176
+ queryParams && subotInlineImpression(queryParams);
9177
+ /** Auto skip the starting node in the case
9178
+ * CTA Start value is not contributed on Subot Admin */
9179
+ if (!(node === null || node === void 0 ? void 0 : node.inline_start_button)) {
9180
+ handleOnClick(false)();
9181
+ }
9182
+ }, 400);
9183
+ startRef.current.element &&
9184
+ (observer === null || observer === void 0 ? void 0 : observer.unobserve(startRef.current.element));
9185
+ }
9186
+ }, {
9187
+ rootMargin: '1000px',
9188
+ });
9189
+ }
9190
+ };
9191
+ eventScrollImpress();
9192
+ window.addEventListener('scroll', eventScrollImpress, { passive: true });
9193
+ return () => window.removeEventListener('scroll', eventScrollImpress);
9194
+ }, [onNext]);
9195
+ if (!node)
9196
+ return null;
9197
+ return (React__default["default"].createElement(SubotInlineStartContainer, null,
9198
+ React__default["default"].createElement(SubotInlineStartWrapper, { ref: (ref) => (startRef.current.element = ref) },
9199
+ node.inline_image && (React__default["default"].createElement(SubotInlineImage, null,
9200
+ React__default["default"].createElement("img", { loading: "lazy", src: node.inline_image, alt: "" }))),
9201
+ React__default["default"].createElement(SubotInlineContent, null,
9202
+ node.inline_title || node.inline_headline ? (React__default["default"].createElement(SubotInlineTitle, { tag: "h3", fontWeight: "bold", color: miscTheme.theme.colors.secondaryBase },
9203
+ React__default["default"].createElement(Markdown, null, node.inline_title || node.inline_headline))) : null,
9204
+ node.inline_review && (React__default["default"].createElement(SubotInlineReview, { size: "s4", color: miscTheme.theme.colors.gray600,
9205
+ // fix error html, div is not allowed as child of p
9206
+ as: 'div' },
9207
+ React__default["default"].createElement(Markdown, null, node.inline_review))),
9208
+ node.inline_start_button && (React__default["default"].createElement(SubotInlineButton, Object.assign({ size: "md", isBlock: isMobile, onClick: handleOnClick(true), className: "pointer-event-child-none" }, trackingCommonInline, { "data-event-action": "Start" }), node.inline_start_button)))),
9209
+ React__default["default"].createElement(SubotInlineDescription, null,
9210
+ React__default["default"].createElement(Markdown, null, node.inline_description))));
9211
+ };
9212
+
9213
+ const SubotInlineLoading = styled__default["default"].div `
9214
+ position: absolute;
9215
+ z-index: 2;
9216
+ top: 0;
9217
+ right: 0;
9218
+ bottom: 0;
9219
+ left: 0;
9220
+ display: flex;
9221
+ flex-direction: column;
9222
+ align-items: center;
9223
+ justify-content: center;
9224
+ color: ${miscTheme.theme.colors.gray800};
9225
+ opacity: 0;
9226
+ pointer-events: none;
9227
+ &:before {
9228
+ position: absolute;
9229
+ z-index: -1;
9230
+ top: 0;
9231
+ right: 0;
9232
+ bottom: 0;
9233
+ left: 0;
9234
+ background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
9235
+ content: '';
9236
+ opacity: 1;
9237
+ }
9238
+ ${({ isLoading }) => isLoading && ` opacity: 1; pointer-events: auto; `};
9239
+ `;
9240
+ const SubotInlineLoadingContainer = styled__default["default"].div `
9241
+ position: relative;
9242
+ z-index: 1;
9243
+ line-height: 1.5;
9244
+ transition: 0.25s all linear;
9245
+ margin-block: 16px;
9246
+ content-visibility: auto;
9247
+ contain-intrinsic-size: 500px;
9248
+ &.hhg-subot-style {
9249
+ min-height: 100px;
9250
+ }
9251
+ ${utils.MediaQueries.mbDown} {
9252
+ margin-right: -1rem;
9253
+ margin-left: -1rem;
9254
+ }
9255
+ `;
9256
+ const SubotInline = ({ id, isMobile, articleLink }) => {
9257
+ const currentUrl = useCurrentUrl();
9258
+ const refAccountIdFromLogs = React.useRef(null);
9259
+ const flag = React.useRef(null);
9260
+ const [loading, setLoading] = React.useState(true);
9261
+ const [state, setState] = React.useState({
9262
+ activeId: '',
9263
+ params: {},
9264
+ nodes: [],
9265
+ getParams: () => ({}),
9266
+ });
9267
+ const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
9268
+ const currentNode = React.useMemo(() => {
9269
+ return state.nodes.find((n) => n.id == state.activeId);
9270
+ }, [state.nodes, state.activeId]);
9271
+ const trackingCommonInline = React.useMemo(() => ({
9272
+ 'data-event-category': 'Subot',
9273
+ 'data-event-label': currentUrl,
9274
+ 'data-bot-id': state.params.bot_id,
9275
+ 'data-bot-type': 'Inline',
9276
+ 'data-question-id': typeof (currentNode === null || currentNode === void 0 ? void 0 : currentNode.id) === 'string' ? currentNode === null || currentNode === void 0 ? void 0 : currentNode.id : null,
9277
+ }), [currentNode, currentUrl, state.params.bot_id]);
9278
+ /** Get Params */
9279
+ const getParams = React.useCallback(() => {
9280
+ var _a, _b, _c, _d;
9281
+ const gaData = window.gaData;
9282
+ const _url = window.location.origin +
9283
+ index$3.basePath +
9284
+ (togetherComponentGlobalContext.GlobalData.locale === 'tl-PH'
9285
+ ? articleLink.replace('fil/', '')
9286
+ : articleLink);
9287
+ const params = {
9288
+ bot_id: id,
9289
+ account_id: ((_a = index$1.getUserInfoFromCookie()) === null || _a === void 0 ? void 0 : _a.id) || null,
9290
+ action_id: '',
9291
+ action_value: '',
9292
+ cookie_id: index$1.getSubotCookieId((_c = (_b = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.router) === null || _b === void 0 ? void 0 : _b.query) === null || _c === void 0 ? void 0 : _c.cookie_id),
9293
+ current_score: 0,
9294
+ current_keys: [],
9295
+ current_selected: [],
9296
+ form_submit_meta: [],
9297
+ gtm_id: gaData ? Object.keys(gaData)[0] : '',
9298
+ ga_client_id: Cookies__default["default"].get('_ga') || '',
9299
+ is_new: false,
9300
+ mode: 'inline',
9301
+ node_id: '',
9302
+ selected_actions: {},
9303
+ title_url: document.title || '',
9304
+ // url: _url,
9305
+ // Keep this commnent line to test on local
9306
+ url: _url
9307
+ .replace('http://localhost', 'https://discover.hellobacsi.com')
9308
+ .replace('dev.', 'discover.'),
9309
+ window_id: index$1.getWindowId(),
9310
+ };
9311
+ return index$1.overrideParamsByQuery(params, (_d = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.router) === null || _d === void 0 ? void 0 : _d.query);
9312
+ }, []);
9313
+ const elementScrollIntoView = () => {
9314
+ flag.current &&
9315
+ flag.current.scrollIntoView({
9316
+ behavior: 'smooth',
9317
+ block: 'start',
9318
+ inline: 'start',
9319
+ });
9320
+ };
9321
+ const onChange = (message) => {
9322
+ setState((state) => {
9323
+ var _a;
9324
+ if (message && (message === null || message === void 0 ? void 0 : message.node_id) && (message === null || message === void 0 ? void 0 : message.node_id) == (state === null || state === void 0 ? void 0 : state.activeId)) {
9325
+ const nodeActiveIndex = state.nodes.findIndex(({ id }) => id == (state === null || state === void 0 ? void 0 : state.activeId));
9326
+ if (nodeActiveIndex !== -1) {
9327
+ const tmpNode = Object.assign(Object.assign({}, state.nodes[nodeActiveIndex]), { _message: Object.assign(Object.assign({}, (_a = state.nodes[nodeActiveIndex]) === null || _a === void 0 ? void 0 : _a._message), message) });
9328
+ state.nodes[nodeActiveIndex] = tmpNode;
9329
+ }
9330
+ }
9331
+ return Object.assign({}, state);
9332
+ });
9333
+ };
9334
+ const onSubmit = (nextNode, message) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
9335
+ /**
9336
+ * Skip the OTP Node if user's phone number is verified.
9337
+ */
9338
+ // if (nextNode) {
9339
+ // const isNextNodeOTP = nextNode.type === NodeType.OTP
9340
+ // if (isNextNodeOTP && verifiedPhone) {
9341
+ // const actionOTPSubmit = nextNode.actions?.find(
9342
+ // (action) => action.type === NodeActionType.USER_SUBMIT_SEND,
9343
+ // )
9344
+ // const blockOTPMessage: SubotMessage = {
9345
+ // ...state.params,
9346
+ // node_id: nextNode.id,
9347
+ // action_id: actionOTPSubmit?.id,
9348
+ // action_value: actionOTPSubmit?.key,
9349
+ // }
9350
+ // const res = await subotInlineMessage(blockOTPMessage)
9351
+ // if (res?._status === 1) {
9352
+ // const { node: _node, ...restData } = res?._data
9353
+ // const nextNodeAfterOTP = {
9354
+ // ..._node,
9355
+ // _message: { ...restData, node_id: _node.id },
9356
+ // }
9357
+ // onSubmit && onSubmit(nextNodeAfterOTP, message)
9358
+ // return
9359
+ // }
9360
+ // pushNotifications({
9361
+ // title: '',
9362
+ // message: f({ id: 'notification.comment.somethingWrong' }),
9363
+ // type: 'danger',
9364
+ // })
9365
+ // return
9366
+ // }
9367
+ // }
9368
+ const _state = Object.assign(Object.assign({}, state), { nodes: [...state.nodes] });
9369
+ if (message && (message === null || message === void 0 ? void 0 : message.node_id)) {
9370
+ const updateNodeIndex = _state.nodes.findIndex(({ id }) => id == message.node_id);
9371
+ if (updateNodeIndex !== -1) {
9372
+ _state.nodes[updateNodeIndex]._message = Object.assign(Object.assign({}, _state.nodes[updateNodeIndex]._message), message);
9373
+ _state.nodes = [..._state.nodes.slice(0, updateNodeIndex + 1)];
9374
+ }
9375
+ }
9376
+ setLoading(true);
9377
+ if (nextNode) {
9378
+ const nextNodeFindIndex = _state.nodes.findIndex(({ id }) => id == (nextNode === null || nextNode === void 0 ? void 0 : nextNode.id));
9379
+ if (nextNodeFindIndex === -1) {
9380
+ _state.nodes = [..._state.nodes, Object.assign({}, nextNode)];
9381
+ }
9382
+ else {
9383
+ const tmpNode = Object.assign(Object.assign(Object.assign({}, _state.nodes[nextNodeFindIndex]), nextNode), { _message: Object.assign(Object.assign({}, _state.nodes[nextNodeFindIndex]._message), nextNode === null || nextNode === void 0 ? void 0 : nextNode._message) });
9384
+ _state.nodes = [
9385
+ ..._state.nodes.slice(0, nextNodeFindIndex),
9386
+ Object.assign({}, tmpNode),
9387
+ ..._state.nodes.slice(nextNodeFindIndex + 1),
9388
+ ];
9389
+ }
9390
+ _state.activeId = nextNode.id;
9391
+ }
9392
+ setTimeout(() => {
9393
+ setState(_state);
9394
+ setLoading(false);
9395
+ _state.activeId &&
9396
+ saveSubotInlineLogs({
9397
+ nodes: _state.nodes,
9398
+ activeId: _state.activeId,
9399
+ params: _state.params,
9400
+ accountIdFromLogs: refAccountIdFromLogs.current,
9401
+ });
9402
+ }, 250);
9403
+ elementScrollIntoView();
9404
+ });
9405
+ const onPrev = () => {
9406
+ var _a;
9407
+ const _state = Object.assign({}, state);
9408
+ const nodeActiveIndex = (_a = _state === null || _state === void 0 ? void 0 : _state.nodes) === null || _a === void 0 ? void 0 : _a.findIndex(({ id }) => id == (_state === null || _state === void 0 ? void 0 : _state.activeId));
9409
+ if (nodeActiveIndex && nodeActiveIndex !== -1 && nodeActiveIndex > 1) {
9410
+ const prevNode = _state.nodes[nodeActiveIndex - 1];
9411
+ if (prevNode)
9412
+ _state.activeId = prevNode.id;
9413
+ }
9414
+ elementScrollIntoView();
9415
+ setState(Object.assign({}, _state));
9416
+ _state.activeId &&
9417
+ saveSubotInlineLogs({
9418
+ nodes: _state.nodes,
9419
+ activeId: _state.activeId,
9420
+ params: _state.params,
9421
+ accountIdFromLogs: refAccountIdFromLogs.current,
9422
+ });
9423
+ };
9424
+ const onNext = (message) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
9425
+ if (message && (message === null || message === void 0 ? void 0 : message.node_id)) {
9426
+ const newMessage = Object.assign(Object.assign({}, message), getCurrentTotalDynamicScore(state.nodes, state.activeId, message.action_id));
9427
+ const res = yield subotInlineMessage(newMessage);
9428
+ setLoading(false);
9429
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
9430
+ const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
9431
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
9432
+ const nextNodeFindIndex = state.nodes.findIndex(({ id }) => id === _nextNode.id);
9433
+ if (nextNodeFindIndex !== -1) {
9434
+ onSubmit(_nextNode);
9435
+ }
9436
+ else {
9437
+ onSubmit(_nextNode, message);
9438
+ }
9439
+ return;
9440
+ }
9441
+ }
9442
+ const nodeActive = state.nodes.find(({ id }) => id == (state === null || state === void 0 ? void 0 : state.activeId));
9443
+ if (nodeActive && !nodeActive.hasOwnProperty('type')) {
9444
+ setLoading(true);
9445
+ if (state.nodes[0].id == (state === null || state === void 0 ? void 0 : state.activeId)) {
9446
+ // elementScrollIntoView()
9447
+ setTimeout(() => {
9448
+ setState(Object.assign(Object.assign({}, state), { activeId: state.nodes[1].id.toString() }));
9449
+ setLoading(false);
9450
+ saveSubotInlineLogs({
9451
+ nodes: state.nodes,
9452
+ activeId: state.nodes[1].id.toString(),
9453
+ params: getParams(),
9454
+ accountIdFromLogs: refAccountIdFromLogs.current,
9455
+ });
9456
+ }, 250);
9457
+ }
9458
+ }
9459
+ });
9460
+ const onReset = () => {
9461
+ setLoading(true);
9462
+ setState((state) => {
9463
+ state.nodes = state.nodes.slice(0, 2);
9464
+ state.nodes[1] = Object.assign(Object.assign({}, state.nodes[1]), { _message: undefined });
9465
+ state.activeId = state.nodes[0].id.toString();
9466
+ return Object.assign({}, state);
9467
+ });
9468
+ setTimeout(() => {
9469
+ setLoading(false);
9470
+ }, 250);
9471
+ elementScrollIntoView();
9472
+ };
9473
+ const getFirstAPI = (params) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
9474
+ var _b;
9475
+ if ((params === null || params === void 0 ? void 0 : params.url) && (params === null || params === void 0 ? void 0 : params.bot_id)) {
9476
+ let activeId = '';
9477
+ let nodes = [];
9478
+ setLoading(true);
9479
+ const resFirst = yield subotInlineFirstNode(params.bot_id);
9480
+ if ((resFirst === null || resFirst === void 0 ? void 0 : resFirst._status) === 1) {
9481
+ activeId = resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.id.toString();
9482
+ nodes.push(resFirst === null || resFirst === void 0 ? void 0 : resFirst._data, resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.first_node);
9483
+ }
9484
+ const subotLogs = yield getSubotInlineLogs(nodes[0]);
9485
+ if (subotLogs) {
9486
+ const lastNode = subotLogs.nodes[subotLogs.nodes.length - 1];
9487
+ const isComplete = [
9488
+ index$2.NodeType.FINAL,
9489
+ index$2.NodeType.FINAL_THANK_YOU,
9490
+ index$2.NodeType.FINAL_STANDARD,
9491
+ ].includes(lastNode.type);
9492
+ if (!isComplete) {
9493
+ nodes = subotLogs.nodes;
9494
+ activeId = subotLogs.activeId;
9495
+ refAccountIdFromLogs.current = ((_b = subotLogs.params) === null || _b === void 0 ? void 0 : _b.account_id) || 0;
9496
+ }
9497
+ }
9498
+ /** [Subot Inline] Show result page after redirect from SSO */
9499
+ const previousState = getPreviousStateFromStorage(params.bot_id, {
9500
+ getParams,
9501
+ });
9502
+ if (previousState &&
9503
+ previousState.params.action_id &&
9504
+ previousState.params.action_value) {
9505
+ const resResultInline = yield subotInlineMessage(previousState.params);
9506
+ if ((resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._status) === 1 && (resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node)) {
9507
+ activeId = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node.id;
9508
+ nodes = previousState.listNodes;
9509
+ nodes[nodes.length - 1] = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node;
9510
+ saveSubotInlineLogs({
9511
+ nodes,
9512
+ activeId: activeId,
9513
+ params: previousState.params,
9514
+ accountIdFromLogs: refAccountIdFromLogs.current,
9515
+ });
9516
+ setTimeout(() => {
9517
+ elementScrollIntoView();
9518
+ }, 100);
9519
+ }
9520
+ }
9521
+ const newParams = (previousState === null || previousState === void 0 ? void 0 : previousState.params) || (subotLogs === null || subotLogs === void 0 ? void 0 : subotLogs.params) || params;
9522
+ const _state = Object.assign(Object.assign({}, state), { params: newParams, activeId, nodes: nodes });
9523
+ setLoading(false);
9524
+ setState(_state);
9525
+ }
9526
+ });
9527
+ React.useEffect(() => {
9528
+ var _a;
9529
+ if (!!((_a = state === null || state === void 0 ? void 0 : state.nodes) === null || _a === void 0 ? void 0 : _a.length)) {
9530
+ console.log('Subot Already Loaded');
9531
+ return () => undefined;
9532
+ }
9533
+ if (!Cookies__default["default"].get(index$3.GA_TOKEN_COOKIE)) {
9534
+ index$1.checkUntilFinished({
9535
+ condition: () => Boolean(Cookies__default["default"].get(index$3.GA_TOKEN_COOKIE)),
9536
+ finished: () => {
9537
+ const params = getParams();
9538
+ getFirstAPI(params);
9539
+ },
9540
+ });
9541
+ }
9542
+ else {
9543
+ const params = getParams();
9544
+ getFirstAPI(params);
9545
+ }
9546
+ }, []);
9547
+ if (state.nodes.length && !state.nodes[0].inline_active) {
9548
+ return null;
9549
+ }
9550
+ return (React__default["default"].createElement(SubotInlineContext.Provider, { value: Object.assign(Object.assign({}, state), { isMobile,
9551
+ getParams,
9552
+ onChange,
9553
+ onSubmit,
9554
+ onPrev,
9555
+ onNext,
9556
+ onReset,
9557
+ trackingCommonInline,
9558
+ userInfo }) },
9559
+ React__default["default"].createElement(SubotInlineLoadingContainer, { className: classNames__default["default"]('hhg-subot', `hhg-subot-${id}`, !!state.nodes.length && 'hhg-subot-style') }, !!state.nodes.length && (React__default["default"].createElement(React__default["default"].Fragment, null,
9560
+ React__default["default"].createElement("div", { ref: flag, className: "hhg-flag", style: {
9561
+ position: 'absolute',
9562
+ top: -150,
9563
+ left: 0,
9564
+ pointerEvents: 'none',
9565
+ } }),
9566
+ React__default["default"].createElement(SubotInlineLoading, { isLoading: !!loading },
9567
+ React__default["default"].createElement(index$a.Loading, null),
9568
+ "Verifying..."),
9569
+ state.nodes.map((node, index) => {
9570
+ if (node.id.toString() === (state === null || state === void 0 ? void 0 : state.activeId)) {
9571
+ if (node.hasOwnProperty('type')) {
9572
+ let NodeComponent;
9573
+ switch (node === null || node === void 0 ? void 0 : node.position) {
9574
+ case index$2.NodePosition.SSO:
9575
+ NodeComponent =
9576
+ SubotInlineNodeBase[index$2.NodePosition[node === null || node === void 0 ? void 0 : node.position].valueOf()];
9577
+ break;
9578
+ default:
9579
+ NodeComponent =
9580
+ SubotInlineNodeBase[index$2.NodeType[node === null || node === void 0 ? void 0 : node.type].valueOf()];
9581
+ }
9582
+ if (node.is_multi_select &&
9583
+ node.type !== index$2.NodeType.POLL)
9584
+ NodeComponent = SubotInlineNodeBase['MULTIPLE'];
9585
+ return (NodeComponent && (React__default["default"].createElement(NodeComponent, { key: index.toString(), indexNumber: index, node: node })));
9586
+ }
9587
+ else {
9588
+ return (React__default["default"].createElement(SubotInlineNodeStart, { key: index.toString(), node: node, setLoading: setLoading }));
9589
+ }
9590
+ }
9591
+ return null;
9592
+ }))))));
9593
+ };
9594
+
6439
9595
  // subot.sendOTP.button
6440
9596
  // subot.resendOTP.button
6441
9597
  // subot.verifyOTP.button
@@ -6475,6 +9631,7 @@ var index = /*#__PURE__*/Object.freeze({
6475
9631
  Markdown: Markdown,
6476
9632
  hexRgb: hexRgb,
6477
9633
  SubotInlineVoucherLeftUI: SubotInlineVoucherLeftUI,
9634
+ SubotInline: SubotInline,
6478
9635
  overrideParamsByQuery: index$1.overrideParamsByQuery,
6479
9636
  ssoIntents: index$1.ssoIntents,
6480
9637
  checkUntilFinished: index$1.checkUntilFinished,
@@ -6490,11 +9647,11 @@ var index = /*#__PURE__*/Object.freeze({
6490
9647
  isFakeEmail: index$1.isFakeEmail,
6491
9648
  formatUrlWithEncrypedGa: index$1.formatUrlWithEncrypedGa,
6492
9649
  getSubotApiPath: getSubotApiPath,
6493
- subotInlineMessage: subotInlineMessage,
6494
- computeExtraSettingsForBot: computeExtraSettingsForBot,
6495
- subotInlineFirstNode: subotInlineFirstNode,
6496
- subotInlineClick: subotInlineClick,
6497
- subotInlineImpression: subotInlineImpression,
9650
+ subotInlineMessage: subotInlineMessage$1,
9651
+ computeExtraSettingsForBot: computeExtraSettingsForBot$1,
9652
+ subotInlineFirstNode: subotInlineFirstNode$1,
9653
+ subotInlineClick: subotInlineClick$1,
9654
+ subotInlineImpression: subotInlineImpression$1,
6498
9655
  PATHS: PATHS$1,
6499
9656
  getPreviousStateFromStorage: getPreviousStateFromStorage,
6500
9657
  getSubotInlineLogs: getSubotInlineLogs,
@@ -6505,7 +9662,7 @@ var index = /*#__PURE__*/Object.freeze({
6505
9662
  detectToSkipNodeStart: detectToSkipNodeStart,
6506
9663
  KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD: KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD,
6507
9664
  SubotInlineIntentBaseTarget: SubotInlineIntentBaseTarget,
6508
- SubotInlineIntentBase: SubotInlineIntentBase,
9665
+ SubotInlineIntentBase: SubotInlineIntentBase$1,
6509
9666
  checkSyncDataOnFrisoCampaign: checkSyncDataOnFrisoCampaign,
6510
9667
  handleFrisoRedirecition: handleFrisoRedirecition,
6511
9668
  getDynamicScore: getDynamicScore,
@@ -6530,13 +9687,14 @@ exports.ssoIntents = index$1.ssoIntents;
6530
9687
  exports.KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD = KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD;
6531
9688
  exports.Markdown = Markdown;
6532
9689
  exports.PATHS = PATHS$1;
6533
- exports.SubotInlineIntentBase = SubotInlineIntentBase;
9690
+ exports.SubotInline = SubotInline;
9691
+ exports.SubotInlineIntentBase = SubotInlineIntentBase$1;
6534
9692
  exports.SubotInlineIntentBaseTarget = SubotInlineIntentBaseTarget;
6535
9693
  exports.SubotInlineRevampWithTheme = SubotInlineRevampWithTheme;
6536
9694
  exports.SubotInlineVoucherLeftUI = SubotInlineVoucherLeftUI;
6537
9695
  exports.UserInfoForm = UserInfoForm;
6538
9696
  exports.checkSyncDataOnFrisoCampaign = checkSyncDataOnFrisoCampaign;
6539
- exports.computeExtraSettingsForBot = computeExtraSettingsForBot;
9697
+ exports.computeExtraSettingsForBot = computeExtraSettingsForBot$1;
6540
9698
  exports["default"] = ContainerWithProvider;
6541
9699
  exports.detectToSkipNodeStart = detectToSkipNodeStart;
6542
9700
  exports.extractUnifiedAnswers = extractUnifiedAnswers;
@@ -6551,7 +9709,7 @@ exports.handleFrisoRedirecition = handleFrisoRedirecition;
6551
9709
  exports.hexRgb = hexRgb;
6552
9710
  exports.replaceTextWithVariables = replaceTextWithVariables;
6553
9711
  exports.saveSubotInlineLogs = saveSubotInlineLogs;
6554
- exports.subotInlineClick = subotInlineClick;
6555
- exports.subotInlineFirstNode = subotInlineFirstNode;
6556
- exports.subotInlineImpression = subotInlineImpression;
6557
- exports.subotInlineMessage = subotInlineMessage;
9712
+ exports.subotInlineClick = subotInlineClick$1;
9713
+ exports.subotInlineFirstNode = subotInlineFirstNode$1;
9714
+ exports.subotInlineImpression = subotInlineImpression$1;
9715
+ exports.subotInlineMessage = subotInlineMessage$1;