crmbonus-component-wake 2.1.21-homolog-tray → 2.1.22-homolog-tray

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 (55) hide show
  1. package/dist/cjs/{cart.helper-0a401d80.js → cart.helper-d216033e.js} +2 -2
  2. package/dist/cjs/{cart.helper-0a401d80.js.map → cart.helper-d216033e.js.map} +1 -1
  3. package/dist/cjs/crm-bonus-form.cjs.entry.js +1 -1
  4. package/dist/cjs/crm-bonus-note.cjs.entry.js +2 -2
  5. package/dist/cjs/crm-bonus.cjs.entry.js +2 -2
  6. package/dist/cjs/crm-giftback-form_2.cjs.entry.js +2 -2
  7. package/dist/cjs/crm-tooltip_4.cjs.entry.js +2 -2
  8. package/dist/cjs/{crmbonus.service-7a4f6786.js → crmbonus.service-5537cef5.js} +2 -2
  9. package/dist/cjs/{crmbonus.service-7a4f6786.js.map → crmbonus.service-5537cef5.js.map} +1 -1
  10. package/dist/cjs/pedido-finalizado.cjs.entry.js +2 -2
  11. package/dist/components/crm-bonus-form.js +1 -1
  12. package/dist/components/crm-bonus-note.js +2 -2
  13. package/dist/components/crm-bonus.js +4 -4
  14. package/dist/components/crm-giftback-form.js +1 -1
  15. package/dist/components/giftback-info.js +1 -1
  16. package/dist/components/{p-d8bd654a.js → p-01d41bff.js} +3 -3
  17. package/dist/components/{p-d8bd654a.js.map → p-01d41bff.js.map} +1 -1
  18. package/dist/components/{p-a428d5df.js → p-3eba0eba.js} +2 -2
  19. package/dist/components/{p-a428d5df.js.map → p-3eba0eba.js.map} +1 -1
  20. package/dist/components/{p-9ca28ea7.js → p-b57fbd6d.js} +2 -2
  21. package/dist/components/{p-9ca28ea7.js.map → p-b57fbd6d.js.map} +1 -1
  22. package/dist/components/{p-ec317fb9.js → p-cde3c049.js} +4 -4
  23. package/dist/components/{p-ec317fb9.js.map → p-cde3c049.js.map} +1 -1
  24. package/dist/components/pedido-finalizado.js +2 -2
  25. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
  26. package/dist/crmbonus-component-wake/{p-35b95848.entry.js → p-09e26da2.entry.js} +2 -2
  27. package/dist/crmbonus-component-wake/{p-ed22d88f.entry.js → p-0ecdc07b.entry.js} +2 -2
  28. package/dist/crmbonus-component-wake/{p-81ec64ff.entry.js → p-100b6036.entry.js} +2 -2
  29. package/dist/crmbonus-component-wake/{p-b2941d60.entry.js → p-213bf3b6.entry.js} +2 -2
  30. package/dist/crmbonus-component-wake/{p-8e2d6659.entry.js → p-25e29b60.entry.js} +2 -2
  31. package/dist/crmbonus-component-wake/{p-a428d5df.js → p-3eba0eba.js} +2 -2
  32. package/dist/crmbonus-component-wake/{p-a428d5df.js.map → p-3eba0eba.js.map} +1 -1
  33. package/dist/crmbonus-component-wake/{p-9ca28ea7.js → p-b57fbd6d.js} +2 -2
  34. package/dist/crmbonus-component-wake/{p-0055876c.entry.js → p-d4821de7.entry.js} +2 -2
  35. package/dist/env.js +1 -1
  36. package/dist/env.js.map +1 -1
  37. package/dist/esm/{cart.helper-c6fd0b36.js → cart.helper-8be1bc35.js} +2 -2
  38. package/dist/esm/{cart.helper-c6fd0b36.js.map → cart.helper-8be1bc35.js.map} +1 -1
  39. package/dist/esm/crm-bonus-form.entry.js +1 -1
  40. package/dist/esm/crm-bonus-note.entry.js +2 -2
  41. package/dist/esm/crm-bonus.entry.js +2 -2
  42. package/dist/esm/crm-giftback-form_2.entry.js +2 -2
  43. package/dist/esm/crm-tooltip_4.entry.js +2 -2
  44. package/dist/esm/{crmbonus.service-0bd0a5ac.js → crmbonus.service-5bc16be9.js} +2 -2
  45. package/dist/esm/{crmbonus.service-0bd0a5ac.js.map → crmbonus.service-5bc16be9.js.map} +1 -1
  46. package/dist/esm/pedido-finalizado.entry.js +2 -2
  47. package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +1 -1
  48. package/package.json +1 -1
  49. /package/dist/crmbonus-component-wake/{p-35b95848.entry.js.map → p-09e26da2.entry.js.map} +0 -0
  50. /package/dist/crmbonus-component-wake/{p-ed22d88f.entry.js.map → p-0ecdc07b.entry.js.map} +0 -0
  51. /package/dist/crmbonus-component-wake/{p-81ec64ff.entry.js.map → p-100b6036.entry.js.map} +0 -0
  52. /package/dist/crmbonus-component-wake/{p-b2941d60.entry.js.map → p-213bf3b6.entry.js.map} +0 -0
  53. /package/dist/crmbonus-component-wake/{p-8e2d6659.entry.js.map → p-25e29b60.entry.js.map} +0 -0
  54. /package/dist/crmbonus-component-wake/{p-9ca28ea7.js.map → p-b57fbd6d.js.map} +0 -0
  55. /package/dist/crmbonus-component-wake/{p-0055876c.entry.js.map → p-d4821de7.entry.js.map} +0 -0
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-a7537457.js');
6
- const crmbonus_service = require('./crmbonus.service-7a4f6786.js');
7
- const cart_helper = require('./cart.helper-0a401d80.js');
6
+ const crmbonus_service = require('./crmbonus.service-5537cef5.js');
7
+ const cart_helper = require('./cart.helper-d216033e.js');
8
8
 
