crmbonus-component-wake 0.0.27 → 1.0.28

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 (119) hide show
  1. package/dist/cjs/app-modal_4.cjs.entry.js +152 -0
  2. package/dist/cjs/app-modal_4.cjs.entry.js.map +1 -0
  3. package/dist/cjs/crm-bonus.cjs.entry.js +37 -6
  4. package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -1
  5. package/dist/cjs/crmbonus-component-wake.cjs.js +1 -1
  6. package/dist/cjs/{giftback-finish_5.cjs.entry.js → giftback-finish_3.cjs.entry.js} +6 -59
  7. package/dist/cjs/giftback-finish_3.cjs.entry.js.map +1 -0
  8. package/dist/cjs/index-296f70bf.js +11 -0
  9. package/dist/cjs/index-296f70bf.js.map +1 -0
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
  12. package/dist/cjs/pedido-finalizado.cjs.entry.js +1 -1
  13. package/dist/cjs/phone-input-mask.cjs.entry.js +45 -0
  14. package/dist/cjs/phone-input-mask.cjs.entry.js.map +1 -0
  15. package/dist/collection/collection-manifest.json +1 -0
  16. package/dist/collection/components/crm-bonus/crm-bonus.css +54 -1
  17. package/dist/collection/components/crm-bonus/crm-bonus.js +43 -5
  18. package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
  19. package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +0 -13
  20. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +125 -30
  21. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -1
  22. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +1 -1
  23. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +1 -1
  24. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +3 -3
  25. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +1 -1
  26. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +1 -1
  27. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -1
  28. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +75 -0
  29. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +1 -0
  30. package/dist/collection/components/loading-spinner/loading-spinner.js +1 -1
  31. package/dist/collection/components/modal/app-modal.js +1 -1
  32. package/dist/collection/components/pedido/pedido.js +1 -1
  33. package/dist/collection/components/phone/phone-input-mask.css +16 -7
  34. package/dist/collection/components/phone/phone-input-mask.js +19 -1
  35. package/dist/collection/components/phone/phone-input-mask.js.map +1 -1
  36. package/dist/components/app-modal.js +1 -1
  37. package/dist/components/crm-bonus-form.js +1 -1
  38. package/dist/components/crm-bonus.js +62 -21
  39. package/dist/components/crm-bonus.js.map +1 -1
  40. package/dist/components/giftback-finish.js +1 -1
  41. package/dist/components/giftback-pin.js +1 -1
  42. package/dist/components/giftback-progress.js +1 -1
  43. package/dist/components/loading-spinner.js +1 -1
  44. package/dist/components/{p-cb5a1fdf.js → p-03918b34.js} +2 -2
  45. package/dist/components/{p-cb5a1fdf.js.map → p-03918b34.js.map} +1 -1
  46. package/dist/components/{p-cbade307.js → p-2667d525.js} +2 -2
  47. package/dist/components/{p-cbade307.js.map → p-2667d525.js.map} +1 -1
  48. package/dist/components/{p-8fcf8924.js → p-3d431add.js} +4 -4
  49. package/dist/components/{p-8fcf8924.js.map → p-3d431add.js.map} +1 -1
  50. package/dist/components/{p-e40cf14d.js → p-3d7c9042.js} +5 -3
  51. package/dist/components/p-3d7c9042.js.map +1 -0
  52. package/dist/components/{p-6442ffce.js → p-3e80a758.js} +3 -3
  53. package/dist/components/{p-6442ffce.js.map → p-3e80a758.js.map} +1 -1
  54. package/dist/components/p-a7c9d0d8.js +52 -0
  55. package/dist/components/p-a7c9d0d8.js.map +1 -0
  56. package/dist/components/{p-878ce0aa.js → p-b4c3e6bf.js} +36 -54
  57. package/dist/components/p-b4c3e6bf.js.map +1 -0
  58. package/dist/components/{p-462c12d8.js → p-c5913818.js} +5 -5
  59. package/dist/components/p-c5913818.js.map +1 -0
  60. package/dist/components/{p-e816fb90.js → p-f6396f4c.js} +2 -2
  61. package/dist/components/{p-e816fb90.js.map → p-f6396f4c.js.map} +1 -1
  62. package/dist/components/pedido-finalizado.js +1 -1
  63. package/dist/components/phone-cancel-input.d.ts +11 -0
  64. package/dist/components/phone-cancel-input.js +8 -0
  65. package/dist/components/phone-cancel-input.js.map +1 -0
  66. package/dist/components/phone-input-mask.js +1 -1
  67. package/dist/components/phone-input.js +1 -1
  68. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
  69. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  70. package/dist/crmbonus-component-wake/p-562a34f1.entry.js +2 -0
  71. package/dist/crmbonus-component-wake/p-562a34f1.entry.js.map +1 -0
  72. package/dist/crmbonus-component-wake/p-8e6cdd1e.js +2 -0
  73. package/dist/crmbonus-component-wake/p-8e6cdd1e.js.map +1 -0
  74. package/dist/crmbonus-component-wake/p-9163a847.entry.js +2 -0
  75. package/dist/crmbonus-component-wake/p-9163a847.entry.js.map +1 -0
  76. package/dist/crmbonus-component-wake/{p-f74e4a71.entry.js → p-a603a26e.entry.js} +2 -2
  77. package/dist/crmbonus-component-wake/p-e9c2ed46.entry.js +2 -0
  78. package/dist/crmbonus-component-wake/p-e9c2ed46.entry.js.map +1 -0
  79. package/dist/crmbonus-component-wake/{p-4306a717.entry.js → p-ef75ecd5.entry.js} +2 -2
  80. package/dist/crmbonus-component-wake/p-fafb8311.entry.js +2 -0
  81. package/dist/crmbonus-component-wake/p-fafb8311.entry.js.map +1 -0
  82. package/dist/esm/app-modal_4.entry.js +145 -0
  83. package/dist/esm/app-modal_4.entry.js.map +1 -0
  84. package/dist/esm/crm-bonus.entry.js +37 -6
  85. package/dist/esm/crm-bonus.entry.js.map +1 -1
  86. package/dist/esm/crmbonus-component-wake.js +1 -1
  87. package/dist/esm/{giftback-finish_5.entry.js → giftback-finish_3.entry.js} +7 -58
  88. package/dist/esm/giftback-finish_3.entry.js.map +1 -0
  89. package/dist/esm/index-2bfaba2b.js +11 -0
  90. package/dist/esm/index-2bfaba2b.js.map +1 -0
  91. package/dist/esm/loader.js +1 -1
  92. package/dist/esm/loading-spinner.entry.js +1 -1
  93. package/dist/esm/pedido-finalizado.entry.js +1 -1
  94. package/dist/esm/phone-input-mask.entry.js +41 -0
  95. package/dist/esm/phone-input-mask.entry.js.map +1 -0
  96. package/dist/types/components/crm-bonus/crm-bonus.d.ts +9 -0
  97. package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +8 -4
  98. package/dist/types/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.d.ts +1 -1
  99. package/dist/types/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.d.ts +8 -0
  100. package/dist/types/components/phone/phone-input-mask.d.ts +1 -0
  101. package/dist/types/components.d.ts +32 -0
  102. package/package.json +1 -1
  103. package/dist/cjs/app-modal_2.cjs.entry.js +0 -134
  104. package/dist/cjs/app-modal_2.cjs.entry.js.map +0 -1
  105. package/dist/cjs/giftback-finish_5.cjs.entry.js.map +0 -1
  106. package/dist/components/p-462c12d8.js.map +0 -1
  107. package/dist/components/p-878ce0aa.js.map +0 -1
  108. package/dist/components/p-e40cf14d.js.map +0 -1
  109. package/dist/crmbonus-component-wake/p-9985f639.entry.js +0 -2
  110. package/dist/crmbonus-component-wake/p-9985f639.entry.js.map +0 -1
  111. package/dist/crmbonus-component-wake/p-be1a56de.entry.js +0 -2
  112. package/dist/crmbonus-component-wake/p-be1a56de.entry.js.map +0 -1
  113. package/dist/crmbonus-component-wake/p-e2f165e8.entry.js +0 -2
  114. package/dist/crmbonus-component-wake/p-e2f165e8.entry.js.map +0 -1
  115. package/dist/esm/app-modal_2.entry.js +0 -129
  116. package/dist/esm/app-modal_2.entry.js.map +0 -1
  117. package/dist/esm/giftback-finish_5.entry.js.map +0 -1
  118. /package/dist/crmbonus-component-wake/{p-f74e4a71.entry.js.map → p-a603a26e.entry.js.map} +0 -0
  119. /package/dist/crmbonus-component-wake/{p-4306a717.entry.js.map → p-ef75ecd5.entry.js.map} +0 -0
