crmbonus-component-wake 0.0.26 → 0.0.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  2. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  3. package/dist/cjs/app-modal_2.cjs.entry.js +134 -0
  4. package/dist/cjs/app-modal_2.cjs.entry.js.map +1 -0
  5. package/dist/cjs/crm-bonus.cjs.entry.js +55 -0
  6. package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -0
  7. package/dist/cjs/crmbonus-component-wake.cjs.js +27 -0
  8. package/dist/cjs/crmbonus-component-wake.cjs.js.map +1 -0
  9. package/dist/cjs/crmbonus.service-8412ddbf.js +3798 -0
  10. package/dist/cjs/crmbonus.service-8412ddbf.js.map +1 -0
  11. package/dist/cjs/giftback-finish_5.cjs.entry.js +155 -0
  12. package/dist/cjs/giftback-finish_5.cjs.entry.js.map +1 -0
  13. package/dist/cjs/index-52d8a075.js +1248 -0
  14. package/dist/cjs/index-52d8a075.js.map +1 -0
  15. package/dist/cjs/index.cjs.js +11 -0
  16. package/dist/cjs/index.cjs.js.map +1 -0
  17. package/dist/cjs/loader.cjs.js +17 -0
  18. package/dist/cjs/loader.cjs.js.map +1 -0
  19. package/dist/cjs/loading-spinner.cjs.entry.js +24 -0
  20. package/dist/cjs/loading-spinner.cjs.entry.js.map +1 -0
  21. package/dist/cjs/pedido-finalizado.cjs.entry.js +36 -0
  22. package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -0
  23. package/dist/collection/collection-manifest.json +21 -0
  24. package/dist/collection/components/crm-bonus/assets/logo.svg +18 -0
  25. package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +8 -0
  26. package/dist/collection/components/crm-bonus/assets/svg/logo.svg +18 -0
  27. package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +8 -0
  28. package/dist/collection/components/crm-bonus/crm-bonus.css +20 -0
  29. package/dist/collection/components/crm-bonus/crm-bonus.js +132 -0
  30. package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -0
  31. package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +32 -0
  32. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +216 -0
  33. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -0
  34. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +10 -0
  35. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +20 -0
  36. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +1 -0
  37. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +74 -0
  38. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +127 -0
  39. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +1 -0
  40. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +109 -0
  41. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +127 -0
  42. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +1 -0
  43. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +75 -0
  44. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -0
  45. package/dist/collection/components/loading-spinner/loading-spinner.css +17 -0
  46. package/dist/collection/components/loading-spinner/loading-spinner.js +63 -0
  47. package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -0
  48. package/dist/collection/components/modal/app-modal.css +45 -0
  49. package/dist/collection/components/modal/app-modal.js +83 -0
  50. package/dist/collection/components/modal/app-modal.js.map +1 -0
  51. package/dist/collection/components/pedido/pedido.js +83 -0
  52. package/dist/collection/components/pedido/pedido.js.map +1 -0
  53. package/dist/collection/components/phone/phone-input-mask.css +47 -0
  54. package/dist/collection/components/phone/phone-input-mask.js +90 -0
  55. package/dist/collection/components/phone/phone-input-mask.js.map +1 -0
  56. package/dist/collection/contants/index.js +8 -0
  57. package/dist/collection/contants/index.js.map +1 -0
  58. package/dist/collection/contants/mocks.js +28 -0
  59. package/dist/collection/contants/mocks.js.map +1 -0
  60. package/dist/collection/dto/pin.sent.js +2 -0
  61. package/dist/collection/dto/pin.sent.js.map +1 -0
  62. package/dist/collection/dto/update.order.dto.js +2 -0
  63. package/dist/collection/dto/update.order.dto.js.map +1 -0
  64. package/dist/collection/dto/validate.pin.bonus.js +2 -0
  65. package/dist/collection/dto/validate.pin.bonus.js.map +1 -0
  66. package/dist/collection/index.js +11 -0
  67. package/dist/collection/index.js.map +1 -0
  68. package/dist/collection/services/crmbonus.service.js +42 -0
  69. package/dist/collection/services/crmbonus.service.js.map +1 -0
  70. package/dist/collection/utils/utils.js +4 -0
  71. package/dist/collection/utils/utils.js.map +1 -0
  72. package/dist/components/app-modal.js +8 -0
  73. package/dist/components/app-modal.js.map +1 -0
  74. package/dist/components/crm-bonus-form.js +8 -0
  75. package/dist/components/crm-bonus-form.js.map +1 -0
  76. package/dist/components/crm-bonus.js +126 -0
  77. package/dist/components/crm-bonus.js.map +1 -0
  78. package/dist/components/giftback-finish.js +8 -0
  79. package/dist/components/giftback-finish.js.map +1 -0
  80. package/dist/components/giftback-pin.js +8 -0
  81. package/dist/components/giftback-pin.js.map +1 -0
  82. package/dist/components/giftback-progress.js +8 -0
  83. package/dist/components/giftback-progress.js.map +1 -0
  84. package/dist/components/index.js +9 -0
  85. package/dist/components/index.js.map +1 -0
  86. package/dist/components/loading-spinner.js +8 -0
  87. package/dist/components/loading-spinner.js.map +1 -0
  88. package/dist/{crmbonus-component-wake/crmbonus.service-5208f883.js → components/p-374de9ae.js} +91 -166
  89. package/dist/components/p-374de9ae.js.map +1 -0
  90. package/dist/components/p-462c12d8.js +69 -0
  91. package/dist/components/p-462c12d8.js.map +1 -0
  92. package/dist/{crmbonus-component-wake/giftback-pin.entry.js → components/p-6442ffce.js} +39 -9
  93. package/dist/components/p-6442ffce.js.map +1 -0
  94. package/dist/components/p-878ce0aa.js +174 -0
  95. package/dist/components/p-878ce0aa.js.map +1 -0
  96. package/dist/components/p-8fcf8924.js +52 -0
  97. package/dist/components/p-8fcf8924.js.map +1 -0
  98. package/dist/components/p-cb5a1fdf.js +39 -0
  99. package/dist/components/p-cb5a1fdf.js.map +1 -0
  100. package/dist/components/p-cbade307.js +36 -0
  101. package/dist/components/p-cbade307.js.map +1 -0
  102. package/dist/{crmbonus-component-wake/phone-input-mask.entry.js → components/p-e40cf14d.js} +30 -9
  103. package/dist/components/p-e40cf14d.js.map +1 -0
  104. package/dist/components/p-e816fb90.js +43 -0
  105. package/dist/components/p-e816fb90.js.map +1 -0
  106. package/dist/components/p-faf7103e.js +1064 -0
  107. package/dist/components/p-faf7103e.js.map +1 -0
  108. package/dist/components/pedido-finalizado.js +54 -0
  109. package/dist/components/pedido-finalizado.js.map +1 -0
  110. package/dist/components/phone-input-mask.js +8 -0
  111. package/dist/components/phone-input-mask.js.map +1 -0
  112. package/dist/components/phone-input.js +8 -0
  113. package/dist/components/phone-input.js.map +1 -0
  114. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -48
  115. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  116. package/dist/crmbonus-component-wake/index.esm.js +1 -16
  117. package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
  118. package/dist/crmbonus-component-wake/p-374de9ae.js +2 -0
  119. package/dist/crmbonus-component-wake/p-374de9ae.js.map +1 -0
  120. package/dist/crmbonus-component-wake/p-4306a717.entry.js +2 -0
  121. package/dist/crmbonus-component-wake/p-4306a717.entry.js.map +1 -0
  122. package/dist/crmbonus-component-wake/p-72510682.js +3 -0
  123. package/dist/crmbonus-component-wake/p-72510682.js.map +1 -0
  124. package/dist/crmbonus-component-wake/p-9985f639.entry.js +2 -0
  125. package/dist/crmbonus-component-wake/p-9985f639.entry.js.map +1 -0
  126. package/dist/crmbonus-component-wake/p-be1a56de.entry.js +2 -0
  127. package/dist/crmbonus-component-wake/p-be1a56de.entry.js.map +1 -0
  128. package/dist/crmbonus-component-wake/p-e1255160.js +2 -0
  129. package/dist/crmbonus-component-wake/p-e1255160.js.map +1 -0
  130. package/dist/crmbonus-component-wake/p-e2f165e8.entry.js +2 -0
  131. package/dist/crmbonus-component-wake/p-e2f165e8.entry.js.map +1 -0
  132. package/dist/crmbonus-component-wake/p-f74e4a71.entry.js +2 -0
  133. package/dist/crmbonus-component-wake/p-f74e4a71.entry.js.map +1 -0
  134. package/dist/env.js +5 -0
  135. package/dist/env.js.map +1 -0
  136. package/dist/{crmbonus-component-wake/crm-bonus-form.entry.js → esm/app-modal_2.entry.js} +26 -6
  137. package/dist/esm/app-modal_2.entry.js.map +1 -0
  138. package/dist/{crmbonus-component-wake → esm}/crm-bonus.entry.js +5 -4
  139. package/dist/esm/crm-bonus.entry.js.map +1 -0
  140. package/dist/esm/crmbonus-component-wake.js +22 -0
  141. package/dist/esm/crmbonus-component-wake.js.map +1 -0
  142. package/dist/esm/crmbonus.service-053a9e38.js +3796 -0
  143. package/dist/esm/crmbonus.service-053a9e38.js.map +1 -0
  144. package/dist/esm/giftback-finish_5.entry.js +147 -0
  145. package/dist/esm/giftback-finish_5.entry.js.map +1 -0
  146. package/dist/esm/index-9f7bde48.js +1220 -0
  147. package/dist/esm/index-9f7bde48.js.map +1 -0
  148. package/dist/esm/index.js +7 -0
  149. package/dist/esm/index.js.map +1 -0
  150. package/dist/esm/loader.js +13 -0
  151. package/dist/esm/loader.js.map +1 -0
  152. package/dist/{crmbonus-component-wake → esm}/loading-spinner.entry.js +4 -3
  153. package/dist/esm/loading-spinner.entry.js.map +1 -0
  154. package/dist/{crmbonus-component-wake → esm}/pedido-finalizado.entry.js +3 -3
  155. package/dist/esm/pedido-finalizado.entry.js.map +1 -0
  156. package/dist/index.cjs.js +1 -0
  157. package/dist/index.js +1 -0
  158. package/package.json +1 -1
  159. package/dist/crmbonus-component-wake/app-modal.entry.js +0 -23
  160. package/dist/crmbonus-component-wake/app-modal.entry.js.map +0 -1
  161. package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +0 -1
  162. package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +0 -1
  163. package/dist/crmbonus-component-wake/crmbonus.service-5208f883.js.map +0 -1
  164. package/dist/crmbonus-component-wake/giftback-finish.entry.js +0 -19
  165. package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +0 -1
  166. package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +0 -1
  167. package/dist/crmbonus-component-wake/giftback-progress.entry.js +0 -40
  168. package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +0 -1
  169. package/dist/crmbonus-component-wake/index-f557ce7c.js +0 -3039
  170. package/dist/crmbonus-component-wake/index-f557ce7c.js.map +0 -1
  171. package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +0 -1
  172. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +0 -1
  173. package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +0 -1
  174. package/dist/crmbonus-component-wake/phone-input.entry.js +0 -21
  175. package/dist/crmbonus-component-wake/phone-input.entry.js.map +0 -1
  176. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +0 -334
  177. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +0 -1
  178. /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js +0 -0
  179. /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js.map +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["successSvgrepoComSvg","giftbackFinishCss","GiftbackFinishStyle0","GiftbackFinish","render","h","key","class","src","success","width","giftbackPinCss","GiftbackPinStyle0","GiftbackPin","handleInput","event","index","input","target","value","slice","this","pin","length","nextInput","nextElementSibling","focus","validatePin","console","log","validate","join","verifyPin","pinCode","isVerified","map","_","type","maxLength","onInput","disabled","loading","onClick","cancel","size","color","giftbackProgressCss","GiftbackProgressStyle0","GiftbackProgress","totalBonus","cartId","minimumPurchase","bonusBalance","calculatedValue","firstValidityDate","componentWillLoad","usedValue","parseFloat","bonus","toString","handleSliderChange","handleReserve","reserve","remainingGiftback","totalValue","toFixed","Date","toLocaleDateString","min","step","max","Number","PhoneInput","validatePhone","phone","phoneInputMask","getPhone","sendPin","initialValue","ref","phoneInputMaskCss","PhoneInputMaskStyle0","PhoneInputMask","formatPhone","cleaned","replace","match","part1","part2","part3","id","placeholder"],"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","src/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css?tag=giftback-pin&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.tsx","src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css?tag=giftback-progress&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.tsx","src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx","src/components/phone/phone-input-mask.css?tag=phone-input-mask&encapsulation=shadow","src/components/phone/phone-input-mask.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}",":host {\n display: block;\n font-family: Arial, sans-serif;\n}\n\n.form-container-pin {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.pin-container {\n display: flex;\n gap: 10px;\n margin: 26px 0;\n}\n\ninput {\n width: 58px;\n height: 40px;\n font-size: 18px;\n text-align: center;\n border: 1px solid #ccc;\n border-radius: 5px;\n}\n\nbutton {\n padding: 10px 20px;\n background-color: #ddd;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n}\n\nbutton:hover {\n background-color: #bbb;\n}\n\n.success {\n color: green;\n margin-top: 10px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n border-radius: 10px;\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.footer-button {\n display: flex;\n justify-content: space-between;\n width: 100%;\n}","import { Component, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\n\n@Component({\n tag: 'giftback-pin',\n styleUrl: 'giftback-pin.css',\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() sent: IPinSent;\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n\n @Prop() loading: boolean = false;\n\n handleInput(event: Event, index: number) {\n const input = event.target as HTMLInputElement;\n const value = input.value.slice(0, 1); // Limitar a um único dígito\n this.pin[index] = value;\n\n // Focar no próximo campo, se possível\n if (value && index < this.pin.length - 1) {\n const nextInput = input.nextElementSibling as HTMLInputElement;\n nextInput?.focus();\n }\n\n this.pin = [...this.pin];\n }\n\n validatePin() {\n console.log('this.pin', this.pin);\n this.validate(this.pin.join(\"\"))\n }\n\n verifyPin() {\n const pinCode = this.pin.join('');\n if (pinCode === '9999') {\n this.isVerified = true;\n }\n }\n\n render() {\n return (\n <div class=\"form-container-pin\">\n <div >\n <p>Insira o PIN de 4 dígitos enviado por SMS.</p>\n <div class=\"pin-container\">\n {this.pin.map((_, index) => (\n <input\n type=\"text\"\n maxLength={1}\n value={this.pin[index]}\n onInput={(event) => this.handleInput(event, index)}\n />\n ))}\n </div>\n </div>\n\n <div class=\"footer-button\">\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()}>\n Cancelar\n </button>\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePin()}>\n {\n !this.loading ? \"Enviar\" : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div>\n {/* <button onClick={() => this.verifyPin()}>Enviar</button>\n {this.isVerified && <p class=\"success\">Código verificado com sucesso!</p>} */}\n </div>\n );\n }\n}\n",":host {\n display: flex;\n font-family: Arial, sans-serif;\n /* background-color: #f8f4eb; */\n border-radius: 10px;\n padding: 16px;\n /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */\n max-width: 100%;\n flex-direction: column;\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n}\n\n.giftback-container p {\n font-size: medium;\n}\n\nh3 {\n margin: 0 0 10px;\n font-size: 18px;\n}\n\np {\n margin: 5px 0;\n font-size: 14px;\n align-self: start;\n}\n\n.validity {\n font-size: 12px;\n color: #888;\n}\n\n.progress-container {\n display: flex;\n align-items: center;\n margin: 10px 0;\n}\n\nprogress-container span {\n font-size: 12px;\n color: #666;\n}\n\ninput[type='range'] {\n flex: 1;\n margin: 0 10px;\n appearance: none;\n background-color: #ccc;\n height: 6px;\n border-radius: 3px;\n outline: none;\n cursor: pointer;\n}\n\ninput[type='range']::-webkit-slider-thumb {\n appearance: none;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #555;\n cursor: pointer;\n}\n\n.remaining {\n font-weight: bold;\n font-size: 14px;\n color: #333;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.footer-button-giftback {\n display: flex;\n justify-content: space-between;\n margin-top: 14px;\n}","import { Component, h, State, Prop } from '@stencil/core';\nimport { IBonus } from '../../../../dto/validate.pin.bonus';\n\n@Component({\n tag: 'giftback-progress',\n styleUrl: 'giftback-progress.css',\n shadow: true,\n})\nexport class GiftbackProgress {\n @State() usedValue: number = 0;\n\n @Prop() loading: boolean = false;\n\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\"\n };\n\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n componentWillLoad() {\n this.usedValue = parseFloat(this.bonus.bonusBalance.toString());\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n }\n\n async handleReserve() {\n this.reserve(this.usedValue);\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n return (\n <div class=\"giftback-container\">\n <p>\n Você possui até <strong>R$ {this.bonus.totalBonus.toFixed(2)}</strong> de Giftback nessa compra!\n </p>\n <p class=\"validity\">Válido até: {new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')}</p>\n\n <p>Você está utilizando <strong>R$ {this.usedValue.toFixed(2)}</strong> nessa compra</p>\n\n <div class=\"progress-container\">\n <span>R$ 0</span>\n <input\n disabled\n type=\"range\"\n min=\"0\"\n step=\"0.01\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n onInput={(event) => this.handleSliderChange(event)}\n />\n <span>R$ {this.bonus.totalBonus.toFixed(2)}</span>\n </div>\n\n <p class=\"remaining\">\n Faltam <strong>R$ {remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)}</strong> para utilizar o valor total do Giftback.\n </p>\n\n <div class=\"footer-button-giftback\">\n\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()}>\n Cancelar\n </button>\n\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.handleReserve()}>\n {\n !this.loading ? \"Aplicar\" : <loading-spinner size=\"10px\" color=\"#fff\" />\n }\n </button>\n </div>\n </div>\n );\n }\n}\n","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}",".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 width: 300px;\n height: 50px;\n font-size: 18px;\n padding: 10px;\n color: grey;\n border: 1px solid #d3c6c6;\n outline: none;\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\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"],"mappings":"2CAAA,MAAMA,EAAu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AChB,MAAMiE,EAAUjE,EAAMkE,QAAQ,MAAO,IACrC,MAAMC,EAAQF,EAAQE,MAAM,iCAC5B,IAAKA,EAAO,OAAOnE,EAEnB,MAAMoE,EAAQD,EAAM,GAAK,IAAIA,EAAM,KAAO,GAC1C,MAAME,EAAQF,EAAM,GAAK,KAAKA,EAAM,KAAO,GAC3C,MAAMG,EAAQH,EAAM,GAAK,IAAIA,EAAM,KAAO,GAE1C,MAAO,GAAGC,IAAQC,IAAQC,G,CAGtB,WAAA3E,CAAYC,GAChB,MAAME,EAAQF,EAAMG,OACpBG,KAAKqD,MAAQrD,KAAK8D,YAAYlE,EAAME,M,CAIjC,cAAMyD,GACT,OAAOvD,KAAKqD,K,CAGhB,MAAAtE,GACI,OACIC,EAAA,SAAAC,IAAA,2CACIoF,GAAG,QACHrD,KAAK,MACL9B,MAAM,QACNY,MAAOE,KAAKqD,MACZnC,QAAUxB,GAAUM,KAAKP,YAAYC,GACrC4E,YAAY,mB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r,h as s}from"./p-72510682.js";const t=".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)}}";const n=t;const e=class{constructor(s){r(this,s);this.size="50px";this.color="#0078d7"}render(){return s("div",{key:"cba1c6d6635d5f9ca12dd86c1d293126ffc54167",class:"spinner",style:{width:this.size,height:this.size,borderColor:`${this.color} transparent transparent transparent`}})}};e.style=n;export{e as loading_spinner};
