!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ShippingFeeInfoService=t():(e.ShopeeLib=e.ShopeeLib||{},e.ShopeeLib.ShippingFeeInfoService=t())}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=16)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupBy=function(e,t){for(var n={},r=0;r<e.length;r++){var o=e[r],i=t(o);void 0!==i&&(n[i]||(n[i]=[]),n[i].push(o))}return n},t.unsafeTranslate=function(e){return function(t,n){return e(t,Object.assign({},n,{interpolation:{escapeValue:!1}}))}},t.highlight=function(e,t,n){var r=a(t);if(e.isReactNative||e.isReact)return'<View style="font-size: 14px; color: #ff5722;">'+r+"</View>";var o=o||"pl-c-primary";return'<span class="'+o+'">'+r+"</span>"},t.highlightBlack=function(e){return'<View style="font-size: 14px; color: #000;">'+a(e)+"</View>"},t.formatCurrencyWrapper=function(e,t,n){return e.hideUnnecessaryDecimalPlacesInAmount&&n%i.DB_PRICE_INFLATION_FACTOR==0?(0,r.formatCurrencyWithPrecision)(t,0,n):(0,o.default)(t,n)},t.deepCopy=function(e){return JSON.parse(JSON.stringify(e))};var r=n(19),o=function(e){return e&&e.__esModule?e:{default:e}}(r),i=n(1);function a(e){return(""+e).replace(/[&<>"'\/]/g,function(e){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}[e]})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LogisticPromotionRuleDiscountRuleFlag={REQUIRE_MIN_ORDER_TOTAL:16,REQUIRE_BUYER_LOCATION:32,REQUIRE_SELLER_LOCATION:64,HIDE_PROMOTION_RULE_FROM_DISPLAY:256,HIDE_PROMOTION_RULE_FROM_DISCOUNT_STRING_ONLY:512},t.LogisticPromotionRuleDiscountFlag={PERCENTAGE:1,FLAT_RATE:2,CAPPED:4,PERCENTAGE_WITH_CAP:8,ROUND_UP_DISCOUNTED_AMOUNT:65536,ROUND_DOWN_DISCOUNTED_AMOUNT:1<<17},t.LogisticPromotionRuleDiscountFlagComparisonModifier=65535,t.DB_PRICE_INFLATION_FACTOR=1e5,t.FEE_RANGE_SEPARATOR=" - ",t.LIST_SEPARATOR={ID:" / ",TW:"、",en:", ",zhHant:"、"},t.PHRASE_SEPARATOR={ID:" / ",TW:"; ",en:", ",zhHant:"; "},t.SENTENCE_SEPARATOR={ID:", ",TW:"，",en:", ",zhHant:"，"},t.DISCOUNT_DELTA_TYPE={DELTA_PERCENTAGE:1,DELTA_CAPPED:2,DELTA_FLAT_RATE:3,DISCOUNTED_AMOUNT:4,FREE_SHIPPING:5,DELTA_PERCENTAGE_WITH_CAP:6,QUALIFIED_FOR_SHIPPING_SUBSIDY:100},t.SHIPPING_PROMOTION_PAYMENT_TYPE={NORMAL:0,SHOPEE_PAY:1},t.DISCOUNT_DETAIL_TAG_TYPE={NORMAL:0,SHOPEE_PAY:1},t.DISCOUNT_RULE_VARS_CALLER={DEFAULT:-1,DISCOUNT_STRING:2,DISCOUNT_HINT:4,CART_DISCOUNT_STRING:6,DETAILED_CART_DISCOUNT_INFO:8,DISCOUNT_PROMPT:10,GREEN_TRUCK_DISCOUNT_STRING:11,CHANNEL_SHIPPING_FEE_DISPLAY_DATA:12},t.ICON_HELP_MARKER="<IconHelp>",t.BREAK_LINE_MARKER="\n",t.COUNTRY={TW:"TW"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyFilters=function(e,t,n){for(var r=void 0,o=0;o<n.length;o++)r=n[o],e=e.filter(function(e){for(var n=0;n<r.length;n++)if((0,r[n])(e,t))return!0;return!1});return e},t.isChannelSupported=function(e,t){return Object.keys(e.channels).indexOf(""+t.channelid)>=0},t.isShopSupported=function(e,t){return Object.keys(e.channels).filter(function(e){return-1!=Object.keys(t.shopEnabledChannelsData).indexOf(e)}).length>0},t.isRuleShownForAll=function(e,t){return!(e.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.HIDE_PROMOTION_RULE_FROM_DISPLAY)},t.isLocationGroupSupported=function(e,t){var n=t.shopEnabledChannelsData,o=(e.extra_data.buyer_location_group_id,Object.keys(e.channels).filter(function(e){return Object.keys(n).indexOf(e)>=0}));if(o.length<=0)return!1;var i=(e.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.REQUIRE_BUYER_LOCATION)>0,a=(e.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.REQUIRE_SELLER_LOCATION)>0;return!(i&&!function(e,t,n){for(var r=0;r<e.length;r++){var o=e[r],i=t[o].buyerLocationGroupIds||[];if(i.indexOf(n.extra_data.buyer_location_group_id)<0)return!1}return!0}(o,n,e)||a&&!function(e,t,n){for(var r=0;r<e.length;r++){var o=e[r],i=t[o].sellerLocationGroupIds||[];if(i.indexOf(n.extra_data.seller_location_group_id)<0)return!1}return!0}(o,n,e))},t.isCapPromotion=function(e,t){return!!e&&e.discount_flag&r.LogisticPromotionRuleDiscountFlag.CAPPED},t.isFreeShippingPromotion=s,t.isShopeePromotion=function(e,t){return!!e&&0===e.shopId},t.isSellerPromotion=function(e,t){return!!e&&e.shopId>0},t.isSellerFreeShippingPromotion=function(e,t){return!!e&&e.shopid>0&&s(e,t)},t.isRuleShownGreenTruck=function(e,t){return!(!e||e.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.HIDE_PROMOTION_RULE_FROM_DISCOUNT_STRING_ONLY)},t.isFreeShippingDiscountRuleVar=function(e,t){return!!e&&e.deltaType===r.DISCOUNT_DELTA_TYPE.FREE_SHIPPING},t.isFlatRateFreeShippingDiscountRuleVar=function(e,t){return!!e&&e.deltaType===r.DISCOUNT_DELTA_TYPE.FREE_SHIPPING&&(e.ruleFlag&r.LogisticPromotionRuleDiscountFlag.FLAT_RATE)>0},t.isCapDiscountRuleVar=function(e,t){return!!e&&(e.ruleFlag&r.LogisticPromotionRuleDiscountFlag.CAPPED)>0},t.isFlatRateDiscountRuleVar=function(e,t){return!!e&&e.ruleFlag===r.LogisticPromotionRuleDiscountFlag.FLAT_RATE},t.isPercentageWithCapDiscountRuleVar=function(e,t){return!!e&&e.ruleFlag===r.LogisticPromotionRuleDiscountFlag.PERCENTAGE_WITH_CAP},t.isPercentageDiscountRuleVar=function(e,t){return!!e&&e.ruleFlag===r.LogisticPromotionRuleDiscountFlag.PERCENTAGE},t.isDiscountRuleVarMBSApplicable=function(e,t){if(!e)return!1;var n=e.minOrderTotal||0;return t.orderTotal>=n},t.getSuperiorPromotionRules=function(e){var t=null;t=e.caller===r.DISCOUNT_RULE_VARS_CALLER.DETAILED_CART_DISCOUNT_INFO||e.caller===r.DISCOUNT_RULE_VARS_CALLER.CART_DISCOUNT_STRING?e.countryCode!=r.COUNTRY.TW?u.CapChannelSuperiorRuleManager:a.DiscountedChannelFeeSuperiorManager:e.countryCode!=r.COUNTRY.TW?o.CapSuperiorRuleManager:i.DiscountedFeeSuperiorRuleManager;return new t(e.promotionRules).process()};var r=n(1),o=n(11),i=n(13),a=n(22),u=n(23);function s(e,t){return!!e&&(e.discount_flag&r.LogisticPromotionRuleDiscountFlag.FLAT_RATE&&0===e.discount_delta)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDiscountRuleVarsComparisonKey=function(e,t,n){var o=[];(e&=r.LogisticPromotionRuleDiscountFlagComparisonModifier)&r.DISCOUNT_DELTA_TYPE.FREE_SHIPPING||e&r.DISCOUNT_DELTA_TYPE.QUALIFIED_FOR_SHIPPING_SUBSIDY?o.push(e,0):o.push(e,t);void 0!==n&&o.push(n);return o.toString()},t.isSameDeltaType=function(e,t,n,o){if((e&r.LogisticPromotionRuleDiscountFlagComparisonModifier)!=(n&r.LogisticPromotionRuleDiscountFlagComparisonModifier))return!1;return!!(e&r.DISCOUNT_DELTA_TYPE.FREE_SHIPPING||e&r.DISCOUNT_DELTA_TYPE.QUALIFIED_FOR_SHIPPING_SUBSIDY)||t===o},t.calculateDiscountedFee=a,t.getEstimatedShippingFee=u,t.getMostAttractiveRule=function(e,t){var n=void 0;return e.forEach(function(e){(null==n||n.discountedFee>e.discountedFee||n.discountedFee===e.discountedFee&&n.minOrderTotal>e.minOrderTotal)&&(n=e)}),n},t.getDiscountRuleVars=function(e,t,n,o,i){for(var s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:-1,c=void 0,p=void 0,f=void 0,_=!1,y=[],h=0;h<i.length;h++){var d=i[h],g=o[d];y.push(u(t,d,g))}var m=Math.min.apply(Math,y),R=a(n,m);if(e.showDiscountedFee)c=0===(p=R)?r.DISCOUNT_DELTA_TYPE.FREE_SHIPPING:r.DISCOUNT_DELTA_TYPE.DISCOUNTED_AMOUNT;else if(e.showFreeShippingInsteadOfDelta)c=r.DISCOUNT_DELTA_TYPE.FREE_SHIPPING,p=0;else if(e.showFreeShippingInsteadOfDeltaForCap&&n.discount_flag&r.LogisticPromotionRuleDiscountFlag.CAPPED)c=r.DISCOUNT_DELTA_TYPE.FREE_SHIPPING,p=0;else{p=n.discount_delta;var P=l!==r.DISCOUNT_RULE_VARS_CALLER.DETAILED_CART_DISCOUNT_INFO&&l!==r.DISCOUNT_RULE_VARS_CALLER.CART_DISCOUNT_STRING,b=0==R,O=P&&s&&e.showFreeShippingForDeltaIfFree__crossBorder&&!(e.doNotShowFreeShippingForDiscountStringIfNoTiersMet__crossBorder&&m===R)&&b,D=P&&b&&!s,T=n.discount_flag&r.LogisticPromotionRuleDiscountFlag.FLAT_RATE&&0===n.discount_delta,S=l===r.DISCOUNT_RULE_VARS_CALLER.DISCOUNT_STRING&&e.showFreeShippingInsteadOfDeltaForCapForDiscountStringOnly,v=O||D||S||T;v?c=r.DISCOUNT_DELTA_TYPE.FREE_SHIPPING:n.discount_flag&r.LogisticPromotionRuleDiscountFlag.PERCENTAGE?c=r.DISCOUNT_DELTA_TYPE.DELTA_PERCENTAGE:n.discount_flag&r.LogisticPromotionRuleDiscountFlag.CAPPED?c=r.DISCOUNT_DELTA_TYPE.DELTA_CAPPED:n.discount_flag&r.LogisticPromotionRuleDiscountFlag.FLAT_RATE?c=r.DISCOUNT_DELTA_TYPE.DELTA_FLAT_RATE:n.discount_flag&r.LogisticPromotionRuleDiscountFlag.PERCENTAGE_WITH_CAP&&(c=r.DISCOUNT_DELTA_TYPE.DELTA_PERCENTAGE_WITH_CAP)}n.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.REQUIRE_MIN_ORDER_TOTAL&&(f=n.extra_data.min_order_total);n.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.REQUIRE_BUYER_LOCATION&&(_=!0);return{paymentType:n.extra_data.payment_type,deltaType:c,delta:p,minOrderTotal:f||0,channelids:i,extra:n.extra_data,priority:n.priority,discountedFee:R,requireBuyerLocation:_,shopId:n.shopid,ruleFlag:n.discount_flag,promotionId:n.id}},t.getDetailInfoTagTypeByPaymentType=function(e){var t;return(t={},i(t,r.SHIPPING_PROMOTION_PAYMENT_TYPE.NORMAL,r.DISCOUNT_DETAIL_TAG_TYPE.NORMAL),i(t,r.SHIPPING_PROMOTION_PAYMENT_TYPE.SHOPEE_PAY,r.DISCOUNT_DETAIL_TAG_TYPE.SHOPEE_PAY),t)[e]||r.DISCOUNT_DETAIL_TAG_TYPE.NORMAL},t.hasFreeShippingDiscountRuleVars=function(e){return e.some(function(e){return 0===e.discountedFee})},t.generateDiscountDeltaPhrase=function(e,t,n,i,a){var u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=void 0,c=e.highlightPromotionFees?(0,o.unsafeTranslate)(n):n,p=e.highlightPromotionFees?function(e,t,n){return(0,o.highlight)(e,(0,o.formatCurrencyWrapper)(e,t,n))}:o.formatCurrencyWrapper;switch(i){case r.DISCOUNT_DELTA_TYPE.DELTA_PERCENTAGE:l=c("msg_promotion__delta__percentage",{delta:e.highlightPromotionFees?(0,o.highlight)(e,a):a});break;case r.DISCOUNT_DELTA_TYPE.DELTA_CAPPED:if(s===r.DISCOUNT_RULE_VARS_CALLER.DETAILED_CART_DISCOUNT_INFO)l=p(e,t,a);else{var f=e.showCappedDeltaWithUpTo?"msg_promotion__delta__capped__up_to":"msg_promotion__delta__capped";l=c(f,{delta:p(e,t,a)})}break;case r.DISCOUNT_DELTA_TYPE.DELTA_FLAT_RATE:l=c("msg_promotion__delta__flat_rate",{delta:p(e,t,a)});break;case r.DISCOUNT_DELTA_TYPE.FREE_SHIPPING:l=c("msg_promotion__delta__free_shipping"),l=e.highlightPromotionFees?(0,o.highlight)(e,l):l;break;case r.DISCOUNT_DELTA_TYPE.DISCOUNTED_AMOUNT:l=c("msg_promotion__delta__discounted_amount",{delta:p(e,t,a)});break;case r.DISCOUNT_DELTA_TYPE.DELTA_PERCENTAGE_WITH_CAP:var _=s===r.DISCOUNT_RULE_VARS_CALLER.DISCOUNT_STRING&&e.hideCapForPercentageWithCapForDiscountString||s===r.DISCOUNT_RULE_VARS_CALLER.DISCOUNT_HINT&&e.hideCapForPercentageWithCapForDiscountHint||s===r.DISCOUNT_RULE_VARS_CALLER.CART_DISCOUNT_STRING&&e.hideCapForPercentageWithCapForCartDiscountString?"msg_promotion__delta__percentage":"msg_promotion__delta__percentage_with_cap";l=c(_,{delta:a,cap:p(e,t,u.percentage_discount_cap)});break;case r.DISCOUNT_DELTA_TYPE.QUALIFIED_FOR_SHIPPING_SUBSIDY:l=c("msg_promotion__delta__qualified_for_shipping_subsidy");break;default:l=""}return l},t.generateHighlightedDeltaPhrase=function(e,t,n,i,a){arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6];var u="",s=e.highlightPromotionFees?(0,o.unsafeTranslate)(n):n;switch(i){case r.DISCOUNT_DELTA_TYPE.DELTA_PERCENTAGE_WITH_CAP:case r.DISCOUNT_DELTA_TYPE.DELTA_PERCENTAGE:u=s("msg_promotion__delta__percentage_off",{delta:a});break;case r.DISCOUNT_DELTA_TYPE.DELTA_CAPPED:u=s("msg_promotion__delta__off",{delta:(0,o.formatCurrencyWrapper)(e,t,a)});break;case r.DISCOUNT_DELTA_TYPE.DELTA_FLAT_RATE:u=s("msg_promotion__delta__flat_rate_off",{delta:(0,o.formatCurrencyWrapper)(e,t,a)});break;case r.DISCOUNT_DELTA_TYPE.FREE_SHIPPING:u=s("msg_promotion__delta__free_shipping");break;default:u=""}return(0,o.highlight)(e,u,"")},t.filterPromotionRules=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=[];n=n||[],o=o||[];for(var u=0;u<e.length;u++){var s=e[u];Object.keys(s.channels).indexOf(""+t)<0||(s.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.REQUIRE_BUYER_LOCATION&&n.indexOf(s.extra_data.buyer_location_group_id)<0&&!i||s.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.REQUIRE_SELLER_LOCATION&&o.indexOf(s.extra_data.seller_location_group_id)<0||a.push(s))}return a},t.filterPromotionRulesByShopEnabledChannelsData=function(e,t,n){for(var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],a=0;a<e.length;a++){var u=e[a];if((void 0===n||n(u))&&(!(u.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.HIDE_PROMOTION_RULE_FROM_DISPLAY)&&(u.affectedChannelIds=Object.keys(u.channels).filter(function(e){return-1!=Object.keys(t).indexOf(e)}),0!==u.affectedChannelIds.length))){if(u.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.REQUIRE_BUYER_LOCATION){for(var s=!1,l=0;l<u.affectedChannelIds.length;l++){var c=u.affectedChannelIds[l],p=t[c].buyerLocationGroupIds||[];if(p.indexOf(u.extra_data.buyer_location_group_id)<0&&!o){s=!0;break}}if(s)continue}if(u.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.REQUIRE_SELLER_LOCATION){for(var f=!1,_=0;_<u.affectedChannelIds.length;_++){var y=u.affectedChannelIds[_],h=t[y].sellerLocationGroupIds||[];if(h.indexOf(u.extra_data.seller_location_group_id)<0){f=!0;break}}if(f)continue}i.push(u)}}return i},t.makeInfiniteDeltaForFreeShippingPromotion=function(e){var t=(0,o.deepCopy)(e);return t.filter(function(e){return e.deltaType===r.DISCOUNT_DELTA_TYPE.FREE_SHIPPING}).forEach(function(e){return e.delta=Number.MAX_SAFE_INTEGER}),t};var r=n(1),o=n(0);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=t;if(e.discount_flag&r.LogisticPromotionRuleDiscountFlag.PERCENTAGE?n=t*(100-e.discount_delta)/100:e.discount_flag&r.LogisticPromotionRuleDiscountFlag.FLAT_RATE?n=e.discount_delta:e.discount_flag&r.LogisticPromotionRuleDiscountFlag.CAPPED?n=t-Math.min(t,e.discount_delta):e.discount_flag&r.LogisticPromotionRuleDiscountFlag.PERCENTAGE_WITH_CAP&&(n=t-Math.min(t*e.discount_delta/100,e.extra_data.percentage_discount_cap)),e.discount_flag&r.LogisticPromotionRuleDiscountFlag.ROUND_UP_DISCOUNTED_AMOUNT){var o=e.extra_data.discount_rounding_factor,i=n%o;i&&(n+=o-i)}else if(e.discount_flag&r.LogisticPromotionRuleDiscountFlag.ROUND_DOWN_DISCOUNTED_AMOUNT){var a=n%e.extra_data.discount_rounding_factor;a&&(n-=a)}return n}function u(e,t,n){return void 0!==n.estimatedShippingFee?n.estimatedShippingFee:e[t]?e[t].minimum_cost:0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChannelDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(8),i=n(2),a=n(0),u=n(9);t.ChannelDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_RULE_PHRASE_MBS_PROMOTION=null,i.TRANSIFY_RULESET_CAPPED_PROMOTION="msg_promotion__ruleset__simple",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.BaseDisplay),r(t,[{key:"getHintGenerator",value:function(){return this.processChannelHint}},{key:"processChannelHint",value:function(e){var t=e.preprocessedPromotions,n=this.generateFreeShippingInfo(e),r=this.generateHighestMbsInfo(e),o=this.generateAnyPromotionInfo(e);return n.anyFreeShipping?t=n.discountRuleVars:r.meetsHighestMbs?t=r.discountRuleVars:o.meetsAnyPromotion&&(t=o.discountRuleVars),this.getRuleHints((0,u.sortPromotionRulesByMbs)(t))}},{key:"generateFreeShippingInfo",value:function(e){var t=e.preprocessedPromotions,n=e.orderTotal;return{anyFreeShipping:t.some(function(e){return(0,i.isFreeShippingDiscountRuleVar)(e)&&n>=e.minOrderTotal}),discountRuleVars:[]}}},{key:"generateHighestMbsInfo",value:function(e){var t=e.preprocessedPromotions,n=e.orderTotal,r=Math.max.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t.map(function(e){return e.minOrderTotal})));return{meetsHighestMbs:n>=r,discountRuleVars:t.filter(function(e){return e.minOrderTotal===r})}}},{key:"generateAnyPromotionInfo",value:function(e){var t=e.preprocessedPromotions,n=e.orderTotal,r=t.filter(function(t){return t.promotionId===e.discountPromotionRuleId}),o=t.filter(function(e){return n<e.minOrderTotal}),i=r.concat(o);return{meetsAnyPromotion:i.length>0,discountRuleVars:i}}},{key:"getRuleHints",value:function(e){var t=this;return e.map(function(e){return{rulesetData:t.getRuleSetData(e),rulePhraseData:t.getRulePhraseData(e)}})}},{key:"getRuleSetData",value:function(e){var t=(0,i.isPercentageWithCapDiscountRuleVar)(e,null)?e.extra.percentage_discount_cap:e.delta,n=(0,a.formatCurrencyWrapper)(this.config,this.countryCode,t),r=(0,i.isPercentageWithCapDiscountRuleVar)(e,null)||(0,i.isCapDiscountRuleVar)(e,null)?this.TRANSIFY_RULESET_CAPPED_PROMOTION:"msg_promotion__ruleset__simple",o={delta:n};return{transifyKey:r=this.getCountrySpecificTransifyKey(r),transifyData:o}}},{key:"getRulePhraseData",value:function(e){var t=(0,a.formatCurrencyWrapper)(this.config,this.countryCode,e.minOrderTotal),n={minOrderTotal:(0,a.highlightBlack)(t)};return[{discountRuleVar:e,transifyKey:this.TRANSIFY_RULE_PHRASE_MBS_PROMOTION,transifyData:n}]}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChannelShippingFeeDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(8),i=n(0),a=n(1),u=n(2);t.ChannelShippingFeeDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.SHOW_FREE_SHIPPING_TEXT=!1,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.BaseDisplay),r(t,[{key:"getMinimumDiscountedShippingFee",value:function(e){var t=e.map(function(e){return e.discountedFee});return Math.min.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))}},{key:"getMbsFilteredDiscountRuleVars",value:function(e,t){return e.filter(function(e){return(0,u.isDiscountRuleVarMBSApplicable)(e,{orderTotal:t})})}},{key:"generateShippingFeeNoPriceRange",value:function(e,t,n){var r=this.getMbsFilteredDiscountRuleVars(t,n),o=e.estimatedShippingFee,i=e.discountedShippingFee,a=this.getMinimumDiscountedShippingFee(r);return this.isAnyRuleApplied(a,i,o)?this.getCrossPriceEstimatedShippingFee(a,o,i):this.getPlainEstimatedShippingFee(o)}},{key:"generateShippingFeeWithPriceRange",value:function(e,t,n){var r=this.getMbsFilteredDiscountRuleVars(t,n),o=e.estimatedShippingFee,i=this.getMinimumDiscountedShippingFee(r),a=this.getMinimumDiscountedShippingFee(t),u=e.discountedShippingFee;return this.isLowestDiscountedFeeApplied(a,u)?this.getCrossPriceEstimatedShippingFee(a,o,u):this.isAnyRuleApplied(i,u,o)?this.getPriceRangeCrossEstimatedShippingFee(a,u,o):t.length>0?this.getPriceRangeEstimatedShippingFee(a,o):this.getPlainEstimatedShippingFee(o)}},{key:"isLowestDiscountedFeeApplied",value:function(e,t){return e===t}},{key:"isAnyRuleApplied",value:function(e,t,n){return e<=t&&t<n}},{key:"getPlainEstimatedShippingFee",value:function(e){return{estimatedShippingFeeString:this.getPossibleFreeShipping(e),possibleShippingFees:[e]}}},{key:"getPriceRangeCrossEstimatedShippingFee",value:function(e,t,n){var r=this.getPossibleFreeShipping(e),o=this.getPossibleFreeShipping(t),i=this.getPossibleFreeShipping(n);return{discountedShippingFeeString:[r,o].join(a.FEE_RANGE_SEPARATOR),possibleShippingFees:[e,t],estimatedShippingFeeString:i}}},{key:"getPriceRangeEstimatedShippingFee",value:function(e,t){return{discountedShippingFeeString:"",possibleShippingFees:[e,t],estimatedShippingFeeString:[this.getPossibleFreeShipping(e),this.getPossibleFreeShipping(t)].join(a.FEE_RANGE_SEPARATOR)}}},{key:"getCrossPriceEstimatedShippingFee",value:function(e,t,n){var r=e===n?[n]:[n,e],o=this.getPossibleFreeShipping(n);return{estimatedShippingFeeString:this.getPossibleFreeShipping(t),discountedShippingFeeString:o,possibleShippingFees:r}}},{key:"getPossibleFreeShipping",value:function(e){return 0===e&&this.SHOW_FREE_SHIPPING_TEXT?this.trans("label_free_shipping_cap"):(0,i.formatCurrencyWrapper)(this.config,this.countryCode,e)}},{key:"generateResultOfEmptyPreprocessedPromotions",value:function(e,t){return{estimatedShippingFeeString:this.getPossibleFreeShipping(t.estimatedShippingFee),possibleShippingFees:[t.estimatedShippingFee]}}},{key:"generateEarlyStopResult",value:function(e,t){return{estimatedShippingFeeString:this.getPossibleFreeShipping(t.estimatedShippingFee),possibleShippingFees:[t.estimatedShippingFee]}}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProductDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(8),i=n(0),a=n(2);t.ProductDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_FS_WITH_MBS=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.BaseDisplay),r(t,[{key:"getPromotionRulesFilters",value:function(){return[[a.isChannelSupported,a.isShopSupported],[a.isLocationGroupSupported],[a.isRuleShownGreenTruck],[a.isRuleShownForAll]]}},{key:"getDiscountRuleVarsFilters",value:function(){return[[a.isFreeShippingDiscountRuleVar]]}},{key:"getHintGenerator",value:function(){return this.processGreenTruckDiscountDisplay}},{key:"processGreenTruckDiscountDisplay",value:function(e){return[{rulesetData:this.getRuleSetData(e),rulePhraseData:this.getRulePhraseData()}]}},{key:"getRuleSetData",value:function(e){var t=e.preprocessedPromotions,n=e.orderTotal,r=this.usePlainFsTransify({discountRuleVars:t,orderTotal:n})?this.getPlainFreeShippingTransify():this.getModifiedFreeShippingTransify(t);return{transifyKey:this.getCountrySpecificTransifyKey(r.transifyKey),transifyData:r.transifyData}}},{key:"usePlainFsTransify",value:function(e){return(e.discountRuleVars||[]).filter(function(e){return 0===e.minOrderTotal}).length>0}},{key:"getPlainFreeShippingTransify",value:function(){return{transifyKey:"msg_promotion__ruleset__simple",transifyData:{}}}},{key:"getModifiedFreeShippingTransify",value:function(e){var t=e.filter(function(e){return e.minOrderTotal>0}),n=(0,i.formatCurrencyWrapper)(this.config,this.countryCode,Math.min.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t.map(function(e){return e.minOrderTotal}))));return{transifyKey:this.TRANSIFY_FS_WITH_MBS,transifyData:{lowestMBS:n}}}},{key:"getRulePhraseData",value:function(){return[{discountRuleVar:{},transifyKey:"msg_promotion__rule__simple",transifyData:{useFreeShippingPhrase:!0}}]}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CartDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(8),a=n(3);function u(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}t.CartDisplay=function(e){function t(e,n,r,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o,i));return a.BREAK_LINE_MARKER="; ",a.TRANSIFY_CART="msg_promotion__rule__from_min_order_total__simple_id",a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.BaseDisplay),r(t,[{key:"getHintGenerator",value:function(){return this.processCartDiscountString}},{key:"processCartDiscountString",value:function(e){var t=e.preprocessedPromotions,n=this.getLowestMbsDiscountRuleVars(t),r=this.getBestPriorityDiscountRuleVar(this.getHighestCappedDiscountRuleVars(n));t=(0,a.makeInfiniteDeltaForFreeShippingPromotion)(t);var o=this.getHighestCappedDiscountRuleVars(t),i=this.getBestPriorityDiscountRuleVar(this.getLowestMbsDiscountRuleVars(o));return this.getRuleHints(this.getDistinctListDiscountRuleVars(r,i))}},{key:"getRuleHints",value:function(e){var t=this;return e.map(function(e){return{rulesetData:t.getRulesetData(e),rulePhraseData:t.getRulePhraseData(e)}})}},{key:"getBestPriorityDiscountRuleVar",value:function(e){if(0===e.length)return{};var t=e[0];return e.forEach(function(e){e.priority<t.priority&&(t=e)}),t}},{key:"getDistinctListDiscountRuleVars",value:function(e,t){return e.promotionId===t.promotionId?[e]:[e,t]}},{key:"getHighestCappedDiscountRuleVars",value:function(e){var t=Math.max.apply(Math,u(e.map(function(e){return e.delta})));return e.filter(function(e){return t===e.delta})}},{key:"getLowestMbsDiscountRuleVars",value:function(e){var t=Math.min.apply(Math,u(e.map(function(e){return e.minOrderTotal})));return e.filter(function(e){return e.minOrderTotal===t})}},{key:"getRulesetData",value:function(e){var t="msg_promotion__ruleset__simple";return{transifyKey:t=this.getCountrySpecificTransifyKey(t),transifyData:{}}}},{key:"getRulePhraseData",value:function(e){var t={minOrderTotal:(0,o.formatCurrencyWrapper)(this.config,this.countryCode,e.minOrderTotal)};return[{discountRuleVar:e,transifyKey:this.getCountrySpecificTransifyKey(this.TRANSIFY_CART),transifyData:t}]}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(3),a=n(1),u=n(2),s=n(10),l=n(9),c=n(24);t.BaseDisplay=function(){function e(t,n,r,i){var u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:a.DISCOUNT_RULE_VARS_CALLER.DEFAULT;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.countryCode=n,this.languageCode=r,this.trans=t.HIGHLIGHT_MBS_FOR_CHANNEL_DISPLAY||t.HIGHLIGHT_DELTA_AMOUNT_FOR_CHANNEL_DISPLAY?(0,o.unsafeTranslate)(i):i,this.BREAK_LINE_MARKER=a.BREAK_LINE_MARKER,this.caller=u}return r(e,[{key:"getDummyFilters",value:function(){return[[function(e,t){return e}]]}},{key:"getDummyPreprocessorFunction",value:function(){return function(e,t){return e}}},{key:"getParams",value:function(){return{preProcessingStopConditions:this.getPreProcessingStopConditions(),rulesPreprocessors:this.getRulesPreprocessors(),postProcessingStopConditions:this.getPostProcessingStopConditions(),hintGenerator:this.getHintGenerator().bind(this)}}},{key:"getPreProcessingStopConditions",value:function(){return[s.hasNoPromotion]}},{key:"getRulesPreprocessors",value:function(){var e=this;return[function(t,n){return(0,u.applyFilters)(t,n,e.getPromotionRulesFilters())},function(t,n){return e.getPromotionRulesFormatter()(e.config,t,n,e.caller)},function(t,n){return(0,u.applyFilters)(t,n,e.getDiscountRuleVarsFilters())},function(t,n){return t.sort(e.getDiscountRuleVarsSorter())},function(t,n){return e.getDiscountRuleVarsReverser()(t,n)},function(t,n){return e.getDiscountRuleVarsSplitter()(t,n)}]}},{key:"getPostProcessingStopConditions",value:function(){return[s.hasNoDiscountRuleVar]}},{key:"getDiscountRuleVarsSplitter",value:function(){return this.getDummyPreprocessorFunction()}},{key:"getPromotionRulesFormatter",value:function(){return c.formatRuleToDiscountRuleVars}},{key:"getPromotionRulesFilters",value:function(){return[[u.isChannelSupported,u.isShopSupported],[u.isLocationGroupSupported],[u.isRuleShownForAll]]}},{key:"getDiscountRuleVarsFilters",value:function(){return[[u.isCapDiscountRuleVar,u.isFreeShippingDiscountRuleVar,u.isFlatRateDiscountRuleVar]]}},{key:"getDiscountRuleVarsSorter",value:function(){return l.sortDiscountRuleVarsByMBSAndPriority}},{key:"getDiscountRuleVarsReverser",value:function(){return function(e,t){return e.reverse()}}},{key:"getHintGenerator",value:function(){return function(){}}},{key:"getCountrySpecificTransifyKey",value:function(e){return this.config.countrySpecificRulesetString?e+"__"+this.countryCode:e}},{key:"applyPreprocessors",value:function(e,t,n){for(var r=e.slice(),o=0;o<n.length;o++)r=(0,n[o])(r,t);return r}},{key:"process",value:function(e,t,n,r,o,i,a,l){var c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,p=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"";if((0,s.applyStopConditions)({promotionRules:t},e.preProcessingStopConditions))return this.generateEarlyStopResult(n,c);n=n||[];var f={promotionRules:this.applyPreprocessors(t,{shopEnabledChannelsData:n,channels:r,channelid:o,orderTotal:i},e.rulesPreprocessors),countryCode:p,caller:this.caller,shopEnabledChannelsData:n},_=(0,u.getSuperiorPromotionRules)(f);return _.length<=0?this.generateResultOfEmptyPreprocessedPromotions(n,c):(0,s.applyStopConditions)({discountRuleVars:_,orderTotal:i},e.postProcessingStopConditions)?"":this.generateReturnResponse(e,_,i,a,r,l,c)}},{key:"generateReturnResponse",value:function(e,t,n,r,o,i,u){for(var s=e.hintGenerator({preprocessedPromotions:t,orderTotal:n,discountPromotionRuleId:r,channels:o,shippingFeeData:u}),l=[],c=void 0,p=0;p<s.length;p++)if((c=s[p]).rulePhraseData){var f=this.translateHints(c.rulePhraseData);if(f.join(a.PHRASE_SEPARATOR[this.languageCode]).length<=0)return"";c.rulesetData.transifyData.rulePhrases=f,l.push(this.trans(c.rulesetData.transifyKey,c.rulesetData.transifyData))}return l.join(this.BREAK_LINE_MARKER)}},{key:"translateHints",value:function(e){var t=this;return e.map(function(e){var n=e.discountRuleVar,r=e.transifyKey,o=e.transifyData||{};return o.useFreeShippingPhrase&&(n.deltaType=a.DISCOUNT_DELTA_TYPE.FREE_SHIPPING),o.deltaPhrase=t.generateDeltaPhrase(t.config,t.countryCode,t.trans,n.deltaType,n.delta,n.extra),t.trans(r,o)})}},{key:"generateDeltaPhrase",value:function(){return i.generateDiscountDeltaPhrase.apply(void 0,arguments)}},{key:"generateResultOfEmptyPreprocessedPromotions",value:function(){return""}},{key:"generateEarlyStopResult",value:function(){return""}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sortDiscountRuleVarsByMBSAndPriority=function(e,t){return e.minOrderTotal<t.minOrderTotal?-1:e.minOrderTotal>t.minOrderTotal?1:e.priority<t.priority?-1:e.priority>t.priority?1:0},t.sortPromotionRulesByMbs=function(e){return e.sort(function(e,t){return e.minOrderTotal<t.minOrderTotal?-1:e.minOrderTotal>t.minOrderTotal?1:0})},t.comparePromotionRulesByMbsDiscountedFee=function(e,t){return e.minOrderTotal<t.minOrderTotal?-1:e.minOrderTotal>t.minOrderTotal?1:e.discountedFee<t.discountedFee?-1:e.discountedFee>t.discountedFee?1:0},t.comparePromotionRulesByMbsCap=function(e,t){return e.minOrderTotal<t.minOrderTotal?-1:e.minOrderTotal>t.minOrderTotal?1:e.delta>t.delta?-1:e.delta<t.delta?1:0},t.comparePromotionRulesByPaymentType=function(e,t){return t.paymentType-e.paymentType}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyStopConditions=function(e,t){for(var n=0;n<t.length;n++)if((0,t[n])(e))return!0;return!1},t.hasNoPromotion=function(e){return(e.promotionRules||[]).length<=0},t.canApplyHighestMBSDiscountRuleVars=function(e){var t=e.discountRuleVars||[];if(t.length<=0)return!0;var n=e.orderTotal||0,r=Math.max.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t.map(function(e){return e.minOrderTotal})));return n>=r},t.canApplyFSPromotion=function(e){var t=e.discountRuleVars||[];if(t.length<=0)return!1;var n=e.orderTotal||0;return t.filter(function(e){return e.deltaType===r.DISCOUNT_DELTA_TYPE.FREE_SHIPPING}).filter(function(e){return n>=e.minOrderTotal}).length>0},t.hasNoDiscountRuleVar=function(e){return(e.discountRuleVars||[]).length<=0},t.canApplyFlatRateFSPromotion=function(e,t){var n=e.discountRuleVars||[];if(n.length<=0)return!1;var o=e.orderTotal||0,i=n.filter(function(e){return e.deltaType===r.DISCOUNT_DELTA_TYPE.FREE_SHIPPING&&(e.ruleFlag&r.LogisticPromotionRuleDiscountFlag.FLAT_RATE)>0});t&&(i=i.filter(function(e){return o>=e.minOrderTotal}));return i.length>0};var r=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CapSuperiorRuleManager=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(9),i=n(12);t.CapSuperiorRuleManager=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.SuperiorRuleManager),r(t,[{key:"process",value:function(){return this.processOverallChannel()}},{key:"isSuperiorRule",value:function(e,t){return e.delta>t.delta&&e.minOrderTotal>t.minOrderTotal}},{key:"sortPromotionRules",value:function(e){return(0,o.sortPromotionRulesByMbsCap)(e)}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SuperiorRuleManager=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(3),i=n(9),a=n(0);t.SuperiorRuleManager=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.promotionRules=t}return r(e,[{key:"process",value:function(){throw new Error("please implement the isSuperiorRule")}},{key:"processOverallChannel",value:function(){return this.generateSuperiorRules(this.promotionRules)}},{key:"processPerChannel",value:function(){var e=this.getChannelIdToPromotionRules(),t=this.generateSuperiorRulesPerChannels(e);return this.removeDuplicatePromotionRules(t)}},{key:"getChannelIdToPromotionRules",value:function(){var e={};return this.promotionRules.forEach(function(t){t.channelids.forEach(function(n){e[n]||(e[n]=[]),e[n].push(t)})}),e}},{key:"generateSuperiorRulesPerChannels",value:function(e){var t=this,n=[];return Object.values(e).forEach(function(e){n.push.apply(n,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t.generateSuperiorRules(e)))}),n}},{key:"removeDuplicatePromotionRules",value:function(e){var t=[],n=new Set;return e.forEach(function(e){n.has(e.promotionId)||(t.push(e),n.add(e.promotionId))}),t}},{key:"generateSuperiorRules",value:function(e){if(0===e.length)return[];var t=this.getPromotionIdToOriginalCap(e);e=(0,o.makeInfiniteDeltaForFreeShippingPromotion)(e);var n=this.getSuperiorPromotionRulesWithPaymentType(e);return this.transformCapPromotionToOriginalValue(t,n),n}},{key:"transformCapPromotionToOriginalValue",value:function(e,t){t.forEach(function(t){return t.delta=e[t.promotionId]})}},{key:"getPromotionIdToOriginalCap",value:function(e){var t={};return e.forEach(function(e){return t[e.promotionId]=e.delta}),t}},{key:"getSuperiorPromotionRulesWithPaymentType",value:function(e){var t=this,n=(0,a.groupBy)(e,function(e){return e.paymentType||0});return Object.keys(n).map(function(e){return t.getSuperiorPromotionRules(n[e])}).reduce(function(e,t){return e.concat(t)},[]).sort(function(e,n){var r=(0,i.comparePromotionRulesByPaymentType)(e,n);return 0!==r?r:t.sortPromotionRulesCompareFunc(e,n)})}},{key:"getSuperiorPromotionRules",value:function(e){for(var t=e.sort(this.sortPromotionRulesCompareFunc),n=t[0],r=[n],o=1;o<t.length;o++)this.isSuperiorRule(t[o],n)&&(n=t[o],r.push(n));return r}},{key:"isSuperiorRule",value:function(e,t){throw new Error("please implement the isSuperiorRule")}},{key:"sortPromotionRulesCompareFunc",value:function(e,t){return(0,i.comparePromotionRulesByMbsCap)(e,t)}}]),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiscountedFeeSuperiorRuleManager=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(9),i=n(12);t.DiscountedFeeSuperiorRuleManager=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.SuperiorRuleManager),r(t,[{key:"process",value:function(){return this.processOverallChannel()}},{key:"isSuperiorRule",value:function(e,t){return e.discountedFee<t.discountedFee&&e.minOrderTotal>t.minOrderTotal}},{key:"sortPromotionRulesCompareFunc",value:function(e,t){return(0,o.comparePromotionRulesByMbsDiscountedFee)(e,t)}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupDiscountVarsByMBS=function(e){return(0,r.groupBy)(e,function(e){return e.minOrderTotal||0})},t.sortArrayByValue=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.slice().sort(function(e,t){return e-t});t&&(n=n.reverse());return n},t.getPromotionChannelIds=function(e,t){return e&&t?Object.keys(e.channels).filter(function(e){return-1!=Object.keys(t).indexOf(e)}):[]};var r=n(0);n(1),n(2)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DetailCartDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(8),a=n(3),u=n(1);t.DetailCartDisplay=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.BaseDisplay),r(t,[{key:"generateReturnResponse",value:function(e,t,n,r,o,i){return{shopName:i,ruleVars:this.generateRuleVars(t,o)}}},{key:"generateRuleVars",value:function(e,t){var n=this;e=(0,a.makeInfiniteDeltaForFreeShippingPromotion)(e);var r=(0,o.groupBy)(e,function(e){return n.getComparisonKey(e)}),i=[],u=this.channelIdToChannelName(t);return Object.keys(r).map(function(e){return i.push(n.generateCartInfo(r[e]))}),i.sort(this.sortCartDetailsFunction.bind(this)),i=i.map(function(e){return n.transformCartInfo(e,u)})}},{key:"transformCartInfo",value:function(e,t){var n=null;return n=e.deltaType===u.DISCOUNT_DELTA_TYPE.FREE_SHIPPING?this.trans("msg_promotion__delta__free_shipping"):(0,o.formatCurrencyWrapper)(this.config,this.countryCode,e.delta),{tagType:e.tagType,minOrderTotal:(0,o.formatCurrencyWrapper)(this.config,this.countryCode,e.minOrderTotal),deltaPhrase:n,channelNames:e.channelIds.map(function(e){return t[e]})}}},{key:"sortCartDetailsFunction",value:function(e,t){var n=e.minOrderTotal-t.minOrderTotal,r=this.getTieBreakingRule(e,t),o=this.sortByTagType(e,t);return 0!==n?n:0!==r?r:o}},{key:"sortByTagType",value:function(e,t){return t.tagType-e.tagType}},{key:"getTieBreakingRule",value:function(e,t){return e.delta<t.delta?-1:e.delta>t.delta?1:0}},{key:"generateCartInfo",value:function(e){var t=new Set;e.forEach(function(e){e.channelids.forEach(function(e){return t.add(e)})});var n=e[0];return{tagType:(0,a.getDetailInfoTagTypeByPaymentType)(e[0].paymentType),minOrderTotal:n.minOrderTotal,deltaType:n.deltaType,channelIds:[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t)),delta:n.delta,discountedFee:n.discountedFee}}},{key:"getComparisonKey",value:function(e){return[e.paymentType,e.minOrderTotal,e.delta].toString()}},{key:"channelIdToChannelName",value:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n].name);return t}}]),t}()},function(e,t,n){e.exports=n(17)},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(0),i=n(3),a=n(20),u=n(54);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(){function e(e,t,n,l,c){var p=this;return c=Object.assign({},c,(0,u.getConfigByCountry)(e)),this.generateShopChannelDataParameters=function(e){for(var t={},n=0;n<e.length;n++){var r={};e[n].error||(void 0!==e[n].original_cost?(r.estimatedShippingFee=e[n].original_cost,r.discountedShippingFee=e[n].cost):r.estimatedShippingFee=r.discountedShippingFee=e[n].cost,r.locationGroupId=e[n].location_group_id,r.buyerLocationGroupIds=e[n].buyer_location_group_ids,r.sellerLocationGroupIds=e[n].seller_location_group_ids,r.warning=e[n].warning,t[e[n].channel.channelid]=r)}return t},this.generateChannelShippingFeeDisplayData=function(r,o,i,u){return(0,a.generateChannelShippingFeeDisplayData)(c,e,t,l,r,i,o,n,u)},this.generateDiscountString=function(r,o){r=Object.assign({crossBorder:!1,orderTotal:0,simpleMode:!1,fromCart:!1,fromPrompt:!1,showFreeShippingVoucherRequired:!1},r);var i=Object.assign({},c,o);return(0,a.generateProductGreenTruckDiscountString)(i,e,t,l,r.promotionRules,r.shopEnabledChannelsData,n,0,r.orderTotal)},this.generateChannelDiscountHint=function(r,o,i,u,s,p){return(0,a.generateChannelDiscountHint)(c,e,t,l,r,i,o,n,u,p)},this.generateCartDiscountString=function(r){return(0,a.generateCartDiscountString)(c,e,t,l,r.promotionRules,r.shopEnabledChannelsData,n,r.orderTotal)},this.generateDetailedCartDiscountInfo=function(r){return(0,a.generateDetailCartDiscountInfo)(c,e,t,l,r.promotionRules,r.shopEnabledChannelsData,n,r.orderTotal,r.shopName)},this.generateDiscountPrompt=function(u,f,_,y,h,d){if(c.hideDiscountPrompt)return"";if(c.ENABLE_MODULAR_PROCESSING_CHECKOUT_DISPLAY){var g=s({},_,y);return(0,a.generateDiscountPrompt)(c,e,t,l,u,g,n,_,h)}if(!c.displayHighestTierIfAllClearedForPrompt&&0===y.discountedShippingFee)return"";if(c.useDiscountStringForPrompt||c.useSimpleDiscountStringForPrompt){var m={};return m[_]=y,p.generateDiscountString({promotionRules:u,shopName:f,shopEnabledChannelsData:m,crossBorder:d,orderTotal:h,simpleMode:c.useSimpleDiscountStringForPrompt,fromPrompt:!0})}for(var R=[],P=(0,i.filterPromotionRules)(u,_,y.buyerLocationGroupIds,y.sellerLocationGroupIds).slice().reverse(),b=0;b<P.length;b++){var O=P[b];if(!(O.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.HIDE_PROMOTION_RULE_FROM_DISPLAY)&&O.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.REQUIRE_MIN_ORDER_TOTAL){var D=(0,i.getDiscountRuleVars)(c,n,O,s({},_,y),[_],d,r.DISCOUNT_RULE_VARS_CALLER.DISCOUNT_PROMPT);if(!(h>=D.minOrderTotal&&(!c.displayHighestTierIfAllClearedForPrompt||b<P.length-1))){var T=(0,i.generateDiscountDeltaPhrase)(c,e,l,D.deltaType,D.delta,D.extra,r.DISCOUNT_RULE_VARS_CALLER.DISCOUNT_PROMPT),S=D.channelids.map(function(e){return n[e]?n[e].name:""}).join(r.LIST_SEPARATOR[t]),v=c.useNewDiscountStringWithLocationGroupNameLabel&&D.extra.buyer_location_group_id>0?"msg_promotion__prompt__order_total__location_group__":"msg_promotion__prompt__order_total__";if(v+=e,v+=d?"__cb":"",R.push(l(v,{deltaPhrase:T,minOrderTotal:(0,o.formatCurrencyWrapper)(c,e,D.minOrderTotal),channelNames:S,shopName:f,buyerLocationGroupName:D.extra.buyer_location_group_name||""})),!c.showAllUnmetTiersForPrompt)break}}}return R.length?R.join(r.LIST_SEPARATOR[t]):""},this.calculateShowFreeShippingIcon=function(e,t,n,r){return p.shouldShowFreeShippingIconBesideCartText(e)},this.shouldShowFreeShippingIconBesideCartText=function(t){if("VN"===e){for(var n=0;n<t.length;n++){if(t[n].discount_flag&r.LogisticPromotionRuleDiscountFlag.CAPPED)return!0}return!1}return!0},this.shouldShowFreeShippingIconBesidePrompt=function(t,n){if("VN"===e){for(var o=0;o<t.length;o++){var i=t[o];if(i.discount_flag&r.LogisticPromotionRuleDiscountFlag.CAPPED){if(!(i.discount_rule_flag&r.LogisticPromotionRuleDiscountRuleFlag.REQUIRE_MIN_ORDER_TOTAL))return!0;if(n>=i.extra_data.min_order_total)return!0}}return!1}return!0},this}var t={create:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return new(Function.prototype.bind.apply(e,[null].concat(n)))}};return t}t.default=l,e&&e.exports&&(l.default=l,e.exports=l)}).call(this,n(18)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CONVERT_RATIO=1e5,t.MAX_PRECISION=20,t.COUNTRY_TO_CURRENCY={SG:"SGD",ID:"IDR",MY:"MYR",PH:"PHP",TW:"TWD",TH:"THB",VN:"VND",IR:"IRR",MM:"MMK",HK:"HKD",BR:"BRL"};var r=t.CURRENCY={SGD:{symbol:"$",precision:2,separator:",",decimalPoint:".",convertRate:1},IDR:{symbol:"Rp",precision:0,separator:".",decimalPoint:",",convertRate:1},MYR:{symbol:"RM",precision:2,separator:",",decimalPoint:".",convertRate:1},PHP:{symbol:"₱",precision:0,separator:",",decimalPoint:".",convertRate:1},TWD:{symbol:"$",precision:0,separator:",",decimalPoint:".",convertRate:1},THB:{symbol:"฿",precision:0,separator:",",decimalPoint:".",convertRate:1},VND:{symbol:"₫",precision:0,separator:".",decimalPoint:",",convertRate:1},IRR:{symbol:"تومان",precision:0,separator:",",decimalPoint:".",convertRate:.1},MMK:{symbol:"Ks",precision:0,separator:",",decimalPoint:".",convertRate:1},HKD:{symbol:"$",precision:2,separator:",",decimalPoint:".",convertRate:1},BRL:{symbol:"R$",precision:2,separator:".",decimalPoint:",",convertRate:1}};t.CURRENCY_SYMBOL=function(){var e={};return Object.keys(r).forEach(function(t){e[t]=r[t].symbol}),e}(),t.NOTCHES=[{notch:1e9,unit:"b"},{notch:1e6,unit:"m"},{notch:1e3,unit:"k"}],t.LOCALIZED_NOTCH_UNITS={default:{K:"k",M:"m",B:"b"},id:{K:"rb",M:"juta"},ph:{K:"k",M:"mil"},th:{K:"พัน",M:"ล้าน"},vn:{K:"k",M:"tr"},br:{K:"mil",M:"mi",B:"bi"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);function o(e,t){return r.CURRENCY[t||r.COUNTRY_TO_CURRENCY[e]]}function i(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=parseFloat(e);return isFinite(n)?(t&&(n/=r.CONVERT_RATIO),n):e}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:",";if(e=i(e),!isFinite(e))return e;var o=e.toString(),a=o.indexOf(".");if(null===t||void 0===t?t=a>=0?o.length-a+1:0:o=e.toFixed(t),r){for(var u=0===t?o.length:o.indexOf("."),s=o.search(/^-\+/)+1,l=o.slice(0,s),c=[],p=u;p>s;p-=3)c.push(o.slice(Math.max(0,p-3),p));c.reverse();var f=l+c.join(r);return 0===t?f:f+n+o.substr(u+1)}return o.replace(/\./,n)}function u(e,t){var n=o(t);return a(e,void 0,n.decimalPoint,n.separator)}function s(e,t,n,u){var s=i(n,!0),l=s<0,c=o(e,u),p=s*c.convertRate;return t=t>=0&&t<=r.MAX_PRECISION?t:c.precision,(l?"-":"")+c.symbol+a(Math.abs(p),t,c.decimalPoint,c.separator)}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.NOTCHES,a=i(e);if(!isFinite(a)||Math.abs(a)<n)return[parseFloat(a.toFixed(t)),""];t=(t=parseInt(t,10))>=0?t>r.MAX_PRECISION?r.MAX_PRECISION:t:1;for(var u=0;u<o.length;u++){var s=o[u],l=s.notch,c=s.unit,p=parseFloat((a/l).toFixed(t));if(Math.abs(p)>=1)return[p,c]}return[a,""]}function c(e,t,n,o,i){var a=r.LOCALIZED_NOTCH_UNITS.default,s=r.LOCALIZED_NOTCH_UNITS[e&&e.toLowerCase()||"default"]||a,c=function(t,n){return n=n&&n.toUpperCase(),[u(t,e&&e.toUpperCase()||"SG"),s[n]||a[n]||""]};if(void 0!==t){var p=l(t,n,o,i);return c.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(p))}return c}Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}),t.getCurrencyConfig=o,t.parseNumber=i,t.formatNum=a,t.formatNumber=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:".";return a(i(e,!r),n,o,t)},t.localizeNumber=u,t.default=function(e,t,n){return s(e,void 0,t,n)},t.formatCurrencyWithPrecision=s,t.getCurrencySymbolByCountryCode=function(e){var t=o(e);return t&&t.symbol},t.getCurrencySymbolByCurrencyID=function(e){var t=o(void 0,e);return t&&t.symbol},t.compactNumber=l,t.localizeCompactNumber=c,t.compactCurrencyFromServer=function(e,t,n,r,a){var u=i(t,!0),s=u<0,l=o(e),p=u*l.convertRate;return(s?"-":"")+l.symbol+c(e,Math.abs(p),n,r,a).join("")}}])})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateCartDiscountString=function(e,t,n,r,o,i,a,u){var s=new(0,k[t.toLowerCase()].cartDisplay)(e,t,n,r,L.DISCOUNT_RULE_VARS_CALLER.CART_DISCOUNT_STRING),l={params:s.getParams(),promotionRules:o,shopEnabledChannelsData:i,channels:a,channelid:0,orderTotal:u,discountPromotionRuleId:0,shopName:"",shippingFeeData:{},countryCode:t};return s.process.apply(s,M(Object.values(l)))},t.generateChannelDiscountHint=function(e,t,n,r,o,i,a,u,s,l){var c=j({},a,i),p=new(0,k[t.toLowerCase()].channelDisplay)(e,t,n,r,L.DISCOUNT_RULE_VARS_CALLER.DISCOUNT_HINT),f={params:p.getParams(),promotionRules:o,shopEnabledChannelsData:c,channels:u,channelid:a,orderTotal:s,discountPromotionRuleId:l,shopName:"",shippingFeeData:i,countryCode:t};return p.process.apply(p,M(Object.values(f)))},t.generateDiscountPrompt=function(e,t,n,r,o,i,a,u,s){var l=new T.CheckoutDisplay(e,t,n,r,L.DISCOUNT_RULE_VARS_CALLER.DISCOUNT_PROMPT),c={params:l.getParams(),promotionRules:o,shopEnabledChannelsData:i,channels:a,channelid:u,orderTotal:s,discountPromotionRuleId:0,shopName:"",shippingFeeData:{},countryCode:t};return l.process.apply(l,M(Object.values(c)))},t.generateProductGreenTruckDiscountString=function(e,t,n,r,o,i,a,u,s){var l=new(0,k[t.toLowerCase()].productDisplay)(e,t,n,r,L.DISCOUNT_RULE_VARS_CALLER.GREEN_TRUCK_DISCOUNT_STRING),c={params:l.getParams(),promotionRules:o,shopEnabledChannelsData:i,channels:a,channelid:u,orderTotal:s,discountPromotionRuleId:0,shopName:"",shippingFeeData:{},countryCode:t};return l.process.apply(l,M(Object.values(c)))},t.generateDetailCartDiscountInfo=function(e,t,n,r,o,i,a,u,s){var l=new(0,k[t.toLowerCase()].detailCartDisplay)(e,t,n,r,L.DISCOUNT_RULE_VARS_CALLER.DETAILED_CART_DISCOUNT_INFO),c={params:l.getParams(),promotionRules:o,shopEnabledChannelsData:i,channels:a,channelid:0,orderTotal:u,discountPromotionRuleId:0,shopName:s,shippingFeeData:{},countryCode:t};return l.process.apply(l,M(Object.values(c)))},t.generateChannelShippingFeeDisplayData=function(e,t,n,r,o,i,a,u,s){var l=j({},a,i),c=new(0,k[t.toLowerCase()].channelShippingFeeDisplay)(e,t,n,r,L.DISCOUNT_RULE_VARS_CALLER.CHANNEL_SHIPPING_FEE_DISPLAY_DATA),p={params:c.getParams(),promotionRules:o,shopEnabledChannelsData:l,channels:u,channelid:a,orderTotal:s,discountPromotionRuleId:0,shopName:"",shippingFeeData:i,countryCode:t};return c.process.apply(c,M(Object.values(p)))};var r=n(21),o=n(25),i=n(26),a=n(27),u=n(28),s=n(29),l=n(30),c=n(31),p=n(32),f=n(33),_=n(34),y=n(35),h=n(36),d=n(37),g=n(38),m=n(39),R=n(40),P=n(41),b=n(42),O=n(43),D=n(44),T=n(45),S=n(46),v=n(47),E=n(48),C=n(49),I=n(50),A=n(51),F=n(52),N=n(15),w=n(53),L=n(1);function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var k={sg:{channelDisplay:o.SgChannelDisplay,productDisplay:m.SgProductDisplay,cartDisplay:v.SgCartDisplay,detailCartDisplay:N.DetailCartDisplay,channelShippingFeeDisplay:p.SgChannelShippingFeeDisplay},vn:{channelDisplay:r.VnChannelDisplay,productDisplay:g.VnProductDisplay,cartDisplay:S.VnCartDisplay,detailCartDisplay:N.DetailCartDisplay,channelShippingFeeDisplay:c.VnChannelShippingFeeDisplay},my:{channelDisplay:a.MyChannelDisplay,productDisplay:P.MyProductDisplay,cartDisplay:C.MyCartDisplay,detailCartDisplay:N.DetailCartDisplay,channelShippingFeeDisplay:_.MyChannelShippingFeeDisplay},tw:{channelDisplay:l.TwChannelDisplay,productDisplay:D.TwProductDisplay,cartDisplay:F.TwCartDisplay,detailCartDisplay:w.TwDetailCartDisplay,channelShippingFeeDisplay:d.TwChannelShippingFeeDisplay},id:{channelDisplay:i.IdChannelDisplay,productDisplay:R.IdProductDisplay,cartDisplay:E.IdCartDisplay,detailCartDisplay:N.DetailCartDisplay,channelShippingFeeDisplay:f.IdChannelShippingFeeDisplay},ph:{channelDisplay:u.PhChannelDisplay,productDisplay:b.PhProductDisplay,cartDisplay:I.PhCartDisplay,detailCartDisplay:N.DetailCartDisplay,channelShippingFeeDisplay:y.PhChannelShippingFeeDisplay},th:{channelDisplay:s.ThChannelDisplay,productDisplay:O.ThProductDisplay,cartDisplay:A.ThCartDisplay,detailCartDisplay:N.DetailCartDisplay,channelShippingFeeDisplay:h.ThChannelShippingFeeDisplay},br:{channelDisplay:u.PhChannelDisplay,productDisplay:b.PhProductDisplay,cartDisplay:F.TwCartDisplay,detailCartDisplay:w.TwDetailCartDisplay,channelShippingFeeDisplay:y.PhChannelShippingFeeDisplay}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VnChannelDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(4),a=n(2);t.VnChannelDisplay=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.ChannelDisplay),r(t,[{key:"processChannelHint",value:function(e){var t=e.preprocessedPromotions,n=this.sortDiscountRuleVars(t);if(n.length<=0)return[];for(var r=n[0],o=n[0],i=[],a=0;a<n.length;a++){if(r=n[a],0!==a)this.isStrictlyBetterRule(o,r)&&(i.push(r),o=r);else i.push(r)}return this.getRuleHints(i)}},{key:"sortDiscountRuleVars",value:function(e){return e.sort(function(e,t){if(e.minOrderTotal<t.minOrderTotal)return-1;if(e.minOrderTotal>t.minOrderTotal)return 1;var n=(0,a.isFlatRateFreeShippingDiscountRuleVar)(e,null),r=(0,a.isFlatRateFreeShippingDiscountRuleVar)(t,null);if(r-n!=0)return r-n;if((0,a.isCapDiscountRuleVar)(e,null)&&(0,a.isCapDiscountRuleVar)(t,null)){if(e.delta<t.delta)return 1;if(e.delta>t.delta)return-1}return e.priority-t.priority})}},{key:"isStrictlyBetterRule",value:function(e,t){var n=(0,a.isFlatRateFreeShippingDiscountRuleVar)(e,null),r=(0,a.isCapDiscountRuleVar)(e,null),o=(0,a.isCapDiscountRuleVar)(t,null);return!n&&(!r||!o||!(e.delta>=t.delta))}},{key:"getRuleHints",value:function(e){var t=this;return e.map(function(e){return{rulesetData:t.getRuleSetData(e),rulePhraseData:t.getRulePhraseData(e)}})}},{key:"getRuleSetData",value:function(e,t){var n=(0,o.formatCurrencyWrapper)(this.config,this.countryCode,e.delta),r={delta:this.config.HIGHLIGHT_DELTA_AMOUNT_FOR_CHANNEL_DISPLAY?(0,o.highlight)(this.config,n):n},i=(0,a.isFlatRateFreeShippingDiscountRuleVar)(e)?"msg_promotion__ruleset__simple":"msg_promotion__ruleset__capped__simple";return{transifyKey:i=this.getCountrySpecificTransifyKey(i),transifyData:r}}},{key:"getRulePhraseData",value:function(e){var t=(0,o.formatCurrencyWrapper)(this.config,this.countryCode,e.minOrderTotal),n={minOrderTotal:this.config.HIGHLIGHT_MBS_FOR_CHANNEL_DISPLAY?(0,o.highlight)(this.config,t):t,useFreeShippingPhrase:!0};return[{discountRuleVar:e,transifyKey:this.getCountrySpecificTransifyKey("msg_promotion__rule__order_total__simple"),transifyData:n}]}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiscountedChannelFeeSuperiorManager=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(13);t.DiscountedChannelFeeSuperiorManager=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.DiscountedFeeSuperiorRuleManager),r(t,[{key:"process",value:function(){return this.processPerChannel()}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CapChannelSuperiorRuleManager=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(11);t.CapChannelSuperiorRuleManager=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.CapSuperiorRuleManager),r(t,[{key:"process",value:function(){return this.processPerChannel()}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatRuleToDiscountRuleVars=function(e,t,n,i){return t.map(function(t){var a=(0,o.getPromotionChannelIds)(t,n.shopEnabledChannelsData),u=(0,r.getDiscountRuleVars)(e,n.channels,t,n.shopEnabledChannelsData,a,!1,i);return u.minOrderTotal=u.minOrderTotal||0,u})};var r=n(3),o=n(14)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SgChannelDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(4),i=n(2),a=n(9),u=n(3);t.SgChannelDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_RULE_PHRASE_MBS_PROMOTION="msg_promotion__rule__from_min_order_total__simple",i.TRANSIFY_RULESET_CAPPED_PROMOTION="msg_promotion__ruleset__up_to__simple",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.ChannelDisplay),r(t,[{key:"getDiscountRuleVarsFilters",value:function(){return[[i.isCapDiscountRuleVar,i.isFreeShippingDiscountRuleVar,i.isFlatRateDiscountRuleVar,i.isPercentageWithCapDiscountRuleVar,i.isPercentageDiscountRuleVar]]}},{key:"processChannelHint",value:function(e){var t=e.preprocessedPromotions,n=e.shippingFeeData,r=e.orderTotal,o=[],i=this.getAppliedPromotion(t,n,r);i&&o.push(i);var u=this.removePromotionRuleById(i,t),s=this.getLowestMbsNotEligiblePromotion(u,r);s&&o.push(s);var l=this.removePromotionRuleById(s,u),c=(0,a.sortPromotionRulesByMbs)(l);return o=o.concat(c),this.getRuleHints(o)}},{key:"getAppliedPromotion",value:function(e,t,n){var r=null;return e.forEach(function(e){t.discountedShippingFee===e.discountedFee&&e.minOrderTotal<=n&&(r=e)}),r}},{key:"removePromotionRuleById",value:function(e,t){var n=e&&e.promotionId;return t.filter(function(e){return e&&e.promotionId!==n})}},{key:"getLowestMbsNotEligiblePromotion",value:function(e,t){if(0===e.length)return null;var n=null,r=e[0].minOrderTotal;return e.forEach(function(e){t<e.minOrderTotal&&e.minOrderTotal<=r&&(n=e,r=e.minOrderTotal)}),n}},{key:"generateDeltaPhrase",value:function(e,t,n,r,o){arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6];return(0,u.generateHighlightedDeltaPhrase)(e,t,n,r,o,{},null)}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdChannelDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(4);t.IdChannelDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_RULE_PHRASE_MBS_PROMOTION="msg_promotion__rule__from_min_order_total__simple_id",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.ChannelDisplay),r(t,[{key:"processChannelHint",value:function(e){var t=e.preprocessedPromotions,n=Math.max.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t.map(function(e){return e.minOrderTotal})));return this.getRuleHints(t.filter(function(e){return e.minOrderTotal===n}))}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MyChannelDisplay=void 0;var r=n(4);t.MyChannelDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_RULE_PHRASE_MBS_PROMOTION="msg_promotion__rule__from_min_order_total__simple_my",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.ChannelDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PhChannelDisplay=void 0;var r=n(4);t.PhChannelDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_RULE_PHRASE_MBS_PROMOTION="msg_promotion__rule__from_min_order_total__simple_ph",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.ChannelDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThChannelDisplay=void 0;var r=n(4);t.ThChannelDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_RULE_PHRASE_MBS_PROMOTION="msg_promotion__rule__from_min_order_total__simple_th",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.ChannelDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TwChannelDisplay=void 0;var r=n(4);t.TwChannelDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_RULE_PHRASE_MBS_PROMOTION="msg_promotion__rule__from_min_order_total__simple_tw",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.ChannelDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VnChannelShippingFeeDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(5);t.VnChannelShippingFeeDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.SHOW_FREE_SHIPPING_TEXT=!0,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.ChannelShippingFeeDisplay),r(t,[{key:"generateReturnResponse",value:function(e,t,n,r,o,i,a){return this.generateShippingFeeNoPriceRange(a,t,n)}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SgChannelShippingFeeDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(5);t.SgChannelShippingFeeDisplay=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.ChannelShippingFeeDisplay),r(t,[{key:"generateReturnResponse",value:function(e,t,n,r,o,i,a){return this.generateShippingFeeWithPriceRange(a,t,n)}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdChannelShippingFeeDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(5);t.IdChannelShippingFeeDisplay=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.ChannelShippingFeeDisplay),r(t,[{key:"generateReturnResponse",value:function(e,t,n,r,o,i,a){return this.generateShippingFeeWithPriceRange(a,t,n)}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MyChannelShippingFeeDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(5);t.MyChannelShippingFeeDisplay=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.ChannelShippingFeeDisplay),r(t,[{key:"generateReturnResponse",value:function(e,t,n,r,o,i,a){return this.generateShippingFeeWithPriceRange(a,t,n)}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PhChannelShippingFeeDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(5);t.PhChannelShippingFeeDisplay=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.ChannelShippingFeeDisplay),r(t,[{key:"generateReturnResponse",value:function(e,t,n,r,o,i,a){return this.generateShippingFeeWithPriceRange(a,t,n)}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThChannelShippingFeeDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(5);t.ThChannelShippingFeeDisplay=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.ChannelShippingFeeDisplay),r(t,[{key:"generateReturnResponse",value:function(e,t,n,r,o,i,a){return this.generateShippingFeeWithPriceRange(a,t,n)}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TwChannelShippingFeeDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(5);t.TwChannelShippingFeeDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.SHOW_FREE_SHIPPING_TEXT=!0,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.ChannelShippingFeeDisplay),r(t,[{key:"generateReturnResponse",value:function(e,t,n,r,o,i,a){return this.generateShippingFeeNoPriceRange(a,t,n)}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VnProductDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(6),i=n(10),a=n(1),u=n(2);t.VnProductDisplay=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.ProductDisplay),r(t,[{key:"getDiscountRuleVarsFilters",value:function(){return[[u.isCapDiscountRuleVar,u.isFreeShippingDiscountRuleVar,u.isFlatRateDiscountRuleVar]]}},{key:"getHintGenerator",value:function(){return this.processGreenTruckDiscountDisplay}},{key:"processGreenTruckDiscountDisplay",value:function(e){return[{rulesetData:this.getRulesetData(e),rulePhraseData:this.getRulePhraseData()}]}},{key:"usePlainFsTransify",value:function(e){return(0,i.canApplyFSPromotion)(e)}},{key:"getRulesetData",value:function(e){var t=e.preprocessedPromotions,n=e.orderTotal,r=this.usePlainFsTransify({discountRuleVars:t,orderTotal:n})?this.getPlainFreeShippingTransify():this.getModifiedFreeShippingTransify(t);return{transifyKey:this.getCountrySpecificTransifyKey(r.transifyKey),transifyData:r.transifyData}}},{key:"getPlainFreeShippingTransify",value:function(){return{transifyKey:"msg_promotion__ruleset__simple",transifyData:{}}}},{key:"getModifiedFreeShippingTransify",value:function(e){return{transifyKey:"msg_promotion__ruleset__min_spend__icon__simple",transifyData:{icon:a.ICON_HELP_MARKER}}}},{key:"getRulePhraseData",value:function(){return[{discountRuleVar:{},transifyKey:"msg_promotion__rule__simple",transifyData:{useFreeShippingPhrase:!0}}]}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SgProductDisplay=void 0;var r=n(6);t.SgProductDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_FS_WITH_MBS="msg_promotion__ruleset__min_order_lowest_mbs",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.ProductDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdProductDisplay=void 0;var r=n(6);t.IdProductDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_FS_WITH_MBS="msg_promotion__ruleset__min_order_lowest_mbs_id",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.ProductDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MyProductDisplay=void 0;var r=n(6);t.MyProductDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_FS_WITH_MBS="msg_promotion__ruleset__min_order_lowest_mbs_my",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.ProductDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PhProductDisplay=void 0;var r=n(6);t.PhProductDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_FS_WITH_MBS="msg_promotion__ruleset__min_order_lowest_mbs_ph",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.ProductDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThProductDisplay=void 0;var r=n(6);t.ThProductDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_FS_WITH_MBS="msg_promotion__ruleset__min_order_lowest_mbs_th",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.ProductDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TwProductDisplay=void 0;var r=n(6);t.TwProductDisplay=function(e){function t(e,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o));return i.TRANSIFY_FS_WITH_MBS="msg_promotion__ruleset__min_order_lowest_mbs_tw",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.ProductDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CheckoutDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(8),a=n(2),u=n(10),s=n(14);t.CheckoutDisplay=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.BaseDisplay),r(t,[{key:"getPostProcessingStopConditions",value:function(){return function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"getPostProcessingStopConditions",this).call(this).concat([u.canApplyHighestMBSDiscountRuleVars,u.canApplyFSPromotion])}},{key:"getHintGenerator",value:function(){return this.processCheckoutDiscountString}},{key:"processCheckoutDiscountString",value:function(e){var t=e.preprocessedPromotions,n=e.orderTotal,r=(0,s.groupDiscountVarsByMBS)(t),o=(0,s.sortArrayByValue)(Object.keys(r)).map(function(e){return parseInt(e)}).filter(function(e){return e>n});if(o.length<=0)return[];var i=o[0],a=this.sortDiscountRuleVarsInMBS(r[i])[0];return[{rulesetData:this.getRulesetData(a,n),rulePhraseData:this.getRulePhraseData(a)}]}},{key:"sortDiscountRuleVarsInMBS",value:function(e){return e.sort(function(e,t){return e.discountedFee<t.discountedFee?-1:e.discountedFee>t.discountedFee?1:e.priority<t.priority?-1:e.priority>t.priority?1:0})}},{key:"getRulesetData",value:function(e,t){var n={delta:(0,o.formatCurrencyWrapper)(this.config,this.countryCode,e.delta)},r=(0,a.isCapDiscountRuleVar)(e)?"msg_promotion__ruleset__capped__simple":"msg_promotion__ruleset__simple";return{transifyKey:r=this.getCountrySpecificTransifyKey(r),transifyData:n}}},{key:"getRulePhraseData",value:function(e){var t={minOrderTotal:(0,o.formatCurrencyWrapper)(this.config,this.countryCode,e.minOrderTotal),useFreeShippingPhrase:!0};return[{discountRuleVar:e,transifyKey:this.getCountrySpecificTransifyKey("msg_promotion__rule__order_total__simple"),transifyData:t}]}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VnCartDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(7),i=n(0),a=n(2);t.VnCartDisplay=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.CartDisplay),r(t,[{key:"getRulesetData",value:function(e){var t={delta:(0,i.formatCurrencyWrapper)(this.config,this.countryCode,e.delta),minOrderTotal:(0,i.formatCurrencyWrapper)(this.config,this.countryCode,e.minOrderTotal)},n=(0,a.isFlatRateFreeShippingDiscountRuleVar)(e)?"msg_promotion__ruleset__simple":"msg_promotion__ruleset__capped__simple";return{transifyKey:n=this.getCountrySpecificTransifyKey(n),transifyData:t}}},{key:"getRulePhraseData",value:function(e){var t={minOrderTotal:(0,i.formatCurrencyWrapper)(this.config,this.countryCode,e.minOrderTotal),useFreeShippingPhrase:!0};return[{discountRuleVar:e,transifyKey:this.getCountrySpecificTransifyKey("msg_promotion__rule__order_total__simple"),transifyData:t}]}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SgCartDisplay=void 0;var r=n(7);t.SgCartDisplay=function(e){function t(e,n,r,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o,i));return a.BREAK_LINE_MARKER="; ",a.TRANSIFY_CART="msg_promotion__rule__from_min_order_total__simple",a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.CartDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdCartDisplay=void 0;var r=n(7);t.IdCartDisplay=function(e){function t(e,n,r,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o,i));return a.BREAK_LINE_MARKER="; ",a.TRANSIFY_CART="msg_promotion__rule__from_min_order_total__simple_id",a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.CartDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MyCartDisplay=void 0;var r=n(7);t.MyCartDisplay=function(e){function t(e,n,r,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o,i));return a.BREAK_LINE_MARKER="; ",a.TRANSIFY_CART="msg_promotion__rule__from_min_order_total__simple_my",a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.CartDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PhCartDisplay=void 0;var r=n(7);t.PhCartDisplay=function(e){function t(e,n,r,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o,i));return a.BREAK_LINE_MARKER="; ",a.TRANSIFY_CART="msg_promotion__rule__from_min_order_total__simple_ph",a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.CartDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThCartDisplay=void 0;var r=n(7);t.ThCartDisplay=function(e){function t(e,n,r,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o,i));return a.BREAK_LINE_MARKER="; ",a.TRANSIFY_CART="msg_promotion__rule__from_min_order_total__simple_th",a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.CartDisplay),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TwCartDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),i=n(7);function a(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}t.TwCartDisplay=function(e){function t(e,n,r,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r,o,i));return a.BREAK_LINE_MARKER="; ",a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.CartDisplay),r(t,[{key:"processCartDiscountString",value:function(e){var t=e.preprocessedPromotions,n=this.getLowestMbsDiscountRuleVars(t),r=this.getLowestFlatRateDiscountRuleVars(n),o=this.getLowestFlatRateDiscountRuleVars(t),i=this.getLowestMbsDiscountRuleVars(o);return this.getRuleHints(this.getDistinctListDiscountRuleVars(r,i),e.channels)}},{key:"getDistinctListDiscountRuleVars",value:function(e,t){if(t.length!==e.length)return[e,t];var n=new Set(e.map(function(e){return e.promotionId})),r=!0;return t.forEach(function(e){n.has(e.promotionId)||(r=!1)}),r?[t]:[e,t]}},{key:"getRuleHints",value:function(e,t){var n=this;return e.map(function(e){return 0===e.length?{}:{rulesetData:n.getRulesetData(),rulePhraseData:n.getRulePhraseData(e,t)}})}},{key:"getLowestFlatRateDiscountRuleVars",value:function(e){var t=Math.min.apply(Math,a(e.map(function(e){return e.delta})));return e.filter(function(e){return e.delta===t})}},{key:"getLowestMbsDiscountRuleVars",value:function(e){var t=Math.min.apply(Math,a(e.map(function(e){return e.minOrderTotal})));return e.filter(function(e){return e.minOrderTotal===t})}},{key:"getRulesetData",value:function(){var e="msg_promotion__ruleset__simple";return{transifyKey:e=this.getCountrySpecificTransifyKey(e),transifyData:{}}}},{key:"getRulePhraseData",value:function(e,t){var n=e[0];return 0===n.minOrderTotal?this.getRulePhraseDataNoMbs(n,e,t):this.getRulePhraseDataWithMbs(n,e,t)}},{key:"getRulePhraseDataNoMbs",value:function(e,t,n){var r={channelNames:this.getChannelNames(t,n)};return[{discountRuleVar:e,transifyKey:this.getCountrySpecificTransifyKey("msg_promotion__rule__channel_names"),transifyData:r}]}},{key:"getRulePhraseDataWithMbs",value:function(e,t,n){var r={minOrderTotal:(0,o.formatCurrencyWrapper)(this.config,this.countryCode,e.minOrderTotal),channelNames:this.getChannelNames(t,n)};return[{discountRuleVar:e,transifyKey:this.getCountrySpecificTransifyKey("msg_promotion_min_order_total__rule__channel_names"),transifyData:r}]}},{key:"getChannelNames",value:function(e,t){var n=[];return e.forEach(function(e){return n=n.concat(e.channelids)}),n.map(function(e){return t[parseInt(e)].name}).join(",")}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TwDetailCartDisplay=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(15);t.TwDetailCartDisplay=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.DetailCartDisplay),r(t,[{key:"getComparisonKey",value:function(e){return[e.minOrderTotal,e.discountedFee].toString()}},{key:"getTieBreakingRule",value:function(e,t){return e.discountedFee<t.discountedFee?1:e.discountedFee>t.discountedFee?-1:0}}]),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getConfigByCountry=function(e){return r[e]};var r={VN:{showActualShippingFeeInsteadOfPossibleRange:!0,showFreeShippingForDeltaIfFree:!0,ENABLE_MODULAR_PROCESSING_CART_DISPLAY:!0,ENABLE_MODULAR_PROCESSING_CHANNEL_DISPLAY:!0,ENABLE_MODULAR_PROCESSING_DETAIL_CART_DISPLAY:!0,ENABLE_MODULAR_PROCESSING_CHECKOUT_DISPLAY:!0,USE_GREEN_TRUCK_STRING_FOR_CART:!0,ADD_ICON_HELP_ON_GREEN_TRUCK_HINT:!0,HIGHLIGHT_MBS_FOR_CHANNEL_DISPLAY:!0,HIGHLIGHT_DELTA_AMOUNT_FOR_CHANNEL_DISPLAY:!0},ID:{ENABLE_MODULAR_PROCESSING_CART_DISPLAY:!0,ENABLE_MODULAR_PROCESSING_CHANNEL_DISPLAY:!0},TH:{ENABLE_MODULAR_PROCESSING_CART_DISPLAY:!0,ENABLE_MODULAR_PROCESSING_CHANNEL_DISPLAY:!0},PH:{ENABLE_MODULAR_PROCESSING_CART_DISPLAY:!0,ENABLE_MODULAR_PROCESSING_CHANNEL_DISPLAY:!0},TW:{ENABLE_MODULAR_PROCESSING_CART_DISPLAY:!0,ENABLE_MODULAR_PROCESSING_CHANNEL_DISPLAY:!0},MY:{ENABLE_MODULAR_PROCESSING_CART_DISPLAY:!0,ENABLE_MODULAR_PROCESSING_CHANNEL_DISPLAY:!0},SG:{ENABLE_MODULAR_PROCESSING_CART_DISPLAY:!0,ENABLE_MODULAR_PROCESSING_CHANNEL_DISPLAY:!0,showActualShippingFeeInsteadOfPossibleRange:!0}}}])});
//# sourceMappingURL=../../source_maps/ShopeeLib.ShippingFeeInfoService.min.js.map