9
9
  const Pedido = class {
10
10
  constructor(hostRef) {
@@ -1,5 +1,5 @@
1
1
  import { p as proxyCustomElement, H, h, d as Host } from './p-9d950d25.js';
2
- import { C as CrmBonusService } from './p-a428d5df.js';
2
+ import { C as CrmBonusService } from './p-3eba0eba.js';
3
3
  import { S as StepFormEnum } from './p-ecc51430.js';
4
4
  import { d as defineCustomElement$6 } from './p-3cd7a20f.js';
5
5
  import { d as defineCustomElement$5 } from './p-dc1871cf.js';
@@ -1,8 +1,8 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-9d950d25.js';
2
2
  import { g as getInfoCustomization } from './p-1b441909.js';
3
- import { g as getKeyReserveByCartId } from './p-a428d5df.js';
3
+ import { g as getKeyReserveByCartId } from './p-3eba0eba.js';
4
4
  import { i as instance } from './p-c53241bf.js';
5
- import { C as CartWake, g as getCart, a as getInfoBonusByCartIdAndStoreName } from './p-9ca28ea7.js';
5
+ import { C as CartWake, g as getCart, a as getInfoBonusByCartIdAndStoreName } from './p-b57fbd6d.js';
6
6
  import { d as defaultStyles } from './p-ecc51430.js';
7
7
  import { d as defineCustomElement$2 } from './p-86b95c83.js';
8
8
 
@@ -1,13 +1,13 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-9d950d25.js';
2
- import { C as CrmBonusService, U as USED_KEY } from './p-a428d5df.js';
2
+ import { C as CrmBonusService, U as USED_KEY } from './p-3eba0eba.js';
3
3
  import { d as defaultStyles, S as StepFormEnum } from './p-ecc51430.js';
4
4
  import { i as instance } from './p-c53241bf.js';
5
- import { g as getCart, a as getInfoBonusByCartIdAndStoreName, C as CartWake } from './p-9ca28ea7.js';
5
+ import { g as getCart, a as getInfoBonusByCartIdAndStoreName, C as CartWake } from './p-b57fbd6d.js';
6
6
  import { d as defineCustomElement$b } from './p-86b95c83.js';
7
7
  import { d as defineCustomElement$a } from './p-39cc3ce4.js';
8
- import { d as defineCustomElement$9 } from './p-ec317fb9.js';
8
+ import { d as defineCustomElement$9 } from './p-cde3c049.js';
9
9
  import { d as defineCustomElement$8 } from './p-a70a82a3.js';
10
- import { d as defineCustomElement$7 } from './p-d8bd654a.js';
10
+ import { d as defineCustomElement$7 } from './p-01d41bff.js';
11
11
  import { d as defineCustomElement$6 } from './p-cd108989.js';
12
12
  import { d as defineCustomElement$5 } from './p-e25a1b64.js';
13
13
  import { d as defineCustomElement$4 } from './p-63ca9208.js';
@@ -1,4 +1,4 @@
1
- import { C as CrmBonus, d as defineCustomElement$1 } from './p-ec317fb9.js';
1
+ import { C as CrmBonus, d as defineCustomElement$1 } from './p-cde3c049.js';
2
2
 
3
3
  const CrmGiftbackForm = CrmBonus;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { G as GiftbackInfo$1, d as defineCustomElement$1 } from './p-d8bd654a.js';
1
+ import { G as GiftbackInfo$1, d as defineCustomElement$1 } from './p-01d41bff.js';
2
2
 
3
3
  const GiftbackInfo = GiftbackInfo$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,8 +1,8 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-9d950d25.js';
2
2
  import { i as instance } from './p-c53241bf.js';
3
- import { U as USED_KEY } from './p-a428d5df.js';
3
+ import { U as USED_KEY } from './p-3eba0eba.js';
4
4
  import { d as defineLimit, a as formatDateToBr } from './p-af3ba015.js';
5
- import { p as persisteMetadata } from './p-9ca28ea7.js';
5
+ import { p as persisteMetadata } from './p-b57fbd6d.js';
6
6
  import { d as defineCustomElement$2 } from './p-86b95c83.js';
7
7
  import { d as defineCustomElement$1 } from './p-a70a82a3.js';
8
8
 
@@ -164,4 +164,4 @@ defineCustomElement();
164
164
 
165
165
  export { GiftbackInfo as G, defineCustomElement as d };
166
166
 
167
- //# sourceMappingURL=p-d8bd654a.js.map
167
+ //# sourceMappingURL=p-01d41bff.js.map
@@ -1 +1 @@
1
- {"file":"p-d8bd654a.js","mappings":";;;;;;;;AAAA,MAAM,eAAe,GAAG,iyDAAiyD,CAAC;AAC1zD,2BAAe,eAAe;;MCajB,YAAY;;;;yBAIQ,CAAC;8BACI,MAAM;;uBAGb,KAAK;qBACC;YAC7B,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,CAAC;YAClB,iBAAiB,EAAE,EAAE;YACrB,UAAU,EAAE,CAAC;SAChB;;;;;;8BAOiC,CAAC;mCACI,CAAC;2BAEjB,KAAK;;IAG5B,YAAY;QACR,IAAI,CAAC,WAAW,EAAE,CAAA;KACrB;IAEO,WAAW;QACf,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;KACtD;IAED,iBAAiB;QACb,IAAI,CAAC,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M,EAAE,CAAA,EAAE,GAAI,gFAC3I,CACT,EAID,EAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS,0CAAE,gBAAgB,CAAA,KAC9B,4DAAK,KAAK,EAAC,UAAU,2DAEf,CACT,CAGH,EACR;KACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/subcomponents/giftback-info/giftback-info.css?tag=giftback-info","src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx"],"sourcesContent":[":host {\n --text-color: #6D6D5F\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\nh3 {\n /* font-size: 1.2rem; */\n margin-bottom: 8px;\n color: #333;\n}\n\n.container-description {\n display: flex;\n align-items: center;\n gap: 5px;\n margin: 0 0 10px 0;\n}\n\n.container-description p {\n /* font-size: 14px; */\n font-weight: 400;\n margin: 0px;\n}\n\n\np {\n /* font-size: 14px; */\n color: #000;\n}\n\n.value-display h2 {\n color: #6D6D5F;\n /* Verde para o valor atual */\n /* font-size: 1.6rem; */\n margin: 16px 0;\n}\n\ninput[type='range'] {\n width: 100%;\n margin: 12px 0;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 4px;\n outline: none;\n padding: 3px 0px 3px 3px;\n}\n\n/* input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n border-radius: 50%;\n cursor: pointer;\n} */\n\ninput[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: rgb(109, 109, 95);\n /* Cor do botão */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.options {\n margin: 0px 0;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.options label {\n display: flex;\n margin: 0px 0;\n /* font-size: 0.9rem; */\n color: #333;\n align-items: center;\n}\n\n.options input[type='radio'] {\n margin-right: 8px;\n height: 16px;\n width: 16px;\n}\n\n.options input[type='radio'] {\n appearance: none;\n -webkit-appearance: none;\n margin-right: 8px;\n width: 16px;\n height: 16px;\n border: 2px solid #ddd;\n border-radius: 50%;\n background-color: #fff;\n cursor: pointer;\n transition: all 0.3s;\n padding: 0px;\n}\n\n.options input[type='radio']:checked {\n border-color: #000;\n background-color: #FAFAFA;\n border: 4px solid #000;\n}\n\n.info-box {\n background-color: #f9f9f9;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 8px;\n /* font-size: 14px; */\n color: #262626;\n line-height: 20px;\n}\n\n.info-icon {\n /* font-size: 0.9rem; */\n cursor: pointer;\n color: #888;\n}\n\nh3 {\n /* font-size: 1.2rem; */\n margin-bottom: 8px;\n color: #333;\n}\n\n.slider-wrapper {\n position: relative;\n margin: 21px 0px 0px 0px;\n}\n\n.slider {\n width: 100%;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 2px;\n outline: none;\n}\n\n.slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n /* Azul para o slider */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.slider-value {\n position: absolute;\n top: -30px;\n /* Posição acima do slider */\n /* font-size: 16px; */\n font-weight: 700;\n color: var(--text-color);\n /* Verde para o texto */\n transform: translateX(-50%);\n white-space: nowrap;\n /* margin-left: 23px; */\n}\n\n.options-option {\n display: flex;\n}\n\n\n/* ########################################## */\n","import { Component, Prop, State, Watch, h } from \"@stencil/core\";\nimport { IBonus } from \"../../../../dto/validate.pin.bonus\";\n\nimport i18next from '../../../../i18n/i18n'\nimport { USED_KEY } from \"../../../../utils/keys.storage\";\nimport { defineLimit, formatDateToBr } from \"../../../../utils/utils\";\nimport { IInfoStore } from \"../../../../helpers/info.config.helper\";\nimport { ReservedInfoDTO } from \"../../../../dto/reserved-info.dto\";\nimport { persisteMetadata } from \"../../../../helpers/cart.helper\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n\n private _refIinputRange: HTMLInputElement;\n\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\n @Prop() cartId;\n @Prop() loading: boolean = false;\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\",\n totalValue: 0\n };\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n @Prop() config: IInfoStore;\n @Prop() infoBonus: ReservedInfoDTO;\n @Prop() storeName: string\n\n @State() sliderPosition: number = 0;\n @State() sliderValuePosition: number = 0;\n\n @State() loadingTime = false;\n\n @Watch(\"bonus\")\n changedBonus() {\n this.updateBonus()\n }\n\n private updateBonus() {\n this.usedValue = this.bonus.bonusBalance;\n this.buildPositionSlider(0, this.bonus.totalBonus);\n }\n\n componentWillLoad() {\n this.updateBonus();\n this.selectedOption = localStorage.getItem(USED_KEY);\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n\n // Calculando a posição do texto com base no valor do slider\n // const percentage = ((this.usedValue - parseInt(input.min)) / (parseInt(input.max) - parseInt(input.min))) * 100;\n // this.sliderPosition = percentage;\n\n this.buildPositionSlider(parseFloat(input.min), parseFloat(input.max))\n }\n\n componentDidLoad() {\n if (this.bonus) {\n this._refIinputRange.value = this.bonus?.bonusBalance.toString();\n }\n }\n\n private buildPositionSlider(min: number, max: number) {\n\n const percentage_init = max * 0.1;\n\n // Calculando a posição do texto com base no valor do slider\n const percentage = ((this.usedValue - min) / (max - min)) * 100;\n\n this.sliderPosition = percentage;\n this.sliderValuePosition = percentage + (this.usedValue <= percentage_init ? 10 : 0);\n }\n\n async handleOptionChange(option: string) {\n this.selectedOption = option;\n\n localStorage.setItem(USED_KEY, option);\n\n await persisteMetadata(this.storeName, this.cartId, { ...this.infoBonus.metadata, createdAt: null })\n\n switch (this.selectedOption) {\n case 'use':\n await this.reserve(this.usedValue);\n break;\n case 'dontUse':\n await this.cancel();\n break;\n default:\n }\n }\n\n showTime() {\n if (!this.infoBonus) return false;\n\n return !this.infoBonus.isExpired();\n\n // return this.infoBonus.isBonusProcessed\n }\n\n getTime() {\n\n const createdAt = new Date(this.infoBonus?.metadata?.createdAt);\n const expiration = new Date(createdAt);\n expiration.setMinutes(expiration.getMinutes() + 6);\n\n return {\n createdAt,\n expiration\n }\n }\n\n async downtime() {\n await persisteMetadata(this.storeName, this.bonus.cartId, {\n createdAt: null,\n })\n }\n\n render() {\n console.log('this.bonus', this.bonus)\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n const translateDescription = i18next.t(\"giftDescription\", { amount: `${this.bonus?.totalBonus?.toFixed(2).replace(\".\", \",\")}`, custom_name: \"Giftback\" })\n\n const limit = defineLimit(remainingGiftback);\n\n return (\n\n <div class=\"giftback-container\">\n <div class=\"container-description\">\n <p innerHTML={translateDescription}></p>\n <crm-tooltip identity=\"crm-role-description\" text={i18next.t(\"labelUseGiftback\", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) })} />\n </div>\n <div class=\"slider-wrapper\">\n <div\n class=\"slider-value\"\n style={{\n left: `calc(${this.sliderValuePosition}% - 20px)`, // Ajuste para centralizar o texto\n\n }}\n >\n R$ {this.usedValue.toFixed(2).replace(\".\", \",\")}\n </div>\n <input\n ref={ref => this._refIinputRange = ref}\n id=\"position_value_id\"\n disabled\n type=\"range\"\n min=\"0\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n class=\"slider\"\n step=\"0.01\"\n onInput={(event) => this.handleSliderChange(event)}\n style={{\n background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,\n }}\n />\n </div>\n\n {\n limit.isComplete && (\n <p>\n {i18next.t(\"maxAmount\")}\n </p>\n )\n }\n\n {\n !limit.isComplete && (\n <div class=\"container-description\">\n <p>\n Adicione <strong>R$ {remainingGiftback < 0 ? \"0,00\" : remainingGiftback.toFixed(2).replace(\".\", \",\")}</strong> ao carrinho para atingir o valor\n máximo!\n </p>\n <crm-tooltip identity=\"crm-max-description\" text={i18next.t(\"labelamountPartial\")} />\n </div>\n )\n }\n\n\n <div class=\"options\">\n <div class=\"options-option\">\n <input\n disabled={this.showTime()}\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"use\"\n checked={this.selectedOption === 'use'}\n onChange={() => this.handleOptionChange('use')}\n />\n <p>Usar o meu {this.config?.giftbackTitle}</p>\n </div>\n <div class=\"options-option\">\n <input\n disabled={this.showTime()}\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"dontUse\"\n checked={this.selectedOption === 'dontUse'}\n onChange={() => this.handleOptionChange('dontUse')}\n />\n <p>Não usar o meu {this.config?.giftbackTitle}</p>\n </div>\n </div>\n\n {\n this.showTime() &&\n (\n <div class=\"info-box\">\n Após <countdown-timer dataCriacao={new Date(this.infoBonus?.metadata?.createdAt).toString()} downtime={() => { window.location.reload() }} />, você poderá alterar sua escolha de usar ou não o Giftback.\n </div>\n )\n }\n\n {\n !this?.infoBonus?.isBonusProcessed && (\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n )\n }\n\n </div>\n );\n }\n}"],"version":3}
1
+ {"file":"p-01d41bff.js","mappings":";;;;;;;;AAAA,MAAM,eAAe,GAAG,iyDAAiyD,CAAC;AAC1zD,2BAAe,eAAe;;MCajB,YAAY;;;;yBAIQ,CAAC;8BACI,MAAM;;uBAGb,KAAK;qBACC;YAC7B,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,CAAC;YAClB,iBAAiB,EAAE,EAAE;YACrB,UAAU,EAAE,CAAC;SAChB;;;;;;8BAOiC,CAAC;mCACI,CAA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,aAAa,CAAK,CAChD,CACJ,EAGF,IAAI,CAAC,QAAQ,EAAE;aAEX,4DAAK,KAAK,EAAC,UAAU,kBACZ,wEAAiB,WAAW,EAAE,IAAI,IAAI,CAAC,MAAA,MAAA,IAAI,CAAC,SAAS,0CAAE,QAAQ,0CAAE,SAAS,CAAC,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAA,EAAE,GAAI,gFAC3I,CACT,EAID,EAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS,0CAAE,gBAAgB,CAAA,KAC9B,4DAAK,KAAK,EAAC,UAAU,2DAEf,CACT,CAGH,EACR;KACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/subcomponents/giftback-info/giftback-info.css?tag=giftback-info","src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx"],"sourcesContent":[":host {\n --text-color: #6D6D5F\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\nh3 {\n /* font-size: 1.2rem; */\n margin-bottom: 8px;\n color: #333;\n}\n\n.container-description {\n display: flex;\n align-items: center;\n gap: 5px;\n margin: 0 0 10px 0;\n}\n\n.container-description p {\n /* font-size: 14px; */\n font-weight: 400;\n margin: 0px;\n}\n\n\np {\n /* font-size: 14px; */\n color: #000;\n}\n\n.value-display h2 {\n color: #6D6D5F;\n /* Verde para o valor atual */\n /* font-size: 1.6rem; */\n margin: 16px 0;\n}\n\ninput[type='range'] {\n width: 100%;\n margin: 12px 0;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 4px;\n outline: none;\n padding: 3px 0px 3px 3px;\n}\n\n/* input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n border-radius: 50%;\n cursor: pointer;\n} */\n\ninput[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: rgb(109, 109, 95);\n /* Cor do botão */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.options {\n margin: 0px 0;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.options label {\n display: flex;\n margin: 0px 0;\n /* font-size: 0.9rem; */\n color: #333;\n align-items: center;\n}\n\n.options input[type='radio'] {\n margin-right: 8px;\n height: 16px;\n width: 16px;\n}\n\n.options input[type='radio'] {\n appearance: none;\n -webkit-appearance: none;\n margin-right: 8px;\n width: 16px;\n height: 16px;\n border: 2px solid #ddd;\n border-radius: 50%;\n background-color: #fff;\n cursor: pointer;\n transition: all 0.3s;\n padding: 0px;\n}\n\n.options input[type='radio']:checked {\n border-color: #000;\n background-color: #FAFAFA;\n border: 4px solid #000;\n}\n\n.info-box {\n background-color: #f9f9f9;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 8px;\n /* font-size: 14px; */\n color: #262626;\n line-height: 20px;\n}\n\n.info-icon {\n /* font-size: 0.9rem; */\n cursor: pointer;\n color: #888;\n}\n\nh3 {\n /* font-size: 1.2rem; */\n margin-bottom: 8px;\n color: #333;\n}\n\n.slider-wrapper {\n position: relative;\n margin: 21px 0px 0px 0px;\n}\n\n.slider {\n width: 100%;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 2px;\n outline: none;\n}\n\n.slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n /* Azul para o slider */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.slider-value {\n position: absolute;\n top: -30px;\n /* Posição acima do slider */\n /* font-size: 16px; */\n font-weight: 700;\n color: var(--text-color);\n /* Verde para o texto */\n transform: translateX(-50%);\n white-space: nowrap;\n /* margin-left: 23px; */\n}\n\n.options-option {\n display: flex;\n}\n\n\n/* ########################################## */\n","import { Component, Prop, State, Watch, h } from \"@stencil/core\";\nimport { IBonus } from \"../../../../dto/validate.pin.bonus\";\n\nimport i18next from '../../../../i18n/i18n'\nimport { USED_KEY } from \"../../../../utils/keys.storage\";\nimport { defineLimit, formatDateToBr } from \"../../../../utils/utils\";\nimport { IInfoStore } from \"../../../../helpers/info.config.helper\";\nimport { ReservedInfoDTO } from \"../../../../dto/reserved-info.dto\";\nimport { persisteMetadata } from \"../../../../helpers/cart.helper\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n\n private _refIinputRange: HTMLInputElement;\n\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\n @Prop() cartId;\n @Prop() loading: boolean = false;\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\",\n totalValue: 0\n };\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n @Prop() config: IInfoStore;\n @Prop() infoBonus: ReservedInfoDTO;\n @Prop() storeName: string\n\n @State() sliderPosition: number = 0;\n @State() sliderValuePosition: number = 0;\n\n @State() loadingTime = false;\n\n @Watch(\"bonus\")\n changedBonus() {\n this.updateBonus()\n }\n\n private updateBonus() {\n this.usedValue = this.bonus.bonusBalance;\n this.buildPositionSlider(0, this.bonus.totalBonus);\n }\n\n componentWillLoad() {\n this.updateBonus();\n this.selectedOption = localStorage.getItem(USED_KEY);\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n\n // Calculando a posição do texto com base no valor do slider\n // const percentage = ((this.usedValue - parseInt(input.min)) / (parseInt(input.max) - parseInt(input.min))) * 100;\n // this.sliderPosition = percentage;\n\n this.buildPositionSlider(parseFloat(input.min), parseFloat(input.max))\n }\n\n componentDidLoad() {\n if (this.bonus) {\n this._refIinputRange.value = this.bonus?.bonusBalance.toString();\n }\n }\n\n private buildPositionSlider(min: number, max: number) {\n\n const percentage_init = max * 0.1;\n\n // Calculando a posição do texto com base no valor do slider\n const percentage = ((this.usedValue - min) / (max - min)) * 100;\n\n this.sliderPosition = percentage;\n this.sliderValuePosition = percentage + (this.usedValue <= percentage_init ? 10 : 0);\n }\n\n async handleOptionChange(option: string) {\n this.selectedOption = option;\n\n localStorage.setItem(USED_KEY, option);\n\n await persisteMetadata(this.storeName, this.cartId, { ...this.infoBonus.metadata, createdAt: null })\n\n switch (this.selectedOption) {\n case 'use':\n await this.reserve(this.usedValue);\n break;\n case 'dontUse':\n await this.cancel();\n break;\n default:\n }\n }\n\n showTime() {\n if (!this.infoBonus) return false;\n\n return !this.infoBonus.isExpired();\n\n // return this.infoBonus.isBonusProcessed\n }\n\n getTime() {\n\n const createdAt = new Date(this.infoBonus?.metadata?.createdAt);\n const expiration = new Date(createdAt);\n expiration.setMinutes(expiration.getMinutes() + 6);\n\n return {\n createdAt,\n expiration\n }\n }\n\n async downtime() {\n await persisteMetadata(this.storeName, this.bonus.cartId, {\n createdAt: null,\n })\n }\n\n render() {\n console.log('this.bonus', this.bonus)\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n const translateDescription = i18next.t(\"giftDescription\", { amount: `${this.bonus?.totalBonus?.toFixed(2).replace(\".\", \",\")}`, custom_name: \"Giftback\" })\n\n const limit = defineLimit(remainingGiftback);\n\n return (\n\n <div class=\"giftback-container\">\n <div class=\"container-description\">\n <p innerHTML={translateDescription}></p>\n <crm-tooltip identity=\"crm-role-description\" text={i18next.t(\"labelUseGiftback\", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) })} />\n </div>\n <div class=\"slider-wrapper\">\n <div\n class=\"slider-value\"\n style={{\n left: `calc(${this.sliderValuePosition}% - 20px)`, // Ajuste para centralizar o texto\n\n }}\n >\n R$ {this.usedValue.toFixed(2).replace(\".\", \",\")}\n </div>\n <input\n ref={ref => this._refIinputRange = ref}\n id=\"position_value_id\"\n disabled\n type=\"range\"\n min=\"0\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n class=\"slider\"\n step=\"0.01\"\n onInput={(event) => this.handleSliderChange(event)}\n style={{\n background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,\n }}\n />\n </div>\n\n {\n limit.isComplete && (\n <p>\n {i18next.t(\"maxAmount\")}\n </p>\n )\n }\n\n {\n !limit.isComplete && (\n <div class=\"container-description\">\n <p>\n Adicione <strong>R$ {remainingGiftback < 0 ? \"0,00\" : remainingGiftback.toFixed(2).replace(\".\", \",\")}</strong> ao carrinho para atingir o valor\n máximo!\n </p>\n <crm-tooltip identity=\"crm-max-description\" text={i18next.t(\"labelamountPartial\")} />\n </div>\n )\n }\n\n\n <div class=\"options\">\n <div class=\"options-option\">\n <input\n disabled={this.showTime()}\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"use\"\n checked={this.selectedOption === 'use'}\n onChange={() => this.handleOptionChange('use')}\n />\n <p>Usar o meu {this.config?.giftbackTitle}</p>\n </div>\n <div class=\"options-option\">\n <input\n disabled={this.showTime()}\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"dontUse\"\n checked={this.selectedOption === 'dontUse'}\n onChange={() => this.handleOptionChange('dontUse')}\n />\n <p>Não usar o meu {this.config?.giftbackTitle}</p>\n </div>\n </div>\n\n {\n this.showTime() &&\n (\n <div class=\"info-box\">\n Após <countdown-timer dataCriacao={new Date(this.infoBonus?.metadata?.createdAt).toString()} downtime={() => { window.location.reload() }} />, você poderá alterar sua escolha de usar ou não o Giftback.\n </div>\n )\n }\n\n {\n !this?.infoBonus?.isBonusProcessed && (\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n )\n }\n\n </div>\n );\n }\n}"],"version":3}
@@ -3749,7 +3749,7 @@ axios.default = axios;
3749
3749
  // this module should only have a default export
