crmbonus-component-wake 2.1.40-ngrok → 2.1.41-shoulder

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 (303) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/app-modal.cjs.entry.js +2 -2
  3. package/dist/cjs/app-modal.cjs.entry.js.map +1 -1
  4. package/dist/cjs/bc-crmbonus.cjs.entry.js +28 -0
  5. package/dist/cjs/bc-crmbonus.cjs.entry.js.map +1 -0
  6. package/dist/cjs/bc-phone-form_2.cjs.entry.js +333 -0
  7. package/dist/cjs/bc-phone-form_2.cjs.entry.js.map +1 -0
  8. package/dist/cjs/bc-wake-crmbonus.cjs.entry.js +18 -0
  9. package/dist/cjs/bc-wake-crmbonus.cjs.entry.js.map +1 -0
  10. package/dist/cjs/cart.helper-d1f02660.js +201 -0
  11. package/dist/cjs/cart.helper-d1f02660.js.map +1 -0
  12. package/dist/cjs/container-empty.cjs.entry.js +2 -2
  13. package/dist/cjs/container-empty.cjs.entry.js.map +1 -1
  14. package/dist/cjs/countdown-timer-v2.cjs.entry.js +2 -2
  15. package/dist/cjs/countdown-timer-v2.cjs.entry.js.map +1 -1
  16. package/dist/cjs/countdown-timer_11.cjs.entry.js +66 -42
  17. package/dist/cjs/countdown-timer_11.cjs.entry.js.map +1 -1
  18. package/dist/cjs/crm-bonus-note.cjs.entry.js +14 -12
  19. package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -1
  20. package/dist/cjs/crmbonus-component-wake.cjs.js +2 -2
  21. package/dist/{components/p-0d09c221.js → cjs/crmbonus.service-ef8fe456.js} +30 -117
  22. package/dist/cjs/crmbonus.service-ef8fe456.js.map +1 -0
  23. package/dist/{esm/info.config.helper-e4b8c478.js → cjs/i18n-defaa4f8.js} +3 -30
  24. package/dist/cjs/i18n-defaa4f8.js.map +1 -0
  25. package/dist/cjs/{index-a7537457.js → index-e45b352e.js} +17 -1
  26. package/dist/cjs/index-e45b352e.js.map +1 -0
  27. package/dist/cjs/info.config.helper-52984ab9.js +36 -0
  28. package/dist/cjs/info.config.helper-52984ab9.js.map +1 -0
  29. package/dist/cjs/loader.cjs.js +2 -2
  30. package/dist/cjs/pedido-finalizado.cjs.entry.js +6 -5
  31. package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -1
  32. package/dist/cjs/utils-5d59acb1.js.map +1 -1
  33. package/dist/collection/assets/svg/money-dollars-svgrepo-com.svg +5 -5
  34. package/dist/collection/collection-manifest.json +5 -1
  35. package/dist/collection/components/button/crm-button.css +21 -21
  36. package/dist/collection/components/button/index.js +1 -1
  37. package/dist/collection/components/button/index.js.map +1 -1
  38. package/dist/collection/components/countdown-timer/countdown-timer.js +1 -1
  39. package/dist/collection/components/countdown-timer/countdown-timer.js.map +1 -1
  40. package/dist/collection/components/countdown-timer/countdown-timer.v2.js +2 -2
  41. package/dist/collection/components/countdown-timer/countdown-timer.v2.js.map +1 -1
  42. package/dist/collection/components/crm-bonus/assets/logo.svg +17 -17
  43. package/dist/collection/components/crm-bonus/assets/svg/logo.svg +17 -17
  44. package/dist/collection/components/crm-bonus/crm-bonus.css +86 -82
  45. package/dist/collection/components/crm-bonus/crm-bonus.js +27 -6
  46. package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
  47. package/dist/collection/components/crmbonus/crmbonus.js +26 -0
  48. package/dist/collection/components/crmbonus/crmbonus.js.map +1 -0
  49. package/dist/collection/components/crmbonus/subcomponents/phone-form/index.js +95 -0
  50. package/dist/collection/components/crmbonus/subcomponents/phone-form/index.js.map +1 -0
  51. package/dist/collection/components/crmbonus/subcomponents/phone-form/styles.scss +5 -0
  52. package/dist/collection/components/crmbonus/subcomponents/phone-validate/index.js +129 -0
  53. package/dist/collection/components/crmbonus/subcomponents/phone-validate/index.js.map +1 -0
  54. package/dist/collection/components/crmbonus/subcomponents/phone-validate/styles.scss +84 -0
  55. package/dist/collection/components/giftback-form/giftback-form.css +74 -74
  56. package/dist/collection/components/giftback-form/giftback-form.js +5 -5
  57. package/dist/collection/components/giftback-form/giftback-form.js.map +1 -1
  58. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +181 -181
  59. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +6 -6
  60. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +1 -1
  61. package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js.map +1 -1
  62. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +1 -1
  63. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +1 -1
  64. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +83 -83
  65. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +1 -1
  66. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +1 -1
  67. package/dist/collection/components/loading-container/container-empty.js +1 -1
  68. package/dist/collection/components/loading-container/container-empty.js.map +1 -1
  69. package/dist/collection/components/loading-container/loading-container.css +53 -53
  70. package/dist/collection/components/loading-container/loading-container.js +1 -1
  71. package/dist/collection/components/loading-container/loading-container.js.map +1 -1
  72. package/dist/collection/components/loading-spinner/loading-spinner.css +16 -16
  73. package/dist/collection/components/loading-spinner/loading-spinner.js +1 -1
  74. package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -1
  75. package/dist/collection/components/modal/app-modal.css +44 -44
  76. package/dist/collection/components/modal/app-modal.js +1 -1
  77. package/dist/collection/components/modal/app-modal.js.map +1 -1
  78. package/dist/collection/components/note/crm-bonus-note.css +68 -68
  79. package/dist/collection/components/note/crm-bonus-note.js +2 -2
  80. package/dist/collection/components/note/crm-bonus-note.js.map +1 -1
  81. package/dist/collection/components/pedido/pedido.js +2 -2
  82. package/dist/collection/components/pedido/pedido.js.map +1 -1
  83. package/dist/collection/components/phone/phone-input-mask.css +40 -40
  84. package/dist/collection/components/phone/phone-input-mask.js +1 -1
  85. package/dist/collection/components/phone/phone-input-mask.js.map +1 -1
  86. package/dist/collection/components/tooltip/crm-tooltip.css +48 -48
  87. package/dist/collection/components/tooltip/tooltip.js +1 -1
  88. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  89. package/dist/collection/contants/index.js.map +1 -1
  90. package/dist/collection/contants/mocks.js.map +1 -1
  91. package/dist/collection/dto/checkout.dto.js +2 -0
  92. package/dist/collection/dto/checkout.dto.js.map +1 -0
  93. package/dist/collection/dto/pin.sent.js.map +1 -1
  94. package/dist/collection/dto/reserved-info.dto.js.map +1 -1
  95. package/dist/collection/dto/update.order.dto.js.map +1 -1
  96. package/dist/collection/dto/validate.pin.bonus.js.map +1 -1
  97. package/dist/collection/helpers/build.payload.helper.js +1 -0
  98. package/dist/collection/helpers/build.payload.helper.js.map +1 -1
  99. package/dist/collection/helpers/cart.helper.js +55 -1
  100. package/dist/collection/helpers/cart.helper.js.map +1 -1
  101. package/dist/collection/helpers/info.config.helper.js.map +1 -1
  102. package/dist/collection/helpers/payload.interface.js.map +1 -1
  103. package/dist/collection/helpers/time.helper.js.map +1 -1
  104. package/dist/collection/i18n/i18n.js.map +1 -1
  105. package/dist/collection/index.js.map +1 -1
  106. package/dist/collection/objectvalues/cart.wake.js +33 -8
  107. package/dist/collection/objectvalues/cart.wake.js.map +1 -1
  108. package/dist/collection/platforms/wake/index.js +8 -0
  109. package/dist/collection/platforms/wake/index.js.map +1 -0
  110. package/dist/collection/services/crmbonus.service.js +21 -2
  111. package/dist/collection/services/crmbonus.service.js.map +1 -1
  112. package/dist/collection/utils/keys.storage.js.map +1 -1
  113. package/dist/collection/utils/retry.utils.js.map +1 -1
  114. package/dist/collection/utils/utils.js.map +1 -1
  115. package/dist/components/app-modal.js +2 -2
  116. package/dist/components/app-modal.js.map +1 -1
  117. package/dist/components/bc-crmbonus.d.ts +11 -0
  118. package/dist/components/bc-crmbonus.js +8 -0
  119. package/dist/components/bc-crmbonus.js.map +1 -0
  120. package/dist/components/bc-phone-form.d.ts +11 -0
  121. package/dist/components/bc-phone-form.js +8 -0
  122. package/dist/components/bc-phone-form.js.map +1 -0
  123. package/dist/components/bc-phone-validate-pin-form.d.ts +11 -0
  124. package/dist/components/bc-phone-validate-pin-form.js +8 -0
  125. package/dist/components/bc-phone-validate-pin-form.js.map +1 -0
  126. package/dist/components/bc-wake-crmbonus.d.ts +11 -0
  127. package/dist/components/bc-wake-crmbonus.js +74 -0
  128. package/dist/components/bc-wake-crmbonus.js.map +1 -0
  129. package/dist/components/container-empty.js +2 -2
  130. package/dist/components/container-empty.js.map +1 -1
  131. package/dist/components/countdown-timer-v2.js +2 -2
  132. package/dist/components/countdown-timer-v2.js.map +1 -1
  133. package/dist/components/countdown-timer.js +1 -1
  134. package/dist/components/crm-bonus-note.js +8 -7
  135. package/dist/components/crm-bonus-note.js.map +1 -1
  136. package/dist/components/crm-bonus.js +41 -18
  137. package/dist/components/crm-bonus.js.map +1 -1
  138. package/dist/components/crm-button.js +1 -1
  139. package/dist/components/crm-giftback-form.js +1 -1
  140. package/dist/components/crm-tooltip.js +1 -1
  141. package/dist/components/giftback-info.js +1 -1
  142. package/dist/components/index.js +1 -1
  143. package/dist/components/loading-container.js +1 -1
  144. package/dist/components/loading-spinner.js +1 -1
  145. package/dist/components/p-06d73541.js +80 -0
  146. package/dist/components/p-06d73541.js.map +1 -0
  147. package/dist/components/p-09f86f1d.js +106 -0
  148. package/dist/components/p-09f86f1d.js.map +1 -0
  149. package/dist/components/p-1b441909.js.map +1 -1
  150. package/dist/components/p-2362455d.js +195 -0
  151. package/dist/components/p-2362455d.js.map +1 -0
  152. package/dist/components/p-2fac7f5e.js +78 -0
  153. package/dist/components/p-2fac7f5e.js.map +1 -0
  154. package/dist/components/{p-786485b2.js → p-39bd2459.js} +3 -3
  155. package/dist/components/p-39bd2459.js.map +1 -0
  156. package/dist/components/{p-144c34f6.js → p-496bc4af.js} +17 -16
  157. package/dist/components/p-496bc4af.js.map +1 -0
  158. package/dist/{esm/cart.helper-8c8d4a0a.js → components/p-60787be2.js} +25 -117
  159. package/dist/components/p-60787be2.js.map +1 -0
  160. package/dist/components/{p-0a7ccd8c.js → p-6aa17c2b.js} +6 -6
  161. package/dist/components/p-6aa17c2b.js.map +1 -0
  162. package/dist/components/{p-c250687d.js → p-80a69118.js} +4 -4
  163. package/dist/components/p-80a69118.js.map +1 -0
  164. package/dist/components/p-81e4e697.js +1298 -0
  165. package/dist/components/p-81e4e697.js.map +1 -0
  166. package/dist/components/{p-2cece106.js → p-8f45d088.js} +3 -3
  167. package/dist/components/p-8f45d088.js.map +1 -0
  168. package/dist/components/{p-9b5c07d8.js → p-9231dc5e.js} +4 -4
  169. package/dist/components/p-9231dc5e.js.map +1 -0
  170. package/dist/components/{p-3c8ae82e.js → p-ade5e41e.js} +11 -10
  171. package/dist/components/p-ade5e41e.js.map +1 -0
  172. package/dist/components/p-af3ba015.js.map +1 -1
  173. package/dist/components/{p-e6863cf5.js → p-bf1d624e.js} +6 -6
  174. package/dist/components/p-bf1d624e.js.map +1 -0
  175. package/dist/components/{p-8274e2c4.js → p-c1522ad8.js} +3 -3
  176. package/dist/components/p-c1522ad8.js.map +1 -0
  177. package/dist/components/p-c53241bf.js.map +1 -1
  178. package/dist/components/{p-11520f0f.js → p-eabf185c.js} +3 -3
  179. package/dist/components/p-eabf185c.js.map +1 -0
  180. package/dist/components/p-ecc51430.js.map +1 -1
  181. package/dist/components/{p-9d950d25.js → p-f58c9cb2.js} +2 -2
  182. package/dist/components/p-f58c9cb2.js.map +1 -0
  183. package/dist/components/pedido-finalizado.js +5 -4
  184. package/dist/components/pedido-finalizado.js.map +1 -1
  185. package/dist/components/phone-form.js +1 -1
  186. package/dist/components/phone-input-mask.js +1 -1
  187. package/dist/components/pin-form.js +1 -1
  188. package/dist/crmbonus-component-wake/assets/logo.svg +17 -17
  189. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
  190. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  191. package/dist/crmbonus-component-wake/{p-ac027576.entry.js → p-06d494c4.entry.js} +2 -2
  192. package/dist/crmbonus-component-wake/p-06d494c4.entry.js.map +1 -0
  193. package/dist/crmbonus-component-wake/{p-8c362346.js → p-19848de4.js} +2 -2
  194. package/dist/crmbonus-component-wake/p-19848de4.js.map +1 -0
  195. package/dist/crmbonus-component-wake/p-20d0467e.js +2 -0
  196. package/dist/crmbonus-component-wake/p-20d0467e.js.map +1 -0
  197. package/dist/crmbonus-component-wake/p-2362455d.js +2 -0
  198. package/dist/crmbonus-component-wake/p-2362455d.js.map +1 -0
  199. package/dist/crmbonus-component-wake/p-2dd97532.entry.js +2 -0
  200. package/dist/crmbonus-component-wake/p-2dd97532.entry.js.map +1 -0
  201. package/dist/crmbonus-component-wake/p-3e02757c.entry.js +2 -0
  202. package/dist/crmbonus-component-wake/p-3e02757c.entry.js.map +1 -0
  203. package/dist/crmbonus-component-wake/p-4cbebe64.entry.js +2 -0
  204. package/dist/crmbonus-component-wake/p-4cbebe64.entry.js.map +1 -0
  205. package/dist/crmbonus-component-wake/{p-0d09c221.js → p-60787be2.js} +2 -2
  206. package/dist/crmbonus-component-wake/p-60787be2.js.map +1 -0
  207. package/dist/crmbonus-component-wake/p-6e7c09cd.entry.js +2 -0
  208. package/dist/crmbonus-component-wake/p-6e7c09cd.entry.js.map +1 -0
  209. package/dist/crmbonus-component-wake/p-9b556ee6.entry.js +2 -0
  210. package/dist/crmbonus-component-wake/p-9b556ee6.entry.js.map +1 -0
  211. package/dist/crmbonus-component-wake/p-af3ba015.js.map +1 -1
  212. package/dist/crmbonus-component-wake/p-b435da9a.entry.js +2 -0
  213. package/dist/crmbonus-component-wake/p-b435da9a.entry.js.map +1 -0
  214. package/dist/crmbonus-component-wake/p-c53241bf.js +2 -0
  215. package/dist/crmbonus-component-wake/p-c53241bf.js.map +1 -0
  216. package/dist/crmbonus-component-wake/p-c533ea8b.entry.js +2 -0
  217. package/dist/crmbonus-component-wake/p-c533ea8b.entry.js.map +1 -0
  218. package/dist/crmbonus-component-wake/p-c7d03986.entry.js +2 -0
  219. package/dist/crmbonus-component-wake/p-c7d03986.entry.js.map +1 -0
  220. package/dist/env.js +2 -2
  221. package/dist/env.js.map +1 -1
  222. package/dist/esm/app-modal.entry.js +2 -2
  223. package/dist/esm/app-modal.entry.js.map +1 -1
  224. package/dist/esm/bc-crmbonus.entry.js +24 -0
  225. package/dist/esm/bc-crmbonus.entry.js.map +1 -0
  226. package/dist/esm/bc-phone-form_2.entry.js +328 -0
  227. package/dist/esm/bc-phone-form_2.entry.js.map +1 -0
  228. package/dist/esm/bc-wake-crmbonus.entry.js +14 -0
  229. package/dist/esm/bc-wake-crmbonus.entry.js.map +1 -0
  230. package/dist/esm/cart.helper-22ecdec9.js +195 -0
  231. package/dist/esm/cart.helper-22ecdec9.js.map +1 -0
  232. package/dist/esm/container-empty.entry.js +2 -2
  233. package/dist/esm/container-empty.entry.js.map +1 -1
  234. package/dist/esm/countdown-timer-v2.entry.js +2 -2
  235. package/dist/esm/countdown-timer-v2.entry.js.map +1 -1
  236. package/dist/esm/countdown-timer_11.entry.js +52 -28
  237. package/dist/esm/countdown-timer_11.entry.js.map +1 -1
  238. package/dist/esm/crm-bonus-note.entry.js +9 -7
  239. package/dist/esm/crm-bonus-note.entry.js.map +1 -1
  240. package/dist/esm/crmbonus-component-wake.js +3 -3
  241. package/dist/{cjs/cart.helper-31ba8997.js → esm/crmbonus.service-d83e6bb6.js} +25 -125
  242. package/dist/esm/crmbonus.service-d83e6bb6.js.map +1 -0
  243. package/dist/{cjs/info.config.helper-d4b1291b.js → esm/i18n-b9d8b0cc.js} +2 -36
  244. package/dist/esm/i18n-b9d8b0cc.js.map +1 -0
  245. package/dist/esm/{index-bdb70d5a.js → index-09314622.js} +16 -2
  246. package/dist/esm/index-09314622.js.map +1 -0
  247. package/dist/esm/info.config.helper-156cb9b2.js +32 -0
  248. package/dist/esm/info.config.helper-156cb9b2.js.map +1 -0
  249. package/dist/esm/loader.js +3 -3
  250. package/dist/esm/pedido-finalizado.entry.js +5 -4
  251. package/dist/esm/pedido-finalizado.entry.js.map +1 -1
  252. package/dist/esm/utils-dec6df66.js.map +1 -1
  253. package/dist/store.js +25 -0
  254. package/dist/store.js.map +1 -0
  255. package/dist/types/components/crmbonus/crmbonus.d.ts +9 -0
  256. package/dist/types/components/crmbonus/subcomponents/phone-form/index.d.ts +13 -0
  257. package/dist/types/components/crmbonus/subcomponents/phone-validate/index.d.ts +17 -0
  258. package/dist/types/components.d.ts +76 -0
  259. package/dist/types/dto/checkout.dto.d.ts +8 -0
  260. package/dist/types/dto/pin.sent.d.ts +3 -0
  261. package/dist/types/dto/validate.pin.bonus.d.ts +9 -0
  262. package/dist/types/helpers/cart.helper.d.ts +1 -0
  263. package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +2 -0
  264. package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/store.d.ts +11 -0
  265. package/dist/types/objectvalues/cart.wake.d.ts +2 -1
  266. package/dist/types/platforms/wake/index.d.ts +3 -0
  267. package/dist/types/services/crmbonus.service.d.ts +4 -2
  268. package/package.json +59 -58
  269. package/readme.md +114 -114
  270. package/dist/cjs/cart.helper-31ba8997.js.map +0 -1
  271. package/dist/cjs/index-a7537457.js.map +0 -1
  272. package/dist/cjs/info.config.helper-d4b1291b.js.map +0 -1
  273. package/dist/components/p-0a7ccd8c.js.map +0 -1
  274. package/dist/components/p-0d09c221.js.map +0 -1
  275. package/dist/components/p-11520f0f.js.map +0 -1
  276. package/dist/components/p-144c34f6.js.map +0 -1
  277. package/dist/components/p-2cece106.js.map +0 -1
  278. package/dist/components/p-3c8ae82e.js.map +0 -1
  279. package/dist/components/p-786485b2.js.map +0 -1
  280. package/dist/components/p-8274e2c4.js.map +0 -1
  281. package/dist/components/p-9b5c07d8.js.map +0 -1
  282. package/dist/components/p-9d950d25.js.map +0 -1
  283. package/dist/components/p-c250687d.js.map +0 -1
  284. package/dist/components/p-e6863cf5.js.map +0 -1
  285. package/dist/crmbonus-component-wake/p-0d09c221.js.map +0 -1
  286. package/dist/crmbonus-component-wake/p-1644deef.entry.js +0 -2
  287. package/dist/crmbonus-component-wake/p-1644deef.entry.js.map +0 -1
  288. package/dist/crmbonus-component-wake/p-3ceb1dad.entry.js +0 -2
  289. package/dist/crmbonus-component-wake/p-3ceb1dad.entry.js.map +0 -1
  290. package/dist/crmbonus-component-wake/p-7e52727e.entry.js +0 -2
  291. package/dist/crmbonus-component-wake/p-7e52727e.entry.js.map +0 -1
  292. package/dist/crmbonus-component-wake/p-8c362346.js.map +0 -1
  293. package/dist/crmbonus-component-wake/p-ac027576.entry.js.map +0 -1
  294. package/dist/crmbonus-component-wake/p-ac1e7c32.entry.js +0 -2
  295. package/dist/crmbonus-component-wake/p-ac1e7c32.entry.js.map +0 -1
  296. package/dist/crmbonus-component-wake/p-b4f52f79.js +0 -2
  297. package/dist/crmbonus-component-wake/p-b4f52f79.js.map +0 -1
  298. package/dist/crmbonus-component-wake/p-df80d1b0.entry.js +0 -2
  299. package/dist/crmbonus-component-wake/p-df80d1b0.entry.js.map +0 -1
  300. package/dist/esm/cart.helper-8c8d4a0a.js.map +0 -1
  301. package/dist/esm/index-bdb70d5a.js.map +0 -1
  302. package/dist/esm/info.config.helper-e4b8c478.js.map +0 -1
  303. package/dist/types/Users/Darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +0 -2
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2018
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2018
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-a7537457.js');
5
+ const index = require('./index-e45b352e.js');
6
6
 
