2026-08-24 06:08:38 +00:00
// Module ID: 15211
// Function ID: 15212
2026-07-20 16:05:17 +00:00
// Name: GiftPurchaseSKUView
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 32, 19, 17, 1922, 4526, 676, 1924, 21, 3, 1629, 9662, 589, 10416, 5305, 1945, 7700, 12020, 4346, 4662, 5318, 4738, 4739, 6323, 4750, 9635, 514, 7696, 6988, 9622, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 15211 (GiftPurchaseSKUView)
import timestampDefault from "timestamp" /* 3 */ ;
import NativePaymentContextProvider from "NativePaymentContextProvider" /* 9622 */ ;
import closure_3 from "asyncGeneratorStep" /* 5 */ ;
import closure_4 from "_slicedToArray" /* 32 */ ;
import closure_5 from "noop" /* 19 */ ;
import { View } from "get ActivityIndicator" /* 17 */ ;
import closure_7 from "mergeGuildAvatar" /* 1922 */ ;
import closure_8 from "addSku" /* 4526 */ ;
import { PriceSetAssignmentPurchaseTypes as closure_9 } from "ME" /* 676 */ ;
import { PremiumTypes } from "GuildFeatures" /* 1924 */ ;
import jsxProd from "jsxProd" /* 21 */ ;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1 ;
2026-07-20 16:05:17 +00:00
function GiftPurchaseSKUView ( selectedSkuId ) {
selectedSkuId = selectedSkuId . selectedSkuId ;
( { giftRecipientId , giftMessage } = selectedSkuId ) ;
2026-07-29 08:29:29 +00:00
let first ;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined ;
2026-07-29 08:29:29 +00:00
let currentUser ;
let callback ;
2026-07-20 16:05:17 +00:00
let React ;
2026-07-23 10:11:24 +00:00
let memo ;
2026-07-29 08:29:29 +00:00
let memo1 ;
2026-08-24 06:08:38 +00:00
closure_8 = undefined ;
2026-07-20 16:05:17 +00:00
function _submitGiftPurchase() {
2026-07-29 08:29:29 +00:00
const self = this ;
const tmp = currentUser ( function * ( ) {
if ( c5 === 2 ) {
c5 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp6 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
return { value : "HermesInternal" , done : null } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c5 = 2 ;
if ( 0 === c4 ) {
if ( arg0 === 1 ) {
c5 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c5 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp3 ;
2026-07-29 08:29:29 +00:00
let message = tmp7 ;
2026-08-24 06:08:38 +00:00
c3 = 1 ;
2026-07-29 08:29:29 +00:00
if ( null == c5 ) {
2026-08-24 06:08:38 +00:00
closure_1_13 . error ( "Cannot proceed with purchase: collectibleProduct is undefined" ) ;
closure_1_1 ( closure_1_2 [ 19 ] ) . show ( { title : "Product Not Found" , body : "The product information could not be loaded. Please try again." } ) ;
2026-07-29 08:29:29 +00:00
c3 = 0 ;
c5 = 3 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : true } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = undefined ;
return obj1 ;
} else {
if ( null != tmp43 . googleSkuIds ) {
2026-08-24 06:08:38 +00:00
if ( 0 !== closure_1_6 . length ) {
2026-07-29 08:29:29 +00:00
c4 = 2 ;
c5 = 1 ;
const obj2 = { value : null , done : false } ;
2026-08-24 06:08:38 +00:00
obj2 [ 0 ] = closure_1_8 ( ) ;
2026-07-29 08:29:29 +00:00
return obj2 ;
}
}
const _HermesInternal2 = HermesInternal ;
2026-08-24 06:08:38 +00:00
closure_1_13 . error ( "No Google SKU IDs available for product " + tmp43 . skuId ) ;
let obj4 = closure_1_1 ( closure_1_2 [ 19 ] ) ;
2026-07-29 08:29:29 +00:00
obj4 . show ( { title : "Product Not Available" , body : "This product is not available for purchase on Google Play." } ) ;
c3 = 0 ;
c5 = 3 ;
const obj3 = { value : null , done : true } ;
obj3 [ 0 ] = undefined ;
return obj3 ;
}
}
} else {
if ( 1 === tmp7 ) {
c3 = 0 ;
message = closure_2 ;
2026-08-24 06:08:38 +00:00
closure_1_13 . warn ( "Error creating gift purchase:" , message ) ;
obj1 = closure_1_1 ( closure_1_2 [ 19 ] ) ;
2026-07-29 08:29:29 +00:00
message = undefined ;
if ( message != null ) {
message = message . message ;
}
if ( ! message ) {
const _JSON = JSON ;
message = JSON . stringify ( message ) ;
}
obj4 = { title : "Gift Purchase Failed" , body : null } ;
const _HermesInternal = HermesInternal ;
obj4 [ 1 ] = "Error: " + message ;
obj1 . show ( obj4 ) ;
c5 = 3 ;
} else if ( arg0 === 1 ) {
c5 = 3 ;
throw arg1 ;
} else if ( arg0 !== 2 ) {
c3 = 0 ;
}
c3 = 0 ;
c5 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
}
} catch ( tmp33 ) {
closure_2 = tmp33 ;
if ( tmp4 === c3 ) {
c5 = tmp2 ;
throw tmp33 ;
} else {
c4 = tmp ;
}
}
}
} ) ;
2026-08-24 06:08:38 +00:00
closure_9 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-08-15 05:55:55 +00:00
const rect = first ( 1629 ) ( ) ;
2026-07-29 08:29:29 +00:00
let obj = React ;
const tmp4 = callback ( React . useState ( false ) , 2 ) ;
first = tmp4 [ 0 ] ;
dependencyMap = tmp4 [ 1 ] ;
currentUser = memo1 . getCurrentUser ( ) ;
2026-07-23 10:11:24 +00:00
callback = React . useRef ( { } ) ;
2026-08-24 06:08:38 +00:00
obj1 = selectedSkuId ( 9662 ) ;
2026-07-29 08:29:29 +00:00
const giftStyle = obj1 . useNativeGiftContext ( ) . giftStyle ;
let obj2 = selectedSkuId ( 589 ) ;
2026-07-23 10:11:24 +00:00
let items = [ closure_8 ] ;
2026-07-29 08:29:29 +00:00
const stateFromStores = obj2 . useStateFromStores ( items , ( ) = > closure_8 . get ( selectedSkuId ) ) ;
2026-08-24 06:08:38 +00:00
let obj3 = selectedSkuId ( 10416 ) ;
2026-07-29 08:29:29 +00:00
const fetchCollectiblesProduct = obj3 . useFetchCollectiblesProduct ( selectedSkuId ) ;
2026-07-20 16:05:17 +00:00
const product = fetchCollectiblesProduct . product ;
React = product ;
let isFetching = fetchCollectiblesProduct . isFetching ;
const items1 = [ selectedSkuId ] ;
const effect = React . useEffect ( ( ) = > {
if ( null != selectedSkuId ) {
2026-08-24 06:08:38 +00:00
const collectiblesProduct = selectedSkuId ( 5305 ) . fetchCollectiblesProduct ( tmp ) ;
const obj = selectedSkuId ( 5305 ) ;
2026-07-20 16:05:17 +00:00
}
} , items1 ) ;
const items2 = [ product , currentUser , selectedSkuId ] ;
2026-07-23 10:11:24 +00:00
memo = React . useMemo ( ( ) = > {
2026-07-29 08:29:29 +00:00
if ( null != c5 ) {
if ( null != tmp . googleSkuIds ) {
const googleSkuIds = tmp . googleSkuIds ;
2026-08-24 06:08:38 +00:00
if ( obj . isPremium ( currentUser , closure_1_10 . TIER_2 ) ) {
2026-07-29 08:29:29 +00:00
let tmp2 = googleSkuIds [ tmp10 . MOBILE_PREMIUM_TIER_2 ] ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp2 = googleSkuIds [ tmp10 . MOBILE ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( null == tmp2 ) {
const items = [ tmp2 ] ;
2026-07-20 16:05:17 +00:00
let values = items ;
} else {
const _Object = Object ;
2026-07-29 08:29:29 +00:00
values = Object . values ( tmp . googleSkuIds ) ;
2026-07-20 16:05:17 +00:00
}
return values ;
}
}
2026-08-24 06:08:38 +00:00
closure_1_13 . warn ( "No googleSkuIds available for product: " + selectedSkuId ) ;
2026-07-20 16:05:17 +00:00
return [ ] ;
} , items2 ) ;
const items3 = [ memo ] ;
2026-07-23 10:11:24 +00:00
memo1 = React . useMemo ( ( ) = > {
2026-07-20 16:05:17 +00:00
const sorted = memo . sort ( ) ;
return sorted . join ( "," ) ;
} , items3 ) ;
const items4 = [ memo , first , memo1 ] ;
const effect1 = React . useEffect ( ( ) = > {
function _loadGoogleSkus() {
2026-07-29 08:29:29 +00:00
const self = this ;
const tmp = currentUser ( function * ( ) {
if ( c5 === 2 ) {
c5 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp6 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
return { value : "HermesInternal" , done : null } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c5 = 2 ;
if ( 0 === ref ) {
if ( arg0 === 1 ) {
c5 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c5 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp3 ;
2026-07-29 08:29:29 +00:00
let callback = tmp7 ;
2026-08-24 06:08:38 +00:00
if ( null == closure_1_7 ) {
if ( 0 !== closure_1_6 . length ) {
if ( ! closure_1_1 ) {
closure_1_2 ( true ) ;
c3 = 1 ;
obj1 = callback ( closure_2_2 [ 16 ] ) ;
2026-07-29 08:29:29 +00:00
ref = 2 ;
c5 = 1 ;
obj1 = { value : null , done : false } ;
obj1 [ 0 ] = obj1 . loadInAppSkus ( tmp27 ) ;
return obj1 ;
}
}
}
}
} else {
if ( 1 === tmp7 ) {
c3 = 0 ;
callback = closure_2 ;
2026-08-24 06:08:38 +00:00
closure_2_13 . error ( "Unable to fetch product IDs from Google Play store:" , callback ) ;
closure_1_2 ( false ) ;
2026-07-29 08:29:29 +00:00
} else if ( arg0 === 1 ) {
c5 = 3 ;
throw arg1 ;
} else if ( arg0 !== 2 ) {
2026-08-24 06:08:38 +00:00
if ( null != closure_1_7 ) {
ref . current [ closure_1_7 ] = true ;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
closure_1_2 ( false ) ;
2026-07-29 08:29:29 +00:00
c3 = 0 ;
}
c3 = 0 ;
c5 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
}
c5 = 3 ;
} catch ( tmp33 ) {
closure_2 = tmp33 ;
if ( tmp4 === c3 ) {
c5 = tmp2 ;
throw tmp33 ;
} else {
ref = tmp ;
}
}
}
} ) ;
2026-08-24 06:08:38 +00:00
closure_0 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
! ( function loadGoogleSkus() {
2026-07-29 08:29:29 +00:00
const self = this ;
const apply = _loadGoogleSkus . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
2026-07-20 16:05:17 +00:00
} , items4 ) ;
2026-07-29 08:29:29 +00:00
let tmp14 = product ;
2026-07-20 16:05:17 +00:00
if ( null == product ) {
2026-07-29 08:29:29 +00:00
obj = { skuId : null , googleSkuIds : null } ;
obj [ 0 ] = selectedSkuId ;
obj [ 1 ] = { } ;
tmp14 = obj ;
2026-07-20 16:05:17 +00:00
}
obj = {
2026-07-29 08:29:29 +00:00
product : tmp14 ,
2026-07-20 16:05:17 +00:00
onPurchaseComplete() {
2026-08-24 06:08:38 +00:00
first ( 4346 ) . hideActionSheet ( ) ;
2026-07-20 16:05:17 +00:00
} ,
onPurchaseError() {
2026-07-29 08:29:29 +00:00
logger . error ( "Purchase error occurred" ) ;
2026-07-20 16:05:17 +00:00
} ,
onPurchasePending() {
2026-07-29 08:29:29 +00:00
logger . info ( "Purchase is pending" ) ;
2026-07-20 16:05:17 +00:00
} ,
giftParams : { isGift : true , options : { recipient_id : giftRecipientId , custom_message : giftMessage , gift_style : giftStyle } }
} ;
2026-08-24 06:08:38 +00:00
closure_8 = tmp ( 12020 ) ( obj ) ;
2026-07-20 16:05:17 +00:00
const items5 = [ product ] ;
2026-07-29 08:29:29 +00:00
[ tmp16 , tmp17 ] = callback ( obj . useMemo ( ( ) = > {
2026-07-23 10:11:24 +00:00
if ( null == c5 ) {
let items = [ "Loading..." , "Loading..." ] ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
items = [ selectedSkuId ( 5318 ) . getFormattedPriceForCollectiblesProduct ( tmp , true , true ) , ] ;
const obj = selectedSkuId ( 5318 ) ;
items [ 1 ] = selectedSkuId ( 5318 ) . getFormattedPriceForCollectiblesProduct ( tmp , false , true ) ;
const obj2 = selectedSkuId ( 5318 ) ;
2026-07-20 16:05:17 +00:00
}
return items ;
} , items5 ) , 2 ) ;
if ( ! isFetching ) {
isFetching = first ;
}
if ( ! isFetching ) {
isFetching = null == product ;
}
2026-07-29 08:29:29 +00:00
obj1 = { spacing : 24 , style : obj2 , children : null } ;
2026-07-20 16:05:17 +00:00
obj2 = { paddingTop : rect.top , paddingBottom : rect.bottom , paddingHorizontal : 12 } ;
let name ;
2026-07-29 08:29:29 +00:00
if ( stateFromStores != null ) {
2026-07-20 16:05:17 +00:00
name = stateFromStores . name ;
}
2026-07-29 08:29:29 +00:00
const items6 = [ "Gifting " , name , " to " , giftRecipientId , " " , "\n" , "Regular price: " , tmp17 , " " , "\n" , "Premium price: " , tmp16 , " " , "\n" ] ;
2026-07-20 16:05:17 +00:00
let str = "No message" ;
if ( null != giftMessage ) {
str = "No message" ;
if ( "" !== giftMessage ) {
2026-07-29 08:29:29 +00:00
let _HermesInternal = HermesInternal ;
2026-07-20 16:05:17 +00:00
str = "Message: " + giftMessage ;
}
}
items6 [ 14 ] = str ;
2026-08-24 06:08:38 +00:00
const items7 = [ closure_11 ( selectedSkuId ( 4739 ) . Text , { variant : "text-md/medium" , color : "text-overlay-light" , children : items6 } ) , , ] ;
2026-07-20 16:05:17 +00:00
let str4 = "Send Gift" ;
if ( isFetching ) {
str4 = "Loading..." ;
}
2026-08-24 06:08:38 +00:00
obj3 = { children : tmp21 ( tmp7 ( 4750 ) . Button , obj4 ) } ;
items7 [ 1 ] = closure_12 ( selectedSkuId ( 6323 ) . Card , obj3 ) ;
2026-07-29 08:29:29 +00:00
const obj5 = { children : null } ;
2026-07-23 10:11:24 +00:00
const items8 = [ "Select style: " , giftStyle ] ;
2026-08-24 06:08:38 +00:00
const items9 = [ closure_11 ( selectedSkuId ( 4739 ) . Text , { variant : "text-md/medium" , color : "text-overlay-light" , children : items8 } ) , closure_12 ( first ( 9635 ) , { } ) ] ;
2026-07-29 08:29:29 +00:00
obj5 [ 0 ] = items9 ;
2026-08-24 06:08:38 +00:00
items7 [ 2 ] = closure_11 ( selectedSkuId ( 6323 ) . Card , obj5 ) ;
2026-07-29 08:29:29 +00:00
obj1 [ 2 ] = items7 ;
2026-08-24 06:08:38 +00:00
return closure_11 ( selectedSkuId ( 4738 ) . Stack , obj1 ) ;
2026-07-20 16:05:17 +00:00
}
function SimpleRequestOTPActionSheet ( giftMessage ) {
( { selectedSkuId , requestType , giftRecipientId } = giftMessage ) ;
2026-07-29 08:29:29 +00:00
let _require ;
let obj = _require ( 514 ) ;
2026-07-20 16:05:17 +00:00
const v4Result = obj . v4 ( ) ;
2026-07-29 08:29:29 +00:00
_require = v4Result ;
2026-07-20 16:05:17 +00:00
[ ] [ 0 ] = v4Result ;
if ( "giftSku" === requestType ) {
if ( null != selectedSkuId ) {
if ( null != giftRecipientId ) {
2026-07-29 08:29:29 +00:00
obj = { basePurchaseAnalytics : null , onClose : null , setCurrentAnalyticsStep : null , children : null } ;
obj [ 0 ] = tmp4 ;
obj [ 1 ] = function onClose() {
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
} ;
obj [ 2 ] = function setCurrentAnalyticsStep() {
2026-07-20 16:05:17 +00:00
} ;
2026-07-29 08:29:29 +00:00
obj = { selectedSkuId : null , giftRecipientId : null , giftMessage : null } ;
obj [ 0 ] = selectedSkuId ;
obj [ 1 ] = giftRecipientId ;
obj [ 2 ] = giftMessage . giftMessage ;
obj [ 3 ] = callback2 ( GiftPurchaseSKUView , obj ) ;
2026-08-24 06:08:38 +00:00
let tmp6Result = callback2 ( tmp ( 9662 ) . NativeGiftContextProvider , obj ) ;
2026-07-29 08:29:29 +00:00
let tmp8 = callback2 ;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
obj1 = { children : null } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = tmp6Result ;
2026-08-24 06:08:38 +00:00
return tmp8 ( tmp ( 6988 ) . BottomSheet , obj1 ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
tmp8 = callback2 ;
2026-08-24 06:08:38 +00:00
const items = [ callback2 ( _require ( 4739 ) . Text , { variant : "text-lg/bold" , color : "text-feedback-warning" , children : "Gift purchasing is the only supported feature on Android in this version." } ) , ] ;
2026-07-20 16:05:17 +00:00
let str = "none" ;
if ( null != requestType ) {
str = requestType ;
}
2026-07-29 08:29:29 +00:00
const obj2 = { children : null } ;
2026-07-23 10:11:24 +00:00
const items1 = [ "Request type: " , str ] ;
2026-08-24 06:08:38 +00:00
items [ 1 ] = closure_11 ( _require ( 4739 ) . Text , { variant : "text-md/normal" , color : "text-feedback-warning" , children : items1 } ) ;
2026-07-29 08:29:29 +00:00
obj2 [ 0 ] = items ;
tmp6Result = tmp6 ( View , obj2 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
( { jsxs : unpackModuleId , jsx : closure_12 } = jsxProd ) ;
2026-08-24 06:08:38 +00:00
let closure_13 = new timestampDefault ( "PaymentFlowTest.android" ) ;
const tmp3 = new timestampDefault ( "PaymentFlowTest.android" ) ;
const result = require ( "set" ) . fileFinishedImporting ( "modules/billing/native/otp/SimpleRequestOTPActionSheet.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default function SimpleCreateOTPActionSheetWrapper ( arg0 ) {
2026-07-29 08:29:29 +00:00
let obj = { skuIDs : [ ] , activeSubscription : null , children : null } ;
2026-07-20 16:05:17 +00:00
obj = { } ;
const merged = Object . assign ( arg0 ) ;
2026-07-29 08:29:29 +00:00
obj [ 2 ] = callback2 ( SimpleRequestOTPActionSheet , obj ) ;
2026-08-24 06:08:38 +00:00
return callback2 ( NativePaymentContextProvider . NativePaymentContextProvider , obj ) ;
2026-07-20 16:05:17 +00:00
} ;