@botonic/plugin-flow-builder 0.56.0-alpha.0 → 0.57.0-rslib-esm.0

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 (564) hide show
  1. package/lib/esm/action/ai-agent-from-user-input.d.ts +2 -2
  2. package/lib/esm/action/ai-agent-from-user-input.js +9 -6
  3. package/lib/esm/action/ai-agent-from-user-input.js.map +1 -1
  4. package/lib/esm/action/context.d.ts +2 -2
  5. package/lib/esm/action/context.js +9 -6
  6. package/lib/esm/action/context.js.map +1 -1
  7. package/lib/esm/action/fallback.d.ts +2 -2
  8. package/lib/esm/action/fallback.js +16 -11
  9. package/lib/esm/action/fallback.js.map +1 -1
  10. package/lib/esm/action/first-interaction.d.ts +2 -2
  11. package/lib/esm/action/first-interaction.js +39 -27
  12. package/lib/esm/action/first-interaction.js.map +1 -1
  13. package/lib/esm/action/get-contents.d.ts +1 -1
  14. package/lib/esm/action/get-contents.js +37 -20
  15. package/lib/esm/action/get-contents.js.map +1 -1
  16. package/lib/esm/action/index.d.ts +1 -1
  17. package/lib/esm/action/index.js +68 -32
  18. package/lib/esm/action/index.js.map +1 -1
  19. package/lib/esm/action/payload.d.ts +2 -2
  20. package/lib/esm/action/payload.js +27 -23
  21. package/lib/esm/action/payload.js.map +1 -1
  22. package/lib/esm/api.d.ts +2 -2
  23. package/lib/esm/api.js +55 -44
  24. package/lib/esm/api.js.map +1 -1
  25. package/lib/esm/constants.js +16 -18
  26. package/lib/esm/constants.js.map +1 -1
  27. package/lib/esm/content-fields/content-fields-base.d.ts +2 -2
  28. package/lib/esm/content-fields/content-fields-base.js +33 -29
  29. package/lib/esm/content-fields/content-fields-base.js.map +1 -1
  30. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +1 -1
  31. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +35 -33
  32. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -1
  33. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +1 -1
  34. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +15 -15
  35. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -1
  36. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +2 -2
  37. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +50 -35
  38. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -1
  39. package/lib/esm/content-fields/flow-ai-agent-base.d.ts +4 -4
  40. package/lib/esm/content-fields/flow-ai-agent-base.js +50 -47
  41. package/lib/esm/content-fields/flow-ai-agent-base.js.map +1 -1
  42. package/lib/esm/content-fields/flow-ai-agent-router.d.ts +5 -5
  43. package/lib/esm/content-fields/flow-ai-agent-router.js +57 -46
  44. package/lib/esm/content-fields/flow-ai-agent-router.js.map +1 -1
  45. package/lib/esm/content-fields/flow-ai-agent.d.ts +4 -4
  46. package/lib/esm/content-fields/flow-ai-agent.js +33 -22
  47. package/lib/esm/content-fields/flow-ai-agent.js.map +1 -1
  48. package/lib/esm/content-fields/flow-bot-action.d.ts +3 -3
  49. package/lib/esm/content-fields/flow-bot-action.js +23 -15
  50. package/lib/esm/content-fields/flow-bot-action.js.map +1 -1
  51. package/lib/esm/content-fields/flow-button.d.ts +5 -5
  52. package/lib/esm/content-fields/flow-button.js +48 -29
  53. package/lib/esm/content-fields/flow-button.js.map +1 -1
  54. package/lib/esm/content-fields/flow-capture-user-input.d.ts +2 -2
  55. package/lib/esm/content-fields/flow-capture-user-input.js +24 -23
  56. package/lib/esm/content-fields/flow-capture-user-input.js.map +1 -1
  57. package/lib/esm/content-fields/flow-carousel.d.ts +4 -4
  58. package/lib/esm/content-fields/flow-carousel.js +99 -58
  59. package/lib/esm/content-fields/flow-carousel.js.map +1 -1
  60. package/lib/esm/content-fields/flow-channel-conditional.d.ts +3 -3
  61. package/lib/esm/content-fields/flow-channel-conditional.js +26 -22
  62. package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -1
  63. package/lib/esm/content-fields/flow-country-conditional.d.ts +3 -3
  64. package/lib/esm/content-fields/flow-country-conditional.js +26 -21
  65. package/lib/esm/content-fields/flow-country-conditional.js.map +1 -1
  66. package/lib/esm/content-fields/flow-custom-conditional.d.ts +3 -3
  67. package/lib/esm/content-fields/flow-custom-conditional.js +31 -33
  68. package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -1
  69. package/lib/esm/content-fields/flow-element.d.ts +4 -4
  70. package/lib/esm/content-fields/flow-element.js +37 -20
  71. package/lib/esm/content-fields/flow-element.js.map +1 -1
  72. package/lib/esm/content-fields/flow-go-to-flow.d.ts +3 -3
  73. package/lib/esm/content-fields/flow-go-to-flow.js +25 -20
  74. package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -1
  75. package/lib/esm/content-fields/flow-handoff.d.ts +3 -3
  76. package/lib/esm/content-fields/flow-handoff.js +30 -19
  77. package/lib/esm/content-fields/flow-handoff.js.map +1 -1
  78. package/lib/esm/content-fields/flow-image.d.ts +2 -2
  79. package/lib/esm/content-fields/flow-image.js +24 -15
  80. package/lib/esm/content-fields/flow-image.js.map +1 -1
  81. package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +3 -3
  82. package/lib/esm/content-fields/flow-queue-status-conditional.js +45 -40
  83. package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -1
  84. package/lib/esm/content-fields/flow-rating.d.ts +3 -3
  85. package/lib/esm/content-fields/flow-rating.js +62 -40
  86. package/lib/esm/content-fields/flow-rating.js.map +1 -1
  87. package/lib/esm/content-fields/flow-text.d.ts +4 -4
  88. package/lib/esm/content-fields/flow-text.js +51 -29
  89. package/lib/esm/content-fields/flow-text.js.map +1 -1
  90. package/lib/esm/content-fields/flow-video.d.ts +2 -2
  91. package/lib/esm/content-fields/flow-video.js +24 -15
  92. package/lib/esm/content-fields/flow-video.js.map +1 -1
  93. package/lib/esm/content-fields/flow-webview.d.ts +2 -2
  94. package/lib/esm/content-fields/flow-webview.js +31 -28
  95. package/lib/esm/content-fields/flow-webview.js.map +1 -1
  96. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +3 -3
  97. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +91 -52
  98. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
  99. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.d.ts +3 -4
  100. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js +32 -26
  101. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js.map +1 -1
  102. package/lib/esm/content-fields/flow-whatsapp-template.d.ts +2 -2
  103. package/lib/esm/content-fields/flow-whatsapp-template.js +119 -102
  104. package/lib/esm/content-fields/flow-whatsapp-template.js.map +1 -1
  105. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.d.ts +3 -3
  106. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js +3 -2
  107. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js.map +1 -1
  108. package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +2 -2
  109. package/lib/esm/content-fields/hubtype-fields/ai-agent.js +3 -2
  110. package/lib/esm/content-fields/hubtype-fields/ai-agent.js.map +1 -1
  111. package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +2 -2
  112. package/lib/esm/content-fields/hubtype-fields/bot-action.js +3 -2
  113. package/lib/esm/content-fields/hubtype-fields/bot-action.js.map +1 -1
  114. package/lib/esm/content-fields/hubtype-fields/button.d.ts +1 -1
  115. package/lib/esm/content-fields/hubtype-fields/button.js +3 -2
  116. package/lib/esm/content-fields/hubtype-fields/button.js.map +1 -1
  117. package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +2 -2
  118. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +6 -6
  119. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +1 -1
  120. package/lib/esm/content-fields/hubtype-fields/carousel.d.ts +3 -3
  121. package/lib/esm/content-fields/hubtype-fields/carousel.js +3 -2
  122. package/lib/esm/content-fields/hubtype-fields/carousel.js.map +1 -1
  123. package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +3 -3
  124. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +3 -2
  125. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +1 -1
  126. package/lib/esm/content-fields/hubtype-fields/common.d.ts +2 -2
  127. package/lib/esm/content-fields/hubtype-fields/common.js +3 -2
  128. package/lib/esm/content-fields/hubtype-fields/common.js.map +1 -1
  129. package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +3 -3
  130. package/lib/esm/content-fields/hubtype-fields/country-conditional.js +3 -2
  131. package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +1 -1
  132. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.d.ts +2 -2
  133. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js +15 -15
  134. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -1
  135. package/lib/esm/content-fields/hubtype-fields/custom-conditional.d.ts +3 -3
  136. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +3 -2
  137. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +1 -1
  138. package/lib/esm/content-fields/hubtype-fields/fallback.d.ts +2 -2
  139. package/lib/esm/content-fields/hubtype-fields/fallback.js +3 -2
  140. package/lib/esm/content-fields/hubtype-fields/fallback.js.map +1 -1
  141. package/lib/esm/content-fields/hubtype-fields/function.d.ts +2 -2
  142. package/lib/esm/content-fields/hubtype-fields/function.js +6 -6
  143. package/lib/esm/content-fields/hubtype-fields/function.js.map +1 -1
  144. package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +2 -2
  145. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +3 -2
  146. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +1 -1
  147. package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +2 -2
  148. package/lib/esm/content-fields/hubtype-fields/handoff.js +3 -2
  149. package/lib/esm/content-fields/hubtype-fields/handoff.js.map +1 -1
  150. package/lib/esm/content-fields/hubtype-fields/image.d.ts +2 -2
  151. package/lib/esm/content-fields/hubtype-fields/image.js +3 -2
  152. package/lib/esm/content-fields/hubtype-fields/image.js.map +1 -1
  153. package/lib/esm/content-fields/hubtype-fields/index.d.ts +27 -27
  154. package/lib/esm/content-fields/hubtype-fields/index.js +56 -30
  155. package/lib/esm/content-fields/hubtype-fields/index.js.map +1 -1
  156. package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +2 -2
  157. package/lib/esm/content-fields/hubtype-fields/keyword.js +3 -2
  158. package/lib/esm/content-fields/hubtype-fields/keyword.js.map +1 -1
  159. package/lib/esm/content-fields/hubtype-fields/node-types.js +12 -12
  160. package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -1
  161. package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +23 -23
  162. package/lib/esm/content-fields/hubtype-fields/nodes.js +3 -2
  163. package/lib/esm/content-fields/hubtype-fields/nodes.js.map +1 -1
  164. package/lib/esm/content-fields/hubtype-fields/payload.d.ts +1 -1
  165. package/lib/esm/content-fields/hubtype-fields/payload.js +3 -2
  166. package/lib/esm/content-fields/hubtype-fields/payload.js.map +1 -1
  167. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.d.ts +3 -3
  168. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +3 -2
  169. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -1
  170. package/lib/esm/content-fields/hubtype-fields/rating.d.ts +2 -2
  171. package/lib/esm/content-fields/hubtype-fields/rating.js +6 -6
  172. package/lib/esm/content-fields/hubtype-fields/rating.js.map +1 -1
  173. package/lib/esm/content-fields/hubtype-fields/smart-intent.d.ts +2 -2
  174. package/lib/esm/content-fields/hubtype-fields/smart-intent.js +3 -2
  175. package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +1 -1
  176. package/lib/esm/content-fields/hubtype-fields/text.d.ts +3 -3
  177. package/lib/esm/content-fields/hubtype-fields/text.js +3 -2
  178. package/lib/esm/content-fields/hubtype-fields/text.js.map +1 -1
  179. package/lib/esm/content-fields/hubtype-fields/url.d.ts +1 -1
  180. package/lib/esm/content-fields/hubtype-fields/url.js +3 -2
  181. package/lib/esm/content-fields/hubtype-fields/url.js.map +1 -1
  182. package/lib/esm/content-fields/hubtype-fields/video.d.ts +2 -2
  183. package/lib/esm/content-fields/hubtype-fields/video.js +3 -2
  184. package/lib/esm/content-fields/hubtype-fields/video.js.map +1 -1
  185. package/lib/esm/content-fields/hubtype-fields/webview.d.ts +2 -2
  186. package/lib/esm/content-fields/hubtype-fields/webview.js +3 -2
  187. package/lib/esm/content-fields/hubtype-fields/webview.js.map +1 -1
  188. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.d.ts +2 -2
  189. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +3 -2
  190. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -1
  191. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +3 -3
  192. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -2
  193. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -1
  194. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +2 -2
  195. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -2
  196. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -1
  197. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +3 -3
  198. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +6 -6
  199. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +1 -1
  200. package/lib/esm/content-fields/index.d.ts +23 -23
  201. package/lib/esm/content-fields/index.js +72 -51
  202. package/lib/esm/content-fields/index.js.map +1 -1
  203. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +3 -3
  204. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +16 -14
  205. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
  206. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +4 -4
  207. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +20 -15
  208. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
  209. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +4 -4
  210. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -26
  211. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
  212. package/lib/esm/content-fields/whatsapp-button-list/index.d.ts +3 -3
  213. package/lib/esm/content-fields/whatsapp-button-list/index.js +11 -9
  214. package/lib/esm/content-fields/whatsapp-button-list/index.js.map +1 -1
  215. package/lib/esm/filters/index.d.ts +2 -2
  216. package/lib/esm/filters/index.js +8 -9
  217. package/lib/esm/filters/index.js.map +1 -1
  218. package/lib/esm/flow-factory.d.ts +3 -3
  219. package/lib/esm/flow-factory.js +57 -51
  220. package/lib/esm/flow-factory.js.map +1 -1
  221. package/lib/esm/functions/index.d.ts +1 -1
  222. package/lib/esm/functions/index.js +25 -19
  223. package/lib/esm/functions/index.js.map +1 -1
  224. package/lib/esm/index.d.ts +12 -12
  225. package/lib/esm/index.js +94 -77
  226. package/lib/esm/index.js.map +1 -1
  227. package/lib/esm/package.json +3 -0
  228. package/lib/esm/services/hubtype-queues-api.js +14 -14
  229. package/lib/esm/services/hubtype-queues-api.js.map +1 -1
  230. package/lib/esm/structured-output/flow-builder-content.js +14 -13
  231. package/lib/esm/structured-output/flow-builder-content.js.map +1 -1
  232. package/lib/esm/tracking.d.ts +2 -2
  233. package/lib/esm/tracking.js +27 -21
  234. package/lib/esm/tracking.js.map +1 -1
  235. package/lib/esm/types.d.ts +5 -5
  236. package/lib/esm/types.js +9 -9
  237. package/lib/esm/types.js.map +1 -1
  238. package/lib/esm/user-input/capture-user-input-api.d.ts +2 -2
  239. package/lib/esm/user-input/capture-user-input-api.js +44 -33
  240. package/lib/esm/user-input/capture-user-input-api.js.map +1 -1
  241. package/lib/esm/user-input/index.d.ts +2 -2
  242. package/lib/esm/user-input/index.js +23 -14
  243. package/lib/esm/user-input/index.js.map +1 -1
  244. package/lib/esm/user-input/keyword.d.ts +2 -2
  245. package/lib/esm/user-input/keyword.js +31 -26
  246. package/lib/esm/user-input/keyword.js.map +1 -1
  247. package/lib/esm/user-input/smart-intent.d.ts +2 -2
  248. package/lib/esm/user-input/smart-intent.js +36 -32
  249. package/lib/esm/user-input/smart-intent.js.map +1 -1
  250. package/lib/esm/utils/ai-agent.d.ts +3 -3
  251. package/lib/esm/utils/ai-agent.js +17 -12
  252. package/lib/esm/utils/ai-agent.js.map +1 -1
  253. package/lib/esm/utils/authentication.js +10 -7
  254. package/lib/esm/utils/authentication.js.map +1 -1
  255. package/lib/esm/utils/flow-locale.js +14 -18
  256. package/lib/esm/utils/flow-locale.js.map +1 -1
  257. package/lib/esm/utils/get-flow-builder-plugin.d.ts +1 -1
  258. package/lib/esm/utils/get-flow-builder-plugin.js +4 -4
  259. package/lib/esm/utils/get-flow-builder-plugin.js.map +1 -1
  260. package/lib/esm/utils/hubtype-assistant-content.d.ts +1 -2
  261. package/lib/esm/utils/hubtype-assistant-content.js +57 -54
  262. package/lib/esm/utils/hubtype-assistant-content.js.map +1 -1
  263. package/lib/esm/utils/input.js +16 -14
  264. package/lib/esm/utils/input.js.map +1 -1
  265. package/lib/esm/webview/contents-context.d.ts +1 -1
  266. package/lib/esm/webview/contents-context.js +13 -11
  267. package/lib/esm/webview/contents-context.js.map +1 -1
  268. package/lib/esm/webview/index.d.ts +3 -3
  269. package/lib/esm/webview/index.js +10 -9
  270. package/lib/esm/webview/index.js.map +1 -1
  271. package/lib/esm/webview/types.d.ts +1 -1
  272. package/lib/esm/webview/types.js +6 -6
  273. package/lib/esm/webview/types.js.map +1 -1
  274. package/lib/esm/webview/use-webview-contents.d.ts +1 -1
  275. package/lib/esm/webview/use-webview-contents.js +46 -39
  276. package/lib/esm/webview/use-webview-contents.js.map +1 -1
  277. package/package.json +8 -7
  278. package/src/content-fields/flow-ai-agent-base.tsx +0 -11
  279. package/src/content-fields/flow-whatsapp-request-contact-info.tsx +1 -17
  280. package/src/index.ts +5 -5
  281. package/src/types.ts +6 -6
  282. package/src/utils/hubtype-assistant-content.ts +0 -14
  283. package/lib/cjs/action/ai-agent-from-user-input.d.ts +0 -3
  284. package/lib/cjs/action/ai-agent-from-user-input.js +0 -32
  285. package/lib/cjs/action/ai-agent-from-user-input.js.map +0 -1
  286. package/lib/cjs/action/context.d.ts +0 -11
  287. package/lib/cjs/action/context.js +0 -17
  288. package/lib/cjs/action/context.js.map +0 -1
  289. package/lib/cjs/action/fallback.d.ts +0 -3
  290. package/lib/cjs/action/fallback.js +0 -36
  291. package/lib/cjs/action/fallback.js.map +0 -1
  292. package/lib/cjs/action/first-interaction.d.ts +0 -3
  293. package/lib/cjs/action/first-interaction.js +0 -88
  294. package/lib/cjs/action/first-interaction.js.map +0 -1
  295. package/lib/cjs/action/get-contents.d.ts +0 -3
  296. package/lib/cjs/action/get-contents.js +0 -39
  297. package/lib/cjs/action/get-contents.js.map +0 -1
  298. package/lib/cjs/action/index.d.ts +0 -25
  299. package/lib/cjs/action/index.js +0 -90
  300. package/lib/cjs/action/index.js.map +0 -1
  301. package/lib/cjs/action/payload.d.ts +0 -3
  302. package/lib/cjs/action/payload.js +0 -74
  303. package/lib/cjs/action/payload.js.map +0 -1
  304. package/lib/cjs/api.d.ts +0 -40
  305. package/lib/cjs/api.js +0 -205
  306. package/lib/cjs/api.js.map +0 -1
  307. package/lib/cjs/constants.d.ts +0 -13
  308. package/lib/cjs/constants.js +0 -19
  309. package/lib/cjs/constants.js.map +0 -1
  310. package/lib/cjs/content-fields/content-fields-base.d.ts +0 -20
  311. package/lib/cjs/content-fields/content-fields-base.js +0 -74
  312. package/lib/cjs/content-fields/content-fields-base.js.map +0 -1
  313. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -15
  314. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -71
  315. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
  316. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -9
  317. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js +0 -58
  318. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
  319. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +0 -17
  320. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -79
  321. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
  322. package/lib/cjs/content-fields/flow-ai-agent-base.d.ts +0 -25
  323. package/lib/cjs/content-fields/flow-ai-agent-base.js +0 -97
  324. package/lib/cjs/content-fields/flow-ai-agent-base.js.map +0 -1
  325. package/lib/cjs/content-fields/flow-ai-agent-router.d.ts +0 -21
  326. package/lib/cjs/content-fields/flow-ai-agent-router.js +0 -125
  327. package/lib/cjs/content-fields/flow-ai-agent-router.js.map +0 -1
  328. package/lib/cjs/content-fields/flow-ai-agent.d.ts +0 -17
  329. package/lib/cjs/content-fields/flow-ai-agent.js +0 -64
  330. package/lib/cjs/content-fields/flow-ai-agent.js.map +0 -1
  331. package/lib/cjs/content-fields/flow-bot-action.d.ts +0 -14
  332. package/lib/cjs/content-fields/flow-bot-action.js +0 -45
  333. package/lib/cjs/content-fields/flow-bot-action.js.map +0 -1
  334. package/lib/cjs/content-fields/flow-button.d.ts +0 -31
  335. package/lib/cjs/content-fields/flow-button.js +0 -86
  336. package/lib/cjs/content-fields/flow-button.js.map +0 -1
  337. package/lib/cjs/content-fields/flow-capture-user-input.d.ts +0 -14
  338. package/lib/cjs/content-fields/flow-capture-user-input.js +0 -45
  339. package/lib/cjs/content-fields/flow-capture-user-input.js.map +0 -1
  340. package/lib/cjs/content-fields/flow-carousel.d.ts +0 -22
  341. package/lib/cjs/content-fields/flow-carousel.js +0 -152
  342. package/lib/cjs/content-fields/flow-carousel.js.map +0 -1
  343. package/lib/cjs/content-fields/flow-channel-conditional.d.ts +0 -14
  344. package/lib/cjs/content-fields/flow-channel-conditional.js +0 -57
  345. package/lib/cjs/content-fields/flow-channel-conditional.js.map +0 -1
  346. package/lib/cjs/content-fields/flow-country-conditional.d.ts +0 -13
  347. package/lib/cjs/content-fields/flow-country-conditional.js +0 -59
  348. package/lib/cjs/content-fields/flow-country-conditional.js.map +0 -1
  349. package/lib/cjs/content-fields/flow-custom-conditional.d.ts +0 -17
  350. package/lib/cjs/content-fields/flow-custom-conditional.js +0 -89
  351. package/lib/cjs/content-fields/flow-custom-conditional.js.map +0 -1
  352. package/lib/cjs/content-fields/flow-element.d.ts +0 -22
  353. package/lib/cjs/content-fields/flow-element.js +0 -50
  354. package/lib/cjs/content-fields/flow-element.js.map +0 -1
  355. package/lib/cjs/content-fields/flow-go-to-flow.d.ts +0 -13
  356. package/lib/cjs/content-fields/flow-go-to-flow.js +0 -51
  357. package/lib/cjs/content-fields/flow-go-to-flow.js.map +0 -1
  358. package/lib/cjs/content-fields/flow-handoff.d.ts +0 -17
  359. package/lib/cjs/content-fields/flow-handoff.js +0 -68
  360. package/lib/cjs/content-fields/flow-handoff.js.map +0 -1
  361. package/lib/cjs/content-fields/flow-image.d.ts +0 -10
  362. package/lib/cjs/content-fields/flow-image.js +0 -33
  363. package/lib/cjs/content-fields/flow-image.js.map +0 -1
  364. package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +0 -30
  365. package/lib/cjs/content-fields/flow-queue-status-conditional.js +0 -95
  366. package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +0 -1
  367. package/lib/cjs/content-fields/flow-rating.d.ts +0 -15
  368. package/lib/cjs/content-fields/flow-rating.js +0 -66
  369. package/lib/cjs/content-fields/flow-rating.js.map +0 -1
  370. package/lib/cjs/content-fields/flow-text.d.ts +0 -15
  371. package/lib/cjs/content-fields/flow-text.js +0 -60
  372. package/lib/cjs/content-fields/flow-text.js.map +0 -1
  373. package/lib/cjs/content-fields/flow-video.d.ts +0 -10
  374. package/lib/cjs/content-fields/flow-video.js +0 -33
  375. package/lib/cjs/content-fields/flow-video.js.map +0 -1
  376. package/lib/cjs/content-fields/flow-webview.d.ts +0 -16
  377. package/lib/cjs/content-fields/flow-webview.js +0 -78
  378. package/lib/cjs/content-fields/flow-webview.js.map +0 -1
  379. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -21
  380. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +0 -92
  381. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
  382. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.d.ts +0 -11
  383. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js +0 -45
  384. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
  385. package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +0 -37
  386. package/lib/cjs/content-fields/flow-whatsapp-template.js +0 -264
  387. package/lib/cjs/content-fields/flow-whatsapp-template.js.map +0 -1
  388. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.d.ts +0 -21
  389. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js +0 -3
  390. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
  391. package/lib/cjs/content-fields/hubtype-fields/ai-agent.d.ts +0 -25
  392. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js +0 -3
  393. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js.map +0 -1
  394. package/lib/cjs/content-fields/hubtype-fields/bot-action.d.ts +0 -10
  395. package/lib/cjs/content-fields/hubtype-fields/bot-action.js +0 -3
  396. package/lib/cjs/content-fields/hubtype-fields/bot-action.js.map +0 -1
  397. package/lib/cjs/content-fields/hubtype-fields/button.d.ts +0 -8
  398. package/lib/cjs/content-fields/hubtype-fields/button.js +0 -3
  399. package/lib/cjs/content-fields/hubtype-fields/button.js.map +0 -1
  400. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.d.ts +0 -19
  401. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +0 -12
  402. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
  403. package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +0 -17
  404. package/lib/cjs/content-fields/hubtype-fields/carousel.js +0 -3
  405. package/lib/cjs/content-fields/hubtype-fields/carousel.js.map +0 -1
  406. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.d.ts +0 -10
  407. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js +0 -3
  408. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
  409. package/lib/cjs/content-fields/hubtype-fields/common.d.ts +0 -83
  410. package/lib/cjs/content-fields/hubtype-fields/common.js +0 -3
  411. package/lib/cjs/content-fields/hubtype-fields/common.js.map +0 -1
  412. package/lib/cjs/content-fields/hubtype-fields/country-conditional.d.ts +0 -10
  413. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +0 -3
  414. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +0 -1
  415. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +0 -56
  416. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +0 -36
  417. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
  418. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +0 -11
  419. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +0 -3
  420. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
  421. package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +0 -9
  422. package/lib/cjs/content-fields/hubtype-fields/fallback.js +0 -3
  423. package/lib/cjs/content-fields/hubtype-fields/fallback.js.map +0 -1
  424. package/lib/cjs/content-fields/hubtype-fields/function.d.ts +0 -30
  425. package/lib/cjs/content-fields/hubtype-fields/function.js +0 -11
  426. package/lib/cjs/content-fields/hubtype-fields/function.js.map +0 -1
  427. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.d.ts +0 -9
  428. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js +0 -3
  429. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
  430. package/lib/cjs/content-fields/hubtype-fields/handoff.d.ts +0 -11
  431. package/lib/cjs/content-fields/hubtype-fields/handoff.js +0 -3
  432. package/lib/cjs/content-fields/hubtype-fields/handoff.js.map +0 -1
  433. package/lib/cjs/content-fields/hubtype-fields/image.d.ts +0 -8
  434. package/lib/cjs/content-fields/hubtype-fields/image.js +0 -3
  435. package/lib/cjs/content-fields/hubtype-fields/image.js.map +0 -1
  436. package/lib/cjs/content-fields/hubtype-fields/index.d.ts +0 -27
  437. package/lib/cjs/content-fields/hubtype-fields/index.js +0 -31
  438. package/lib/cjs/content-fields/hubtype-fields/index.js.map +0 -1
  439. package/lib/cjs/content-fields/hubtype-fields/keyword.d.ts +0 -9
  440. package/lib/cjs/content-fields/hubtype-fields/keyword.js +0 -3
  441. package/lib/cjs/content-fields/hubtype-fields/keyword.js.map +0 -1
  442. package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +0 -31
  443. package/lib/cjs/content-fields/hubtype-fields/node-types.js +0 -38
  444. package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +0 -1
  445. package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +0 -26
  446. package/lib/cjs/content-fields/hubtype-fields/nodes.js +0 -3
  447. package/lib/cjs/content-fields/hubtype-fields/nodes.js.map +0 -1
  448. package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +0 -8
  449. package/lib/cjs/content-fields/hubtype-fields/payload.js +0 -3
  450. package/lib/cjs/content-fields/hubtype-fields/payload.js.map +0 -1
  451. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +0 -25
  452. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +0 -3
  453. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
  454. package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +0 -23
  455. package/lib/cjs/content-fields/hubtype-fields/rating.js +0 -9
  456. package/lib/cjs/content-fields/hubtype-fields/rating.js.map +0 -1
  457. package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +0 -12
  458. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js +0 -3
  459. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js.map +0 -1
  460. package/lib/cjs/content-fields/hubtype-fields/text.d.ts +0 -11
  461. package/lib/cjs/content-fields/hubtype-fields/text.js +0 -3
  462. package/lib/cjs/content-fields/hubtype-fields/text.js.map +0 -1
  463. package/lib/cjs/content-fields/hubtype-fields/url.d.ts +0 -8
  464. package/lib/cjs/content-fields/hubtype-fields/url.js +0 -3
  465. package/lib/cjs/content-fields/hubtype-fields/url.js.map +0 -1
  466. package/lib/cjs/content-fields/hubtype-fields/video.d.ts +0 -8
  467. package/lib/cjs/content-fields/hubtype-fields/video.js +0 -3
  468. package/lib/cjs/content-fields/hubtype-fields/video.js.map +0 -1
  469. package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +0 -17
  470. package/lib/cjs/content-fields/hubtype-fields/webview.js +0 -3
  471. package/lib/cjs/content-fields/hubtype-fields/webview.js.map +0 -1
  472. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +0 -21
  473. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js +0 -3
  474. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
  475. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -17
  476. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -3
  477. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
  478. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +0 -8
  479. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -3
  480. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
  481. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.d.ts +0 -96
  482. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +0 -9
  483. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
  484. package/lib/cjs/content-fields/index.d.ts +0 -25
  485. package/lib/cjs/content-fields/index.js +0 -52
  486. package/lib/cjs/content-fields/index.js.map +0 -1
  487. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -14
  488. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -41
  489. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
  490. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -13
  491. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -36
  492. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
  493. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -14
  494. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -46
  495. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
  496. package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +0 -3
  497. package/lib/cjs/content-fields/whatsapp-button-list/index.js +0 -10
  498. package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +0 -1
  499. package/lib/cjs/filters/index.d.ts +0 -12
  500. package/lib/cjs/filters/index.js +0 -17
  501. package/lib/cjs/filters/index.js.map +0 -1
  502. package/lib/cjs/flow-factory.d.ts +0 -12
  503. package/lib/cjs/flow-factory.js +0 -69
  504. package/lib/cjs/flow-factory.js.map +0 -1
  505. package/lib/cjs/functions/index.d.ts +0 -11
  506. package/lib/cjs/functions/index.js +0 -49
  507. package/lib/cjs/functions/index.js.map +0 -1
  508. package/lib/cjs/index.d.ts +0 -45
  509. package/lib/cjs/index.js +0 -178
  510. package/lib/cjs/index.js.map +0 -1
  511. package/lib/cjs/services/hubtype-queues-api.d.ts +0 -14
  512. package/lib/cjs/services/hubtype-queues-api.js +0 -26
  513. package/lib/cjs/services/hubtype-queues-api.js.map +0 -1
  514. package/lib/cjs/structured-output/flow-builder-content.d.ts +0 -13
  515. package/lib/cjs/structured-output/flow-builder-content.js +0 -15
  516. package/lib/cjs/structured-output/flow-builder-content.js.map +0 -1
  517. package/lib/cjs/tracking.d.ts +0 -16
  518. package/lib/cjs/tracking.js +0 -71
  519. package/lib/cjs/tracking.js.map +0 -1
  520. package/lib/cjs/types.d.ts +0 -62
  521. package/lib/cjs/types.js +0 -14
  522. package/lib/cjs/types.js.map +0 -1
  523. package/lib/cjs/user-input/capture-user-input-api.d.ts +0 -21
  524. package/lib/cjs/user-input/capture-user-input-api.js +0 -88
  525. package/lib/cjs/user-input/capture-user-input-api.js.map +0 -1
  526. package/lib/cjs/user-input/index.d.ts +0 -4
  527. package/lib/cjs/user-input/index.js +0 -37
  528. package/lib/cjs/user-input/index.js.map +0 -1
  529. package/lib/cjs/user-input/keyword.d.ts +0 -27
  530. package/lib/cjs/user-input/keyword.js +0 -84
  531. package/lib/cjs/user-input/keyword.js.map +0 -1
  532. package/lib/cjs/user-input/smart-intent.d.ts +0 -24
  533. package/lib/cjs/user-input/smart-intent.js +0 -89
  534. package/lib/cjs/user-input/smart-intent.js.map +0 -1
  535. package/lib/cjs/utils/ai-agent.d.ts +0 -11
  536. package/lib/cjs/utils/ai-agent.js +0 -28
  537. package/lib/cjs/utils/ai-agent.js.map +0 -1
  538. package/lib/cjs/utils/authentication.d.ts +0 -2
  539. package/lib/cjs/utils/authentication.js +0 -21
  540. package/lib/cjs/utils/authentication.js.map +0 -1
  541. package/lib/cjs/utils/flow-locale.d.ts +0 -22
  542. package/lib/cjs/utils/flow-locale.js +0 -79
  543. package/lib/cjs/utils/flow-locale.js.map +0 -1
  544. package/lib/cjs/utils/get-flow-builder-plugin.d.ts +0 -3
  545. package/lib/cjs/utils/get-flow-builder-plugin.js +0 -16
  546. package/lib/cjs/utils/get-flow-builder-plugin.js.map +0 -1
  547. package/lib/cjs/utils/hubtype-assistant-content.d.ts +0 -13
  548. package/lib/cjs/utils/hubtype-assistant-content.js +0 -184
  549. package/lib/cjs/utils/hubtype-assistant-content.js.map +0 -1
  550. package/lib/cjs/utils/input.d.ts +0 -6
  551. package/lib/cjs/utils/input.js +0 -35
  552. package/lib/cjs/utils/input.js.map +0 -1
  553. package/lib/cjs/webview/contents-context.d.ts +0 -2
  554. package/lib/cjs/webview/contents-context.js +0 -12
  555. package/lib/cjs/webview/contents-context.js.map +0 -1
  556. package/lib/cjs/webview/index.d.ts +0 -3
  557. package/lib/cjs/webview/index.js +0 -10
  558. package/lib/cjs/webview/index.js.map +0 -1
  559. package/lib/cjs/webview/types.d.ts +0 -47
  560. package/lib/cjs/webview/types.js +0 -9
  561. package/lib/cjs/webview/types.js.map +0 -1
  562. package/lib/cjs/webview/use-webview-contents.d.ts +0 -2
  563. package/lib/cjs/webview/use-webview-contents.js +0 -83
  564. package/lib/cjs/webview/use-webview-contents.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"hubtype-assistant-content.js","sourceRoot":"","sources":["../../../src/utils/hubtype-assistant-content.ts"],"names":[],"mappings":";;;AAAA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M,CAAC,+BAA+B,CAC5C,kBAAsD;QAEtD,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;QAClD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,iCAAiC,CAAA;QAC1C,CAAC;QACD,OAAO,kBAAkB,CAAC,IAAI,CAAA;IAChC,CAAC;CACF;AA/MD,0DA+MC"}
