crmbonus-component-wake 2.0.114 → 2.0.116

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 (366) hide show
  1. package/dist/{esm → crmbonus-component-wake}/app-modal.entry.js +2 -3
  2. package/dist/crmbonus-component-wake/app-modal.entry.js.map +1 -0
  3. package/dist/crmbonus-component-wake/cart.helper-2643939f.js +50 -0
  4. package/dist/crmbonus-component-wake/cart.helper-2643939f.js.map +1 -0
  5. package/dist/{components/p-2b3b8d6b.js → crmbonus-component-wake/countdown-timer.entry.js} +7 -27
  6. package/dist/crmbonus-component-wake/countdown-timer.entry.js.map +1 -0
  7. package/dist/{esm → crmbonus-component-wake}/crm-bonus-form.entry.js +3 -4
  8. package/dist/crmbonus-component-wake/{p-147ba861.entry.js.map → crm-bonus-form.entry.js.map} +1 -1
  9. package/dist/{esm → crmbonus-component-wake}/crm-bonus-note.entry.js +22 -18
  10. package/dist/crmbonus-component-wake/crm-bonus-note.entry.js.map +1 -0
  11. package/dist/{esm → crmbonus-component-wake}/crm-bonus.entry.js +45 -53
  12. package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +1 -0
  13. package/dist/crmbonus-component-wake/crm-button.entry.js +20 -0
  14. package/dist/crmbonus-component-wake/crm-button.entry.js.map +1 -0
  15. package/dist/{esm/crm-giftback-form_2.entry.js → crmbonus-component-wake/crm-giftback-form.entry.js} +6 -21
  16. package/dist/{cjs/crm-giftback-form_2.cjs.entry.js.map → crmbonus-component-wake/crm-giftback-form.entry.js.map} +1 -1
  17. package/dist/{components/p-58b97429.js → crmbonus-component-wake/crm-tooltip.entry.js} +8 -27
  18. package/dist/crmbonus-component-wake/crm-tooltip.entry.js.map +1 -0
  19. package/dist/crmbonus-component-wake/crmbonus-component-wake.css +7 -1
  20. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +48 -1
  21. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  22. package/dist/{esm/crmbonus.service-774ebe83.js → crmbonus-component-wake/crmbonus.service-047b6b01.js} +169 -95
  23. package/dist/crmbonus-component-wake/crmbonus.service-047b6b01.js.map +1 -0
  24. package/dist/{components/p-b79c86a8.js → crmbonus-component-wake/giftback-finish.entry.js} +8 -25
  25. package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +1 -0
  26. package/dist/{components/p-2671d669.js → crmbonus-component-wake/giftback-info.entry.js} +12 -52
  27. package/dist/crmbonus-component-wake/giftback-info.entry.js.map +1 -0
  28. package/dist/{components/p-6186ddcc.js → crmbonus-component-wake/giftback-pin.entry.js} +8 -38
  29. package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +1 -0
  30. package/dist/{components/p-7c744cca.js → crmbonus-component-wake/giftback-progress.entry.js} +8 -37
  31. package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -0
  32. package/dist/{esm/i18n-e8150dff.js → crmbonus-component-wake/i18n-11138a2c.js} +16 -1
  33. package/dist/{esm/i18n-e8150dff.js.map → crmbonus-component-wake/i18n-11138a2c.js.map} +1 -1
  34. package/dist/crmbonus-component-wake/index-d0fd1dc0.js +3039 -0
  35. package/dist/crmbonus-component-wake/index-d0fd1dc0.js.map +1 -0
  36. package/dist/crmbonus-component-wake/index.esm.js +12 -1
  37. package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
  38. package/dist/crmbonus-component-wake/loading-container.entry.js +18 -0
  39. package/dist/crmbonus-component-wake/loading-container.entry.js.map +1 -0
  40. package/dist/{esm → crmbonus-component-wake}/loading-spinner.entry.js +2 -3
  41. package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +1 -0
  42. package/dist/{components/p-246a3e9d.js → crmbonus-component-wake/name-input.entry.js} +8 -37
  43. package/dist/crmbonus-component-wake/name-input.entry.js.map +1 -0
  44. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js +35 -0
  45. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +1 -0
  46. package/dist/{esm → crmbonus-component-wake}/phone-cancel-input.entry.js +1 -1
  47. package/dist/crmbonus-component-wake/phone-cancel-input.entry.js.map +1 -0
  48. package/dist/{components/p-6c546e48.js → crmbonus-component-wake/phone-form.entry.js} +8 -47
  49. package/dist/crmbonus-component-wake/phone-form.entry.js.map +1 -0
  50. package/dist/{esm → crmbonus-component-wake}/phone-input-mask.entry.js +2 -3
  51. package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +1 -0
  52. package/dist/{esm → crmbonus-component-wake}/phone-input.entry.js +1 -1
  53. package/dist/crmbonus-component-wake/phone-input.entry.js.map +1 -0
  54. package/dist/{components/p-83a12a8f.js → crmbonus-component-wake/pin-form.entry.js} +9 -56
  55. package/dist/crmbonus-component-wake/pin-form.entry.js.map +1 -0
  56. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +334 -0
  57. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +1 -0
  58. package/dist/{collection/utils/utils.js → crmbonus-component-wake/utils-96cf9ae0.js} +8 -5
  59. package/dist/crmbonus-component-wake/utils-96cf9ae0.js.map +1 -0
  60. package/dist/types/components/crm-bonus/crm-bonus.d.ts +5 -8
  61. package/dist/types/components/note/crm-bonus-note.d.ts +5 -4
  62. package/dist/types/components/pedido/pedido.d.ts +2 -3
  63. package/dist/types/components.d.ts +7 -19
  64. package/dist/types/dto/validate.pin.bonus.d.ts +6 -0
  65. package/dist/types/helpers/cart.helper.d.ts +2 -0
  66. package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +2 -4
  67. package/dist/types/objectvalues/cart.wake.d.ts +12 -0
  68. package/dist/types/services/crmbonus.service.d.ts +1 -1
  69. package/package.json +6 -2
  70. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  71. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  72. package/dist/cjs/app-modal.cjs.entry.js +0 -28
  73. package/dist/cjs/app-modal.cjs.entry.js.map +0 -1
  74. package/dist/cjs/countdown-timer_2.cjs.entry.js +0 -63
  75. package/dist/cjs/countdown-timer_2.cjs.entry.js.map +0 -1
  76. package/dist/cjs/crm-bonus-form.cjs.entry.js +0 -104
  77. package/dist/cjs/crm-bonus-form.cjs.entry.js.map +0 -1
  78. package/dist/cjs/crm-bonus-note.cjs.entry.js +0 -98
  79. package/dist/cjs/crm-bonus-note.cjs.entry.js.map +0 -1
  80. package/dist/cjs/crm-bonus.cjs.entry.js +0 -252
  81. package/dist/cjs/crm-bonus.cjs.entry.js.map +0 -1
  82. package/dist/cjs/crm-giftback-form_2.cjs.entry.js +0 -253
  83. package/dist/cjs/crm-tooltip_4.cjs.entry.js +0 -211
  84. package/dist/cjs/crm-tooltip_4.cjs.entry.js.map +0 -1
  85. package/dist/cjs/crmbonus-component-wake.cjs.js +0 -27
  86. package/dist/cjs/crmbonus-component-wake.cjs.js.map +0 -1
  87. package/dist/cjs/crmbonus.service-b31b7396.js +0 -3874
  88. package/dist/cjs/crmbonus.service-b31b7396.js.map +0 -1
  89. package/dist/cjs/giftback-finish_4.cjs.entry.js +0 -131
  90. package/dist/cjs/giftback-finish_4.cjs.entry.js.map +0 -1
  91. package/dist/cjs/i18n-f2a6f60e.js +0 -2219
  92. package/dist/cjs/i18n-f2a6f60e.js.map +0 -1
  93. package/dist/cjs/index-6054ed44.js +0 -21
  94. package/dist/cjs/index-6054ed44.js.map +0 -1
  95. package/dist/cjs/index-d11684bd.js +0 -1599
  96. package/dist/cjs/index-d11684bd.js.map +0 -1
  97. package/dist/cjs/index.cjs.js +0 -11
  98. package/dist/cjs/index.cjs.js.map +0 -1
  99. package/dist/cjs/info.config.helper-c5d9f781.js +0 -16
  100. package/dist/cjs/info.config.helper-c5d9f781.js.map +0 -1
  101. package/dist/cjs/keys.storage-de7744aa.js +0 -17
  102. package/dist/cjs/keys.storage-de7744aa.js.map +0 -1
  103. package/dist/cjs/loader.cjs.js +0 -17
  104. package/dist/cjs/loader.cjs.js.map +0 -1
  105. package/dist/cjs/loading-spinner.cjs.entry.js +0 -24
  106. package/dist/cjs/loading-spinner.cjs.entry.js.map +0 -1
  107. package/dist/cjs/pedido-finalizado.cjs.entry.js +0 -36
  108. package/dist/cjs/pedido-finalizado.cjs.entry.js.map +0 -1
  109. package/dist/cjs/phone-cancel-input.cjs.entry.js +0 -25
  110. package/dist/cjs/phone-cancel-input.cjs.entry.js.map +0 -1
  111. package/dist/cjs/phone-input-mask.cjs.entry.js +0 -61
  112. package/dist/cjs/phone-input-mask.cjs.entry.js.map +0 -1
  113. package/dist/cjs/phone-input.cjs.entry.js +0 -25
  114. package/dist/cjs/phone-input.cjs.entry.js.map +0 -1
  115. package/dist/cjs/utils-e9413ee3.js +0 -25
  116. package/dist/cjs/utils-e9413ee3.js.map +0 -1
  117. package/dist/collection/assets/svg/info-circle-svgrepo-com.svg +0 -6
  118. package/dist/collection/assets/svg/money-dollars-svgrepo-com.svg +0 -6
  119. package/dist/collection/collection-manifest.json +0 -32
  120. package/dist/collection/components/button/crm-button.css +0 -22
  121. package/dist/collection/components/button/index.js +0 -76
  122. package/dist/collection/components/button/index.js.map +0 -1
  123. package/dist/collection/components/countdown-timer/countdown-timer.js +0 -81
  124. package/dist/collection/components/countdown-timer/countdown-timer.js.map +0 -1
  125. package/dist/collection/components/crm-bonus/assets/logo.svg +0 -18
  126. package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +0 -8
  127. package/dist/collection/components/crm-bonus/assets/svg/logo.svg +0 -18
  128. package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +0 -8
  129. package/dist/collection/components/crm-bonus/crm-bonus.css +0 -84
  130. package/dist/collection/components/crm-bonus/crm-bonus.js +0 -360
  131. package/dist/collection/components/crm-bonus/crm-bonus.js.map +0 -1
  132. package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +0 -19
  133. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +0 -348
  134. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +0 -1
  135. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +0 -10
  136. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +0 -20
  137. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +0 -1
  138. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +0 -70
  139. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +0 -126
  140. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +0 -1
  141. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +0 -110
  142. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +0 -127
  143. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +0 -1
  144. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.css +0 -108
  145. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js +0 -110
  146. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js.map +0 -1
  147. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +0 -75
  148. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +0 -1
  149. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +0 -75
  150. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +0 -1
  151. package/dist/collection/components/giftback-form/giftback-form.css +0 -75
  152. package/dist/collection/components/giftback-form/giftback-form.js +0 -410
  153. package/dist/collection/components/giftback-form/giftback-form.js.map +0 -1
  154. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +0 -181
  155. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +0 -221
  156. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +0 -1
  157. package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js +0 -11
  158. package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js.map +0 -1
  159. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +0 -103
  160. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +0 -1
  161. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +0 -84
  162. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +0 -197
  163. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +0 -1
  164. package/dist/collection/components/loading-container/loading-container.css +0 -47
  165. package/dist/collection/components/loading-container/loading-container.js +0 -43
  166. package/dist/collection/components/loading-container/loading-container.js.map +0 -1
  167. package/dist/collection/components/loading-spinner/loading-spinner.css +0 -17
  168. package/dist/collection/components/loading-spinner/loading-spinner.js +0 -63
  169. package/dist/collection/components/loading-spinner/loading-spinner.js.map +0 -1
  170. package/dist/collection/components/modal/app-modal.css +0 -45
  171. package/dist/collection/components/modal/app-modal.js +0 -83
  172. package/dist/collection/components/modal/app-modal.js.map +0 -1
  173. package/dist/collection/components/note/crm-bonus-note.css +0 -71
  174. package/dist/collection/components/note/crm-bonus-note.js +0 -130
  175. package/dist/collection/components/note/crm-bonus-note.js.map +0 -1
  176. package/dist/collection/components/pedido/pedido.js +0 -82
  177. package/dist/collection/components/pedido/pedido.js.map +0 -1
  178. package/dist/collection/components/phone/phone-input-mask.css +0 -40
  179. package/dist/collection/components/phone/phone-input-mask.js +0 -125
  180. package/dist/collection/components/phone/phone-input-mask.js.map +0 -1
  181. package/dist/collection/components/tooltip/crm-tooltip.css +0 -49
  182. package/dist/collection/components/tooltip/tooltip.js +0 -61
  183. package/dist/collection/components/tooltip/tooltip.js.map +0 -1
  184. package/dist/collection/contants/index.js +0 -16
  185. package/dist/collection/contants/index.js.map +0 -1
  186. package/dist/collection/contants/mocks.js +0 -28
  187. package/dist/collection/contants/mocks.js.map +0 -1
  188. package/dist/collection/dto/pin.sent.js +0 -2
  189. package/dist/collection/dto/pin.sent.js.map +0 -1
  190. package/dist/collection/dto/update.order.dto.js +0 -2
  191. package/dist/collection/dto/update.order.dto.js.map +0 -1
  192. package/dist/collection/dto/validate.pin.bonus.js +0 -5
  193. package/dist/collection/dto/validate.pin.bonus.js.map +0 -1
  194. package/dist/collection/helpers/build.payload.helper.js +0 -25
  195. package/dist/collection/helpers/build.payload.helper.js.map +0 -1
  196. package/dist/collection/helpers/info.config.helper.js +0 -11
  197. package/dist/collection/helpers/info.config.helper.js.map +0 -1
  198. package/dist/collection/helpers/time.helper.js +0 -12
  199. package/dist/collection/helpers/time.helper.js.map +0 -1
  200. package/dist/collection/i18n/i18n.js +0 -35
  201. package/dist/collection/i18n/i18n.js.map +0 -1
  202. package/dist/collection/index.js +0 -11
  203. package/dist/collection/index.js.map +0 -1
  204. package/dist/collection/services/crmbonus.service.js +0 -117
  205. package/dist/collection/services/crmbonus.service.js.map +0 -1
  206. package/dist/collection/utils/keys.storage.js +0 -9
  207. package/dist/collection/utils/keys.storage.js.map +0 -1
  208. package/dist/collection/utils/utils.js.map +0 -1
  209. package/dist/components/app-modal.js +0 -46
  210. package/dist/components/app-modal.js.map +0 -1
  211. package/dist/components/countdown-timer.js +0 -8
  212. package/dist/components/countdown-timer.js.map +0 -1
  213. package/dist/components/crm-bonus-form.js +0 -165
  214. package/dist/components/crm-bonus-form.js.map +0 -1
  215. package/dist/components/crm-bonus-note.js +0 -137
  216. package/dist/components/crm-bonus-note.js.map +0 -1
  217. package/dist/components/crm-bonus.js +0 -345
  218. package/dist/components/crm-bonus.js.map +0 -1
  219. package/dist/components/crm-button.js +0 -8
  220. package/dist/components/crm-button.js.map +0 -1
  221. package/dist/components/crm-giftback-form.js +0 -8
  222. package/dist/components/crm-giftback-form.js.map +0 -1
  223. package/dist/components/crm-tooltip.js +0 -8
  224. package/dist/components/crm-tooltip.js.map +0 -1
  225. package/dist/components/giftback-finish.js +0 -8
  226. package/dist/components/giftback-finish.js.map +0 -1
  227. package/dist/components/giftback-info.js +0 -8
  228. package/dist/components/giftback-info.js.map +0 -1
  229. package/dist/components/giftback-pin.js +0 -8
  230. package/dist/components/giftback-pin.js.map +0 -1
  231. package/dist/components/giftback-progress.js +0 -8
  232. package/dist/components/giftback-progress.js.map +0 -1
  233. package/dist/components/index.js +0 -4
  234. package/dist/components/index.js.map +0 -1
  235. package/dist/components/loading-container.js +0 -8
  236. package/dist/components/loading-container.js.map +0 -1
  237. package/dist/components/loading-spinner.js +0 -8
  238. package/dist/components/loading-spinner.js.map +0 -1
  239. package/dist/components/name-input.js +0 -8
  240. package/dist/components/name-input.js.map +0 -1
  241. package/dist/components/p-11085d9b.js +0 -79
  242. package/dist/components/p-11085d9b.js.map +0 -1
  243. package/dist/components/p-246a3e9d.js.map +0 -1
  244. package/dist/components/p-2671d669.js.map +0 -1
  245. package/dist/components/p-27c0fd26.js +0 -316
  246. package/dist/components/p-27c0fd26.js.map +0 -1
  247. package/dist/components/p-2b3b8d6b.js.map +0 -1
  248. package/dist/components/p-3e84f78c.js +0 -1408
  249. package/dist/components/p-3e84f78c.js.map +0 -1
  250. package/dist/components/p-47f9da55.js +0 -46
  251. package/dist/components/p-47f9da55.js.map +0 -1
  252. package/dist/components/p-58b97429.js.map +0 -1
  253. package/dist/components/p-6186ddcc.js.map +0 -1
  254. package/dist/components/p-6c546e48.js.map +0 -1
  255. package/dist/components/p-75ba7b9a.js +0 -14
  256. package/dist/components/p-75ba7b9a.js.map +0 -1
  257. package/dist/components/p-7c744cca.js.map +0 -1
  258. package/dist/components/p-7cfea8fe.js +0 -19
  259. package/dist/components/p-7cfea8fe.js.map +0 -1
  260. package/dist/components/p-83a12a8f.js.map +0 -1
  261. package/dist/components/p-b79c86a8.js.map +0 -1
  262. package/dist/components/p-ba369e65.js +0 -21
  263. package/dist/components/p-ba369e65.js.map +0 -1
  264. package/dist/components/p-c44e2f02.js +0 -3872
  265. package/dist/components/p-c44e2f02.js.map +0 -1
  266. package/dist/components/p-cc1ea33f.js +0 -36
  267. package/dist/components/p-cc1ea33f.js.map +0 -1
  268. package/dist/components/p-e8c19a64.js +0 -2217
  269. package/dist/components/p-e8c19a64.js.map +0 -1
  270. package/dist/components/p-f9aeffc1.js +0 -12
  271. package/dist/components/p-f9aeffc1.js.map +0 -1
  272. package/dist/components/p-fe9c3966.js +0 -39
  273. package/dist/components/p-fe9c3966.js.map +0 -1
  274. package/dist/components/pedido-finalizado.js +0 -53
  275. package/dist/components/pedido-finalizado.js.map +0 -1
  276. package/dist/components/phone-cancel-input.js +0 -55
  277. package/dist/components/phone-cancel-input.js.map +0 -1
  278. package/dist/components/phone-form.js +0 -8
  279. package/dist/components/phone-form.js.map +0 -1
  280. package/dist/components/phone-input-mask.js +0 -8
  281. package/dist/components/phone-input-mask.js.map +0 -1
  282. package/dist/components/phone-input.js +0 -55
  283. package/dist/components/phone-input.js.map +0 -1
  284. package/dist/components/pin-form.js +0 -8
  285. package/dist/components/pin-form.js.map +0 -1
  286. package/dist/crmbonus-component-wake/p-03b77c41.entry.js +0 -2
  287. package/dist/crmbonus-component-wake/p-03b77c41.entry.js.map +0 -1
  288. package/dist/crmbonus-component-wake/p-147ba861.entry.js +0 -2
  289. package/dist/crmbonus-component-wake/p-21464f24.entry.js +0 -2
  290. package/dist/crmbonus-component-wake/p-21464f24.entry.js.map +0 -1
  291. package/dist/crmbonus-component-wake/p-3d6152b1.js +0 -3
  292. package/dist/crmbonus-component-wake/p-3d6152b1.js.map +0 -1
  293. package/dist/crmbonus-component-wake/p-620ec1a3.entry.js +0 -2
  294. package/dist/crmbonus-component-wake/p-620ec1a3.entry.js.map +0 -1
  295. package/dist/crmbonus-component-wake/p-6276ee63.entry.js +0 -2
  296. package/dist/crmbonus-component-wake/p-6276ee63.entry.js.map +0 -1
  297. package/dist/crmbonus-component-wake/p-74206c91.entry.js +0 -2
  298. package/dist/crmbonus-component-wake/p-74206c91.entry.js.map +0 -1
  299. package/dist/crmbonus-component-wake/p-75ba7b9a.js +0 -2
  300. package/dist/crmbonus-component-wake/p-75ba7b9a.js.map +0 -1
  301. package/dist/crmbonus-component-wake/p-7751b4be.entry.js +0 -2
  302. package/dist/crmbonus-component-wake/p-7751b4be.entry.js.map +0 -1
  303. package/dist/crmbonus-component-wake/p-7b7fb354.entry.js +0 -2
  304. package/dist/crmbonus-component-wake/p-7b7fb354.entry.js.map +0 -1
  305. package/dist/crmbonus-component-wake/p-7cfea8fe.js +0 -2
  306. package/dist/crmbonus-component-wake/p-7cfea8fe.js.map +0 -1
  307. package/dist/crmbonus-component-wake/p-885fc30e.entry.js +0 -2
  308. package/dist/crmbonus-component-wake/p-885fc30e.entry.js.map +0 -1
  309. package/dist/crmbonus-component-wake/p-90716188.entry.js +0 -2
  310. package/dist/crmbonus-component-wake/p-90716188.entry.js.map +0 -1
  311. package/dist/crmbonus-component-wake/p-b7a8f915.entry.js +0 -2
  312. package/dist/crmbonus-component-wake/p-b7a8f915.entry.js.map +0 -1
  313. package/dist/crmbonus-component-wake/p-b873347f.entry.js +0 -2
  314. package/dist/crmbonus-component-wake/p-b873347f.entry.js.map +0 -1
  315. package/dist/crmbonus-component-wake/p-ba369e65.js +0 -2
  316. package/dist/crmbonus-component-wake/p-ba369e65.js.map +0 -1
  317. package/dist/crmbonus-component-wake/p-be3ddacc.entry.js +0 -2
  318. package/dist/crmbonus-component-wake/p-be3ddacc.entry.js.map +0 -1
  319. package/dist/crmbonus-component-wake/p-c44e2f02.js +0 -2
  320. package/dist/crmbonus-component-wake/p-c44e2f02.js.map +0 -1
  321. package/dist/crmbonus-component-wake/p-e1255160.js +0 -2
  322. package/dist/crmbonus-component-wake/p-e1255160.js.map +0 -1
  323. package/dist/crmbonus-component-wake/p-e8c19a64.js +0 -2
  324. package/dist/crmbonus-component-wake/p-e8c19a64.js.map +0 -1
  325. package/dist/crmbonus-component-wake/p-f9aeffc1.js +0 -2
  326. package/dist/crmbonus-component-wake/p-f9aeffc1.js.map +0 -1
  327. package/dist/env.js +0 -5
  328. package/dist/env.js.map +0 -1
  329. package/dist/esm/app-modal.entry.js.map +0 -1
  330. package/dist/esm/countdown-timer_2.entry.js +0 -58
  331. package/dist/esm/countdown-timer_2.entry.js.map +0 -1
  332. package/dist/esm/crm-bonus-form.entry.js.map +0 -1
  333. package/dist/esm/crm-bonus-note.entry.js.map +0 -1
  334. package/dist/esm/crm-bonus.entry.js.map +0 -1
  335. package/dist/esm/crm-giftback-form_2.entry.js.map +0 -1
  336. package/dist/esm/crm-tooltip_4.entry.js +0 -204
  337. package/dist/esm/crm-tooltip_4.entry.js.map +0 -1
  338. package/dist/esm/crmbonus-component-wake.js +0 -22
  339. package/dist/esm/crmbonus-component-wake.js.map +0 -1
  340. package/dist/esm/crmbonus.service-774ebe83.js.map +0 -1
  341. package/dist/esm/giftback-finish_4.entry.js +0 -124
  342. package/dist/esm/giftback-finish_4.entry.js.map +0 -1
  343. package/dist/esm/index-e8724c8f.js +0 -1571
  344. package/dist/esm/index-e8724c8f.js.map +0 -1
  345. package/dist/esm/index.js +0 -3
  346. package/dist/esm/index.js.map +0 -1
  347. package/dist/esm/loader.js +0 -13
  348. package/dist/esm/loader.js.map +0 -1
  349. package/dist/esm/loading-spinner.entry.js.map +0 -1
  350. package/dist/esm/pedido-finalizado.entry.js +0 -32
  351. package/dist/esm/pedido-finalizado.entry.js.map +0 -1
  352. package/dist/esm/phone-cancel-input.entry.js.map +0 -1
  353. package/dist/esm/phone-input-mask.entry.js.map +0 -1
  354. package/dist/esm/phone-input.entry.js.map +0 -1
  355. package/dist/esm/utils-d642b4db.js +0 -21
  356. package/dist/esm/utils-d642b4db.js.map +0 -1
  357. package/dist/index.cjs.js +0 -1
  358. package/dist/index.js +0 -1
  359. /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js +0 -0
  360. /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js.map +0 -0
  361. /package/dist/{esm → crmbonus-component-wake}/index-5b567099.js +0 -0
  362. /package/dist/{esm → crmbonus-component-wake}/index-5b567099.js.map +0 -0
  363. /package/dist/{esm → crmbonus-component-wake}/info.config.helper-42d9ddf9.js +0 -0
  364. /package/dist/{esm → crmbonus-component-wake}/info.config.helper-42d9ddf9.js.map +0 -0
  365. /package/dist/{esm → crmbonus-component-wake}/keys.storage-8c76fcd7.js +0 -0
  366. /package/dist/{esm → crmbonus-component-wake}/keys.storage-8c76fcd7.js.map +0 -0