2
+ //# sourceMappingURL=p-f74e4a71.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["loadingSpinnerCss","LoadingSpinnerStyle0","LoadingSpinner","render","h","key","class","style","width","this","size","height","borderColor","color"],"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"],"mappings":"sCAAA,MAAMA,EAAoB,kOAC1B,MAAAC,EAAeD,E,MCMFE,EAAc,M,mCACA,O,WACC,S,CAExB,MAAAC,GACI,OACIC,EAAA,OAAAC,IAAA,2CAAKC,MAAM,UAAUC,MAAO,CAAEC,MAAOC,KAAKC,KAAMC,OAAQF,KAAKC,KAAME,YAAa,GAAGH,KAAKI,8C","ignoreList":[]}
package/dist/env.js ADDED
@@ -0,0 +1,5 @@
1
+ export const CRM_BONUS_API_URL = "https://crmbonus-service-staging-d15ba5377115.herokuapp.com"; //"https://typically-workable-perch.ngrok-free.app"; // "http://localhost:3500";
2
+ export const CRM_BONUS_ID_LOJA = "undefined";
3
+ export const CRM_BONUS_CODEMPRESA = "undefined";
4
+ export const CRM_BONUS_AUTHORIZATION = "undefined";
5
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../env.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,iBAAiB,GAAG,6DAA6D,CAAC,CAAC,gFAAgF;AAChL,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAC7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAChD,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC","sourcesContent":["\nexport const CRM_BONUS_API_URL = \"https://crmbonus-service-staging-d15ba5377115.herokuapp.com\"; //\"https://typically-workable-perch.ngrok-free.app\"; // \"http://localhost:3500\";\nexport const CRM_BONUS_ID_LOJA = \"undefined\";\nexport const CRM_BONUS_CODEMPRESA = \"undefined\";\nexport const CRM_BONUS_AUTHORIZATION = \"undefined\";\n"]}
@@ -1,5 +1,24 @@
1
- import { r as registerInstance, h, e as Host } from './index-f557ce7c.js';
2
- import { C as CrmBonusService } from './crmbonus.service-5208f883.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-9f7bde48.js';
2
+ import { C as CrmBonusService } from './crmbonus.service-053a9e38.js';
3
+
4
+ const appModalCss = ".modal-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);display:none;justify-content:center;align-items:center;z-index:1000}.modal-backdrop.visible{display:flex}.modal{background:white;border-radius:8px;padding:1rem;max-width:500px;width:90%;box-shadow:0 2px 10px rgba(0, 0, 0, 0.3)}.modal-header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #ddd;margin-bottom:1rem}.close-button{background:none;border:none;font-size:1.5rem;cursor:pointer}.modal-body{}";
5
+ const AppModalStyle0 = appModalCss;
6
+
7
+ const AppModal = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.modalClosed = createEvent(this, "modalClosed", 7);
11
+ this.isOpen = false;
12
+ this.modalTitle = undefined;
13
+ }
14
+ closeModal() {
15
+ this.modalClosed.emit();
16
+ }
17
+ render() {
18
+ 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' })))));
19
+ }
20
+ };
21
+ AppModal.style = AppModalStyle0;
3
22
 
