crmbonus-component-wake 2.0.49 → 2.0.51
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.
- package/dist/{esm → crmbonus-component-wake}/app-modal.entry.js +3 -4
- package/dist/crmbonus-component-wake/app-modal.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/countdown-timer.entry.js +30 -0
- package/dist/crmbonus-component-wake/countdown-timer.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/crm-bonus-form.entry.js +4 -5
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/crm-bonus-note.entry.js +48 -0
- package/dist/crmbonus-component-wake/crm-bonus-note.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/crm-bonus.entry.js +7 -6
- package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/crm-button.entry.js +4 -4
- package/dist/crmbonus-component-wake/crm-button.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/crm-giftback-form.entry.js +12 -11
- package/dist/crmbonus-component-wake/crm-giftback-form.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/crmbonus-component-wake.css +7 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +48 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/{esm/crmbonus.service-a846150c.js → crmbonus-component-wake/crmbonus.service-0e166281.js} +167 -92
- package/dist/crmbonus-component-wake/crmbonus.service-0e166281.js.map +1 -0
- package/dist/{components/p-384fabf7.js → crmbonus-component-wake/crmbonus.service-98a7bcf0.js} +167 -92
- package/dist/crmbonus-component-wake/crmbonus.service-98a7bcf0.js.map +1 -0
- package/dist/crmbonus-component-wake/giftback-finish.entry.js +19 -0
- package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +1 -0
- package/dist/{components/p-0a57e57f.js → crmbonus-component-wake/giftback-info.entry.js} +13 -36
- package/dist/crmbonus-component-wake/giftback-info.entry.js.map +1 -0
- package/dist/{components/p-4f18f4c0.js → crmbonus-component-wake/giftback-pin.entry.js} +9 -39
- package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/giftback-progress.entry.js +40 -0
- package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -0
- package/dist/{esm/i18n-853fedb3.js → crmbonus-component-wake/i18n-a17a0837.js} +17 -2
- package/dist/{esm/i18n-853fedb3.js.map → crmbonus-component-wake/i18n-a17a0837.js.map} +1 -1
- package/dist/crmbonus-component-wake/index-bdc90e13.js +3039 -0
- package/dist/crmbonus-component-wake/index-bdc90e13.js.map +1 -0
- package/dist/crmbonus-component-wake/index.esm.js +16 -1
- package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
- package/dist/{esm → crmbonus-component-wake}/loading-spinner.entry.js +3 -4
- package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +1 -0
- package/dist/{components/p-a30bd6b1.js → crmbonus-component-wake/name-input.entry.js} +9 -38
- package/dist/crmbonus-component-wake/name-input.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/pedido-finalizado.entry.js +3 -3
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/phone-cancel-input.entry.js +2 -2
- package/dist/crmbonus-component-wake/phone-cancel-input.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/phone-form.entry.js +26 -0
- package/dist/crmbonus-component-wake/phone-form.entry.js.map +1 -0
- package/dist/{esm → crmbonus-component-wake}/phone-input-mask.entry.js +6 -4
- package/dist/{cjs/phone-input-mask.cjs.entry.js.map → crmbonus-component-wake/phone-input-mask.entry.js.map} +1 -1
- package/dist/{esm → crmbonus-component-wake}/phone-input.entry.js +2 -2
- package/dist/crmbonus-component-wake/phone-input.entry.js.map +1 -0
- package/dist/{components/p-5dfa24e0.js → crmbonus-component-wake/pin-form.entry.js} +13 -56
- package/dist/crmbonus-component-wake/pin-form.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +334 -0
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +1 -0
- package/dist/types/components/button/index.d.ts +1 -0
- package/dist/types/components/giftback-form/subcomponents/phone-form/phone-form.d.ts +2 -0
- package/dist/types/components/giftback-form/subcomponents/pin-form/pin-form.d.ts +2 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/app-modal.cjs.entry.js +0 -28
- package/dist/cjs/app-modal.cjs.entry.js.map +0 -1
- package/dist/cjs/countdown-timer_4.cjs.entry.js +0 -176
- package/dist/cjs/countdown-timer_4.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-bonus-form.cjs.entry.js +0 -103
- package/dist/cjs/crm-bonus-form.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-bonus-note.cjs.entry.js +0 -52
- package/dist/cjs/crm-bonus-note.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-bonus.cjs.entry.js +0 -204
- package/dist/cjs/crm-bonus.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-button.cjs.entry.js +0 -24
- package/dist/cjs/crm-button.cjs.entry.js.map +0 -1
- package/dist/cjs/crm-giftback-form.cjs.entry.js +0 -171
- package/dist/cjs/crm-giftback-form.cjs.entry.js.map +0 -1
- package/dist/cjs/crmbonus-component-wake.cjs.js +0 -27
- package/dist/cjs/crmbonus-component-wake.cjs.js.map +0 -1
- package/dist/cjs/crmbonus.service-7991795d.js +0 -3852
- package/dist/cjs/crmbonus.service-7991795d.js.map +0 -1
- package/dist/cjs/giftback-finish_4.cjs.entry.js +0 -132
- package/dist/cjs/giftback-finish_4.cjs.entry.js.map +0 -1
- package/dist/cjs/i18n-818275e6.js +0 -2209
- package/dist/cjs/i18n-818275e6.js.map +0 -1
- package/dist/cjs/index-80419303.js +0 -1253
- package/dist/cjs/index-80419303.js.map +0 -1
- package/dist/cjs/index-96a8951f.js +0 -16
- package/dist/cjs/index-96a8951f.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -11
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/info.config.helper-c5d9f781.js +0 -16
- package/dist/cjs/info.config.helper-c5d9f781.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -17
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/loading-spinner.cjs.entry.js +0 -24
- package/dist/cjs/loading-spinner.cjs.entry.js.map +0 -1
- package/dist/cjs/pedido-finalizado.cjs.entry.js +0 -36
- package/dist/cjs/pedido-finalizado.cjs.entry.js.map +0 -1
- package/dist/cjs/phone-cancel-input.cjs.entry.js +0 -25
- package/dist/cjs/phone-cancel-input.cjs.entry.js.map +0 -1
- package/dist/cjs/phone-input-mask.cjs.entry.js +0 -58
- package/dist/cjs/phone-input.cjs.entry.js +0 -25
- package/dist/cjs/phone-input.cjs.entry.js.map +0 -1
- package/dist/collection/collection-manifest.json +0 -30
- package/dist/collection/components/button/crm-button.css +0 -22
- package/dist/collection/components/button/index.js +0 -60
- package/dist/collection/components/button/index.js.map +0 -1
- package/dist/collection/components/countdown-timer/countdown-timer.js +0 -51
- package/dist/collection/components/countdown-timer/countdown-timer.js.map +0 -1
- package/dist/collection/components/crm-bonus/assets/logo.svg +0 -18
- package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +0 -8
- package/dist/collection/components/crm-bonus/assets/svg/logo.svg +0 -18
- package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +0 -8
- package/dist/collection/components/crm-bonus/crm-bonus.css +0 -84
- package/dist/collection/components/crm-bonus/crm-bonus.js +0 -291
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +0 -19
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +0 -348
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +0 -10
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +0 -20
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +0 -70
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +0 -127
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +0 -110
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +0 -127
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.css +0 -108
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js +0 -110
- package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +0 -75
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +0 -1
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +0 -75
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +0 -1
- package/dist/collection/components/giftback-form/giftback-form.css +0 -74
- package/dist/collection/components/giftback-form/giftback-form.js +0 -246
- package/dist/collection/components/giftback-form/giftback-form.js.map +0 -1
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +0 -154
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +0 -156
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +0 -1
- package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js +0 -11
- package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js.map +0 -1
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +0 -80
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +0 -1
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +0 -84
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +0 -174
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +0 -1
- package/dist/collection/components/loading-spinner/loading-spinner.css +0 -17
- package/dist/collection/components/loading-spinner/loading-spinner.js +0 -63
- package/dist/collection/components/loading-spinner/loading-spinner.js.map +0 -1
- package/dist/collection/components/modal/app-modal.css +0 -45
- package/dist/collection/components/modal/app-modal.js +0 -83
- package/dist/collection/components/modal/app-modal.js.map +0 -1
- package/dist/collection/components/note/crm-bonus-note.css +0 -51
- package/dist/collection/components/note/crm-bonus-note.js +0 -94
- package/dist/collection/components/note/crm-bonus-note.js.map +0 -1
- package/dist/collection/components/pedido/pedido.js +0 -83
- package/dist/collection/components/pedido/pedido.js.map +0 -1
- package/dist/collection/components/phone/phone-input-mask.css +0 -39
- package/dist/collection/components/phone/phone-input-mask.js +0 -122
- package/dist/collection/components/phone/phone-input-mask.js.map +0 -1
- package/dist/collection/contants/index.js +0 -11
- package/dist/collection/contants/index.js.map +0 -1
- package/dist/collection/contants/mocks.js +0 -28
- package/dist/collection/contants/mocks.js.map +0 -1
- package/dist/collection/dto/pin.sent.js +0 -2
- package/dist/collection/dto/pin.sent.js.map +0 -1
- package/dist/collection/dto/update.order.dto.js +0 -2
- package/dist/collection/dto/update.order.dto.js.map +0 -1
- package/dist/collection/dto/validate.pin.bonus.js +0 -2
- package/dist/collection/dto/validate.pin.bonus.js.map +0 -1
- package/dist/collection/helpers/info.config.helper.js +0 -11
- package/dist/collection/helpers/info.config.helper.js.map +0 -1
- package/dist/collection/i18n/i18n.js +0 -25
- package/dist/collection/i18n/i18n.js.map +0 -1
- package/dist/collection/index.js +0 -11
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/services/crmbonus.service.js +0 -96
- package/dist/collection/services/crmbonus.service.js.map +0 -1
- package/dist/collection/utils/utils.js +0 -4
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/app-modal.js +0 -46
- package/dist/components/app-modal.js.map +0 -1
- package/dist/components/countdown-timer.js +0 -8
- package/dist/components/countdown-timer.js.map +0 -1
- package/dist/components/crm-bonus-form.js +0 -165
- package/dist/components/crm-bonus-form.js.map +0 -1
- package/dist/components/crm-bonus-note.js +0 -71
- package/dist/components/crm-bonus-note.js.map +0 -1
- package/dist/components/crm-bonus.js +0 -282
- package/dist/components/crm-bonus.js.map +0 -1
- package/dist/components/crm-button.js +0 -8
- package/dist/components/crm-button.js.map +0 -1
- package/dist/components/crm-giftback-form.js +0 -8
- package/dist/components/crm-giftback-form.js.map +0 -1
- package/dist/components/giftback-finish.js +0 -8
- package/dist/components/giftback-finish.js.map +0 -1
- package/dist/components/giftback-info.js +0 -8
- package/dist/components/giftback-info.js.map +0 -1
- package/dist/components/giftback-pin.js +0 -8
- package/dist/components/giftback-pin.js.map +0 -1
- package/dist/components/giftback-progress.js +0 -8
- package/dist/components/giftback-progress.js.map +0 -1
- package/dist/components/index.js +0 -9
- package/dist/components/index.js.map +0 -1
- package/dist/components/loading-spinner.js +0 -8
- package/dist/components/loading-spinner.js.map +0 -1
- package/dist/components/name-input.js +0 -8
- package/dist/components/name-input.js.map +0 -1
- package/dist/components/p-0a57e57f.js.map +0 -1
- package/dist/components/p-11bd8050.js +0 -62
- package/dist/components/p-11bd8050.js.map +0 -1
- package/dist/components/p-1d5eeac0.js +0 -2207
- package/dist/components/p-1d5eeac0.js.map +0 -1
- package/dist/components/p-25f37293.js +0 -238
- package/dist/components/p-25f37293.js.map +0 -1
- package/dist/components/p-2f266d73.js +0 -1068
- package/dist/components/p-2f266d73.js.map +0 -1
- package/dist/components/p-384fabf7.js.map +0 -1
- package/dist/components/p-39d680b6.js +0 -49
- package/dist/components/p-39d680b6.js.map +0 -1
- package/dist/components/p-46578efa.js +0 -44
- package/dist/components/p-46578efa.js.map +0 -1
- package/dist/components/p-4f18f4c0.js.map +0 -1
- package/dist/components/p-5c3fe5a8.js +0 -39
- package/dist/components/p-5c3fe5a8.js.map +0 -1
- package/dist/components/p-5dfa24e0.js.map +0 -1
- package/dist/components/p-75ba7b9a.js +0 -14
- package/dist/components/p-75ba7b9a.js.map +0 -1
- package/dist/components/p-a30bd6b1.js.map +0 -1
- package/dist/components/p-a561251a.js +0 -14
- package/dist/components/p-a561251a.js.map +0 -1
- package/dist/components/p-be365312.js +0 -76
- package/dist/components/p-be365312.js.map +0 -1
- package/dist/components/p-f168d5f6.js +0 -69
- package/dist/components/p-f168d5f6.js.map +0 -1
- package/dist/components/p-f5fcff75.js +0 -36
- package/dist/components/p-f5fcff75.js.map +0 -1
- package/dist/components/pedido-finalizado.js +0 -54
- package/dist/components/pedido-finalizado.js.map +0 -1
- package/dist/components/phone-cancel-input.js +0 -55
- package/dist/components/phone-cancel-input.js.map +0 -1
- package/dist/components/phone-form.js +0 -8
- package/dist/components/phone-form.js.map +0 -1
- package/dist/components/phone-input-mask.js +0 -8
- package/dist/components/phone-input-mask.js.map +0 -1
- package/dist/components/phone-input.js +0 -55
- package/dist/components/phone-input.js.map +0 -1
- package/dist/components/pin-form.js +0 -8
- package/dist/components/pin-form.js.map +0 -1
- package/dist/crmbonus-component-wake/p-1d5eeac0.js +0 -2
- package/dist/crmbonus-component-wake/p-1d5eeac0.js.map +0 -1
- package/dist/crmbonus-component-wake/p-384fabf7.js +0 -2
- package/dist/crmbonus-component-wake/p-384fabf7.js.map +0 -1
- package/dist/crmbonus-component-wake/p-3beb5158.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-3beb5158.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-5a8fa5b9.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-5a8fa5b9.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-5ede3b10.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-5ede3b10.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-66f41fd0.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-66f41fd0.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-6e6bf96e.js +0 -3
- package/dist/crmbonus-component-wake/p-6e6bf96e.js.map +0 -1
- package/dist/crmbonus-component-wake/p-75ba7b9a.js +0 -2
- package/dist/crmbonus-component-wake/p-75ba7b9a.js.map +0 -1
- package/dist/crmbonus-component-wake/p-830b5bdc.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-830b5bdc.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-8b9a1aec.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-8b9a1aec.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-9514339e.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-9514339e.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-a561251a.js +0 -2
- package/dist/crmbonus-component-wake/p-a561251a.js.map +0 -1
- package/dist/crmbonus-component-wake/p-adb37e26.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-adb37e26.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-af160cdc.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-af160cdc.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-c271c472.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-c271c472.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-c72a11ba.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-c72a11ba.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-cc452df3.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-cc452df3.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-d0349daf.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-d0349daf.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-e1255160.js +0 -2
- package/dist/crmbonus-component-wake/p-e1255160.js.map +0 -1
- package/dist/env.js +0 -5
- package/dist/env.js.map +0 -1
- package/dist/esm/app-modal.entry.js.map +0 -1
- package/dist/esm/countdown-timer_4.entry.js +0 -169
- package/dist/esm/countdown-timer_4.entry.js.map +0 -1
- package/dist/esm/crm-bonus-form.entry.js.map +0 -1
- package/dist/esm/crm-bonus-note.entry.js +0 -48
- package/dist/esm/crm-bonus-note.entry.js.map +0 -1
- package/dist/esm/crm-bonus.entry.js.map +0 -1
- package/dist/esm/crm-button.entry.js.map +0 -1
- package/dist/esm/crm-giftback-form.entry.js.map +0 -1
- package/dist/esm/crmbonus-component-wake.js +0 -22
- package/dist/esm/crmbonus-component-wake.js.map +0 -1
- package/dist/esm/crmbonus.service-a846150c.js.map +0 -1
- package/dist/esm/giftback-finish_4.entry.js +0 -125
- package/dist/esm/giftback-finish_4.entry.js.map +0 -1
- package/dist/esm/index-a4c14fca.js +0 -1225
- package/dist/esm/index-a4c14fca.js.map +0 -1
- package/dist/esm/index.js +0 -7
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -13
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/loading-spinner.entry.js.map +0 -1
- package/dist/esm/pedido-finalizado.entry.js.map +0 -1
- package/dist/esm/phone-cancel-input.entry.js.map +0 -1
- package/dist/esm/phone-input-mask.entry.js.map +0 -1
- package/dist/esm/phone-input.entry.js.map +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js +0 -0
- /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js.map +0 -0
- /package/dist/{esm → crmbonus-component-wake}/index-3c6d4feb.js +0 -0
- /package/dist/{esm → crmbonus-component-wake}/index-3c6d4feb.js.map +0 -0
- /package/dist/{esm → crmbonus-component-wake}/info.config.helper-42d9ddf9.js +0 -0
- /package/dist/{esm → crmbonus-component-wake}/info.config.helper-42d9ddf9.js.map +0 -0
@@ -1,238 +0,0 @@
|
|
1
|
-
import { p as proxyCustomElement, H, h } from './p-2f266d73.js';
|
2
|
-
import { C as CrmBonusService } from './p-384fabf7.js';
|
3
|
-
import { S as StepFormEnum } from './p-a561251a.js';
|
4
|
-
import { g as getInfoCustomization } from './p-75ba7b9a.js';
|
5
|
-
import { i as instance } from './p-1d5eeac0.js';
|
6
|
-
import { d as defineCustomElement$7 } from './p-39d680b6.js';
|
7
|
-
import { d as defineCustomElement$6 } from './p-46578efa.js';
|
8
|
-
import { d as defineCustomElement$5 } from './p-0a57e57f.js';
|
9
|
-
import { d as defineCustomElement$4 } from './p-5c3fe5a8.js';
|
10
|
-
import { d as defineCustomElement$3 } from './p-11bd8050.js';
|
11
|
-
import { d as defineCustomElement$2 } from './p-be365312.js';
|
12
|
-
import { d as defineCustomElement$1 } from './p-5dfa24e0.js';
|
13
|
-
|
14
|
-
const giftbackFormCss = "*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-family:Roboto;font-size:var(--crmfont-sizebodymd);font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:14px;color:var(--crm-btn)}.crm-title{font-weight:700;line-height:20px;color:#262626;font-size:16px}.crm-message-info{color:#619013;font-weight:500;font-size:12px}.crm-message-error{color:#E11D48;font-weight:500;font-size:12px}";
|
15
|
-
const CrmGiftbackFormStyle0 = giftbackFormCss;
|
16
|
-
|
17
|
-
const CrmBonus = /*@__PURE__*/ proxyCustomElement(class CrmBonus extends H {
|
18
|
-
constructor() {
|
19
|
-
super();
|
20
|
-
this.__registerHost();
|
21
|
-
// private phoneInputMask: HTMLPhoneFormElement;
|
22
|
-
this.crmBonusService = CrmBonusService.getInstance();
|
23
|
-
this.storeName = undefined;
|
24
|
-
this.cartId = undefined;
|
25
|
-
this.products = undefined;
|
26
|
-
this.value = undefined;
|
27
|
-
this.loading = false;
|
28
|
-
this.message = undefined;
|
29
|
-
this.phone = undefined;
|
30
|
-
this.pinInfo = undefined;
|
31
|
-
this.step = StepFormEnum.STEP_PHONE;
|
32
|
-
this.bonus = undefined;
|
33
|
-
this.sucess = "";
|
34
|
-
this.error = "";
|
35
|
-
this.config = undefined;
|
36
|
-
}
|
37
|
-
async handleSendPin(phone) {
|
38
|
-
this.message = "";
|
39
|
-
if (!phone) {
|
40
|
-
this.message = "Informe seu telefone";
|
41
|
-
return;
|
42
|
-
}
|
43
|
-
this.phone = phone;
|
44
|
-
this.sendPin();
|
45
|
-
}
|
46
|
-
componentWillLoad() {
|
47
|
-
this.sucess = "";
|
48
|
-
this.error = "";
|
49
|
-
this.config = getInfoCustomization(this.storeName);
|
50
|
-
}
|
51
|
-
convertStringToNumber() {
|
52
|
-
const _phone = this.phone.replace(/\D/g, '');
|
53
|
-
return Number(_phone);
|
54
|
-
}
|
55
|
-
async sendPin() {
|
56
|
-
var _a, _b;
|
57
|
-
this.loading = true;
|
58
|
-
this.message = "";
|
59
|
-
this.sucess = "";
|
60
|
-
this.error = "";
|
61
|
-
try {
|
62
|
-
const _phone = this.convertStringToNumber();
|
63
|
-
this.pinInfo = await this.crmBonusService.sendPin(_phone, "", this.storeName);
|
64
|
-
this.step = StepFormEnum.STEP_PIN;
|
65
|
-
}
|
66
|
-
catch (error) {
|
67
|
-
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;
|
68
|
-
}
|
69
|
-
finally {
|
70
|
-
this.loading = false;
|
71
|
-
}
|
72
|
-
}
|
73
|
-
changePhone() {
|
74
|
-
this.sucess = "";
|
75
|
-
this.error = "";
|
76
|
-
this.step = StepFormEnum.STEP_PHONE;
|
77
|
-
}
|
78
|
-
async validateBonus(pin) {
|
79
|
-
var _a, _b;
|
80
|
-
if (this.sucess) {
|
81
|
-
this.step = StepFormEnum.STEP_RESERVE;
|
82
|
-
return;
|
83
|
-
}
|
84
|
-
this.loading = true;
|
85
|
-
this.sucess = "";
|
86
|
-
this.error = "";
|
87
|
-
const payload = {
|
88
|
-
pin: pin,
|
89
|
-
cellphone: this.phone.toString(),
|
90
|
-
storeId: this.pinInfo.storeId.toString(),
|
91
|
-
userId: this.pinInfo.userId.toString(),
|
92
|
-
checkoutId: this.cartId,
|
93
|
-
checkoutProducts: this.products,
|
94
|
-
name: null,
|
95
|
-
storeName: this.storeName
|
96
|
-
};
|
97
|
-
try {
|
98
|
-
this.bonus = await this.crmBonusService.validatePinBonus(payload);
|
99
|
-
this.sucess = "Código validado com sucesso!";
|
100
|
-
}
|
101
|
-
catch (error) {
|
102
|
-
const _error = (_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;
|
103
|
-
if (_error.includes("Pin")) {
|
104
|
-
this.error = "Código inválido!";
|
105
|
-
}
|
106
|
-
else {
|
107
|
-
this.error = _error;
|
108
|
-
}
|
109
|
-
this.step = StepFormEnum.STEP_NO_BONUS;
|
110
|
-
}
|
111
|
-
finally {
|
112
|
-
this.loading = false;
|
113
|
-
}
|
114
|
-
}
|
115
|
-
handleCancel() {
|
116
|
-
// this.step = StepFormEnum.STEP_PHONE;
|
117
|
-
this.cancel();
|
118
|
-
}
|
119
|
-
async cancel() {
|
120
|
-
this.message = "";
|
121
|
-
this.loading = true;
|
122
|
-
try {
|
123
|
-
await this.crmBonusService.cancel(this.cartId);
|
124
|
-
localStorage.removeItem(this.cartId);
|
125
|
-
}
|
126
|
-
catch (error) {
|
127
|
-
this.message = "Não consegui cancelar o bônus, tente novamente!";
|
128
|
-
}
|
129
|
-
finally {
|
130
|
-
this.loading = false;
|
131
|
-
}
|
132
|
-
}
|
133
|
-
async reserveApply(amount) {
|
134
|
-
this.loading = true;
|
135
|
-
this.message = "";
|
136
|
-
try {
|
137
|
-
await this.reserve(amount);
|
138
|
-
console.log('[reserva]');
|
139
|
-
this.save(amount);
|
140
|
-
}
|
141
|
-
catch (error) {
|
142
|
-
this.message = "ocorreu um error ao solicitar a aplicação do bonus! tente novamente";
|
143
|
-
this.step = StepFormEnum.STEP_NO_BONUS;
|
144
|
-
}
|
145
|
-
finally {
|
146
|
-
this.loading = false;
|
147
|
-
}
|
148
|
-
}
|
149
|
-
save(amount) {
|
150
|
-
localStorage.setItem(this.cartId, amount.toString());
|
151
|
-
}
|
152
|
-
async reserve(amount) {
|
153
|
-
await this.crmBonusService.reserve({
|
154
|
-
redeemedBonus: amount,
|
155
|
-
cartId: this.cartId,
|
156
|
-
ticket: this.cartId,
|
157
|
-
grossValue: Number(this.bonus.totalValue),
|
158
|
-
storeName: this.storeName,
|
159
|
-
storeId: this.bonus.storeId.toString(),
|
160
|
-
userId: this.bonus.userId
|
161
|
-
});
|
162
|
-
}
|
163
|
-
render() {
|
164
|
-
return (h("div", { key: '06d78425ff758b165bb5bc70662182e6f86ad12d', class: "crm-container-form fbits-responsive-carrinho-desconto" }, h("label", { key: '920084d9a172734b5919b31871526a2809bb87be', class: "crm-title" }, this.config.giftbackTitle), this.step === StepFormEnum.STEP_PHONE &&
|
165
|
-
h("phone-form", { key: '3f78734540d1ee27f41cf7dd2eaf1702ac670f49', loading: this.loading, handlerSubmit: (phone) => this.handleSendPin(phone) }), this.step === StepFormEnum.STEP_PIN &&
|
166
|
-
h("pin-form", { key: '5b8957446dace613bcc8d01adda67d5ed4d0b34e', phone: this.phone, cancel: () => this.changePhone(), resend: () => this.sendPin(), validate: (data) => this.validateBonus(data), loading: this.loading }, this.sucess && h("p", { key: '8210548d8bcb0aba9255a5525e3c0041d11d7394', class: "crm-message-info" }, this.sucess), this.error && h("p", { key: 'ad181c7c5d11ca2e120505121939e42363c44c64', class: "crm-message-error" }, this.error)), this.step === StepFormEnum.STEP_RESERVE &&
|
167
|
-
h("giftback-info", { key: '8f9a22db846c8d8fa2d257e7bc1712be1c67b3dc', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserveApply(amountRedeemed) }), this.step === StepFormEnum.STEP_NO_BONUS &&
|
168
|
-
(h("div", { key: '3e327792f32a22f2064f6201ff14f93fc5124964', class: "container-message" }, instance.t("noGiftback")))));
|
169
|
-
}
|
170
|
-
static get style() { return CrmGiftbackFormStyle0; }
|
171
|
-
}, [0, "crm-giftback-form", {
|
172
|
-
"storeName": [8, "storename"],
|
173
|
-
"cartId": [8, "cart-id"],
|
174
|
-
"products": [16],
|
175
|
-
"value": [32],
|
176
|
-
"loading": [32],
|
177
|
-
"message": [32],
|
178
|
-
"phone": [32],
|
179
|
-
"pinInfo": [32],
|
180
|
-
"step": [32],
|
181
|
-
"bonus": [32],
|
182
|
-
"sucess": [32],
|
183
|
-
"error": [32],
|
184
|
-
"config": [32]
|
185
|
-
}]);
|
186
|
-
function defineCustomElement() {
|
187
|
-
if (typeof customElements === "undefined") {
|
188
|
-
return;
|
189
|
-
}
|
190
|
-
const components = ["crm-giftback-form", "countdown-timer", "crm-button", "giftback-info", "loading-spinner", "phone-form", "phone-input-mask", "pin-form"];
|
191
|
-
components.forEach(tagName => { switch (tagName) {
|
192
|
-
case "crm-giftback-form":
|
193
|
-
if (!customElements.get(tagName)) {
|
194
|
-
customElements.define(tagName, CrmBonus);
|
195
|
-
}
|
196
|
-
break;
|
197
|
-
case "countdown-timer":
|
198
|
-
if (!customElements.get(tagName)) {
|
199
|
-
defineCustomElement$7();
|
200
|
-
}
|
201
|
-
break;
|
202
|
-
case "crm-button":
|
203
|
-
if (!customElements.get(tagName)) {
|
204
|
-
defineCustomElement$6();
|
205
|
-
}
|
206
|
-
break;
|
207
|
-
case "giftback-info":
|
208
|
-
if (!customElements.get(tagName)) {
|
209
|
-
defineCustomElement$5();
|
210
|
-
}
|
211
|
-
break;
|
212
|
-
case "loading-spinner":
|
213
|
-
if (!customElements.get(tagName)) {
|
214
|
-
defineCustomElement$4();
|
215
|
-
}
|
216
|
-
break;
|
217
|
-
case "phone-form":
|
218
|
-
if (!customElements.get(tagName)) {
|
219
|
-
defineCustomElement$3();
|
220
|
-
}
|
221
|
-
break;
|
222
|
-
case "phone-input-mask":
|
223
|
-
if (!customElements.get(tagName)) {
|
224
|
-
defineCustomElement$2();
|
225
|
-
}
|
226
|
-
break;
|
227
|
-
case "pin-form":
|
228
|
-
if (!customElements.get(tagName)) {
|
229
|
-
defineCustomElement$1();
|
230
|
-
}
|
231
|
-
break;
|
232
|
-
} });
|
233
|
-
}
|
234
|
-
defineCustomElement();
|
235
|
-
|
236
|
-
export { CrmBonus as C, defineCustomElement as d };
|
237
|
-
|
238
|
-
//# sourceMappingURL=p-25f37293.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"p-25f37293.js","mappings":";;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,i9BAAi9B,CAAC;AAC1+B,8BAAe,eAAe;;MCYjB,QAAQ;;;;;QAGX,oBAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;;;;;uBAO7C,KAAK;;;;oBAIH,YAAY,CAAC,UAAU;;sBAG3B,EAAE;qBACH,EAAE;;;IAG3B,MAAM,aAAa,CAAC,KAAa;QAE/B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,KAAK,EAAE;YACV,IAAI,CAAC,OAAO,GAAG,sBAAsB,CAAC;YACtC,OAAO;SACR;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,CAAC,OAAO,EAAE,CAAA;KACf;IAED,i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1BA,QAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CACrB,CACP,CAGC,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/giftback-form.css?tag=crm-giftback-form","src/components/giftback-form/giftback-form.tsx"],"sourcesContent":["* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent'\nimport { IBonus, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport i18next from \"../../i18n/i18n\"\n\n@Component({\n tag: 'crm-giftback-form',\n styleUrl: 'giftback-form.css'\n})\nexport class CrmBonus {\n // private phoneInputMask: HTMLPhoneFormElement;\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n\n @State() value: string;\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: string;\n @State() pinInfo: IPinSent;\n @State() step: StepFormEnum = StepFormEnum.STEP_PHONE;\n @State() bonus: IBonus;\n\n @State() sucess: string = \"\";\n @State() error: string = \"\";\n @State() config: IInfoStore;\n\n async handleSendPin(phone: string) {\n\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.phone = phone;\n\n this.sendPin()\n }\n\n componentWillLoad() {\n this.sucess = \"\";\n this.error = \"\"\n this.config = getInfoCustomization(this.storeName);\n }\n\n private convertStringToNumber(): number {\n const _phone = this.phone.replace(/\\D/g, '');\n return Number(_phone);\n }\n\n public async sendPin() {\n this.loading = true;\n this.message = \"\";\n this.sucess = \"\";\n this.error = \"\"\n\n try {\n\n const _phone = this.convertStringToNumber()\n\n this.pinInfo = await this.crmBonusService.sendPin(_phone, \"\", this.storeName);\n\n this.step = StepFormEnum.STEP_PIN;\n\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n changePhone() {\n this.sucess = \"\";\n this.error = \"\"\n this.step = StepFormEnum.STEP_PHONE;\n }\n\n public async validateBonus(pin: string) {\n\n if (this.sucess) {\n this.step = StepFormEnum.STEP_RESERVE;\n return\n }\n\n this.loading = true;\n this.sucess = \"\";\n this.error = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n storeId: this.pinInfo.storeId.toString(),\n userId: this.pinInfo.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.sucess = \"Código validado com sucesso!\";\n\n } catch (error) {\n const _error: string = error?.response?.data?.message;\n\n if (_error.includes(\"Pin\")) {\n this.error = \"Código inválido!\"\n } else {\n this.error = _error;\n }\n\n this.step = StepFormEnum.STEP_NO_BONUS;\n\n } finally {\n this.loading = false;\n }\n }\n\n public handleCancel() {\n // this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n localStorage.removeItem(this.cartId);\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\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 console.log('[reserva]')\n \n this.save(amount);\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n\n this.step = StepFormEnum.STEP_NO_BONUS;\n } finally {\n this.loading = false;\n }\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n }\n\n public async reserve(amount: number) {\n\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 render() {\n return (\n <div class=\"crm-container-form fbits-responsive-carrinho-desconto\" >\n <label class=\"crm-title\">{this.config.giftbackTitle}</label>\n\n {this.step === StepFormEnum.STEP_PHONE &&\n <phone-form\n loading={this.loading}\n handlerSubmit={(phone) => this.handleSendPin(phone)}\n />}\n {\n this.step === StepFormEnum.STEP_PIN &&\n <pin-form\n phone={this.phone}\n cancel={() => this.changePhone()}\n resend={() => this.sendPin()}\n validate={(data) => this.validateBonus(data)}\n loading={this.loading}\n >\n {this.sucess && <p class=\"crm-message-info\">{this.sucess}</p>}\n {this.error && <p class=\"crm-message-error\">{this.error}</p>}\n\n </pin-form>\n }\n\n {\n this.step === StepFormEnum.STEP_RESERVE &&\n <giftback-info\n loading={this.loading}\n cancel={() => this.handleCancel()}\n bonus={this.bonus}\n reserve={(amountRedeemed: number) => this.reserveApply(amountRedeemed)}\n />\n }\n\n\n {\n this.step === StepFormEnum.STEP_NO_BONUS &&\n (\n <div class=\"container-message\">\n { i18next.t(\"noGiftback\") }\n </div>\n )\n\n }\n </div>\n )\n }\n}"],"version":3}
|