@@ -1,28 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-d11684bd.js');
6
-
7
- const appModalCss = ".modal-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);display:none;justify-content:center;align-items:center;z-index:1000}.modal-backdrop.visible{display:flex}.modal{background:white;border-radius:8px;padding:1rem;max-width:500px;width:90%;box-shadow:0 2px 10px rgba(0, 0, 0, 0.3)}.modal-header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #ddd;margin-bottom:1rem}.close-button{background:none;border:none;font-size:1.5rem;cursor:pointer}.modal-body{}";
8
- const AppModalStyle0 = appModalCss;
9
-
10
- const AppModal = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.modalClosed = index.createEvent(this, "modalClosed", 7);
14
- this.isOpen = false;
15
- this.modalTitle = undefined;
16
- }
17
- closeModal() {
18
- this.modalClosed.emit();
19
- }
20
- render() {
21
- return (index.h("div", { key: '3f44609d2835224eea0668475f6851eab807cfce', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, index.h("div", { key: 'c7998d2ab6ce04ce722a52712267b0493495cb29', class: "modal" }, index.h("div", { key: 'dcc7438d690866d20972f04c6c9ad39f4f2e84da', class: "modal-header" }, index.h("h3", { key: '0257c585eeec3daf72b7b371b557ae699891dba9' }, this.modalTitle), index.h("button", { key: 'e0b4f89907a4da774c021bcc3797f5b2fb1f0c0e', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), index.h("div", { key: 'e9efd84c1fd89da8b9df15970b71beae66ea6fb8', class: "modal-body" }, index.h("slot", { key: '6e3371866a4a2adf86a04e30e7a1ed843e7492fb' })))));
22
- }
23
- };
24
- AppModal.style = AppModalStyle0;
25
-
26
- exports.app_modal = AppModal;
27
-
28
- //# sourceMappingURL=app-modal.cjs.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"app-modal.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,WAAW,GAAG,+hBAA+hB,CAAC;AACpjB,uBAAe,WAAW;;MCMb,QAAQ;;;;sBAG0B,KAAK;;;IAQxC,UAAU;QACd,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;KAC3B;IAED,MAAM;QACF,QACIA,kEAAK,KAAK,EAAE,kBAAkB,IAAI,CAAC,MAAM,GAAG,SAAS,GAAG,EAAE,EAAE,IACxDA,kEAAK,KAAK,EAAC,OAAO,IACdA,kEAAK,KAAK,EAAC,cAAc,IACrBA,mEAAK,IAAI,CAAC,UAAU,CAAM,EAC1BA,qEAAQ,KAAK,EAAC,cAAc,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,aAEpD,CACP,EACNA,kEAAK,KAAK,EAAC,YAAY,IACnBA,oEAAQ,CACN,CACJ,CACJ,EACT;KACJ;;;;;;","names":["h"],"sources":["src/components/modal/app-modal.css?tag=app-modal&encapsulation=shadow","src/components/modal/app-modal.tsx"],"sourcesContent":[".modal-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: none;\n justify-content: center;\n align-items: center;\n z-index: 1000;\n }\n \n .modal-backdrop.visible {\n display: flex;\n }\n \n .modal {\n background: white;\n border-radius: 8px;\n padding: 1rem;\n max-width: 500px;\n width: 90%;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);\n }\n \n .modal-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid #ddd;\n margin-bottom: 1rem;\n }\n \n .close-button {\n background: none;\n border: none;\n font-size: 1.5rem;\n cursor: pointer;\n }\n \n .modal-body {\n /* padding: 1rem 0; */\n }\n ","import { Component, Event, EventEmitter, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'app-modal',\n styleUrl: 'app-modal.css',\n shadow: true,\n})\nexport class AppModal {\n\n // Controle da visibilidade do modal\n @Prop({ reflect: true }) isOpen: boolean = false;\n\n // Título do modal\n @Prop() modalTitle: string;\n\n // Evento emitido ao fechar o modal\n @Event() modalClosed: EventEmitter<void>;\n\n private closeModal() {\n this.modalClosed.emit();\n }\n\n render() {\n return (\n <div class={`modal-backdrop ${this.isOpen ? 'visible' : ''}`}>\n <div class=\"modal\">\n <div class=\"modal-header\">\n <h3>{this.modalTitle}</h3>\n <button class=\"close-button\" onClick={() => this.closeModal()}>\n ×\n </button>\n </div>\n <div class=\"modal-body\">\n <slot />\n </div>\n </div>\n </div>\n )\n }\n}"],"version":3}
@@ -1,63 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-d11684bd.js');
6
-
7
- const CountdownTimer = class {
8
- constructor(hostRef) {
9
- index.registerInstance(this, hostRef);
10
- this.downtime = undefined;
11
- this.initialValue = 0;
12
- this.seconds = 0;
13
- }
14
- componentWillLoad() {
15
- const initial = localStorage.getItem("bc:time");
16
- this.seconds = initial ? Number(initial) : this.initialValue;
17
- this.intervalId = setInterval(() => {
18
- if (this.seconds > 0) {
19
- this.seconds--;
20
- localStorage.setItem("bc:time", this.seconds.toString());
21
- }
22
- else {
23
- clearInterval(this.intervalId);
24
- this.downtime();
25
- localStorage.removeItem("bc:time");
26
- }
27
- }, 1000); // Intervalo de 1 segundo
28
- }
29
- disconnectedCallback() {
30
- clearInterval(this.intervalId);
31
- }
32
- padLeft() {
33
- const minutes = this.seconds / 60;
34
- const seconds = this.seconds % 60;
35
- if (minutes < 1)
36
- return `${seconds}s`;
37
- return `${parseInt(minutes.toString())}m ${seconds}s`;
38
- }
39
- render() {
40
- return (index.h("label", { key: '6fe8811ce04f0f95d31404c2257124f454ab3cfa' }, this.padLeft()));
41
- }
42
- };
43
-
44
- const crmButtonCss = "input,button{margin:0;padding:10px;}.crm-contaner-button{height:auto;width:auto}.crm-button{height:48px;width:100%;border:1px solid #000;padding:14px 20px;background-color:#000;color:#fff;font-size:14px;line-height:20px;font-weight:500;cursor:pointer}";
45
- const CrmButtonStyle0 = crmButtonCss;
46
-
47
- const Button = class {
48
- constructor(hostRef) {
49
- index.registerInstance(this, hostRef);
50
- this.txtBtn = undefined;
51
- this.loading = undefined;
52
- this.handleClick = undefined;
53
- }
54
- render() {
55
- return (index.h("div", { key: '848df9f754a114343163eae85d34a2acb6b04863', class: "crm-contaner-button" }, index.h("button", { key: '517b761b39ced2615dd04fc42d5aaa98a7d749f6', class: "crm-button", onClick: () => this.handleClick() }, !this.loading ? this.txtBtn : index.h("loading-spinner", { size: "15px", color: "#fff" }))));
56
- }
57
- };
58
- Button.style = CrmButtonStyle0;
59
-
60
- exports.countdown_timer = CountdownTimer;
61
- exports.crm_button = Button;
62
-
63
- //# sourceMappingURL=countdown-timer_2.cjs.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"countdown-timer.crm-button.entry.cjs.js","mappings":";;;;;;MAMa,cAAc;;;;4BAGQ,CAAC;uBAEL,CAAC;;IAI5B,iBAAiB;QACb,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEhD,IAAI,CAAC,OAAO,GAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QAE9D,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC;YAC1B,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE;gBAClB,IAAI,CAAC,OAAO,EAAE,CAAC;gBAEf,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC5D;iBAAM;gBACH,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAEhB,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;aACtC;SACJ,EAAE,IAAI,CAAC,CAAC;KACZ;IAED,oBAAoB;QAChB,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAClC;IAED,OAAO;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAElC,IAAG,OAAO,GAAG,CAAC;YAAE,OAAO,GAAG,OAAO,GAAG,CAAA;QAEpC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,OAAO,GAAG,CAAA;KACxD;IAED,MAAM;QACF,QACIA,sEAAQ,IAAI,CAAC,OAAO,EAAE,CAAS,EACjC;KACL;;;ACpDL,MAAM,YAAY,GAAG,6PAA6P,CAAC;AACnR,wBAAe,YAAY;;MCKd,MAAM;;;;;;;IAOf,MAAM;QACF,QACIA,kEAAK,KAAK,EAAC,qBAAqB,IAC5BA,qEAAQ,KAAK,EAAC,YAAY,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,IAEpD,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,GAAGA,6BAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEzE,CACP,EACT;KACJ;;;;;;;","names":["h"],"sources":["src/components/countdown-timer/countdown-timer.tsx","src/components/button/crm-button.css?tag=crm-button","src/components/button/index.tsx"],"sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'countdown-timer',\n shadow: true,\n})\nexport class CountdownTimer {\n\n @Prop() downtime: () => void;\n @Prop() initialValue: number = 0;\n\n @State() seconds: number = 0;\n\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n const initial = localStorage.getItem(\"bc:time\");\n\n this.seconds = initial ? Number(initial) : this.initialValue;\n \n this.intervalId = setInterval(() => {\n if (this.seconds > 0) {\n this.seconds--;\n\n localStorage.setItem(\"bc:time\", this.seconds.toString());\n } else {\n clearInterval(this.intervalId);\n\n this.downtime();\n\n localStorage.removeItem(\"bc:time\");\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n padLeft() {\n const minutes = this.seconds / 60; \n const seconds = this.seconds % 60;\n\n if(minutes < 1) return `${seconds}s`\n \n return `${parseInt(minutes.toString())}m ${seconds}s`\n }\n\n render() {\n return (\n <label>{this.padLeft()}</label>\n );\n }\n}\n","input, button {\n margin: 0;\n padding: 10px; /* Ajuste o valor conforme necessário */\n}\n\n.crm-contaner-button {\n height: auto;\n width: auto;\n}\n\n.crm-button {\n height: 48px;\n width: 100%;\n border: 1px solid #000;\n padding: 14px 20px;\n background-color: #000;\n color: #fff;\n font-size: 14px;\n line-height: 20px;\n font-weight: 500;\n cursor: pointer;\n}","import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'crm-button',\n styleUrl: 'crm-button.css'\n})\nexport class Button {\n\n @Prop() txtBtn: string;\n @Prop() loading: boolean;\n\n @Prop() handleClick: () => void;\n\n render() {\n return (\n <div class=\"crm-contaner-button\">\n <button class=\"crm-button\" onClick={() => this.handleClick()}>\n {\n !this.loading ? this.txtBtn : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"],"version":3}
@@ -1,104 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-d11684bd.js');
6
- const crmbonus_service = require('./crmbonus.service-b31b7396.js');
7
- const index$1 = require('./index-6054ed44.js');
8
- require('./keys.storage-de7744aa.js');
9
-
10
- const crmBonusFormCss = ".form-container{width:100%;display:flex;justify-content:center;justify-content:space-around}.disabled{opacity:0.6;cursor:not-allowed}.message-error{color:#d11111;font-weight:bold;font-family:Arial;font-size:small;margin-left:16px}";
11
- const CrmBonusFormStyle0 = crmBonusFormCss;
12
-
13
- const CrmBonusForm = class {
14
- constructor(hostRef) {
15
- index.registerInstance(this, hostRef);
16
- this.crmBonusService = crmbonus_service.CrmBonusService.getInstance();
17
- this.storeName = undefined;
18
- this.cartId = undefined;
19
- this.products = undefined;
20
- this.customer = {
21
- phone: "",
22
- birthDate: "",
23
- document: "",
24
- name: ""
25
- };
26
- this.sent = undefined;
27
- this.stepNext = undefined;
28
- this.phone = undefined;
29
- this.loadingModal = undefined;
30
- this.saveStore = undefined;
31
- this.cancel = undefined;
32
- this.handleCustomerName = undefined;
33
- this.loading = false;
34
- this.step = index$1.StepFormEnum.STEP_NAME;
35
- this.message = undefined;
36
- this.bonus = undefined;
37
- }
38
- async setStep(step) {
39
- this.step = step;
40
- }
41
- async validateBonus(pin) {
42
- var _a, _b;
43
- this.loading = true;
44
- this.message = "";
45
- const payload = {
46
- pin: pin,
47
- cellphone: parseInt(this.phone.toString()),
48
- storeId: this.sent.storeId.toString(),
49
- userId: this.sent.userId.toString(),
50
- checkoutId: this.cartId,
51
- checkoutProducts: this.products,
52
- name: null,
53
- storeName: this.storeName
54
- };
55
- try {
56
- this.bonus = await this.crmBonusService.validatePinBonus(payload);
57
- this.step = index$1.StepFormEnum.STEP_RESERVE;
58
- }
59
- catch (error) {
60
- this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
61
- }
62
- finally {
63
- this.loading = false;
64
- }
65
- }
66
- async reserveApply(amount) {
67
- this.loading = true;
68
- this.message = "";
69
- try {
70
- await this.reserve(amount);
71
- this.step = index$1.StepFormEnum.STEP_APPLY;
72
- this.saveStore(amount);
73
- }
74
- catch (error) {
75
- this.message = "ocorreu um error ao solicitar a aplicação do bonus! tente novamente";
76
- }
77
- finally {
78
- this.loading = false;
79
- }
80
- }
81
- async reserve(amount) {
82
- await this.crmBonusService.reserve({
83
- redeemedBonus: amount,
84
- cartId: this.cartId,
85
- ticket: this.cartId,
86
- grossValue: Number(this.bonus.totalValue),
87
- storeName: this.storeName,
88
- storeId: this.bonus.storeId.toString(),
89
- userId: this.bonus.userId
90
- });
91
- }
92
- handleCancel() {
93
- this.step = index$1.StepFormEnum.STEP_PHONE;
94
- this.cancel();
95
- }
96
- render() {
97
- return (index.h(index.Host, { key: '2d736cd603436521bf15f0ef8eaf0670ad9f6a42' }, this.step == index$1.StepFormEnum.STEP_NAME && index.h("name-input", { key: 'bfa12463c1f29bb65814368790f201dcab869dd9', loading: this.loadingModal, value: this.customer.name, applyName: (name) => this.handleCustomerName(name) }), this.step === index$1.StepFormEnum.STEP_PIN && index.h("giftback-pin", { key: '3fdf1c285b5d777289b42fcfbcf80dfc92579f29', cancel: () => this.handleCancel(), sent: this.sent, validate: (data) => this.validateBonus(data), loading: this.loading }), this.step === index$1.StepFormEnum.STEP_RESERVE && index.h("giftback-progress", { key: 'f06df8cab7361a51d1b89b4f0f0a1a8ceb7a7e30', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserveApply(amountRedeemed) }), this.step === index$1.StepFormEnum.STEP_APPLY && index.h("giftback-finish", { key: 'eaacf1438652b04cfd607e5bac81dffbe4b542bb' }), index.h("p", { key: 'a2014780bbb5dfb23cf6165500f43c6fcca700d3', class: "message-error" }, this.message)));
98
- }
99
- };
100
- CrmBonusForm.style = CrmBonusFormStyle0;
101
-
102
- exports.crm_bonus_form = CrmBonusForm;
103
-
104
- //# sourceMappingURL=crm-bonus-form.cjs.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"crm-bonus-form.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,eAAe,GAAG,wOAAwO,CAAC;AACjQ,2BAAe,eAAe;;MCUjB,YAAY;;;QAEb,oBAAe,G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c,MAAM,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,GAAI,EAEhL,IAAI,CAAC,IAAI,KAAKD,oBAAY,CAAC,YAAY,IAAIC,gFAAmB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,cAAsB,KAAK,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,GAAI,EACrN,IAAI,CAAC,IAAI,KAAKD,oBAAY,CAAC,UAAU,IAAIC,+EAAmB,EAC7DA,gEAAG,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,OAAO,CAAK,CACxC,EACV;KACJ;;;;;;","names":["CrmBonusService","StepFormEnum","h","Host"],"sources":["src/components/crm-bonus-form/crm-bonus-form.css?tag=crm-bonus-form&encapsulation=shadow","src/components/crm-bonus-form/crm-bonus-form.tsx"],"sourcesContent":[".form-container {\n width: 100%;\n display: flex;\n justify-content: center;\n justify-content: space-around;\n}\n\n.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.message-error {\n color: #d11111;\n font-weight: bold;\n font-family: Arial;\n font-size: small;\n margin-left: 16px;\n}","import { Component, Host, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent';\n\n@Component({\n tag: 'crm-bonus-form',\n styleUrl: 'crm-bonus-form.css',\n shadow: true\n})\nexport class CrmBonusForm {\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer = {\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n };\n @Prop() sent: IPinSent;\n @Prop() stepNext: StepFormEnum;\n @Prop() phone: number;\n @Prop() loadingModal: boolean;\n\n @Prop() saveStore: (amount: number) => void;\n\n @Prop() cancel: () => void;\n\n @Prop() handleCustomerName: (name: string) => void;\n\n @State() loading: boolean = false;\n\n @State() step: number = StepFormEnum.STEP_NAME;\n\n @State() message: string;\n\n @State() bonus: IBonus;\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n public async validateBonus(pin: string) {\n this.loading = true;\n this.message = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: parseInt(this.phone.toString()),\n storeId: this.sent.storeId.toString(),\n userId: this.sent.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: null,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload);\n\n this.step = StepFormEnum.STEP_RESERVE;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false;\n }\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n\n this.step = StepFormEnum.STEP_APPLY;\n\n this.saveStore(amount);\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserve(amount: number) {\n await this.crmBonusService.reserve({\n redeemedBonus: amount,\n cartId: this.cartId,\n ticket: this.cartId,\n grossValue: Number(this.bonus.totalValue),\n storeName: this.storeName,\n storeId: this.bonus.storeId.toString(),\n userId: this.bonus.userId\n });\n }\n\n public handleCancel() {\n this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n render() {\n return (\n <Host>\n {/* {this.step === StepFormEnum.STEP_PHONE && <phone-input value={this.customer.phone} sendPin={(phone) => this.sendPin(phone)} loading={this.loading} />} */}\n \n {this.step == StepFormEnum.STEP_NAME && <name-input loading={this.loadingModal} value={this.customer.name} applyName={(name) => this.handleCustomerName(name)} />}\n {this.step === StepFormEnum.STEP_PIN && <giftback-pin cancel={() => this.handleCancel()} sent={this.sent} validate={(data) => this.validateBonus(data)} loading={this.loading} />}\n\n {this.step === StepFormEnum.STEP_RESERVE && <giftback-progress loading={this.loading} cancel={() => this.handleCancel()} bonus={this.bonus} reserve={(amountRedeemed: number) => this.reserveApply(amountRedeemed)} />}\n {this.step === StepFormEnum.STEP_APPLY && <giftback-finish />}\n <p class=\"message-error\">{this.message}</p>\n </Host>\n )\n }\n}"],"version":3}
@@ -1,98 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-d11684bd.js');
6
- const info_config_helper = require('./info.config.helper-c5d9f781.js');
7
- const keys_storage = require('./keys.storage-de7744aa.js');
8
- const i18n = require('./i18n-f2a6f60e.js');
9
-
10
- const moneyDollarsSvgrepoComSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiLz4KPHBhdGggZD0iTTE1IDkuOTQ3MjhDMTQuNSA5LjMgMTMuOCA4LjUgMTIgOC41QzEwLjIgOC41IDkgOS41MTM5MyA5IDkuOTQ3MjhDOSAxMC4zODA2IDkuMDY3ODYgMTAuOTI3NyAxMCAxMS41QzEwLjc1MjIgMTEuOTYxOCAxMi42Njg0IDEyLjA0MzkgMTMuNSAxMi41QzE0LjY3OSAxMy4xNDY3IDE0Ljg0OTcgMTMuODIwMiAxNC44NDk3IDE0LjA1MjJDMTQuODQ5NyAxNC42ODM3IDEzLjQxNzUgMTUuNDg1MiAxMiAxNS41QzEwLjUzNiAxNS41MTUzIDkuNSAxNC43IDkgMTQuMDUyMiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTIgN1YxNyIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPg==';
11
-
12
- function setTime() {
13
- if (localStorage.getItem("bc:time-allow")) {
14
- return;
15
- }
16
- const time = localStorage.getItem("bc:time");
17
- if (!time) {
18
- localStorage.setItem("bc:time", "360");
19
- localStorage.setItem("bc:time-allow", "true");
20
- return;
21
- }
22
- }
23
-
24
- const crmBonusNoteCss = ".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\n}\n\n.note-container hr {\n border: 1px solid #CCC;\n}\n\n.note-container .back-cart {\n display: flex;\n text-align: center;\n}\n\n.note-header {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n}\n\n.note-title {\n font-weight: 700;\n text-align: left;\n display: flex;\n gap: 6px;\n align-items: center;\n margin-top: 11px;\n color: #000;\n}\n\n.note-description {\n font-family: Arial;\n color: #6d6d5f;\n padding: 0;\n margin: 0 auto;\n}\n\n.back-cart {\n font-size: .9em;\n color: #27272A;\n text-decoration: none;\n cursor: pointer;\n margin-top: 11px;\n}\n\n.note-description-2 {\n color: var(--crm-scheme-fg-main-inverse, #262626);\n font-family: Roboto;\n font-size: var(--crm-font-size-body-lg, 16px);\n font-style: normal;\n font-weight: var(--crm-font-weight-body-bold, 400);\n line-height: var(--crm-line-height-body-md, 20px);\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\n margin-top: 11px;\n color: #000;\n}\n\n.note-description-not {\n font-size: 16px;\n}";
25
- const CrmBonusNoteStyle0 = crmBonusNoteCss;
26
-
27
- const CrmBonusNote = class {
28
- constructor(hostRef) {
29
- index.registerInstance(this, hostRef);
30
- this.cartId = undefined;
31
- this.storename = undefined;
32
- this.url = undefined;
33
- this.config = undefined;
34
- this.bonus = undefined;
35
- this.showEdit = false;
36
- }
37
- componentWillLoad() {
38
- this.upadateCheckToFreteAndGetUrl();
39
- this.startTime();
40
- }
41
- upadateCheckToFreteAndGetUrl() {
42
- this.config = info_config_helper.getInfoCustomization(this.storename);
43
- const envios = document.getElementsByName('forma-envio');
44
- envios.forEach((envio) => {
45
- envio.checked = false;
46
- });
47
- this.url = window.location.origin;
48
- }
49
- handleHide() {
50
- const amount = localStorage.getItem(this.cartId);
51
- return !!amount;
52
- }
53
- getAmount() {
54
- const amount = localStorage.getItem(this.cartId);
55
- return amount ? Number(amount).toFixed(2).replace(".", ",") || "0,00" : "0,00";
56
- }
57
- async backCart() {
58
- window.location.href = this.url;
59
- }
60
- startTime() {
61
- if (document.location.pathname == '/Fechamento') {
62
- if (!localStorage.getItem("bc:time-allow")) {
63
- localStorage.removeItem("bc:time");
64
- }
65
- setTime();
66
- }
67
- }
68
- hasBonus() {
69
- const _bonus = localStorage.getItem(keys_storage.getKeyReserveByCartId(this.cartId));
70
- const info = {
71
- hasBonus: false,
72
- requestBonus: false
73
- };
74
- if (_bonus) {
75
- this.bonus = JSON.parse(_bonus);
76
- info.hasBonus = this.bonus.hasBonus;
77
- info.requestBonus = true;
78
- }
79
- return info;
80
- }
81
- getTime() {
82
- const time = localStorage.getItem("bc:time");
83
- return time ? Number(time) : 0;
84
- }
85
- render() {
86
- const giftbackname = this.config.giftbackTitle || "Giftback";
87
- const infobonus = this.hasBonus();
88
- return (index.h("div", { key: '5e6af682c8a1d449c7b44372cc8392c23d3b8c37' }, index.h("div", { key: 'fdaac56b3f905ccd34ac19f8d26472d13f2e6060', class: "note-container" }, index.h("div", { key: '532921493fa0e6d84628ce344a04c7f3e4c1188b', class: "note-header" }, index.h("p", { key: '09fb8be7eb83b7e5a2cad2a6c8e4ac42bcc8843f', class: "note-title" }, index.h("img", { key: 'b50b4bb1d2b087fdf51d94b66a7618156f4e02b8', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (index.h("div", { key: 'c4bbcfac356814745248ca0e03b31691dbbfc68e' }, this.showEdit && (index.h("p", { key: '8139ff2556944583c367106d205de783a68793d8', class: "back-cart", onClick: () => this.backCart() }, i18n.instance.t("edit"))), !this.showEdit && index.h("countdown-timer", { key: '9720653f739eadc70b4f44c44f9c10c215350fe4', initialValue: this.getTime(), downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
89
- (index.h("p", { key: 'e0a6d0b9aa09699aeaf86633d9a24fe7550ffbe6', class: "note-description-2" }, i18n.instance.t("withApplyBonus", { giftbackname: giftbackname }), " ", index.h("strong", { key: '39728d345ed3cbcf76be108e894095bc0b6f844c' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
90
- (index.h("p", { key: 'a92ac10c9e2db555a0244497c5be9654f17cb53b', class: "note-description-not" }, i18n.instance.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
91
- (index.h("div", { key: 'fe95768f91165bd89f4eed467f69122e1c0a2d49', class: "description" }, index.h("p", { key: 'fe0360269c159032c1b8cab772b4613900dd6ce3', class: "note-description-not" }, i18n.instance.t("backCart")), index.h("crm-button", { key: 'da883a2fc5bb08f0435ce4493619c6a9952e6391', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
92
- }
93
- };
94
- CrmBonusNote.style = CrmBonusNoteStyle0;
95
-
96
- exports.crm_bonus_note = CrmBonusNote;
97
-
98
- //# sourceMappingURL=crm-bonus-note.cjs.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"crm-bonus-note.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,4gCAA4gC;;SCA9hC,OAAO;IAEnB,IAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACtC,OAAM;KACT;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAE7C,IAAG,CAAC,IAAI,EAAE;QACN,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QACvC,YAAY,CAAC,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAM;KACT;AACL;;ACbA,MAAM,eAAe,GAAG,i3CAAi3C,CAAC;AAC14C,2BAAe,eAAe;;MCYjB,YAAY;;;;;;;;wBAUQ,KAAK;;IAElC,iBAAiB;QACb,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACpC,IAAI,CAAC,SAAS,EAAE,CAAC;KACpB;IAED,4BAA4B;QAExB,IAAI,CAAC,MAAM,GAAGA,uCAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,QAAQ,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QACzD,MAAM,CAAC,OAAO,CAAC,CAAC,KAAU;YACtB,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;SACzB,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;KACrC;IAED,UAAU;QACN,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO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CAAC,UAAU,CAAC,CACtB,EACJF,yEAAY,MAAM,EAAC,oBAAoB,EAAC,WAAW,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,EACT;KACJ;;;;;;","names":["getInfoCustomization","getKeyReserveByCartId","h","money","i18next"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","src/components/note/crm-bonus-note.css?tag=crm-bonus-note","src/components/note/crm-bonus-note.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\n<path d=\"M15 9.94728C14.5 9.3 13.8 8.5 12 8.5C10.2 8.5 9 9.51393 9 9.94728C9 10.3806 9.06786 10.9277 10 11.5C10.7522 11.9618 12.6684 12.0439 13.5 12.5C14.679 13.1467 14.8497 13.8202 14.8497 14.0522C14.8497 14.6837 13.4175 15.4852 12 15.5C10.536 15.5153 9.5 14.7 9 14.0522\" stroke=\"#000000\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\n}\n\n.note-container hr {\n border: 1px solid #CCC;\n}\n\n.note-container .back-cart {\n display: flex;\n text-align: center;\n}\n\n.note-header {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n}\n\n.note-title {\n font-weight: 700;\n text-align: left;\n display: flex;\n gap: 6px;\n align-items: center;\n margin-top: 11px;\n color: #000;\n}\n\n.note-description {\n font-family: Arial;\n color: #6d6d5f;\n padding: 0;\n margin: 0 auto;\n}\n\n.back-cart {\n font-size: .9em;\n color: #27272A;\n text-decoration: none;\n cursor: pointer;\n margin-top: 11px;\n}\n\n.note-description-2 {\n color: var(--crm-scheme-fg-main-inverse, #262626);\n font-family: Roboto;\n font-size: var(--crm-font-size-body-lg, 16px);\n font-style: normal;\n font-weight: var(--crm-font-weight-body-bold, 400);\n line-height: var(--crm-line-height-body-md, 20px);\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\n margin-top: 11px;\n color: #000;\n}\n\n.note-description-not {\n font-size: 16px;\n}","import { Component, Prop, State, h } from \"@stencil/core\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport money from '../../assets/svg/money-dollars-svgrepo-com.svg'\nimport { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @Prop({ attribute: 'cartid' }) cartId;\n @Prop({ attribute: \"storename\" }) storename;\n\n @State() url: string;\n @State() config: IInfoStore;\n\n @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\n }\n\n upadateCheckToFreteAndGetUrl() {\n\n this.config = getInfoCustomization(this.storename);\n const envios = document.getElementsByName('forma-envio');\n envios.forEach((envio: any) => {\n envio.checked = false;\n });\n\n this.url = window.location.origin;\n }\n\n handleHide() {\n const amount = localStorage.getItem(this.cartId);\n return !!amount;\n }\n\n getAmount() {\n const amount = localStorage.getItem(this.cartId);\n\n return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n getTime() {\n const time = localStorage.getItem(\"bc:time\")\n \n return time ? Number(time) : 0;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\n\n return (\n <div>\n <div class=\"note-container\">\n <div class=\"note-header\">\n\n <p class=\"note-title\">\n <img src={money} width={23} />\n {this.config.giftbackTitle}\n </p>\n {\n infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={this.getTime()} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"],"version":3}
@@ -1,252 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-d11684bd.js');
6
- const crmbonus_service = require('./crmbonus.service-b31b7396.js');
7
- const index$1 = require('./index-6054ed44.js');
8
- const i18n = require('./i18n-f2a6f60e.js');
9
- require('./keys.storage-de7744aa.js');
10
-
11
- var AjustesTipoEnum;
12
- (function (AjustesTipoEnum) {
13
- AjustesTipoEnum["P"] = "Promocao";
14
- })(AjustesTipoEnum || (AjustesTipoEnum = {}));
15
-
16
- function buildProductsByWake(productsWake = []) {
17
- const products = [];
18
- for (const pw of productsWake) {
19
- let discounts = getDiscount(pw.Ajustes);
20
- products.push({
21
- sku: pw.SKU,
22
- value: (pw.PrecoPor * pw.Quantidade),
23
- productVariantId: pw.ProdutoVarianteId.toString(),
24
- quantity: pw.Quantidade,
25
- discount: (discounts * -1)
26
- });
27
- }
28
- return products;
29
- }
30
- function getDiscount(ajustes = []) {
31
- let discounts = 0;
32
- for (const discount of ajustes) {
33
- if (discount.Tipo === AjustesTipoEnum.P) {
34
- discounts += discount.Valor;
35
- }
36
- }
37
- return discounts;
38
- }
39
-
40
- const crmBonusCss = ".container-button.sc-crm-bonus{cursor:pointer;padding:5px 5px 5px 14px}.section-crm.sc-crm-bonus{border:1px solid #dbd4d4;text-align:-webkit-center;margin-bottom:20px}.section-cart-crm.sc-crm-bonus{margin-top:10px}.section-cart-crm.sc-crm-bonus p.sc-crm-bonus{padding:0;margin:0px 0px 0px 15px}.button.sc-crm-bonus{top:50%;background-color:#6c6c7e;color:#fff;border:none;padding:15px;min-height:30px;min-width:120px;font-size:20px;cursor:pointer;margin-left:10px;height:70px}.form-container.sc-crm-bonus{width:97%;display:flex;justify-content:space-around}.btn.sc-crm-bonus{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:0px}.form-container.sc-crm-bonus .btnCrm.sc-crm-bonus{background:#00162e;border-color:#00162e;width:30%;color:#fff}.message-alert.sc-crm-bonus{font-family:sans-serif;color:#df4d4d;margin-top:5px}";
41
- const CrmBonusStyle0 = crmBonusCss;
42
-
43
- const CrmBonus = class {
44
- constructor(hostRef) {
45
- index.registerInstance(this, hostRef);
46
- this.crmBonusService = crmbonus_service.CrmBonusService.getInstance();
47
- this.showModal = false;
48
- this.userId = undefined;
49
- this.storeName = undefined;
50
- this.productsInString = undefined;
51
- this.cartId = undefined;
52
- this.products = undefined;
53
- this.customer = {
54
- birthDate: "",
55
- document: "",
56
- name: "",
57
- phone: ""
58
- };
59
- this.loading = false;
60
- this.message = undefined;
61
- this.phone = undefined;
62
- this.canCancel = false;
63
- this.amountCancel = undefined;
64
- this.sent = undefined;
65
- this.session = undefined;
66
- this.loading_reprocess = false;
67
- }
68
- async resetBonus() {
69
- console.log('[START RESET BONUS]!!!!!');
70
- // const used = localStorage.getItem("bc:used");
71
- // if (used == "use") {
72
- // await this.crmBonusService.cancelBonus(this.cartId, this.storeName);
73
- // }
74
- try {
75
- await this.crmBonusRef.processBonus(this.buildProducts(), true);
76
- console.log('[BONUS RESETADO]!!!!!');
77
- }
78
- catch (err) {
79
- this.loading = false;
80
- console.log('[error ao reprocessar bonous]');
81
- await this.crmBonusRef.setStep(index$1.StepFormEnum.STEP_PHONE);
82
- }
83
- finally {
84
- this.loading = false;
85
- }
86
- }
87
- async reprocess(products) {
88
- this.loading_reprocess = true;
89
- try {
90
- this.productsInString = JSON.stringify(products);
91
- await this.handleLoad();
92
- await this.resetBonus();
93
- }
94
- catch (err) {
95
- console.debug('[watchProducts]', err.message);
96
- }
97
- finally {
98
- this.loading_reprocess = false;
99
- }
100
- }
101
- async watchProducts(newValue) {
102
- try {
103
- console.log('[update products list]');
104
- this.productsInString = newValue;
105
- await this.handleLoad();
106
- await this.resetBonus();
107
- }
108
- catch (err) {
109
- console.debug('[watchProducts]', err.message);
110
- }
111
- }
112
- async componentWillLoad() {
113
- i18n.instance.changeLanguage(i18n.instance.language);
114
- await this.loadSession();
115
- await this.loadConfigStore();
116
- await this.handleLoad();
117
- }
118
- async loadConfigStore() {
119
- await this.crmBonusService.getCustomization(this.storeName);
120
- }
121
- async handleLoad() {
122
- try {
123
- if (this.userId) {
124
- this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);
125
- console.log('customer', this.customer);
126
- }
127
- const amount = localStorage.getItem(this.cartId);
128
- if (amount) {
129
- this.canCancel = true;
130
- this.amountCancel = amount;
131
- }
132
- }
133
- catch (error) {
134
- console.log('info customer');
135
- }
136
- await this.buildAndGetProducts();
137
- }
138
- async loadSession() {
139
- this.session = await this.crmBonusService.getToken(this.storeName);
140
- setTimeout(() => {
141
- this.loadSession();
142
- }, 1500000);
143
- }
144
- async buildAndGetProducts() {
145
- const key = `bc-products:${this.cartId}`;
146
- const cart = await this.crmBonusService.getInfoCart();
147
- this.productsInString = JSON.stringify(cart.Produtos);
148
- localStorage.setItem(key, this.productsInString);
149
- const productsInCart = JSON.parse(this.productsInString);
150
- const products_in_cache = JSON.parse(localStorage.getItem(key));
151
- const products = [];
152
- for (const product_cart of productsInCart) {
153
- const [pro] = products_in_cache.filter(p => p.ProdutoVarianteId == product_cart.ProdutoVarianteId);
154
- const [ajuste = { Valor: 0 }] = pro.Ajustes.filter(aj => aj.Tipo === "Formula");
155
- if (pro) {
156
- products.push(Object.assign(Object.assign({}, product_cart), { PrecoPor: pro.PrecoPor + (ajuste.Valor * -1), Quantidade: pro.Quantidade, Ajustes: pro.Ajustes }));
157
- }
158
- else {
159
- products.push(product_cart);
160
- }
161
- }
162
- this.products = products; //cache_products ? JSON.parse(cache_products) : JSON.parse(this.productsInString);
163
- }
164
- async sendPin(phone) {
165
- var _a, _b;
166
- this.loading = true;
167
- this.message = "";
168
- try {
169
- const _phone = phone.replace(/\D/g, '');
170
- this.phone = Number(_phone);
171
- this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);
172
- await this.crmBonusRef.setStep(index$1.StepFormEnum.STEP_PIN);
173
- this.showModal = true;
174
- }
175
- catch (error) {
176
- this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
177
- }
178
- finally {
179
- this.loading = false;
180
- }
181
- }
182
- async sendPinName(customerName) {
183
- var _a, _b;
184
- this.loading = true;
185
- this.message = "";
186
- try {
187
- this.customer.name = customerName;
188
- this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);
189
- await this.crmBonusRef.setStep(index$1.StepFormEnum.STEP_PIN);
190
- this.showModal = true;
191
- }
192
- catch (error) {
193
- this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
194
- }
195
- finally {
196
- this.loading = false;
197
- }
198
- }
199
- buildProducts() {
200
- return buildProductsByWake(this.products);
201
- }
202
- handleCloseModal() {
203
- this.showModal = false;
204
- }
205
- save(amount) {
206
- localStorage.setItem(this.cartId, amount.toString());
207
- this.canCancel = true;
208
- this.amountCancel = amount.toString();
209
- }
210
- async cancel() {
211
- this.message = "";
212
- this.loading = true;
213
- try {
214
- await this.crmBonusService.cancel(this.cartId);
215
- this.canCancel = false;
216
- localStorage.removeItem(this.cartId);
217
- }
218
- catch (error) {
219
- this.message = "Não consegui cancelar o bônus, tente novamente!";
220
- }
221
- finally {
222
- this.loading = false;
223
- }
224
- }
225
- async handleSendPin(phone) {
226
- this.message = "";
227
- if (!phone) {
228
- this.message = "Informe seu telefone";
229
- return;
230
- }
231
- this.customer.phone = phone;
232
- const _phone = phone.replace(/\D/g, '');
233
- this.phone = Number(_phone);
234
- if (this.customer.name) {
235
- return this.sendPin(phone);
236
- }
237
- await this.crmBonusRef.setStep(index$1.StepFormEnum.STEP_NAME);
238
- this.showModal = true;
239
- }
240
- render() {
241
- return (index.h("loading-container", { key: 'fe4b22419f15c995446952127a3dde3f8fdc4f87', loading: this.loading_reprocess }, index.h("crm-giftback-form", { key: 'd5ba2f9f949ab9ff94c37419f3b59a01cf548ae8', style: { position: "relative" }, ref: ref => this.crmBonusRef = ref, storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer, loadProducts: () => this.buildProducts() })));
242
- }
243
- static get assetsDirs() { return ["assets"]; }
244
- static get watchers() { return {
245
- "productsInString": ["watchProducts"]
246
- }; }
247
- };
248
- CrmBonus.style = CrmBonusStyle0;
249
-
250
- exports.crm_bonus = CrmBonus;
251
-
252
- //# sourceMappingURL=crm-bonus.cjs.entry.js.map