4
23
  var StepFormEnum;
5
24
  (function (StepFormEnum) {
@@ -10,6 +29,7 @@ var StepFormEnum;
10
29
  })(StepFormEnum || (StepFormEnum = {}));
11
30
 
12
31
  const crmBonusFormCss = ".form-container{width:100%;display:flex;justify-content:center;justify-content:space-around}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:15px;min-height:30px;min-width:120px;font-size:20px;cursor:pointer}.disabled{opacity:0.6;cursor:not-allowed}.message-error{color:#d11111;font-weight:bold;font-family:Arial;font-size:small;margin-left:16px}";
32
+ const CrmBonusFormStyle0 = crmBonusFormCss;
13
33
 
14
34
  const CrmBonusForm = class {
15
35
  constructor(hostRef) {
@@ -99,11 +119,11 @@ const CrmBonusForm = class {
99
119
  this.cancel();
100
120
  }
101
121
  render() {
102
- return (h(Host, { key: '3be4b75b0ae2a8ad1cdda1717e7b464fdbf2144f' }, this.step === StepFormEnum.STEP_PHONE && h("phone-input", { key: '32c9afa5e7866ed4d534e1796f619ab3461fe6ae', value: this.customer.phone, sendPin: (phone) => this.sendPin(phone), loading: this.loading }), this.step === StepFormEnum.STEP_PIN && h("giftback-pin", { key: '5305fcb69fc27d84c98c8ad06cb0d368d19c13fe', cancel: () => this.handleCancel(), sent: this.sent, validate: (data) => this.validateBonus(data), loading: this.loading }), this.step === StepFormEnum.STEP_RESERVE && h("giftback-progress", { key: 'ad58eda5507e90e17d4346195b6caa7a4309460a', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserve(amountRedeemed) }), this.step === StepFormEnum.STEP_APPLY && h("giftback-finish", { key: 'e178cbe6553944ae87db1349b87a89bd8668e32d' }), h("p", { key: '7f49c0dbfe6d7a9bb2856a3a016513f8065647a0', class: "message-error" }, this.message)));
122
+ return (h(Host, { key: '3097220f8802f698c4c1163fa359dfbf3089921f' }, this.step === StepFormEnum.STEP_PHONE && h("phone-input", { key: '039f1d21f8b40f00b24722fe26d5a5539f9d8226', value: this.customer.phone, sendPin: (phone) => this.sendPin(phone), loading: this.loading }), this.step === StepFormEnum.STEP_PIN && h("giftback-pin", { key: '600a4adff83b3afa5d82c4fd484ab07757323ebb', cancel: () => this.handleCancel(), sent: this.sent, validate: (data) => this.validateBonus(data), loading: this.loading }), this.step === StepFormEnum.STEP_RESERVE && h("giftback-progress", { key: 'd3f430232255cc602f0cdb6c7fe4b4cc41588fdc', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserve(amountRedeemed) }), this.step === StepFormEnum.STEP_APPLY && h("giftback-finish", { key: '6cac259c8b3d7a2fc00dd9feeb28abaad948009e' }), h("p", { key: 'f21ea87102b5aea7122aa983bed22257b7f73721', class: "message-error" }, this.message)));
103
123
  }
104
124
  };
105
- CrmBonusForm.style = crmBonusFormCss;
125
+ CrmBonusForm.style = CrmBonusFormStyle0;
106
126
 
107
- export { CrmBonusForm as crm_bonus_form };
127
+ export { AppModal as app_modal, CrmBonusForm as crm_bonus_form };
108
128
 
109
- //# sourceMappingURL=crm-bonus-form.entry.js.map
129
+ //# sourceMappingURL=app-modal_2.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"app-modal.crm-bonus-form.entry.js","mappings":";;;AAAA,MAAM,WAAW,GAAG,+hBAA+hB,CAAC;AACpjB,uBAAe,WAAW;;MCMb,QAAQ;;;;sBAG0B,KAAK;;;IAQxC,UAAU;QACd,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;KAC3B;IAED,MAAM;QACF,QACI,4DAAK,KAAK,EAAE,kBAAkB,IAAI,CAAC,MAAM,GAAG,SAAS,GAAG,EAAE,EAAE,IACxD,4D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AAE,CAAC,cAAsB,KAAK,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,GAAI,EAChN,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,UAAU,IAAI,yEAAmB,EAC7D,0DAAG,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,OAAO,CAAK,CACxC,EACV;KACJ;;;;;;","names":[],"sources":["src/components/modal/app-modal.css?tag=app-modal&encapsulation=shadow","src/components/modal/app-modal.tsx","src/contants/index.ts","src/components/crm-bonus-form/crm-bonus-form.css?tag=crm-bonus-form&encapsulation=shadow","src/components/crm-bonus-form/crm-bonus-form.tsx"],"sourcesContent":[".modal-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: none;\n justify-content: center;\n align-items: center;\n z-index: 1000;\n }\n \n .modal-backdrop.visible {\n display: flex;\n }\n \n .modal {\n background: white;\n border-radius: 8px;\n padding: 1rem;\n max-width: 500px;\n width: 90%;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);\n }\n \n .modal-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid #ddd;\n margin-bottom: 1rem;\n }\n \n .close-button {\n background: none;\n border: none;\n font-size: 1.5rem;\n cursor: pointer;\n }\n \n .modal-body {\n /* padding: 1rem 0; */\n }\n ","import { Component, Event, EventEmitter, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'app-modal',\n styleUrl: 'app-modal.css',\n shadow: true,\n})\nexport class AppModal {\n\n // Controle da visibilidade do modal\n @Prop({ reflect: true }) isOpen: boolean = false;\n\n // Título do modal\n @Prop() modalTitle: string;\n\n // Evento emitido ao fechar o modal\n @Event() modalClosed: EventEmitter<void>;\n\n private closeModal() {\n this.modalClosed.emit();\n }\n\n render() {\n return (\n <div class={`modal-backdrop ${this.isOpen ? 'visible' : ''}`}>\n <div class=\"modal\">\n <div class=\"modal-header\">\n <h3>{this.modalTitle}</h3>\n <button class=\"close-button\" onClick={() => this.closeModal()}>\n ×\n </button>\n </div>\n <div class=\"modal-body\">\n <slot />\n </div>\n </div>\n </div>\n )\n }\n}","export enum StepFormEnum {\n STEP_PHONE = 1,\n STEP_PIN = 2,\n STEP_RESERVE = 3,\n STEP_APPLY = 4\n}",".form-container {\n width: 100%;\n display: flex;\n justify-content: center;\n justify-content: space-around;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n border-radius: 10px;\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n}\n\n.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.message-error {\n color: #d11111;\n font-weight: bold;\n font-family: Arial;\n font-size: small;\n margin-left: 16px;\n}","import { Component, Host, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { IPinSent } from \"../../components\";\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { StepFormEnum } from \"../../contants\";\n\n@Component({\n tag: 'crm-bonus-form',\n styleUrl: 'crm-bonus-form.css',\n shadow: true\n})\nexport class CrmBonusForm {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer = {\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n };\n @Prop() cancel: () => void;\n\n @State() loading: boolean = false;\n\n @State() step: number = StepFormEnum.STEP_PHONE;\n\n @State() sent: IPinSent;\n\n @State() message: string;\n\n @State() phone: number;\n\n @State() bonus: IBonus;\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 const sent = await this.crmBonusService.sendPin(this.phone, this.storeName);\n this.sent = sent;\n this.step = StepFormEnum.STEP_PIN;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n public async validateBonus(pin: string) {\n this.loading = true;\n this.message = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n loja_id: this.sent.storeId,\n user_id: this.sent.userId,\n cartId: this.cartId,\n products: this.products\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload, this.storeName);\n\n console.log('[this.bonus]', this.bonus);\n this.step = StepFormEnum.STEP_RESERVE;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false;\n }\n console.log('payload', payload)\n }\n\n public async reserve(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.crmBonusService.reserve({\n redeemed_bonus: amount,\n cart_id: this.cartId,\n ticket: this.cartId,\n gross_value: this.bonus.totalValue,\n }, this.storeName);\n\n this.step = StepFormEnum.STEP_APPLY;\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n } finally {\n this.loading = false;\n }\n }\n\n public handleCancel() {\n this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n render() {\n return (\n <Host>\n {this.step === StepFormEnum.STEP_PHONE && <phone-input value={this.customer.phone} sendPin={(phone) => this.sendPin(phone)} loading={this.loading} />}\n {this.step === StepFormEnum.STEP_PIN && <giftback-pin cancel={() => this.handleCancel()} sent={this.sent} validate={(data) => this.validateBonus(data)} loading={this.loading} />}\n\n {this.step === StepFormEnum.STEP_RESERVE && <giftback-progress loading={this.loading} cancel={() => this.handleCancel()} bonus={this.bonus} reserve={(amountRedeemed: number) => this.reserve(amountRedeemed)} />}\n {this.step === StepFormEnum.STEP_APPLY && <giftback-finish />}\n <p class=\"message-error\">{this.message}</p>\n </Host>\n )\n }\n}"],"version":3}
@@ -1,9 +1,10 @@
1
- import { r as registerInstance, h } from './index-f557ce7c.js';
2
- import { C as CrmBonusService } from './crmbonus.service-5208f883.js';
1
+ import { r as registerInstance, h } from './index-9f7bde48.js';
2
+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AzLjQgMzIuMjAwMiA2MTguMyAzNi42MDAyIDYxOS43IDU0LjEwMDJINjA2LjFDNjA1LjQgNDYuOTAwMiA1OTkgNDQuMDAwMiA1OTAuNSA0NC4wMDAyQzU4MiA0NC4wMDAyIDU3Ny4zIDQ3LjEwMDIgNTc3LjMgNTEuODAwMkM1NzcuMyA1NS4zMDAyIDU3OS45IDU4LjgwMDIgNTg3LjcgNjAuMDAwMkw2MDAuMiA2Mi4wMDAyQzYxMC4zIDYzLjgwMDIgNjIwLjIgNjguMjAwMiA2MjAuMiA4MS4yMDAyQzYyMC4yIDk1LjMwMDIgNjA3LjkgMTAyLjUgNTkxLjEgMTAyLjVDNTc1LjMgMTAyLjUgNTYxLjkgOTYuMzAwMiA1NjAuMiA3OC43MDAyTDU3My44IDc4LjgwMDJDNTc1LjMgODcuMDAwMiA1ODEuNCA5MC41MDAyIDU5MS41IDkwLjUwMDJaIiBmaWxsPSJjdXJyZW50Q29sb3IiPjwvcGF0aD4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhcl8xNjI5XzE4OCIgeDE9IjYzNi44MzMiIHkxPSI5Ny44MjYxIiB4Mj0iNzEzLjQ2IiB5Mj0iMjYuNjU4MiIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjRjdBODMwIj48L3N0b3A+CjxzdG9wIG9mZnNldD0iMC42MzUzIiBzdG9wLWNvbG9yPSIjRjA4MzM2Ij48L3N0b3A+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0VBNTM0NiI+PC9zdG9wPgo8L2xpbmVhckdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPg==';
5
5
 
6
6
  const crmBonusCss = ".container-button{max-width:136px;cursor:pointer;padding:10px}.section-crm{border:1px solid #dbd4d4;text-align:-webkit-center;margin-bottom:20px}";
7
+ const CrmBonusStyle0 = crmBonusCss;
7
8
 
8
9
  const CrmBonus = class {
9
10
  constructor(hostRef) {
@@ -39,11 +40,11 @@ const CrmBonus = class {
39
40
  this.showModal = false;
40
41
  }
41
42
  render() {
42
- return (h("div", { key: '1f107deaddaba99f0a4e52b5b7e79c388a2bbd0c', class: "section-crm" }, h("div", { key: '7b6ccebbcb2b43576d687c193f1d07dd8083c872', class: "container-button" }, h("img", { key: '56e75da59433e55cde4ed3aa5edd4cfec3aa672c', src: logoSvg, onClick: () => (this.showModal = true) })), h("app-modal", { key: '6efdcc98325023202c9402219138ea917b6db1af', isOpen: this.showModal, modalTitle: `Giftback`, onModalClosed: () => (this.showModal = false) }, h("crm-bonus-form", { key: 'bcfd9bd62c2e48d2785127a79710b57d79e1ba2c', cancel: () => this.handleCloseModal(), storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer }))));
43
+ 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 }))));
43
44
  }
