rebill-web-components-sdk 1.8.3-beta.3 → 1.8.3-beta.5

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 (297) hide show
  1. package/dist/cjs/apm-checkout_16.cjs.entry.js +2 -2
  2. package/dist/cjs/apm-checkout_16.cjs.entry.js.map +1 -1
  3. package/dist/cjs/card-identification.card-iframe.card-skeleton.rebill-input-combo.rebill-installments.entry.cjs.js.map +1 -1
  4. package/dist/cjs/card-identification_5.cjs.entry.js +1 -1
  5. package/dist/cjs/card-identification_5.cjs.entry.js.map +1 -1
  6. package/dist/cjs/card-skeleton.cjs.entry.js +1 -1
  7. package/dist/cjs/card-skeleton.cjs.entry.js.map +1 -1
  8. package/dist/cjs/card-skeleton.entry.cjs.js.map +1 -1
  9. package/dist/cjs/collapsible-card.cjs.entry.js +1 -1
  10. package/dist/cjs/collapsible-card.cjs.entry.js.map +1 -1
  11. package/dist/cjs/collapsible-card.entry.cjs.js.map +1 -1
  12. package/dist/cjs/{organization-logo-BZqb4lkj.js → organization-logo-D4gP9Bg_.js} +3 -3
  13. package/dist/cjs/{organization-logo-BZqb4lkj.js.map → organization-logo-D4gP9Bg_.js.map} +1 -1
  14. package/dist/cjs/{organization-logo-Dnfazz63.js → organization-logo-x4KEuA72.js} +3 -3
  15. package/dist/cjs/{organization-logo-Dnfazz63.js.map → organization-logo-x4KEuA72.js.map} +1 -1
  16. package/dist/cjs/organization-logo.cjs.entry.js +1 -1
  17. package/dist/cjs/organization-logo_4.cjs.entry.js +1 -1
  18. package/dist/cjs/otp-component.cjs.entry.js +5 -5
  19. package/dist/cjs/otp-component.cjs.entry.js.map +1 -1
  20. package/dist/cjs/otp-component.entry.cjs.js.map +1 -1
  21. package/dist/cjs/otp-component.rebill-modal-overlay.rebill-mode-sandbox.rebill-mode-sandbox-mobile.rebill-summary.success-page.user-information.entry.cjs.js.map +1 -1
  22. package/dist/cjs/otp-component_7.cjs.entry.js +10 -10
  23. package/dist/cjs/otp-component_7.cjs.entry.js.map +1 -1
  24. package/dist/cjs/rebill-address.cjs.entry.js +1 -1
  25. package/dist/cjs/rebill-address.cjs.entry.js.map +1 -1
  26. package/dist/cjs/rebill-address.entry.cjs.js.map +1 -1
  27. package/dist/cjs/rebill-checkout.cjs.entry.js +1 -1
  28. package/dist/cjs/rebill-icon.rebill-typography.entry.cjs.js.map +1 -1
  29. package/dist/cjs/rebill-icon_2.cjs.entry.js +1 -1
  30. package/dist/cjs/rebill-icon_2.cjs.entry.js.map +1 -1
  31. package/dist/cjs/rebill-input-text.cjs.entry.js +2 -2
  32. package/dist/cjs/rebill-input-text.cjs.entry.js.map +1 -1
  33. package/dist/cjs/rebill-input-text.entry.cjs.js.map +1 -1
  34. package/dist/cjs/rebill-mode-sandbox-mobile.cjs.entry.js +4 -4
  35. package/dist/cjs/rebill-mode-sandbox-mobile.cjs.entry.js.map +1 -1
  36. package/dist/cjs/rebill-mode-sandbox-mobile.entry.cjs.js.map +1 -1
  37. package/dist/cjs/rebill-renewal.cjs.entry.js +1 -1
  38. package/dist/cjs/rebill-renewal.cjs.entry.js.map +1 -1
  39. package/dist/cjs/rebill-renewal.entry.cjs.js.map +1 -1
  40. package/dist/cjs/rebill-typography.cjs.entry.js +1 -1
  41. package/dist/cjs/rebill-typography.cjs.entry.js.map +1 -1
  42. package/dist/cjs/rebill-typography.entry.cjs.js.map +1 -1
  43. package/dist/cjs/renewal-success-page.cjs.entry.js +1 -1
  44. package/dist/cjs/renewal-success-page.cjs.entry.js.map +1 -1
  45. package/dist/cjs/renewal-success-page.entry.cjs.js.map +1 -1
  46. package/dist/cjs/renewal-success-page.renewal-summary.entry.cjs.js.map +1 -1
  47. package/dist/cjs/renewal-success-page_2.cjs.entry.js +1 -1
  48. package/dist/cjs/renewal-success-page_2.cjs.entry.js.map +1 -1
  49. package/dist/cjs/root-component.cjs.entry.js +1 -1
  50. package/dist/cjs/root-component.cjs.entry.js.map +1 -1
  51. package/dist/cjs/root-component.entry.cjs.js.map +1 -1
  52. package/dist/cjs/selectable-card.cjs.entry.js +1 -1
  53. package/dist/cjs/selectable-card.cjs.entry.js.map +1 -1
  54. package/dist/cjs/selectable-card.entry.cjs.js.map +1 -1
  55. package/dist/cjs/success-page.cjs.entry.js +1 -1
  56. package/dist/cjs/success-page.cjs.entry.js.map +1 -1
  57. package/dist/cjs/success-page.entry.cjs.js.map +1 -1
  58. package/dist/collection/components/checkout/address/address.css +0 -6
  59. package/dist/collection/components/checkout/card-success-page/success-page.css +0 -6
  60. package/dist/collection/components/checkout/otp/otp.css +16 -16
  61. package/dist/collection/components/checkout/otp/otp.js +4 -4
  62. package/dist/collection/components/checkout/otp/otp.js.map +1 -1
  63. package/dist/collection/components/checkout/payment-method-selector/card-fields/iframe/skeleton/cardSkeleton.css +0 -6
  64. package/dist/collection/components/renewal/rebill-renewal.css +0 -6
  65. package/dist/collection/components/renewal/renewal-success-page/renewal-success-page.css +0 -6
  66. package/dist/collection/components/root-component/root-component.css +0 -6
  67. package/dist/collection/components/shared/collapsible-card/collapsible-card.css +0 -6
  68. package/dist/collection/components/shared/inputs/input-text/input-text.css +4 -4
  69. package/dist/collection/components/shared/inputs/input-text/input-text.js +1 -1
  70. package/dist/collection/components/shared/inputs/input-text/input-text.js.map +1 -1
  71. package/dist/collection/components/shared/mode-sandbox/mode-sandbox-mobile.css +21 -16
  72. package/dist/collection/components/shared/mode-sandbox/mode-sandbox-mobile.js +3 -3
  73. package/dist/collection/components/shared/mode-sandbox/mode-sandbox-mobile.js.map +1 -1
  74. package/dist/collection/components/shared/organization-logo/organization-logo.css +0 -6
  75. package/dist/collection/components/shared/selectable-card/selectable-card.css +0 -6
  76. package/dist/collection/components/shared/typography/typography.css +0 -6
  77. package/dist/components/CardSkeleton.js +1 -1
  78. package/dist/components/CardSkeleton.js.map +1 -1
  79. package/dist/components/address.js +1 -1
  80. package/dist/components/address.js.map +1 -1
  81. package/dist/components/collapsible-card2.js +1 -1
  82. package/dist/components/collapsible-card2.js.map +1 -1
  83. package/dist/components/input-text.js +2 -2
  84. package/dist/components/input-text.js.map +1 -1
  85. package/dist/components/mode-sandbox-mobile.js +4 -4
  86. package/dist/components/mode-sandbox-mobile.js.map +1 -1
  87. package/dist/components/organization-logo2.js +1 -1
  88. package/dist/components/organization-logo2.js.map +1 -1
  89. package/dist/components/otp.js +5 -5
  90. package/dist/components/otp.js.map +1 -1
  91. package/dist/components/{p-F4jLIfkG.js → p-0BTfY4S5.js} +7 -7
  92. package/dist/components/{p-F4jLIfkG.js.map → p-0BTfY4S5.js.map} +1 -1
  93. package/dist/components/{p-BhZLfMCq.js → p-8Z6_-yhm.js} +4 -4
  94. package/dist/components/p-8Z6_-yhm.js.map +1 -0
  95. package/dist/components/{p-N7wfNpl2.js → p-B9aIvZlq.js} +4 -4
  96. package/dist/components/{p-N7wfNpl2.js.map → p-B9aIvZlq.js.map} +1 -1
  97. package/dist/components/{p-C1Jzk6t7.js → p-B9aJ7_rc.js} +9 -9
  98. package/dist/components/{p-C1Jzk6t7.js.map → p-B9aJ7_rc.js.map} +1 -1
  99. package/dist/components/{p-C-BFyHag.js → p-BId02g8-.js} +9 -9
  100. package/dist/components/p-BId02g8-.js.map +1 -0
  101. package/dist/components/{p-BGIg233G.js → p-BOrcSA8T.js} +3 -3
  102. package/dist/components/{p-BGIg233G.js.map → p-BOrcSA8T.js.map} +1 -1
  103. package/dist/components/{p-D_sGE3-j.js → p-BRjIL3fw.js} +3 -3
  104. package/dist/components/{p-D_sGE3-j.js.map → p-BRjIL3fw.js.map} +1 -1
  105. package/dist/components/{p-FoWuzUYH.js → p-BVfV2NVA.js} +6 -6
  106. package/dist/components/{p-FoWuzUYH.js.map → p-BVfV2NVA.js.map} +1 -1
  107. package/dist/components/{p-mGnGyYiQ.js → p-BVtSIdnS.js} +4 -4
  108. package/dist/components/{p-mGnGyYiQ.js.map → p-BVtSIdnS.js.map} +1 -1
  109. package/dist/components/{p-D6JNNodL.js → p-BZ90sz6G.js} +3 -3
  110. package/dist/components/{p-D6JNNodL.js.map → p-BZ90sz6G.js.map} +1 -1
  111. package/dist/components/{p-JVLfbdAy.js → p-C0a5bxXF.js} +3 -3
  112. package/dist/components/{p-JVLfbdAy.js.map → p-C0a5bxXF.js.map} +1 -1
  113. package/dist/components/{p-D_PXcKNq.js → p-C8bwQKOB.js} +3 -3
  114. package/dist/components/{p-D_PXcKNq.js.map → p-C8bwQKOB.js.map} +1 -1
  115. package/dist/components/{p-CKHlNMVF.js → p-CjKgYUL9.js} +3 -3
  116. package/dist/components/{p-CKHlNMVF.js.map → p-CjKgYUL9.js.map} +1 -1
  117. package/dist/components/{p-Mn8ErAAb.js → p-CwHrjjgl.js} +4 -4
  118. package/dist/components/{p-Mn8ErAAb.js.map → p-CwHrjjgl.js.map} +1 -1
  119. package/dist/components/{p-ojGSd7eA.js → p-D8FW7I0M.js} +3 -3
  120. package/dist/components/{p-ojGSd7eA.js.map → p-D8FW7I0M.js.map} +1 -1
  121. package/dist/components/{p-CdLmSaw6.js → p-DAJuJoZn.js} +4 -4
  122. package/dist/components/{p-CdLmSaw6.js.map → p-DAJuJoZn.js.map} +1 -1
  123. package/dist/components/{p-BaN8grjD.js → p-DNxp10y2.js} +5 -5
  124. package/dist/components/{p-BaN8grjD.js.map → p-DNxp10y2.js.map} +1 -1
  125. package/dist/components/{p-BshrHj7X.js → p-DQi9Jit7.js} +5 -5
  126. package/dist/components/{p-BshrHj7X.js.map → p-DQi9Jit7.js.map} +1 -1
  127. package/dist/components/{p-fLN8M37t.js → p-DbLIZ0gI.js} +3 -3
  128. package/dist/components/{p-fLN8M37t.js.map → p-DbLIZ0gI.js.map} +1 -1
  129. package/dist/components/{p-C81ESSvH.js → p-DlgrkLu0.js} +4 -4
  130. package/dist/components/{p-C81ESSvH.js.map → p-DlgrkLu0.js.map} +1 -1
  131. package/dist/components/{p-CGfY7lYE.js → p-DmG9jqf9.js} +3 -3
  132. package/dist/components/{p-CGfY7lYE.js.map → p-DmG9jqf9.js.map} +1 -1
  133. package/dist/components/{p-B2TDQClH.js → p-Dua4qdwP.js} +3 -3
  134. package/dist/components/{p-B2TDQClH.js.map → p-Dua4qdwP.js.map} +1 -1
  135. package/dist/components/{p-CgtGqqWz.js → p-Dy2kgG1_.js} +3 -3
  136. package/dist/components/{p-CgtGqqWz.js.map → p-Dy2kgG1_.js.map} +1 -1
  137. package/dist/components/{p-e4my43Fj.js → p-J04T9w3B.js} +4 -4
  138. package/dist/components/{p-e4my43Fj.js.map → p-J04T9w3B.js.map} +1 -1
  139. package/dist/components/{p-BMR1f9Ny.js → p-J4ePC1Gr.js} +7 -7
  140. package/dist/components/{p-BMR1f9Ny.js.map → p-J4ePC1Gr.js.map} +1 -1
  141. package/dist/components/{p-6crhm8xF.js → p-KnZ28rwQ.js} +7 -7
  142. package/dist/components/{p-6crhm8xF.js.map → p-KnZ28rwQ.js.map} +1 -1
  143. package/dist/components/p-ReaNe705.js +85 -0
  144. package/dist/components/p-ReaNe705.js.map +1 -0
  145. package/dist/components/{p--nzbbHU3.js → p-bhvS6Qdq.js} +3 -3
  146. package/dist/components/{p--nzbbHU3.js.map → p-bhvS6Qdq.js.map} +1 -1
  147. package/dist/components/{p-BKW3nMqk.js → p-d3WZKgsB.js} +5 -5
  148. package/dist/components/{p-BKW3nMqk.js.map → p-d3WZKgsB.js.map} +1 -1
  149. package/dist/components/{p-De6XbCCz.js → p-gCWikaoG.js} +7 -7
  150. package/dist/components/{p-De6XbCCz.js.map → p-gCWikaoG.js.map} +1 -1
  151. package/dist/components/{p-8OkGYgSm.js → p-nhr8VHHV.js} +4 -4
  152. package/dist/components/{p-8OkGYgSm.js.map → p-nhr8VHHV.js.map} +1 -1
  153. package/dist/components/{p-DWoIf2g_.js → p-rT7t0c3J.js} +9 -9
  154. package/dist/components/{p-DWoIf2g_.js.map → p-rT7t0c3J.js.map} +1 -1
  155. package/dist/components/{p-C1R9RQEK.js → p-u7D3-_Vp.js} +4 -4
  156. package/dist/components/{p-C1R9RQEK.js.map → p-u7D3-_Vp.js.map} +1 -1
  157. package/dist/components/rebill-renewal.js +1 -1
  158. package/dist/components/rebill-renewal.js.map +1 -1
  159. package/dist/components/renewal-success-page2.js +1 -1
  160. package/dist/components/renewal-success-page2.js.map +1 -1
  161. package/dist/components/root-component.js +1 -1
  162. package/dist/components/root-component.js.map +1 -1
  163. package/dist/components/selectable-card2.js +1 -1
  164. package/dist/components/selectable-card2.js.map +1 -1
  165. package/dist/components/success-page2.js +1 -1
  166. package/dist/components/success-page2.js.map +1 -1
  167. package/dist/components/typography.js +1 -1
  168. package/dist/components/typography.js.map +1 -1
  169. package/dist/esm/apm-checkout_16.entry.js +2 -2
  170. package/dist/esm/apm-checkout_16.entry.js.map +1 -1
  171. package/dist/esm/card-identification.card-iframe.card-skeleton.rebill-input-combo.rebill-installments.entry.js.map +1 -1
  172. package/dist/esm/card-identification_5.entry.js +1 -1
  173. package/dist/esm/card-identification_5.entry.js.map +1 -1
  174. package/dist/esm/card-skeleton.entry.js +1 -1
  175. package/dist/esm/card-skeleton.entry.js.map +1 -1
  176. package/dist/esm/collapsible-card.entry.js +1 -1
  177. package/dist/esm/collapsible-card.entry.js.map +1 -1
  178. package/dist/esm/{organization-logo-DTXw5Lu4.js → organization-logo-BPE5_Qxz.js} +3 -3
  179. package/dist/esm/{organization-logo-6pnwjRAd.js.map → organization-logo-BPE5_Qxz.js.map} +1 -1
  180. package/dist/{rebill-web-components-sdk/organization-logo-6pnwjRAd.js → esm/organization-logo-FuaJxXfD.js} +3 -3
  181. package/dist/{rebill-web-components-sdk/organization-logo-6pnwjRAd.js.map → esm/organization-logo-FuaJxXfD.js.map} +1 -1
  182. package/dist/esm/organization-logo.entry.js +1 -1
  183. package/dist/esm/organization-logo_4.entry.js +1 -1
  184. package/dist/esm/otp-component.entry.js +5 -5
  185. package/dist/esm/otp-component.entry.js.map +1 -1
  186. package/dist/esm/otp-component.rebill-modal-overlay.rebill-mode-sandbox.rebill-mode-sandbox-mobile.rebill-summary.success-page.user-information.entry.js.map +1 -1
  187. package/dist/esm/otp-component_7.entry.js +10 -10
  188. package/dist/esm/otp-component_7.entry.js.map +1 -1
  189. package/dist/esm/rebill-address.entry.js +1 -1
  190. package/dist/esm/rebill-address.entry.js.map +1 -1
  191. package/dist/esm/rebill-checkout.entry.js +1 -1
  192. package/dist/esm/rebill-icon.rebill-typography.entry.js.map +1 -1
  193. package/dist/esm/rebill-icon_2.entry.js +1 -1
  194. package/dist/esm/rebill-icon_2.entry.js.map +1 -1
  195. package/dist/esm/rebill-input-text.entry.js +2 -2
  196. package/dist/esm/rebill-input-text.entry.js.map +1 -1
  197. package/dist/esm/rebill-mode-sandbox-mobile.entry.js +4 -4
  198. package/dist/esm/rebill-mode-sandbox-mobile.entry.js.map +1 -1
  199. package/dist/esm/rebill-renewal.entry.js +1 -1
  200. package/dist/esm/rebill-renewal.entry.js.map +1 -1
  201. package/dist/esm/rebill-typography.entry.js +1 -1
  202. package/dist/esm/rebill-typography.entry.js.map +1 -1
  203. package/dist/esm/renewal-success-page.entry.js +1 -1
  204. package/dist/esm/renewal-success-page.entry.js.map +1 -1
  205. package/dist/esm/renewal-success-page.renewal-summary.entry.js.map +1 -1
  206. package/dist/esm/renewal-success-page_2.entry.js +1 -1
  207. package/dist/esm/renewal-success-page_2.entry.js.map +1 -1
  208. package/dist/esm/root-component.entry.js +1 -1
  209. package/dist/esm/root-component.entry.js.map +1 -1
  210. package/dist/esm/selectable-card.entry.js +1 -1
  211. package/dist/esm/selectable-card.entry.js.map +1 -1
  212. package/dist/esm/success-page.entry.js +1 -1
  213. package/dist/esm/success-page.entry.js.map +1 -1
  214. package/dist/rebill-web-components-sdk/card-identification.card-iframe.card-skeleton.rebill-input-combo.rebill-installments.entry.esm.js.map +1 -1
  215. package/dist/rebill-web-components-sdk/card-skeleton.entry.esm.js.map +1 -1
  216. package/dist/rebill-web-components-sdk/card-skeleton.entry.js +1 -1
  217. package/dist/rebill-web-components-sdk/card-skeleton.entry.js.map +1 -1
  218. package/dist/rebill-web-components-sdk/collapsible-card.entry.esm.js.map +1 -1
  219. package/dist/rebill-web-components-sdk/collapsible-card.entry.js +1 -1
  220. package/dist/rebill-web-components-sdk/collapsible-card.entry.js.map +1 -1
  221. package/dist/{esm/organization-logo-6pnwjRAd.js → rebill-web-components-sdk/organization-logo-FuaJxXfD.js} +3 -3
  222. package/dist/{esm/organization-logo-DTXw5Lu4.js.map → rebill-web-components-sdk/organization-logo-FuaJxXfD.js.map} +1 -1
  223. package/dist/rebill-web-components-sdk/organization-logo.entry.js +1 -1
  224. package/dist/rebill-web-components-sdk/otp-component.entry.esm.js.map +1 -1
  225. package/dist/rebill-web-components-sdk/otp-component.entry.js +5 -5
  226. package/dist/rebill-web-components-sdk/otp-component.entry.js.map +1 -1
  227. package/dist/rebill-web-components-sdk/otp-component.rebill-modal-overlay.rebill-mode-sandbox.rebill-mode-sandbox-mobile.rebill-summary.success-page.user-information.entry.esm.js.map +1 -1
  228. package/dist/rebill-web-components-sdk/p-07de170b.entry.js +2 -0
  229. package/dist/rebill-web-components-sdk/{p-d189dea8.entry.js.map → p-07de170b.entry.js.map} +1 -1
  230. package/dist/rebill-web-components-sdk/p-2be8b27e.entry.js +2 -0
  231. package/dist/rebill-web-components-sdk/{p-a3f63a73.entry.js.map → p-2be8b27e.entry.js.map} +1 -1
  232. package/dist/rebill-web-components-sdk/p-2f00f173.entry.js +2 -0
  233. package/dist/rebill-web-components-sdk/{p-e16cc3b0.entry.js.map → p-2f00f173.entry.js.map} +1 -1
  234. package/dist/rebill-web-components-sdk/p-3b7a11c7.entry.js +2 -0
  235. package/dist/rebill-web-components-sdk/{p-f02133d8.entry.js.map → p-3b7a11c7.entry.js.map} +1 -1
  236. package/dist/rebill-web-components-sdk/p-3c6aaa56.entry.js +2 -0
  237. package/dist/rebill-web-components-sdk/{p-174a9543.entry.js.map → p-3c6aaa56.entry.js.map} +1 -1
  238. package/dist/rebill-web-components-sdk/p-5485215c.entry.js +2 -0
  239. package/dist/rebill-web-components-sdk/{p-62fc3d11.entry.js.map → p-5485215c.entry.js.map} +1 -1
  240. package/dist/rebill-web-components-sdk/{p-68a78ab6.entry.js → p-932d5912.entry.js} +2 -2
  241. package/dist/rebill-web-components-sdk/{p-3fca32f8.entry.js → p-a09e3090.entry.js} +2 -2
  242. package/dist/rebill-web-components-sdk/p-a780e6e8.entry.js +2 -0
  243. package/dist/rebill-web-components-sdk/p-a780e6e8.entry.js.map +1 -0
  244. package/dist/rebill-web-components-sdk/p-bf4f1bcc.entry.js +2 -0
  245. package/dist/rebill-web-components-sdk/{p-b8591c64.entry.js.map → p-bf4f1bcc.entry.js.map} +1 -1
  246. package/dist/rebill-web-components-sdk/p-cecc2fbe.entry.js +2 -0
  247. package/dist/rebill-web-components-sdk/p-cecc2fbe.entry.js.map +1 -0
  248. package/dist/rebill-web-components-sdk/{p-DTsMkxC1.js → p-tu-WZjQJ.js} +2 -2
  249. package/dist/rebill-web-components-sdk/{p-DTsMkxC1.js.map → p-tu-WZjQJ.js.map} +1 -1
  250. package/dist/rebill-web-components-sdk/rebill-address.entry.esm.js.map +1 -1
  251. package/dist/rebill-web-components-sdk/rebill-address.entry.js +1 -1
  252. package/dist/rebill-web-components-sdk/rebill-address.entry.js.map +1 -1
  253. package/dist/rebill-web-components-sdk/rebill-checkout.entry.js +1 -1
  254. package/dist/rebill-web-components-sdk/rebill-icon.rebill-typography.entry.esm.js.map +1 -1
  255. package/dist/rebill-web-components-sdk/rebill-input-text.entry.esm.js.map +1 -1
  256. package/dist/rebill-web-components-sdk/rebill-input-text.entry.js +2 -2
  257. package/dist/rebill-web-components-sdk/rebill-input-text.entry.js.map +1 -1
  258. package/dist/rebill-web-components-sdk/rebill-mode-sandbox-mobile.entry.esm.js.map +1 -1
  259. package/dist/rebill-web-components-sdk/rebill-mode-sandbox-mobile.entry.js +4 -4
  260. package/dist/rebill-web-components-sdk/rebill-mode-sandbox-mobile.entry.js.map +1 -1
  261. package/dist/rebill-web-components-sdk/rebill-renewal.entry.esm.js.map +1 -1
  262. package/dist/rebill-web-components-sdk/rebill-renewal.entry.js +1 -1
  263. package/dist/rebill-web-components-sdk/rebill-renewal.entry.js.map +1 -1
  264. package/dist/rebill-web-components-sdk/rebill-typography.entry.esm.js.map +1 -1
  265. package/dist/rebill-web-components-sdk/rebill-typography.entry.js +1 -1
  266. package/dist/rebill-web-components-sdk/rebill-typography.entry.js.map +1 -1
  267. package/dist/rebill-web-components-sdk/renewal-success-page.entry.esm.js.map +1 -1
  268. package/dist/rebill-web-components-sdk/renewal-success-page.entry.js +1 -1
  269. package/dist/rebill-web-components-sdk/renewal-success-page.entry.js.map +1 -1
  270. package/dist/rebill-web-components-sdk/renewal-success-page.renewal-summary.entry.esm.js.map +1 -1
  271. package/dist/rebill-web-components-sdk/root-component.entry.esm.js.map +1 -1
  272. package/dist/rebill-web-components-sdk/root-component.entry.js +1 -1
  273. package/dist/rebill-web-components-sdk/root-component.entry.js.map +1 -1
  274. package/dist/rebill-web-components-sdk/selectable-card.entry.esm.js.map +1 -1
  275. package/dist/rebill-web-components-sdk/selectable-card.entry.js +1 -1
  276. package/dist/rebill-web-components-sdk/selectable-card.entry.js.map +1 -1
  277. package/dist/rebill-web-components-sdk/success-page.entry.esm.js.map +1 -1
  278. package/dist/rebill-web-components-sdk/success-page.entry.js +1 -1
  279. package/dist/rebill-web-components-sdk/success-page.entry.js.map +1 -1
  280. package/package.json +1 -1
  281. package/dist/components/p-BhZLfMCq.js.map +0 -1
  282. package/dist/components/p-Bl3lkRJY.js +0 -85
  283. package/dist/components/p-Bl3lkRJY.js.map +0 -1
  284. package/dist/components/p-C-BFyHag.js.map +0 -1
  285. package/dist/rebill-web-components-sdk/p-174a9543.entry.js +0 -2
  286. package/dist/rebill-web-components-sdk/p-62fc3d11.entry.js +0 -2
  287. package/dist/rebill-web-components-sdk/p-8edd1215.entry.js +0 -2
  288. package/dist/rebill-web-components-sdk/p-8edd1215.entry.js.map +0 -1
  289. package/dist/rebill-web-components-sdk/p-a3f63a73.entry.js +0 -2
  290. package/dist/rebill-web-components-sdk/p-b8591c64.entry.js +0 -2
  291. package/dist/rebill-web-components-sdk/p-d189dea8.entry.js +0 -2
  292. package/dist/rebill-web-components-sdk/p-daa7cbb2.entry.js +0 -2
  293. package/dist/rebill-web-components-sdk/p-daa7cbb2.entry.js.map +0 -1
  294. package/dist/rebill-web-components-sdk/p-e16cc3b0.entry.js +0 -2
  295. package/dist/rebill-web-components-sdk/p-f02133d8.entry.js +0 -2
  296. /package/dist/rebill-web-components-sdk/{p-68a78ab6.entry.js.map → p-932d5912.entry.js.map} +0 -0
  297. /package/dist/rebill-web-components-sdk/{p-3fca32f8.entry.js.map → p-a09e3090.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["getRequiredFields","async","currency","method","organizationId","requiredFieldsResponse","api","checkout","fields","mapRequiredFields","data","original","getAllRequiredFieldsRenewal","paymentMethods","Set","renewalState","map","pm","type","promises","paymentMethod","apiPaymentMethod","PaymentMethodMapper","mapToAPMPaymentMethod","price","country","result","organization","id","error","console","results","Promise","all","fieldsMap","forEach","getRequiredFieldsForMethod","allRequiredFields","storedFields","rebillRenewalCss","RebillRenewal","renewalData","renewalToken","currentPaymentMethod","PAYMENT_METHOD_ENUM","CARD","isSubmitting","isCardSubmitting","isCardSuccess","errorMessage","breakpoint","BREAKPOINT_ENUM","DESKTOP","errorPaymentCard","errorPaymentAPM","initialData","checkoutResponse","currentApmPaymentMethod","countries","currentRequiredFields","errorCardInvalid","cardMode","success","paymentError","paymentMethodSelected","validationSchema","phoneNumber","yup.string","when","is","isFieldRequired","this","then","schema","required","otherwise","notRequired","bankId","documentType","documentNumber","min","resizeHandler","getBreakpoint","window","innerWidth","componentWillLoad","addEventListener","renewalProps","JSON","parse","RenewalStore","initializeRenewal","token","GoogleMapsService","loadGoogleMapsScript","response","getCountries","length","firstPaymentMethod","setSelectedPaymentMethod","initializeFingerprint","getInitialData","renewalOnChange","disconnectedCallback","removeEventListener","handlePaymentMethodSelected","event","stopPropagation","detail","setCardMode","emit","deviceId","uuid","crypto","randomUUID","fingerprintResponse","fingerPrint","getFingerPrint","setDeviceId","script","scriptElement","document","createElement","innerHTML","body","appendChild","handleBankSelected","setSelectedBankId","handleCardSelected","card","cvv","setSelectedCard","setCvv","currentPaymentError","CASH","BANK_TRANSFER","handleSubmit","handleCardRenewal","handleAPMRenewal","formData","cardId","cardTokenId","cardInformation","setLoading","renewalRequest","transaction","quantity","customAttributes","customer","firstName","fullName","split","subscription","customerName","lastName","slice","join","email","customerEmail","phone","countryCode","countryCodePhoneNumber","number","billingDetails","address","lineOne","city","state","zipCode","identification","value","idempotencyKey","generateIdempotencyKey","createCardCheckoutRequest","setCheckoutResponse","status","toUpperCase","CheckoutStatusE","APPROVED","message","apmPaymentMethod","getFormData","redirect","approved","location","origin","rejected","paymentMetadata","orderId","source","bank","PaymentMethodNameE","CO_TRANSFERENCE_PSE","targetCurrency","createAPMCheckoutRequest","alertTitle","hasPrefilledAddress","billingFields","some","key","trim","getPaymentDate","payment","form","date","getReferenceNumber","traceId","render","isInitialized","h","class","I18nService","translate","renderRenewalSummary","props","totalAmount","amount","subscriptionTitle","name","text","subscriptionAmount","nextChargeDate","frequency","Fragment","style","display","typePaymentMethod","paymentDate","referenceNumber","cardLastFour","paymentMethodName","selectedBankId","onSubmit","args","renderForm","submit","errors","userInfo","isBreakpointBelow","displayedComponents","flexDirection","gap","enabledPaymentMethods","defaultSelected","errorComponent","showErrorComponent","PaymentErrorMapper","getErrorMessage","cardError","showCardInvalid","documentTypeError","documentNumberError","showDocument","icon","variant","colorIcon","COLORS_ENUM","PRIMARY","banks","getFieldValues","defaultSelectedBankId","countryOptions","label","isoCountryCode","billingView","referenceId","undefined","qrCodeData","qrCode","providerName","expirationDate","Date","setDate","getDate","toISOString","redirectUrl","url","isLoading","isRenewal","trialPeriodDays","timeToRedirect","isDisabled","fetchingInstallments"],"sources":["src/components/renewal/utils/getRequiredFieldsRenewal.ts","src/components/renewal/rebill-renewal.css?tag=rebill-renewal","src/components/renewal/rebill-renewal.tsx"],"sourcesContent":["import { api } from '../../../api';\nimport { PAYMENT_METHOD_ENUM } from '../../../models/enums/payment-methods.enum';\nimport { renewalState } from '../../../store/renewal.store';\nimport { PaymentMethodMapper } from '../../../utils/payment-method-mapper';\nimport { mapRequiredFields, RequiredField } from '../../../utils/required-fields-mappers';\n\nexport interface RequiredFieldsResult {\n fields: string[];\n original: RequiredField[];\n}\n\nexport interface AllRequiredFieldsMap {\n [key: string]: RequiredFieldsResult;\n}\n\nconst getRequiredFields = async (\n currency: string,\n method: string,\n organizationId: string,\n): Promise<RequiredFieldsResult> => {\n const requiredFieldsResponse = await api.checkout.getRequiredFields(\n {\n currency,\n method,\n },\n organizationId,\n );\n\n return {\n fields: mapRequiredFields(requiredFieldsResponse.data),\n original: requiredFieldsResponse.data,\n };\n};\n\nexport const getAllRequiredFieldsRenewal = async (): Promise<AllRequiredFieldsMap> => {\n const paymentMethods = [\n ...new Set(renewalState.data.paymentMethods.map(pm => pm.type as PAYMENT_METHOD_ENUM)),\n ];\n const promises = paymentMethods.map(async paymentMethod => {\n try {\n const apiPaymentMethod = PaymentMethodMapper.mapToAPMPaymentMethod(\n paymentMethod,\n renewalState.data.price.country,\n );\n\n const result = await getRequiredFields(\n renewalState.data.price.currency,\n apiPaymentMethod,\n renewalState.data.organization.id,\n );\n\n return {\n paymentMethod,\n ...result,\n };\n } catch (error) {\n console.error(`Error getting required fields for ${paymentMethod}:`, error);\n return {\n paymentMethod,\n fields: [],\n original: [],\n };\n }\n });\n\n const results = await Promise.all(promises);\n const fieldsMap: AllRequiredFieldsMap = {};\n\n results.forEach(result => {\n fieldsMap[result.paymentMethod] = {\n fields: result.fields,\n original: result.original,\n };\n });\n return fieldsMap;\n};\n\nexport const getRequiredFieldsForMethod = (\n paymentMethod: PAYMENT_METHOD_ENUM,\n allRequiredFields: AllRequiredFieldsMap,\n): RequiredFieldsResult => {\n const storedFields = allRequiredFields[paymentMethod];\n if (storedFields) {\n return storedFields;\n } else {\n return {\n fields: [],\n original: [],\n };\n }\n};\n","@import '../../styles/variables.css';\n\n@media (max-width: 1024px) {\n .rebill-checkout-renewal {\n flex-direction: column;\n gap: 0;\n justify-content: flex-start;\n background: var(--rebill-color-background);\n padding: 20px;\n }\n .right-section .left-section {\n width: 100%;\n height: 100%;\n background: var(--rebill-color-background);\n }\n .checkout-form-section {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n gap: 24px;\n height: 100%;\n margin-top: 24px;\n }\n .otp-container {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n gap: 24px;\n }\n}\n\n@media (min-width: 1025px) {\n .rebill-checkout-renewal {\n width: 100vw;\n min-height: 100vh;\n display: flex;\n flex-direction: row;\n justify-content: center;\n overflow-y: auto;\n }\n\n .left-section {\n display: flex;\n width: 60%;\n background: var(--rebill-color-background-left);\n justify-content: space-around;\n }\n\n .right-section {\n display: flex;\n padding-top: 72px;\n width: 40%;\n background: var(--rebill-color-background-right);\n position: sticky;\n top: 0;\n\n justify-content: center;\n }\n\n .checkout-form-section {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n margin-bottom: 36px;\n margin-top: 24px;\n gap: 32px;\n }\n .left-section-container {\n max-width: 450px;\n min-width: 450px;\n margin: 2.5rem 2rem 1.5rem 2rem;\n display: flex;\n flex-direction: column;\n }\n\n .checkout-summary-section {\n max-width: 450px;\n min-width: 350px;\n margin: 0rem 2rem;\n background: var(--rebill-color-background-right);\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n width: 100%;\n }\n\n .checkout-form-section user-information,\n .checkout-form-section payment-method-selector,\n .checkout-form-section rebill-address,\n .checkout-summary-section rebill-summary {\n width: 100%;\n }\n\n /* Google Maps Autocomplete Styles */\n .pac-container {\n border-radius: 4px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);\n border: 1px solid #e0e0e0;\n margin-top: 4px;\n font-family: inherit;\n }\n\n .pac-item {\n padding: 10px 12px;\n cursor: pointer;\n border-top: none;\n }\n\n .pac-item:first-child {\n border-top: none;\n }\n\n .pac-item:hover {\n background-color: #f5f5f5;\n }\n\n .pac-item-query {\n font-weight: 500;\n }\n\n .pac-icon {\n display: none;\n }\n}\n\n.payment-button-container {\n display: flex;\n flex-direction: column;\n gap: 16px;\n margin-bottom: 16px;\n}\n/* Animaciones para componentes condicionales */\n.animated-component {\n transition: all 0.3s ease-in-out;\n overflow: visible;\n}\n\n/* Keep overflow hidden only for sliding height animations */\n/* .animated-component.slide-in {\n overflow: hidden;\n} */\n\n.fade-in {\n animation: fadeIn 0.4s ease-in-out;\n}\n\n.slide-in {\n animation: slideIn 0.5s ease-out;\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(-10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes slideIn {\n from {\n opacity: 0;\n transform: translateX(-20px);\n max-height: 0;\n }\n to {\n opacity: 1;\n transform: translateX(0);\n max-height: 450px;\n }\n}\n\n/* Animación para cuando se ocultan los componentes */\n.animated-component.hide {\n animation: fadeOut 0.3s ease-in-out forwards;\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(20px);\n }\n}\n\n/* Test Mode Chip Positioning */\nrebill-mode-sandbox {\n position: fixed;\n bottom: 50px;\n left: 50%;\n transform: translateX(-50%);\n z-index: 1000;\n}\n\n/* Ensure the chip is visible on all screen sizes */\n@media (max-width: 1024px) {\n rebill-test-mode-chip {\n bottom: 46px;\n }\n}\n\n@media (min-width: 1025px) {\n rebill-test-mode-chip {\n bottom: 46px;\n }\n}\n.mode-sandbox-mobile-container {\n display: flex;\n align-items: center;\n width: 100%;\n\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n}\n\n/* Desktop grande - mantener tamaños originales */\n@media (min-width: 1451px) {\n .left-section-container {\n min-width: 450px;\n margin: 2.5rem 5rem 1.5rem 5rem;\n }\n\n .checkout-summary-section {\n min-width: 450px;\n margin: 0rem 5rem;\n }\n}\n","import { Component, Event, EventEmitter, h, Listen, Prop, State } from '@stencil/core';\nimport * as yup from 'yup';\nimport { api, Country } from '../../api';\nimport { SavedCard } from '../../api/entities/cards/types';\nimport {\n CheckoutStatusE,\n CreateAPMCheckoutRequest,\n CreateAPMCheckoutResponse,\n CreateCardCheckoutRequest,\n} from '../../api/entities/checkout/types';\nimport '../../components/checkout/apm/apm-checkout/apm-checkout';\nimport '../../components/checkout/processing-payment/processing-payment';\nimport { I18nService } from '../../i18n/i18n.service';\nimport { ErrorCodeTypeE } from '../../models/enums/error-code-type.enum';\nimport { PaymentMethodNameE } from '../../models/enums/payment-method-name.enum';\nimport { PAYMENT_METHOD_ENUM } from '../../models/enums/payment-methods.enum';\nimport { PaymentStatusE } from '../../models/enums/payment-status.enum';\nimport { onChange as renewalOnChange, renewalState, RenewalStore } from '../../store/renewal.store';\nimport { BREAKPOINT_ENUM, getBreakpoint, isBreakpointBelow } from '../../utils/breakpoint';\nimport { COLORS_ENUM } from '../../utils/color-class-mapper';\nimport { generateIdempotencyKey } from '../../utils/generate-idempotency-key';\nimport { GoogleMapsService } from '../../utils/google-maps.service';\nimport { PaymentErrorMapper, PaymentErrorResponse } from '../../utils/payment-error-mapper';\nimport { PaymentMethodMapper } from '../../utils/payment-method-mapper';\nimport { getFieldValues, isFieldRequired } from '../../utils/required-fields-mappers';\nimport {\n AllRequiredFieldsMap,\n getAllRequiredFieldsRenewal,\n getRequiredFieldsForMethod,\n} from './utils/getRequiredFieldsRenewal';\n\n@Component({\n tag: 'rebill-renewal',\n styleUrl: 'rebill-renewal.css',\n shadow: false,\n})\nexport class RebillRenewal {\n @Prop() renewalData!: string;\n @Prop() renewalToken!: string;\n\n @State() currentPaymentMethod: PAYMENT_METHOD_ENUM = PAYMENT_METHOD_ENUM.CARD;\n @State() isSubmitting: boolean = false;\n @State() isCardSubmitting: boolean = false;\n @State() isCardSuccess: boolean = false;\n @State() errorMessage: PaymentErrorResponse | null = null;\n @State() breakpoint: BREAKPOINT_ENUM = BREAKPOINT_ENUM.DESKTOP;\n @State() errorPaymentCard: boolean = false;\n @State() errorPaymentAPM: boolean = false;\n @State() initialData: any = {};\n @State() checkoutResponse: CreateAPMCheckoutResponse | null = null;\n @State() currentApmPaymentMethod: PaymentMethodNameE | null = null;\n @State() countries: Country[] = [];\n @State() allRequiredFields: AllRequiredFieldsMap = {};\n @State() currentRequiredFields: string[] = [];\n @State() errorCardInvalid: boolean = false;\n @State() cardMode: 'input' | 'select' | null = 'select';\n\n @Event() success: EventEmitter<any>;\n @Event() paymentError: EventEmitter<any>;\n @Event() paymentMethodSelected: EventEmitter<PAYMENT_METHOD_ENUM>;\n\n private validationSchema = {\n 'phoneNumber': yup.string().when([], {\n is: () =>\n isFieldRequired('phoneNumber', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.phoneRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-country': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-country', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.countryRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-state': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-state', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.stateRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-address': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-address', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.addressRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-city': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-city', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.cityRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-zip': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-zip', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.zipRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'bankId': yup.string().when([], {\n is: () => isFieldRequired('bankId', this.currentRequiredFields),\n then: schema => schema.required('validation.bankRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'documentType': yup.string().when([], {\n is: () =>\n isFieldRequired('documentType', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.documentTypeRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'documentNumber': yup.string().when([], {\n is: () =>\n isFieldRequired('documentNumber', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema =>\n schema.required('validation.documentNumberRequired').min(7, 'validation.documentInvalid'),\n otherwise: schema => schema.notRequired(),\n }),\n };\n\n private resizeHandler = () => {\n this.breakpoint = getBreakpoint(window.innerWidth);\n };\n\n async componentWillLoad() {\n this.resizeHandler();\n window.addEventListener('resize', this.resizeHandler);\n\n const renewalProps =\n typeof this.renewalData === 'string' ? JSON.parse(this.renewalData) : this.renewalData;\n\n RenewalStore.initializeRenewal({\n ...renewalProps,\n token: this.renewalToken,\n });\n\n // Load Google Maps script for address autocomplete\n GoogleMapsService.loadGoogleMapsScript();\n\n // Load countries data\n try {\n const response = await api.data.getCountries();\n this.countries = response.data;\n } catch (error) {\n console.error('Error loading countries:', error);\n }\n\n // Load required fields data\n try {\n this.allRequiredFields = await getAllRequiredFieldsRenewal();\n } catch (error) {\n console.error('Error loading required fields:', error);\n }\n\n if (renewalState.data.paymentMethods.length > 0) {\n const firstPaymentMethod = renewalState.data.paymentMethods[0].type as PAYMENT_METHOD_ENUM;\n this.currentPaymentMethod = firstPaymentMethod;\n RenewalStore.setSelectedPaymentMethod(firstPaymentMethod);\n\n // Set required fields for the initial payment method\n try {\n this.currentRequiredFields = getRequiredFieldsForMethod(\n firstPaymentMethod,\n this.allRequiredFields,\n ).fields;\n } catch (error) {\n console.error('Error getting required fields for method:', error);\n }\n\n // Initialize fingerprint for the first payment method\n await this.initializeFingerprint(firstPaymentMethod);\n }\n\n this.initialData = this.getInitialData();\n\n this.cardMode = renewalState.cardMode;\n renewalOnChange('cardMode', () => {\n this.cardMode = renewalState.cardMode;\n });\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.resizeHandler);\n }\n\n @Listen('paymentMethodSelected')\n async handlePaymentMethodSelected(event: CustomEvent<PAYMENT_METHOD_ENUM>) {\n event.stopPropagation();\n\n if (this.currentPaymentMethod === event.detail) {\n return;\n }\n\n this.currentPaymentMethod = event.detail;\n RenewalStore.setSelectedPaymentMethod(this.currentPaymentMethod);\n\n // Change cardMode to 'input' if payment method is not CARD\n if (this.currentPaymentMethod !== PAYMENT_METHOD_ENUM.CARD) {\n this.cardMode = 'input';\n RenewalStore.setCardMode('input');\n }\n\n // Update required fields for the new payment method\n try {\n this.currentRequiredFields = getRequiredFieldsForMethod(\n this.currentPaymentMethod,\n this.allRequiredFields,\n ).fields;\n } catch (error) {\n console.error('Error getting required fields for method:', error);\n }\n\n // Note: Fingerprint is handled in componentWillLoad\n\n // Initialize fingerprint for the new payment method\n await this.initializeFingerprint(this.currentPaymentMethod);\n\n this.paymentMethodSelected.emit(event.detail);\n }\n\n private async initializeFingerprint(paymentMethod: PAYMENT_METHOD_ENUM) {\n // Only initialize fingerprint for card payments and if not already generated\n if (paymentMethod === PAYMENT_METHOD_ENUM.CARD && !renewalState.deviceId) {\n try {\n const uuid = crypto.randomUUID();\n const fingerprintResponse = await api.fingerPrint.getFingerPrint(uuid);\n RenewalStore.setDeviceId(uuid);\n const script = fingerprintResponse.result.script;\n const scriptElement = document.createElement('script');\n scriptElement.innerHTML = script;\n document.body.appendChild(scriptElement);\n } catch (error) {\n console.error('Failed to initialize fingerprint:', error);\n }\n }\n }\n\n @Listen('bankSelected')\n handleBankSelected(event: CustomEvent<string>) {\n event.stopPropagation();\n RenewalStore.setSelectedBankId(event.detail);\n }\n\n @Listen('cardSelected')\n handleCardSelected(event: CustomEvent<{ card: SavedCard; cvv?: string }>) {\n const { card, cvv } = event.detail;\n RenewalStore.setSelectedCard(card);\n RenewalStore.setCvv(cvv || '');\n }\n\n private get currentPaymentError(): boolean {\n if (this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n return this.errorPaymentCard;\n } else if (\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CASH ||\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER\n ) {\n return this.errorPaymentAPM;\n }\n return false;\n }\n\n private async handleSubmit(event?: CustomEvent) {\n if (this.isSubmitting) {\n return;\n }\n\n if (this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n await this.handleCardRenewal(event);\n } else {\n await this.handleAPMRenewal(event);\n }\n }\n\n private async handleCardRenewal(event?: CustomEvent) {\n const formData = event?.detail || this.getInitialData();\n\n if (!renewalState.data.cardId && !renewalState.data.cardTokenId) {\n this.errorCardInvalid = true;\n return;\n }\n if (!renewalState.data.cardInformation && !renewalState.data.cardId) {\n this.errorCardInvalid = true;\n return;\n }\n this.errorCardInvalid = false;\n this.isSubmitting = true;\n this.isCardSubmitting = true;\n RenewalStore.setLoading(true);\n\n try {\n const renewalRequest: CreateCardCheckoutRequest = {\n transaction: {\n quantity: 1,\n },\n ...(renewalState.data.cardId && { cardId: renewalState.data.cardId }),\n ...(renewalState.data.cardTokenId && { cardTokenId: renewalState.data.cardTokenId }),\n customAttributes: {\n ...(renewalState.deviceId && { deviceId: renewalState.deviceId }),\n },\n ...(this.cardMode === 'input' && {\n customer: {\n firstName:\n formData.fullName?.split(' ')[0] ||\n renewalState.data.subscription.customerName?.split(' ')[0],\n lastName:\n formData.fullName?.split(' ').slice(1).join(' ') ||\n renewalState.data.subscription.customerName?.split(' ').slice(1).join(' '),\n email: formData.email || renewalState.data.subscription.customerEmail,\n phone: {\n countryCode: formData.countryCodePhoneNumber || '',\n number: formData.phoneNumber || '',\n },\n },\n billingDetails: {\n address: {\n lineOne: formData['billing-address'] || '',\n city: formData['billing-city'] || '',\n state: formData['billing-state'] || '',\n country: formData['billing-country'] || '',\n zipCode: formData['billing-zip'] || '',\n },\n identification: {\n type: formData.documentType || '',\n value: formData.documentNumber || '',\n },\n },\n }),\n };\n\n const idempotencyKey = generateIdempotencyKey();\n const response = await api.checkout.createCardCheckoutRequest(\n renewalState.data.id,\n idempotencyKey,\n renewalRequest,\n renewalState.token,\n );\n\n this.isSubmitting = false;\n this.isCardSubmitting = false;\n RenewalStore.setLoading(false);\n RenewalStore.setCheckoutResponse(response.data);\n\n if (response.data.result?.status.toUpperCase() === CheckoutStatusE.APPROVED) {\n this.isCardSuccess = true;\n } else {\n this.isCardSuccess = false;\n this.errorPaymentCard = true;\n this.errorMessage = {\n message: response.data.error?.error?.message as PaymentStatusE,\n type: response.data.error?.error?.type as ErrorCodeTypeE,\n };\n }\n } catch (error: any) {\n this.isSubmitting = false;\n this.isCardSubmitting = false;\n RenewalStore.setLoading(false);\n\n this.errorPaymentCard = true;\n this.errorMessage = {\n message: error.data?.error?.message,\n type: error.data?.error?.type,\n };\n }\n }\n\n private async handleAPMRenewal(event?: CustomEvent) {\n this.isSubmitting = true;\n RenewalStore.setLoading(true);\n\n try {\n const apmPaymentMethod = PaymentMethodMapper.mapToAPMPaymentMethod(\n this.currentPaymentMethod,\n renewalState.data.price.country,\n );\n\n // Get form data for billing details and customer info\n const formData = event?.detail || this.getFormData();\n\n // Transform form data to match CreateAPMCheckoutRequest structure\n const billingDetails = {\n address: {\n country: formData['billing-country'],\n state: formData['billing-state'] || '',\n city: formData['billing-city'] || '',\n zipCode: formData['billing-zip'] || '',\n lineOne: formData['billing-address'] || '',\n },\n identification: {\n type: formData.documentType || 'dni',\n value: formData.documentNumber || '',\n },\n };\n\n const renewalRequest: CreateAPMCheckoutRequest = {\n transaction: {\n quantity: 1,\n },\n method: apmPaymentMethod,\n billingDetails,\n redirect: {\n approved: window.location.origin + '/renewal/success',\n rejected: window.location.origin + '/renewal/failure',\n },\n paymentMetadata: {\n orderId: renewalState.data.id,\n source: 'renewal-web',\n },\n customAttributes: {\n bank: formData.bankId || '',\n },\n // Remove targetCurrency for PSE payments as it's not supported\n ...(apmPaymentMethod !== PaymentMethodNameE.CO_TRANSFERENCE_PSE && {\n targetCurrency: renewalState.data.price.currency,\n }),\n };\n\n // Add customer data for renewal\n renewalRequest.customer = {\n firstName:\n formData.fullName?.split(' ')[0] ||\n renewalState.data.subscription.customerName.split(' ')[0] ||\n '',\n lastName:\n formData.fullName?.split(' ').slice(1).join(' ') ||\n renewalState.data.subscription.customerName.split(' ').slice(1).join(' ') ||\n '',\n email: formData.email || renewalState.data.subscription.customerEmail,\n phone: {\n countryCode: formData.countryCodePhoneNumber || '',\n number: formData.phoneNumber || '',\n },\n };\n\n const idempotencyKey = generateIdempotencyKey();\n const response = await api.checkout.createAPMCheckoutRequest(\n renewalState.data.id,\n idempotencyKey,\n renewalRequest,\n );\n\n this.isSubmitting = false;\n RenewalStore.setLoading(false);\n RenewalStore.setCheckoutResponse(response.data);\n this.checkoutResponse = response.data;\n if (response.data.result?.status.toUpperCase() === CheckoutStatusE.APPROVED) {\n this.isCardSuccess = true;\n } else {\n this.paymentError.emit(response.data);\n RenewalStore.setCheckoutResponse(response.data);\n this.errorPaymentAPM = true;\n\n this.errorMessage = {\n alertTitle: response.data?.error?.message as PaymentStatusE,\n message: response.data.error?.message as PaymentStatusE,\n type: response.data.error?.type as ErrorCodeTypeE,\n paymentMethod: this.currentPaymentMethod,\n };\n }\n } catch (error: any) {\n this.isSubmitting = false;\n RenewalStore.setLoading(false);\n this.paymentError.emit(error);\n this.errorPaymentAPM = true;\n\n this.errorMessage = {\n alertTitle: error.data?.error?.message as PaymentStatusE,\n message: error.data?.error?.message,\n type: error.data?.error?.type,\n paymentMethod: this.currentPaymentMethod,\n };\n }\n }\n\n private getFormData = () => {\n return this.initialData;\n };\n\n private getInitialData = () => {\n return {\n 'email': renewalState.data.subscription.customerEmail,\n 'fullName': renewalState.data.subscription.customerName,\n 'card': '',\n 'billing-country': '',\n 'billing-state': '',\n 'billing-address': '',\n 'billing-city': '',\n 'billing-zip': '',\n 'bankId': '',\n 'phoneNumber': '',\n 'countryCodePhoneNumber': '',\n 'documentType': '',\n 'documentNumber': '',\n };\n };\n\n private hasPrefilledAddress = () => {\n const billingFields = [\n 'billing-country',\n 'billing-state',\n 'billing-address',\n 'billing-city',\n 'billing-zip',\n ];\n return billingFields.some(key => {\n const value = this.initialData[key];\n return value && value.trim() !== '';\n });\n };\n\n private getPaymentDate = (): string => {\n const payment = renewalState.form.checkoutResponse;\n if (!payment) return '';\n\n if ('date' in payment) {\n return payment.date as string;\n }\n\n return '';\n };\n\n private getReferenceNumber = (): string => {\n const payment = renewalState.form.checkoutResponse;\n if (!payment) return '';\n if ('traceId' in payment) {\n return payment.traceId as string;\n }\n\n return '';\n };\n\n render() {\n if (!renewalState.isInitialized) {\n return <div class=\"loading\">{I18nService.translate('renewal.loading')}</div>;\n }\n\n const renderRenewalSummary = props => (\n <renewal-summary\n totalAmount={renewalState.data.price.amount}\n currency={renewalState.data.price.currency}\n subscriptionTitle={renewalState.data.subscription.name[0]?.text || 'Subscription'}\n subscriptionAmount={renewalState.data.subscription.amount}\n nextChargeDate={renewalState.data.subscription.nextChargeDate}\n frequency={renewalState.data.subscription.frequency}\n {...props}\n />\n );\n\n return (\n <>\n <rebill-processing-payment style={{ display: this.isCardSubmitting ? 'block' : 'none' }} />\n {this.isCardSuccess ? (\n <renewal-success-page\n typePaymentMethod={this.currentPaymentMethod}\n paymentDate={this.getPaymentDate()}\n referenceNumber={this.getReferenceNumber()}\n cardLastFour={renewalState.data.subscription.cardLastFour}\n country={renewalState.data.price.country}\n paymentMethodName={PaymentMethodMapper.mapToAPMPaymentMethod(\n this.currentPaymentMethod,\n renewalState.data?.price?.country,\n )}\n bank={renewalState.form?.selectedBankId || ''}\n />\n ) : (\n <rebill-checkout-form\n style={{ display: this.isCardSubmitting || this.isCardSuccess ? 'none' : 'block' }}\n validationSchema={this.validationSchema}\n initialData={this.initialData}\n onSubmit={(args: any) => this.handleSubmit(args)}\n renderForm={({ submit, formData, errors }) => (\n <div class=\"rebill-checkout-renewal\">\n <div class=\"left-section\">\n <div class=\"left-section-container\">\n <organization-logo organization={renewalState.data.organization} />\n\n <div class=\"checkout-form-section\">\n {/* Customer Information - Readonly */}\n <user-information-static\n userInfo={{\n customerName: renewalState.data.subscription.customerName,\n customerEmail: renewalState.data.subscription.customerEmail,\n }}\n />\n\n {isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n renderRenewalSummary({\n displayedComponents: 'header',\n })}\n\n {isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n renderRenewalSummary({\n displayedComponents: 'details',\n })}\n\n {/* Payment Method Selection */}\n <div style={{ display: 'flex', flexDirection: 'column', gap: '32px' }}>\n <payment-method-selector\n enabledPaymentMethods={[\n ...new Set(\n renewalState.data.paymentMethods.map(\n pm => pm.type as PAYMENT_METHOD_ENUM,\n ),\n ),\n ]}\n defaultSelected={this.currentPaymentMethod}\n errorComponent={{\n showErrorComponent: this.currentPaymentError,\n message: PaymentErrorMapper.getErrorMessage(this.errorMessage),\n }}\n cardError={{\n showCardInvalid: this.errorCardInvalid,\n type: null,\n }}\n country={renewalState.data.price.country}\n documentTypeError={errors?.documentType}\n documentNumberError={errors?.documentNumber}\n showDocument={\n this.cardMode === 'input' &&\n (isFieldRequired('documentType', this.currentRequiredFields) ||\n isFieldRequired('documentNumber', this.currentRequiredFields))\n }\n />\n {/* Alert for non-card payment methods */}\n {this.currentPaymentMethod !== PAYMENT_METHOD_ENUM.CARD && (\n <rebill-alert\n type=\"info\"\n message={I18nService.translate('renewal.paymentMethodAlert', {\n cardLastFour: renewalState.data.subscription.cardLastFour || '****',\n })}\n icon=\"calendar-edit\"\n variant=\"outlined\"\n colorIcon={COLORS_ENUM.PRIMARY}\n />\n )}\n {this.cardMode === 'input' &&\n isFieldRequired('bankId', this.currentRequiredFields) && (\n <div class=\"animated-component fade-in\">\n <rebill-bank-selector\n banks={\n getFieldValues(\n 'bank',\n this.allRequiredFields[this.currentPaymentMethod]?.original,\n ) || []\n }\n defaultSelectedBankId={formData.bankId || ''}\n error={errors?.bankId}\n />\n </div>\n )}\n </div>\n {this.cardMode === 'input' &&\n (isFieldRequired('billing-country', this.currentRequiredFields) ||\n isFieldRequired('billing-state', this.currentRequiredFields) ||\n isFieldRequired('billing-address', this.currentRequiredFields) ||\n isFieldRequired('billing-city', this.currentRequiredFields) ||\n isFieldRequired('billing-zip', this.currentRequiredFields)) && (\n <div class=\"animated-component slide-in\">\n <rebill-address\n countryOptions={this.countries.map(country => ({\n label: country.country,\n value: country.isoCountryCode,\n }))}\n billingView={this.hasPrefilledAddress() ? 'form' : 'search'}\n errors={{\n 'billing-country': errors['billing-country'],\n 'billing-state': errors['billing-state'],\n 'billing-address': errors['billing-address'],\n 'billing-city': errors['billing-city'],\n 'billing-zip': errors['billing-zip'],\n }}\n />\n </div>\n )}\n {this.cardMode === 'input' &&\n isFieldRequired('phoneNumber', this.currentRequiredFields) && (\n <div class=\"animated-component fade-in\">\n <user-information-phone error={errors?.phoneNumber} />\n </div>\n )}\n\n {/* Show APM checkout response after successful payment submission */}\n {this.checkoutResponse?.result &&\n (this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CASH ||\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER) && (\n <apm-checkout\n paymentMethod={this.currentPaymentMethod}\n referenceId={\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CASH\n ? this.checkoutResponse.result.data.referenceId\n : undefined\n }\n qrCodeData={\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER\n ? this.checkoutResponse.result.data.qrCode\n : undefined\n }\n providerName={renewalState.data.organization?.name || ''}\n expirationDate={(() => {\n const expirationDate = new Date();\n expirationDate.setDate(expirationDate.getDate() + 30);\n return expirationDate.toISOString();\n })()}\n country={renewalState.data.price.country}\n redirectUrl={this.checkoutResponse.result.data.url}\n />\n )}\n\n {isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n renderRenewalSummary({\n displayedComponents: 'summary',\n })}\n\n <div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>\n {/* Payment Button */}\n <payment-button\n paymentMethod={this.currentPaymentMethod}\n isLoading={this.isSubmitting}\n isRenewal={true}\n trialPeriodDays={renewalState.data.subscription.trialPeriodDays}\n redirectUrl={!!this.checkoutResponse?.result?.data?.url}\n timeToRedirect={5000}\n country={renewalState.data.price.country}\n isDisabled={renewalState.fetchingInstallments}\n onSubmit={() => submit()}\n />\n\n {/* Disabled Button Below */}\n <rebill-alert\n type=\"secure\"\n variant=\"variant-secure\"\n icon=\"lock-outline\"\n message={I18nService.translate('otp.secureMessage')}\n />\n </div>\n </div>\n <rebill-footer />\n </div>\n </div>\n\n {/* Desktop Summary */}\n {!isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <div class=\"right-section\">\n <div class=\"checkout-summary-section\">\n {renderRenewalSummary({\n displayedComponents: ['header', 'details', 'summary'],\n })}\n </div>\n </div>\n )}\n </div>\n )}\n />\n )}\n </>\n );\n }\n}\n"],"mappings":"8kBAeA,MAAMA,EAAoBC,MACxBC,EACAC,EACAC,KAEA,MAAMC,QAA+BC,EAAIC,SAASP,kBAChD,CACEE,WACAC,UAEFC,GAGF,MAAO,CACLI,OAAQC,EAAkBJ,EAAuBK,MACjDC,SAAUN,EAAuBK,KAClC,EAGI,MAAME,EAA8BX,UACzC,MAAMY,EAAiB,IAClB,IAAIC,IAAIC,EAAaL,KAAKG,eAAeG,KAAIC,GAAMA,EAAGC,SAE3D,MAAMC,EAAWN,EAAeG,KAAIf,MAAMmB,IACxC,IACE,MAAMC,EAAmBC,EAAoBC,sBAC3CH,EACAL,EAAaL,KAAKc,MAAMC,SAG1B,MAAMC,QAAe1B,EACnBe,EAAaL,KAAKc,MAAMtB,SACxBmB,EACAN,EAAaL,KAAKiB,aAAaC,IAGjC,MAAO,CAC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MG,MAIlB1B,EACE,gBAAA/L,KAAK,SACL4O,QAAQ,iBACRD,KAAK,eACL1E,QAASgC,EAAYC,UAAU,yBAIrCH,EAAA,yBAKF6B,EAAkBvK,KAAKrB,WAAYC,EAAgBC,UACnD6J,EAAK,OAAAC,MAAM,iBACTD,EAAA,OAAKC,MAAM,4BACRG,EAAqB,CACpB0B,oBAAqB,CAAC,SAAU,UAAW,kB","ignoreList":[]}
