Build 574548stable
Module 57020
1,401 characters · in b8e8f8808c8513d8.jsDependencies
Source Raw
function(e,t,r){r.d(t,{A:()=>d,F:()=>f}),r(321073);var n=r(855104),l=r(287809),i=r(428262),s=r(623373),o=r(561769),a=r(652215);function u(e){let{product:t,hasShopDiscount:r}=e,n=(0,s.CW)({product:t,hasShopDiscount:r});return{orbPrice:n,fiatPrice:(0,s.$K)({product:t,hasShopDiscount:r})??void 0,isOrbExclusive:(0,s.Ab)(t)}}function c(e){let{hasSufficientOrbs:t,orbPrice:r,fiatPrice:n,isOrbExclusive:l,hasDiscountOffer:i=!1,prioritizedCurrency:s=null}=e,u=[],c=s===o.Hi.ORBS,d=s===o.Hi.FIAT;null!=r&&null!=n?c||!d&&t&&!i?u.push(r,n):u.push(n,r):null!=r?u.push(r):null!=n&&u.push(n);let f=u.length>0&&u[0]?.currency===a.Yri.DISCORD_ORB;return{checkoutEligiblePrices:u,isOrbExclusive:l,hasSufficientOrbs:t,shouldCheckoutWithOrbs:f}}function d(e){let{product:t,prioritizedCurrency:r}=e,s=(0,n.r_)(),o=l.default.getCurrentUser(),{orbPrice:a,fiatPrice:d,isOrbExclusive:f}=u({product:t,hasShopDiscount:i.Ay.canUseShopDiscounts(o)}),C=null!=a&&null!=s&&s>=a.amount,{shouldCheckoutWithOrbs:_}=c({orbPrice:a,fiatPrice:d,isOrbExclusive:f,hasSufficientOrbs:C,prioritizedCurrency:r??null});return _}function f(e){let{product:t,hasShopDiscount:r,prioritizedCurrency:l,hasDiscountOffer:i=!1}=e,{orbPrice:s,fiatPrice:o,isOrbExclusive:a}=u({product:t,hasShopDiscount:r}),d=(0,n.kj)(null!=s?s.amount:null);return c({orbPrice:s,fiatPrice:o,isOrbExclusive:a,hasSufficientOrbs:d,hasDiscountOffer:i,prioritizedCurrency:l})}}