(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5ec43d10"],{"36a9":function(e,t,o){},"987a":function(e,t,o){"use strict";var n=o("5530"),r=o("c7eb"),a=o("1da1"),i=(o("7db0"),o("d3b7"),o("4e82"),o("d81d"),o("4de4"),o("99af"),o("a4d3"),o("e01a"),o("2f62")),s=o("0b2a"),c=o("3d2a"),u=o("83aa"),d=o("6801"),l=o("2fa3");t["a"]=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{data:function(){return{promotionSelected:null,shouldShowPromoCodeModal:!1,isWrongCode:!1,isLoading:!1,wrongCodeMessage:"",shouldNotLoadRewards:!1}},created:function(){var t=this;return Object(a["a"])(Object(r["a"])().mark((function o(){var n;return Object(r["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(!t.shouldNotLoadRewards){o.next=2;break}return o.abrupt("return");case 2:return o.prev=2,e&&t.showPreloader(),t.isLoading=!0,o.next=7,Object(u["i"])();case 7:n=o.sent,t.updateRewards(n),o.next=14;break;case 11:o.prev=11,o.t0=o["catch"](2),console.log(o.t0);case 14:return o.prev=14,t.isLoading=!1,e&&t.hidePreloader(),o.finish(14);case 18:case"end":return o.stop()}}),o,null,[[2,11,14,18]])})))()},computed:Object(n["a"])(Object(n["a"])(Object(n["a"])({},Object(i["e"])({rewards:function(e){return e.rewards},routes:function(e){return e.routeModule.routes}})),Object(i["c"])(["getMainAccount"])),{},{USDRoute:function(){return this.routes&&this.routes.find((function(e){return"USD"===e.currency.code}))},promotionsFormatted:function(){var e=this;return null==this.rewards?[]:this.rewards.map((function(t){return Object(n["a"])(Object(n["a"])({},t),{},{available:!!t.checkData,title:e.promoTitleString(t),description:(t.rewardSnapshot.promoCode||"PREMIOREFERIDOS")+" - "+e.promoDateString(t)})})).reverse().sort((function(e,t){return e.retrievalDetails&&!t.retrievalDetails?-1:0})).sort((function(e,t){return e.available&&!t.available?-1:0}))},hasPromotions:function(){return this.promotionsFormatted&&this.promotionsFormatted.length>0},availableBalance:function(){var e;return null===(e=this.getMainAccount)||void 0===e||null===(e=e.balance)||void 0===e?void 0:e.availableBalance},errorList:function(){return{PROMOTION_NOT_FOUND:"Este código no existe. Intenta ingresar otro.",PROMOTION_NOT_ENABLED:"Este código no está disponible. Intenta ingresar otro.",PROMOTION_ONLY_FIRST_TRANSACTION:"Este código sólo está disponible para la primera transferencia.",PROMOTION_EXPIRED:"Este código está vencido. Intenta ingresar otro.",PROMOTION_ALREADY_USED:"Este código ya fue usado. Intenta ingresar otro.",PROMOTION_ALREADY_ASSIGNED:"Ya agregaste este código, ahora úsalo.",PROMOTION_USAGE_LIMIT_EXCEEDED:"Este código excedió el límite de uso. Intenta ingresar otro.",PROMOTION_USED_ANOTHER_TRANSACTION:"Este código es válido para primera transacción únicamente. Intenta ingresar otro.",PROMOTION_RECORD_TYPE_INVALID:"Este código no sirve en este producto. Puedes utilizarlo en otro producto.",PROMOTION_NOT_AVAILABLE_TO_EVERYONE:"Este código no está disponible."}}}),methods:Object(n["a"])(Object(n["a"])(Object(n["a"])({},Object(i["b"])(["showPreloader","hidePreloader","updateDataG66Alert"])),Object(i["d"])(["updateRewards"])),{},{trackSegmentEvent:l["V"],showAddPromoModal:function(){Object(s["d"])()},closePromoCodeModal:function(){this.shouldShowPromoCodeModal=!1,this.isWrongCode=!1,this.wrongCodeMessage=""},setPromotionCode:function(e){var t=this;return Object(a["a"])(Object(r["a"])().mark((function o(){var n,a,i,s,c,d,l,p,h,v;return Object(r["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return n=e.code,a=void 0===n?"":n,i=e.type,s=void 0===i?{}:i,c=e.closePromotions,d=void 0!==c&&c,o.prev=1,t.showPreloader(),t.isWrongCode=!1,t.wrongCodeMessage="",o.next=7,Object(u["j"])(a,s);case 7:return l=o.sent,o.next=10,t.updateRewards(l);case 10:t.isAvailableForThisTransaction(a)?t.$snotify.success("Cupón agregado con éxito","Éxito",{timeout:2e3,showProgressBar:!0,closeOnClick:!1,pauseOnHover:!0,position:"rightTop"}):t.$snotify.info("El cupón se agrego correctamente, pero no puedes usarlo en esta operación","Importante",{timeout:2e3,showProgressBar:!0,closeOnClick:!1,pauseOnHover:!0,position:"rightTop"}),t.closePromoCodeModal(),d&&(p=t.findPromotionByCode(a),t.$emit("close",p)),o.next=20;break;case 15:o.prev=15,o.t0=o["catch"](1),console.error(o.t0),v=t.errorList[null===o.t0||void 0===o.t0||null===(h=o.t0.response)||void 0===h||null===(h=h.data)||void 0===h?void 0:h.reason],v&&(t.isWrongCode=!0,t.wrongCodeMessage=v);case 20:return o.prev=20,t.hidePreloader(),o.finish(20);case 23:case"end":return o.stop()}}),o,null,[[1,15,20,23]])})))()},promoTitleString:function(e){var t,o,n=null===(t=e.rewardSnapshot)||void 0===t?void 0:t.feeDiscountPercentage;return n>0?100===n?"Envío gratis":"".concat(n,"% de descuento"):Object(d["a"])(this.USDRoute.currency.code).format(null===(o=e.rewardSnapshot)||void 0===o?void 0:o.amount)},promoDateString:function(e){var t=e.retrievalDetails,o=e.availableUntilMillis,n=e.availableSinceMillis,r=e.checkData,a=new Date(n)>new Date(Date.now()),i="weekDayFullStringDate";return t?"Usado el "+Object(c["b"])(t.retrievalDateMillis,i,!0):a?"Disponible desde el "+Object(c["b"])(n,i,!0):r?"Disponible hasta el "+Object(c["b"])(o,i,!0):"No disponible"},searchExchangePromoCode:function(e){var t=this;return Object(a["a"])(Object(r["a"])().mark((function o(){var n,a;return Object(r["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.prev=0,t.showPreloader(),t.isWrongCode=!1,o.next=5,Object(u["d"])();case 5:if(n=o.sent,a=n.filter((function(t){var o;return(null===(o=t.rewardSnapshot)||void 0===o||null===(o=o.promoCode)||void 0===o?void 0:o.toUpperCase())===(null===e||void 0===e?void 0:e.toUpperCase())})),!a.length){o.next=18;break}if(!a[0].checkData){o.next=13;break}return t.closePromoCodeModal(),o.abrupt("return",a[0]);case 13:return t.isWrongCode=!0,a[0].retrievalDetails?t.wrongCodeMessage="El código ingresado ya fue utilizado.":t.wrongCodeMessage="El código ingresado ya no está disponible.",o.abrupt("return",a[0]);case 16:o.next=19;break;case 18:return o.abrupt("return",!1);case 19:o.next=24;break;case 21:return o.prev=21,o.t0=o["catch"](0),o.abrupt("return",!1);case 24:return o.prev=24,t.hidePreloader(),o.finish(24);case 27:case"end":return o.stop()}}),o,null,[[0,21,24,27]])})))()},setExchangePromotionCode:function(e){var t=this;return Object(a["a"])(Object(r["a"])().mark((function o(){var n,a,i,s;return Object(r["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.prev=0,t.showPreloader(),t.isWrongCode=!1,o.next=5,Object(u["j"])(e,{recordType:"EXCHANGE"});case 5:return n=o.sent,a=n.filter((function(t){return t.rewardSnapshot.promoCode.toUpperCase()===e.toUpperCase()})),t.closePromoCodeModal(),o.abrupt("return",a.pop());case 11:return o.prev=11,o.t0=o["catch"](0),console.error(o.t0),s=t.errorList[null===o.t0||void 0===o.t0||null===(i=o.t0.response)||void 0===i||null===(i=i.data)||void 0===i?void 0:i.reason],s&&(t.isWrongCode=!0,t.wrongCodeMessage=s),o.abrupt("return",!1);case 17:return o.prev=17,t.hidePreloader(),o.finish(17);case 20:case"end":return o.stop()}}),o,null,[[0,11,17,20]])})))()},updateRewardsForCoupon:function(){var e=this;return Object(a["a"])(Object(r["a"])().mark((function t(){var o;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(u["i"])();case 2:o=t.sent,e.updateRewards(o);case 4:case"end":return t.stop()}}),t)})))()},useCoupon:function(e,t){Object(l["V"])({name:"Banner Transaction Started",origin:"banner",platform:"web",type:e});var o="";switch(e){case"RMT-P2P":o=0===this.availableBalance?"/cashin":"/account?promoCodeId=".concat(t);break;case"EXCHANGE":o="/exchange?promoCodeId=".concat(t);break;case"P2P":o="/p2p?promoCodeId=".concat(t);break;default:o="/transfer?promoCodeId=".concat(t);break}this.$router.push(o)},descriptionByCouponType:function(e){var t,o,n="";switch(null===e||void 0===e||null===(t=e.recordType)||void 0===t?void 0:t.codeType){case"RMT-P2P":n="Remesa - Transferencia a Cuenta Global";break;case"EXCHANGE":n="Conversión";break;case"P2P":n="Transferencia a Cuenta Global";break;default:n="Remesa";break}return"".concat(null!==e&&void 0!==e&&null!==(o=e.recordType)&&void 0!==o&&o.codeType?"Cupón para":"Lo puedes usar en una",": ").concat(n)},handleCoupon:function(e){var t=this;return Object(a["a"])(Object(r["a"])().mark((function o(){var n,a;return Object(r["a"])().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if("TO_CLAIM"!==e.rewardStatus||null===e.recordType||"REFERRED"===e.rewardSnapshot.type){o.next=20;break}return o.prev=1,t.isLoading=!0,o.next=5,Object(u["k"])(e.rewardSnapshot.promoCode);case 5:return o.next=7,t.updateRewardsForCoupon();case 7:t.updateDataG66Alert({show:!0,message:"¡Cupón canjeado correctamente!",type:"Success"}),t.$emit("code-emitted",null===e||void 0===e||null===(n=e.rewardSnapshot)||void 0===n?void 0:n.promoCode),setTimeout((function(){t.updateDataG66Alert({show:!1})}),3e3),o.next=15;break;case 12:o.prev=12,o.t0=o["catch"](1),console.log(o.t0);case 15:return o.prev=15,t.isLoading=!1,o.finish(15);case 18:o.next=21;break;case 20:t.useCoupon(null===e||void 0===e||null===(a=e.recordType)||void 0===a?void 0:a.codeType,null===e||void 0===e?void 0:e.id);case 21:case"end":return o.stop()}}),o,null,[[1,12,15,18]])})))()},checkPromotion:function(e){var t=this.findPromotionByCode(e);t?this.$emit("close",t):this.setPromotionCode({code:e,closePromotions:!0})},findPromotionByCode:function(e){return this.promotionsFiltered.find((function(t){return t.rewardSnapshot.description.toUpperCase()===e.toUpperCase()}))},isAvailableForThisTransaction:function(e){var t,o,n,r=Object(l["k"])({rewards:this.promotionsFormatted,movementType:this.filterBy,originRouteId:null===(t=this.promotionsFilterObject)||void 0===t?void 0:t.originRouteId,destinationRouteId:null===(o=this.promotionsFilterObject)||void 0===o?void 0:o.destinationRouteId,originAmountInUsd:null===(n=this.promotionsFilterObject)||void 0===n?void 0:n.originAmountUsd});return r.find((function(t){return t.rewardSnapshot.description.toUpperCase()===e.toUpperCase()}))}})}}},c287:function(e,t,o){"use strict";o("d00c")},d00c:function(e,t,o){},d332:function(e,t,o){"use strict";var n=function(){var e=this,t=e._self._c;return e.showCarouselList?t("div",{staticClass:"coupon-container-base"},[e.promotionsFormatted.length>0?t("g-carousel",{ref:"carousel",staticClass:"coupon-container-item",attrs:{circular:"","limit-pages":"","auto-resize":"","enable-arrows":"","bullet-classes":"my-6"}},e._l(e.coupons,(function(o,n){return t("coupon-item-banner",{key:n,attrs:{coupon:o,showNavigation:e.coupons.length>1,emitCodeForCouponList:e.emitCodeForCouponList},on:{changePage:e.changePage,"code-emitted":function(t){return e.$emit("code-emitted",t)}}})})),1):e._e(),0===e.promotionsFormatted.length&&e.showMainSlide?t("coupon-item-banner",{attrs:{coupon:e.mainCouponInfo}}):e._e()],1):e._e()},r=[],a=o("2909"),i=(o("99af"),o("4de4"),o("d3b7"),o("ac1f"),o("466d"),o("a4d3"),o("e01a"),function(){var e=this,t=e._self._c;return t("div",{staticClass:"coupon-card"},[t("div",{staticClass:"coupon-card__content"},[t("div",{staticClass:"relative"},[t("img",{staticClass:"mb-2",attrs:{src:e.icon}}),!e.isMainSlide&&e.coupon.recordType?t("span",{staticClass:"coupon-card__text-coin"},[e._v("$"+e._s(e.coupon.rewardSnapshot.amount))]):e._e()]),t("span",{staticClass:"max-w-250px truncate"},[t("span",{staticClass:"font-bold text-18 whitespace-pre-wrap text-white mb-2"},[e._v(e._s(e.title))])]),t("span",{staticClass:"font-medium text-14 whitespace-pre-wrap text-white px-10"},[e._v(e._s(e.description))])]),t("div",{staticClass:"coupon-card__separator"},[t("span",{staticClass:"coupon-card__separator-prev",class:{active:e.showNavigation},on:{click:function(t){return e.changePage(!0)}}},[t("i",{staticClass:"fas fa-chevron-left"})]),t("span",{staticClass:"coupon-card__separator-next",class:{active:e.showNavigation},on:{click:function(t){return e.changePage(!1)}}},[t("i",{staticClass:"fas fa-chevron-right"})])]),t("div",{staticClass:"coupon-card__footer"},[t("g-button",{staticClass:"w-40",attrs:{color:"accent"},on:{click:e.setAction}},[e._v(" "+e._s(e.isLoading?"Canjeando...":e.btnText)+" ")])],1),t("div",{staticClass:"coupon-card__bg"})])}),s=[],c=o("c7eb"),u=o("1da1"),d=o("987a"),l=o("2fa3"),p={name:"CouponItemBanner",mixins:[Object(d["a"])(!1)],props:{coupon:{type:Object,required:!0},emitCodeForCouponList:{type:Boolean,default:!1},showNavigation:{type:Boolean,default:!1}},data:function(){return{shouldNotLoadRewards:!0}},computed:{isMainSlide:function(){return this.coupon.main},title:function(){var e;return this.isMainSlide?this.coupon.title:null!==(e=this.coupon)&&void 0!==e&&null!==(e=e.recordType)&&void 0!==e&&e.codeType?this.coupon.rewardSnapshot.description:"Premio por referido"},description:function(){return this.isMainSlide?this.coupon.description:this.descriptionByCouponType(this.coupon)},icon:function(){var e;return this.isMainSlide||null===(e=this.coupon)||void 0===e||null===(e=e.recordType)||void 0===e||!e.codeType?o("ba67"):o("6f89")},btnText:function(){return this.isMainSlide?"Ver":"TO_CLAIM"===this.coupon.rewardStatus&&null!==this.coupon.recordType&&"REFERRED"!==this.coupon.rewardSnapshot.type?"Canjear":"Aplicar"}},methods:{goToPromotions:function(){Object(l["V"])({name:"AYC - Referral Page Visited",origin:"banner",platform:"web",productName:"growth"}),this.$router.push("/promotions")},setAction:function(){var e=this;return Object(u["a"])(Object(c["a"])().mark((function t(){var o;return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(o={MAIN:function(){return e.goToPromotions()},EMIT_COUPON:function(){var t;return e.$emit("code-emitted",null===(t=e.coupon)||void 0===t||null===(t=t.rewardSnapshot)||void 0===t?void 0:t.promoCode)},HANDLE_COUPON:function(){return e.handleCoupon(e.coupon)}},!e.isMainSlide){t.next=3;break}return t.abrupt("return",o["MAIN"]());case 3:if(!e.emitCodeForCouponList){t.next=5;break}return t.abrupt("return","TO_CLAIM"===e.coupon.rewardStatus?o["HANDLE_COUPON"]():o["EMIT_COUPON"]());case 5:return t.abrupt("return",o["HANDLE_COUPON"]());case 6:case"end":return t.stop()}}),t)})))()},changePage:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.showNavigation&&this.$emit("changePage",e)}}},h=p,v=(o("c287"),o("2877")),f=Object(v["a"])(h,i,s,!1,null,null,null),m=f.exports,b={name:"CouponListBanner",mixins:[Object(d["a"])()],components:{CouponItemBanner:m},props:{showMainSlide:{type:Boolean,default:!0},emitCodeForCouponList:{type:Boolean,default:!1},filterBy:{type:String,default:""},showOnlyByReclaim:{type:Boolean,default:!1},promotionsFilterObject:{type:Object,default:null,validator:function(e){return e.originRouteId&&e.destinationRouteId&&e.originAmountUsd}}},data:function(){return{shouldNotLoadRewards:!0}},watch:{coupons:{immediate:!0,handler:function(e){this.$emit("has-empty-coupons",e.length<=this.showMainSlide?1:0)}}},computed:{mainCouponInfo:function(){return{title:"¡Con Global66 tienes beneficios y cupones!",description:"Ingresa aquí y descúbrelos.",main:!0}},coupons:function(){var e=[];return this.showMainSlide&&e.push(this.mainCouponInfo),[].concat(e,Object(a["a"])(this.showOnlyByReclaim?this.rewardsFilteredByStatus:this.rewardsFilteredByDefault))},rewardsFilteredByDefault:function(){var e=this;return this.promotionsFormatted.filter((function(t){var o=t.checkData,n=t.recordType,r=t.rewardSnapshot;return o&&null!==n&&"REFERRED"!==r.type&&n.codeType.match(e.filterBy)}))},rewardsFilteredByStatus:function(){var e=this;return[].concat(Object(a["a"])(this.promotionsFormatted.filter((function(t){var o=t.checkData,n=t.recordType,r=t.rewardSnapshot,a=t.rewardStatus;return o&&null!==n&&"REFERRED"!==r.type&&n.codeType.match(e.filterBy)&&"TO_CLAIM"===a}))),Object(a["a"])(Object(l["k"])({rewards:this.promotionsFormatted,movementType:this.filterBy,originRouteId:this.promotionsFilterObject.originRouteId,destinationRouteId:this.promotionsFilterObject.destinationRouteId,originAmountInUsd:this.promotionsFilterObject.originAmountUsd})))},showCarouselList:function(){return this.promotionsFormatted.length>0||0===this.promotionsFormatted.length&&this.showMainSlide}},methods:{changePage:function(e){var t=this.$refs.carousel;e?null===t||void 0===t||t.changePage({index:(null===t||void 0===t?void 0:t.activePage)-1,enableArrows:!0,toLeft:e}):null===t||void 0===t||t.changePage({index:(null===t||void 0===t?void 0:t.activePage)+1,enableArrows:!0})}}},g=b,O=(o("d66b"),Object(v["a"])(g,n,r,!1,null,null,null));t["a"]=O.exports},d66b:function(e,t,o){"use strict";o("36a9")}}]);