1
+ {"version":3,"names":["getRequiredFields","async","currency","method","organizationId","requiredFieldsResponse","api","checkout","fields","mapRequiredFields","data","original","getAllRequiredFieldsRenewal","paymentMethods","Set","renewalState","map","pm","type","promises","paymentMethod","apiPaymentMethod","PaymentMethodMapper","mapToAPMPaymentMethod","price","country","result","organization","id","error","console","results","Promise","all","fieldsMap","forEach","getRequiredFieldsForMethod","allRequiredFields","storedFields","rebillRenewalCss","RebillRenewal","renewalData","renewalToken","currentPaymentMethod","PAYMENT_METHOD_ENUM","CARD","isSubmitting","isCardSubmitting","isCardSuccess","errorMessage","breakpoint","BREAKPOINT_ENUM","DESKTOP","errorPaymentCard","errorPaymentAPM","initialData","checkoutResponse","currentApmPaymentMethod","countries","currentRequiredFields","errorCardInvalid","cardMode","success","paymentError","paymentMethodSelected","validationSchema","phoneNumber","yup.string","when","is","isFieldRequired","this","then","schema","required","otherwise","notRequired","bankId","documentType","documentNumber","min","resizeHandler","getBreakpoint","window","innerWidth","componentWillLoad","addEventListener","renewalProps","JSON","parse","RenewalStore","initializeRenewal","token","GoogleMapsService","loadGoogleMapsScript","response","getCountries","length","firstPaymentMethod","setSelectedPaymentMethod","initializeFingerprint","getInitialData","renewalOnChange","disconnectedCallback","removeEventListener","handlePaymentMethodSelected","event","stopPropagation","detail","setCardMode","emit","deviceId","uuid","crypto","randomUUID","fingerprintResponse","fingerPrint","getFingerPrint","setDeviceId","script","scriptElement","document","createElement","innerHTML","body","appendChild","handleBankSelected","setSelectedBankId","handleCardSelected","card","cvv","setSelectedCard","setCvv","currentPaymentError","CASH","BANK_TRANSFER","handleSubmit","handleCardRenewal","handleAPMRenewal","formData","cardId","cardTokenId","cardInformation","setLoading","renewalRequest","transaction","quantity","customAttributes","customer","firstName","fullName","split","subscription","customerName","lastName","slice","join","email","customerEmail","phone","countryCode","countryCodePhoneNumber","number","billingDetails","address","lineOne","city","state","zipCode","identification","value","idempotencyKey","generateIdempotencyKey","createCardCheckoutRequest","setCheckoutResponse","status","toUpperCase","CheckoutStatusE","APPROVED","message","apmPaymentMethod","getFormData","redirect","approved","location","origin","rejected","paymentMetadata","orderId","source","bank","PaymentMethodNameE","CO_TRANSFERENCE_PSE","targetCurrency","createAPMCheckoutRequest","alertTitle","hasPrefilledAddress","billingFields","some","key","trim","getPaymentDate","payment","form","date","getReferenceNumber","traceId","render","isInitialized","h","class","I18nService","translate","renderRenewalSummary","props","totalAmount","amount","subscriptionTitle","name","text","subscriptionAmount","nextChargeDate","frequency","Fragment","style","display","typePaymentMethod","paymentDate","referenceNumber","cardLastFour","paymentMethodName","selectedBankId","onSubmit","args","renderForm","submit","errors","userInfo","isBreakpointBelow","displayedComponents","flexDirection","gap","enabledPaymentMethods","defaultSelected","errorComponent","showErrorComponent","PaymentErrorMapper","getErrorMessage","cardError","showCardInvalid","documentTypeError","documentNumberError","showDocument","icon","variant","colorIcon","COLORS_ENUM","PRIMARY","banks","getFieldValues","defaultSelectedBankId","countryOptions","label","isoCountryCode","billingView","referenceId","undefined","qrCodeData","qrCode","providerName","expirationDate","Date","setDate","getDate","toISOString","redirectUrl","url","isLoading","isRenewal","trialPeriodDays","timeToRedirect","isDisabled","fetchingInstallments"],"sources":["src/components/renewal/utils/getRequiredFieldsRenewal.ts","src/components/renewal/rebill-renewal.css?tag=rebill-renewal","src/components/renewal/rebill-renewal.tsx"],"sourcesContent":["import { api } from '../../../api';\nimport { PAYMENT_METHOD_ENUM } from '../../../models/enums/payment-methods.enum';\nimport { renewalState } from '../../../store/renewal.store';\nimport { PaymentMethodMapper } from '../../../utils/payment-method-mapper';\nimport { mapRequiredFields, RequiredField } from '../../../utils/required-fields-mappers';\n\nexport interface RequiredFieldsResult {\n fields: string[];\n original: RequiredField[];\n}\n\nexport interface AllRequiredFieldsMap {\n [key: string]: RequiredFieldsResult;\n}\n\nconst getRequiredFields = async (\n currency: string,\n method: string,\n organizationId: string,\n): Promise<RequiredFieldsResult> => {\n const requiredFieldsResponse = await api.checkout.getRequiredFields(\n {\n currency,\n method,\n },\n organizationId,\n );\n\n return {\n fields: mapRequiredFields(requiredFieldsResponse.data),\n original: requiredFieldsResponse.data,\n };\n};\n\nexport const getAllRequiredFieldsRenewal = async (): Promise<AllRequiredFieldsMap> => {\n const paymentMethods = [\n ...new Set(renewalState.data.paymentMethods.map(pm => pm.type as PAYMENT_METHOD_ENUM)),\n ];\n const promises = paymentMethods.map(async paymentMethod => {\n try {\n const apiPaymentMethod = PaymentMethodMapper.mapToAPMPaymentMethod(\n paymentMethod,\n renewalState.data.price.country,\n );\n\n const result = await getRequiredFields(\n renewalState.data.price.currency,\n apiPaymentMethod,\n renewalState.data.organization.id,\n );\n\n return {\n paymentMethod,\n ...result,\n };\n } catch (error) {\n console.error(`Error getting required fields for ${paymentMethod}:`, error);\n return {\n paymentMethod,\n fields: [],\n original: [],\n };\n }\n });\n\n const results = await Promise.all(promises);\n const fieldsMap: AllRequiredFieldsMap = {};\n\n results.forEach(result => {\n fieldsMap[result.paymentMethod] = {\n fields: result.fields,\n original: result.original,\n };\n });\n return fieldsMap;\n};\n\nexport const getRequiredFieldsForMethod = (\n paymentMethod: PAYMENT_METHOD_ENUM,\n allRequiredFields: AllRequiredFieldsMap,\n): RequiredFieldsResult => {\n const storedFields = allRequiredFields[paymentMethod];\n if (storedFields) {\n return storedFields;\n } else {\n return {\n fields: [],\n original: [],\n };\n }\n};\n","@import '../../styles/variables.css';\n\n@media (max-width: 1024px) {\n .rebill-checkout-renewal {\n flex-direction: column;\n gap: 0;\n justify-content: flex-start;\n background: var(--rebill-color-background);\n padding: 20px;\n }\n .right-section .left-section {\n width: 100%;\n height: 100%;\n background: var(--rebill-color-background);\n }\n .checkout-form-section {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n gap: 24px;\n height: 100%;\n margin-top: 24px;\n }\n .otp-container {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n gap: 24px;\n }\n}\n\n@media (min-width: 1025px) {\n .rebill-checkout-renewal {\n width: 100vw;\n min-height: 100vh;\n display: flex;\n flex-direction: row;\n justify-content: center;\n overflow-y: auto;\n }\n\n .left-section {\n display: flex;\n width: 60%;\n background: var(--rebill-color-background-left);\n justify-content: space-around;\n }\n\n .right-section {\n display: flex;\n padding-top: 72px;\n width: 40%;\n background: var(--rebill-color-background-right);\n position: sticky;\n top: 0;\n\n justify-content: center;\n }\n\n .checkout-form-section {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n margin-bottom: 36px;\n margin-top: 24px;\n gap: 32px;\n }\n .left-section-container {\n max-width: 450px;\n min-width: 450px;\n margin: 2.5rem 2rem 1.5rem 2rem;\n display: flex;\n flex-direction: column;\n }\n\n .checkout-summary-section {\n max-width: 450px;\n min-width: 350px;\n margin: 0rem 2rem;\n background: var(--rebill-color-background-right);\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n width: 100%;\n }\n\n .checkout-form-section user-information,\n .checkout-form-section payment-method-selector,\n .checkout-form-section rebill-address,\n .checkout-summary-section rebill-summary {\n width: 100%;\n }\n\n /* Google Maps Autocomplete Styles */\n .pac-container {\n border-radius: 4px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);\n border: 1px solid #e0e0e0;\n margin-top: 4px;\n font-family: inherit;\n }\n\n .pac-item {\n padding: 10px 12px;\n cursor: pointer;\n border-top: none;\n }\n\n .pac-item:first-child {\n border-top: none;\n }\n\n .pac-item:hover {\n background-color: #f5f5f5;\n }\n\n .pac-item-query {\n font-weight: 500;\n }\n\n .pac-icon {\n display: none;\n }\n}\n\n.payment-button-container {\n display: flex;\n flex-direction: column;\n gap: 16px;\n margin-bottom: 16px;\n}\n/* Animaciones para componentes condicionales */\n.animated-component {\n transition: all 0.3s ease-in-out;\n overflow: visible;\n}\n\n/* Keep overflow hidden only for sliding height animations */\n/* .animated-component.slide-in {\n overflow: hidden;\n} */\n\n.fade-in {\n animation: fadeIn 0.4s ease-in-out;\n}\n\n.slide-in {\n animation: slideIn 0.5s ease-out;\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(-10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes slideIn {\n from {\n opacity: 0;\n transform: translateX(-20px);\n max-height: 0;\n }\n to {\n opacity: 1;\n transform: translateX(0);\n max-height: 450px;\n }\n}\n\n/* Animación para cuando se ocultan los componentes */\n.animated-component.hide {\n animation: fadeOut 0.3s ease-in-out forwards;\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(20px);\n }\n}\n\n/* Test Mode Chip Positioning */\nrebill-mode-sandbox {\n position: fixed;\n bottom: 50px;\n left: 50%;\n transform: translateX(-50%);\n z-index: 1000;\n}\n\n/* Ensure the chip is visible on all screen sizes */\n@media (max-width: 1024px) {\n rebill-test-mode-chip {\n bottom: 46px;\n }\n}\n\n@media (min-width: 1025px) {\n rebill-test-mode-chip {\n bottom: 46px;\n }\n}\n.mode-sandbox-mobile-container {\n display: flex;\n align-items: center;\n width: 100%;\n\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n}\n\n/* Desktop grande - mantener tamaños originales */\n@media (min-width: 1451px) {\n .left-section-container {\n min-width: 450px;\n margin: 2.5rem 5rem 1.5rem 5rem;\n }\n\n .checkout-summary-section {\n min-width: 450px;\n margin: 0rem 5rem;\n }\n}\n","import { Component, Event, EventEmitter, h, Listen, Prop, State } from '@stencil/core';\nimport * as yup from 'yup';\nimport { api, Country } from '../../api';\nimport { SavedCard } from '../../api/entities/cards/types';\nimport {\n CheckoutStatusE,\n CreateAPMCheckoutRequest,\n CreateAPMCheckoutResponse,\n CreateCardCheckoutRequest,\n} from '../../api/entities/checkout/types';\nimport '../../components/checkout/apm/apm-checkout/apm-checkout';\nimport '../../components/checkout/processing-payment/processing-payment';\nimport { I18nService } from '../../i18n/i18n.service';\nimport { ErrorCodeTypeE } from '../../models/enums/error-code-type.enum';\nimport { PaymentMethodNameE } from '../../models/enums/payment-method-name.enum';\nimport { PAYMENT_METHOD_ENUM } from '../../models/enums/payment-methods.enum';\nimport { PaymentStatusE } from '../../models/enums/payment-status.enum';\nimport { onChange as renewalOnChange, renewalState, RenewalStore } from '../../store/renewal.store';\nimport { BREAKPOINT_ENUM, getBreakpoint, isBreakpointBelow } from '../../utils/breakpoint';\nimport { COLORS_ENUM } from '../../utils/color-class-mapper';\nimport { generateIdempotencyKey } from '../../utils/generate-idempotency-key';\nimport { GoogleMapsService } from '../../utils/google-maps.service';\nimport { PaymentErrorMapper, PaymentErrorResponse } from '../../utils/payment-error-mapper';\nimport { PaymentMethodMapper } from '../../utils/payment-method-mapper';\nimport { getFieldValues, isFieldRequired } from '../../utils/required-fields-mappers';\nimport {\n AllRequiredFieldsMap,\n getAllRequiredFieldsRenewal,\n getRequiredFieldsForMethod,\n} from './utils/getRequiredFieldsRenewal';\n\n@Component({\n tag: 'rebill-renewal',\n styleUrl: 'rebill-renewal.css',\n shadow: false,\n})\nexport class RebillRenewal {\n @Prop() renewalData!: string;\n @Prop() renewalToken!: string;\n\n @State() currentPaymentMethod: PAYMENT_METHOD_ENUM = PAYMENT_METHOD_ENUM.CARD;\n @State() isSubmitting: boolean = false;\n @State() isCardSubmitting: boolean = false;\n @State() isCardSuccess: boolean = false;\n @State() errorMessage: PaymentErrorResponse | null = null;\n @State() breakpoint: BREAKPOINT_ENUM = BREAKPOINT_ENUM.DESKTOP;\n @State() errorPaymentCard: boolean = false;\n @State() errorPaymentAPM: boolean = false;\n @State() initialData: any = {};\n @State() checkoutResponse: CreateAPMCheckoutResponse | null = null;\n @State() currentApmPaymentMethod: PaymentMethodNameE | null = null;\n @State() countries: Country[] = [];\n @State() allRequiredFields: AllRequiredFieldsMap = {};\n @State() currentRequiredFields: string[] = [];\n @State() errorCardInvalid: boolean = false;\n @State() cardMode: 'input' | 'select' | null = 'select';\n\n @Event() success: EventEmitter<any>;\n @Event() paymentError: EventEmitter<any>;\n @Event() paymentMethodSelected: EventEmitter<PAYMENT_METHOD_ENUM>;\n\n private validationSchema = {\n 'phoneNumber': yup.string().when([], {\n is: () =>\n isFieldRequired('phoneNumber', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.phoneRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-country': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-country', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.countryRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-state': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-state', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.stateRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-address': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-address', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.addressRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-city': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-city', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.cityRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'billing-zip': yup.string().when([], {\n is: () =>\n isFieldRequired('billing-zip', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.zipRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'bankId': yup.string().when([], {\n is: () => isFieldRequired('bankId', this.currentRequiredFields),\n then: schema => schema.required('validation.bankRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'documentType': yup.string().when([], {\n is: () =>\n isFieldRequired('documentType', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema => schema.required('validation.documentTypeRequired'),\n otherwise: schema => schema.notRequired(),\n }),\n 'documentNumber': yup.string().when([], {\n is: () =>\n isFieldRequired('documentNumber', this.currentRequiredFields) && this.cardMode === 'input',\n then: schema =>\n schema.required('validation.documentNumberRequired').min(7, 'validation.documentInvalid'),\n otherwise: schema => schema.notRequired(),\n }),\n };\n\n private resizeHandler = () => {\n this.breakpoint = getBreakpoint(window.innerWidth);\n };\n\n async componentWillLoad() {\n this.resizeHandler();\n window.addEventListener('resize', this.resizeHandler);\n\n const renewalProps =\n typeof this.renewalData === 'string' ? JSON.parse(this.renewalData) : this.renewalData;\n\n RenewalStore.initializeRenewal({\n ...renewalProps,\n token: this.renewalToken,\n });\n\n // Load Google Maps script for address autocomplete\n GoogleMapsService.loadGoogleMapsScript();\n\n // Load countries data\n try {\n const response = await api.data.getCountries();\n this.countries = response.data;\n } catch (error) {\n console.error('Error loading countries:', error);\n }\n\n // Load required fields data\n try {\n this.allRequiredFields = await getAllRequiredFieldsRenewal();\n } catch (error) {\n console.error('Error loading required fields:', error);\n }\n\n if (renewalState.data.paymentMethods.length > 0) {\n const firstPaymentMethod = renewalState.data.paymentMethods[0].type as PAYMENT_METHOD_ENUM;\n this.currentPaymentMethod = firstPaymentMethod;\n RenewalStore.setSelectedPaymentMethod(firstPaymentMethod);\n\n // Set required fields for the initial payment method\n try {\n this.currentRequiredFields = getRequiredFieldsForMethod(\n firstPaymentMethod,\n this.allRequiredFields,\n ).fields;\n } catch (error) {\n console.error('Error getting required fields for method:', error);\n }\n\n // Initialize fingerprint for the first payment method\n await this.initializeFingerprint(firstPaymentMethod);\n }\n\n this.initialData = this.getInitialData();\n\n this.cardMode = renewalState.cardMode;\n renewalOnChange('cardMode', () => {\n this.cardMode = renewalState.cardMode;\n });\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.resizeHandler);\n }\n\n @Listen('paymentMethodSelected')\n async handlePaymentMethodSelected(event: CustomEvent<PAYMENT_METHOD_ENUM>) {\n event.stopPropagation();\n\n if (this.currentPaymentMethod === event.detail) {\n return;\n }\n\n this.currentPaymentMethod = event.detail;\n RenewalStore.setSelectedPaymentMethod(this.currentPaymentMethod);\n\n // Change cardMode to 'input' if payment method is not CARD\n if (this.currentPaymentMethod !== PAYMENT_METHOD_ENUM.CARD) {\n this.cardMode = 'input';\n RenewalStore.setCardMode('input');\n }\n\n // Update required fields for the new payment method\n try {\n this.currentRequiredFields = getRequiredFieldsForMethod(\n this.currentPaymentMethod,\n this.allRequiredFields,\n ).fields;\n } catch (error) {\n console.error('Error getting required fields for method:', error);\n }\n\n // Note: Fingerprint is handled in componentWillLoad\n\n // Initialize fingerprint for the new payment method\n await this.initializeFingerprint(this.currentPaymentMethod);\n\n this.paymentMethodSelected.emit(event.detail);\n }\n\n private async initializeFingerprint(paymentMethod: PAYMENT_METHOD_ENUM) {\n // Only initialize fingerprint for card payments and if not already generated\n if (paymentMethod === PAYMENT_METHOD_ENUM.CARD && !renewalState.deviceId) {\n try {\n const uuid = crypto.randomUUID();\n const fingerprintResponse = await api.fingerPrint.getFingerPrint(uuid);\n RenewalStore.setDeviceId(uuid);\n const script = fingerprintResponse.result.script;\n const scriptElement = document.createElement('script');\n scriptElement.innerHTML = script;\n document.body.appendChild(scriptElement);\n } catch (error) {\n console.error('Failed to initialize fingerprint:', error);\n }\n }\n }\n\n @Listen('bankSelected')\n handleBankSelected(event: CustomEvent<string>) {\n event.stopPropagation();\n RenewalStore.setSelectedBankId(event.detail);\n }\n\n @Listen('cardSelected')\n handleCardSelected(event: CustomEvent<{ card: SavedCard; cvv?: string }>) {\n const { card, cvv } = event.detail;\n RenewalStore.setSelectedCard(card);\n RenewalStore.setCvv(cvv || '');\n }\n\n private get currentPaymentError(): boolean {\n if (this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n return this.errorPaymentCard;\n } else if (\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CASH ||\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER\n ) {\n return this.errorPaymentAPM;\n }\n return false;\n }\n\n private async handleSubmit(event?: CustomEvent) {\n if (this.isSubmitting) {\n return;\n }\n\n if (this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CARD) {\n await this.handleCardRenewal(event);\n } else {\n await this.handleAPMRenewal(event);\n }\n }\n\n private async handleCardRenewal(event?: CustomEvent) {\n const formData = event?.detail || this.getInitialData();\n\n if (!renewalState.data.cardId && !renewalState.data.cardTokenId) {\n this.errorCardInvalid = true;\n return;\n }\n if (!renewalState.data.cardInformation && !renewalState.data.cardId) {\n this.errorCardInvalid = true;\n return;\n }\n this.errorCardInvalid = false;\n this.isSubmitting = true;\n this.isCardSubmitting = true;\n RenewalStore.setLoading(true);\n\n try {\n const renewalRequest: CreateCardCheckoutRequest = {\n transaction: {\n quantity: 1,\n },\n ...(renewalState.data.cardId && { cardId: renewalState.data.cardId }),\n ...(renewalState.data.cardTokenId && { cardTokenId: renewalState.data.cardTokenId }),\n customAttributes: {\n ...(renewalState.deviceId && { deviceId: renewalState.deviceId }),\n },\n ...(this.cardMode === 'input' && {\n customer: {\n firstName:\n formData.fullName?.split(' ')[0] ||\n renewalState.data.subscription.customerName?.split(' ')[0],\n lastName:\n formData.fullName?.split(' ').slice(1).join(' ') ||\n renewalState.data.subscription.customerName?.split(' ').slice(1).join(' '),\n email: formData.email || renewalState.data.subscription.customerEmail,\n phone: {\n countryCode: formData.countryCodePhoneNumber || '',\n number: formData.phoneNumber || '',\n },\n },\n billingDetails: {\n address: {\n lineOne: formData['billing-address'] || '',\n city: formData['billing-city'] || '',\n state: formData['billing-state'] || '',\n country: formData['billing-country'] || '',\n zipCode: formData['billing-zip'] || '',\n },\n identification: {\n type: formData.documentType || '',\n value: formData.documentNumber || '',\n },\n },\n }),\n };\n\n const idempotencyKey = generateIdempotencyKey();\n const response = await api.checkout.createCardCheckoutRequest(\n renewalState.data.id,\n idempotencyKey,\n renewalRequest,\n renewalState.token,\n );\n\n this.isSubmitting = false;\n this.isCardSubmitting = false;\n RenewalStore.setLoading(false);\n RenewalStore.setCheckoutResponse(response.data);\n\n if (response.data.result?.status.toUpperCase() === CheckoutStatusE.APPROVED) {\n this.isCardSuccess = true;\n } else {\n this.isCardSuccess = false;\n this.errorPaymentCard = true;\n this.errorMessage = {\n message: response.data.error?.error?.message as PaymentStatusE,\n type: response.data.error?.error?.type as ErrorCodeTypeE,\n };\n }\n } catch (error: any) {\n this.isSubmitting = false;\n this.isCardSubmitting = false;\n RenewalStore.setLoading(false);\n\n this.errorPaymentCard = true;\n this.errorMessage = {\n message: error.data?.error?.message,\n type: error.data?.error?.type,\n };\n }\n }\n\n private async handleAPMRenewal(event?: CustomEvent) {\n this.isSubmitting = true;\n RenewalStore.setLoading(true);\n\n try {\n const apmPaymentMethod = PaymentMethodMapper.mapToAPMPaymentMethod(\n this.currentPaymentMethod,\n renewalState.data.price.country,\n );\n\n // Get form data for billing details and customer info\n const formData = event?.detail || this.getFormData();\n\n // Transform form data to match CreateAPMCheckoutRequest structure\n const billingDetails = {\n address: {\n country: formData['billing-country'],\n state: formData['billing-state'] || '',\n city: formData['billing-city'] || '',\n zipCode: formData['billing-zip'] || '',\n lineOne: formData['billing-address'] || '',\n },\n identification: {\n type: formData.documentType || 'dni',\n value: formData.documentNumber || '',\n },\n };\n\n const renewalRequest: CreateAPMCheckoutRequest = {\n transaction: {\n quantity: 1,\n },\n method: apmPaymentMethod,\n billingDetails,\n redirect: {\n approved: window.location.origin + '/renewal/success',\n rejected: window.location.origin + '/renewal/failure',\n },\n paymentMetadata: {\n orderId: renewalState.data.id,\n source: 'renewal-web',\n },\n customAttributes: {\n bank: formData.bankId || '',\n },\n // Remove targetCurrency for PSE payments as it's not supported\n ...(apmPaymentMethod !== PaymentMethodNameE.CO_TRANSFERENCE_PSE && {\n targetCurrency: renewalState.data.price.currency,\n }),\n };\n\n // Add customer data for renewal\n renewalRequest.customer = {\n firstName:\n formData.fullName?.split(' ')[0] ||\n renewalState.data.subscription.customerName.split(' ')[0] ||\n '',\n lastName:\n formData.fullName?.split(' ').slice(1).join(' ') ||\n renewalState.data.subscription.customerName.split(' ').slice(1).join(' ') ||\n '',\n email: formData.email || renewalState.data.subscription.customerEmail,\n phone: {\n countryCode: formData.countryCodePhoneNumber || '',\n number: formData.phoneNumber || '',\n },\n };\n\n const idempotencyKey = generateIdempotencyKey();\n const response = await api.checkout.createAPMCheckoutRequest(\n renewalState.data.id,\n idempotencyKey,\n renewalRequest,\n );\n\n this.isSubmitting = false;\n RenewalStore.setLoading(false);\n RenewalStore.setCheckoutResponse(response.data);\n this.checkoutResponse = response.data;\n if (response.data.result?.status.toUpperCase() === CheckoutStatusE.APPROVED) {\n this.isCardSuccess = true;\n } else {\n this.paymentError.emit(response.data);\n RenewalStore.setCheckoutResponse(response.data);\n this.errorPaymentAPM = true;\n\n this.errorMessage = {\n alertTitle: response.data?.error?.message as PaymentStatusE,\n message: response.data.error?.message as PaymentStatusE,\n type: response.data.error?.type as ErrorCodeTypeE,\n paymentMethod: this.currentPaymentMethod,\n };\n }\n } catch (error: any) {\n this.isSubmitting = false;\n RenewalStore.setLoading(false);\n this.paymentError.emit(error);\n this.errorPaymentAPM = true;\n\n this.errorMessage = {\n alertTitle: error.data?.error?.message as PaymentStatusE,\n message: error.data?.error?.message,\n type: error.data?.error?.type,\n paymentMethod: this.currentPaymentMethod,\n };\n }\n }\n\n private getFormData = () => {\n return this.initialData;\n };\n\n private getInitialData = () => {\n return {\n 'email': renewalState.data.subscription.customerEmail,\n 'fullName': renewalState.data.subscription.customerName,\n 'card': '',\n 'billing-country': '',\n 'billing-state': '',\n 'billing-address': '',\n 'billing-city': '',\n 'billing-zip': '',\n 'bankId': '',\n 'phoneNumber': '',\n 'countryCodePhoneNumber': '',\n 'documentType': '',\n 'documentNumber': '',\n };\n };\n\n private hasPrefilledAddress = () => {\n const billingFields = [\n 'billing-country',\n 'billing-state',\n 'billing-address',\n 'billing-city',\n 'billing-zip',\n ];\n return billingFields.some(key => {\n const value = this.initialData[key];\n return value && value.trim() !== '';\n });\n };\n\n private getPaymentDate = (): string => {\n const payment = renewalState.form.checkoutResponse;\n if (!payment) return '';\n\n if ('date' in payment) {\n return payment.date as string;\n }\n\n return '';\n };\n\n private getReferenceNumber = (): string => {\n const payment = renewalState.form.checkoutResponse;\n if (!payment) return '';\n if ('traceId' in payment) {\n return payment.traceId as string;\n }\n\n return '';\n };\n\n render() {\n if (!renewalState.isInitialized) {\n return <div class=\"loading\">{I18nService.translate('renewal.loading')}</div>;\n }\n\n const renderRenewalSummary = props => (\n <renewal-summary\n totalAmount={renewalState.data.price.amount}\n currency={renewalState.data.price.currency}\n subscriptionTitle={renewalState.data.subscription.name[0]?.text || 'Subscription'}\n subscriptionAmount={renewalState.data.subscription.amount}\n nextChargeDate={renewalState.data.subscription.nextChargeDate}\n frequency={renewalState.data.subscription.frequency}\n {...props}\n />\n );\n\n return (\n <>\n <rebill-processing-payment style={{ display: this.isCardSubmitting ? 'block' : 'none' }} />\n {this.isCardSuccess ? (\n <renewal-success-page\n typePaymentMethod={this.currentPaymentMethod}\n paymentDate={this.getPaymentDate()}\n referenceNumber={this.getReferenceNumber()}\n cardLastFour={renewalState.data.subscription.cardLastFour}\n country={renewalState.data.price.country}\n paymentMethodName={PaymentMethodMapper.mapToAPMPaymentMethod(\n this.currentPaymentMethod,\n renewalState.data?.price?.country,\n )}\n bank={renewalState.form?.selectedBankId || ''}\n />\n ) : (\n <rebill-checkout-form\n style={{ display: this.isCardSubmitting || this.isCardSuccess ? 'none' : 'block' }}\n validationSchema={this.validationSchema}\n initialData={this.initialData}\n onSubmit={(args: any) => this.handleSubmit(args)}\n renderForm={({ submit, formData, errors }) => (\n <div class=\"rebill-checkout-renewal\">\n <div class=\"left-section\">\n <div class=\"left-section-container\">\n <organization-logo organization={renewalState.data.organization} />\n\n <div class=\"checkout-form-section\">\n {/* Customer Information - Readonly */}\n <user-information-static\n userInfo={{\n customerName: renewalState.data.subscription.customerName,\n customerEmail: renewalState.data.subscription.customerEmail,\n }}\n />\n\n {isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n renderRenewalSummary({\n displayedComponents: 'header',\n })}\n\n {isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n renderRenewalSummary({\n displayedComponents: 'details',\n })}\n\n {/* Payment Method Selection */}\n <div style={{ display: 'flex', flexDirection: 'column', gap: '32px' }}>\n <payment-method-selector\n enabledPaymentMethods={[\n ...new Set(\n renewalState.data.paymentMethods.map(\n pm => pm.type as PAYMENT_METHOD_ENUM,\n ),\n ),\n ]}\n defaultSelected={this.currentPaymentMethod}\n errorComponent={{\n showErrorComponent: this.currentPaymentError,\n message: PaymentErrorMapper.getErrorMessage(this.errorMessage),\n }}\n cardError={{\n showCardInvalid: this.errorCardInvalid,\n type: null,\n }}\n country={renewalState.data.price.country}\n documentTypeError={errors?.documentType}\n documentNumberError={errors?.documentNumber}\n showDocument={\n this.cardMode === 'input' &&\n (isFieldRequired('documentType', this.currentRequiredFields) ||\n isFieldRequired('documentNumber', this.currentRequiredFields))\n }\n />\n {/* Alert for non-card payment methods */}\n {this.currentPaymentMethod !== PAYMENT_METHOD_ENUM.CARD && (\n <rebill-alert\n type=\"info\"\n message={I18nService.translate('renewal.paymentMethodAlert', {\n cardLastFour: renewalState.data.subscription.cardLastFour || '****',\n })}\n icon=\"calendar-edit\"\n variant=\"outlined\"\n colorIcon={COLORS_ENUM.PRIMARY}\n />\n )}\n {this.cardMode === 'input' &&\n isFieldRequired('bankId', this.currentRequiredFields) && (\n <div class=\"animated-component fade-in\">\n <rebill-bank-selector\n banks={\n getFieldValues(\n 'bank',\n this.allRequiredFields[this.currentPaymentMethod]?.original,\n ) || []\n }\n defaultSelectedBankId={formData.bankId || ''}\n error={errors?.bankId}\n />\n </div>\n )}\n </div>\n {this.cardMode === 'input' &&\n (isFieldRequired('billing-country', this.currentRequiredFields) ||\n isFieldRequired('billing-state', this.currentRequiredFields) ||\n isFieldRequired('billing-address', this.currentRequiredFields) ||\n isFieldRequired('billing-city', this.currentRequiredFields) ||\n isFieldRequired('billing-zip', this.currentRequiredFields)) && (\n <div class=\"animated-component slide-in\">\n <rebill-address\n countryOptions={this.countries.map(country => ({\n label: country.country,\n value: country.isoCountryCode,\n }))}\n billingView={this.hasPrefilledAddress() ? 'form' : 'search'}\n errors={{\n 'billing-country': errors['billing-country'],\n 'billing-state': errors['billing-state'],\n 'billing-address': errors['billing-address'],\n 'billing-city': errors['billing-city'],\n 'billing-zip': errors['billing-zip'],\n }}\n />\n </div>\n )}\n {this.cardMode === 'input' &&\n isFieldRequired('phoneNumber', this.currentRequiredFields) && (\n <div class=\"animated-component fade-in\">\n <user-information-phone error={errors?.phoneNumber} />\n </div>\n )}\n\n {/* Show APM checkout response after successful payment submission */}\n {this.checkoutResponse?.result &&\n (this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CASH ||\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER) && (\n <apm-checkout\n paymentMethod={this.currentPaymentMethod}\n referenceId={\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.CASH\n ? this.checkoutResponse.result.data.referenceId\n : undefined\n }\n qrCodeData={\n this.currentPaymentMethod === PAYMENT_METHOD_ENUM.BANK_TRANSFER\n ? this.checkoutResponse.result.data.qrCode\n : undefined\n }\n providerName={renewalState.data.organization?.name || ''}\n expirationDate={(() => {\n const expirationDate = new Date();\n expirationDate.setDate(expirationDate.getDate() + 30);\n return expirationDate.toISOString();\n })()}\n country={renewalState.data.price.country}\n redirectUrl={this.checkoutResponse.result.data.url}\n />\n )}\n\n {isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) &&\n renderRenewalSummary({\n displayedComponents: 'summary',\n })}\n\n <div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>\n {/* Payment Button */}\n <payment-button\n paymentMethod={this.currentPaymentMethod}\n isLoading={this.isSubmitting}\n isRenewal={true}\n trialPeriodDays={renewalState.data.subscription.trialPeriodDays}\n redirectUrl={!!this.checkoutResponse?.result?.data?.url}\n timeToRedirect={5000}\n country={renewalState.data.price.country}\n isDisabled={renewalState.fetchingInstallments}\n onSubmit={() => submit()}\n />\n\n {/* Disabled Button Below */}\n <rebill-alert\n type=\"secure\"\n variant=\"variant-secure\"\n icon=\"lock-outline\"\n message={I18nService.translate('otp.secureMessage')}\n />\n </div>\n </div>\n <rebill-footer />\n </div>\n </div>\n\n {/* Desktop Summary */}\n {!isBreakpointBelow(this.breakpoint, BREAKPOINT_ENUM.DESKTOP) && (\n <div class=\"right-section\">\n <div class=\"checkout-summary-section\">\n {renderRenewalSummary({\n displayedComponents: ['header', 'details', 'summary'],\n })}\n </div>\n </div>\n )}\n </div>\n )}\n />\n )}\n </>\n );\n }\n}\n"],"mappings":"8kBAeA,MAAMA,EAAoBC,MACxBC,EACAC,EACAC,KAEA,MAAMC,QAA+BC,EAAIC,SAASP,kBAChD,CACEE,WACAC,UAEFC,GAGF,MAAO,CACLI,OAAQC,EAAkBJ,EAAuBK,MACjDC,SAAUN,EAAuBK,KAClC,EAGI,MAAME,EAA8BX,UACzC,MAAMY,EAAiB,IAClB,IAAIC,IAAIC,EAAaL,KAAKG,eAAeG,KAAIC,GAAMA,EAAGC,SAE3D,MAAMC,EAAWN,EAAeG,KAAIf,MAAMmB,IACxC,IACE,MAAMC,EAAmBC,EAAoBC,sBAC3CH,EACAL,EAAaL,KAAKc,MAAMC,SAG1B,MAAMC,QAAe1B,EACnBe,EAAaL,KAAKc,MAAMtB,SACxBmB,EACAN,EAAaL,KAAKiB,aAAaC,IAGjC,MAAO,CACLR,mBACGM,E,CAEL,MAAOG,GACPC,QAAQD,MAAM,qCAAqCT,KAAkBS,GACrE,MAAO,CACLT,gBACAZ,OAAQ,GACRG,SAAU,G,KAKhB,MAAMoB,QAAgBC,QAAQC,IAAId,GAClC,MAAMe,EAAkC,GAExCH,EAAQI,SAAQT,IACdQ,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AM,4BACRG,EAAqB,CACpB0B,oBAAqB,CAAC,SAAU,UAAW,kB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as e,c as t,g as i,h as r}from"./p-DyaDabZ4.js";const l=".input-container{display:flex;flex-direction:column}.input-label{font-size:0.875rem;color:var(--rebill-color-text-primary);font-weight:500;margin-bottom:0.375rem}.input-label.disabled{cursor:not-allowed}.input-element{border-radius:var(--input-group-inner-border-radius, 8px);border:1.5px solid var(--rebill-color-border);padding:10px 14px;font-size:0.875rem;color:var(--rebill-color-text-primary);outline:none;transition:border-color 0.2s;background:var(--rebill-color-background);height:38.33px;box-sizing:border-box}.input-element.input-error{border-color:var(--rebill-color-error)}.input-element:disabled{background-color:var(--rebill-color-background);border-color:var(--rebill-color-disabled);color:var(--rebill-color-text-secondary);cursor:not-allowed;opacity:0.7}select.input-element{padding:10px 30px 10px 14px;appearance:none;cursor:pointer}select.input-element:disabled{cursor:not-allowed}.input-element:focus{border-color:var(--rebill-color-primary)}.input-element:disabled:focus{border-color:var(--rebill-color-disabled)}.input-element::placeholder{color:var(--rebill-color-text-secondary-light);font-size:0.875rem;opacity:1}.select-wrapper.disabled .select-icon{color:var(--rebill-color-disabled)}.error-message{color:var(--rebill-color-error);font-size:0.75rem;margin-top:0.375rem}.input-wrapper{position:relative;display:flex;align-items:center}.input-element{width:100%;box-sizing:border-box}.icon-left,.icon-right{position:absolute;display:flex;align-items:center;justify-content:center;top:50%;transform:translateY(-50%)}.icon-left{left:0.75rem;color:var(--rebill-color-text-secondary-light)}.icon-right{right:0.75rem;cursor:pointer;color:var(--rebill-color-text-secondary-light)}.input-element.input-error:focus{flex-direction:column;box-shadow:0 0 0 2px var(--rebill-color-error-light)}.floating-label{position:relative}.floating-label .input-text__input-label{position:absolute;top:50%;left:0.75rem;transform:translateY(-50%);color:var(--rebill-color-text-secondary-light);transition:all 0.1s ease-in-out;pointer-events:none}.floating-label .input-element::placeholder{color:transparent}.floating-label .input-element:focus~.input-text__input-label,.floating-label .input-element:not(:placeholder-shown)~.input-text__input-label{top:0;font-size:0.62rem;color:var(--rebill-color-text-secondary);background-color:var(--rebill-color-background);padding:0 4px;left:0.75rem}.floating-label.has-left-icon .input-text__input-label{left:2.5rem}.input-element:disabled{color:var(--rebill-color-neutrals-500)}.input-wrapper:has(.input-element:disabled) .icon-left,.input-wrapper:has(.input-element:disabled) .icon-right{color:var(--rebill-color-text-secondary-light) !important}";const o=class{constructor(i){e(this,i);this.input=t(this,"input");this.rightIconClick=t(this,"rightIconClick");this.blur=t(this,"blur")}get el(){return i(this)}inputElement;label="";placeholder="";value="";error="";id="";disabled=false;leftIcon;rightIcon;clearable=false;variant="default";uppercase=false;input;rightIconClick;blur;handleFormChange(e){const t=e.detail;if(t&&this.id in t){this.value=t[this.id]}}onInput=e=>{if(this.disabled)return;const t=e.target;let i=t.value;if(this.id==="email"){i=i.toLowerCase();t.value=i}else if(this.uppercase){i=i.toUpperCase();t.value=i}this.value=i;this.input.emit({id:this.id,value:this.value})};onClear=()=>{if(this.disabled)return;this.value="";this.input.emit({id:this.id,value:this.value})};onRightIconClick=()=>{if(this.disabled)return;this.rightIconClick.emit({id:this.id})};onBlur=()=>{const e=this.value.trim();if(e!==this.value){this.value=e;this.input.emit({id:this.id,value:this.value})}this.blur.emit({id:this.id,value:this.value})};async getInputElement(){return this.inputElement}render(){const e=this.variant==="floating";const t={"input-element":true,"input-error":!!this.error};const i={"input-wrapper":true,"floating-label":e,"has-left-icon":!!this.leftIcon,"has-right-icon":!!this.rightIcon};return r("div",{key:"ae839c43b839fd758395e38d5fe0a72c55a8ee9f",class:"input-container"},!e&&this.label&&r("label",{key:"fb636004e05ca2b8e76c2081d060e1a9bd2f9c16",class:`input-label ${this.disabled?"disabled":""}`},this.label),r("div",{key:"9eb98685027a407cc996e84bf305982e52c0284c",class:i},this.leftIcon&&r("div",{key:"571a39e99cb432c3d64d0d0215ae984460df7f4c",class:"icon-left"},r("rebill-icon",{key:"179a0b6cd7d749ed04d57000336b1ab852f07972",name:this.leftIcon})),r("input",{key:"b572b87584c7bada77123da31b221526e277488b",ref:e=>this.inputElement=e,type:"text",class:t,placeholder:e?this.label:this.placeholder,value:this.value,onInput:this.onInput,onBlur:this.onBlur,disabled:this.disabled,style:{paddingLeft:this.leftIcon?"2.5rem":"0.75rem",paddingRight:this.clearable||this.rightIcon?"2.5rem":"0.75rem"}}),e&&r("label",{key:"f08d35728ba65ec0e63deda11f2441418ad8c6d1",class:"input-text__input-label input-label"},this.label),this.clearable&&this.value&&r("div",{key:"eb160ca725fca0bb8087b1d06565bcd61839678c",class:"icon-right",onClick:this.onClear},r("rebill-icon",{key:"fd75c41488a3eb7ad9226a53d524a7ce68617a9f",name:"x"})),this.rightIcon&&!this.clearable&&r("div",{key:"8c90dafb6d714066c5491a3d39d8029824da3b75",class:"icon-right",onClick:this.onRightIconClick},r("rebill-icon",{key:"b4ac09f67ac75efb529e55134b2be0794486846c",name:this.rightIcon}))),this.error&&r("span",{key:"6143b1e1a982362681bcb6326a815b7b5fb85c67",class:"error-message"},this.error))}};o.style=l;export{o as rebill_input_text};
2
+ //# sourceMappingURL=p-cecc2fbe.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["inputTextCss","InputText","inputElement","label","placeholder","value","error","id","disabled","leftIcon","rightIcon","clearable","variant","uppercase","input","rightIconClick","blur","handleFormChange","event","formData","detail","this","onInput","target","inputValue","toLowerCase","toUpperCase","emit","onClear","onRightIconClick","onBlur","trimmedValue","trim","getInputElement","render","isFloating","inputClasses","wrapperClasses","h","key","class","name","ref","el","type","style","paddingLeft","paddingRight","onClick"],"sources":["src/components/shared/inputs/input-text/input-text.css?tag=rebill-input-text","src/components/shared/inputs/input-text/input-text.tsx"],"sourcesContent":["@import '../shared-input.css';\n\n.input-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n}\n\n.input-element {\n width: 100%;\n box-sizing: border-box;\n}\n\n.icon-left,\n.icon-right {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 50%;\n transform: translateY(-50%);\n}\n\n.icon-left {\n left: 0.75rem;\n color: var(--rebill-color-text-secondary-light);\n}\n\n.icon-right {\n right: 0.75rem;\n cursor: pointer;\n color: var(--rebill-color-text-secondary-light);\n}\n\n.input-element.input-error:focus {\n flex-direction: column;\n box-shadow: 0 0 0 2px var(--rebill-color-error-light);\n}\n\n/* Floating label styles */\n.floating-label {\n position: relative;\n}\n\n.floating-label .input-text__input-label {\n position: absolute;\n top: 50%;\n left: 0.75rem;\n transform: translateY(-50%);\n color: var(--rebill-color-text-secondary-light);\n transition: all 0.1s ease-in-out;\n pointer-events: none;\n}\n\n.floating-label .input-element::placeholder {\n color: transparent;\n}\n\n.floating-label .input-element:focus ~ .input-text__input-label,\n.floating-label .input-element:not(:placeholder-shown) ~ .input-text__input-label {\n top: 0;\n font-size: 0.62rem;\n color: var(--rebill-color-text-secondary);\n background-color: var(--rebill-color-background);\n padding: 0 4px;\n left: 0.75rem;\n}\n\n.floating-label.has-left-icon .input-text__input-label {\n left: 2.5rem;\n}\n\n/* Disabled state styles */\n.input-element:disabled {\n color: var(--rebill-color-neutrals-500);\n}\n\n.input-wrapper:has(.input-element:disabled) .icon-left,\n.input-wrapper:has(.input-element:disabled) .icon-right {\n color: var(--rebill-color-text-secondary-light) !important;\n}\n","import { Component, Element, Event, EventEmitter, Listen, Method, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'rebill-input-text',\n styleUrl: 'input-text.css',\n shadow: false,\n})\nexport class InputText {\n @Element() el: HTMLElement;\n private inputElement: HTMLInputElement;\n\n /** Etiqueta que se muestra arriba del input */\n @Prop() label: string = '';\n /** Placeholder del input */\n @Prop() placeholder: string = '';\n /** Valor del input */\n @Prop({ mutable: true, reflect: true }) value: string = '';\n /** Mensaje de error */\n @Prop() error: string = '';\n /** ID del input */\n @Prop() id: string = '';\n /** Estado deshabilitado */\n @Prop() disabled: boolean = false;\n /** Icono a la izquierda */\n @Prop() leftIcon: string;\n /** Icono a la derecha */\n @Prop() rightIcon: string;\n /** Permitir limpiar el input */\n @Prop() clearable: boolean = false;\n /** Variacion de estilo del input */\n @Prop() variant: 'default' | 'floating' = 'default';\n /** Convertir texto a mayúsculas automáticamente */\n @Prop() uppercase: boolean = false;\n /** Evento al cambiar el valor */\n @Event() input: EventEmitter<{ id: string; value: string }>;\n /** Evento al hacer clic en el icono derecho */\n @Event() rightIconClick: EventEmitter<{ id: string }>;\n /** Evento al salir del input */\n @Event() blur: EventEmitter<{ id: string; value: string }>;\n @Listen('change', { target: 'document' })\n handleFormChange(event: CustomEvent) {\n const formData = event.detail;\n if (formData && this.id in formData) {\n this.value = formData[this.id];\n }\n }\n\n private onInput = (event: Event) => {\n if (this.disabled) return;\n const input = event.target as HTMLInputElement;\n let inputValue = input.value;\n\n if (this.id === 'email') {\n inputValue = inputValue.toLowerCase();\n input.value = inputValue;\n } else if (this.uppercase) {\n inputValue = inputValue.toUpperCase();\n input.value = inputValue;\n }\n\n this.value = inputValue;\n this.input.emit({ id: this.id, value: this.value });\n };\n\n private onClear = () => {\n if (this.disabled) return;\n this.value = '';\n this.input.emit({ id: this.id, value: this.value });\n };\n\n private onRightIconClick = () => {\n if (this.disabled) return;\n this.rightIconClick.emit({ id: this.id });\n };\n\n private onBlur = () => {\n const trimmedValue = this.value.trim();\n\n if (trimmedValue !== this.value) {\n this.value = trimmedValue;\n this.input.emit({ id: this.id, value: this.value });\n }\n\n this.blur.emit({ id: this.id, value: this.value });\n };\n\n @Method()\n async getInputElement(): Promise<HTMLInputElement | null> {\n return this.inputElement;\n }\n\n render() {\n const isFloating = this.variant === 'floating';\n\n const inputClasses = {\n 'input-element': true,\n 'input-error': !!this.error,\n };\n\n const wrapperClasses = {\n 'input-wrapper': true,\n 'floating-label': isFloating,\n 'has-left-icon': !!this.leftIcon,\n 'has-right-icon': !!this.rightIcon,\n };\n\n return (\n <div class=\"input-container\">\n {!isFloating && this.label && (\n <label class={`input-label ${this.disabled ? 'disabled' : ''}`}>{this.label}</label>\n )}\n <div class={wrapperClasses}>\n {this.leftIcon && (\n <div class=\"icon-left\">\n <rebill-icon name={this.leftIcon}></rebill-icon>\n </div>\n )}\n <input\n ref={el => (this.inputElement = el)}\n type=\"text\"\n class={inputClasses}\n placeholder={isFloating ? this.label : this.placeholder}\n value={this.value}\n onInput={this.onInput}\n onBlur={this.onBlur}\n disabled={this.disabled}\n style={{\n paddingLeft: this.leftIcon ? '2.5rem' : '0.75rem',\n paddingRight: this.clearable || this.rightIcon ? '2.5rem' : '0.75rem',\n }}\n />\n {isFloating && <label class=\"input-text__input-label input-label\">{this.label}</label>}\n {this.clearable && this.value && (\n <div class=\"icon-right\" onClick={this.onClear}>\n <rebill-icon name=\"x\"></rebill-icon>\n </div>\n )}\n {this.rightIcon && !this.clearable && (\n <div class=\"icon-right\" onClick={this.onRightIconClick}>\n <rebill-icon name={this.rightIcon}></rebill-icon>\n </div>\n )}\n </div>\n {this.error && <span class=\"error-message\">{this.error}</span>}\n </div>\n );\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAe,qoF,MCORC,EAAS,M,kJAEZC,aAGAC,MAAgB,GAEhBC,YAAsB,GAEUC,MAAgB,GAEhDC,MAAgB,GAEhBC,GAAa,GAEbC,SAAoB,MAEpBC,SAEAC,UAEAC,UAAqB,MAErBC,QAAkC,UAElCC,UAAqB,MAEpBC,MAEAC,eAEAC,KAET,gBAAAC,CAAiBC,GACf,MAAMC,EAAWD,EAAME,OACvB,GAAID,GAAYE,KAAKd,MAAMY,EAAU,CACnCE,KAAKhB,MAAQc,EAASE,KAAKd,G,EAIvBe,QAAWJ,IACjB,GAAIG,KAAKb,SAAU,OACnB,MAAMM,EAAQI,EAAMK,OACpB,IAAIC,EAAaV,EAAMT,MAEvB,GAAIgB,KAAKd,KAAO,QAAS,CACvBiB,EAAaA,EAAWC,cACxBX,EAAMT,MAAQmB,C,MACT,GAAIH,KAAKR,UAAW,CACzBW,EAAaA,EAAWE,cACxBZ,EAAMT,MAAQmB,C,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B,KAAKnB,aAAeyC,EAChCC,KAAK,OACLJ,MAAOJ,EACPhC,YAAa+B,EAAad,KAAKlB,MAAQkB,KAAKjB,YAC5CC,MAAOgB,KAAKhB,MACZiB,QAASD,KAAKC,QACdQ,OAAQT,KAAKS,OACbtB,SAAUa,KAAKb,SACfqC,MAAO,CACLC,YAAazB,KAAKZ,SAAW,SAAW,UACxCsC,aAAc1B,KAAKV,WAAaU,KAAKX,UAAY,SAAW,aAG/DyB,GAAcG,EAAA,SAAAC,IAAA,2CAAOC,MAAM,uCAAuCnB,KAAKlB,OACvEkB,KAAKV,WAAaU,KAAKhB,OACtBiC,EAAK,OAAAC,IAAA,2CAAAC,MAAM,aAAaQ,QAAS3B,KAAKO,SACpCU,EAAA,eAAAC,IAAA,2CAAaE,KAAK,OAGrBpB,KAAKX,YAAcW,KAAKV,WACvB2B,EAAK,OAAAC,IAAA,2CAAAC,MAAM,aAAaQ,QAAS3B,KAAKQ,kBACpCS,EAAa,eAAAC,IAAA,2CAAAE,KAAMpB,KAAKX,cAI7BW,KAAKf,OAASgC,EAAA,QAAAC,IAAA,2CAAMC,MAAM,iBAAiBnB,KAAKf,O","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r,h as o}from"./p-DyaDabZ4.js";const l=":root{--rebill-color-primary:#3b82f6;--rebill-color-primary-light:rgba(59, 130, 246, 0.1);--rebill-color-primary-hover:#2563eb;--rebill-color-primary-dark:#001131;--rebill-color-primary-dark-text:#000000;--rebill-color-primary-dark-hover:#001c4a;--rebill-color-primary-dark-light:rgba(0, 17, 49, 0.1);--rebill-color-error:#ef4444;--rebill-color-error-background:#fef2f2;--rebill-color-error-light:rgba(239, 68, 68, 0.1);--rebill-color-error-dark:#6f101b;--rebill-color-background:#ffffff;--rebill-color-background-left:#fafafa;--rebill-color-background-right:#f4f5f6;--rebill-color-background-secondary:#f7f8fa;--rebill-color-border:#ebedef;--rebill-color-timeline-connector:#c4c8cf;--rebill-color-neutrals-700:#58616e;--rebill-color-neutrals-500:#9ca3af;--rebill-color-border-primary:#e4e4e7;--rebill-color-text-primary:#3b4049;--rebill-color-text-secondary:#6b7280;--rebill-color-grey-700:#7d7d7d;--rebill-color-text-secondary-light:#a1a1aa;--rebill-color-text-on-primary:#ffffff;--rebill-color-disabled:#9ca3af;--rebill-color-shadow:rgba(0, 0, 0, 0.1);--rebill-color-green:#10b981;--rebill-color-green-text:#257c67;--rebill-color-green-light:rgba(183, 233, 221, 0.15);--rebill-color-green-light-2:rgba(183, 233, 221, 1);--rebill-color-info-background:#d5e4ff;--rebill-color-info-border:#0156f6;--rebill-color-info-text:#172b85;--rebill-color-background-secondary-light:#f7f8fa;--rebill-breakpoint-mobile:768px;--rebill-breakpoint-tablet:1024px;--rebill-breakpoint-desktop:1025px;--rebill-color-orange:#ff9400;--rebill-color-black:#1e2025;--rebill-color-grey-300:#3b4049;--rebill-color-grey-100:#aeaeae}*{transition:none !important}.qr-container,.qr-image,.qr-image svg,.qr-image img,[class*='qr-'],[class*='success'],[class*='receipt']{transition:none !important;animation:none !important;will-change:auto !important}button:active,button:focus,button:hover{isolation:isolate}.organization-logo{display:flex;align-items:center;justify-content:flex-start;width:100%}.logo-image{max-height:40px;max-width:120px;width:auto;height:auto;object-fit:contain;border-radius:8px}";const e=class{constructor(o){r(this,o)}organization;render(){return o("div",{key:"8d7c57c33ba11ffe5d0c2ce18b077a63a895332c",class:"organization-logo"},this.organization.logoUrl?o("img",{src:this.organization.logoUrl,alt:this.organization.name,class:"logo-image"}):o("rebill-icon",{name:"logo-default",class:"logo-image"}))}};e.style=l;export{e as O};
2
- //# sourceMappingURL=p-DTsMkxC1.js.map
1
+ import{r,h as l}from"./p-DyaDabZ4.js";const o=":root{--rebill-color-primary:#3b82f6;--rebill-color-primary-light:rgba(59, 130, 246, 0.1);--rebill-color-primary-hover:#2563eb;--rebill-color-primary-dark:#001131;--rebill-color-primary-dark-text:#000000;--rebill-color-primary-dark-hover:#001c4a;--rebill-color-primary-dark-light:rgba(0, 17, 49, 0.1);--rebill-color-error:#ef4444;--rebill-color-error-background:#fef2f2;--rebill-color-error-light:rgba(239, 68, 68, 0.1);--rebill-color-error-dark:#6f101b;--rebill-color-background:#ffffff;--rebill-color-background-left:#fafafa;--rebill-color-background-right:#f4f5f6;--rebill-color-background-secondary:#f7f8fa;--rebill-color-border:#ebedef;--rebill-color-timeline-connector:#c4c8cf;--rebill-color-neutrals-700:#58616e;--rebill-color-neutrals-500:#9ca3af;--rebill-color-border-primary:#e4e4e7;--rebill-color-text-primary:#3b4049;--rebill-color-text-secondary:#6b7280;--rebill-color-grey-700:#7d7d7d;--rebill-color-text-secondary-light:#a1a1aa;--rebill-color-text-on-primary:#ffffff;--rebill-color-disabled:#9ca3af;--rebill-color-shadow:rgba(0, 0, 0, 0.1);--rebill-color-green:#10b981;--rebill-color-green-text:#257c67;--rebill-color-green-light:rgba(183, 233, 221, 0.15);--rebill-color-green-light-2:rgba(183, 233, 221, 1);--rebill-color-info-background:#d5e4ff;--rebill-color-info-border:#0156f6;--rebill-color-info-text:#172b85;--rebill-color-background-secondary-light:#f7f8fa;--rebill-breakpoint-mobile:768px;--rebill-breakpoint-tablet:1024px;--rebill-breakpoint-desktop:1025px;--rebill-color-orange:#ff9400;--rebill-color-black:#1e2025;--rebill-color-grey-300:#3b4049;--rebill-color-grey-100:#aeaeae}.qr-container,.qr-image,.qr-image svg,.qr-image img,[class*='qr-'],[class*='success'],[class*='receipt']{transition:none !important;animation:none !important;will-change:auto !important}button:active,button:focus,button:hover{isolation:isolate}.organization-logo{display:flex;align-items:center;justify-content:flex-start;width:100%}.logo-image{max-height:40px;max-width:120px;width:auto;height:auto;object-fit:contain;border-radius:8px}";const e=class{constructor(l){r(this,l)}organization;render(){return l("div",{key:"8d7c57c33ba11ffe5d0c2ce18b077a63a895332c",class:"organization-logo"},this.organization.logoUrl?l("img",{src:this.organization.logoUrl,alt:this.organization.name,class:"logo-image"}):l("rebill-icon",{name:"logo-default",class:"logo-image"}))}};e.style=o;export{e as O};
2
+ //# sourceMappingURL=p-tu-WZjQJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"p-DTsMkxC1.js","sources":["src/components/shared/organization-logo/organization-logo.css?tag=organization-logo","src/components/shared/organization-logo/organization-logo.tsx"],"sourcesContent":["@import '../../../styles/variables.css';\n\n.organization-logo {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n width: 100%;\n}\n\n.logo-image {\n max-height: 40px;\n max-width: 120px;\n width: auto;\n height: auto;\n object-fit: contain;\n border-radius: 8px;\n}\n","import { Component, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'organization-logo',\n styleUrl: 'organization-logo.css',\n shadow: false,\n})\nexport class OrganizationLogo {\n /**\n * The organization data containing logo URL and name\n */\n @Prop() organization!: {\n name: string;\n logoUrl?: string;\n };\n\n render() {\n return (\n <div class=\"organization-logo\">\n {this.organization.logoUrl ? (\n <img src={this.organization.logoUrl} alt={this.organization.name} class=\"logo-image\" />\n ) : (\n <rebill-icon name=\"logo-default\" class=\"logo-image\" />\n )}\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,mBAAmB,GAAG,yhEAAyhE;;MCOxiE,gBAAgB,GAAA,MAAA;;;;AAC3B;;AAEG;AACK,IAAA,YAAY;IAKpB,MAAM,GAAA;AACJ,QAAA,QACE,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,mBAAmB,IAC3B,IAAI,CAAC,YAAY,CAAC,OAAO,IACxB,CAAK,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,EAAC,YAAY,EAAA,CAAG,KAEvF,CAAa,CAAA,aAAA,EAAA,EAAA,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,YAAY,EAAG,CAAA,CACvD,CACG;;;;;;;"}
1
+ {"version":3,"file":"p-tu-WZjQJ.js","sources":["src/components/shared/organization-logo/organization-logo.css?tag=organization-logo","src/components/shared/organization-logo/organization-logo.tsx"],"sourcesContent":["@import '../../../styles/variables.css';\n\n.organization-logo {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n width: 100%;\n}\n\n.logo-image {\n max-height: 40px;\n max-width: 120px;\n width: auto;\n height: auto;\n object-fit: contain;\n border-radius: 8px;\n}\n","import { Component, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'organization-logo',\n styleUrl: 'organization-logo.css',\n shadow: false,\n})\nexport class OrganizationLogo {\n /**\n * The organization data containing logo URL and name\n */\n @Prop() organization!: {\n name: string;\n logoUrl?: string;\n };\n\n render() {\n return (\n <div class=\"organization-logo\">\n {this.organization.logoUrl ? (\n <img src={this.organization.logoUrl} alt={this.organization.name} class=\"logo-image\" />\n ) : (\n <rebill-icon name=\"logo-default\" class=\"logo-image\" />\n )}\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,mBAAmB,GAAG,4/DAA4/D;;MCO3gE,gBAAgB,GAAA,MAAA;;;;AAC3B;;AAEG;AACK,IAAA,YAAY;IAKpB,MAAM,GAAA;AACJ,QAAA,QACE,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,mBAAmB,IAC3B,IAAI,CAAC,YAAY,CAAC,OAAO,IACxB,CAAK,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,EAAC,YAAY,EAAA,CAAG,KAEvF,CAAa,CAAA,aAAA,EAAA,EAAA,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,YAAY,EAAG,CAAA,CACvD,CACG;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"rebill-address.entry.esm.js","sources":["src/components/checkout/address/address.css?tag=rebill-address","src/components/checkout/address/address.tsx"],"sourcesContent":["@import '../../../styles/variables.css';\n\n:host {\n display: block;\n}\n\n.billing-header-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 16px;\n}\n\n.address-container {\n display: flex;\n flex-direction: column;\n gap: 16px;\n width: 100%;\n}\n\n.state-zip-row {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 16px;\n}\n\n.state-zip-row rebill-input-select,\n.state-zip-row rebill-input-text {\n flex: 1;\n}\n\n.search-input-container {\n margin-top: 8px;\n}\n\n.manual-entry-link-wrapper {\n margin-top: 8px;\n text-align: left;\n}\n\n.manual-entry-link {\n background: none;\n border: none;\n color: var(--rebill-color-primary);\n cursor: pointer;\n text-decoration: underline;\n font-size: 14px;\n padding: 4px 8px;\n transition: color 0.2s ease;\n text-decoration: none;\n}\n\n.manual-entry-link:hover {\n text-decoration: underline;\n text-decoration-color: var(--rebill-color-text-secondary);\n}\n\n.same-as-shipping-section {\n margin: 24px 0;\n padding: 16px 0;\n}\n\n.shipping-address-section {\n margin-top: 24px;\n padding-top: 24px;\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, State } from '@stencil/core';\nimport { api } from '../../../api';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { onChange, sessionState, SessionStore } from '../../../store/session.store';\nimport { AddressComponents } from '../../../utils';\n\n@Component({\n tag: 'rebill-address',\n styleUrl: 'address.css',\n shadow: false,\n})\nexport class Address {\n @Element() el: HTMLElement;\n @Prop({ mutable: true, reflect: true }) billingView: 'search' | 'form' = 'search';\n @State() currentBillingStateOptions: { label: string; value: string }[] = [];\n @State() isLoadingAddress: boolean = false;\n @Prop() disabled: boolean = false;\n\n @Prop() countryOptions: { label: string; value: string }[] = [];\n\n @Prop() errors?: {\n 'billing-country': string;\n 'billing-state': string;\n 'billing-address': string;\n 'billing-city': string;\n 'billing-zip': string;\n } | null = null;\n\n private unsubscribeAddressStore?: () => void;\n\n private translateError(errorKey: string | undefined): string {\n if (!errorKey) return '';\n if (errorKey.includes('validation.') || errorKey.includes('paymentErrors.')) {\n return I18nService.translate(errorKey);\n }\n return errorKey;\n }\n\n @Event() addressUpdated: EventEmitter<{\n country: string;\n state: string;\n address: string;\n city: string;\n zip: string;\n }>;\n\n componentDidLoad() {\n this.unsubscribeAddressStore = onChange('data', () => {\n const billingAddress = sessionState.data.userInformation.address?.billingAddress;\n\n if (billingAddress) {\n const addressData: AddressComponents = {\n country: billingAddress.country || '',\n state: billingAddress.state || '',\n address: billingAddress.address || '',\n city: billingAddress.city || '',\n zip: billingAddress.zip || '',\n };\n\n this.emitInputEventsForAddress(addressData);\n }\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribeAddressStore) {\n this.unsubscribeAddressStore();\n }\n }\n\n private async handleAddressSelected(address: AddressComponents) {\n this.isLoadingAddress = true;\n\n // Normalize text function for handling accents and special characters\n const normalizeText = (text: string) => {\n return text\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '') // Remove accents\n .trim();\n };\n\n SessionStore.setBillingAddress(address);\n this.billingView = 'form';\n\n if (address.country) {\n await this.loadStatesForCountry(address.country);\n\n // Compare Google state with API states\n if (address.state && this.currentBillingStateOptions.length > 0) {\n const exactMatch = this.currentBillingStateOptions.find(\n option => option.value.toLowerCase() === address.state.toLowerCase(),\n );\n\n const partialMatch = this.currentBillingStateOptions.find(\n option =>\n option.value.toLowerCase().includes(address.state.toLowerCase()) ||\n address.state.toLowerCase().includes(option.value.toLowerCase()),\n );\n\n // Try to find matches with common variations\n const normalizedGoogleState = normalizeText(address.state)\n .replace('ciudad de ', '')\n .replace('estado de ', '')\n .replace('provincia de ', '');\n\n const normalizedMatch = this.currentBillingStateOptions.find(option => {\n const normalizedOption = normalizeText(option.value)\n .replace('ciudad de ', '')\n .replace('estado de ', '')\n .replace('provincia de ', '');\n\n const matches =\n normalizedOption === normalizedGoogleState ||\n normalizedOption.startsWith(normalizedGoogleState + ' ') ||\n normalizedGoogleState.startsWith(normalizedOption + ' ');\n return matches;\n });\n\n if (exactMatch) {\n address.state = exactMatch.value;\n } else if (normalizedMatch) {\n address.state = normalizedMatch.value;\n } else address.state = partialMatch.value;\n }\n }\n this.addressUpdated.emit({\n country: address.country || '',\n address: address.address || '',\n city: address.city || '',\n state: address.state || '',\n zip: address.zip || '',\n });\n\n // Use requestAnimationFrame to ensure the form is rendered with the new state options\n // before emitting events. This ensures the state field can be properly populated.\n requestAnimationFrame(() => {\n this.emitInputEventsForAddress(address);\n setTimeout(() => {\n this.isLoadingAddress = false;\n }, 500);\n });\n }\n\n private emitInputEventsForAddress(address: AddressComponents) {\n // Emit input events for each address field that has a value\n // This mimics user input to properly clear validation errors\n const fields = [\n { id: `billing-country`, value: address.country },\n { id: `billing-address`, value: address.address },\n { id: `billing-city`, value: address.city },\n { id: `billing-state`, value: address.state },\n { id: `billing-zip`, value: address.zip },\n ];\n\n fields.forEach(field => {\n if (field.value) {\n this.emitInputEvent(field.id, field.value);\n }\n });\n }\n\n private emitInputEvent(id: string, value: string) {\n if (value) {\n // Create and dispatch a custom input event that the form component can listen to\n const inputEvent = new CustomEvent('input', {\n detail: { id, value },\n bubbles: true,\n composed: true,\n });\n this.el.dispatchEvent(inputEvent);\n }\n }\n\n private async loadStatesForCountry(countryCode: string) {\n try {\n const response = await api.data.getStates(countryCode);\n const statesResponse = response.data;\n const stateOptions =\n statesResponse && statesResponse.states\n ? statesResponse.states.map(state => ({ label: state, value: state }))\n : [];\n\n this.currentBillingStateOptions = stateOptions;\n } catch (error) {\n this.currentBillingStateOptions = [];\n }\n }\n\n private handleManualEntry = () => {\n this.billingView = 'form';\n };\n\n private handleSearchEntry = () => {\n this.billingView = 'search';\n };\n\n private async handleInput(field: string, value: string) {\n if (value === undefined) return;\n SessionStore.setBillingAddress({ [field]: value } as any);\n // Emit input event to form to sync with form data\n this.emitInputEvent(`billing-${field}`, value);\n\n // If country changes, load states for the new country\n if (field === 'country') {\n await this.loadStatesForCountry(value);\n // Clear the current state selection since the country changed\n SessionStore.setBillingAddress({ state: '' } as any);\n }\n }\n\n private renderAddressHeader() {\n return (\n <div class=\"billing-header-row\">\n <rebill-typography variant=\"body2\">\n {I18nService.translate('billingAddress.title')}\n </rebill-typography>\n </div>\n );\n }\n\n private renderAddressForm() {\n if (this.billingView === 'search') {\n const addressError =\n this.translateError(this.errors?.['billing-address']) ||\n this.translateError(this.errors?.['billing-country']) ||\n this.translateError(this.errors?.['billing-state']) ||\n this.translateError(this.errors?.['billing-city']) ||\n this.translateError(this.errors?.['billing-zip']) ||\n '';\n return (\n <div>\n {this.renderAddressHeader()}\n <rebill-address-search\n onAddressSelected={e => this.handleAddressSelected(e.detail)}\n onManualEntryRequested={() => this.handleManualEntry()}\n error={addressError}\n disabled={this.disabled}\n />\n </div>\n );\n }\n\n const errorsToShow = this.isLoadingAddress ? null : this.errors;\n\n return (\n <div>\n {this.renderAddressHeader()}\n <rebill-address-form\n countryOptions={this.countryOptions}\n stateOptions={this.currentBillingStateOptions}\n errors={errorsToShow}\n disabled={this.disabled}\n onFieldChanged={e => this.handleInput(e.detail.field, e.detail.value)}\n onSearchRequested={() => this.handleSearchEntry()}\n />\n </div>\n );\n }\n\n render() {\n return (\n <div>\n {/* Billing Address */}\n {this.renderAddressForm()}\n </div>\n );\n }\n}\n"],"names":["sessionState"],"mappings":";;;;;;;AAAA,MAAM,UAAU,GAAG,irFAAirF;;MCWvrF,OAAO,GAAA,MAAA;;;;;;IAEsB,WAAW,GAAsB,QAAQ;IACxE,0BAA0B,GAAuC,EAAE;IACnE,gBAAgB,GAAY,KAAK;IAClC,QAAQ,GAAY,KAAK;IAEzB,cAAc,GAAuC,EAAE;IAEvD,MAAM,GAMH,IAAI;AAEP,IAAA,uBAAuB;AAEvB,IAAA,cAAc,CAAC,QAA4B,EAAA;AACjD,QAAA,IAAI,CAAC,QAAQ;AAAE,YAAA,OAAO,EAAE;AACxB,QAAA,IAAI,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,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CAAC,mBAAmB,EAAE,EAC3B,CAAA,CAAA,uBAAA,EAAA,EACE,iBAAiB,EAAE,CAAC,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,EAC5D,sBAAsB,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,EACtD,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,CAAA,CACE;;AAIV,QAAA,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC,MAAM;AAE/D,QAAA,QACE,CAAA,CAAA,KAAA,EAAA,IAAA,EACG,IAAI,CAAC,mBAAmB,EAAE,EAC3B,CACE,CAAA,qBAAA,EAAA,EAAA,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,YAAY,EAAE,IAAI,CAAC,0BAA0B,EAC7C,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,cAAc,EAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACrE,iBAAiB,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,EAAA,CACjD,CACE;;IAIV,MAAM,GAAA;AACJ,QAAA,QACE,8DAEG,IAAI,CAAC,iBAAiB,EAAE,CACrB;;;;;;;"}
1
+ {"version":3,"file":"rebill-address.entry.esm.js","sources":["src/components/checkout/address/address.css?tag=rebill-address","src/components/checkout/address/address.tsx"],"sourcesContent":["@import '../../../styles/variables.css';\n\n:host {\n display: block;\n}\n\n.billing-header-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 16px;\n}\n\n.address-container {\n display: flex;\n flex-direction: column;\n gap: 16px;\n width: 100%;\n}\n\n.state-zip-row {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 16px;\n}\n\n.state-zip-row rebill-input-select,\n.state-zip-row rebill-input-text {\n flex: 1;\n}\n\n.search-input-container {\n margin-top: 8px;\n}\n\n.manual-entry-link-wrapper {\n margin-top: 8px;\n text-align: left;\n}\n\n.manual-entry-link {\n background: none;\n border: none;\n color: var(--rebill-color-primary);\n cursor: pointer;\n text-decoration: underline;\n font-size: 14px;\n padding: 4px 8px;\n transition: color 0.2s ease;\n text-decoration: none;\n}\n\n.manual-entry-link:hover {\n text-decoration: underline;\n text-decoration-color: var(--rebill-color-text-secondary);\n}\n\n.same-as-shipping-section {\n margin: 24px 0;\n padding: 16px 0;\n}\n\n.shipping-address-section {\n margin-top: 24px;\n padding-top: 24px;\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, State } from '@stencil/core';\nimport { api } from '../../../api';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { onChange, sessionState, SessionStore } from '../../../store/session.store';\nimport { AddressComponents } from '../../../utils';\n\n@Component({\n tag: 'rebill-address',\n styleUrl: 'address.css',\n shadow: false,\n})\nexport class Address {\n @Element() el: HTMLElement;\n @Prop({ mutable: true, reflect: true }) billingView: 'search' | 'form' = 'search';\n @State() currentBillingStateOptions: { label: string; value: string }[] = [];\n @State() isLoadingAddress: boolean = false;\n @Prop() disabled: boolean = false;\n\n @Prop() countryOptions: { label: string; value: string }[] = [];\n\n @Prop() errors?: {\n 'billing-country': string;\n 'billing-state': string;\n 'billing-address': string;\n 'billing-city': string;\n 'billing-zip': string;\n } | null = null;\n\n private unsubscribeAddressStore?: () => void;\n\n private translateError(errorKey: string | undefined): string {\n if (!errorKey) return '';\n if (errorKey.includes('validation.') || errorKey.includes('paymentErrors.')) {\n return I18nService.translate(errorKey);\n }\n return errorKey;\n }\n\n @Event() addressUpdated: EventEmitter<{\n country: string;\n state: string;\n address: string;\n city: string;\n zip: string;\n }>;\n\n componentDidLoad() {\n this.unsubscribeAddressStore = onChange('data', () => {\n const billingAddress = sessionState.data.userInformation.address?.billingAddress;\n\n if (billingAddress) {\n const addressData: AddressComponents = {\n country: billingAddress.country || '',\n state: billingAddress.state || '',\n address: billingAddress.address || '',\n city: billingAddress.city || '',\n zip: billingAddress.zip || '',\n };\n\n this.emitInputEventsForAddress(addressData);\n }\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribeAddressStore) {\n this.unsubscribeAddressStore();\n }\n }\n\n private async handleAddressSelected(address: AddressComponents) {\n this.isLoadingAddress = true;\n\n // Normalize text function for handling accents and special characters\n const normalizeText = (text: string) => {\n return text\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '') // Remove accents\n .trim();\n };\n\n SessionStore.setBillingAddress(address);\n this.billingView = 'form';\n\n if (address.country) {\n await this.loadStatesForCountry(address.country);\n\n // Compare Google state with API states\n if (address.state && this.currentBillingStateOptions.length > 0) {\n const exactMatch = this.currentBillingStateOptions.find(\n option => option.value.toLowerCase() === address.state.toLowerCase(),\n );\n\n const partialMatch = this.currentBillingStateOptions.find(\n option =>\n option.value.toLowerCase().includes(address.state.toLowerCase()) ||\n address.state.toLowerCase().includes(option.value.toLowerCase()),\n );\n\n // Try to find matches with common variations\n const normalizedGoogleState = normalizeText(address.state)\n .replace('ciudad de ', '')\n .replace('estado de ', '')\n .replace('provincia de ', '');\n\n const normalizedMatch = this.currentBillingStateOptions.find(option => {\n const normalizedOption = normalizeText(option.value)\n .replace('ciudad de ', '')\n .replace('estado de ', '')\n .replace('provincia de ', '');\n\n const matches =\n normalizedOption === normalizedGoogleState ||\n normalizedOption.startsWith(normalizedGoogleState + ' ') ||\n normalizedGoogleState.startsWith(normalizedOption + ' ');\n return matches;\n });\n\n if (exactMatch) {\n address.state = exactMatch.value;\n } else if (normalizedMatch) {\n address.state = normalizedMatch.value;\n } else address.state = partialMatch.value;\n }\n }\n this.addressUpdated.emit({\n country: address.country || '',\n address: address.address || '',\n city: address.city || '',\n state: address.state || '',\n zip: address.zip || '',\n });\n\n // Use requestAnimationFrame to ensure the form is rendered with the new state options\n // before emitting events. This ensures the state field can be properly populated.\n requestAnimationFrame(() => {\n this.emitInputEventsForAddress(address);\n setTimeout(() => {\n this.isLoadingAddress = false;\n }, 500);\n });\n }\n\n private emitInputEventsForAddress(address: AddressComponents) {\n // Emit input events for each address field that has a value\n // This mimics user input to properly clear validation errors\n const fields = [\n { id: `billing-country`, value: address.country },\n { id: `billing-address`, value: address.address },\n { id: `billing-city`, value: address.city },\n { id: `billing-state`, value: address.state },\n { id: `billing-zip`, value: address.zip },\n ];\n\n fields.forEach(field => {\n if (field.value) {\n this.emitInputEvent(field.id, field.value);\n }\n });\n }\n\n private emitInputEvent(id: string, value: string) {\n if (value) {\n // Create and dispatch a custom input event that the form component can listen to\n const inputEvent = new CustomEvent('input', {\n detail: { id, value },\n bubbles: true,\n composed: true,\n });\n this.el.dispatchEvent(inputEvent);\n }\n }\n\n private async loadStatesForCountry(countryCode: string) {\n try {\n const response = await api.data.getStates(countryCode);\n const statesResponse = response.data;\n const stateOptions =\n statesResponse && statesResponse.states\n ? statesResponse.states.map(state => ({ label: state, value: state }))\n : [];\n\n this.currentBillingStateOptions = stateOptions;\n } catch (error) {\n this.currentBillingStateOptions = [];\n }\n }\n\n private handleManualEntry = () => {\n this.billingView = 'form';\n };\n\n private handleSearchEntry = () => {\n this.billingView = 'search';\n };\n\n private async handleInput(field: string, value: string) {\n if (value === undefined) return;\n SessionStore.setBillingAddress({ [field]: value } as any);\n // Emit input event to form to sync with form data\n this.emitInputEvent(`billing-${field}`, value);\n\n // If country changes, load states for the new country\n if (field === 'country') {\n await this.loadStatesForCountry(value);\n // Clear the current state selection since the country changed\n SessionStore.setBillingAddress({ state: '' } as any);\n }\n }\n\n private renderAddressHeader() {\n return (\n <div class=\"billing-header-row\">\n <rebill-typography variant=\"body2\">\n {I18nService.translate('billingAddress.title')}\n </rebill-typography>\n </div>\n );\n }\n\n private renderAddressForm() {\n if (this.billingView === 'search') {\n const addressError =\n this.translateError(this.errors?.['billing-address']) ||\n this.translateError(this.errors?.['billing-country']) ||\n this.translateError(this.errors?.['billing-state']) ||\n this.translateError(this.errors?.['billing-city']) ||\n this.translateError(this.errors?.['billing-zip']) ||\n '';\n return (\n <div>\n {this.renderAddressHeader()}\n <rebill-address-search\n onAddressSelected={e => this.handleAddressSelected(e.detail)}\n onManualEntryRequested={() => this.handleManualEntry()}\n error={addressError}\n disabled={this.disabled}\n />\n </div>\n );\n }\n\n const errorsToShow = this.isLoadingAddress ? null : this.errors;\n\n return (\n <div>\n {this.renderAddressHeader()}\n <rebill-address-form\n countryOptions={this.countryOptions}\n stateOptions={this.currentBillingStateOptions}\n errors={errorsToShow}\n disabled={this.disabled}\n onFieldChanged={e => this.handleInput(e.detail.field, e.detail.value)}\n onSearchRequested={() => this.handleSearchEntry()}\n />\n </div>\n );\n }\n\n render() {\n return (\n <div>\n {/* Billing Address */}\n {this.renderAddressForm()}\n </div>\n );\n }\n}\n"],"names":["sessionState"],"mappings":";;;;;;;AAAA,MAAM,UAAU,GAAG,opFAAopF;;MCW1pF,OAAO,GAAA,MAAA;;;;;;IAEsB,WAAW,GAAsB,QAAQ;IACxE,0BAA0B,GAAuC,EAAE;IACnE,gBAAgB,GAAY,KAAK;IAClC,QAAQ,GAAY,KAAK;IAEzB,cAAc,GAAuC,EAAE;IAEvD,MAAM,GAMH,IAAI;AAEP,IAAA,uBAAuB;AAEvB,IAAA,cAAc,CAAC,QAA4B,EAAA;AACjD,QAAA,IAAI,CAAC,QAAQ;AAAE,YAAA,OAAO,EAAE;AACxB,QAAA,IAAI,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;AAC3E,YAAA,OAAO,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC;;AAExC,QAAA,OAAO,QAAQ;;AAGR,IAAA,cAAc;IAQvB,gBAAgB,GAAA;QACd,IAAI,CAAC,uBAAuB,GAAG,QAAQ,CAAC,MAAM,EAAE,MAAK;YACnD,MAAM,cAAc,GAAGA,KAAY,CAAC,IAAI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,EACvB,CAAA,CACE;;AAIV,QAAA,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC,MAAM;AAE/D,QAAA,QACE,CAAA,CAAA,KAAA,EAAA,IAAA,EACG,IAAI,CAAC,mBAAmB,EAAE,EAC3B,CACE,CAAA,qBAAA,EAAA,EAAA,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,YAAY,EAAE,IAAI,CAAC,0BAA0B,EAC7C,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,cAAc,EAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACrE,iBAAiB,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,EAAA,CACjD,CACE;;IAIV,MAAM,GAAA;AACJ,QAAA,QACE,8DAEG,IAAI,CAAC,iBAAiB,EAAE,CACrB;;;;;;;"}
@@ -5,7 +5,7 @@ import './_commonjsHelpers-i-KAFXlR.js';
5
5
  import './config-BLghMKz-.js';
6
6
  import './cdn-D6m0Kscr.js';
7
7
 
8
- const addressCss = ":root{--rebill-color-primary:#3b82f6;--rebill-color-primary-light:rgba(59, 130, 246, 0.1);--rebill-color-primary-hover:#2563eb;--rebill-color-primary-dark:#001131;--rebill-color-primary-dark-text:#000000;--rebill-color-primary-dark-hover:#001c4a;--rebill-color-primary-dark-light:rgba(0, 17, 49, 0.1);--rebill-color-error:#ef4444;--rebill-color-error-background:#fef2f2;--rebill-color-error-light:rgba(239, 68, 68, 0.1);--rebill-color-error-dark:#6f101b;--rebill-color-background:#ffffff;--rebill-color-background-left:#fafafa;--rebill-color-background-right:#f4f5f6;--rebill-color-background-secondary:#f7f8fa;--rebill-color-border:#ebedef;--rebill-color-timeline-connector:#c4c8cf;--rebill-color-neutrals-700:#58616e;--rebill-color-neutrals-500:#9ca3af;--rebill-color-border-primary:#e4e4e7;--rebill-color-text-primary:#3b4049;--rebill-color-text-secondary:#6b7280;--rebill-color-grey-700:#7d7d7d;--rebill-color-text-secondary-light:#a1a1aa;--rebill-color-text-on-primary:#ffffff;--rebill-color-disabled:#9ca3af;--rebill-color-shadow:rgba(0, 0, 0, 0.1);--rebill-color-green:#10b981;--rebill-color-green-text:#257c67;--rebill-color-green-light:rgba(183, 233, 221, 0.15);--rebill-color-green-light-2:rgba(183, 233, 221, 1);--rebill-color-info-background:#d5e4ff;--rebill-color-info-border:#0156f6;--rebill-color-info-text:#172b85;--rebill-color-background-secondary-light:#f7f8fa;--rebill-breakpoint-mobile:768px;--rebill-breakpoint-tablet:1024px;--rebill-breakpoint-desktop:1025px;--rebill-color-orange:#ff9400;--rebill-color-black:#1e2025;--rebill-color-grey-300:#3b4049;--rebill-color-grey-100:#aeaeae}*{transition:none !important}.qr-container,.qr-image,.qr-image svg,.qr-image img,[class*='qr-'],[class*='success'],[class*='receipt']{transition:none !important;animation:none !important;will-change:auto !important}button:active,button:focus,button:hover{isolation:isolate}:host{display:block}.billing-header-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.address-container{display:flex;flex-direction:column;gap:16px;width:100%}.state-zip-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}.state-zip-row rebill-input-select,.state-zip-row rebill-input-text{flex:1}.search-input-container{margin-top:8px}.manual-entry-link-wrapper{margin-top:8px;text-align:left}.manual-entry-link{background:none;border:none;color:var(--rebill-color-primary);cursor:pointer;text-decoration:underline;font-size:14px;padding:4px 8px;transition:color 0.2s ease;text-decoration:none}.manual-entry-link:hover{text-decoration:underline;text-decoration-color:var(--rebill-color-text-secondary)}.same-as-shipping-section{margin:24px 0;padding:16px 0}.shipping-address-section{margin-top:24px;padding-top:24px}";
8
+ const addressCss = ":root{--rebill-color-primary:#3b82f6;--rebill-color-primary-light:rgba(59, 130, 246, 0.1);--rebill-color-primary-hover:#2563eb;--rebill-color-primary-dark:#001131;--rebill-color-primary-dark-text:#000000;--rebill-color-primary-dark-hover:#001c4a;--rebill-color-primary-dark-light:rgba(0, 17, 49, 0.1);--rebill-color-error:#ef4444;--rebill-color-error-background:#fef2f2;--rebill-color-error-light:rgba(239, 68, 68, 0.1);--rebill-color-error-dark:#6f101b;--rebill-color-background:#ffffff;--rebill-color-background-left:#fafafa;--rebill-color-background-right:#f4f5f6;--rebill-color-background-secondary:#f7f8fa;--rebill-color-border:#ebedef;--rebill-color-timeline-connector:#c4c8cf;--rebill-color-neutrals-700:#58616e;--rebill-color-neutrals-500:#9ca3af;--rebill-color-border-primary:#e4e4e7;--rebill-color-text-primary:#3b4049;--rebill-color-text-secondary:#6b7280;--rebill-color-grey-700:#7d7d7d;--rebill-color-text-secondary-light:#a1a1aa;--rebill-color-text-on-primary:#ffffff;--rebill-color-disabled:#9ca3af;--rebill-color-shadow:rgba(0, 0, 0, 0.1);--rebill-color-green:#10b981;--rebill-color-green-text:#257c67;--rebill-color-green-light:rgba(183, 233, 221, 0.15);--rebill-color-green-light-2:rgba(183, 233, 221, 1);--rebill-color-info-background:#d5e4ff;--rebill-color-info-border:#0156f6;--rebill-color-info-text:#172b85;--rebill-color-background-secondary-light:#f7f8fa;--rebill-breakpoint-mobile:768px;--rebill-breakpoint-tablet:1024px;--rebill-breakpoint-desktop:1025px;--rebill-color-orange:#ff9400;--rebill-color-black:#1e2025;--rebill-color-grey-300:#3b4049;--rebill-color-grey-100:#aeaeae}.qr-container,.qr-image,.qr-image svg,.qr-image img,[class*='qr-'],[class*='success'],[class*='receipt']{transition:none !important;animation:none !important;will-change:auto !important}button:active,button:focus,button:hover{isolation:isolate}:host{display:block}.billing-header-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.address-container{display:flex;flex-direction:column;gap:16px;width:100%}.state-zip-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}.state-zip-row rebill-input-select,.state-zip-row rebill-input-text{flex:1}.search-input-container{margin-top:8px}.manual-entry-link-wrapper{margin-top:8px;text-align:left}.manual-entry-link{background:none;border:none;color:var(--rebill-color-primary);cursor:pointer;text-decoration:underline;font-size:14px;padding:4px 8px;transition:color 0.2s ease;text-decoration:none}.manual-entry-link:hover{text-decoration:underline;text-decoration-color:var(--rebill-color-text-secondary)}.same-as-shipping-section{margin:24px 0;padding:16px 0}.shipping-address-section{margin-top:24px;padding-top:24px}";
9
9
 
10
10
  const Address = class {
11
11
  constructor(hostRef) {
@@ -1 +1 @@
1
- {"file":"rebill-address.entry.esm.js","mappings":";;;;;;;AAAA,MAAM,UAAU,GAAG,irFAAirF;;MCWvrF,OAAO,GAAA,MAAA;;;;;;IAEsB,WAAW,GAAsB,QAAQ;IACxE,0BAA0B,GAAuC,EAAE;IACnE,gBAAgB,GAAY,KAAK;IAClC,QAAQ,GAAY,KAAK;IAEzB,cAAc,GAAuC,EAAE;IAEvD,MAAM,GAMH,IAAI;AAEP,IAAA,uBAAuB;AAEvB,IAAA,cAAc,CAAC,QAA4B,EAAA;AACjD,QAAA,IAAI,CAAC,QAAQ;AAAE,YAAA,OAAO,EAAE;AACxB,QAAA,IAAI,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;AAC3E,YAAA,OAAO,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC;;AAExC,QAAA,OAAO,QAAQ;;AAGR,IAAA,cAAc;IAQvB,gBAAgB,GAAA;QACd,IAAI,CAAC,uBAAuB,GAAG,QAAQ,CAAC,MAAM,EAAE,MAAK;YACnD,MAAM,cAAc,GAAGA,KAAY,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,cAAc;YAEhF,IAAI,cAAc,EAAE;AAClB,gBAAA,MAAM,WAAW,GAAsB;AACrC,oBAAA,OAAO,EAAE,cAAc,CAAC,OAAO,IAAI,EAAE;AACrC,oBAAA,KAAK,EAAE,cAAc,CAAC,KAAK,IAAI,EAAE;AACjC,oBAAA,OAAO,EAAE,cAAc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IAAI,CAAC,cAAc,EACnC,YAAY,EAAE,IAAI,CAAC,0BAA0B,EAC7C,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,cAAc,EAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACrE,iBAAiB,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,EAAA,CACjD,CACE;;IAIV,MAAM,GAAA;AACJ,QAAA,QACE,8DAEG,IAAI,CAAC,iBAAiB,EAAE,CACrB;;;;;;;","names":["sessionState"],"sources":["src/components/checkout/address/address.css?tag=rebill-address","src/components/checkout/address/address.tsx"],"sourcesContent":["@import '../../../styles/variables.css';\n\n:host {\n display: block;\n}\n\n.billing-header-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 16px;\n}\n\n.address-container {\n display: flex;\n flex-direction: column;\n gap: 16px;\n width: 100%;\n}\n\n.state-zip-row {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 16px;\n}\n\n.state-zip-row rebill-input-select,\n.state-zip-row rebill-input-text {\n flex: 1;\n}\n\n.search-input-container {\n margin-top: 8px;\n}\n\n.manual-entry-link-wrapper {\n margin-top: 8px;\n text-align: left;\n}\n\n.manual-entry-link {\n background: none;\n border: none;\n color: var(--rebill-color-primary);\n cursor: pointer;\n text-decoration: underline;\n font-size: 14px;\n padding: 4px 8px;\n transition: color 0.2s ease;\n text-decoration: none;\n}\n\n.manual-entry-link:hover {\n text-decoration: underline;\n text-decoration-color: var(--rebill-color-text-secondary);\n}\n\n.same-as-shipping-section {\n margin: 24px 0;\n padding: 16px 0;\n}\n\n.shipping-address-section {\n margin-top: 24px;\n padding-top: 24px;\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, State } from '@stencil/core';\nimport { api } from '../../../api';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { onChange, sessionState, SessionStore } from '../../../store/session.store';\nimport { AddressComponents } from '../../../utils';\n\n@Component({\n tag: 'rebill-address',\n styleUrl: 'address.css',\n shadow: false,\n})\nexport class Address {\n @Element() el: HTMLElement;\n @Prop({ mutable: true, reflect: true }) billingView: 'search' | 'form' = 'search';\n @State() currentBillingStateOptions: { label: string; value: string }[] = [];\n @State() isLoadingAddress: boolean = false;\n @Prop() disabled: boolean = false;\n\n @Prop() countryOptions: { label: string; value: string }[] = [];\n\n @Prop() errors?: {\n 'billing-country': string;\n 'billing-state': string;\n 'billing-address': string;\n 'billing-city': string;\n 'billing-zip': string;\n } | null = null;\n\n private unsubscribeAddressStore?: () => void;\n\n private translateError(errorKey: string | undefined): string {\n if (!errorKey) return '';\n if (errorKey.includes('validation.') || errorKey.includes('paymentErrors.')) {\n return I18nService.translate(errorKey);\n }\n return errorKey;\n }\n\n @Event() addressUpdated: EventEmitter<{\n country: string;\n state: string;\n address: string;\n city: string;\n zip: string;\n }>;\n\n componentDidLoad() {\n this.unsubscribeAddressStore = onChange('data', () => {\n const billingAddress = sessionState.data.userInformation.address?.billingAddress;\n\n if (billingAddress) {\n const addressData: AddressComponents = {\n country: billingAddress.country || '',\n state: billingAddress.state || '',\n address: billingAddress.address || '',\n city: billingAddress.city || '',\n zip: billingAddress.zip || '',\n };\n\n this.emitInputEventsForAddress(addressData);\n }\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribeAddressStore) {\n this.unsubscribeAddressStore();\n }\n }\n\n private async handleAddressSelected(address: AddressComponents) {\n this.isLoadingAddress = true;\n\n // Normalize text function for handling accents and special characters\n const normalizeText = (text: string) => {\n return text\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '') // Remove accents\n .trim();\n };\n\n SessionStore.setBillingAddress(address);\n this.billingView = 'form';\n\n if (address.country) {\n await this.loadStatesForCountry(address.country);\n\n // Compare Google state with API states\n if (address.state && this.currentBillingStateOptions.length > 0) {\n const exactMatch = this.currentBillingStateOptions.find(\n option => option.value.toLowerCase() === address.state.toLowerCase(),\n );\n\n const partialMatch = this.currentBillingStateOptions.find(\n option =>\n option.value.toLowerCase().includes(address.state.toLowerCase()) ||\n address.state.toLowerCase().includes(option.value.toLowerCase()),\n );\n\n // Try to find matches with common variations\n const normalizedGoogleState = normalizeText(address.state)\n .replace('ciudad de ', '')\n .replace('estado de ', '')\n .replace('provincia de ', '');\n\n const normalizedMatch = this.currentBillingStateOptions.find(option => {\n const normalizedOption = normalizeText(option.value)\n .replace('ciudad de ', '')\n .replace('estado de ', '')\n .replace('provincia de ', '');\n\n const matches =\n normalizedOption === normalizedGoogleState ||\n normalizedOption.startsWith(normalizedGoogleState + ' ') ||\n normalizedGoogleState.startsWith(normalizedOption + ' ');\n return matches;\n });\n\n if (exactMatch) {\n address.state = exactMatch.value;\n } else if (normalizedMatch) {\n address.state = normalizedMatch.value;\n } else address.state = partialMatch.value;\n }\n }\n this.addressUpdated.emit({\n country: address.country || '',\n address: address.address || '',\n city: address.city || '',\n state: address.state || '',\n zip: address.zip || '',\n });\n\n // Use requestAnimationFrame to ensure the form is rendered with the new state options\n // before emitting events. This ensures the state field can be properly populated.\n requestAnimationFrame(() => {\n this.emitInputEventsForAddress(address);\n setTimeout(() => {\n this.isLoadingAddress = false;\n }, 500);\n });\n }\n\n private emitInputEventsForAddress(address: AddressComponents) {\n // Emit input events for each address field that has a value\n // This mimics user input to properly clear validation errors\n const fields = [\n { id: `billing-country`, value: address.country },\n { id: `billing-address`, value: address.address },\n { id: `billing-city`, value: address.city },\n { id: `billing-state`, value: address.state },\n { id: `billing-zip`, value: address.zip },\n ];\n\n fields.forEach(field => {\n if (field.value) {\n this.emitInputEvent(field.id, field.value);\n }\n });\n }\n\n private emitInputEvent(id: string, value: string) {\n if (value) {\n // Create and dispatch a custom input event that the form component can listen to\n const inputEvent = new CustomEvent('input', {\n detail: { id, value },\n bubbles: true,\n composed: true,\n });\n this.el.dispatchEvent(inputEvent);\n }\n }\n\n private async loadStatesForCountry(countryCode: string) {\n try {\n const response = await api.data.getStates(countryCode);\n const statesResponse = response.data;\n const stateOptions =\n statesResponse && statesResponse.states\n ? statesResponse.states.map(state => ({ label: state, value: state }))\n : [];\n\n this.currentBillingStateOptions = stateOptions;\n } catch (error) {\n this.currentBillingStateOptions = [];\n }\n }\n\n private handleManualEntry = () => {\n this.billingView = 'form';\n };\n\n private handleSearchEntry = () => {\n this.billingView = 'search';\n };\n\n private async handleInput(field: string, value: string) {\n if (value === undefined) return;\n SessionStore.setBillingAddress({ [field]: value } as any);\n // Emit input event to form to sync with form data\n this.emitInputEvent(`billing-${field}`, value);\n\n // If country changes, load states for the new country\n if (field === 'country') {\n await this.loadStatesForCountry(value);\n // Clear the current state selection since the country changed\n SessionStore.setBillingAddress({ state: '' } as any);\n }\n }\n\n private renderAddressHeader() {\n return (\n <div class=\"billing-header-row\">\n <rebill-typography variant=\"body2\">\n {I18nService.translate('billingAddress.title')}\n </rebill-typography>\n </div>\n );\n }\n\n private renderAddressForm() {\n if (this.billingView === 'search') {\n const addressError =\n this.translateError(this.errors?.['billing-address']) ||\n this.translateError(this.errors?.['billing-country']) ||\n this.translateError(this.errors?.['billing-state']) ||\n this.translateError(this.errors?.['billing-city']) ||\n this.translateError(this.errors?.['billing-zip']) ||\n '';\n return (\n <div>\n {this.renderAddressHeader()}\n <rebill-address-search\n onAddressSelected={e => this.handleAddressSelected(e.detail)}\n onManualEntryRequested={() => this.handleManualEntry()}\n error={addressError}\n disabled={this.disabled}\n />\n </div>\n );\n }\n\n const errorsToShow = this.isLoadingAddress ? null : this.errors;\n\n return (\n <div>\n {this.renderAddressHeader()}\n <rebill-address-form\n countryOptions={this.countryOptions}\n stateOptions={this.currentBillingStateOptions}\n errors={errorsToShow}\n disabled={this.disabled}\n onFieldChanged={e => this.handleInput(e.detail.field, e.detail.value)}\n onSearchRequested={() => this.handleSearchEntry()}\n />\n </div>\n );\n }\n\n render() {\n return (\n <div>\n {/* Billing Address */}\n {this.renderAddressForm()}\n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,iBAAiB,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,EAAA,CACjD,CACE;;IAIV,MAAM,GAAA;AACJ,QAAA,QACE,8DAEG,IAAI,CAAC,iBAAiB,EAAE,CACrB;;;;;;;","names":["sessionState"],"sources":["src/components/checkout/address/address.css?tag=rebill-address","src/components/checkout/address/address.tsx"],"sourcesContent":["@import '../../../styles/variables.css';\n\n:host {\n display: block;\n}\n\n.billing-header-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 16px;\n}\n\n.address-container {\n display: flex;\n flex-direction: column;\n gap: 16px;\n width: 100%;\n}\n\n.state-zip-row {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 16px;\n}\n\n.state-zip-row rebill-input-select,\n.state-zip-row rebill-input-text {\n flex: 1;\n}\n\n.search-input-container {\n margin-top: 8px;\n}\n\n.manual-entry-link-wrapper {\n margin-top: 8px;\n text-align: left;\n}\n\n.manual-entry-link {\n background: none;\n border: none;\n color: var(--rebill-color-primary);\n cursor: pointer;\n text-decoration: underline;\n font-size: 14px;\n padding: 4px 8px;\n transition: color 0.2s ease;\n text-decoration: none;\n}\n\n.manual-entry-link:hover {\n text-decoration: underline;\n text-decoration-color: var(--rebill-color-text-secondary);\n}\n\n.same-as-shipping-section {\n margin: 24px 0;\n padding: 16px 0;\n}\n\n.shipping-address-section {\n margin-top: 24px;\n padding-top: 24px;\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, State } from '@stencil/core';\nimport { api } from '../../../api';\nimport { I18nService } from '../../../i18n/i18n.service';\nimport { onChange, sessionState, SessionStore } from '../../../store/session.store';\nimport { AddressComponents } from '../../../utils';\n\n@Component({\n tag: 'rebill-address',\n styleUrl: 'address.css',\n shadow: false,\n})\nexport class Address {\n @Element() el: HTMLElement;\n @Prop({ mutable: true, reflect: true }) billingView: 'search' | 'form' = 'search';\n @State() currentBillingStateOptions: { label: string; value: string }[] = [];\n @State() isLoadingAddress: boolean = false;\n @Prop() disabled: boolean = false;\n\n @Prop() countryOptions: { label: string; value: string }[] = [];\n\n @Prop() errors?: {\n 'billing-country': string;\n 'billing-state': string;\n 'billing-address': string;\n 'billing-city': string;\n 'billing-zip': string;\n } | null = null;\n\n private unsubscribeAddressStore?: () => void;\n\n private translateError(errorKey: string | undefined): string {\n if (!errorKey) return '';\n if (errorKey.includes('validation.') || errorKey.includes('paymentErrors.')) {\n return I18nService.translate(errorKey);\n }\n return errorKey;\n }\n\n @Event() addressUpdated: EventEmitter<{\n country: string;\n state: string;\n address: string;\n city: string;\n zip: string;\n }>;\n\n componentDidLoad() {\n this.unsubscribeAddressStore = onChange('data', () => {\n const billingAddress = sessionState.data.userInformation.address?.billingAddress;\n\n if (billingAddress) {\n const addressData: AddressComponents = {\n country: billingAddress.country || '',\n state: billingAddress.state || '',\n address: billingAddress.address || '',\n city: billingAddress.city || '',\n zip: billingAddress.zip || '',\n };\n\n this.emitInputEventsForAddress(addressData);\n }\n });\n }\n\n disconnectedCallback() {\n if (this.unsubscribeAddressStore) {\n this.unsubscribeAddressStore();\n }\n }\n\n private async handleAddressSelected(address: AddressComponents) {\n this.isLoadingAddress = true;\n\n // Normalize text function for handling accents and special characters\n const normalizeText = (text: string) => {\n return text\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '') // Remove accents\n .trim();\n };\n\n SessionStore.setBillingAddress(address);\n this.billingView = 'form';\n\n if (address.country) {\n await this.loadStatesForCountry(address.country);\n\n // Compare Google state with API states\n if (address.state && this.currentBillingStateOptions.length > 0) {\n const exactMatch = this.currentBillingStateOptions.find(\n option => option.value.toLowerCase() === address.state.toLowerCase(),\n );\n\n const partialMatch = this.currentBillingStateOptions.find(\n option =>\n option.value.toLowerCase().includes(address.state.toLowerCase()) ||\n address.state.toLowerCase().includes(option.value.toLowerCase()),\n );\n\n // Try to find matches with common variations\n const normalizedGoogleState = normalizeText(address.state)\n .replace('ciudad de ', '')\n .replace('estado de ', '')\n .replace('provincia de ', '');\n\n const normalizedMatch = this.currentBillingStateOptions.find(option => {\n const normalizedOption = normalizeText(option.value)\n .replace('ciudad de ', '')\n .replace('estado de ', '')\n .replace('provincia de ', '');\n\n const matches =\n normalizedOption === normalizedGoogleState ||\n normalizedOption.startsWith(normalizedGoogleState + ' ') ||\n normalizedGoogleState.startsWith(normalizedOption + ' ');\n return matches;\n });\n\n if (exactMatch) {\n address.state = exactMatch.value;\n } else if (normalizedMatch) {\n address.state = normalizedMatch.value;\n } else address.state = partialMatch.value;\n }\n }\n this.addressUpdated.emit({\n country: address.country || '',\n address: address.address || '',\n city: address.city || '',\n state: address.state || '',\n zip: address.zip || '',\n });\n\n // Use requestAnimationFrame to ensure the form is rendered with the new state options\n // before emitting events. This ensures the state field can be properly populated.\n requestAnimationFrame(() => {\n this.emitInputEventsForAddress(address);\n setTimeout(() => {\n this.isLoadingAddress = false;\n }, 500);\n });\n }\n\n private emitInputEventsForAddress(address: AddressComponents) {\n // Emit input events for each address field that has a value\n // This mimics user input to properly clear validation errors\n const fields = [\n { id: `billing-country`, value: address.country },\n { id: `billing-address`, value: address.address },\n { id: `billing-city`, value: address.city },\n { id: `billing-state`, value: address.state },\n { id: `billing-zip`, value: address.zip },\n ];\n\n fields.forEach(field => {\n if (field.value) {\n this.emitInputEvent(field.id, field.value);\n }\n });\n }\n\n private emitInputEvent(id: string, value: string) {\n if (value) {\n // Create and dispatch a custom input event that the form component can listen to\n const inputEvent = new CustomEvent('input', {\n detail: { id, value },\n bubbles: true,\n composed: true,\n });\n this.el.dispatchEvent(inputEvent);\n }\n }\n\n private async loadStatesForCountry(countryCode: string) {\n try {\n const response = await api.data.getStates(countryCode);\n const statesResponse = response.data;\n const stateOptions =\n statesResponse && statesResponse.states\n ? statesResponse.states.map(state => ({ label: state, value: state }))\n : [];\n\n this.currentBillingStateOptions = stateOptions;\n } catch (error) {\n this.currentBillingStateOptions = [];\n }\n }\n\n private handleManualEntry = () => {\n this.billingView = 'form';\n };\n\n private handleSearchEntry = () => {\n this.billingView = 'search';\n };\n\n private async handleInput(field: string, value: string) {\n if (value === undefined) return;\n SessionStore.setBillingAddress({ [field]: value } as any);\n // Emit input event to form to sync with form data\n this.emitInputEvent(`billing-${field}`, value);\n\n // If country changes, load states for the new country\n if (field === 'country') {\n await this.loadStatesForCountry(value);\n // Clear the current state selection since the country changed\n SessionStore.setBillingAddress({ state: '' } as any);\n }\n }\n\n private renderAddressHeader() {\n return (\n <div class=\"billing-header-row\">\n <rebill-typography variant=\"body2\">\n {I18nService.translate('billingAddress.title')}\n </rebill-typography>\n </div>\n );\n }\n\n private renderAddressForm() {\n if (this.billingView === 'search') {\n const addressError =\n this.translateError(this.errors?.['billing-address']) ||\n this.translateError(this.errors?.['billing-country']) ||\n this.translateError(this.errors?.['billing-state']) ||\n this.translateError(this.errors?.['billing-city']) ||\n this.translateError(this.errors?.['billing-zip']) ||\n '';\n return (\n <div>\n {this.renderAddressHeader()}\n <rebill-address-search\n onAddressSelected={e => this.handleAddressSelected(e.detail)}\n onManualEntryRequested={() => this.handleManualEntry()}\n error={addressError}\n disabled={this.disabled}\n />\n </div>\n );\n }\n\n const errorsToShow = this.isLoadingAddress ? null : this.errors;\n\n return (\n <div>\n {this.renderAddressHeader()}\n <rebill-address-form\n countryOptions={this.countryOptions}\n stateOptions={this.currentBillingStateOptions}\n errors={errorsToShow}\n disabled={this.disabled}\n onFieldChanged={e => this.handleInput(e.detail.field, e.detail.value)}\n onSearchRequested={() => this.handleSearchEntry()}\n />\n </div>\n );\n }\n\n render() {\n return (\n <div>\n {/* Billing Address */}\n {this.renderAddressForm()}\n </div>\n );\n }\n}\n"],"version":3}
@@ -6,7 +6,7 @@ import './payment-button-BTfA3gUi.js';
6
6
  import './processing-payment-CqkxDOH6.js';
7
7
  import './summary-C0kDi3Qu.js';
8
8
  import './user-information-static-XK4HDNmA.js';
9
- import './organization-logo-6pnwjRAd.js';
9
+ import './organization-logo-FuaJxXfD.js';
10
10
  import { s as state, S as SESSION_TYPE_ENUM, I as I18nService, a as SessionStore, D as DEFAULT_DISPLAY_CONFIG, i as initializeI18nWithSessionLanguage, P as PAYMENT_METHOD_ENUM, o as onChange, b as SESSION_ITEM_TYPE_ENUM } from './i18n.service-Du3vb0yg.js';
11
11
  import { m as mapRequiredFields, P as PaymentStatusE, i as isFieldRequired, a as PaymentErrorMapper, g as getFieldValues } from './required-fields-mappers-Dl2TD0jm.js';
12
12
  import { B as BREAKPOINT_ENUM, g as getBreakpoint, i as isBreakpointBelow } from './breakpoint-Do_vNuMa.js';