3750
3750
  const axios$1 = axios;
3751
3751
 
3752
- const CRM_BONUS_API_URL = "https://wake.crmbonus.com/api"; //"http://localhost:4000/api";// "https://wake-middleware.crmbonus.com/api"; //"https://wake-middleware.crmbonus.com/api";// "https://crmbonus-wake-hub-staging-5daedbc4e22b.herokuapp.com/api" //"https://crmbonus-service-staging-d15ba5377115.herokuapp.com"; //"https://typically-workable-perch.ngrok-free.app"; // "http://localhost:3500";
3752
+ const CRM_BONUS_API_URL = "https://wake-middleware.crmbonus.com/api"; //"http://localhost:4000/api";// "https://wake-middleware.crmbonus.com/api"; //"https://wake-middleware.crmbonus.com/api";// "https://crmbonus-wake-hub-staging-5daedbc4e22b.herokuapp.com/api" //"https://crmbonus-service-staging-d15ba5377115.herokuapp.com"; //"https://typically-workable-perch.ngrok-free.app"; // "http://localhost:3500";
3753
3753
  const CHECKOUT_CART_WAKE = "http://localhost:3001";
3754
3754
 
3755
3755
  const getKeyReserveByCartId = (cartId) => {
@@ -3898,4 +3898,4 @@ CrmBonusService._instance = null;
3898
3898
 
3899
3899
  export { CrmBonusService as C, USED_KEY as U, CHECKOUT_CART_WAKE as a, getKeyReserveByCartId as g };
3900
3900
 
3901
- //# sourceMappingURL=p-a428d5df.js.map
3901
+ //# sourceMappingURL=p-3eba0eba.js.map