44
45
  static get assetsDirs() { return ["assets"]; }
45
46
  };
46
- CrmBonus.style = crmBonusCss;
47
+ CrmBonus.style = CrmBonusStyle0;
47
48
 
48
49
  export { CrmBonus as crm_bonus };
49
50
 
@@ -0,0 +1 @@
1
+ {"file":"crm-bonus.entry.js","mappings":";;;AAAA,MAAM,OAAO,GAAG,w9JAAw9J;;ACAx+J,MAAM,WAAW,GAAG,mJAAmJ,CAAC;AACxK,uBAAe,WAAW;;MCUb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,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":["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}
@@ -0,0 +1,22 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-9f7bde48.js';
2
+ export { s as setNonce } from './index-9f7bde48.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.22.2 | MIT Licensed | https://stenciljs.com
7
+ */
8
+ var patchBrowser = () => {
9
+ const importMeta = import.meta.url;
10
+ const opts = {};
11
+ if (importMeta !== "") {
12
+ opts.resourcesUrl = new URL(".", importMeta).href;
13
+ }
14
+ return promiseResolve(opts);
15
+ };
16
+
17
+ patchBrowser().then(async (options) => {
18
+ await globalScripts();
19
+ return bootstrapLazy([["loading-spinner",[[1,"loading-spinner",{"size":[1],"color":[1]}]]],["giftback-finish_5",[[0,"phone-input",{"sendPin":[16],"loading":[4],"value":[1]}],[1,"giftback-pin",{"sent":[16],"validate":[16],"cancel":[16],"loading":[4],"pin":[32],"isVerified":[32]}],[1,"giftback-progress",{"loading":[4],"bonus":[16],"reserve":[16],"cancel":[16],"usedValue":[32]}],[1,"giftback-finish"],[1,"phone-input-mask",{"initialValue":[1,"initial-value"],"phone":[32],"getPhone":[64]}]]],["app-modal_2",[[1,"crm-bonus-form",{"storeName":[8,"storename"],"cartId":[8,"cart-id"],"products":[16],"customer":[16],"cancel":[16],"loading":[32],"step":[32],"sent":[32],"message":[32],"phone":[32],"bonus":[32]}],[1,"app-modal",{"isOpen":[516,"is-open"],"modalTitle":[1,"modal-title"]}]]],["crm-bonus",[[1,"crm-bonus",{"userId":[2,"userid"],"storeName":[8,"storename"],"productsInString":[1,"products"],"cartId":[8,"cartid"],"showModal":[32],"products":[32],"customer":[32]}]]],["pedido-finalizado",[[0,"pedido-finalizado",{"cartId":[1,"cartid"],"orderId":[2,"orderid"],"metadadoString":[1,"metadado"]}]]]], options);
20
+ });
21
+
22
+ //# sourceMappingURL=crmbonus-component-wake.js.map
@@ -0,0 +1 @@
1
+ {"file":"crmbonus-component-wake.js","mappings":";;;;AAAA;AACA;AACA;AAKA,IAAI,YAAY,GAAG,MAAM;AAUzB,EAAE,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AACrC,EAAE,MAAM,IAAI,GAAiE,EAAE,CAAC;AAChF,EAAE,IAAI,UAAU,KAAK,EAAE,EAAE;AACzB,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC;AACtD,GAAG;AACH,EAAE,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;;ACnBD,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,OAAO,KAAK;AACvC,EAAE,MAAM,aAAa,EAAE,CAAC;AACxB,EAAE,OAAO,aAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC","names":[],"sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.22.2 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"version":3}