1
+ {"version":3,"file":"utils/hubtype-assistant-content.js","sources":["../../../src/utils/hubtype-assistant-content.ts"],"sourcesContent":["import { WhatsappCTAUrlHeaderType } from '@botonic/react'\nimport type { FlowContent } from '../content-fields'\nimport type { FlowButton } from '../content-fields/flow-button'\nimport { FlowCarousel } from '../content-fields/flow-carousel'\nimport { FlowImage } from '../content-fields/flow-image'\nimport { FlowText } from '../content-fields/flow-text'\nimport { FlowVideo } from '../content-fields/flow-video'\nimport { FlowWhatsappCtaUrlButtonNode } from '../content-fields/flow-whatsapp-cta-url-button'\nimport { FlowWhatsappTemplate } from '../content-fields/flow-whatsapp-template'\nimport { HtButtonStyle } from '../content-fields/hubtype-fields'\nimport { FlowWhatsappButtonList } from '../content-fields/whatsapp-button-list/flow-whatsapp-button-list'\n\n// biome-ignore lint/complexity/noStaticOnlyClass: namespace-like adapter with private static helpers\nexport class HubtypeAssistantContent {\n static adapt(content: FlowContent): string {\n if (content instanceof FlowText) {\n return HubtypeAssistantContent.formatFlowTextContent(content)\n }\n if (content instanceof FlowCarousel) {\n return HubtypeAssistantContent.formatCarouselContent(content)\n }\n if (content instanceof FlowImage) {\n return content.src ? `[Image]\\n${content.src}` : '[Image]'\n }\n if (content instanceof FlowVideo) {\n return content.src ? `[Video]\\n${content.src}` : '[Video]'\n }\n if (content instanceof FlowWhatsappButtonList) {\n return HubtypeAssistantContent.formatWhatsappButtonListContent(content)\n }\n if (content instanceof FlowWhatsappCtaUrlButtonNode) {\n return HubtypeAssistantContent.formatWhatsappCtaContent(content)\n }\n if (content instanceof FlowWhatsappTemplate) {\n return HubtypeAssistantContent.formatWhatsappTemplateContent(content)\n }\n return ''\n }\n\n private static quickReplyLabel(button: FlowButton): string {\n const buttonText = button.text?.trim()\n if (buttonText) {\n return buttonText\n }\n\n return button.payload || 'Option'\n }\n\n private static persistentButtonLabel(button: FlowButton): string {\n return button.text?.trim() || 'Button'\n }\n\n private static carouselButtonLabel(button: FlowButton): string {\n return button.text?.trim() || 'Action'\n }\n\n private static formatFlowTextContent(text: FlowText): string {\n const body = text.text?.trim() ?? ''\n const buttons = text.buttons\n\n if (!body && buttons.length === 0) {\n return ''\n }\n\n if (buttons.length === 0) {\n return text.text\n }\n\n const isQuickReply = text.buttonStyle === HtButtonStyle.QUICK_REPLY\n const blockTitle = isQuickReply ? 'Quick replies:' : 'Buttons:'\n const lines = buttons.map((button, i) => {\n const label = isQuickReply\n ? HubtypeAssistantContent.quickReplyLabel(button)\n : HubtypeAssistantContent.persistentButtonLabel(button)\n return ` [${i + 1}] ${label}`\n })\n\n const block = [blockTitle, ...lines].join('\\n')\n if (!body) {\n return block\n }\n\n return `${body}\\n\\n${block}`\n }\n\n private static formatCarouselContent(carousel: FlowCarousel): string {\n const elements = carousel.elements\n const n = elements.length\n const mainText = (carousel.whatsappText ?? '').trim()\n\n if (n === 0) {\n return mainText\n }\n\n let header: string\n if (!mainText) {\n header = `Carousel displayed with ${n} items:`\n } else if (mainText.endsWith(':')) {\n header = mainText\n } else {\n header = `${mainText}\\nCarousel with ${n} items:`\n }\n\n const itemLines = elements.map((element, index) => {\n const title = element.title?.trim() || 'Item'\n const subtitle = element.subtitle?.trim()\n const subtitlePart = subtitle ? ` - ${subtitle}` : ''\n const btnLabels: string[] = []\n if (element.button) {\n btnLabels.push(\n HubtypeAssistantContent.carouselButtonLabel(element.button)\n )\n }\n const btnPart = btnLabels.length > 0 ? ` [${btnLabels.join(', ')}]` : ''\n\n return ` ${index + 1}. \"${title}\"${subtitlePart}${btnPart}`\n })\n\n return [header, ...itemLines].join('\\n')\n }\n\n private static formatWhatsappButtonListContent(\n list: FlowWhatsappButtonList\n ): string {\n const body = list.text?.trim() ?? ''\n const hasSections = list.sections.some(s => s.rows.length > 0)\n\n if (!body && !hasSections) {\n return '[WhatsApp Button List]'\n }\n\n const parts: string[] = []\n if (body) {\n parts.push(body)\n }\n\n if (hasSections) {\n const sectionBlocks = list.sections.map(section => {\n const rowLines = section.rows.map(row => {\n const rowTitle = row.title?.trim() ?? ''\n const rowDescription = row.description?.trim() ?? ''\n if (!rowTitle && !rowDescription) {\n return ' - '\n }\n if (!rowTitle) {\n return ` - ${rowDescription}`\n }\n if (!rowDescription) {\n return ` - ${rowTitle}`\n }\n return ` - ${rowTitle}: ${rowDescription}`\n })\n const rowsText = rowLines.join('\\n')\n\n const sectionTitle = section.title?.trim()\n if (sectionTitle) {\n return `${sectionTitle}:\\n${rowsText}`\n }\n\n return rowsText\n })\n parts.push(sectionBlocks.join('\\n'))\n }\n\n return parts.join('\\n\\n')\n }\n\n private static formatWhatsappCtaContent(\n cta: FlowWhatsappCtaUrlButtonNode\n ): string {\n const hasStructuredData =\n (cta.headerType === WhatsappCTAUrlHeaderType.Text &&\n !!cta.header?.trim()) ||\n cta.text?.trim() ||\n cta.footer?.trim() ||\n cta.displayText?.trim() ||\n cta.url\n\n if (!hasStructuredData) {\n return cta.text?.trim() || '[WhatsApp CTA Button]'\n }\n\n const lines: string[] = []\n if (\n cta.headerType === WhatsappCTAUrlHeaderType.Text &&\n cta.header?.trim()\n ) {\n lines.push(cta.header.trim())\n }\n if (cta.text?.trim()) {\n lines.push(cta.text.trim())\n }\n if (cta.footer?.trim()) {\n lines.push(cta.footer.trim())\n }\n const ctaLine = `[${cta.displayText || ''}]${cta.url ? ` (${cta.url})` : ''}`\n lines.push(ctaLine)\n\n return lines.join('\\n')\n }\n\n private static formatWhatsappTemplateContent(\n template: FlowWhatsappTemplate\n ): string {\n const { name, language } = template.htWhatsappTemplate\n return `WhatsApp Template: ${name} (${language})`\n }\n}\n"],"names":["WhatsappCTAUrlHeaderType","FlowCarousel","FlowImage","FlowText","FlowVideo","FlowWhatsappCtaUrlButtonNode","FlowWhatsappTemplate","HtButtonStyle","FlowWhatsappButtonList","HubtypeAssistantContent","content","button","buttonText","text","body","buttons","isQuickReply","blockTitle","lines","i","label","block","carousel","elements","n","mainText","header","itemLines","element","index","title","subtitle","subtitlePart","btnLabels","btnPart","list","hasSections","s","parts","sectionBlocks","section","rowLines","row","rowTitle","rowDescription","rowsText","sectionTitle","cta","hasStructuredData","ctaLine","template","name","language"],"mappings":";;;;;;;;;;;;;;;;;;;AAAyD;AAGK;AACN;AACF;AACE;AACqC;AACd;AACf;AACyC;AAEzG,qGAAqG;AAC9F,MAAMS,uBAAuBA;IAClC,OAAO,MAAMC,OAAoB,EAAU;QACzC,IAAIA,mBAAmBP,QAAQA,EAAE;YAC/B,OAAOM,uBAAuBA,CAAC,qBAAqB,CAACC;QACvD;QACA,IAAIA,mBAAmBT,YAAYA,EAAE;YACnC,OAAOQ,uBAAuBA,CAAC,qBAAqB,CAACC;QACvD;QACA,IAAIA,mBAAmBR,SAASA,EAAE;YAChC,OAAOQ,QAAQ,GAAG,GAAG,CAAC,SAAS,EAAEA,QAAQ,GAAG,EAAE,GAAG;QACnD;QACA,IAAIA,mBAAmBN,SAASA,EAAE;YAChC,OAAOM,QAAQ,GAAG,GAAG,CAAC,SAAS,EAAEA,QAAQ,GAAG,EAAE,GAAG;QACnD;QACA,IAAIA,mBAAmBF,sBAAsBA,EAAE;YAC7C,OAAOC,uBAAuBA,CAAC,+BAA+B,CAACC;QACjE;QACA,IAAIA,mBAAmBL,4BAA4BA,EAAE;YACnD,OAAOI,uBAAuBA,CAAC,wBAAwB,CAACC;QAC1D;QACA,IAAIA,mBAAmBJ,oBAAoBA,EAAE;YAC3C,OAAOG,uBAAuBA,CAAC,6BAA6B,CAACC;QAC/D;QACA,OAAO;IACT;IAEA,OAAe,gBAAgBC,MAAkB,EAAU;QACzD,MAAMC,aAAaD,OAAO,IAAI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AAC,CAAC,EAAEF,IAAI,WAAW,IAAI,GAAG,CAAC,EAAEA,IAAI,GAAG,GAAG,CAAC,EAAE,EAAEA,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI;QAC7E7B,MAAM,IAAI,CAAC+B;QAEX,OAAO/B,MAAM,IAAI,CAAC;IACpB;IAEA,OAAe,8BACbgC,QAA8B,EACtB;QACR,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGF,SAAS,kBAAkB;QACtD,OAAO,CAAC,mBAAmB,EAAEC,KAAK,EAAE,EAAEC,SAAS,CAAC,CAAC;IACnD;AACF"}
@@ -1,21 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.inputHasTextOrTranscript = inputHasTextOrTranscript;
4
- exports.getTextOrTranscript = getTextOrTranscript;
5
- exports.isKeywordsAllowed = isKeywordsAllowed;
6
- exports.isSmartIntentsAllowed = isSmartIntentsAllowed;
7
- const core_1 = require("@botonic/core");
8
- const get_flow_builder_plugin_1 = require("./get-flow-builder-plugin");
1
+ import { INPUT } from "@botonic/core";
2
+ import { getFlowBuilderPlugin } from "./get-flow-builder-plugin.js";
3
+
4
+
5
+
6
+
7
+
9
8
  function inputHasTextOrTranscript(input) {
10
- const isTextInput = Boolean(input.data) && input.type === core_1.INPUT.TEXT;
11
- const isTranscriptText = Boolean(input.transcript) && input.type === core_1.INPUT.AUDIO;
9
+ const isTextInput = Boolean(input.data) && input.type === INPUT.TEXT;
10
+ const isTranscriptText = Boolean(input.transcript) && input.type === INPUT.AUDIO;
12
11
  return isTextInput || isTranscriptText;
13
12
  }
