crmbonus-component-wake 2.0.109 → 2.0.111

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 (31) hide show
  1. package/dist/cjs/crm-bonus-note.cjs.entry.js +7 -4
  2. package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -1
  3. package/dist/cjs/crm-tooltip_4.cjs.entry.js +8 -5
  4. package/dist/cjs/crm-tooltip_4.cjs.entry.js.map +1 -1
  5. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +8 -5
  6. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +1 -1
  7. package/dist/collection/components/note/crm-bonus-note.js +7 -4
  8. package/dist/collection/components/note/crm-bonus-note.js.map +1 -1
  9. package/dist/components/crm-bonus-note.js +7 -4
  10. package/dist/components/crm-bonus-note.js.map +1 -1
  11. package/dist/components/crm-bonus.js +2 -2
  12. package/dist/components/crm-giftback-form.js +1 -1
  13. package/dist/components/giftback-info.js +1 -1
  14. package/dist/components/{p-e719bd13.js → p-069cacf6.js} +2 -2
  15. package/dist/components/{p-e719bd13.js.map → p-069cacf6.js.map} +1 -1
  16. package/dist/components/{p-ced902e8.js → p-a94f3e34.js} +9 -6
  17. package/dist/components/p-a94f3e34.js.map +1 -0
  18. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
  19. package/dist/crmbonus-component-wake/{p-7288423c.entry.js → p-35ea89d8.entry.js} +2 -2
  20. package/dist/crmbonus-component-wake/p-35ea89d8.entry.js.map +1 -0
  21. package/dist/crmbonus-component-wake/p-48a8f372.entry.js +2 -0
  22. package/dist/crmbonus-component-wake/p-48a8f372.entry.js.map +1 -0
  23. package/dist/esm/crm-bonus-note.entry.js +7 -4
  24. package/dist/esm/crm-bonus-note.entry.js.map +1 -1
  25. package/dist/esm/crm-tooltip_4.entry.js +8 -5
  26. package/dist/esm/crm-tooltip_4.entry.js.map +1 -1
  27. package/package.json +1 -1
  28. package/dist/components/p-ced902e8.js.map +0 -1
  29. package/dist/crmbonus-component-wake/p-27e571b4.entry.js +0 -2
  30. package/dist/crmbonus-component-wake/p-27e571b4.entry.js.map +0 -1
  31. package/dist/crmbonus-component-wake/p-7288423c.entry.js.map +0 -1
@@ -59,6 +59,9 @@ const CrmBonusNote = class {
59
59
  }
60
60
  startTime() {
61
61
  if (document.location.pathname == '/Fechamento') {
62
+ if (!localStorage.getItem("bc:time-allow")) {
63
+ localStorage.removeItem("bc:time");
64
+ }
62
65
  setTime();
63
66
  }
64
67
  }