7
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;cursor:pointer}.modal-body{}";
8
8
  const AppModalStyle0 = appModalCss;
@@ -18,7 +18,7 @@ const AppModal = class {
18
18
  this.modalClosed.emit();
19
19
  }
20
20
  render() {
21
- return (index.h("div", { key: '2a9b7c3cc11600c9608cfbf960e06f72d2618ded', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, index.h("div", { key: 'c9d7ba54997d33e3d73e8ddd1417879e3786e859', class: "modal" }, index.h("div", { key: '141151a40b678f979e47ea530aeca7bcb389cedd', class: "modal-header" }, index.h("h3", { key: '7ffccb7e55ba62fba77467416a66e3794a923b07' }, this.modalTitle), index.h("button", { key: 'c85800ab26d401c5e80b5db9d86f90bade49ff2d', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), index.h("div", { key: '1b69d75322c87d3623660792562da4c4fd1137c1', class: "modal-body" }, index.h("slot", { key: '07b8b13a344367ed517e7f41de632776b0b655c3' })))));
21
+ return (index.h("div", { key: 'ca01fe665107339db0cbbd9d2304dcc962d23910', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, index.h("div", { key: '53a4a83cd2d734f674f298cf966d15d2218d1d88', class: "modal" }, index.h("div", { key: '63e41b5e61c2a5c962e71984af794c78b79aef60', class: "modal-header" }, index.h("h3", { key: '3b50ab8509e808135b12a9aea68b0aba64250501' }, this.modalTitle), index.h("button", { key: 'a213cb6387c66a2b0d012cef3c018aab90dae9af', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), index.h("div", { key: '907794b4afa37068bc2f2bdfd31d154a6f57859f', class: "modal-body" }, index.h("slot", { key: 'f20682d624021e33de0b484d2fbb2b675ae889a2' })))));
22
22
  }
23
23
  };
24
24
  AppModal.style = AppModalStyle0;
@@ -1 +1 @@
1
- {"file":"app-modal.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,WAAW,GAAG,8gBAA8gB,CAAC;AACniB,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 {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background-color: rgba(0, 0, 0, 0.5);\r\n display: none;\r\n justify-content: center;\r\n align-items: center;\r\n z-index: 1000;\r\n }\r\n \r\n .modal-backdrop.visible {\r\n display: flex;\r\n }\r\n \r\n .modal {\r\n background: white;\r\n border-radius: 8px;\r\n padding: 1rem;\r\n max-width: 500px;\r\n width: 90%;\r\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);\r\n }\r\n \r\n .modal-header {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n border-bottom: 1px solid #ddd;\r\n margin-bottom: 1rem;\r\n }\r\n \r\n .close-button {\r\n background: none;\r\n border: none;\r\n /* font-size: 1.5rem; */\r\n cursor: pointer;\r\n }\r\n \r\n .modal-body {\r\n /* padding: 1rem 0; */\r\n }\r\n ","import { Component, Event, EventEmitter, Prop, h } from \"@stencil/core\";\r\n\r\n@Component({\r\n tag: 'app-modal',\r\n styleUrl: 'app-modal.css',\r\n shadow: true,\r\n})\r\nexport class AppModal {\r\n\r\n // Controle da visibilidade do modal\r\n @Prop({ reflect: true }) isOpen: boolean = false;\r\n\r\n // Título do modal\r\n @Prop() modalTitle: string;\r\n\r\n // Evento emitido ao fechar o modal\r\n @Event() modalClosed: EventEmitter<void>;\r\n\r\n private closeModal() {\r\n this.modalClosed.emit();\r\n }\r\n\r\n render() {\r\n return (\r\n <div class={`modal-backdrop ${this.isOpen ? 'visible' : ''}`}>\r\n <div class=\"modal\">\r\n <div class=\"modal-header\">\r\n <h3>{this.modalTitle}</h3>\r\n <button class=\"close-button\" onClick={() => this.closeModal()}>\r\n ×\r\n </button>\r\n </div>\r\n <div class=\"modal-body\">\r\n <slot />\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n }\r\n}"],"version":3}
1
+ {"file":"app-modal.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,WAAW,GAAG,8gBAA8gB,CAAC;AACniB,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}
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-e45b352e.js');
6
+ const crmbonus_service = require('./crmbonus.service-ef8fe456.js');
7
+
8
+ const CrmBonus = class {
9
+ constructor(hostRef) {
10
+ index.registerInstance(this, hostRef);
11
+ this.storeName = 'bycoders';
12
+ this.crmBonusService = crmbonus_service.CrmBonusService.getInstance();
13
+ this.checkout = {};
14
+ }
15
+ async handlerToken() {
16
+ await this.crmBonusService.getToken(this.storeName);
17
+ }
18
+ componentDidLoad() {
19
+ this.handlerToken();
20
+ }
21
+ render() {
22
+ return (index.h("div", { key: 'cefc590c81f4de1a44fd67cbd599c6a5366f2ee7' }, index.h("bc-phone-form", { key: '126d01e0c4da26d9c2b56c74580eb2988fbc58ad', storeName: this.storeName }), index.h("bc-phone-validate-pin-form", { key: 'c08a9c81a1394deb787e5ff7b353aea596985a22', storeName: this.storeName })));
23
+ }
24
+ };
25
+
26
+ exports.bc_crmbonus = CrmBonus;
27
+
28
+ //# sourceMappingURL=bc-crmbonus.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"bc-crmbonus.entry.cjs.js","mappings":";;;;;;;MAQa,QAAQ;;;QAEjB,cAAS,GAAG,UAAU,CAAA;QAEd,oBAAe,GAAGA,gCAAe,CAAC,WAAW,EAAE,CAAC;wBAEb,EAAE;;IAE7C,MAAM,YAAY;QACd,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KACvD;IAED,gBAAgB;QACZ,IAAI,CAAC,YAAY,EAAE,CAAC;KACvB;IAGD,MAAM;QACF,QACIC,oEACIA,4EAAe,SAAS,EAAE,IAAI,CAAC,SAAS,GAAI,EAE5CA,yFAA4B,SAAS,EAAE,IAAI,CAAC,SAAS,GAAI,CACvD,EACT;KACJ;;;;;","names":["CrmBonusService","h"],"sources":["src/components/crmbonus/crmbonus.tsx"],"sourcesContent":["import { Component, h, State } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { ICheckoutDTO } from \"../../dto/checkout.dto\";\n\n@Component({\n tag: 'bc-crmbonus',\n shadow: true\n})\nexport class CrmBonus {\n\n storeName = 'bycoders'\n\n private crmBonusService = CrmBonusService.getInstance();\n\n @State() checkout: Partial<ICheckoutDTO> = {}\n\n async handlerToken() {\n await this.crmBonusService.getToken(this.storeName);\n }\n\n componentDidLoad() {\n this.handlerToken();\n }\n\n\n render() {\n return (\n <div>\n <bc-phone-form storeName={this.storeName} />\n\n <bc-phone-validate-pin-form storeName={this.storeName} />\n </div>\n )\n }\n}"],"version":3}
@@ -0,0 +1,333 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-e45b352e.js');
6
+ const crmbonus_service = require('./crmbonus.service-ef8fe456.js');
7
+ const i18n = require('./i18n-defaa4f8.js');
8
+
9
+ const appendToMap = (map, propName, value) => {
10
+ const items = map.get(propName);
11
+ if (!items) {
12
+ map.set(propName, [value]);
13
+ }
14
+ else if (!items.includes(value)) {
15
+ items.push(value);
16
+ }
17
+ };
18
+ const debounce = (fn, ms) => {
19
+ let timeoutId;
20
+ return (...args) => {
21
+ if (timeoutId) {
22
+ clearTimeout(timeoutId);
23
+ }
24
+ timeoutId = setTimeout(() => {
25
+ timeoutId = 0;
26
+ fn(...args);
27
+ }, ms);
28
+ };
29
+ };
30
+
31
+ /**
32
+ * Check if a possible element isConnected.
33
+ * The property might not be there, so we check for it.
34
+ *
35
+ * We want it to return true if isConnected is not a property,
36
+ * otherwise we would remove these elements and would not update.
37
+ *
38
+ * Better leak in Edge than to be useless.
39
+ */
40
+ const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
41
+ const cleanupElements = debounce((map) => {
42
+ for (let key of map.keys()) {
43
+ map.set(key, map.get(key).filter(isConnected));
44
+ }
45
+ }, 2_000);
46
+ const stencilSubscription = () => {
47
+ if (typeof index.getRenderingRef !== 'function') {
48
+ // If we are not in a stencil project, we do nothing.
49
+ // This function is not really exported by @stencil/core.
50
+ return {};
51
+ }
52
+ const elmsToUpdate = new Map();
53
+ return {
54
+ dispose: () => elmsToUpdate.clear(),
55
+ get: (propName) => {
56
+ const elm = index.getRenderingRef();
57
+ if (elm) {
58
+ appendToMap(elmsToUpdate, propName, elm);
59
+ }
60
+ },
61
+ set: (propName) => {
62
+ const elements = elmsToUpdate.get(propName);
63
+ if (elements) {
64
+ elmsToUpdate.set(propName, elements.filter(index.forceUpdate));
65
+ }
66
+ cleanupElements(elmsToUpdate);
67
+ },
68
+ reset: () => {
69
+ elmsToUpdate.forEach((elms) => elms.forEach(index.forceUpdate));
70
+ cleanupElements(elmsToUpdate);
71
+ },
72
+ };
73
+ };
74
+
75
+ const unwrap = (val) => (typeof val === 'function' ? val() : val);
76
+ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
77
+ const unwrappedState = unwrap(defaultState);
78
+ let states = new Map(Object.entries(unwrappedState ?? {}));
79
+ const handlers = {
80
+ dispose: [],
81
+ get: [],
82
+ set: [],
83
+ reset: [],
84
+ };
85
+ // Track onChange listeners to enable removeListener functionality
86
+ const changeListeners = new Map();
87
+ const reset = () => {
88
+ // When resetting the state, the default state may be a function - unwrap it to invoke it.
89
+ // otherwise, the state won't be properly reset
90
+ states = new Map(Object.entries(unwrap(defaultState) ?? {}));
91
+ handlers.reset.forEach((cb) => cb());
92
+ };
93
+ const dispose = () => {
94
+ // Call first dispose as resetting the state would
95
+ // cause less updates ;)
96
+ handlers.dispose.forEach((cb) => cb());
97
+ reset();
98
+ };
99
+ const get = (propName) => {
100
+ handlers.get.forEach((cb) => cb(propName));
101
+ return states.get(propName);
102
+ };
103
+ const set = (propName, value) => {
104
+ const oldValue = states.get(propName);
105
+ if (shouldUpdate(value, oldValue, propName)) {
106
+ states.set(propName, value);
107
+ handlers.set.forEach((cb) => cb(propName, value, oldValue));
108
+ }
109
+ };
110
+ const state = (typeof Proxy === 'undefined'
111
+ ? {}
112
+ : new Proxy(unwrappedState, {
113
+ get(_, propName) {
114
+ return get(propName);
115
+ },
116
+ ownKeys(_) {
117
+ return Array.from(states.keys());
118
+ },
119
+ getOwnPropertyDescriptor() {
120
+ return {
121
+ enumerable: true,
122
+ configurable: true,
123
+ };
124
+ },
125
+ has(_, propName) {
126
+ return states.has(propName);
127
+ },
128
+ set(_, propName, value) {
129
+ set(propName, value);
130
+ return true;
131
+ },
132
+ }));
133
+ const on = (eventName, callback) => {
134
+ handlers[eventName].push(callback);
135
+ return () => {
136
+ removeFromArray(handlers[eventName], callback);
137
+ };
138
+ };
139
+ const onChange = (propName, cb) => {
140
+ const setHandler = (key, newValue) => {
141
+ if (key === propName) {
142
+ cb(newValue);
143
+ }
144
+ };
145
+ const resetHandler = () => cb(unwrap(defaultState)[propName]);
146
+ // Register the handlers
147
+ const unSet = on('set', setHandler);
148
+ const unReset = on('reset', resetHandler);
149
+ // Track the relationship between the user callback and internal handlers
150
+ changeListeners.set(cb, { setHandler, resetHandler, propName });
151
+ return () => {
152
+ unSet();
153
+ unReset();
154
+ changeListeners.delete(cb);
155
+ };
156
+ };
157
+ const use = (...subscriptions) => {
158
+ const unsubs = subscriptions.reduce((unsubs, subscription) => {
159
+ if (subscription.set) {
160
+ unsubs.push(on('set', subscription.set));
161
+ }
162
+ if (subscription.get) {
163
+ unsubs.push(on('get', subscription.get));
164
+ }
165
+ if (subscription.reset) {
166
+ unsubs.push(on('reset', subscription.reset));
167
+ }
168
+ if (subscription.dispose) {
169
+ unsubs.push(on('dispose', subscription.dispose));
170
+ }
171
+ return unsubs;
172
+ }, []);
173
+ return () => unsubs.forEach((unsub) => unsub());
174
+ };
175
+ const forceUpdate = (key) => {
176
+ const oldValue = states.get(key);
177
+ handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
178
+ };
179
+ const removeListener = (propName, listener) => {
180
+ const listenerInfo = changeListeners.get(listener);
181
+ if (listenerInfo && listenerInfo.propName === propName) {
182
+ // Remove the specific handlers that were created for this listener
183
+ removeFromArray(handlers.set, listenerInfo.setHandler);
184
+ removeFromArray(handlers.reset, listenerInfo.resetHandler);
185
+ changeListeners.delete(listener);
186
+ }
187
+ };
188
+ return {
189
+ state,
190
+ get,
191
+ set,
192
+ on,
193
+ onChange,
194
+ use,
195
+ dispose,
196
+ reset,
197
+ forceUpdate,
198
+ removeListener,
199
+ };
200
+ };
201
+ const removeFromArray = (array, item) => {
202
+ const index = array.indexOf(item);
203
+ if (index >= 0) {
204
+ array[index] = array[array.length - 1];
205
+ array.length--;
206
+ }
207
+ };
208
+
209
+ const createStore = (defaultState, shouldUpdate) => {
210
+ const map = createObservableMap(defaultState, shouldUpdate);
211
+ map.use(stencilSubscription());
212
+ return map;
213
+ };
214
+
215
+ const { state, onChange } = createStore({
216
+ storeConfig: {
217
+ btnApplyBonusLabel: 'Avançar',
218
+ confirmationMessage: '',
219
+ giftbackTitle: 'giftback',
220
+ keepStoreFrontStyle: false
221
+ },
222
+ checkout: {
223
+ cellphone: null,
224
+ checkoutId: '',
225
+ checkoutProducts: [],
226
+ crmbonuStoreId: null,
227
+ crmbonusUserId: null,
228
+ storeName: ''
229
+ },
230
+ clicks: 0,
231
+ seconds: 0,
232
+ squaredClicks: 0
233
+ });
234
+ onChange('clicks', value => {
235
+ state.squaredClicks = value ** 2;
236
+ });
237
+
238
+ const stylesScss$1 = ".phone-form{display:flex;flex-direction:column;gap:12px}";
239
+ const BcPhoneFormStyle0 = stylesScss$1;
240
+
241
+ const PhoneForm = class {
242
+ constructor(hostRef) {
243
+ index.registerInstance(this, hostRef);
244
+ this.actionError = index.createEvent(this, "actionError", 7);
245
+ this.crmbonusService = crmbonus_service.CrmBonusService.getInstance();
246
+ this.loading = false;
247
+ this.storeName = '';
248
+ }
249
+ async handlerPhone() {
250
+ this.loading = true;
251
+ try {
252
+ const phoneMask = await this.phoneInputMask.getPhone();
253
+ const phone = phoneMask.replace(/\D/g, '');
254
+ const send = await this.crmbonusService.sendPin(Number(phone), '', this.storeName);
255
+ state.checkout.cellphone = Number(phone);
256
+ state.checkout.crmbonuStoreId = send.storeId;
257
+ state.checkout.crmbonusUserId = send.userId;
258
+ }
259
+ catch (error) {
260
+ this.actionError.emit({
261
+ message: error.message
262
+ });
263
+ }
264
+ finally {
265
+ this.loading = false;
266
+ }
267
+ }
268
+ render() {
269
+ return (index.h("div", { key: 'b14641104823437a9ab8d358b9326163b86a1c2e', class: "phone-form" }, index.h("span", { key: '0c6aca3e25b12f651402086bff2405de112d47ca' }, "Digite o seu celular para verificar se h\u00E1 desconto dispon\u00EDvel nessa compra:"), index.h("phone-input-mask", { key: '3362b63ed0afcda46a2ec82784786ab3ce139969', ref: ref => this.phoneInputMask = ref }), index.h("crm-button", { key: '4dfc4e036d8689cbde15edce49b9f71ad73748c3', loading: this.loading, txtBtn: "Avan\u00E7ar", handleClick: () => this.handlerPhone() })));
270
+ }
271
+ };
272
+ PhoneForm.style = BcPhoneFormStyle0;
273
+
274
+ const stylesScss = ":host{display:block}.form-container-pin{display:flex;flex-direction:column;align-items:center}.pin-container{display:flex;justify-content:start;gap:10px}.pin-container input{width:100%;height:48px;text-align:center;border:1px solid #ccc;border-radius:5px}button{padding:10px 20px;background-color:#ddd;border:none;border-radius:5px;cursor:pointer}.success{color:green;margin-top:10px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:15px;min-height:30px;min-width:120px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;cursor:pointer}.crm-description{width:100%;display:flex;gap:9px;flex-wrap:wrap}.crm-description a{font-weight:bold;cursor:pointer;text-decoration:underline}.crm-description div{display:flex;gap:5px}";
275
+ const BcPhoneValidatePinFormStyle0 = stylesScss;
276
+
277
+ const PhoneValidatePinForm = class {
278
+ constructor(hostRef) {
279
+ index.registerInstance(this, hostRef);
280
+ this.crmbonusService = crmbonus_service.CrmBonusService.getInstance();
281
+ this.storeName = '';
282
+ this.phone = undefined;
283
+ this.cancel = undefined;
284
+ this.pin = ['', '', '', ''];
285
+ this.isVerified = false;
286
+ this.canResend = false;
287
+ this.loading = false;
288
+ }
289
+ handleInput(event, index) {
290
+ const input = event.target;
291
+ const value = input.value.slice(0, 1); // Limitar a um único dígito
292
+ this.pin[index] = value;
293
+ // Focar no próximo campo, se possível
294
+ if (value && index < this.pin.length - 1) {
295
+ const nextInput = input.nextElementSibling;
296
+ nextInput === null || nextInput === void 0 ? void 0 : nextInput.focus();
297
+ }
298
+ this.pin = [...this.pin];
299
+ }
300
+ async handleResend() {
301
+ // await this.resend();
302
+ this.canResend = false;
303
+ this.pin = ['', '', '', ''];
304
+ }
305
+ buildTime() {
306
+ const resendDate = localStorage.getItem("bc:resend");
307
+ if (resendDate) {
308
+ return resendDate;
309
+ }
310
+ const date = new Date();
311
+ date.setSeconds(date.getSeconds() + 30);
312
+ localStorage.setItem("bc:resend", date.toString());
313
+ return date.toString();
314
+ }
315
+ handleTimeout() {
316
+ localStorage.removeItem("bc:resend");
317
+ this.canResend = true;
318
+ }
319
+ validatePin() {
320
+ console.log('[x][STORE]', state.checkout);
321
+ // this.crmbonusService.validatePinBonus()
322
+ }
323
+ render() {
324
+ var _a;
325
+ return (index.h("div", { key: '0ba777997120acd11e83043f3450bf7288cb5665', class: "crm-phone-form" }, index.h("label", { key: '75d3ba7803982927d14da4f99c84a1e1cb4a827e', class: "crm-subtitle" }, i18n.instance.t('pin-sutitle'), " ", index.h("strong", { key: '04042da34bb9b90822187bc5f3d03dd309cc87d0' }, "+55 ", this.phone)), index.h("div", { key: '8250a29967cacc8eb0c9a00dab6e3e59280e5870', class: "pin-container" }, this.pin.map((_, index$1) => (index.h("input", { type: "text", maxLength: 1, value: this.pin[index$1], onInput: (event) => this.handleInput(event, index$1) })))), index.h("slot", { key: 'df1e2e9cc3033ee760ae1bf607e311e0038743cb' }), index.h("p", { key: 'beeea228c5c108588f38f64052cffed424ff7539', class: "crm-description" }, " N\u00E3o recebeu?", !this.canResend && index.h("label", { key: 'b304f40425994ddfc905ab3b0c18db738b8a2d3b' }, " Reenviar em", index.h("countdown-timer", { key: '776f50ddc79cd0813aa49dfa236a955aa5994b7c', minutos: 0, segundos: 30, dataCriacao: this.buildTime(), downtime: () => this.handleTimeout() }), " "), this.canResend && (index.h("div", { key: '02a4d05b7c15097881cece7752a36671d29162db' }, index.h("a", { key: 'b6bd0961dc687b8c4f601c668b0ba2cdfa83a339', onClick: () => this.handleResend() }, "Reenviar"), index.h("a", { key: 'd348c9fe25a728b098b8ef2359a724c9b2956e98', onClick: () => this.cancel() }, "Trocar n\u00FAmero")))), index.h("crm-button", { key: '0382610ed7d6a7fda3f8851e30e3852320e2ff23', txtBtn: ((_a = state === null || state === void 0 ? void 0 : state.storeConfig) === null || _a === void 0 ? void 0 : _a.btnApplyBonusLabel) || "Avançar", loading: this.loading, handleClick: () => this.validatePin() })));
326
+ }
327
+ };
328
+ PhoneValidatePinForm.style = BcPhoneValidatePinFormStyle0;
329
+
330
+ exports.bc_phone_form = PhoneForm;
331
+ exports.bc_phone_validate_pin_form = PhoneValidatePinForm;
332
+
333
+ //# sourceMappingURL=bc-phone-form_2.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"bc-phone-form.bc-phone-validate-pin-form.entry.cjs.js","mappings":";;;;;;;;AAEA,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,KAAK;AAC9C,IAAI,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACpC,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,QAAQ,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACnC,KAAK;AACL,SAAS,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACrC,QAAQ,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1B,KAAK;AACL,CAAC,CAAC;AACF,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK;AAC7B,IAAI,IAAI,SAAS,CAAC;AAClB,IAAI,OAAO,CAAC,GAAG,IAAI,KAAK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next","index"],"sources":["node_modules/@stencil/store/dist/index.js","store.ts","src/components/crmbonus/subcomponents/phone-form/styles.scss?tag=bc-phone-form&encapsulation=shadow","src/components/crmbonus/subcomponents/phone-form/index.tsx","src/components/crmbonus/subcomponents/phone-validate/styles.scss?tag=bc-phone-validate-pin-form&encapsulation=shadow","src/components/crmbonus/subcomponents/phone-validate/index.tsx"],"sourcesContent":["import { getRenderingRef, forceUpdate } from '@stencil/core';\n\nconst appendToMap = (map, propName, value) => {\n const items = map.get(propName);\n if (!items) {\n map.set(propName, [value]);\n }\n else if (!items.includes(value)) {\n items.push(value);\n }\n};\nconst debounce = (fn, ms) => {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = 0;\n fn(...args);\n }, ms);\n };\n};\n\n/**\n * Check if a possible element isConnected.\n * The property might not be there, so we check for it.\n *\n * We want it to return true if isConnected is not a property,\n * otherwise we would remove these elements and would not update.\n *\n * Better leak in Edge than to be useless.\n */\nconst isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;\nconst cleanupElements = debounce((map) => {\n for (let key of map.keys()) {\n map.set(key, map.get(key).filter(isConnected));\n }\n}, 2_000);\nconst stencilSubscription = () => {\n if (typeof getRenderingRef !== 'function') {\n // If we are not in a stencil project, we do nothing.\n // This function is not really exported by @stencil/core.\n return {};\n }\n const elmsToUpdate = new Map();\n return {\n dispose: () => elmsToUpdate.clear(),\n get: (propName) => {\n const elm = getRenderingRef();\n if (elm) {\n appendToMap(elmsToUpdate, propName, elm);\n }\n },\n set: (propName) => {\n const elements = elmsToUpdate.get(propName);\n if (elements) {\n elmsToUpdate.set(propName, elements.filter(forceUpdate));\n }\n cleanupElements(elmsToUpdate);\n },\n reset: () => {\n elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));\n cleanupElements(elmsToUpdate);\n },\n };\n};\n\nconst unwrap = (val) => (typeof val === 'function' ? val() : val);\nconst createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {\n const unwrappedState = unwrap(defaultState);\n let states = new Map(Object.entries(unwrappedState ?? {}));\n const handlers = {\n dispose: [],\n get: [],\n set: [],\n reset: [],\n };\n // Track onChange listeners to enable removeListener functionality\n const changeListeners = new Map();\n const reset = () => {\n // When resetting the state, the default state may be a function - unwrap it to invoke it.\n // otherwise, the state won't be properly reset\n states = new Map(Object.entries(unwrap(defaultState) ?? {}));\n handlers.reset.forEach((cb) => cb());\n };\n const dispose = () => {\n // Call first dispose as resetting the state would\n // cause less updates ;)\n handlers.dispose.forEach((cb) => cb());\n reset();\n };\n const get = (propName) => {\n handlers.get.forEach((cb) => cb(propName));\n return states.get(propName);\n };\n const set = (propName, value) => {\n const oldValue = states.get(propName);\n if (shouldUpdate(value, oldValue, propName)) {\n states.set(propName, value);\n handlers.set.forEach((cb) => cb(propName, value, oldValue));\n }\n };\n const state = (typeof Proxy === 'undefined'\n ? {}\n : new Proxy(unwrappedState, {\n get(_, propName) {\n return get(propName);\n },\n ownKeys(_) {\n return Array.from(states.keys());\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n has(_, propName) {\n return states.has(propName);\n },\n set(_, propName, value) {\n set(propName, value);\n return true;\n },\n }));\n const on = (eventName, callback) => {\n handlers[eventName].push(callback);\n return () => {\n removeFromArray(handlers[eventName], callback);\n };\n };\n const onChange = (propName, cb) => {\n const setHandler = (key, newValue) => {\n if (key === propName) {\n cb(newValue);\n }\n };\n const resetHandler = () => cb(unwrap(defaultState)[propName]);\n // Register the handlers\n const unSet = on('set', setHandler);\n const unReset = on('reset', resetHandler);\n // Track the relationship between the user callback and internal handlers\n changeListeners.set(cb, { setHandler, resetHandler, propName });\n return () => {\n unSet();\n unReset();\n changeListeners.delete(cb);\n };\n };\n const use = (...subscriptions) => {\n const unsubs = subscriptions.reduce((unsubs, subscription) => {\n if (subscription.set) {\n unsubs.push(on('set', subscription.set));\n }\n if (subscription.get) {\n unsubs.push(on('get', subscription.get));\n }\n if (subscription.reset) {\n unsubs.push(on('reset', subscription.reset));\n }\n if (subscription.dispose) {\n unsubs.push(on('dispose', subscription.dispose));\n }\n return unsubs;\n }, []);\n return () => unsubs.forEach((unsub) => unsub());\n };\n const forceUpdate = (key) => {\n const oldValue = states.get(key);\n handlers.set.forEach((cb) => cb(key, oldValue, oldValue));\n };\n const removeListener = (propName, listener) => {\n const listenerInfo = changeListeners.get(listener);\n if (listenerInfo && listenerInfo.propName === propName) {\n // Remove the specific handlers that were created for this listener\n removeFromArray(handlers.set, listenerInfo.setHandler);\n removeFromArray(handlers.reset, listenerInfo.resetHandler);\n changeListeners.delete(listener);\n }\n };\n return {\n state,\n get,\n set,\n on,\n onChange,\n use,\n dispose,\n reset,\n forceUpdate,\n removeListener,\n };\n};\nconst removeFromArray = (array, item) => {\n const index = array.indexOf(item);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.length--;\n }\n};\n\nconst createStore = (defaultState, shouldUpdate) => {\n const map = createObservableMap(defaultState, shouldUpdate);\n map.use(stencilSubscription());\n return map;\n};\n\nexport { createObservableMap, createStore };\n","import { createStore } from \"@stencil/store\";\n\nimport { IInfoStore } from \"./src/helpers/info.config.helper\";\nimport { ICheckoutDTO } from \"./src/dto/checkout.dto\";\n\n\ninterface IStoreCheckout {\n clicks: number;\n squaredClicks: number;\n seconds: number;\n storeConfig: IInfoStore;\n checkout: ICheckoutDTO;\n}\n\nconst { state, onChange } = createStore<IStoreCheckout>({\n storeConfig: {\n btnApplyBonusLabel: 'Avançar',\n confirmationMessage: '',\n giftbackTitle: 'giftback',\n keepStoreFrontStyle: false\n },\n checkout: {\n cellphone: null,\n checkoutId: '',\n checkoutProducts: [],\n crmbonuStoreId: null,\n crmbonusUserId: null,\n storeName: ''\n },\n clicks: 0,\n seconds: 0,\n squaredClicks: 0\n});\n\nonChange('clicks', value => {\n state.squaredClicks = value ** 2;\n});\n\nexport default state;",".phone-form {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}","import { Component, Event, EventEmitter, h, Prop, State } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../../../services/crmbonus.service\";\n\nimport store from '../../../../../store';\n\n@Component({\n tag: 'bc-phone-form',\n shadow: true,\n styleUrl: 'styles.scss'\n})\nexport class PhoneForm {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n crmbonusService = CrmBonusService.getInstance();\n\n @State() loading = false;\n\n @Prop() storeName = '';\n\n @Event() actionError: EventEmitter<Partial<{ message: string }>>;\n\n async handlerPhone() {\n this.loading = true;\n try {\n const phoneMask = await this.phoneInputMask.getPhone();\n const phone = phoneMask.replace(/\\D/g, '');\n const send = await this.crmbonusService.sendPin(Number(phone), '', this.storeName);\n\n store.checkout.cellphone = Number(phone);\n store.checkout.crmbonuStoreId = send.storeId;\n store.checkout.crmbonusUserId = send.userId;\n\n } catch (error) {\n this.actionError.emit({\n message: error.message\n });\n } finally {\n this.loading = false;\n }\n }\n\n render() {\n return (\n <div class=\"phone-form\">\n <span>Digite o seu celular para verificar se há desconto disponível nessa compra:</span>\n <phone-input-mask ref={ref => this.phoneInputMask = ref} />\n <crm-button loading={this.loading} txtBtn=\"Avançar\" handleClick={() => this.handlerPhone()} />\n </div>\n )\n }\n}",":host {\n display: block;\n}\n\n.form-container-pin {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.pin-container {\n display: flex;\n /* margin: 26px 0; */\n justify-content: start;\n gap: 10px;\n}\n\n.pin-container input {\n width: 100%;\n height: 48px;\n /* font-size: 14px; */\n text-align: center;\n border: 1px solid #ccc;\n border-radius: 5px;\n}\n\nbutton {\n padding: 10px 20px;\n background-color: #ddd;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n}\n\n\n.success {\n color: green;\n margin-top: 10px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n border-radius: 10px;\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n /* font-size: 20px; */\n cursor: pointer;\n}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n /* font-size: 19px; */\n cursor: pointer;\n}\n\n.crm-description {\n /* font-size: 14px; */\n width: 100%;\n display: flex;\n gap: 9px;\n flex-wrap: wrap;\n}\n\n.crm-description a {\n font-weight: bold;\n cursor: pointer;\n text-decoration: underline;\n}\n\n.crm-description div {\n display: flex;\n gap: 5px;\n}","import { Component, h, Prop, State } from \"@stencil/core\";\n\nimport i18next from '../../../../i18n/i18n'\nimport store from '../../../../../store';\nimport { CrmBonusService } from \"../../../../services/crmbonus.service\";\n\n@Component({\n tag: 'bc-phone-validate-pin-form',\n shadow: true,\n styleUrl: 'styles.scss'\n})\nexport class PhoneValidatePinForm {\n\n crmbonusService = CrmBonusService.getInstance();\n\n @Prop() storeName: string = '';\n @Prop() phone: number;\n @Prop() cancel: () => void;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n @State() canResend: boolean = false;\n @State() loading = false;\n\n handleInput(event: Event, index: number) {\n const input = event.target as HTMLInputElement;\n const value = input.value.slice(0, 1); // Limitar a um único dígito\n this.pin[index] = value;\n\n // Focar no próximo campo, se possível\n if (value && index < this.pin.length - 1) {\n const nextInput = input.nextElementSibling as HTMLInputElement;\n nextInput?.focus();\n }\n\n this.pin = [...this.pin];\n }\n\n async handleResend() {\n // await this.resend();\n\n this.canResend = false;\n this.pin = ['', '', '', ''];\n }\n\n buildTime() {\n const resendDate = localStorage.getItem(\"bc:resend\");\n\n if(resendDate) {\n return resendDate;\n }\n\n const date = new Date();\n date.setSeconds(date.getSeconds() + 30);\n localStorage.setItem(\"bc:resend\", date.toString());\n\n return date.toString();\n }\n\n handleTimeout() {\n localStorage.removeItem(\"bc:resend\")\n this.canResend = true;\n }\n\n validatePin() {\n console.log('[x][STORE]', store.checkout);\n\n // this.crmbonusService.validatePinBonus()\n }\n\n render() {\n return (\n <div class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >{i18next.t('pin-sutitle')} <strong>+55 {this.phone}</strong></label>\n <div class=\"pin-container\">\n {this.pin.map((_, index) => (\n <input\n type=\"text\"\n maxLength={1}\n value={this.pin[index]}\n onInput={(event) => this.handleInput(event, index)}\n />\n ))}\n </div>\n\n <slot></slot>\n\n <p class=\"crm-description\"> Não recebeu?\n {\n !this.canResend && <label> Reenviar em\n <countdown-timer minutos={0} segundos={30} dataCriacao={this.buildTime()} downtime={() => this.handleTimeout()} /> </label>\n }\n {\n this.canResend && (\n <div >\n <a onClick={() => this.handleResend()}>Reenviar</a>\n <a onClick={() => this.cancel()}>Trocar número</a>\n </div>\n )\n }\n </p>\n <crm-button txtBtn={store?.storeConfig?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.validatePin()} />\n </div >\n );\n }\n}"],"version":3}
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-e45b352e.js');
6
+
7
+ const WakeCrmbonus = class {
8
+ constructor(hostRef) {
9
+ index.registerInstance(this, hostRef);
10
+ }
11
+ render() {
12
+ return (index.h("bc-crmbonus", { key: '06d56d19fbe0d101409c44517b70ad8281ce8edb' }));
13
+ }
14
+ };
15
+
16
+ exports.bc_wake_crmbonus = WakeCrmbonus;
17
+
18
+ //# sourceMappingURL=bc-wake-crmbonus.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"bc-wake-crmbonus.entry.cjs.js","mappings":";;;;;;MAKa,YAAY;;;;IAErB,MAAM;QACF,QACIA,2EAAe,EAClB;KACJ;;;;;","names":["h"],"sources":["src/platforms/wake/index.tsx"],"sourcesContent":["import { Component, h } from \"@stencil/core\";\n\n@Component({\n tag: 'bc-wake-crmbonus'\n})\nexport class WakeCrmbonus {\n\n render() {\n return (\n <bc-crmbonus />\n )\n }\n}"],"version":3}