14
13
  function getTextOrTranscript(input) {
15
- if (input.type === core_1.INPUT.TEXT && input.data) {
14
+ if (input.type === INPUT.TEXT && input.data) {
16
15
  return input.data;
17
16
  }
18
- if (input.type === core_1.INPUT.AUDIO && input.transcript) {
17
+ if (input.type === INPUT.AUDIO && input.transcript) {
19
18
  return input.transcript;
20
19
  }
21
20
  console.error('No text or transcript found in input', input);
@@ -23,8 +22,8 @@ function getTextOrTranscript(input) {
23
22
  }
24
23
  function isNluAllowed(request, nluFlag) {
25
24
  const shadowing = Boolean(request.session._shadowing);
26
- const flowBuilderPlugin = (0, get_flow_builder_plugin_1.getFlowBuilderPlugin)(request.plugins);
27
- return !shadowing || (shadowing && flowBuilderPlugin.inShadowing[nluFlag]);
25
+ const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
26
+ return !shadowing || shadowing && flowBuilderPlugin.inShadowing[nluFlag];
28
27
  }
29
28
  function isKeywordsAllowed(request) {
30
29
  return isNluAllowed(request, 'allowKeywords');
@@ -32,4 +31,7 @@ function isKeywordsAllowed(request) {
32
31
  function isSmartIntentsAllowed(request) {
33
32
  return isNluAllowed(request, 'allowSmartIntents');
34
33
  }
34
+
35
+ export { getTextOrTranscript, inputHasTextOrTranscript, isKeywordsAllowed, isSmartIntentsAllowed };
36
+
35
37
  //# sourceMappingURL=input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/utils/input.ts"],"names":[],"mappings":";;AAMA,4DAMC;AAED,kDAUC;AAWD,8CAEC;AAED,sDAEC;AAzCD,wCAAiD;AAIjD,uEAAgE;AAEhE,SAAgB,wBAAwB,CAAC,KAAY;IACnD,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,YAAK,CAAC,IAAI,CAAA;IACpE,MAAM,gBAAgB,GACpB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,YAAK,CAAC,KAAK,CAAA;IAEzD,OAAO,WAAW,IAAI,gBAAgB,CAAA;AACxC,CAAC;AAED,SAAgB,mBAAmB,CAAC,KAAY;IAC9C,IAAI,KAAK,CAAC,IAAI,KAAK,YAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QAC5C,OAAO,KAAK,CAAC,IAAI,CAAA;IACnB,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,YAAK,CAAC,KAAK,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;QACnD,OAAO,KAAK,CAAC,UAAU,CAAA;IACzB,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAA;IAC5D,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,YAAY,CACnB,OAAsB,EACtB,OAAgC;IAEhC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;IACrD,MAAM,iBAAiB,GAAG,IAAA,8CAAoB,EAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/D,OAAO,CAAC,SAAS,IAAI,CAAC,SAAS,IAAI,iBAAiB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;AAC5E,CAAC;AAED,SAAgB,iBAAiB,CAAC,OAAsB;IACtD,OAAO,YAAY,CAAC,OAAO,EAAE,eAAe,CAAC,CAAA;AAC/C,CAAC;AAED,SAAgB,qBAAqB,CAAC,OAAsB;IAC1D,OAAO,YAAY,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAA;AACnD,CAAC"}
1
+ {"version":3,"file":"utils/input.js","sources":["../../../src/utils/input.ts"],"sourcesContent":["import { INPUT, type Input } from '@botonic/core'\nimport type { ActionRequest } from '@botonic/react'\n\nimport type { InShadowingConfig } from '../types'\nimport { getFlowBuilderPlugin } from './get-flow-builder-plugin'\n\nexport function inputHasTextOrTranscript(input: Input): boolean {\n const isTextInput = Boolean(input.data) && input.type === INPUT.TEXT\n const isTranscriptText =\n Boolean(input.transcript) && input.type === INPUT.AUDIO\n\n return isTextInput || isTranscriptText\n}\n\nexport function getTextOrTranscript(input: Input): string | undefined {\n if (input.type === INPUT.TEXT && input.data) {\n return input.data\n }\n if (input.type === INPUT.AUDIO && input.transcript) {\n return input.transcript\n }\n\n console.error('No text or transcript found in input', input)\n return undefined\n}\n\nfunction isNluAllowed(\n request: ActionRequest,\n nluFlag: keyof InShadowingConfig\n): boolean {\n const shadowing = Boolean(request.session._shadowing)\n const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)\n return !shadowing || (shadowing && flowBuilderPlugin.inShadowing[nluFlag])\n}\n\nexport function isKeywordsAllowed(request: ActionRequest): boolean {\n return isNluAllowed(request, 'allowKeywords')\n}\n\nexport function isSmartIntentsAllowed(request: ActionRequest): boolean {\n return isNluAllowed(request, 'allowSmartIntents')\n}\n"],"names":["INPUT","getFlowBuilderPlugin","inputHasTextOrTranscript","input","isTextInput","Boolean","isTranscriptText","getTextOrTranscript","console","undefined","isNluAllowed","request","nluFlag","shadowing","flowBuilderPlugin","isKeywordsAllowed","isSmartIntentsAllowed"],"mappings":";;;;;AAAiD;AAIe;AAEzD,SAASE,wBAAwBA,CAACC,KAAY;IACnD,MAAMC,cAAcC,QAAQF,MAAM,IAAI,KAAKA,MAAM,IAAI,KAAKH,UAAU;IACpE,MAAMM,mBACJD,QAAQF,MAAM,UAAU,KAAKA,MAAM,IAAI,KAAKH,WAAW;IAEzD,OAAOI,eAAeE;AACxB;AAEO,SAASC,mBAAmBA,CAACJ,KAAY;IAC9C,IAAIA,MAAM,IAAI,KAAKH,UAAU,IAAIG,MAAM,IAAI,EAAE;QAC3C,OAAOA,MAAM,IAAI;IACnB;IACA,IAAIA,MAAM,IAAI,KAAKH,WAAW,IAAIG,MAAM,UAAU,EAAE;QAClD,OAAOA,MAAM,UAAU;IACzB;IAEAK,QAAQ,KAAK,CAAC,wCAAwCL;IACtD,OAAOM;AACT;AAEA,SAASC,YAAYA,CACnBC,OAAsB,EACtBC,OAAgC;IAEhC,MAAMC,YAAYR,QAAQM,QAAQ,OAAO,CAAC,UAAU;IACpD,MAAMG,oBAAoBb,oBAAoBA,CAACU,QAAQ,OAAO;IAC9D,OAAO,CAACE,aAAcA,aAAaC,kBAAkB,WAAW,CAACF,QAAQ;AAC3E;AAEO,SAASG,iBAAiBA,CAACJ,OAAsB;IACtD,OAAOD,YAAYA,CAACC,SAAS;AAC/B;AAEO,SAASK,qBAAqBA,CAACL,OAAsB;IAC1D,OAAOD,YAAYA,CAACC,SAAS;AAC/B"}
@@ -1,2 +1,2 @@
1
- import type { MapContentsType, WebviewContentsContextType } from './types';
1
+ import type { MapContentsType, WebviewContentsContextType } from './types.js';
2
2
  export declare const createWebviewContentsContext: <T extends MapContentsType>() => import("react").Context<WebviewContentsContextType<T>>;
@@ -1,12 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createWebviewContentsContext = void 0;
4
- const react_1 = require("react");
5
- const createWebviewContentsContext = () => (0, react_1.createContext)({
6
- getTextContent: () => '',
7
- getImageSrc: () => '',
8
- setCurrentLocale: () => undefined,
9
- contents: {},
10
- });
11
- exports.createWebviewContentsContext = createWebviewContentsContext;
1
+ import { createContext } from "react";
2
+
3
+
4
+
5
+ const createWebviewContentsContext = ()=>createContext({
6
+ getTextContent: ()=>'',
7
+ getImageSrc: ()=>'',
8
+ setCurrentLocale: ()=>undefined,
9
+ contents: {}
10
+ });
11
+
12
+ export { createWebviewContentsContext };
13
+
12
14
  //# sourceMappingURL=contents-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contents-context.js","sourceRoot":"","sources":["../../../src/webview/contents-context.ts"],"names":[],"mappings":";;;AAAA,iCAAqC;AAI9B,MAAM,4BAA4B,GAAG,GAA8B,EAAE,CAC1E,IAAA,qBAAa,EAAgC;IAC3C,cAAc,EAAE,GAAG,EAAE,CAAC,EAAE;IACxB,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE;IACrB,gBAAgB,EAAE,GAAG,EAAE,CAAC,SAAS;IACjC,QAAQ,EAAE,EAA6B;CACxC,CAAC,CAAA;AANS,QAAA,4BAA4B,gCAMrC"}
1
+ {"version":3,"file":"webview/contents-context.js","sources":["../../../src/webview/contents-context.ts"],"sourcesContent":["import { createContext } from 'react'\n\nimport type { MapContentsType, WebviewContentsContextType } from './types'\n\nexport const createWebviewContentsContext = <T extends MapContentsType>() =>\n createContext<WebviewContentsContextType<T>>({\n getTextContent: () => '',\n getImageSrc: () => '',\n setCurrentLocale: () => undefined,\n contents: {} as Record<keyof T, string>,\n })\n"],"names":["createContext","createWebviewContentsContext","undefined"],"mappings":";;;AAAqC;AAI9B,MAAMC,4BAA4BA,GAAG,IAC1CD,aAAaA,CAAgC;QAC3C,gBAAgB,IAAM;QACtB,aAAa,IAAM;QACnB,kBAAkB,IAAME;QACxB,UAAU,CAAC;IACb,GAAE"}
@@ -1,3 +1,3 @@
1
- export { createWebviewContentsContext } from './contents-context';
2
- export * from './types';
3
- export { useWebviewContents } from './use-webview-contents';
1
+ export { createWebviewContentsContext } from './contents-context.js';
2
+ export * from './types.js';
3
+ export { useWebviewContents } from './use-webview-contents.js';
@@ -1,10 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useWebviewContents = exports.createWebviewContentsContext = void 0;
4
- const tslib_1 = require("tslib");
5
- var contents_context_1 = require("./contents-context");
6
- Object.defineProperty(exports, "createWebviewContentsContext", { enumerable: true, get: function () { return contents_context_1.createWebviewContentsContext; } });
7
- tslib_1.__exportStar(require("./types"), exports);
8
- var use_webview_contents_1 = require("./use-webview-contents");
9
- Object.defineProperty(exports, "useWebviewContents", { enumerable: true, get: function () { return use_webview_contents_1.useWebviewContents; } });
1
+ export * from "./types.js";
2
+
3
+
4
+
5
+
6
+
7
+
8
+ export { createWebviewContentsContext } from "./contents-context.js";
9
+ export { useWebviewContents } from "./use-webview-contents.js";
10
+
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/webview/index.ts"],"names":[],"mappings":";;;;AAAA,uDAAiE;AAAxD,gIAAA,4BAA4B,OAAA;AACrC,kDAAuB;AACvB,+DAA2D;AAAlD,0HAAA,kBAAkB,OAAA"}
1
+ {"version":3,"file":"webview/index.js","sources":["../../../src/webview/index.ts"],"sourcesContent":["export { createWebviewContentsContext } from './contents-context'\nexport * from './types'\nexport { useWebviewContents } from './use-webview-contents'\n"],"names":["createWebviewContentsContext","useWebviewContents"],"mappings":";;;AAAiE;AAC1C;AACoC"}
@@ -1,4 +1,4 @@
1
- import type { FlowBuilderJSONVersion } from '../types';
1
+ import type { FlowBuilderJSONVersion } from '../types.js';
2
2
  export declare enum WebviewContentType {
3
3
  TEXT = "webview-text",
4
4
  IMAGE = "webview-image"
@@ -1,9 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebviewContentType = void 0;
4
- var WebviewContentType;
5
- (function (WebviewContentType) {
1
+ var types_WebviewContentType = /*#__PURE__*/ function(WebviewContentType) {
6
2
  WebviewContentType["TEXT"] = "webview-text";
7
3
  WebviewContentType["IMAGE"] = "webview-image";
8
- })(WebviewContentType || (exports.WebviewContentType = WebviewContentType = {}));
4
+ return WebviewContentType;
5
+ }({});
6
+
7
+ export { types_WebviewContentType as WebviewContentType };
8
+
9
9
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/webview/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,2CAAqB,CAAA;IACrB,6CAAuB,CAAA;AACzB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B"}
1
+ {"version":3,"file":"webview/types.js","sources":["../../../src/webview/types.ts"],"sourcesContent":["import type { FlowBuilderJSONVersion } from '../types'\n\nexport enum WebviewContentType {\n TEXT = 'webview-text',\n IMAGE = 'webview-image',\n}\n\nexport type WebviewContentsResponse = (\n | WebviewTextContent\n | WebviewImageContent\n)[]\n\nexport interface WebviewTextContent {\n code: string\n type: WebviewContentType.TEXT\n content: {\n text: { message: string; locale: string }[]\n }\n}\n\nexport interface WebviewImageContent {\n code: string\n type: WebviewContentType.IMAGE\n content: {\n image: { file: string; locale: string }[]\n }\n}\n\nexport type MapContentsType = Record<string, string>\n\nexport interface UseWebviewContentsProps<T extends MapContentsType> {\n apiUrl?: string\n version?: FlowBuilderJSONVersion\n botId: string\n webviewId: string\n providerId: string\n locale: string\n mapContents: Record<keyof T, string>\n}\n\nexport interface UseWebviewContents<T extends MapContentsType> {\n isLoading: boolean\n error: boolean\n webviewContentsContext: WebviewContentsContextType<T>\n}\n\nexport interface WebviewContentsContextType<T extends MapContentsType> {\n getTextContent: (code: string) => string\n getImageSrc: (code: string) => string\n setCurrentLocale: (locale: string) => void\n contents: Record<keyof T, string>\n}\n"],"names":["WebviewContentType"],"mappings":"AAEO,IAAKA,wBAAkBA,0BAAlBA;;;WAAAA;MAGX"}
@@ -1,2 +1,2 @@
1
- import { type MapContentsType, type UseWebviewContents, type UseWebviewContentsProps } from './types';
1
+ import { type MapContentsType, type UseWebviewContents, type UseWebviewContentsProps } from './types.js';
2
2
  export declare function useWebviewContents<T extends MapContentsType>({ apiUrl, version, botId, webviewId, providerId, locale, mapContents, }: UseWebviewContentsProps<T>): UseWebviewContents<T>;
@@ -1,24 +1,31 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useWebviewContents = useWebviewContents;
4
- const tslib_1 = require("tslib");
5
- const axios_1 = tslib_1.__importDefault(require("axios"));
6
- const react_1 = require("react");
7
- const constants_1 = require("../constants");
8
- const types_1 = require("../types");
9
- const types_2 = require("./types");
10
- function useWebviewContents({ apiUrl = constants_1.FLOW_BUILDER_API_URL_PROD, version = types_1.FlowBuilderJSONVersion.LATEST, botId, webviewId, providerId, locale, mapContents, }) {
11
- const [textContents, setTextContents] = (0, react_1.useState)();
12
- const [imageContents, setImageContents] = (0, react_1.useState)();
13
- const [contents, setContents] = (0, react_1.useState)({});
14
- const [currentLocale, setCurrentLocale] = (0, react_1.useState)(locale);
15
- const [error, setError] = (0, react_1.useState)(false);
16
- const updateCurrentLocale = (textContents) => {
1
+ import axios from "axios";
2
+ import { useEffect, useState } from "react";
3
+ import { FLOW_BUILDER_API_URL_PROD } from "../constants.js";
4
+ import { FlowBuilderJSONVersion } from "../types.js";
5
+ import { WebviewContentType } from "./types.js";
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ function useWebviewContents({ apiUrl = FLOW_BUILDER_API_URL_PROD, version = FlowBuilderJSONVersion.LATEST, botId, webviewId, providerId, locale, mapContents }) {
18
+ const [textContents, setTextContents] = useState();
19
+ const [imageContents, setImageContents] = useState();
20
+ const [contents, setContents] = useState({});
21
+ const [currentLocale, setCurrentLocale] = useState(locale);
22
+ const [error, setError] = useState(false);
23
+ const updateCurrentLocale = (textContents)=>{
17
24
  if (!textContents || textContents.length === 0) {
18
25
  console.log('There is no text contents to check the locale');
19
26
  return;
20
27
  }
21
- const locales = textContents[0].content.text.map(text => text.locale);
28
+ const locales = textContents[0].content.text.map((text)=>text.locale);
22
29
  const language = currentLocale.split('-')[0];
23
30
  if (locales.includes(currentLocale)) {
24
31
  setCurrentLocale(currentLocale);
@@ -30,39 +37,36 @@ function useWebviewContents({ apiUrl = constants_1.FLOW_BUILDER_API_URL_PROD, ve
30
37
  }
31
38
  console.error(`locale: ${currentLocale} cannot be resolved with: ${locales.join(', ')}`);
32
39
  };
33
- const getTextContent = (contentID) => {
34
- return (textContents
35
- ?.find(textContent => textContent.code === contentID)
36
- ?.content.text.find(text => text.locale === currentLocale)?.message ||
37
- '');
40
+ const getTextContent = (contentID)=>{
41
+ return textContents?.find((textContent)=>textContent.code === contentID)?.content.text.find((text)=>text.locale === currentLocale)?.message || '';
38
42
  };
39
- const getImageSrc = (contentID) => {
40
- return (imageContents
41
- ?.find(imageContent => imageContent.code === contentID)
42
- ?.content.image.find(image => image.locale === currentLocale)?.file ||
43
- '');
43
+ const getImageSrc = (contentID)=>{
44
+ return imageContents?.find((imageContent)=>imageContent.code === contentID)?.content.image.find((image)=>image.locale === currentLocale)?.file || '';
44
45
  };
45
- (0, react_1.useEffect)(() => {
46
+ useEffect(()=>{
46
47
  if (textContents || imageContents) {
47
48
  const contentsObject = {};
48
- for (const [key, value] of Object.entries(mapContents)) {
49
+ for (const [key, value] of Object.entries(mapContents)){
49
50
  contentsObject[key] = getTextContent(value) || getImageSrc(value);
50
51
  }
51
52
  setContents(contentsObject);
52
53
  }
53
- }, [textContents, imageContents, currentLocale]);
54
- (0, react_1.useEffect)(() => {
55
- const getResponseContents = async () => {
54
+ }, [
55
+ textContents,
56
+ imageContents,
57
+ currentLocale
58
+ ]);
59
+ useEffect(()=>{
60
+ const getResponseContents = async ()=>{
56
61
  const url = `${apiUrl}/v1/bot_flows/${botId}/versions/${version}/webviews/${webviewId}/?provider_id=${providerId}`;
57
62
  try {
58
- const response = await axios_1.default.get(url);
59
- const textResponseContents = response.data.filter(webviewContent => webviewContent.type === types_2.WebviewContentType.TEXT);
63
+ const response = await axios.get(url);
64
+ const textResponseContents = response.data.filter((webviewContent)=>webviewContent.type === WebviewContentType.TEXT);
60
65
  setTextContents(textResponseContents);
61
- const imageResponseContents = response.data.filter(webviewContent => webviewContent.type === types_2.WebviewContentType.IMAGE);
66
+ const imageResponseContents = response.data.filter((webviewContent)=>webviewContent.type === WebviewContentType.IMAGE);
62
67
  setImageContents(imageResponseContents);
63
68
  updateCurrentLocale(textResponseContents);
64
- }
65
- catch (error) {
69
+ } catch (error) {
66
70
  console.error('Error fetching webview contents:', error);
67
71
  setError(true);
68
72
  }
@@ -76,8 +80,11 @@ function useWebviewContents({ apiUrl = constants_1.FLOW_BUILDER_API_URL_PROD, ve
76
80
  getTextContent,
77
81
  getImageSrc,
78
82
  setCurrentLocale,
79
- contents,
80
- },
83
+ contents
84
+ }
81
85
  };
82
86
  }
87
+
88
+ export { useWebviewContents };
89
+
83
90
  //# sourceMappingURL=use-webview-contents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-webview-contents.js","sourceRoot":"","sources":["../../../src/webview/use-webview-contents.ts"],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+ {"version":3,"file":"webview/use-webview-contents.js","sources":["../../../src/webview/use-webview-contents.ts"],"sourcesContent":["import axios from 'axios'\nimport { useEffect, useState } from 'react'\n\nimport { FLOW_BUILDER_API_URL_PROD } from '../constants'\nimport { FlowBuilderJSONVersion } from '../types'\nimport {\n type MapContentsType,\n type UseWebviewContents,\n type UseWebviewContentsProps,\n type WebviewContentsResponse,\n WebviewContentType,\n type WebviewImageContent,\n type WebviewTextContent,\n} from './types'\n\nexport function useWebviewContents<T extends MapContentsType>({\n apiUrl = FLOW_BUILDER_API_URL_PROD,\n version = FlowBuilderJSONVersion.LATEST,\n botId,\n webviewId,\n providerId,\n locale,\n mapContents,\n}: UseWebviewContentsProps<T>): UseWebviewContents<T> {\n const [textContents, setTextContents] = useState<WebviewTextContent[]>()\n const [imageContents, setImageContents] = useState<WebviewImageContent[]>()\n const [contents, setContents] = useState<Record<keyof T, string>>(\n {} as Record<keyof T, string>\n )\n const [currentLocale, setCurrentLocale] = useState(locale)\n const [error, setError] = useState(false)\n\n const updateCurrentLocale = (textContents?: WebviewTextContent[]) => {\n if (!textContents || textContents.length === 0) {\n console.log('There is no text contents to check the locale')\n return\n }\n\n const locales = textContents[0].content.text.map(text => text.locale)\n const language = currentLocale.split('-')[0]\n\n if (locales.includes(currentLocale)) {\n setCurrentLocale(currentLocale)\n return\n }\n\n if (locales.includes(language)) {\n setCurrentLocale(language)\n return\n }\n\n console.error(\n `locale: ${currentLocale} cannot be resolved with: ${locales.join(', ')}`\n )\n }\n\n const getTextContent = (contentID: string): string => {\n return (\n textContents\n ?.find(textContent => textContent.code === contentID)\n ?.content.text.find(text => text.locale === currentLocale)?.message ||\n ''\n )\n }\n\n const getImageSrc = (contentID: string): string => {\n return (\n imageContents\n ?.find(imageContent => imageContent.code === contentID)\n ?.content.image.find(image => image.locale === currentLocale)?.file ||\n ''\n )\n }\n\n useEffect(() => {\n if (textContents || imageContents) {\n const contentsObject = {}\n for (const [key, value] of Object.entries<string>(mapContents)) {\n contentsObject[key] = getTextContent(value) || getImageSrc(value)\n }\n setContents(contentsObject as Record<keyof T, string>)\n }\n }, [textContents, imageContents, currentLocale])\n\n useEffect(() => {\n const getResponseContents = async () => {\n const url = `${apiUrl}/v1/bot_flows/${botId}/versions/${version}/webviews/${webviewId}/?provider_id=${providerId}`\n try {\n const response = await axios.get<WebviewContentsResponse>(url)\n\n const textResponseContents = response.data.filter(\n webviewContent => webviewContent.type === WebviewContentType.TEXT\n ) as WebviewTextContent[]\n setTextContents(textResponseContents)\n\n const imageResponseContents = response.data.filter(\n webviewContent => webviewContent.type === WebviewContentType.IMAGE\n ) as WebviewImageContent[]\n setImageContents(imageResponseContents)\n\n updateCurrentLocale(textResponseContents)\n } catch (error) {\n console.error('Error fetching webview contents:', error)\n setError(true)\n }\n }\n getResponseContents()\n }, [])\n\n return {\n isLoading: Object.keys(contents).length === 0,\n error,\n webviewContentsContext: {\n getTextContent,\n getImageSrc,\n setCurrentLocale,\n contents,\n },\n }\n}\n"],"names":["axios","useEffect","useState","FLOW_BUILDER_API_URL_PROD","FlowBuilderJSONVersion","WebviewContentType","useWebviewContents","apiUrl","version","botId","webviewId","providerId","locale","mapContents","textContents","setTextContents","imageContents","setImageContents","contents","setContents","currentLocale","setCurrentLocale","error","setError","updateCurrentLocale","console","locales","text","language","getTextContent","contentID","textContent","getImageSrc","imageContent","image","contentsObject","key","value","Object","getResponseContents","url","response","textResponseContents","webviewContent","imageResponseContents"],"mappings":";;;;;;;;;;;AAAyB;AACkB;AAEa;AACP;AASjC;AAET,SAASM,kBAAkBA,CAA4B,EAC5DC,SAASJ,yBAAyB,EAClCK,UAAUJ,6BAA6B,EACvCK,KAAK,EACLC,SAAS,EACTC,UAAU,EACVC,MAAM,EACNC,WAAW,EACgB;IAC3B,MAAM,CAACC,cAAcC,gBAAgB,GAAGb,QAAQA;IAChD,MAAM,CAACc,eAAeC,iBAAiB,GAAGf,QAAQA;IAClD,MAAM,CAACgB,UAAUC,YAAY,GAAGjB,QAAQ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QAACrB;QAAcE;QAAeI;KAAc;IAE/CnB,SAASA,CAAC;QACR,MAAMsC,sBAAsB;YAC1B,MAAMC,MAAM,GAAGjC,OAAO,cAAc,EAAEE,MAAM,UAAU,EAAED,QAAQ,UAAU,EAAEE,UAAU,cAAc,EAAEC,YAAY;YAClH,IAAI;gBACF,MAAM8B,WAAW,MAAMzC,SAAS,CAA0BwC;gBAE1D,MAAME,uBAAuBD,SAAS,IAAI,CAAC,MAAM,CAC/CE,CAAAA,iBAAkBA,eAAe,IAAI,KAAKtC,uBAAuB;gBAEnEU,gBAAgB2B;gBAEhB,MAAME,wBAAwBH,SAAS,IAAI,CAAC,MAAM,CAChDE,CAAAA,iBAAkBA,eAAe,IAAI,KAAKtC,wBAAwB;gBAEpEY,iBAAiB2B;gBAEjBpB,oBAAoBkB;YACtB,EAAE,OAAOpB,OAAO;gBACdG,QAAQ,KAAK,CAAC,oCAAoCH;gBAClDC,SAAS;YACX;QACF;QACAgB;IACF,GAAG,EAAE;IAEL,OAAO;QACL,WAAWD,OAAO,IAAI,CAACpB,UAAU,MAAM,KAAK;QAC5CI;QACA,wBAAwB;YACtBO;YACAG;YACAX;YACAH;QACF;IACF;AACF"}
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@botonic/plugin-flow-builder",
3
- "version": "0.56.0-alpha.0",
4
- "main": "./lib/cjs/index.js",
3
+ "version": "0.57.0-rslib-esm.0",
4
+ "main": "./lib/esm/index.js",
5
5
  "module": "./lib/esm/index.js",
6
6
  "description": "Use Flow Builder to show your contents",
7
7
  "scripts": {
8
- "build": "rm -rf lib && ../../node_modules/.bin/tsc -p tsconfig.json && ../../node_modules/.bin/tsc -p tsconfig.esm.json",
9
- "build:watch": "npm run build -- --watch",
8
+ "build": "node ../../scripts/build/clean.mjs && rslib build --no-env",
9
+ "build:watch": "node ../../scripts/build/clean.mjs && rslib build --watch --no-env",
10
10
  "test": "../../node_modules/.bin/jest --coverage",
11
11
  "cloc": "../../scripts/qa/cloc-package.sh .",
12
- "prepublishOnly": "rm -rf lib && npm i && npm run build",
12
+ "prepublishOnly": "npm run build && npm run test && npm run lint",
13
13
  "lint": "biome check --write src/ tests/",
14
14
  "lint:check": "biome check src/ tests/",
15
15
  "format": "biome format --write src/ tests/"
16
16
  },
17
17
  "dependencies": {
18
- "@botonic/react": "^0.56.0-alpha.0",
18
+ "@botonic/react": "^0.57.0-rslib-esm.0",
19
19
  "axios": "^1.18.1",
20
20
  "uuid": "^10.0.0"
21
21
  },
@@ -46,5 +46,6 @@
46
46
  ],
47
47
  "devDependencies": {
48
48
  "@types/uuid": "^10.0.0"
49
- }
49
+ },
50
+ "types": "./lib/esm/index.d.ts"
50
51
  }
@@ -16,7 +16,6 @@ import { HubtypeAssistantContent } from '../utils/hubtype-assistant-content'
16
16
  import { ContentFieldsBase } from './content-fields-base'
17
17
  import { FlowCarousel } from './flow-carousel'
18
18
  import { FlowText } from './flow-text'
19
- import { FlowWhatsappRequestContactInfoNode } from './flow-whatsapp-request-contact-info'
20
19
  import type { HtInputGuardrailRule, HtNodeWithContent } from './hubtype-fields'
21
20
  import type { FlowContent } from './index'
22
21
 
@@ -90,16 +89,6 @@ export abstract class FlowAiAgentBase extends ContentFieldsBase {
90
89
  )
91
90
  }
92
91
 
93
- if (message.type === OutputMessageType.RequestContactInfo) {
94
- this.jsxElements.push(
95
- FlowWhatsappRequestContactInfoNode.fromAIAgent(
96
- this.id,
97
- message,
98
- botContext
99
- )
100
- )
101
- }
102
-
103
92
  if (message.type === FlowBuilderOutputMessageType.FlowBuilderContent) {
104
93
  const flowContents = await this.getFlowContentsByContentId(
105
94
  botContext,
@@ -1,8 +1,4 @@
1
- import {
2
- type BotContext,
3
- isWhatsapp,
4
- type RequestContactInfoMessage,
5
- } from '@botonic/core'
1
+ import { type BotContext, isWhatsapp } from '@botonic/core'
6
2
  import { Text, WhatsappRequestContactInfo } from '@botonic/react'
7
3
 
8
4
  import { trackOneContent } from '../tracking'
@@ -30,18 +26,6 @@ export class FlowWhatsappRequestContactInfoNode extends ContentFieldsBase {
30
26
  return requestContactInfo
31
27
  }
32
28
 
33
- static fromAIAgent(
34
- id: string,
35
- message: RequestContactInfoMessage,
36
- botContext: BotContext
37
- ): JSX.Element {
38
- if (!isWhatsapp(botContext.session)) {
39
- return <Text key={id}>{message.content.text}</Text>
40
- }
41
-
42
- return <WhatsappRequestContactInfo key={id} body={message.content.text} />
43
- }
44
-
45
29
  async trackFlow(botContext: BotContext): Promise<void> {
46
30
  await trackOneContent(botContext, this)
47
31
  }
package/src/index.ts CHANGED
@@ -275,16 +275,16 @@ export default class BotonicPluginFlowBuilder implements Plugin {
275
275
  export * from './action'
276
276
  export { AGENT_RATING_PAYLOAD, EMPTY_PAYLOAD } from './constants'
277
277
  export * from './content-fields'
278
- export { HtBotActionNode } from './content-fields/hubtype-fields'
278
+ export type { HtBotActionNode } from './content-fields/hubtype-fields'
279
279
  export {
280
280
  getCommonFlowContentEventArgsForContentId,
281
281
  trackFlowContent,
282
282
  } from './tracking'
283
283
  export {
284
- BotonicPluginFlowBuilderOptions,
285
- ContentFilter,
284
+ type BotonicPluginFlowBuilderOptions,
285
+ type ContentFilter,
286
286
  FlowBuilderJSONVersion,
287
- PayloadParamsBase,
288
- RatingSubmittedInfo,
287
+ type PayloadParamsBase,
288
+ type RatingSubmittedInfo,
289
289
  } from './types'
290
290
  export * from './webview'
package/src/types.ts CHANGED
@@ -1,10 +1,10 @@
1
- import {
1
+ import type {
2
2
  AiAgentArgs,
3
- type BotContext,
3
+ BotContext,
4
4
  GuardrailRule,
5
- type InferenceResponse,
6
- type PluginPreRequest,
7
- type ResolvedPlugins,
5
+ InferenceResponse,
6
+ PluginPreRequest,
7
+ ResolvedPlugins,
8
8
  } from '@botonic/core'
9
9
  import type { FlowContent } from './content-fields'
10
10
  import type {
@@ -101,4 +101,4 @@ export interface RatingSubmittedInfo extends HtRatingButton {
101
101
  possibleValues: number[]
102
102
  }
103
103
 
104
- export { AiAgentArgs, GuardrailRule }
104
+ export type { AiAgentArgs, GuardrailRule }
@@ -6,7 +6,6 @@ import { FlowImage } from '../content-fields/flow-image'
6
6
  import { FlowText } from '../content-fields/flow-text'
7
7
  import { FlowVideo } from '../content-fields/flow-video'
8
8
  import { FlowWhatsappCtaUrlButtonNode } from '../content-fields/flow-whatsapp-cta-url-button'
9
- import { FlowWhatsappRequestContactInfoNode } from '../content-fields/flow-whatsapp-request-contact-info'
10
9
  import { FlowWhatsappTemplate } from '../content-fields/flow-whatsapp-template'
11
10
  import { HtButtonStyle } from '../content-fields/hubtype-fields'
12
11
  import { FlowWhatsappButtonList } from '../content-fields/whatsapp-button-list/flow-whatsapp-button-list'
@@ -35,9 +34,6 @@ export class HubtypeAssistantContent {
35
34
  if (content instanceof FlowWhatsappTemplate) {
36
35
  return HubtypeAssistantContent.formatWhatsappTemplateContent(content)
37
36
  }
38
- if (content instanceof FlowWhatsappRequestContactInfoNode) {
39
- return HubtypeAssistantContent.formatRequestContactInfoContent(content)
40
- }
41
37
  return ''
42
38
  }
43
39
 
@@ -209,14 +205,4 @@ export class HubtypeAssistantContent {
209
205
  const { name, language } = template.htWhatsappTemplate
210
206
  return `WhatsApp Template: ${name} (${language})`
211
207
  }
212
-
213
- private static formatRequestContactInfoContent(
214
- requestContactInfo: FlowWhatsappRequestContactInfoNode
215
- ): string {
216
- const body = requestContactInfo.text?.trim() ?? ''
217
- if (!body) {
218
- return '[WhatsApp Request Contact Info]'
219
- }
220
- return requestContactInfo.text
221
- }
222
208
  }
@@ -1,3 +0,0 @@
1
- import type { FlowContent } from '../content-fields/index';
2
- import type { FlowBuilderContext } from './context';
3
- export declare function getContentsByAiAgentFromUserInput({ cmsApi, flowBuilderPlugin, request, }: FlowBuilderContext): Promise<FlowContent[]>;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getContentsByAiAgentFromUserInput = getContentsByAiAgentFromUserInput;
4
- const ai_agent_1 = require("../utils/ai-agent");
5
- async function getContentsByAiAgentFromUserInput({ cmsApi, flowBuilderPlugin, request, }) {
6
- const startNodeAiAgentFlow = cmsApi.getStartNodeAiAgentFlow();
7
- const isAiAgentEnabled = cmsApi.isAiAgentEnabled();
8
- if (!startNodeAiAgentFlow || !isAiAgentEnabled) {
9
- return [];
10
- }
11
- const contents = await flowBuilderPlugin.getContentsByNode(startNodeAiAgentFlow);
12
- const splitContents = (0, ai_agent_1.splitAiAgentContents)(contents);
13
- if (!splitContents) {
14
- return [];
15
- }
16
- if ('aiAgentRouterContent' in splitContents) {
17
- const { aiAgentRouterContent, contentsBeforeAiAgentRouter } = splitContents;
18
- const aiAgentResponse = await aiAgentRouterContent.resolveAIAgentResponse(request, contentsBeforeAiAgentRouter);
19
- if (!aiAgentResponse || aiAgentResponse.exit) {
20
- return [];
21
- }
22
- }
23
- if ('aiAgentWorkerContent' in splitContents) {
24
- const { aiAgentWorkerContent, contentsBeforeAiAgentWorker } = splitContents;
25
- const aiAgentResponse = await aiAgentWorkerContent.resolveAIAgentResponse(request, contentsBeforeAiAgentWorker);
26
- if (!aiAgentResponse || aiAgentResponse.exit) {
27
- return [];
28
- }
29
- }
30
- return contents;
31
- }
32
- //# sourceMappingURL=ai-agent-from-user-input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ai-agent-from-user-input.js","sourceRoot":"","sources":["../../../src/action/ai-agent-from-user-input.ts"],"names":[],"mappings":";;AAIA,8EA6CC;AAhDD,gDAAwD;AAGjD,KAAK,UAAU,iCAAiC,CAAC,EACtD,MAAM,EACN,iBAAiB,EACjB,OAAO,GACY;IACnB,MAAM,oBAAoB,GAAG,MAAM,CAAC,uBAAuB,EAAE,CAAA;IAC7D,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAA;IAClD,IAAI,CAAC,oBAAoB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC/C,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM,QAAQ,GACZ,MAAM,iBAAiB,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAA;IAEjE,MAAM,aAAa,GAAG,IAAA,+BAAoB,EAAC,QAAQ,CAAC,CAAA;IAEpD,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,sBAAsB,IAAI,aAAa,EAAE,CAAC;QAC5C,MAAM,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,GAAG,aAAa,CAAA;QAC3E,MAAM,eAAe,GAAG,MAAM,oBAAoB,CAAC,sBAAsB,CACvE,OAAO,EACP,2BAA2B,CAC5B,CAAA;QAED,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,IAAI,EAAE,CAAC;YAC7C,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CAAC;IAED,IAAI,sBAAsB,IAAI,aAAa,EAAE,CAAC;QAC5C,MAAM,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,GAAG,aAAa,CAAA;QAC3E,MAAM,eAAe,GAAG,MAAM,oBAAoB,CAAC,sBAAsB,CACvE,OAAO,EACP,2BAA2B,CAC5B,CAAA;QAED,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,IAAI,EAAE,CAAC;YAC7C,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { BotContext } from '@botonic/core';
2
- import type { FlowBuilderApi } from '../api';
3
- import type BotonicPluginFlowBuilder from '../index';
4
- export interface FlowBuilderContext {
5
- cmsApi: FlowBuilderApi;
6
- flowBuilderPlugin: BotonicPluginFlowBuilder;
7
- request: BotContext;
8
- resolvedLocale: string;
9
- contentID?: string;
10
- }
11
- export declare function getFlowBuilderActionContext(request: BotContext, contentID?: string): FlowBuilderContext;