@@ -78,10 +81,10 @@ const CrmBonusNote = class {
78
81
  render() {
79
82
  const giftbackname = this.config.giftbackTitle || "Giftback";
80
83
  const infobonus = this.hasBonus();
81
- return (index.h("div", { key: '40b65f783b97ee8fee241680a1b426d0a6e5a957' }, index.h("div", { key: 'ecaec8bc0bc2291404ce6ff65bd37672efcaec49', class: "note-container" }, index.h("div", { key: '43e8a2ca78d40e1eab90bad4351d1bb5372fa3e3', class: "note-header" }, index.h("p", { key: 'eb45285cac01dc3c21fedf7189fef891207df961', class: "note-title" }, index.h("img", { key: '87738582b6a37902f70e404bbea62d2967a66193', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (index.h("div", { key: '356cbf79c082125a3d45fcd8627c83d7a5c2bfd8' }, this.showEdit && (index.h("p", { key: '94da6960e7a0a802a1b1c116d5311cc88c1e98cc', class: "back-cart", onClick: () => this.backCart() }, i18n.instance.t("edit"))), !this.showEdit && index.h("countdown-timer", { key: 'ac292ddea8a0e85ed68dbd70deb87377681cd4f1', initialValue: 60, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
82
- (index.h("p", { key: '59084c383238967ea9cfa43145e7eb2a7e65b2a8', class: "note-description-2" }, i18n.instance.t("withApplyBonus", { giftbackname: giftbackname }), " ", index.h("strong", { key: '9504113697df7d40e37fed476eebd979798a3b72' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
83
- (index.h("p", { key: '5952e57df4810c2973749a42aeb43cad6ba893bc', class: "note-description-not" }, i18n.instance.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
84
- (index.h("div", { key: 'c4f612793f55887c0a8434bc0be40884d21f0035', class: "description" }, index.h("p", { key: '544562fe092c0044c165d6339543b7cd79e9c9e4', class: "note-description-not" }, i18n.instance.t("backCart")), index.h("crm-button", { key: '266b151adf1296bea58485ffcd929b2e4496f9bf', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
84
+ return (index.h("div", { key: '2ce9d0ebd4c796ea7812cbd934d8dc2abc7c65d0' }, index.h("div", { key: '4bc8a698cd77677291e58bae000d294f00d9350c', class: "note-container" }, index.h("div", { key: '64edc1f1141614dd6e378c81d0110e1713caed88', class: "note-header" }, index.h("p", { key: '37e52138331897e0e4c43c1b39d2bc56dcb4dae9', class: "note-title" }, index.h("img", { key: '3716f55a0571e5c2c12274935dde99dceb8f10dd', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (index.h("div", { key: '66f9cfec76b7fb878eab7deea954441c1b61ba4e' }, this.showEdit && (index.h("p", { key: '2dc0b7d75c7cea3923be333fccf2ea15153aed72', class: "back-cart", onClick: () => this.backCart() }, i18n.instance.t("edit"))), !this.showEdit && index.h("countdown-timer", { key: 'ab228f6aa8a691227a8380ff1ff1f677998e6aa8', initialValue: 60, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
85
+ (index.h("p", { key: 'aa70095a7472df8d332d50299977f7b9b645eaa4', class: "note-description-2" }, i18n.instance.t("withApplyBonus", { giftbackname: giftbackname }), " ", index.h("strong", { key: 'a6203afca4c2f02b441eb618fd84c3f9f7254127' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
86
+ (index.h("p", { key: 'a75fc7247d5e443600015e340e8d47f3dfa0baf7', class: "note-description-not" }, i18n.instance.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
87
+ (index.h("div", { key: '49d5eea185140c5a06c1f745bf7011b01dd683bb', class: "description" }, index.h("p", { key: '1b2c5ac3753c6fc4162311001be0253007d30a26', class: "note-description-not" }, i18n.instance.t("backCart")), index.h("crm-button", { key: '1fc75a0d0defb7369c6a06814f25627a04753164', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
85
88
  }
86
89
  };
87
90
  CrmBonusNote.style = CrmBonusNoteStyle0;
@@ -1 +1 @@
1
- {"file":"crm-bonus-note.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,4gCAA4gC;;SCA9hC,OAAO;IAEnB,IAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACtC,OAAM;KACT;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAE7C,IAAG,CAAC,IAAI,EAAE;QACN,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QACvC,YAAY,CAAC,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAM;KACT;AACL;;ACbA,MAAM,eAAe,GAAG,i3CAAi3C,CAAC;AAC14C,2BAAe,eAAe;;MCYjB,YAAY;;;;;;;;wBAUQ,KAAK;;IAElC,iBAAiB;QACb,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACpC,IAAI,CAAC,SAAS,EAAE,CAAC;KACpB;IAED,4BAA4B;QAExB,IAAI,CAAC,MAAM,GAAGA,uCAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,QAAQ,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QACzD,MAAM,CAAC,OAAO,CAAC,CAAC,KAAU;YACtB,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;SACzB,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,GAAG,MA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next"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","src/components/note/crm-bonus-note.css?tag=crm-bonus-note","src/components/note/crm-bonus-note.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\n<path d=\"M15 9.94728C14.5 9.3 13.8 8.5 12 8.5C10.2 8.5 9 9.51393 9 9.94728C9 10.3806 9.06786 10.9277 10 11.5C10.7522 11.9618 12.6684 12.0439 13.5 12.5C14.679 13.1467 14.8497 13.8202 14.8497 14.0522C14.8497 14.6837 13.4175 15.4852 12 15.5C10.536 15.5153 9.5 14.7 9 14.0522\" stroke=\"#000000\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\n}\n\n.note-container hr {\n border: 1px solid #CCC;\n}\n\n.note-container .back-cart {\n display: flex;\n text-align: center;\n}\n\n.note-header {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n}\n\n.note-title {\n font-weight: 700;\n text-align: left;\n display: flex;\n gap: 6px;\n align-items: center;\n margin-top: 11px;\n color: #000;\n}\n\n.note-description {\n font-family: Arial;\n color: #6d6d5f;\n padding: 0;\n margin: 0 auto;\n}\n\n.back-cart {\n font-size: .9em;\n color: #27272A;\n text-decoration: none;\n cursor: pointer;\n margin-top: 11px;\n}\n\n.note-description-2 {\n color: var(--crm-scheme-fg-main-inverse, #262626);\n font-family: Roboto;\n font-size: var(--crm-font-size-body-lg, 16px);\n font-style: normal;\n font-weight: var(--crm-font-weight-body-bold, 400);\n line-height: var(--crm-line-height-body-md, 20px);\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\n margin-top: 11px;\n color: #000;\n}\n\n.note-description-not {\n font-size: 16px;\n}","import { Component, Prop, State, h } from \"@stencil/core\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport money from '../../assets/svg/money-dollars-svgrepo-com.svg'\nimport { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @Prop({ attribute: 'cartid' }) cartId;\n @Prop({ attribute: \"storename\" }) storename;\n\n @State() url: string;\n @State() config: IInfoStore;\n\n @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\n }\n\n upadateCheckToFreteAndGetUrl() {\n\n this.config = getInfoCustomization(this.storename);\n const envios = document.getElementsByName('forma-envio');\n envios.forEach((envio: any) => {\n envio.checked = false;\n });\n\n this.url = window.location.origin;\n }\n\n handleHide() {\n const amount = localStorage.getItem(this.cartId);\n return !!amount;\n }\n\n getAmount() {\n const amount = localStorage.getItem(this.cartId);\n\n return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\n\n return (\n <div>\n <div class=\"note-container\">\n <div class=\"note-header\">\n\n <p class=\"note-title\">\n <img src={money} width={23} />\n {this.config.giftbackTitle}\n </p>\n {\n infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={60} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"],"version":3}
1
+ {"file":"crm-bonus-note.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,4gCAA4gC;;SCA9hC,OAAO;IAEnB,IAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACtC,OAAM;KACT;IAED,M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,QAAQ,IAAIF,8EAAiB,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA,EAAE,GAAI,CAChG,CACT,CAEH,EAGF,SAAS,CAAC,QAAQ;aAEdA,gEAAG,KAAK,EAAC,oBAAoB,IACxBE,aAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,OAAEF,8EAAY,IAAI,CAAC,SAAS,EAAE,MAAW,CACrG,CACP,EAID,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,QAAQ;aAE1CA,gEAAG,KAAK,EAAC,sBAAsB,IAC1BE,aAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CACrD,CACP,EAID,CAAC,SAAS,CAAC,YAAY;aAEnBF,kEAAK,KAAK,EAAC,aAAa,IACpBA,gEAAG,KAAK,EAAC,sBAAsB,IAC1BE,aAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CACtB,EACJF,yEAAY,MAAM,EAAC,oBAAoB,EAAC,WAAW,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,EACT;KACJ;;;;;;","names":["getInfoCustomization","getKeyReserveByCartId","h","money","i18next"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","src/components/note/crm-bonus-note.css?tag=crm-bonus-note","src/components/note/crm-bonus-note.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\n<path d=\"M15 9.94728C14.5 9.3 13.8 8.5 12 8.5C10.2 8.5 9 9.51393 9 9.94728C9 10.3806 9.06786 10.9277 10 11.5C10.7522 11.9618 12.6684 12.0439 13.5 12.5C14.679 13.1467 14.8497 13.8202 14.8497 14.0522C14.8497 14.6837 13.4175 15.4852 12 15.5C10.536 15.5153 9.5 14.7 9 14.0522\" stroke=\"#000000\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\n}\n\n.note-container hr {\n border: 1px solid #CCC;\n}\n\n.note-container .back-cart {\n display: flex;\n text-align: center;\n}\n\n.note-header {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n}\n\n.note-title {\n font-weight: 700;\n text-align: left;\n display: flex;\n gap: 6px;\n align-items: center;\n margin-top: 11px;\n color: #000;\n}\n\n.note-description {\n font-family: Arial;\n color: #6d6d5f;\n padding: 0;\n margin: 0 auto;\n}\n\n.back-cart {\n font-size: .9em;\n color: #27272A;\n text-decoration: none;\n cursor: pointer;\n margin-top: 11px;\n}\n\n.note-description-2 {\n color: var(--crm-scheme-fg-main-inverse, #262626);\n font-family: Roboto;\n font-size: var(--crm-font-size-body-lg, 16px);\n font-style: normal;\n font-weight: var(--crm-font-weight-body-bold, 400);\n line-height: var(--crm-line-height-body-md, 20px);\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\n margin-top: 11px;\n color: #000;\n}\n\n.note-description-not {\n font-size: 16px;\n}","import { Component, Prop, State, h } from \"@stencil/core\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport money from '../../assets/svg/money-dollars-svgrepo-com.svg'\nimport { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @Prop({ attribute: 'cartid' }) cartId;\n @Prop({ attribute: \"storename\" }) storename;\n\n @State() url: string;\n @State() config: IInfoStore;\n\n @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\n }\n\n upadateCheckToFreteAndGetUrl() {\n\n this.config = getInfoCustomization(this.storename);\n const envios = document.getElementsByName('forma-envio');\n envios.forEach((envio: any) => {\n envio.checked = false;\n });\n\n this.url = window.location.origin;\n }\n\n handleHide() {\n const amount = localStorage.getItem(this.cartId);\n return !!amount;\n }\n\n getAmount() {\n const amount = localStorage.getItem(this.cartId);\n\n return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\n\n return (\n <div>\n <div class=\"note-container\">\n <div class=\"note-header\">\n\n <p class=\"note-title\">\n <img src={money} width={23} />\n {this.config.giftbackTitle}\n </p>\n {\n infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={60} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"],"version":3}
@@ -93,6 +93,9 @@ const GiftbackInfo = class {
93
93
  }
94
94
  showTime() {
95
95
  const time = localStorage.getItem("bc:time");
96
+ const allow = localStorage.getItem("bc:time-allow");
97
+ if (!allow)
98
+ return false;
96
99
  return !!time;
97
100
  }
98
101
  getTime() {
@@ -104,14 +107,14 @@ const GiftbackInfo = class {
104
107
  const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
105
108
  const translateDescription = i18n.instance.t("giftDescription", { amount: `${this.bonus.totalBonus.toFixed(2).replace(".", ",")}`, custom_name: "Giftback" });
106
109
  const limit = utils.defineLimit(remainingGiftback);
107
- return (index.h("div", { key: 'fafe6b33f7a0a94f2070616378227532b802d55e', class: "giftback-container" }, index.h("div", { key: 'ac65f0b2e968c50a15e2a54c99b6f2cc771ce39e', class: "container-description" }, index.h("p", { key: 'c7bda733a20306ca8a8a5138155027cc245ab54d', innerHTML: translateDescription }), index.h("crm-tooltip", { key: '0244fe115bd75f91929f40c4acaa41aff6af1bd8', identity: "crm-role-description", text: i18n.instance.t("labelUseGiftback", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: utils.formatDateToBr(this.bonus.firstValidityDate) }) })), index.h("div", { key: '641801e38f70c2c816995a6f5f8b5289db4e33dc', class: "slider-wrapper" }, index.h("div", { key: 'f45ab1419d1b92735ed9379bbfeffb85255667e9', class: "slider-value", style: {
110
+ return (index.h("div", { key: 'a95768449481c3b65cf268846b816f6ac9e8114a', class: "giftback-container" }, index.h("div", { key: '4dc64dd88800e9d10722de867338a38942263544', class: "container-description" }, index.h("p", { key: '4e27bd70286582c735a5f1232520e42e72829cf0', innerHTML: translateDescription }), index.h("crm-tooltip", { key: '1f71f1f7fb451bace36606603eb742757440b812', identity: "crm-role-description", text: i18n.instance.t("labelUseGiftback", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: utils.formatDateToBr(this.bonus.firstValidityDate) }) })), index.h("div", { key: '5cfa7ed56cd056eb537f9dfb65e34ab617039a12', class: "slider-wrapper" }, index.h("div", { key: 'e3b2a528f75d11ef8d57e3cdc756329bce54b2af', class: "slider-value", style: {
108
111
  left: `calc(${this.sliderValuePosition}% - 20px)`, // Ajuste para centralizar o texto
109
- } }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), index.h("input", { key: 'bc8c848c8aa8a27f6f73969105b7c75d2767f33f', id: "position_value_id", disabled: true, type: "range", min: "0", max: this.bonus.totalBonus, value: this.usedValue, class: "slider", step: "0.01", onInput: (event) => this.handleSliderChange(event), style: {
112
+ } }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), index.h("input", { key: '0d3db2ea9c816b6808896edc7c2f07b7331ca5fc', id: "position_value_id", disabled: true, type: "range", min: "0", max: this.bonus.totalBonus, value: this.usedValue, class: "slider", step: "0.01", onInput: (event) => this.handleSliderChange(event), style: {
110
113
  background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,
111
- } })), limit.isComplete && (index.h("p", { key: 'ffb782b9376a5053ec5c56028d7f46aa3234e58d' }, i18n.instance.t("maxAmount"))), !limit.isComplete && (index.h("div", { key: '26ac4a4f8ddf492b657ded12df571ffd802dbdfd', class: "container-description" }, index.h("p", { key: '01c7ccb1f966ca88149edc07e2d11830fb603fca' }, "Adicione ", index.h("strong", { key: '827efa48224ff08d0148e5caccadde4e7538a0a3' }, "R$ ", remainingGiftback < 0 ? "0,00" : remainingGiftback.toFixed(2).replace(".", ",")), " ao carrinho para atingir o valor m\u00E1ximo!"), index.h("crm-tooltip", { key: 'c017ed7ab4ffdb3c6843e754863a946382f79c8b', identity: "crm-max-description", text: i18n.instance.t("labelamountPartial") }))), index.h("div", { key: '41c842060add3a0411427c209384272e76194a9b', class: "options" }, index.h("div", { key: '967b1a1cbc32c6e26f4863b887953997583ba379', class: "options-option" }, index.h("input", { key: 'd3a3a349677c2fc63e611e6351490871cebcb359', disabled: this.showTime(), type: "radio", name: "giftbackOption", value: "use", checked: this.selectedOption === 'use', onChange: () => this.handleOptionChange('use') }), index.h("p", { key: '2427074fde5f4dea67f86874f9e1825ed4b1e078' }, "Usar o meu ", (_a = this.config) === null || _a === void 0 ? void 0 :
112
- _a.giftbackTitle)), index.h("div", { key: 'c05852b8685391a5c4b3871df3afcd426bb7cb59', class: "options-option" }, index.h("input", { key: '4c1fee6874de5a3a963d226f7366309ae4660779', disabled: this.showTime(), type: "radio", name: "giftbackOption", value: "dontUse", checked: this.selectedOption === 'dontUse', onChange: () => this.handleOptionChange('dontUse') }), index.h("p", { key: 'e2cbe5c6ea747a6c8d6b39bf4ed44736c443e225' }, "N\u00E3o usar o meu ", (_b = this.config) === null || _b === void 0 ? void 0 :
114
+ } })), limit.isComplete && (index.h("p", { key: '1d5c84174d391884ce8f5c77c2189957fe9e92a6' }, i18n.instance.t("maxAmount"))), !limit.isComplete && (index.h("div", { key: 'b2068a48e6a9dc5ac19e47a94f5abd10c8560a5e', class: "container-description" }, index.h("p", { key: '50a0a8e2e65d630051a7ad94c205538da695d5c0' }, "Adicione ", index.h("strong", { key: '50cc712ba5cbab10c24b9cdf40bf74086ee2c50d' }, "R$ ", remainingGiftback < 0 ? "0,00" : remainingGiftback.toFixed(2).replace(".", ",")), " ao carrinho para atingir o valor m\u00E1ximo!"), index.h("crm-tooltip", { key: '19aa1c3225f5335c3831742840cf82e9adf92662', identity: "crm-max-description", text: i18n.instance.t("labelamountPartial") }))), index.h("div", { key: '9b73166715767caf1f3147512edc3a14aa077b82', class: "options" }, index.h("div", { key: '42229f128f45bc942e2b834ec51666996d96717a', class: "options-option" }, index.h("input", { key: '56186df933c8bec2bac972631904c77cc93e5f07', disabled: this.showTime(), type: "radio", name: "giftbackOption", value: "use", checked: this.selectedOption === 'use', onChange: () => this.handleOptionChange('use') }), index.h("p", { key: '34b1dd578c2823f158424a0677ba5ede7d3c729b' }, "Usar o meu ", (_a = this.config) === null || _a === void 0 ? void 0 :
115
+ _a.giftbackTitle)), index.h("div", { key: '282a1c9c1027a6d63eb606ff090c51cfcc20e313', class: "options-option" }, index.h("input", { key: 'f3cfaa2adfd24f88f4a2ef25fa8d481334cd416a', disabled: this.showTime(), type: "radio", name: "giftbackOption", value: "dontUse", checked: this.selectedOption === 'dontUse', onChange: () => this.handleOptionChange('dontUse') }), index.h("p", { key: '481e4ec08f7e1cd12670760336583f456acbbe08' }, "N\u00E3o usar o meu ", (_b = this.config) === null || _b === void 0 ? void 0 :
113
116
  _b.giftbackTitle))), this.showTime() &&
114
- (index.h("div", { key: '0b443bcddb854dbcaab4a6c562aa7112d3f5e69d', class: "info-box" }, "Ap\u00F3s ", index.h("countdown-timer", { key: '434be7b1d65763c5d708617eb50a707ad9c21a1a', initialValue: this.getTime(), downtime: () => { this.loadingTime = true; } }), ", voc\u00EA poder\u00E1 alterar sua escolha de usar ou n\u00E3o o Giftback.")), index.h("div", { key: '87324f585a3daf5b17f0c49c7ae0707e47a3ec66', class: "info-box" }, "O Giftback ser\u00E1 aplicado na pr\u00F3xima etapa.")));
117
+ (index.h("div", { key: '6240035795b74b5456b251584d062ec6fb9cd738', class: "info-box" }, "Ap\u00F3s ", index.h("countdown-timer", { key: '6292e88fc610701330c2bf1a39f75d15bcbef4b3', initialValue: this.getTime(), downtime: () => { this.loadingTime = true; } }), ", voc\u00EA poder\u00E1 alterar sua escolha de usar ou n\u00E3o o Giftback.")), index.h("div", { key: '10ff18273054939e4c1968bf21dc7e872879b0b0', class: "info-box" }, "O Giftback ser\u00E1 aplicado na pr\u00F3xima etapa.")));
115
118
  }
116
119
  static get watchers() { return {
117
120
  "bonus": ["changedBonus"]
@@ -1 +1 @@
1
- {"file":"crm-tooltip.giftback-info.phone-form.pin-form.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,uBAAuB,GAAG,wvCAAwvC;;ACAxxC,MAAM,aAAa,GAAG,y3BAAy3B,CAAC;AACh5B,yBAAe,aAAa;;MCOf,OAAO;;;;;;IAKhB,MAAM;QACF,QACIA,kEAAK,KAAK,EAAC,mCAAmC,IAC1CA,kEAAK,GAAG,EAAEC,uBAAI,GAAI,EAClBD,mEAAM,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAC,aAAa,IAAE,IAAI,CAAC,IAAI,CAAQ,CAC7D,EACR;KACL;;;;ACpBL,MAAM,eAAe,GAAG,k7DAAk7D,CAAC;AAC38D,2BAAe,eAAe;;MCWjB,YAAY;;;yBACQ,CAAC;8BACI,MAAM;uBAEb,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;;;;8BAKiC,CAAC;mCACI,CAAC;2BAEjB,KAAK;;IAG5B,YAAY;QACR,IAA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MAAM,IAAI,CAAC,MAAM,EAAE,yBAAmB,CAChD,CACT,CAEL,EACJA,yEAAY,MAAM,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,kBAAkB,KAAI,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,GAAI,CAC/H,EACT;KACL;;;;;;;;;","names":["h","info","USED_KEY","i18next","defineLimit","formatDateToBr","giftbackFormCss","Host","index"],"sources":["src/assets/svg/info-circle-svgrepo-com.svg","src/components/tooltip/crm-tooltip.css?tag=crm-tooltip","src/components/tooltip/tooltip.tsx","src/components/giftback-form/subcomponents/giftback-info/giftback-info.css?tag=giftback-info","src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx","src/components/giftback-form/giftback-form.css?tag=phone-form","src/components/giftback-form/subcomponents/phone-form/phone-form.tsx","src/components/giftback-form/subcomponents/pin-form/pin-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/giftback-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/subcomponents/pin-form/pin-form.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path d=\"M12 17.75C12.4142 17.75 12.75 17.4142 12.75 17V11C12.75 10.5858 12.4142 10.25 12 10.25C11.5858 10.25 11.25 10.5858 11.25 11V17C11.25 17.4142 11.5858 17.75 12 17.75Z\" fill=\"#1C274C\"/>\r\n<path d=\"M12 7C12.5523 7 13 7.44772 13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8C11 7.44772 11.4477 7 12 7Z\" fill=\"#1C274C\"/>\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M1.25 12C1.25 6.06294 6.06294 1.25 12 1.25C17.9371 1.25 22.75 6.06294 22.75 12C22.75 17.9371 17.9371 22.75 12 22.75C6.06294 22.75 1.25 17.9371 1.25 12ZM12 2.75C6.89137 2.75 2.75 6.89137 2.75 12C2.75 17.1086 6.89137 21.25 12 21.25C17.1086 21.25 21.25 17.1086 21.25 12C21.25 6.89137 17.1086 2.75 12 2.75Z\" fill=\"#1C274C\"/>\r\n</svg>",".crm-tooltip-container {\n display: flex;\n\n & img {\n width: 16px;\n margin-left: 3px;\n position: relative;\n }\n}\n\n.crm-tooltip {\n position: relative;\n display: inline-block;\n}\n\n.crm-tooltip .tooltiptext {\n visibility: hidden;\n background-color: black;\n color: #fff;\n text-align: center;\n padding: 8px 12px;\n border-radius: 0px;\n position: absolute;\n z-index: 1;\n min-width: 271px;\n top: 100%;\n left: 50%;\n margin-left: -238px;\n}\n\n@container (max-width: 410px) {\n .crm-tooltip .tooltiptext {\n margin-left: -14px;\n }\n\n .crm-tooltip #crm-role-description {\n margin-left: -151px;\n }\n}\n\n@container (max-width: 250px) {\n .crm-tooltip .tooltiptext {\n margin-left: -201px;\n }\n}\n\n.crm-tooltip:hover .tooltiptext {\n visibility: visible;\n}","import { Component, h, Prop } from \"@stencil/core\";\nimport info from '../../assets/svg/info-circle-svgrepo-com.svg';\n\n\n@Component({\n tag: 'crm-tooltip',\n styleUrl: 'crm-tooltip.css'\n})\nexport class Tooltip {\n\n @Prop() text: string;\n @Prop() identity: string;\n\n render() {\n return (\n <div class=\"crm-tooltip-container crm-tooltip\">\n <img src={info} />\n <span id={this.identity} class=\"tooltiptext\">{this.text}</span>\n </div>\n );\n }\n}",":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\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\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\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 const input: any = document.getElementById(\"position_value_id\")\n\n input.value = this.bonus.bonusBalance;\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 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 const time = localStorage.getItem(\"bc:time\");\n return !!time;\n }\n\n getTime() {\n const time = localStorage.getItem(\"bc:time\");\n return Number(time) || 360;\n }\n\n render() {\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 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 initialValue={this.getTime()} downtime={() => { this.loadingTime = true }} />, você poderá alterar sua escolha de usar ou não o Giftback.\n </div>\n )\n }\n\n\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}","* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, Host, Prop, h } from \"@stencil/core\";\nimport { IInfoStore } from \"../../../../helpers/info.config.helper\";\n\n@Component({\n tag: 'phone-form',\n styleUrl: '../../giftback-form.css'\n})\nexport class PhoneForm {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() value: string;\n @Prop() loading: boolean;\n @Prop() handlerSubmit: (phone: string) => void;\n\n @Prop() config: IInfoStore;\n\n\n async handlePhone() {\n\n const phone = await this.phoneInputMask.getPhone()\n\n await this.handlerSubmit(phone);\n }\n\n\n render() {\n return (\n <Host class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >Digite o seu celular para verificar se há desconto disponível nessa compra:</label>\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.handlePhone() } />\n </Host>\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 /* margin: 26px 0; */\n justify-content: start;\n gap: 10px;\n}\n\n.pin-container input {\n width: 100%;\n height: 48px;\n font-size: 14px;\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\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.crm-description {\n font-size: 14px;\n width: 100%;\n display: flex;\n gap: 9px;\n}\n\n.crm-description a {\n font-weight: bold;\n cursor: pointer;\n text-decoration: underline;\n}\n\n.crm-description div {\n display: flex;\n gap: 5px;\n}","* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\nimport i18next from '../../../../i18n/i18n'\nimport { IInfoStore } from '../../../../helpers/info.config.helper';\n\n@Component({\n tag: 'pin-form',\n styleUrls: ['pin-form.css', '../../giftback-form.css'],\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n @Prop() resend: () => void;\n\n @Prop() sent: IPinSent;\n @Prop() loading: boolean = false;\n @Prop() phone: string;\n @Prop() config: IInfoStore;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n @State() canResend: boolean = false;\n\n componentWillLoad() {\n this.canResend = false;\n }\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 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 handleTimeout() {\n this.canResend = true;\n }\n\n async handleResend() {\n await this.resend();\n\n this.canResend = false;\n this.pin = ['', '', '', '']\n }\n\n render() {\n return (\n <div class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >{i18next.t('pin-sutitle')} <strong>+55 {this.phone}</strong></label>\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\n <slot></slot>\n\n <p class=\"crm-description\"> Não recebeu?\n {\n !this.canResend && <label> Reenviar em <countdown-timer initialValue={30} downtime={() => this.handleTimeout()} /> </label>\n }\n {\n this.canResend && (\n <div >\n <a onClick={() => this.handleResend()}>Reenviar</a>\n <a onClick={() => this.cancel()}>Trocar número</a>\n </div>\n )\n }\n </p>\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.validatePin()} />\n </div >\n );\n }\n}\n"],"version":3}
1
+ {"file":"crm-tooltip.giftback-info.phone-form.pin-form.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,uBAAuB,GAAG,wvCAAwvC;;ACAxxC,MAAM,aAAa,GAAG,y3BAAy3B,CAAC;AACh5B,yBAAe,aAAa;;MCOf,OAAO;;;;;;IAKhB,MAAM;QACF,QACIA,kEAAK,KAAK,EAAC,mCAAmC,IAC1CA,kEAAK,GAAG,EAAEC,uBAAI,GAAI,EAClBD,mEAAM,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAC,aAAa,IAAE,IAAI,CAAC,IAAI,CAAQ,CAC7D,EACR;KACL;;;;ACpBL,MAAM,eAAe,GAAG,k7DAAk7D,CAAC;AAC38D,2BAAe,eAAe;;MCWjB,YAAY;;;yBACQ,CAAC;8BACI,MAAM;uBAEb,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;;;;8BAKiC,CAAC;mCACI,CAAC;2BAEjB,KAAK;;IAG5B,YAAY;QACR,IAAI,CAAC,WAAW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,SAAS,KACVA,oEACIA,gEAAG,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,eAAc,EACnDA,gEAAG,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,yBAAmB,CAChD,CACT,CAEL,EACJA,yEAAY,MAAM,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,kBAAkB,KAAI,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,GAAI,CAC/H,EACT;KACL;;;;;;;;;","names":["h","info","USED_KEY","i18next","defineLimit","formatDateToBr","giftbackFormCss","Host","index"],"sources":["src/assets/svg/info-circle-svgrepo-com.svg","src/components/tooltip/crm-tooltip.css?tag=crm-tooltip","src/components/tooltip/tooltip.tsx","src/components/giftback-form/subcomponents/giftback-info/giftback-info.css?tag=giftback-info","src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx","src/components/giftback-form/giftback-form.css?tag=phone-form","src/components/giftback-form/subcomponents/phone-form/phone-form.tsx","src/components/giftback-form/subcomponents/pin-form/pin-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/giftback-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/subcomponents/pin-form/pin-form.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path d=\"M12 17.75C12.4142 17.75 12.75 17.4142 12.75 17V11C12.75 10.5858 12.4142 10.25 12 10.25C11.5858 10.25 11.25 10.5858 11.25 11V17C11.25 17.4142 11.5858 17.75 12 17.75Z\" fill=\"#1C274C\"/>\r\n<path d=\"M12 7C12.5523 7 13 7.44772 13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8C11 7.44772 11.4477 7 12 7Z\" fill=\"#1C274C\"/>\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M1.25 12C1.25 6.06294 6.06294 1.25 12 1.25C17.9371 1.25 22.75 6.06294 22.75 12C22.75 17.9371 17.9371 22.75 12 22.75C6.06294 22.75 1.25 17.9371 1.25 12ZM12 2.75C6.89137 2.75 2.75 6.89137 2.75 12C2.75 17.1086 6.89137 21.25 12 21.25C17.1086 21.25 21.25 17.1086 21.25 12C21.25 6.89137 17.1086 2.75 12 2.75Z\" fill=\"#1C274C\"/>\r\n</svg>",".crm-tooltip-container {\n display: flex;\n\n & img {\n width: 16px;\n margin-left: 3px;\n position: relative;\n }\n}\n\n.crm-tooltip {\n position: relative;\n display: inline-block;\n}\n\n.crm-tooltip .tooltiptext {\n visibility: hidden;\n background-color: black;\n color: #fff;\n text-align: center;\n padding: 8px 12px;\n border-radius: 0px;\n position: absolute;\n z-index: 1;\n min-width: 271px;\n top: 100%;\n left: 50%;\n margin-left: -238px;\n}\n\n@container (max-width: 410px) {\n .crm-tooltip .tooltiptext {\n margin-left: -14px;\n }\n\n .crm-tooltip #crm-role-description {\n margin-left: -151px;\n }\n}\n\n@container (max-width: 250px) {\n .crm-tooltip .tooltiptext {\n margin-left: -201px;\n }\n}\n\n.crm-tooltip:hover .tooltiptext {\n visibility: visible;\n}","import { Component, h, Prop } from \"@stencil/core\";\nimport info from '../../assets/svg/info-circle-svgrepo-com.svg';\n\n\n@Component({\n tag: 'crm-tooltip',\n styleUrl: 'crm-tooltip.css'\n})\nexport class Tooltip {\n\n @Prop() text: string;\n @Prop() identity: string;\n\n render() {\n return (\n <div class=\"crm-tooltip-container crm-tooltip\">\n <img src={info} />\n <span id={this.identity} class=\"tooltiptext\">{this.text}</span>\n </div>\n );\n }\n}",":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\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\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\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 const input: any = document.getElementById(\"position_value_id\")\n\n input.value = this.bonus.bonusBalance;\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 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 const time = localStorage.getItem(\"bc:time\");\n\n const allow = localStorage.getItem(\"bc:time-allow\");\n\n if(!allow) return false;\n\n return !!time;\n }\n\n getTime() {\n const time = localStorage.getItem(\"bc:time\");\n return Number(time) || 360;\n }\n\n render() {\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 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 initialValue={this.getTime()} downtime={() => { this.loadingTime = true }} />, você poderá alterar sua escolha de usar ou não o Giftback.\n </div>\n )\n }\n\n\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}","* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, Host, Prop, h } from \"@stencil/core\";\nimport { IInfoStore } from \"../../../../helpers/info.config.helper\";\n\n@Component({\n tag: 'phone-form',\n styleUrl: '../../giftback-form.css'\n})\nexport class PhoneForm {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() value: string;\n @Prop() loading: boolean;\n @Prop() handlerSubmit: (phone: string) => void;\n\n @Prop() config: IInfoStore;\n\n\n async handlePhone() {\n\n const phone = await this.phoneInputMask.getPhone()\n\n await this.handlerSubmit(phone);\n }\n\n\n render() {\n return (\n <Host class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >Digite o seu celular para verificar se há desconto disponível nessa compra:</label>\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.handlePhone() } />\n </Host>\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 /* margin: 26px 0; */\n justify-content: start;\n gap: 10px;\n}\n\n.pin-container input {\n width: 100%;\n height: 48px;\n font-size: 14px;\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\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.crm-description {\n font-size: 14px;\n width: 100%;\n display: flex;\n gap: 9px;\n}\n\n.crm-description a {\n font-weight: bold;\n cursor: pointer;\n text-decoration: underline;\n}\n\n.crm-description div {\n display: flex;\n gap: 5px;\n}","* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\nimport i18next from '../../../../i18n/i18n'\nimport { IInfoStore } from '../../../../helpers/info.config.helper';\n\n@Component({\n tag: 'pin-form',\n styleUrls: ['pin-form.css', '../../giftback-form.css'],\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n @Prop() resend: () => void;\n\n @Prop() sent: IPinSent;\n @Prop() loading: boolean = false;\n @Prop() phone: string;\n @Prop() config: IInfoStore;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n @State() canResend: boolean = false;\n\n componentWillLoad() {\n this.canResend = false;\n }\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 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 handleTimeout() {\n this.canResend = true;\n }\n\n async handleResend() {\n await this.resend();\n\n this.canResend = false;\n this.pin = ['', '', '', '']\n }\n\n render() {\n return (\n <div class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >{i18next.t('pin-sutitle')} <strong>+55 {this.phone}</strong></label>\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\n <slot></slot>\n\n <p class=\"crm-description\"> Não recebeu?\n {\n !this.canResend && <label> Reenviar em <countdown-timer initialValue={30} downtime={() => this.handleTimeout()} /> </label>\n }\n {\n this.canResend && (\n <div >\n <a onClick={() => this.handleResend()}>Reenviar</a>\n <a onClick={() => this.cancel()}>Trocar número</a>\n </div>\n )\n }\n </p>\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.validatePin()} />\n </div >\n );\n }\n}\n"],"version":3}
@@ -68,6 +68,9 @@ export class GiftbackInfo {
68
68
  }
69
69
  showTime() {
70
70
  const time = localStorage.getItem("bc:time");
71
+ const allow = localStorage.getItem("bc:time-allow");
72
+ if (!allow)
73
+ return false;
71
74
  return !!time;
72
75
  }
73
76
  getTime() {
@@ -79,14 +82,14 @@ export class GiftbackInfo {
79
82
  const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
80
83
  const translateDescription = i18next.t("giftDescription", { amount: `${this.bonus.totalBonus.toFixed(2).replace(".", ",")}`, custom_name: "Giftback" });
81
84
  const limit = defineLimit(remainingGiftback);
82
- return (h("div", { key: 'fafe6b33f7a0a94f2070616378227532b802d55e', class: "giftback-container" }, h("div", { key: 'ac65f0b2e968c50a15e2a54c99b6f2cc771ce39e', class: "container-description" }, h("p", { key: 'c7bda733a20306ca8a8a5138155027cc245ab54d', innerHTML: translateDescription }), h("crm-tooltip", { key: '0244fe115bd75f91929f40c4acaa41aff6af1bd8', identity: "crm-role-description", text: i18next.t("labelUseGiftback", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) }) })), h("div", { key: '641801e38f70c2c816995a6f5f8b5289db4e33dc', class: "slider-wrapper" }, h("div", { key: 'f45ab1419d1b92735ed9379bbfeffb85255667e9', class: "slider-value", style: {
85
+ return (h("div", { key: 'a95768449481c3b65cf268846b816f6ac9e8114a', class: "giftback-container" }, h("div", { key: '4dc64dd88800e9d10722de867338a38942263544', class: "container-description" }, h("p", { key: '4e27bd70286582c735a5f1232520e42e72829cf0', innerHTML: translateDescription }), h("crm-tooltip", { key: '1f71f1f7fb451bace36606603eb742757440b812', identity: "crm-role-description", text: i18next.t("labelUseGiftback", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) }) })), h("div", { key: '5cfa7ed56cd056eb537f9dfb65e34ab617039a12', class: "slider-wrapper" }, h("div", { key: 'e3b2a528f75d11ef8d57e3cdc756329bce54b2af', class: "slider-value", style: {
83
86
  left: `calc(${this.sliderValuePosition}% - 20px)`, // Ajuste para centralizar o texto
84
- } }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), h("input", { key: 'bc8c848c8aa8a27f6f73969105b7c75d2767f33f', id: "position_value_id", disabled: true, type: "range", min: "0", max: this.bonus.totalBonus, value: this.usedValue, class: "slider", step: "0.01", onInput: (event) => this.handleSliderChange(event), style: {
87
+ } }, "R$ ", this.usedValue.toFixed(2).replace(".", ",")), h("input", { key: '0d3db2ea9c816b6808896edc7c2f07b7331ca5fc', id: "position_value_id", disabled: true, type: "range", min: "0", max: this.bonus.totalBonus, value: this.usedValue, class: "slider", step: "0.01", onInput: (event) => this.handleSliderChange(event), style: {
85
88
  background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,
86
- } })), limit.isComplete && (h("p", { key: 'ffb782b9376a5053ec5c56028d7f46aa3234e58d' }, i18next.t("maxAmount"))), !limit.isComplete && (h("div", { key: '26ac4a4f8ddf492b657ded12df571ffd802dbdfd', class: "container-description" }, h("p", { key: '01c7ccb1f966ca88149edc07e2d11830fb603fca' }, "Adicione ", h("strong", { key: '827efa48224ff08d0148e5caccadde4e7538a0a3' }, "R$ ", remainingGiftback < 0 ? "0,00" : remainingGiftback.toFixed(2).replace(".", ",")), " ao carrinho para atingir o valor m\u00E1ximo!"), h("crm-tooltip", { key: 'c017ed7ab4ffdb3c6843e754863a946382f79c8b', identity: "crm-max-description", text: i18next.t("labelamountPartial") }))), h("div", { key: '41c842060add3a0411427c209384272e76194a9b', class: "options" }, h("div", { key: '967b1a1cbc32c6e26f4863b887953997583ba379', class: "options-option" }, h("input", { key: 'd3a3a349677c2fc63e611e6351490871cebcb359', disabled: this.showTime(), type: "radio", name: "giftbackOption", value: "use", checked: this.selectedOption === 'use', onChange: () => this.handleOptionChange('use') }), h("p", { key: '2427074fde5f4dea67f86874f9e1825ed4b1e078' }, "Usar o meu ", (_a = this.config) === null || _a === void 0 ? void 0 :
87
- _a.giftbackTitle)), h("div", { key: 'c05852b8685391a5c4b3871df3afcd426bb7cb59', class: "options-option" }, h("input", { key: '4c1fee6874de5a3a963d226f7366309ae4660779', disabled: this.showTime(), type: "radio", name: "giftbackOption", value: "dontUse", checked: this.selectedOption === 'dontUse', onChange: () => this.handleOptionChange('dontUse') }), h("p", { key: 'e2cbe5c6ea747a6c8d6b39bf4ed44736c443e225' }, "N\u00E3o usar o meu ", (_b = this.config) === null || _b === void 0 ? void 0 :
89
+ } })), limit.isComplete && (h("p", { key: '1d5c84174d391884ce8f5c77c2189957fe9e92a6' }, i18next.t("maxAmount"))), !limit.isComplete && (h("div", { key: 'b2068a48e6a9dc5ac19e47a94f5abd10c8560a5e', class: "container-description" }, h("p", { key: '50a0a8e2e65d630051a7ad94c205538da695d5c0' }, "Adicione ", h("strong", { key: '50cc712ba5cbab10c24b9cdf40bf74086ee2c50d' }, "R$ ", remainingGiftback < 0 ? "0,00" : remainingGiftback.toFixed(2).replace(".", ",")), " ao carrinho para atingir o valor m\u00E1ximo!"), h("crm-tooltip", { key: '19aa1c3225f5335c3831742840cf82e9adf92662', identity: "crm-max-description", text: i18next.t("labelamountPartial") }))), h("div", { key: '9b73166715767caf1f3147512edc3a14aa077b82', class: "options" }, h("div", { key: '42229f128f45bc942e2b834ec51666996d96717a', class: "options-option" }, h("input", { key: '56186df933c8bec2bac972631904c77cc93e5f07', disabled: this.showTime(), type: "radio", name: "giftbackOption", value: "use", checked: this.selectedOption === 'use', onChange: () => this.handleOptionChange('use') }), h("p", { key: '34b1dd578c2823f158424a0677ba5ede7d3c729b' }, "Usar o meu ", (_a = this.config) === null || _a === void 0 ? void 0 :
90
+ _a.giftbackTitle)), h("div", { key: '282a1c9c1027a6d63eb606ff090c51cfcc20e313', class: "options-option" }, h("input", { key: 'f3cfaa2adfd24f88f4a2ef25fa8d481334cd416a', disabled: this.showTime(), type: "radio", name: "giftbackOption", value: "dontUse", checked: this.selectedOption === 'dontUse', onChange: () => this.handleOptionChange('dontUse') }), h("p", { key: '481e4ec08f7e1cd12670760336583f456acbbe08' }, "N\u00E3o usar o meu ", (_b = this.config) === null || _b === void 0 ? void 0 :
88
91
  _b.giftbackTitle))), this.showTime() &&
89
- (h("div", { key: '0b443bcddb854dbcaab4a6c562aa7112d3f5e69d', class: "info-box" }, "Ap\u00F3s ", h("countdown-timer", { key: '434be7b1d65763c5d708617eb50a707ad9c21a1a', initialValue: this.getTime(), downtime: () => { this.loadingTime = true; } }), ", voc\u00EA poder\u00E1 alterar sua escolha de usar ou n\u00E3o o Giftback.")), h("div", { key: '87324f585a3daf5b17f0c49c7ae0707e47a3ec66', class: "info-box" }, "O Giftback ser\u00E1 aplicado na pr\u00F3xima etapa.")));
92
+ (h("div", { key: '6240035795b74b5456b251584d062ec6fb9cd738', class: "info-box" }, "Ap\u00F3s ", h("countdown-timer", { key: '6292e88fc610701330c2bf1a39f75d15bcbef4b3', initialValue: this.getTime(), downtime: () => { this.loadingTime = true; } }), ", voc\u00EA poder\u00E1 alterar sua escolha de usar ou n\u00E3o o Giftback.")), h("div", { key: '10ff18273054939e4c1968bf21dc7e872879b0b0', class: "info-box" }, "O Giftback ser\u00E1 aplicado na pr\u00F3xima etapa.")));
90
93
  }
91
94
  static get is() { return "giftback-info"; }
92
95
  static get originalStyleUrls() {
@@ -1 +1 @@
1
- {"version":3,"file":"giftback-info.js","sourceRoot":"","sources":["../../../../../../src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGjE,OAAO,OAAO,MAAM,uBAAuB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAOtE,MAAM,OAAO,YAAY;;yBACQ,CAAC;8BACI,MAAM;uBAEb,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;;;;8BAKiC,CAAC;mCACI,CAAC;2BAEjB,KAAK;;IAG5B,YAAY;QACR,IAAI,CAAC,WAAW,EAAE,CAAA;IACtB,CAAC;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;IACvD,CAAC;IAED,iBAAiB;QACb,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzD,CAAC;IAED,kBAA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AAC,cAAc,KAAK,KAAK,EACtC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,GAChD;oBACF;uCAAe,MAAA,IAAI,CAAC,MAAM;2BAAE,aAAa,CAAK,CAC5C;gBACN,4DAAK,KAAK,EAAC,gBAAgB;oBACvB,8DACI,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,EACzB,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,IAAI,CAAC,cAAc,KAAK,SAAS,EAC1C,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,GACpD;oBACF;gDAAmB,MAAA,IAAI,CAAC,MAAM;2BAAE,aAAa,CAAK,CAChD,CACJ;YAGF,IAAI,CAAC,QAAQ,EAAE;gBACf,CACI,4DAAK,KAAK,EAAC,UAAU;;oBACZ,wEAAiB,YAAY,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA,CAAC,CAAC,GAAI;kGACjG,CACT;YAIL,4DAAK,KAAK,EAAC,UAAU,2DAEf,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["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\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\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\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 const input: any = document.getElementById(\"position_value_id\")\n\n input.value = this.bonus.bonusBalance;\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 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 const time = localStorage.getItem(\"bc:time\");\n return !!time;\n }\n\n getTime() {\n const time = localStorage.getItem(\"bc:time\");\n return Number(time) || 360;\n }\n\n render() {\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 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 initialValue={this.getTime()} downtime={() => { this.loadingTime = true }} />, você poderá alterar sua escolha de usar ou não o Giftback.\n </div>\n )\n }\n\n\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}"]}
1
+ {"version":3,"file":"giftback-info.js","sourceRoot":"","sources":["../../../../../../src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGjE,OAAO,OAAO,MAAM,uBAAuB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAOtE,MAAM,OAAO,YAAY;;yBACQ,CAAC;8BACI,MAAM;uBAEb,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;;;;8BAKiC,CAAC;mCACI,CAAC;2BAEjB,KAAK;;IAG5B,YAAY;QACR,IAAI,CAAC,WAAW,EAAE,CAAA;IACtB,CAAC;IAEO,WAAW;QACf,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,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;;;;;;;;;;;CACJ","sourcesContent":["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\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\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\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 const input: any = document.getElementById(\"position_value_id\")\n\n input.value = this.bonus.bonusBalance;\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 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 const time = localStorage.getItem(\"bc:time\");\n\n const allow = localStorage.getItem(\"bc:time-allow\");\n\n if(!allow) return false;\n\n return !!time;\n }\n\n getTime() {\n const time = localStorage.getItem(\"bc:time\");\n return Number(time) || 360;\n }\n\n render() {\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 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 initialValue={this.getTime()} downtime={() => { this.loadingTime = true }} />, você poderá alterar sua escolha de usar ou não o Giftback.\n </div>\n )\n }\n\n\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}"]}
@@ -38,6 +38,9 @@ export class CrmBonusNote {
38
38
  }
39
39
  startTime() {
40
40
  if (document.location.pathname == '/Fechamento') {
41
+ if (!localStorage.getItem("bc:time-allow")) {
42
+ localStorage.removeItem("bc:time");
43
+ }
41
44
  setTime();
42
45
  }
43
46
  }
@@ -57,10 +60,10 @@ export class CrmBonusNote {
57
60
  render() {
58
61
  const giftbackname = this.config.giftbackTitle || "Giftback";
59
62
  const infobonus = this.hasBonus();
60
- return (h("div", { key: '40b65f783b97ee8fee241680a1b426d0a6e5a957' }, h("div", { key: 'ecaec8bc0bc2291404ce6ff65bd37672efcaec49', class: "note-container" }, h("div", { key: '43e8a2ca78d40e1eab90bad4351d1bb5372fa3e3', class: "note-header" }, h("p", { key: 'eb45285cac01dc3c21fedf7189fef891207df961', class: "note-title" }, h("img", { key: '87738582b6a37902f70e404bbea62d2967a66193', src: money, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (h("div", { key: '356cbf79c082125a3d45fcd8627c83d7a5c2bfd8' }, this.showEdit && (h("p", { key: '94da6960e7a0a802a1b1c116d5311cc88c1e98cc', class: "back-cart", onClick: () => this.backCart() }, i18next.t("edit"))), !this.showEdit && h("countdown-timer", { key: 'ac292ddea8a0e85ed68dbd70deb87377681cd4f1', initialValue: 60, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
61
- (h("p", { key: '59084c383238967ea9cfa43145e7eb2a7e65b2a8', class: "note-description-2" }, i18next.t("withApplyBonus", { giftbackname: giftbackname }), " ", h("strong", { key: '9504113697df7d40e37fed476eebd979798a3b72' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
62
- (h("p", { key: '5952e57df4810c2973749a42aeb43cad6ba893bc', class: "note-description-not" }, i18next.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
63
- (h("div", { key: 'c4f612793f55887c0a8434bc0be40884d21f0035', class: "description" }, h("p", { key: '544562fe092c0044c165d6339543b7cd79e9c9e4', class: "note-description-not" }, i18next.t("backCart")), h("crm-button", { key: '266b151adf1296bea58485ffcd929b2e4496f9bf', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
63
+ return (h("div", { key: '2ce9d0ebd4c796ea7812cbd934d8dc2abc7c65d0' }, h("div", { key: '4bc8a698cd77677291e58bae000d294f00d9350c', class: "note-container" }, h("div", { key: '64edc1f1141614dd6e378c81d0110e1713caed88', class: "note-header" }, h("p", { key: '37e52138331897e0e4c43c1b39d2bc56dcb4dae9', class: "note-title" }, h("img", { key: '3716f55a0571e5c2c12274935dde99dceb8f10dd', src: money, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (h("div", { key: '66f9cfec76b7fb878eab7deea954441c1b61ba4e' }, this.showEdit && (h("p", { key: '2dc0b7d75c7cea3923be333fccf2ea15153aed72', class: "back-cart", onClick: () => this.backCart() }, i18next.t("edit"))), !this.showEdit && h("countdown-timer", { key: 'ab228f6aa8a691227a8380ff1ff1f677998e6aa8', initialValue: 60, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
64
+ (h("p", { key: 'aa70095a7472df8d332d50299977f7b9b645eaa4', class: "note-description-2" }, i18next.t("withApplyBonus", { giftbackname: giftbackname }), " ", h("strong", { key: 'a6203afca4c2f02b441eb618fd84c3f9f7254127' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
65
+ (h("p", { key: 'a75fc7247d5e443600015e340e8d47f3dfa0baf7', class: "note-description-not" }, i18next.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
66
+ (h("div", { key: '49d5eea185140c5a06c1f745bf7011b01dd683bb', class: "description" }, h("p", { key: '1b2c5ac3753c6fc4162311001be0253007d30a26', class: "note-description-not" }, i18next.t("backCart")), h("crm-button", { key: '1fc75a0d0defb7369c6a06814f25627a04753164', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
64
67
  }
65
68
  static get is() { return "crm-bonus-note"; }
66
69
  static get originalStyleUrls() {
@@ -1 +1 @@
1
- {"version":3,"file":"crm-bonus-note.js","sourceRoot":"","sources":["../../../../src/components/note/crm-bonus-note.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAc,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAEpF,OAAO,KAAK,MAAM,gDAAgD,CAAA;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,OAAO,MAAM,iBAAiB,CAAA;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAMpD,MAAM,OAAO,YAAY;;;;;;;wBAUQ,KAAK;;IAElC,iBAAiB;QACb,IAAI,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,EAAE;gCAAW,CACrG,CACP;gBAID,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;oBAC/C,CACI,0DAAG,KAAK,EAAC,sBAAsB,IAC1B,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CACrD,CACP;gBAID,CAAC,SAAS,CAAC,YAAY;oBACvB,CACI,4DAAK,KAAK,EAAC,aAAa;wBACpB,0DAAG,KAAK,EAAC,sBAAsB,IAC1B,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CACtB;wBACJ,mEAAY,MAAM,EAAC,oBAAoB,EAAC,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, State, h } from \"@stencil/core\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport money from '../../assets/svg/money-dollars-svgrepo-com.svg'\nimport { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @Prop({ attribute: 'cartid' }) cartId;\n @Prop({ attribute: \"storename\" }) storename;\n\n @State() url: string;\n @State() config: IInfoStore;\n\n @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\n }\n\n upadateCheckToFreteAndGetUrl() {\n\n this.config = getInfoCustomization(this.storename);\n const envios = document.getElementsByName('forma-envio');\n envios.forEach((envio: any) => {\n envio.checked = false;\n });\n\n this.url = window.location.origin;\n }\n\n handleHide() {\n const amount = localStorage.getItem(this.cartId);\n return !!amount;\n }\n\n getAmount() {\n const amount = localStorage.getItem(this.cartId);\n\n return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\n\n return (\n <div>\n <div class=\"note-container\">\n <div class=\"note-header\">\n\n <p class=\"note-title\">\n <img src={money} width={23} />\n {this.config.giftbackTitle}\n </p>\n {\n infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={60} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"]}
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\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport money from '../../assets/svg/money-dollars-svgrepo-com.svg'\nimport { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @Prop({ attribute: 'cartid' }) cartId;\n @Prop({ attribute: \"storename\" }) storename;\n\n @State() url: string;\n @State() config: IInfoStore;\n\n @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\n }\n\n upadateCheckToFreteAndGetUrl() {\n\n this.config = getInfoCustomization(this.storename);\n const envios = document.getElementsByName('forma-envio');\n envios.forEach((envio: any) => {\n envio.checked = false;\n });\n\n this.url = window.location.origin;\n }\n\n handleHide() {\n const amount = localStorage.getItem(this.cartId);\n return !!amount;\n }\n\n getAmount() {\n const amount = localStorage.getItem(this.cartId);\n\n return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\n\n return (\n <div>\n <div class=\"note-container\">\n <div class=\"note-header\">\n\n <p class=\"note-title\">\n <img src={money} width={23} />\n {this.config.giftbackTitle}\n </p>\n {\n infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={60} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"]}
@@ -59,6 +59,9 @@ const CrmBonusNote$1 = /*@__PURE__*/ proxyCustomElement(class CrmBonusNote exten
59
59
  }
60
60
  startTime() {
61
61
  if (document.location.pathname == '/Fechamento') {
62
+ if (!localStorage.getItem("bc:time-allow")) {
63
+ localStorage.removeItem("bc:time");
64
+ }
62
65
  setTime();
63
66
  }
64
67
  }
@@ -78,10 +81,10 @@ const CrmBonusNote$1 = /*@__PURE__*/ proxyCustomElement(class CrmBonusNote exten
78
81
  render() {
79
82
  const giftbackname = this.config.giftbackTitle || "Giftback";
80
83
  const infobonus = this.hasBonus();
81
- return (h("div", { key: '40b65f783b97ee8fee241680a1b426d0a6e5a957' }, h("div", { key: 'ecaec8bc0bc2291404ce6ff65bd37672efcaec49', class: "note-container" }, h("div", { key: '43e8a2ca78d40e1eab90bad4351d1bb5372fa3e3', class: "note-header" }, h("p", { key: 'eb45285cac01dc3c21fedf7189fef891207df961', class: "note-title" }, h("img", { key: '87738582b6a37902f70e404bbea62d2967a66193', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (h("div", { key: '356cbf79c082125a3d45fcd8627c83d7a5c2bfd8' }, this.showEdit && (h("p", { key: '94da6960e7a0a802a1b1c116d5311cc88c1e98cc', class: "back-cart", onClick: () => this.backCart() }, instance.t("edit"))), !this.showEdit && h("countdown-timer", { key: 'ac292ddea8a0e85ed68dbd70deb87377681cd4f1', initialValue: 60, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
82
- (h("p", { key: '59084c383238967ea9cfa43145e7eb2a7e65b2a8', class: "note-description-2" }, instance.t("withApplyBonus", { giftbackname: giftbackname }), " ", h("strong", { key: '9504113697df7d40e37fed476eebd979798a3b72' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
83
- (h("p", { key: '5952e57df4810c2973749a42aeb43cad6ba893bc', class: "note-description-not" }, instance.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
84
- (h("div", { key: 'c4f612793f55887c0a8434bc0be40884d21f0035', class: "description" }, h("p", { key: '544562fe092c0044c165d6339543b7cd79e9c9e4', class: "note-description-not" }, instance.t("backCart")), h("crm-button", { key: '266b151adf1296bea58485ffcd929b2e4496f9bf', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
84
+ return (h("div", { key: '2ce9d0ebd4c796ea7812cbd934d8dc2abc7c65d0' }, h("div", { key: '4bc8a698cd77677291e58bae000d294f00d9350c', class: "note-container" }, h("div", { key: '64edc1f1141614dd6e378c81d0110e1713caed88', class: "note-header" }, h("p", { key: '37e52138331897e0e4c43c1b39d2bc56dcb4dae9', class: "note-title" }, h("img", { key: '3716f55a0571e5c2c12274935dde99dceb8f10dd', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (h("div", { key: '66f9cfec76b7fb878eab7deea954441c1b61ba4e' }, this.showEdit && (h("p", { key: '2dc0b7d75c7cea3923be333fccf2ea15153aed72', class: "back-cart", onClick: () => this.backCart() }, instance.t("edit"))), !this.showEdit && h("countdown-timer", { key: 'ab228f6aa8a691227a8380ff1ff1f677998e6aa8', initialValue: 60, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
85
+ (h("p", { key: 'aa70095a7472df8d332d50299977f7b9b645eaa4', class: "note-description-2" }, instance.t("withApplyBonus", { giftbackname: giftbackname }), " ", h("strong", { key: 'a6203afca4c2f02b441eb618fd84c3f9f7254127' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
86
+ (h("p", { key: 'a75fc7247d5e443600015e340e8d47f3dfa0baf7', class: "note-description-not" }, instance.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
87
+ (h("div", { key: '49d5eea185140c5a06c1f745bf7011b01dd683bb', class: "description" }, h("p", { key: '1b2c5ac3753c6fc4162311001be0253007d30a26', class: "note-description-not" }, instance.t("backCart")), h("crm-button", { key: '1fc75a0d0defb7369c6a06814f25627a04753164', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
85
88
  }
86
89
  static get style() { return CrmBonusNoteStyle0; }
87
90
  }, [0, "crm-bonus-note", {
@@ -1 +1 @@
1
- {"file":"crm-bonus-note.js","mappings":";;;;;;;;AAAA,MAAM,yBAAyB,GAAG,4gCAA4gC;;SCA9hC,OAAO;IAEnB,IAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACtC,OAAM;KACT;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAE7C,IAAG,CAAC,IAAI,EAAE;QACN,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QACvC,YAAY,CAAC,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAM;KACT;AACL;;ACbA,MAA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AAC,SAAS,CAAC,QAAQ;aAE1C,0DAAG,KAAK,EAAC,sBAAsB,IAC1BA,QAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CACrD,CACP,EAID,CAAC,SAAS,CAAC,YAAY;aAEnB,4DAAK,KAAK,EAAC,aAAa,IACpB,0DAAG,KAAK,EAAC,sBAAsB,IAC1BA,QAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CACtB,EACJ,mEAAY,MAAM,EAAC,oBAAoB,EAAC,WAAW,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,EACT;KACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CrmBonusNote","money","i18next"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","src/components/note/crm-bonus-note.css?tag=crm-bonus-note","src/components/note/crm-bonus-note.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\n<path d=\"M15 9.94728C14.5 9.3 13.8 8.5 12 8.5C10.2 8.5 9 9.51393 9 9.94728C9 10.3806 9.06786 10.9277 10 11.5C10.7522 11.9618 12.6684 12.0439 13.5 12.5C14.679 13.1467 14.8497 13.8202 14.8497 14.0522C14.8497 14.6837 13.4175 15.4852 12 15.5C10.536 15.5153 9.5 14.7 9 14.0522\" stroke=\"#000000\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\n}\n\n.note-container hr {\n border: 1px solid #CCC;\n}\n\n.note-container .back-cart {\n display: flex;\n text-align: center;\n}\n\n.note-header {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n}\n\n.note-title {\n font-weight: 700;\n text-align: left;\n display: flex;\n gap: 6px;\n align-items: center;\n margin-top: 11px;\n color: #000;\n}\n\n.note-description {\n font-family: Arial;\n color: #6d6d5f;\n padding: 0;\n margin: 0 auto;\n}\n\n.back-cart {\n font-size: .9em;\n color: #27272A;\n text-decoration: none;\n cursor: pointer;\n margin-top: 11px;\n}\n\n.note-description-2 {\n color: var(--crm-scheme-fg-main-inverse, #262626);\n font-family: Roboto;\n font-size: var(--crm-font-size-body-lg, 16px);\n font-style: normal;\n font-weight: var(--crm-font-weight-body-bold, 400);\n line-height: var(--crm-line-height-body-md, 20px);\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\n margin-top: 11px;\n color: #000;\n}\n\n.note-description-not {\n font-size: 16px;\n}","import { Component, Prop, State, h } from \"@stencil/core\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport money from '../../assets/svg/money-dollars-svgrepo-com.svg'\nimport { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @Prop({ attribute: 'cartid' }) cartId;\n @Prop({ attribute: \"storename\" }) storename;\n\n @State() url: string;\n @State() config: IInfoStore;\n\n @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\n }\n\n upadateCheckToFreteAndGetUrl() {\n\n this.config = getInfoCustomization(this.storename);\n const envios = document.getElementsByName('forma-envio');\n envios.forEach((envio: any) => {\n envio.checked = false;\n });\n\n this.url = window.location.origin;\n }\n\n handleHide() {\n const amount = localStorage.getItem(this.cartId);\n return !!amount;\n }\n\n getAmount() {\n const amount = localStorage.getItem(this.cartId);\n\n return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\n\n return (\n <div>\n <div class=\"note-container\">\n <div class=\"note-header\">\n\n <p class=\"note-title\">\n <img src={money} width={23} />\n {this.config.giftbackTitle}\n </p>\n {\n infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={60} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"],"version":3}
1
+ {"file":"crm-bonus-note.js","mappings":";;;;;;;;AAAA,MAAM,yBAAyB,GAAG,4gCAA4gC;;SCA9hC,OAAO;IAEnB,IAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACtC,OAAM;KACT;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAE7C,IAAG,CAAC,IAAI,EAAE;QACN,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QACvC,YAAY,CAAC,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAM;KACT;AACL;;ACbA,MAAM,eAAe,GAAG,i3CAAi3C,CAAC;AAC14C,2BAAe,eAAe;;MCYjBA,cAAY;;;;;;;;;wBAUQ,KAAK;;IAElC,iBAAiB;QACb,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACpC,IAAI,CAAC,SAAS,EAAE,CAAC;KACpB;IAED,4BAA4B;QAExB,IAAI,CAAC,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,QAAQ,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QACzD,MAAM,CAAC,OAAO,CAAC,CAAC,KAAU;YACtB,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;SACzB,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,MAA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,CACT,CAMH,CACJ,EACT;KACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CrmBonusNote","money","i18next"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","src/components/note/crm-bonus-note.css?tag=crm-bonus-note","src/components/note/crm-bonus-note.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\n<path d=\"M15 9.94728C14.5 9.3 13.8 8.5 12 8.5C10.2 8.5 9 9.51393 9 9.94728C9 10.3806 9.06786 10.9277 10 11.5C10.7522 11.9618 12.6684 12.0439 13.5 12.5C14.679 13.1467 14.8497 13.8202 14.8497 14.0522C14.8497 14.6837 13.4175 15.4852 12 15.5C10.536 15.5153 9.5 14.7 9 14.0522\" stroke=\"#000000\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\n}\n\n.note-container hr {\n border: 1px solid #CCC;\n}\n\n.note-container .back-cart {\n display: flex;\n text-align: center;\n}\n\n.note-header {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n}\n\n.note-title {\n font-weight: 700;\n text-align: left;\n display: flex;\n gap: 6px;\n align-items: center;\n margin-top: 11px;\n color: #000;\n}\n\n.note-description {\n font-family: Arial;\n color: #6d6d5f;\n padding: 0;\n margin: 0 auto;\n}\n\n.back-cart {\n font-size: .9em;\n color: #27272A;\n text-decoration: none;\n cursor: pointer;\n margin-top: 11px;\n}\n\n.note-description-2 {\n color: var(--crm-scheme-fg-main-inverse, #262626);\n font-family: Roboto;\n font-size: var(--crm-font-size-body-lg, 16px);\n font-style: normal;\n font-weight: var(--crm-font-weight-body-bold, 400);\n line-height: var(--crm-line-height-body-md, 20px);\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\n margin-top: 11px;\n color: #000;\n}\n\n.note-description-not {\n font-size: 16px;\n}","import { Component, Prop, State, h } from \"@stencil/core\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport money from '../../assets/svg/money-dollars-svgrepo-com.svg'\nimport { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @Prop({ attribute: 'cartid' }) cartId;\n @Prop({ attribute: \"storename\" }) storename;\n\n @State() url: string;\n @State() config: IInfoStore;\n\n @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\n }\n\n upadateCheckToFreteAndGetUrl() {\n\n this.config = getInfoCustomization(this.storename);\n const envios = document.getElementsByName('forma-envio');\n envios.forEach((envio: any) => {\n envio.checked = false;\n });\n\n this.url = window.location.origin;\n }\n\n handleHide() {\n const amount = localStorage.getItem(this.cartId);\n return !!amount;\n }\n\n getAmount() {\n const amount = localStorage.getItem(this.cartId);\n\n return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\n\n return (\n <div>\n <div class=\"note-container\">\n <div class=\"note-header\">\n\n <p class=\"note-title\">\n <img src={money} width={23} />\n {this.config.giftbackTitle}\n </p>\n {\n infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={60} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"],"version":3}
@@ -4,9 +4,9 @@ import { S as StepFormEnum } from './p-7cfea8fe.js';
4
4
  import { i as instance } from './p-e8c19a64.js';
5
5
  import { d as defineCustomElement$b } from './p-761e6cd2.js';
6
6
  import { d as defineCustomElement$a } from './p-47f9da55.js';
7
- import { d as defineCustomElement$9 } from './p-e719bd13.js';
7
+ import { d as defineCustomElement$9 } from './p-069cacf6.js';
8
8
  import { d as defineCustomElement$8 } from './p-58b97429.js';
9
- import { d as defineCustomElement$7 } from './p-ced902e8.js';
9
+ import { d as defineCustomElement$7 } from './p-a94f3e34.js';
10
10
  import { d as defineCustomElement$6 } from './p-cc1ea33f.js';
11
11
  import { d as defineCustomElement$5 } from './p-fe9c3966.js';
12
12
  import { d as defineCustomElement$4 } from './p-6c546e48.js';