@@ -0,0 +1,75 @@
1
+ import { h } from "@stencil/core";
2
+ export class PhoneCancelInput {
3
+ constructor() {
4
+ this.sendPin = undefined;
5
+ this.loading = undefined;
6
+ this.value = undefined;
7
+ }
8
+ async validatePhone() {
9
+ const phone = await this.phoneInputMask.getPhone();
10
+ await this.sendPin(phone);
11
+ }
12
+ render() {
13
+ return (h("div", { key: '9e5524ba40c38bcc04325a8b786ea1b29d92e233', class: "form-container" }, h("phone-input-mask", { key: 'a6625e16e686ffd1738989c29245172ebeee13cf', initialValue: "Valor aplicado R$ 100", ref: ref => this.phoneInputMask = ref, disabled: true }), h("button", { key: '8fa99770b94c72058dd779b2309c5563b398d644', class: `btn ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "Cancelar" : h("loading-spinner", { size: "25px", color: "#fff" }))));
14
+ }
15
+ static get is() { return "phone-cancel-input"; }
16
+ static get properties() {
17
+ return {
18
+ "sendPin": {
19
+ "type": "unknown",
20
+ "mutable": false,
21
+ "complexType": {
22
+ "original": "Function",
23
+ "resolved": "Function",
24
+ "references": {
25
+ "Function": {
26
+ "location": "global",
27
+ "id": "global::Function"
28
+ }
29
+ }
30
+ },
31
+ "required": false,
32
+ "optional": false,
33
+ "docs": {
34
+ "tags": [],
35
+ "text": ""
36
+ }
37
+ },
38
+ "loading": {
39
+ "type": "boolean",
40
+ "mutable": false,
41
+ "complexType": {
42
+ "original": "boolean",
43
+ "resolved": "boolean",
44
+ "references": {}
45
+ },
46
+ "required": false,
47
+ "optional": false,
48
+ "docs": {
49
+ "tags": [],
50
+ "text": ""
51
+ },
52
+ "attribute": "loading",
53
+ "reflect": false
54
+ },
55
+ "value": {
56
+ "type": "string",
57
+ "mutable": false,
58
+ "complexType": {
59
+ "original": "string",
60
+ "resolved": "string",
61
+ "references": {}
62
+ },
63
+ "required": false,
64
+ "optional": false,
65
+ "docs": {
66
+ "tags": [],
67
+ "text": ""
68
+ },
69
+ "attribute": "value",
70
+ "reflect": false
71
+ }
72
+ };
73
+ }
74
+ }
75
+ //# sourceMappingURL=phone.cancel.input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone.cancel.input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,OAAO,gBAAgB;;;;;;IAQzB,KAAK,CAAC,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,yEAAkB,YAAY,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,GAAG,EAAE,QAAQ,EAAE,IAAI,GAAI;YAClH,+DAAQ,KAAK,EAAE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAE5G,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAExE,CACP,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-cancel-input'\n})\nexport class PhoneCancelInput {\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={\"Valor aplicado R$ 100\"} ref={ref => this.phoneInputMask = ref} disabled={true} />\n <button class={`btn ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"Cancelar\" : <loading-spinner size=\"25px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"]}
@@ -5,7 +5,7 @@ export class LoadingSpinner {
5
5
  this.color = '#0078d7';
6
6
  }
7
7
  render() {
8
- return (h("div", { key: 'cba1c6d6635d5f9ca12dd86c1d293126ffc54167', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
8
+ return (h("div", { key: '78b8ba44c23dcf2fe6b86d343242ff696592bacd', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
9
9
  }
10
10
  static get is() { return "loading-spinner"; }
11
11
  static get encapsulation() { return "shadow"; }
@@ -8,7 +8,7 @@ export class AppModal {
8
8
  this.modalClosed.emit();
9
9
  }
10
10
  render() {
11
- return (h("div", { key: '82c352862bc0e4bff13b48c82ce09643d922d66e', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, h("div", { key: 'ffde88a49b5e201caa1b14b52fe997ee183cbb6e', class: "modal" }, h("div", { key: 'f68a25c7ca6554d81d3d55f7b9a00f35ddbb4744', class: "modal-header" }, h("h3", { key: 'f0ec45fac1b595bd03b603a2f69dd036fe2cef16' }, this.modalTitle), h("button", { key: '1600501c66d41e9e8aa8ca7b335f41701c7e57ea', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), h("div", { key: '563e936a2717e5534b9f8d528fbd432565562790', class: "modal-body" }, h("slot", { key: '499c8c2925cc9469da0998bbe1fad360adaf1efd' })))));
11
+ return (h("div", { key: '8dab3bfa7301dbd20a783917037c26451cdab5a8', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, h("div", { key: '2846620c39106abde226cd19b2cc0a58b7a88a11', class: "modal" }, h("div", { key: '46b63f75e09aec5d2b9255334733b2813156a5e6', class: "modal-header" }, h("h3", { key: '6a7baae6fc8430ec9cbbcf959f75842ddac253ac' }, this.modalTitle), h("button", { key: 'c6b76e2c862db06657c5ce91fb2bba56fa89e04d', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), h("div", { key: '7caebe8e0fab2569e3e4e33cc512133bc691b331', class: "modal-body" }, h("slot", { key: 'aa5bd4a5ff5810e1d74727b01121b97ec7b54d51' })))));
12
12
  }
13
13
  static get is() { return "app-modal"; }
14
14
  static get encapsulation() { return "shadow"; }
@@ -21,7 +21,7 @@ export class Pedido {
21
21
  }
22
22
  }
23
23
  render() {
24
- return (h("div", { key: 'bf8eabf6fe4118a1e14b532ce6639f918e07cbec' }));
24
+ return (h("div", { key: '693b9e4927b433cd01e555d33e0430c40d80c91a' }));
25
25
  }
26
26
  static get is() { return "pedido-finalizado"; }
27
27
  static get properties() {
@@ -21,13 +21,22 @@
21
21
  }
22
22
 
23
23
  .phone {
24
- width: 300px;
25
- height: 50px;
26
- font-size: 18px;
27
- padding: 10px;
28
- color: grey;
29
- border: 1px solid #d3c6c6;
30
- outline: none;
24
+ display: block;
25
+ width: 100%;
26
+ height: 34px;
27
+ padding: 6px 12px;
28
+ font-size: 14px;
29
+ line-height: 1.42857143;
30
+ color: #555;
31
+ background-color: #fff;
32
+ background-image: none;
33
+ border: 1px solid #ccc;
34
+ border-radius: 4px;
35
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
36
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
37
+ -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
38
+ -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
39
+ transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
31
40
  }
32
41
 
33
42
  .mdc-text-field {
@@ -3,6 +3,7 @@ export class PhoneInputMask {
3
3
  constructor() {
4
4
  this.phone = '';
5
5
  this.initialValue = undefined;
6
+ this.disabled = undefined;
6
7
  }
7
8
  componentWillLoad() {
8
9
  this.phone = this.initialValue;
@@ -25,7 +26,7 @@ export class PhoneInputMask {
25
26
  return this.phone;
26
27
  }
27
28
  render() {
28
- return (h("input", { key: 'eb90a08eb68463fb8dcb81e22d45621b8b59c754', id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
29
+ return (h("input", { key: '67f707c85624ebb9ae25f11021df00db1cf237ce', disabled: this.disabled, id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
29
30
  }
30
31
  static get is() { return "phone-input-mask"; }
31
32
  static get encapsulation() { return "shadow"; }
@@ -57,6 +58,23 @@ export class PhoneInputMask {
57
58
  },
58
59
  "attribute": "initial-value",
59
60
  "reflect": false
61
+ },
62
+ "disabled": {
63
+ "type": "boolean",
64
+ "mutable": false,
65
+ "complexType": {
66
+ "original": "boolean",
67
+ "resolved": "boolean",
68
+ "references": {}
69
+ },
70
+ "required": false,
71
+ "optional": false,
72
+ "docs": {
73
+ "tags": [],
74
+ "text": ""
75
+ },
76
+ "attribute": "disabled",
77
+ "reflect": false
60
78
  }
61
79
  };
62
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"phone-input-mask.js","sourceRoot":"","sources":["../../../../src/components/phone/phone-input-mask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS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AAK,EAAC,OAAO,EACb,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAC3C,WAAW,EAAC,iBAAiB,GAC/B,CACL,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Method, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'phone-input-mask',\n styleUrl: 'phone-input-mask.css',\n shadow: true,\n})\nexport class PhoneInputMask {\n @State() phone: string = '';\n @Prop() initialValue: string;\n\n componentWillLoad() {\n this.phone = this.initialValue; \n }\n\n\n private formatPhone(value: string): string {\n const cleaned = value.replace(/\\D/g, ''); // Remove tudo que não for número\n const match = cleaned.match(/^(\\d{0,2})(\\d{0,5})(\\d{0,4})$/);\n if (!match) return value;\n\n const part1 = match[1] ? `(${match[1]}` : '';\n const part2 = match[2] ? `) ${match[2]}` : '';\n const part3 = match[3] ? `-${match[3]}` : '';\n\n return `${part1}${part2}${part3}`;\n }\n\n private handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.phone = this.formatPhone(input.value);\n }\n\n @Method()\n public async getPhone() {\n return this.phone;\n }\n\n render() {\n return (\n <input\n id=\"phone\"\n type=\"tel\"\n class=\"phone\"\n value={this.phone}\n onInput={(event) => this.handleInput(event)}\n placeholder=\"(12) 94567-8910\"\n />\n );\n }\n}\n"]}
1
+ {"version":3,"file":"phone-input-mask.js","sourceRoot":"","sources":["../../../../src/components/phone/phone-input-mask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOlE,MAAM,OAAO,cAAc;;qBACE,EAAE;;;;IAI3B,iBAAiB;QACb,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;IACn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,EAAC,iBAAiB,GAC/B,CACL,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Method, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'phone-input-mask',\n styleUrl: 'phone-input-mask.css',\n shadow: true,\n})\nexport class PhoneInputMask {\n @State() phone: string = '';\n @Prop() initialValue: string;\n @Prop() disabled: boolean;\n\n componentWillLoad() {\n this.phone = this.initialValue; \n }\n\n private formatPhone(value: string): string {\n const cleaned = value.replace(/\\D/g, ''); // Remove tudo que não for número\n const match = cleaned.match(/^(\\d{0,2})(\\d{0,5})(\\d{0,4})$/);\n if (!match) return value;\n\n const part1 = match[1] ? `(${match[1]}` : '';\n const part2 = match[2] ? `) ${match[2]}` : '';\n const part3 = match[3] ? `-${match[3]}` : '';\n\n return `${part1}${part2}${part3}`;\n }\n\n private handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.phone = this.formatPhone(input.value);\n }\n\n @Method()\n public async getPhone() {\n return this.phone;\n }\n\n render() {\n return (\n <input\n disabled={this.disabled}\n id=\"phone\"\n type=\"tel\"\n class=\"phone\"\n value={this.phone}\n onInput={(event) => this.handleInput(event)}\n placeholder=\"(12) 94567-8910\"\n />\n );\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { A as AppModal$1, d as defineCustomElement$1 } from './p-e816fb90.js';
1
+ import { A as AppModal$1, d as defineCustomElement$1 } from './p-f6396f4c.js';
2
2
 
3
3
  const AppModal = AppModal$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { C as CrmBonusForm$1, d as defineCustomElement$1 } from './p-878ce0aa.js';
1
+ import { C as CrmBonusForm$1, d as defineCustomElement$1 } from './p-b4c3e6bf.js';
2
2
 
3
3
  const CrmBonusForm = CrmBonusForm$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,17 +1,16 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
2
2
  import { C as CrmBonusService } from './p-374de9ae.js';
3
- import { d as defineCustomElement$9 } from './p-e816fb90.js';
4
- import { d as defineCustomElement$8 } from './p-878ce0aa.js';
5
- import { d as defineCustomElement$7 } from './p-cbade307.js';
6
- import { d as defineCustomElement$6 } from './p-6442ffce.js';
7
- import { d as defineCustomElement$5 } from './p-462c12d8.js';
8
- import { d as defineCustomElement$4 } from './p-cb5a1fdf.js';
9
- import { d as defineCustomElement$3 } from './p-8fcf8924.js';
10
- import { d as defineCustomElement$2 } from './p-e40cf14d.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-a7c9d0d8.js';
10
+ import { d as defineCustomElement$3 } from './p-3d431add.js';
11
+ import { d as defineCustomElement$2 } from './p-3d7c9042.js';
11
12
 
12
- const logoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCA3MDMgMTAzIiBmaWxsPSJub25lIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0IiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02ODkuMiA1Ny41MDA0TDY0Ny4xIDk5LjYwMDRMNjM3LjMgODkuODAwNEw2NzkuNCA0Ny43MDA0SDYzNlYzMy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EuNCA5MC41MDAyIDU5MS41IDkwLjUwMDJaIiBmaWxsPSJjdXJyZW50Q29sb3IiPjwvcGF0aD4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhcl8xNjI5XzE4OCIgeDE9IjYzNi44MzMiIHkxPSI5Ny44MjYxIiB4Mj0iNzEzLjQ2IiB5Mj0iMjYuNjU4MiIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjRjdBODMwIj48L3N0b3A+CjxzdG9wIG9mZnNldD0iMC42MzUzIiBzdG9wLWNvbG9yPSIjRjA4MzM2Ij48L3N0b3A+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0VBNTM0NiI+PC9zdG9wPgo8L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPg==';
13
-
14
- const crmBonusCss = ".container-button{max-width:136px;cursor:pointer;padding:10px}.section-crm{border:1px solid #dbd4d4;text-align:-webkit-center;margin-bottom:20px}";
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}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}";
15
14
  const CrmBonusStyle0 = crmBonusCss;
16
15
 
17
16
  const CrmBonus$1 = /*@__PURE__*/ proxyCustomElement(class CrmBonus extends H {
@@ -26,7 +25,17 @@ const CrmBonus$1 = /*@__PURE__*/ proxyCustomElement(class CrmBonus extends H {
26
25
  this.productsInString = undefined;
27
26
  this.cartId = undefined;
28
27
  this.products = undefined;
29
- this.customer = 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;
30
39
  }
31
40
  async componentWillLoad() {
32
41
  await this.handleLoad();
@@ -34,7 +43,7 @@ const CrmBonus$1 = /*@__PURE__*/ proxyCustomElement(class CrmBonus extends H {
34
43
  async handleLoad() {
35
44
  try {
36
45
  if (this.userId) {
37
- this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);
46
+ // this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);
38
47
  console.log('user', this.customer);
39
48
  }
40
49
  }
@@ -43,14 +52,36 @@ const CrmBonus$1 = /*@__PURE__*/ proxyCustomElement(class CrmBonus extends H {
43
52
  }
44
53
  this.products = JSON.parse(this.productsInString);
45
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
+ }
46
73
  buildProducts() {
47
74
  return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }));
48
75
  }
49
76
  handleCloseModal() {
50
77
  this.showModal = false;
51
78
  }
79
+ save() {
80
+ localStorage.setItem('@BYCODERS', this.cartId);
81
+ }
52
82
  render() {
53
- return (h("div", { key: 'c9db6de8e4503b454fd69302ec52808ed4d46812', class: "section-crm" }, h("div", { key: '4dcfd2946439206652ca8668ca37bbe35d5e0e2d', class: "container-button" }, h("img", { key: '07391e65e467aaebf1f1fabdc0d7dcf3fc1d5182', src: logoSvg, onClick: () => (this.showModal = true) })), h("app-modal", { key: '8aa6c41f5faf07e6389a755faed661803b689cd5', isOpen: this.showModal, modalTitle: `Giftback`, onModalClosed: () => (this.showModal = false) }, h("crm-bonus-form", { key: 'e5903b6dd43617e619230490a23ffaaf5d77c9c6', cancel: () => this.handleCloseModal(), storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer }))));
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: '1ea4bbfc4725c76a93f29494b1fa75a5cddc01c2', isOpen: this.showModal, modalTitle: `Giftback`, onModalClosed: () => (this.showModal = false) }, h("crm-bonus-form", { key: '791172ad0eedeb3d2a0da2e965e1298a9bc1003d', 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 }))));
54
85
  }
55
86
  static get assetsDirs() { return ["assets"]; }
56
87
  static get style() { return CrmBonusStyle0; }
@@ -61,13 +92,18 @@ const CrmBonus$1 = /*@__PURE__*/ proxyCustomElement(class CrmBonus extends H {
61
92
  "cartId": [8, "cartid"],
62
93
  "showModal": [32],
63
94
  "products": [32],
64
- "customer": [32]
95
+ "customer": [32],
96
+ "loading": [32],
97
+ "message": [32],
98
+ "phone": [32],
99
+ "canCancel": [32],
100
+ "sent": [32]
65
101
  }]);
66
102
  function defineCustomElement$1() {
67
103
  if (typeof customElements === "undefined") {
68
104
  return;
69
105
  }
70
- const components = ["crm-bonus", "app-modal", "crm-bonus-form", "giftback-finish", "giftback-pin", "giftback-progress", "loading-spinner", "phone-input", "phone-input-mask"];
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"];
71
107
  components.forEach(tagName => { switch (tagName) {
72
108
  case "crm-bonus":
73
109
  if (!customElements.get(tagName)) {
@@ -76,30 +112,35 @@ function defineCustomElement$1() {
76
112
  break;
77
113
  case "app-modal":
78
114
  if (!customElements.get(tagName)) {
79
- defineCustomElement$9();
115
+ defineCustomElement$a();
80
116
  }
81
117
  break;
82
118
  case "crm-bonus-form":
83
119
  if (!customElements.get(tagName)) {
84
- defineCustomElement$8();
120
+ defineCustomElement$9();
85
121
  }
86
122
  break;
87
123
  case "giftback-finish":
88
124
  if (!customElements.get(tagName)) {
89
- defineCustomElement$7();
125
+ defineCustomElement$8();
90
126
  }
91
127
  break;
92
128
  case "giftback-pin":
93
129
  if (!customElements.get(tagName)) {
94
- defineCustomElement$6();
130
+ defineCustomElement$7();
95
131
  }
96
132
  break;
97
133
  case "giftback-progress":
98
134
  if (!customElements.get(tagName)) {
99
- defineCustomElement$5();
135
+ defineCustomElement$6();
100
136
  }
101
137
  break;
102
138
  case "loading-spinner":
139
+ if (!customElements.get(tagName)) {
140
+ defineCustomElement$5();
141
+ }
142
+ break;
143
+ case "phone-cancel-input":
103
144
  if (!customElements.get(tagName)) {
104
145
  defineCustomElement$4();
105
146
  }
@@ -1 +1 @@
1
- {"file":"crm-bonus.js","mappings":";;;;;;;;;;;AAAA,MAAM,OAAO,GAAG,w9JAAw9J;;ACAx+J,MAAM,WAAW,GAAG,mJAAm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Aa,EAAE,OAAO,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,IAE7C,uEAAgB,MAAM,EAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAI,CACxJ,CACR,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CrmBonus","logo"],"sources":["src/components/crm-bonus/assets/svg/logo.svg","src/components/crm-bonus/crm-bonus.css?tag=crm-bonus&encapsulation=shadow","src/components/crm-bonus/crm-bonus.tsx"],"sourcesContent":["<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 703 103\" fill=\"none\" preserveAspectRatio=\"xMidYMid meet\" aria-hidden=\"true\" role=\"img\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M689.2 57.5004L647.1 99.6004L637.3 89.8004L679.4 47.7004H636V33.9004H695C696.9 33.9004 698.5 34.5004 699.7 35.5004C700 35.7004 700.2 35.9004 700.4 36.1004C700.6 36.3004 700.8 36.5004 700.9 36.7004V36.8004V36.9004C702 38.1004 702.7 39.8004 702.7 41.8004V43.6004V67.0004V100.7H688.9V80.8004V57.5004H689.2Z\" fill=\"url(#paint0_linear_1629_188)\"></path>\n<path d=\"M52.7 76.4998H67.7C65.3 91.7998 51.9 102.5 35.2 102.5C15.2 102.5 0 87.2998 0 67.3998C0 47.6998 15.2 32.2998 35.2 32.2998C51.9 32.2998 65.3 42.8998 67.7 58.2998H52.7C50.9 50.7998 44.2 45.6998 35.2 45.6998C22.9 45.6998 14.8 55.3998 14.8 67.3998C14.8 79.4998 22.9 89.0998 35.2 89.0998C44.2 89.1998 50.9 84.0998 52.7 76.4998Z\" fill=\"currentColor\"></path>\n<path d=\"M117.2 32.7002V46.6002C106.6 47.0002 98.5002 51.0002 92.5002 58.8002V100.8H77.7002V34.1002H92.5002V43.2002C98.6002 36.5002 107 32.7002 117.2 32.7002Z\" fill=\"currentColor\"></path>\n<path d=\"M237.4 62.5997V100.8H222.8V62.5997C222.8 50.7997 216.6 45.6997 207 45.6997C200.5 45.6997 194.2 48.0997 189.3 54.7997C189.7 56.8997 189.9 59.2997 189.9 61.7997V100.8H175.2V61.7997C175.2 49.9997 169 45.7997 160.3 45.7997C153.3 45.7997 147.1 48.5997 142.3 55.2997V100.9H127.5V34.1997H142.3V39.8997C147.3 35.3997 153.2 32.4997 162 32.4997C171.5 32.4997 179.2 35.7997 184.1 42.1997C190.6 35.7997 198.2 32.4997 207.9 32.4997C225.5 32.3997 237.4 42.8997 237.4 62.5997Z\" fill=\"currentColor\"></path>\n<path d=\"M320 67.3C320 86.9 304.8 102.5 286.1 102.5C277.6 102.5 270.3 99.9 264.8 95.5V100.8H250V0H264.8V39.2C270.3 34.9 277.6 32.4 286.1 32.4C304.8 32.4 320 48 320 67.3ZM305.2 67.3C305.2 55.5 296.3 45.7 283.9 45.7C276.5 45.7 269.7 48.1 264.7 55.1V79.7C269.7 86.7 276.5 89.2 283.9 89.2C296.3 89.2 305.2 79.2 305.2 67.3Z\" fill=\"currentColor\"></path>\n<path d=\"M399.2 67.5004C399.2 87.9004 384.4 102.6 363.7 102.6C343 102.6 328.2 87.9004 328.2 67.5004C328.2 47.1004 343 32.4004 363.7 32.4004C384.4 32.4004 399.2 47.0004 399.2 67.5004ZM384.4 67.5004C384.4 54.9004 375.7 45.8004 363.7 45.8004C351.7 45.8004 343 54.9004 343 67.5004C343 80.0004 351.7 89.2004 363.7 89.2004C375.7 89.2004 384.4 79.9004 384.4 67.5004Z\" fill=\"currentColor\"></path>\n<path d=\"M474.3 63.5997V100.8H459.5V64.4996C459.5 52.2996 453 45.7997 442.2 45.7997C435.8 45.7997 428.9 49.2996 423.6 55.8996V100.9H408.8V34.1996H423.6V40.1996C429.4 35.1996 436.7 32.4996 445.2 32.4996C462.5 32.3996 474.3 44.2997 474.3 63.5997Z\" fill=\"currentColor\"></path>\n<path d=\"M550.4 34.0996V100.8H535.8V94.2996C530 99.5996 522.7 102.5 514.1 102.5C496.8 102.5 485.1 90.1996 485.1 70.9996V34.0996H499.7V70.1996C499.7 82.3996 506.4 89.1996 517 89.1996C523.5 89.1996 530.3 85.4996 535.7 78.6996V34.0996H550.4Z\" fill=\"currentColor\"></path>\n<path d=\"M591.5 90.5002C600.2 90.5002 606.1 87.7002 606.1 82.4002C606.1 78.4002 602.8 75.6002 597.2 74.6002L582.4 72.0002C572.2 70.3002 562.7 65.2002 562.7 53.1002C562.7 40.2002 573.9 32.2002 590.5 32.2002C603.4 32.2002 618.3 36.6002 619.7 54.1002H606.1C605.4 46.9002 599 44.0002 590.5 44.0002C582 44.0002 577.3 47.1002 577.3 51.8002C577.3 55.3002 579.9 58.8002 587.7 60.0002L600.2 62.0002C610.3 63.8002 620.2 68.2002 620.2 81.2002C620.2 95.3002 607.9 102.5 591.1 102.5C575.3 102.5 561.9 96.3002 560.2 78.7002L573.8 78.8002C575.3 87.0002 581.4 90.5002 591.5 90.5002Z\" fill=\"currentColor\"></path>\n<defs>\n<linearGradient id=\"paint0_linear_1629_188\" x1=\"636.833\" y1=\"97.8261\" x2=\"713.46\" y2=\"26.6582\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"#F7A830\"></stop>\n<stop offset=\"0.6353\" stop-color=\"#F08336\"></stop>\n<stop offset=\"1\" stop-color=\"#EA5346\"></stop>\n</linearGradient>\n</defs>\n</svg>","/* :host {\n display: block;\n} */\n\n.container-button {\n max-width: 136px;\n cursor: pointer;\n padding: 10px;\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}","import { Component, Prop, State, h } from '@stencil/core';\nimport logo from './assets/svg/logo.svg';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\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 @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\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 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 render() {\n return (\n <div class=\"section-crm\">\n <div class=\"container-button\">\n <img src={logo} onClick={() => (this.showModal = true)} />\n </div>\n <app-modal\n isOpen={this.showModal}\n modalTitle={`Giftback`}\n onModalClosed={() => (this.showModal = false)}\n >\n <crm-bonus-form 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}
1
+ {"file":"crm-bonus.js","mappings":";;;;;;;;;;;;AAAA,MAAM,WAAW,GAAG,+2BAA+2B,CAAC;AACp4B,uBAAe,WAAW;;MCWbA,UAAQ;;;;;QAEX,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;yBAInC,KAAK;;;;;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AC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAI,CAC9P,CACR,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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}\n\n\n.btn {\n display: inline-block;\n padding: 6px 12px;\n margin-bottom: 0;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.42857143;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n -ms-touch-action: manipulation;\n touch-action: manipulation;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background-image: none;\n border: 1px solid transparent;\n border-radius: 4px;\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}
@@ -1,4 +1,4 @@
1
- import { G as GiftbackFinish$1, d as defineCustomElement$1 } from './p-cbade307.js';
1
+ import { G as GiftbackFinish$1, d as defineCustomElement$1 } from './p-2667d525.js';
2
2
 
3
3
  const GiftbackFinish = GiftbackFinish$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { G as GiftbackPin$1, d as defineCustomElement$1 } from './p-6442ffce.js';
1
+ import { G as GiftbackPin$1, d as defineCustomElement$1 } from './p-3e80a758.js';
2
2
 
3
3
  const GiftbackPin = GiftbackPin$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { G as GiftbackProgress$1, d as defineCustomElement$1 } from './p-462c12d8.js';
1
+ import { G as GiftbackProgress$1, d as defineCustomElement$1 } from './p-c5913818.js';
2
2
 
3
3
  const GiftbackProgress = GiftbackProgress$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { L as LoadingSpinner$1, d as defineCustomElement$1 } from './p-cb5a1fdf.js';
1
+ import { L as LoadingSpinner$1, d as defineCustomElement$1 } from './p-03918b34.js';
2
2
 
3
3
  const LoadingSpinner = LoadingSpinner$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -12,7 +12,7 @@ const LoadingSpinner = /*@__PURE__*/ proxyCustomElement(class LoadingSpinner ext
12
12
  this.color = '#0078d7';
13
13
  }
14
14
  render() {
15
- return (h("div", { key: 'cba1c6d6635d5f9ca12dd86c1d293126ffc54167', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
15
+ return (h("div", { key: '78b8ba44c23dcf2fe6b86d343242ff696592bacd', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
16
16
  }
17
17
  static get style() { return LoadingSpinnerStyle0; }
18
18
  }, [1, "loading-spinner", {
@@ -36,4 +36,4 @@ defineCustomElement();
36
36
 
37
37
  export { LoadingSpinner as L, defineCustomElement as d };
38
38
 
39
- //# sourceMappingURL=p-cb5a1fdf.js.map
39
+ //# sourceMappingURL=p-03918b34.js.map
@@ -1 +1 @@
1
- {"file":"p-cb5a1fdf.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}
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}
@@ -12,7 +12,7 @@ const GiftbackFinish = /*@__PURE__*/ proxyCustomElement(class GiftbackFinish ext
12
12
  this.__attachShadow();
13
13
  }
14
14
  render() {
15
- return (h("div", { key: 'e72f82799146a6e94acbdd62324e07cdf9f77009', class: "message-finish" }, h("img", { key: '46e2436a3dbe4745225c3b9674e6bf6c299ad63e', src: successSvgrepoComSvg, width: 80 }), h("p", { key: '270e42050956f7f3d1ae9b90f314211fa310f797' }, "Legal! O B\u00F4nus ser\u00E1 aplicado na sua compra.")));
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
16
  }
17
17
  static get style() { return GiftbackFinishStyle0; }
18
18
  }, [1, "giftback-finish"]);
@@ -33,4 +33,4 @@ defineCustomElement();
33
33
 
34
34
  export { GiftbackFinish as G, defineCustomElement as d };
35
35
 
36
- //# sourceMappingURL=p-cbade307.js.map
36
+ //# sourceMappingURL=p-2667d525.js.map
@@ -1 +1 @@
1
- {"file":"p-cbade307.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}
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}
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
2
- import { d as defineCustomElement$2 } from './p-cb5a1fdf.js';
3
- import { d as defineCustomElement$1 } from './p-e40cf14d.js';
2
+ import { d as defineCustomElement$2 } from './p-03918b34.js';
3
+ import { d as defineCustomElement$1 } from './p-3d7c9042.js';
4
4
 
5
5
  const PhoneInput = /*@__PURE__*/ proxyCustomElement(class PhoneInput extends H {
6
6
  constructor() {
@@ -15,7 +15,7 @@ const PhoneInput = /*@__PURE__*/ proxyCustomElement(class PhoneInput extends H {
15
15
  await this.sendPin(phone);
16
16
  }
17
17
  render() {
18
- return (h("div", { key: '8deb65295383b9a14e1ac5c3050ce2cab709c208', class: "form-container" }, h("phone-input-mask", { key: 'd5c9b2fb84b166c67fdfa653f4d0194818d7ae54', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("button", { key: '666403560be459bd387d743936b4de1d0cb29ade', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "25px", color: "#fff" }))));
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: 'e822c98fb3a1c347f6d97a3008837ac79d55569f', class: `btn ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "25px", color: "#fff" }))));
19
19
  }
20
20
  }, [0, "phone-input", {
21
21
  "sendPin": [16],
@@ -49,4 +49,4 @@ defineCustomElement();
49
49
 
50
50
  export { PhoneInput as P, defineCustomElement as d };
51
51
 
52
- //# sourceMappingURL=p-8fcf8924.js.map
52
+ //# sourceMappingURL=p-3d431add.js.map
@@ -1 +1 @@
1
- {"file":"p-8fcf8924.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}
1
+ {"file":"p-3d431add.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,OAAO,IAAI,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,IAE5G,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={`btn ${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}
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
2
2
 
3
- const phoneInputMaskCss = ".inline-text-field-container{display:flex;flex-direction:column}@supports (top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px, var(--mdc-shape-small, 4px))}}@supports (top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined{height:55px;overflow:visible}.phone{width:300px;height:50px;font-size:18px;padding:10px;color:grey;border:1px solid #d3c6c6;outline:none}.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity, transform, color}";
3
+ const phoneInputMaskCss = ".inline-text-field-container{display:flex;flex-direction:column}@supports (top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px, var(--mdc-shape-small, 4px))}}@supports (top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined{height:55px;overflow:visible}.phone{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);-webkit-transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity, transform, color}";
4
4
  const PhoneInputMaskStyle0 = phoneInputMaskCss;
5
5
 
6
6
  const PhoneInputMask = /*@__PURE__*/ proxyCustomElement(class PhoneInputMask extends H {
@@ -10,6 +10,7 @@ const PhoneInputMask = /*@__PURE__*/ proxyCustomElement(class PhoneInputMask ext
10
10
  this.__attachShadow();
11
11
  this.phone = '';
12
12
  this.initialValue = undefined;
13
+ this.disabled = undefined;
13
14
  }
14
15
  componentWillLoad() {
15
16
  this.phone = this.initialValue;
@@ -32,11 +33,12 @@ const PhoneInputMask = /*@__PURE__*/ proxyCustomElement(class PhoneInputMask ext
32
33
  return this.phone;
33
34
  }
34
35
  render() {
35
- return (h("input", { key: 'eb90a08eb68463fb8dcb81e22d45621b8b59c754', id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
36
+ return (h("input", { key: '67f707c85624ebb9ae25f11021df00db1cf237ce', disabled: this.disabled, id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
36
37
  }
37
38
  static get style() { return PhoneInputMaskStyle0; }
38
39
  }, [1, "phone-input-mask", {
39
40
  "initialValue": [1, "initial-value"],
41
+ "disabled": [4],
40
42
  "phone": [32],
41
43
  "getPhone": [64]
42
44
  }]);
@@ -57,4 +59,4 @@ defineCustomElement();
57
59
 
58
60
  export { PhoneInputMask as P, defineCustomElement as d };
59
61
 
60
- //# sourceMappingURL=p-e40cf14d.js.map
62
+ //# sourceMappingURL=p-3d7c9042.js.map
@@ -0,0 +1 @@
1
+ {"file":"p-3d7c9042.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,guCAAguC,CAAC;AAC3vC,6BAAe,iBAAiB;;MCMnB,cAAc;;;;;qBACE,EAAE;;;;IAI3B,iBAAiB;QACb,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;KAClC;IAEO,WAAW,CAAC,KAAa;QAC7B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAEzB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;QAE7C,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,EAAE,CAAC;KACrC;IAEO,WAAW,CAAC,KAAY;QAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC9C;IAGM,MAAM,QAAQ;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC;KACrB;IAED,MAAM;QACF,QACI,8DACI,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,EAAE,EAAC,OAAO,EACV,IAAI,EAAC,KAAK,EACV,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAC3C,WAAW,EAAC,iBAAiB,GAC/B,EACJ;KACL;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/phone/phone-input-mask.css?tag=phone-input-mask&encapsulation=shadow","src/components/phone/phone-input-mask.tsx"],"sourcesContent":[".inline-text-field-container {\n display: flex;\n flex-direction: column;\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-right: max(16px, var(--mdc-shape-small, 4px));\n }\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-left: max(16px, calc(var(--mdc-shape-small, 4px) + 4px));\n }\n}\n\n.mdc-text-field--outlined {\n height: 55px;\n overflow: visible;\n}\n\n.phone {\n display: block;\n width: 100%;\n height: 34px;\n padding: 6px 12px;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555;\n background-color: #fff;\n background-image: none;\n border: 1px solid #ccc;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);\n -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;\n -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n}\n\n.mdc-text-field {\n border-top-left-radius: 4px;\n border-top-left-radius: var(--mdc-shape-small, 4px);\n border-top-right-radius: 4px;\n border-top-right-radius: var(--mdc-shape-small, 4px);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n display: inline-flex;\n align-items: baseline;\n padding: 0 16px;\n position: relative;\n box-sizing: border-box;\n overflow: hidden;\n will-change: opacity, transform, color;\n}","import { Component, h, Method, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'phone-input-mask',\n styleUrl: 'phone-input-mask.css',\n shadow: true,\n})\nexport class PhoneInputMask {\n @State() phone: string = '';\n @Prop() initialValue: string;\n @Prop() disabled: boolean;\n\n componentWillLoad() {\n this.phone = this.initialValue; \n }\n\n private formatPhone(value: string): string {\n const cleaned = value.replace(/\\D/g, ''); // Remove tudo que não for número\n const match = cleaned.match(/^(\\d{0,2})(\\d{0,5})(\\d{0,4})$/);\n if (!match) return value;\n\n const part1 = match[1] ? `(${match[1]}` : '';\n const part2 = match[2] ? `) ${match[2]}` : '';\n const part3 = match[3] ? `-${match[3]}` : '';\n\n return `${part1}${part2}${part3}`;\n }\n\n private handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.phone = this.formatPhone(input.value);\n }\n\n @Method()\n public async getPhone() {\n return this.phone;\n }\n\n render() {\n return (\n <input\n disabled={this.disabled}\n id=\"phone\"\n type=\"tel\"\n class=\"phone\"\n value={this.phone}\n onInput={(event) => this.handleInput(event)}\n placeholder=\"(12) 94567-8910\"\n />\n );\n }\n}\n"],"version":3}