crmbonus-component-wake 0.0.26 → 1.0.27
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/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/app-modal_4.cjs.entry.js +152 -0
- package/dist/cjs/app-modal_4.cjs.entry.js.map +1 -0
- package/dist/cjs/crm-bonus.cjs.entry.js +86 -0
- package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -0
- package/dist/cjs/crmbonus-component-wake.cjs.js +27 -0
- package/dist/cjs/crmbonus-component-wake.cjs.js.map +1 -0
- package/dist/cjs/crmbonus.service-8412ddbf.js +3798 -0
- package/dist/cjs/crmbonus.service-8412ddbf.js.map +1 -0
- package/dist/cjs/giftback-finish_3.cjs.entry.js +102 -0
- package/dist/cjs/giftback-finish_3.cjs.entry.js.map +1 -0
- package/dist/cjs/index-296f70bf.js +11 -0
- package/dist/cjs/index-296f70bf.js.map +1 -0
- package/dist/cjs/index-52d8a075.js +1248 -0
- package/dist/cjs/index-52d8a075.js.map +1 -0
- package/dist/cjs/index.cjs.js +11 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/loading-spinner.cjs.entry.js +24 -0
- package/dist/cjs/loading-spinner.cjs.entry.js.map +1 -0
- package/dist/cjs/pedido-finalizado.cjs.entry.js +36 -0
- package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -0
- package/dist/cjs/phone-input-mask.cjs.entry.js +45 -0
- package/dist/cjs/phone-input-mask.cjs.entry.js.map +1 -0
- package/dist/collection/collection-manifest.json +22 -0
- package/dist/collection/components/crm-bonus/assets/logo.svg +18 -0
- package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +8 -0
- package/dist/collection/components/crm-bonus/assets/svg/logo.svg +18 -0
- package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +8 -0
- package/dist/collection/components/crm-bonus/crm-bonus.css +50 -0
- package/dist/collection/components/crm-bonus/crm-bonus.js +170 -0
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +19 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +311 -0
- package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +10 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +20 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +74 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +127 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +109 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +127 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +75 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +75 -0
- package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +1 -0
- package/dist/collection/components/loading-spinner/loading-spinner.css +17 -0
- package/dist/collection/components/loading-spinner/loading-spinner.js +63 -0
- package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -0
- package/dist/collection/components/modal/app-modal.css +45 -0
- package/dist/collection/components/modal/app-modal.js +83 -0
- package/dist/collection/components/modal/app-modal.js.map +1 -0
- package/dist/collection/components/pedido/pedido.js +83 -0
- package/dist/collection/components/pedido/pedido.js.map +1 -0
- package/dist/collection/components/phone/phone-input-mask.css +47 -0
- package/dist/collection/components/phone/phone-input-mask.js +108 -0
- package/dist/collection/components/phone/phone-input-mask.js.map +1 -0
- package/dist/collection/contants/index.js +8 -0
- package/dist/collection/contants/index.js.map +1 -0
- package/dist/collection/contants/mocks.js +28 -0
- package/dist/collection/contants/mocks.js.map +1 -0
- package/dist/collection/dto/pin.sent.js +2 -0
- package/dist/collection/dto/pin.sent.js.map +1 -0
- package/dist/collection/dto/update.order.dto.js +2 -0
- package/dist/collection/dto/update.order.dto.js.map +1 -0
- package/dist/collection/dto/validate.pin.bonus.js +2 -0
- package/dist/collection/dto/validate.pin.bonus.js.map +1 -0
- package/dist/collection/index.js +11 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/services/crmbonus.service.js +42 -0
- package/dist/collection/services/crmbonus.service.js.map +1 -0
- package/dist/collection/utils/utils.js +4 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/app-modal.js +8 -0
- package/dist/components/app-modal.js.map +1 -0
- package/dist/components/crm-bonus-form.js +8 -0
- package/dist/components/crm-bonus-form.js.map +1 -0
- package/dist/components/crm-bonus.js +167 -0
- package/dist/components/crm-bonus.js.map +1 -0
- package/dist/components/giftback-finish.js +8 -0
- package/dist/components/giftback-finish.js.map +1 -0
- package/dist/components/giftback-pin.js +8 -0
- package/dist/components/giftback-pin.js.map +1 -0
- package/dist/components/giftback-progress.js +8 -0
- package/dist/components/giftback-progress.js.map +1 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/loading-spinner.js +8 -0
- package/dist/components/loading-spinner.js.map +1 -0
- package/dist/components/p-03918b34.js +39 -0
- package/dist/components/p-03918b34.js.map +1 -0
- package/dist/components/p-2667d525.js +36 -0
- package/dist/components/p-2667d525.js.map +1 -0
- package/dist/components/p-28ba6192.js +52 -0
- package/dist/components/p-28ba6192.js.map +1 -0
- package/dist/{crmbonus-component-wake/crmbonus.service-5208f883.js → components/p-374de9ae.js} +91 -166
- package/dist/components/p-374de9ae.js.map +1 -0
- package/dist/{crmbonus-component-wake/giftback-pin.entry.js → components/p-3e80a758.js} +39 -9
- package/dist/components/p-3e80a758.js.map +1 -0
- package/dist/components/p-675deed3.js +62 -0
- package/dist/components/p-675deed3.js.map +1 -0
- package/dist/components/p-b4c3e6bf.js +156 -0
- package/dist/components/p-b4c3e6bf.js.map +1 -0
- package/dist/components/p-c5913818.js +69 -0
- package/dist/components/p-c5913818.js.map +1 -0
- package/dist/components/p-ed6bc79c.js +52 -0
- package/dist/components/p-ed6bc79c.js.map +1 -0
- package/dist/components/p-f6396f4c.js +43 -0
- package/dist/components/p-f6396f4c.js.map +1 -0
- package/dist/components/p-faf7103e.js +1064 -0
- package/dist/components/p-faf7103e.js.map +1 -0
- package/dist/components/pedido-finalizado.js +54 -0
- package/dist/components/pedido-finalizado.js.map +1 -0
- package/dist/components/phone-cancel-input.d.ts +11 -0
- package/dist/components/phone-cancel-input.js +8 -0
- package/dist/components/phone-cancel-input.js.map +1 -0
- package/dist/components/phone-input-mask.js +8 -0
- package/dist/components/phone-input-mask.js.map +1 -0
- package/dist/components/phone-input.js +8 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -48
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/index.esm.js +1 -16
- package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/p-075bd04d.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-075bd04d.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-241a5303.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-241a5303.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-374de9ae.js +2 -0
- package/dist/crmbonus-component-wake/p-374de9ae.js.map +1 -0
- package/dist/crmbonus-component-wake/p-72510682.js +3 -0
- package/dist/crmbonus-component-wake/p-72510682.js.map +1 -0
- package/dist/crmbonus-component-wake/p-86d04322.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-86d04322.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-8e6cdd1e.js +2 -0
- package/dist/crmbonus-component-wake/p-8e6cdd1e.js.map +1 -0
- package/dist/crmbonus-component-wake/p-a603a26e.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-a603a26e.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-e1255160.js +2 -0
- package/dist/crmbonus-component-wake/p-e1255160.js.map +1 -0
- package/dist/crmbonus-component-wake/p-e9c2ed46.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-e9c2ed46.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-ef75ecd5.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-ef75ecd5.entry.js.map +1 -0
- package/dist/env.js +5 -0
- package/dist/env.js.map +1 -0
- package/dist/esm/app-modal_4.entry.js +145 -0
- package/dist/esm/app-modal_4.entry.js.map +1 -0
- package/dist/esm/crm-bonus.entry.js +82 -0
- package/dist/esm/crm-bonus.entry.js.map +1 -0
- package/dist/esm/crmbonus-component-wake.js +22 -0
- package/dist/esm/crmbonus-component-wake.js.map +1 -0
- package/dist/esm/crmbonus.service-053a9e38.js +3796 -0
- package/dist/esm/crmbonus.service-053a9e38.js.map +1 -0
- package/dist/esm/giftback-finish_3.entry.js +96 -0
- package/dist/esm/giftback-finish_3.entry.js.map +1 -0
- package/dist/esm/index-2bfaba2b.js +11 -0
- package/dist/esm/index-2bfaba2b.js.map +1 -0
- package/dist/esm/index-9f7bde48.js +1220 -0
- package/dist/esm/index-9f7bde48.js.map +1 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/loading-spinner.entry.js +4 -3
- package/dist/esm/loading-spinner.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/pedido-finalizado.entry.js +3 -3
- package/dist/esm/pedido-finalizado.entry.js.map +1 -0
- package/dist/{crmbonus-component-wake → esm}/phone-input-mask.entry.js +5 -3
- package/dist/esm/phone-input-mask.entry.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/crm-bonus/crm-bonus.d.ts +9 -0
- package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +8 -4
- package/dist/types/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.d.ts +1 -1
- package/dist/types/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.d.ts +8 -0
- package/dist/types/components/phone/phone-input-mask.d.ts +1 -0
- package/dist/types/components.d.ts +32 -0
- package/package.json +1 -1
- package/dist/crmbonus-component-wake/app-modal.entry.js +0 -23
- package/dist/crmbonus-component-wake/app-modal.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js +0 -109
- package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crm-bonus.entry.js +0 -50
- package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/crmbonus.service-5208f883.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-finish.entry.js +0 -19
- package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/giftback-progress.entry.js +0 -40
- package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/index-f557ce7c.js +0 -3039
- package/dist/crmbonus-component-wake/index-f557ce7c.js.map +0 -1
- package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/phone-input.entry.js +0 -21
- package/dist/crmbonus-component-wake/phone-input.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +0 -334
- package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +0 -1
- /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js +0 -0
- /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js.map +0 -0
@@ -0,0 +1,42 @@
|
|
1
|
+
import axios from "axios";
|
2
|
+
import { CRM_BONUS_API_URL } from "../../env";
|
3
|
+
export class CrmBonusService {
|
4
|
+
constructor() {
|
5
|
+
this.axiosInstance = axios.create({
|
6
|
+
baseURL: CRM_BONUS_API_URL,
|
7
|
+
headers: {
|
8
|
+
'Content-Type': 'application/json',
|
9
|
+
'accept': 'application/json',
|
10
|
+
},
|
11
|
+
});
|
12
|
+
}
|
13
|
+
async getCustomer(userId, store) {
|
14
|
+
const response = await this.axiosInstance.get(`/api/wake/store/${store}/customer/${userId}`, { headers: { 'Content-Type': 'application/json' } });
|
15
|
+
console.log('response.data', response.data);
|
16
|
+
return response.data;
|
17
|
+
}
|
18
|
+
async updateOrder(updateOrderDTO) {
|
19
|
+
const response = await this.axiosInstance.put(`/api/carts/update_cart/${updateOrderDTO.cartId}`, {
|
20
|
+
orderId: updateOrderDTO.orderId,
|
21
|
+
cartIdCrm: updateOrderDTO.cartIdCrm
|
22
|
+
}, { headers: { 'Content-Type': 'application/json' } });
|
23
|
+
console.log('response', response.data);
|
24
|
+
}
|
25
|
+
async sendPin(phone, store) {
|
26
|
+
const response = await this.axiosInstance.post("/api/crm-bonus/send-pin", { celular: phone, nome: "giftback" }, { headers: { store } });
|
27
|
+
return {
|
28
|
+
storeId: response.data.store_id,
|
29
|
+
userId: response.data.user_id
|
30
|
+
};
|
31
|
+
}
|
32
|
+
async validatePinBonus(payload, store) {
|
33
|
+
console.log('[validatePinBonus]', payload);
|
34
|
+
const response = await this.axiosInstance.post("/api/crm-bonus/process-pin-bonus", payload, { headers: { store } });
|
35
|
+
return response.data;
|
36
|
+
}
|
37
|
+
async reserve(payload, store) {
|
38
|
+
const response = await this.axiosInstance.post("/api/crm-bonus/redeem-bonus", payload, { headers: { store } });
|
39
|
+
return response.data;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
//# sourceMappingURL=crmbonus.service.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"crmbonus.service.js","sourceRoot":"","sources":["../../../src/services/crmbonus.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAK7C,MAAM,OAAO,eAAe;IAGxB;QACI,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC;YAC9B,OAAO,EAAE,iBAAiB;YAC1B,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,QAAQ,EAAE,kBAAkB;aAC7B;SACF,CAAC,CAAC;IACT,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,MAAc,EAAE,KAAa;QAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,mBAAmB,KAAK,aAAa,MAAM,EAAE,EAAG,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAA;QAClJ,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;QAC3C,OAAO,QAAQ,CAAC,IAAI,CAAA;IACxB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,cAA8B;QAC5C,MAAM,QAAQ,GAAI,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,0BAA0B,cAAc,CAAC,MAAM,EAAE,EAChG;YACI,OAAO,EAAE,cAAc,CAAC,OAAO;YAC/B,SAAS,EAAE,cAAc,CAAC,SAAS;SACtC,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAA;QAEvD,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IAE1C,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,KAAa,EAAE,KAAa;QACtC,MAAM,QAAQ,GAAI,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACzI,OAAO;YACH,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ;YAC/B,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO;SAChC,CAAA;IACL,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAA4B,EAAE,KAAa;QAC9D,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;QAE3C,MAAM,QAAQ,GAAI,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,kCAAkC,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAA;QAEpH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAoB,EAAE,KAAa;QAC7C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,6BAA6B,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAC/G,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;CACJ","sourcesContent":["import axios, { AxiosInstance } from 'axios';\nimport { CRM_BONUS_API_URL } from '../../env'\nimport { IPinSent } from '../dto/pin.sent';\nimport { IBonus, IProccesPinBonusDto, IReserveDTO } from '../dto/validate.pin.bonus';\nimport { UpdateOrderDTO } from '../dto/update.order.dto';\n\nexport class CrmBonusService {\n private axiosInstance: AxiosInstance;\n\n constructor() {\n this.axiosInstance = axios.create({\n baseURL: CRM_BONUS_API_URL,\n headers: {\n 'Content-Type': 'application/json',\n 'accept': 'application/json',\n },\n });\n }\n\n async getCustomer(userId: number, store: string) {\n const response = await this.axiosInstance.get(`/api/wake/store/${store}/customer/${userId}`, { headers: { 'Content-Type': 'application/json' } })\n console.log('response.data', response.data)\n return response.data\n }\n\n async updateOrder(updateOrderDTO: UpdateOrderDTO){\n const response = await this.axiosInstance.put(`/api/carts/update_cart/${updateOrderDTO.cartId}`, \n { \n orderId: updateOrderDTO.orderId,\n cartIdCrm: updateOrderDTO.cartIdCrm\n }, { headers: { 'Content-Type': 'application/json' } })\n\n console.log('response', response.data)\n \n }\n\n async sendPin(phone: number, store: string): Promise<IPinSent> {\n const response = await this.axiosInstance.post(\"/api/crm-bonus/send-pin\", { celular: phone, nome: \"giftback\" }, { headers: { store } });\n return {\n storeId: response.data.store_id,\n userId: response.data.user_id\n }\n }\n\n async validatePinBonus(payload: IProccesPinBonusDto, store: string): Promise<IBonus> {\n console.log('[validatePinBonus]', payload);\n\n const response = await this.axiosInstance.post(\"/api/crm-bonus/process-pin-bonus\", payload, { headers: { store } })\n\n return response.data;\n }\n\n async reserve(payload: IReserveDTO, store: string) {\n const response = await this.axiosInstance.post(\"/api/crm-bonus/redeem-bonus\", payload, { headers: { store } });\n return response.data;\n }\n}"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAC,KAAc,EAAE,MAAe,EAAE,IAAa;IACnE,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjF,CAAC","sourcesContent":["export function format(first?: string, middle?: string, last?: string): string {\n return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');\n}\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"app-modal.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { C as CrmBonusForm$1, d as defineCustomElement$1 } from './p-b4c3e6bf.js';
|
2
|
+
|
3
|
+
const CrmBonusForm = CrmBonusForm$1;
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
5
|
+
|
6
|
+
export { CrmBonusForm, defineCustomElement };
|
7
|
+
|
8
|
+
//# sourceMappingURL=crm-bonus-form.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"crm-bonus-form.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
@@ -0,0 +1,167 @@
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
|
2
|
+
import { C as CrmBonusService } from './p-374de9ae.js';
|
3
|
+
import { d as defineCustomElement$9, S as StepFormEnum } from './p-b4c3e6bf.js';
|
4
|
+
import { d as defineCustomElement$a } from './p-f6396f4c.js';
|
5
|
+
import { d as defineCustomElement$8 } from './p-2667d525.js';
|
6
|
+
import { d as defineCustomElement$7 } from './p-3e80a758.js';
|
7
|
+
import { d as defineCustomElement$6 } from './p-c5913818.js';
|
8
|
+
import { d as defineCustomElement$5 } from './p-03918b34.js';
|
9
|
+
import { d as defineCustomElement$4 } from './p-ed6bc79c.js';
|
10
|
+
import { d as defineCustomElement$3 } from './p-28ba6192.js';
|
11
|
+
import { d as defineCustomElement$2 } from './p-675deed3.js';
|
12
|
+
|
13
|
+
const crmBonusCss = ".container-button{max-width:100%;cursor:pointer;padding:10px;display:flex}.section-crm{border:1px solid #dbd4d4;text-align:-webkit-center;margin-bottom:20px}.section-cart-crm{text-align:-webkit-center;margin-bottom:20px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;padding:15px;min-height:30px;min-width:120px;font-size:20px;cursor:pointer;margin-left:10px;height:70px}.form-container{width:100%;display:flex;justify-content:center;justify-content:space-around}";
|
14
|
+
const CrmBonusStyle0 = crmBonusCss;
|
15
|
+
|
16
|
+
const CrmBonus$1 = /*@__PURE__*/ proxyCustomElement(class CrmBonus extends H {
|
17
|
+
constructor() {
|
18
|
+
super();
|
19
|
+
this.__registerHost();
|
20
|
+
this.__attachShadow();
|
21
|
+
this.crmBonusService = new CrmBonusService();
|
22
|
+
this.showModal = false;
|
23
|
+
this.userId = undefined;
|
24
|
+
this.storeName = undefined;
|
25
|
+
this.productsInString = undefined;
|
26
|
+
this.cartId = undefined;
|
27
|
+
this.products = undefined;
|
28
|
+
this.customer = {
|
29
|
+
birthDate: "",
|
30
|
+
document: "",
|
31
|
+
name: "",
|
32
|
+
phone: ""
|
33
|
+
};
|
34
|
+
this.loading = false;
|
35
|
+
this.message = undefined;
|
36
|
+
this.phone = undefined;
|
37
|
+
this.canCancel = false;
|
38
|
+
this.sent = undefined;
|
39
|
+
}
|
40
|
+
async componentWillLoad() {
|
41
|
+
await this.handleLoad();
|
42
|
+
}
|
43
|
+
async handleLoad() {
|
44
|
+
try {
|
45
|
+
if (this.userId) {
|
46
|
+
// this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);
|
47
|
+
console.log('user', this.customer);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
catch (error) {
|
51
|
+
console.log('info customer');
|
52
|
+
}
|
53
|
+
this.products = JSON.parse(this.productsInString);
|
54
|
+
}
|
55
|
+
async sendPin(phone) {
|
56
|
+
var _a, _b;
|
57
|
+
this.loading = true;
|
58
|
+
this.message = "";
|
59
|
+
try {
|
60
|
+
const _phone = phone.replace(/\D/g, '');
|
61
|
+
this.phone = Number(_phone);
|
62
|
+
this.sent = await this.crmBonusService.sendPin(this.phone, this.storeName);
|
63
|
+
await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);
|
64
|
+
this.showModal = true;
|
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
|
+
buildProducts() {
|
74
|
+
return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }));
|
75
|
+
}
|
76
|
+
handleCloseModal() {
|
77
|
+
this.showModal = false;
|
78
|
+
}
|
79
|
+
save() {
|
80
|
+
localStorage.setItem('@BYCODERS', this.cartId);
|
81
|
+
}
|
82
|
+
render() {
|
83
|
+
return (h("div", { key: '18d08a3d03ae5106cf01a426751db8300847f95c', class: "section-cart-crm" }, h("div", { key: 'dd9e939b78616cea4ea0b77ac32fe15afe63c9f9', class: "container-button" }, !this.canCancel ? h("phone-cancel-input", { value: this.customer.phone, sendPin: () => { }, loading: this.loading })
|
84
|
+
: h("phone-input", { value: this.customer.phone, sendPin: (phone) => { this.sendPin(phone); }, loading: this.loading })), h("app-modal", { key: 'abc596ebac59d08df3470d028ee814768a870ba9', isOpen: this.showModal, modalTitle: `Giftback`, onModalClosed: () => (this.showModal = false) }, h("crm-bonus-form", { key: '6ee857fd75d7261382ef8b9752bb6f3ea7918245', saveStore: () => this.save(), ref: ref => this.crmBonusRef = ref, sent: this.sent, phone: this.phone, cancel: () => this.handleCloseModal(), storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer }))));
|
85
|
+
}
|
86
|
+
static get assetsDirs() { return ["assets"]; }
|
87
|
+
static get style() { return CrmBonusStyle0; }
|
88
|
+
}, [1, "crm-bonus", {
|
89
|
+
"userId": [2, "userid"],
|
90
|
+
"storeName": [8, "storename"],
|
91
|
+
"productsInString": [1, "products"],
|
92
|
+
"cartId": [8, "cartid"],
|
93
|
+
"showModal": [32],
|
94
|
+
"products": [32],
|
95
|
+
"customer": [32],
|
96
|
+
"loading": [32],
|
97
|
+
"message": [32],
|
98
|
+
"phone": [32],
|
99
|
+
"canCancel": [32],
|
100
|
+
"sent": [32]
|
101
|
+
}]);
|
102
|
+
function defineCustomElement$1() {
|
103
|
+
if (typeof customElements === "undefined") {
|
104
|
+
return;
|
105
|
+
}
|
106
|
+
const components = ["crm-bonus", "app-modal", "crm-bonus-form", "giftback-finish", "giftback-pin", "giftback-progress", "loading-spinner", "phone-cancel-input", "phone-input", "phone-input-mask"];
|
107
|
+
components.forEach(tagName => { switch (tagName) {
|
108
|
+
case "crm-bonus":
|
109
|
+
if (!customElements.get(tagName)) {
|
110
|
+
customElements.define(tagName, CrmBonus$1);
|
111
|
+
}
|
112
|
+
break;
|
113
|
+
case "app-modal":
|
114
|
+
if (!customElements.get(tagName)) {
|
115
|
+
defineCustomElement$a();
|
116
|
+
}
|
117
|
+
break;
|
118
|
+
case "crm-bonus-form":
|
119
|
+
if (!customElements.get(tagName)) {
|
120
|
+
defineCustomElement$9();
|
121
|
+
}
|
122
|
+
break;
|
123
|
+
case "giftback-finish":
|
124
|
+
if (!customElements.get(tagName)) {
|
125
|
+
defineCustomElement$8();
|
126
|
+
}
|
127
|
+
break;
|
128
|
+
case "giftback-pin":
|
129
|
+
if (!customElements.get(tagName)) {
|
130
|
+
defineCustomElement$7();
|
131
|
+
}
|
132
|
+
break;
|
133
|
+
case "giftback-progress":
|
134
|
+
if (!customElements.get(tagName)) {
|
135
|
+
defineCustomElement$6();
|
136
|
+
}
|
137
|
+
break;
|
138
|
+
case "loading-spinner":
|
139
|
+
if (!customElements.get(tagName)) {
|
140
|
+
defineCustomElement$5();
|
141
|
+
}
|
142
|
+
break;
|
143
|
+
case "phone-cancel-input":
|
144
|
+
if (!customElements.get(tagName)) {
|
145
|
+
defineCustomElement$4();
|
146
|
+
}
|
147
|
+
break;
|
148
|
+
case "phone-input":
|
149
|
+
if (!customElements.get(tagName)) {
|
150
|
+
defineCustomElement$3();
|
151
|
+
}
|
152
|
+
break;
|
153
|
+
case "phone-input-mask":
|
154
|
+
if (!customElements.get(tagName)) {
|
155
|
+
defineCustomElement$2();
|
156
|
+
}
|
157
|
+
break;
|
158
|
+
} });
|
159
|
+
}
|
160
|
+
defineCustomElement$1();
|
161
|
+
|
162
|
+
const CrmBonus = CrmBonus$1;
|
163
|
+
const defineCustomElement = defineCustomElement$1;
|
164
|
+
|
165
|
+
export { CrmBonus, defineCustomElement };
|
166
|
+
|
167
|
+
//# sourceMappingURL=crm-bonus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"crm-bonus.js","mappings":"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","names":["CrmBonus"],"sources":["src/components/crm-bonus/crm-bonus.css?tag=crm-bonus&encapsulation=shadow","src/components/crm-bonus/crm-bonus.tsx"],"sourcesContent":["/* :host {\n display: block;\n} */\n\n.container-button {\n max-width: 100%;\n cursor: pointer;\n padding: 10px;\n display: flex;\n}\n\n/* padding: 0 15px 15px;\nborder: 1px solid #ddd;\nmargin-bottom: 20px; */\n\n.section-crm {\n border: 1px solid #dbd4d4;\n /* min-height: 50px; */\n text-align: -webkit-center;\n margin-bottom: 20px;\n}\n\n.section-cart-crm {\n /* border: 1px solid #dbd4d4; */\n /* min-height: 50px; */\n text-align: -webkit-center;\n margin-bottom: 20px;\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 margin-left: 10px;\n height: 70px;\n}\n\n.form-container {\n width: 100%;\n display: flex;\n justify-content: center;\n justify-content: space-around;\n}","import { Component, Prop, State, h } from '@stencil/core';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\nimport { IPinSent } from '../../components';\nimport { StepFormEnum } from '../../contants';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n shadow: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n private crmBonusRef: HTMLCrmBonusFormElement;\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer = {\n birthDate: \"\",\n document: \"\",\n name: \"\",\n phone: \"\"\n };\n\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: number;\n @State() canCancel: boolean = false;\n @State() sent: IPinSent;\n\n async componentWillLoad() {\n await this.handleLoad();\n }\n\n async handleLoad() {\n try {\n if (this.userId) {\n // this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n console.log('user', this.customer);\n }\n } catch (error) {\n console.log('info customer')\n }\n this.products = JSON.parse(this.productsInString);\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n this.sent = await this.crmBonusService.sendPin(this.phone, this.storeName);;\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save() {\n localStorage.setItem('@BYCODERS', this.cartId)\n }\n\n render() {\n return (\n <div class=\"section-cart-crm\">\n <div class=\"container-button\">\n {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}\n {\n !this.canCancel ? <phone-cancel-input value={this.customer.phone} sendPin={() => { }} loading={this.loading} /> \n : <phone-input value={this.customer.phone} sendPin={(phone) => { this.sendPin(phone) }} loading={this.loading} />\n }\n \n </div>\n <app-modal\n isOpen={this.showModal}\n modalTitle={`Giftback`}\n onModalClosed={() => (this.showModal = false)}\n >\n <crm-bonus-form saveStore={() => this.save()} ref={ref => this.crmBonusRef = ref} sent={this.sent} phone={this.phone} cancel={() => this.handleCloseModal()} storeName={this.storeName} products={this.buildProducts()} cartId={this.cartId} customer={this.customer} />\n </app-modal>\n </div>\n )\n }\n}\n"],"version":3}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { G as GiftbackFinish$1, d as defineCustomElement$1 } from './p-2667d525.js';
|
2
|
+
|
3
|
+
const GiftbackFinish = GiftbackFinish$1;
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
5
|
+
|
6
|
+
export { GiftbackFinish, defineCustomElement };
|
7
|
+
|
8
|
+
//# sourceMappingURL=giftback-finish.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"giftback-finish.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { G as GiftbackPin$1, d as defineCustomElement$1 } from './p-3e80a758.js';
|
2
|
+
|
3
|
+
const GiftbackPin = GiftbackPin$1;
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
5
|
+
|
6
|
+
export { GiftbackPin, defineCustomElement };
|
7
|
+
|
8
|
+
//# sourceMappingURL=giftback-pin.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"giftback-pin.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { G as GiftbackProgress$1, d as defineCustomElement$1 } from './p-c5913818.js';
|
2
|
+
|
3
|
+
const GiftbackProgress = GiftbackProgress$1;
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
5
|
+
|
6
|
+
export { GiftbackProgress, defineCustomElement };
|
7
|
+
|
8
|
+
//# sourceMappingURL=giftback-progress.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"giftback-progress.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export { g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-faf7103e.js';
|
2
|
+
|
3
|
+
function format(first, middle, last) {
|
4
|
+
return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
|
5
|
+
}
|
6
|
+
|
7
|
+
export { format };
|
8
|
+
|
9
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"index.js","mappings":";;SAAgB,MAAM,CAAC,KAAc,EAAE,MAAe,EAAE,IAAa;IACnE,OAAO,CAAC,KAAK,IAAI,EAAE,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,GAAG,IAAI,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;AACjF;;;;","names":[],"sources":["src/utils/utils.ts"],"sourcesContent":["export function format(first?: string, middle?: string, last?: string): string {\n return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');\n}\n"],"version":3}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { L as LoadingSpinner$1, d as defineCustomElement$1 } from './p-03918b34.js';
|
2
|
+
|
3
|
+
const LoadingSpinner = LoadingSpinner$1;
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
5
|
+
|
6
|
+
export { LoadingSpinner, defineCustomElement };
|
7
|
+
|
8
|
+
//# sourceMappingURL=loading-spinner.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"loading-spinner.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
|
2
|
+
|
3
|
+
const loadingSpinnerCss = ".spinner{display:inline-block;border:4px solid transparent;border-radius:50%;border-top-color:var(--color, #0078d7);animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
|
4
|
+
const LoadingSpinnerStyle0 = loadingSpinnerCss;
|
5
|
+
|
6
|
+
const LoadingSpinner = /*@__PURE__*/ proxyCustomElement(class LoadingSpinner extends H {
|
7
|
+
constructor() {
|
8
|
+
super();
|
9
|
+
this.__registerHost();
|
10
|
+
this.__attachShadow();
|
11
|
+
this.size = '50px';
|
12
|
+
this.color = '#0078d7';
|
13
|
+
}
|
14
|
+
render() {
|
15
|
+
return (h("div", { key: '78b8ba44c23dcf2fe6b86d343242ff696592bacd', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
|
16
|
+
}
|
17
|
+
static get style() { return LoadingSpinnerStyle0; }
|
18
|
+
}, [1, "loading-spinner", {
|
19
|
+
"size": [1],
|
20
|
+
"color": [1]
|
21
|
+
}]);
|
22
|
+
function defineCustomElement() {
|
23
|
+
if (typeof customElements === "undefined") {
|
24
|
+
return;
|
25
|
+
}
|
26
|
+
const components = ["loading-spinner"];
|
27
|
+
components.forEach(tagName => { switch (tagName) {
|
28
|
+
case "loading-spinner":
|
29
|
+
if (!customElements.get(tagName)) {
|
30
|
+
customElements.define(tagName, LoadingSpinner);
|
31
|
+
}
|
32
|
+
break;
|
33
|
+
} });
|
34
|
+
}
|
35
|
+
defineCustomElement();
|
36
|
+
|
37
|
+
export { LoadingSpinner as L, defineCustomElement as d };
|
38
|
+
|
39
|
+
//# sourceMappingURL=p-03918b34.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-03918b34.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,iOAAiO,CAAC;AAC5P,6BAAe,iBAAiB;;MCMnB,cAAc;;;;;oBACA,MAAM;qBACL,SAAS;;IAEjC,MAAM;QACF,QACI,4DAAK,KAAK,EAAC,SAAS,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,sCAAsC,EAAE,GAAQ,EAC/I;KACL;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/loading-spinner/loading-spinner.css?tag=loading-spinner&encapsulation=shadow","src/components/loading-spinner/loading-spinner.tsx"],"sourcesContent":[".spinner {\n display: inline-block;\n border: 4px solid transparent;\n border-radius: 50%;\n border-top-color: var(--color, #0078d7);\n animation: spin 1s linear infinite;\n}\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}","import { Component, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'loading-spinner',\n styleUrl: 'loading-spinner.css',\n shadow: true,\n})\nexport class LoadingSpinner {\n @Prop() size: string = '50px'; // Tamanho do spinner (padrão 50px)\n @Prop() color: string = '#0078d7'; // Cor do spinner (padrão azul)\n\n render() {\n return (\n <div class=\"spinner\" style={{ width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` }}></div>\n );\n }\n}\n"],"version":3}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
|
2
|
+
|
3
|
+
const successSvgrepoComSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBVcGxvYWRlZCB0bzogU1ZHIFJlcG8sIHd3dy5zdmdyZXBvLmNvbSwgR2VuZXJhdG9yOiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiANCgkgdmlld0JveD0iMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxjaXJjbGUgc3R5bGU9ImZpbGw6IzI1QUU4ODsiIGN4PSIyNSIgY3k9IjI1IiByPSIyNSIvPg0KPHBvbHlsaW5lIHN0eWxlPSJmaWxsOm5vbmU7c3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwOyIgcG9pbnRzPSINCgkzOCwxNSAyMiwzMyAxMiwyNSAiLz4NCjwvc3ZnPg==';
|
4
|
+
|
5
|
+
const giftbackFinishCss = ".message-finish{align-content:center;text-align:center}.message-finish p{color:#777676;font-size:xx-large;font-family:sans-serif}";
|
6
|
+
const GiftbackFinishStyle0 = giftbackFinishCss;
|
7
|
+
|
8
|
+
const GiftbackFinish = /*@__PURE__*/ proxyCustomElement(class GiftbackFinish extends H {
|
9
|
+
constructor() {
|
10
|
+
super();
|
11
|
+
this.__registerHost();
|
12
|
+
this.__attachShadow();
|
13
|
+
}
|
14
|
+
render() {
|
15
|
+
return (h("div", { key: '4fd9a7731194fbe8e9dbe0e2fc9d4241f0baf733', class: "message-finish" }, h("img", { key: 'ba423d92f1672f14be34334fd0495f38f1f70f4a', src: successSvgrepoComSvg, width: 80 }), h("p", { key: '75d6b9648c1357ced70ad43cb94091da73224179' }, "Legal! O B\u00F4nus ser\u00E1 aplicado na sua compra.")));
|
16
|
+
}
|
17
|
+
static get style() { return GiftbackFinishStyle0; }
|
18
|
+
}, [1, "giftback-finish"]);
|
19
|
+
function defineCustomElement() {
|
20
|
+
if (typeof customElements === "undefined") {
|
21
|
+
return;
|
22
|
+
}
|
23
|
+
const components = ["giftback-finish"];
|
24
|
+
components.forEach(tagName => { switch (tagName) {
|
25
|
+
case "giftback-finish":
|
26
|
+
if (!customElements.get(tagName)) {
|
27
|
+
customElements.define(tagName, GiftbackFinish);
|
28
|
+
}
|
29
|
+
break;
|
30
|
+
} });
|
31
|
+
}
|
32
|
+
defineCustomElement();
|
33
|
+
|
34
|
+
export { GiftbackFinish as G, defineCustomElement as d };
|
35
|
+
|
36
|
+
//# sourceMappingURL=p-2667d525.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-2667d525.js","mappings":";;AAAA,MAAM,oBAAoB,GAAG,4rBAA4rB;;ACAztB,MAAM,iBAAiB,GAAG,mIAAmI,CAAC;AAC9J,6BAAe,iBAAiB;;MCOnB,cAAc;;;;;;IACvB,MAAM;QACF,QACI,4DAAK,KAAK,EAAC,gBAAgB,IACvB,4DAAK,GAAG,EAAEA,oBAAO,EAAE,KAAK,EAAE,EAAE,GAAI,EAChC,oHAAkD,CAChD,EACT;KACJ;;;;;;;;;;;;;;;;;;;;","names":["success"],"sources":["src/components/crm-bonus/assets/svg/success-svgrepo-com.svg","src/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css?tag=giftback-finish&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\r\n<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg version=\"1.1\" id=\"Capa_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" \r\n\t viewBox=\"0 0 50 50\" xml:space=\"preserve\">\r\n<circle style=\"fill:#25AE88;\" cx=\"25\" cy=\"25\" r=\"25\"/>\r\n<polyline style=\"fill:none;stroke:#FFFFFF;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;\" points=\"\r\n\t38,15 22,33 12,25 \"/>\r\n</svg>",".message-finish {\n align-content: center;\n text-align: center;\n}\n\n.message-finish p {\n color: #777676;\n font-size: xx-large;\n font-family: sans-serif;\n}","import { Component, h } from \"@stencil/core\";\nimport success from '../../../crm-bonus/assets/svg/success-svgrepo-com.svg'\n\n@Component({\n tag: 'giftback-finish',\n styleUrl: 'giftback-finish.css',\n shadow: true\n})\nexport class GiftbackFinish {\n render() {\n return (\n <div class=\"message-finish\">\n <img src={success} width={80} />\n <p>Legal! O Bônus será aplicado na sua compra.</p>\n </div>\n )\n }\n}"],"version":3}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
|
2
|
+
import { d as defineCustomElement$2 } from './p-03918b34.js';
|
3
|
+
import { d as defineCustomElement$1 } from './p-675deed3.js';
|
4
|
+
|
5
|
+
const PhoneInput = /*@__PURE__*/ proxyCustomElement(class PhoneInput extends H {
|
6
|
+
constructor() {
|
7
|
+
super();
|
8
|
+
this.__registerHost();
|
9
|
+
this.sendPin = undefined;
|
10
|
+
this.loading = undefined;
|
11
|
+
this.value = undefined;
|
12
|
+
}
|
13
|
+
async validatePhone() {
|
14
|
+
const phone = await this.phoneInputMask.getPhone();
|
15
|
+
await this.sendPin(phone);
|
16
|
+
}
|
17
|
+
render() {
|
18
|
+
return (h("div", { key: 'f24f14d158d9565b17aa024837d4e62e6b64c7a3', class: "form-container" }, h("phone-input-mask", { key: '88bf98c7f35b4a4211354a826fa16c922838d228', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("button", { key: '34fe30a30fd755b3b710c9b00f6d511eeef70013', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "25px", color: "#fff" }))));
|
19
|
+
}
|
20
|
+
}, [0, "phone-input", {
|
21
|
+
"sendPin": [16],
|
22
|
+
"loading": [4],
|
23
|
+
"value": [1]
|
24
|
+
}]);
|
25
|
+
function defineCustomElement() {
|
26
|
+
if (typeof customElements === "undefined") {
|
27
|
+
return;
|
28
|
+
}
|
29
|
+
const components = ["phone-input", "loading-spinner", "phone-input-mask"];
|
30
|
+
components.forEach(tagName => { switch (tagName) {
|
31
|
+
case "phone-input":
|
32
|
+
if (!customElements.get(tagName)) {
|
33
|
+
customElements.define(tagName, PhoneInput);
|
34
|
+
}
|
35
|
+
break;
|
36
|
+
case "loading-spinner":
|
37
|
+
if (!customElements.get(tagName)) {
|
38
|
+
defineCustomElement$2();
|
39
|
+
}
|
40
|
+
break;
|
41
|
+
case "phone-input-mask":
|
42
|
+
if (!customElements.get(tagName)) {
|
43
|
+
defineCustomElement$1();
|
44
|
+
}
|
45
|
+
break;
|
46
|
+
} });
|
47
|
+
}
|
48
|
+
defineCustomElement();
|
49
|
+
|
50
|
+
export { PhoneInput as P, defineCustomElement as d };
|
51
|
+
|
52
|
+
//# sourceMappingURL=p-28ba6192.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-28ba6192.js","mappings":";;;;MAKa,UAAU;;;;;;;;IAQnB,MAAM,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC7B;IAED,MAAM;QACF,QACI,4DAAK,KAAK,EAAC,gBAAgB,IACvB,yEAAkB,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,cAAc,GAAG,GAAG,GAAI,EACrF,+DAAQ,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,IAE/G,CAAC,IAAI,CAAC,OAAO,GAAG,SAAS,GAAG,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEvE,CACP,EACT;KACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx"],"sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-input'\n})\nexport class PhoneInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"validar\" : <loading-spinner size=\"25px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"],"version":3}
|