decord/source/modules/payments/native/hooks/NativePaymentHooks.android.tsx

158 lines
5.4 KiB
TypeScript
Raw Normal View History

// Module ID: 9398
// Function ID: 9399
// Name: NativePaymentHooks
// Dependencies: [5, 32, 19, 7251, 3, 504, 12, 9399, 4246, 2]
2026-07-29 08:29:29 +00:00
// Exports: useCancelSubscription, useCreateSubscription, useGoogleSkuIds, useNativeIAPPayments, useResubscribeSubscription
2026-07-20 16:05:17 +00:00
// Module 9398 (NativePaymentHooks)
import LoggerDefault from "Logger" /* 3 */;
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
import IAPStore from "IAPStore" /* 7251 */;
2026-07-23 10:11:24 +00:00
const require = fn;
2026-07-20 16:05:17 +00:00
function notSupported() {
const error = new Error("Native hook not supported for android");
2026-07-20 16:05:17 +00:00
throw error;
}
function notSupportedReturnVoid() {
const error = new Error("Native hook not supported for android");
2026-07-20 16:05:17 +00:00
throw error;
}
function useNativeIAPPayments() {
return closure_8;
}
function useGoogleSkuIds(arg0, arg1) {
_require = arg0;
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
const items = [IAPStore];
isFetchingGoogleSkus = require("initialize").useStateFromStores(items, () => fetchingGoogleSkus.isFetchingGoogleSkus());
closure_3 = noop.useRef([]);
const fetchError = _slicedToArray(noop.useState(null), 2);
_slicedToArray = fetchError[1];
2026-07-20 16:05:17 +00:00
const items1 = [arg1, isFetchingGoogleSkus, arg0];
const effect = noop.useEffect(() => {
closure_0 = async function _fetch(arg0, value) {
if (c5 === 2) {
c5 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
} else if (tmp7 === 3) {
if (arg0 === 1) {
throw value;
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
2026-07-29 08:29:29 +00:00
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
c5 = 2;
if (0 === v2) {
if (arg0 === 1) {
c5 = 3;
throw value;
} else if (arg0 === 2) {
c5 = 3;
const obj6 = { value, done: true };
return obj6;
} else {
closure_1 = tmp3;
closure_0 = tmp5;
closure_128_0 = undefined;
if (closure_1) {
ref.current = [];
}
const differenceResult = closure_2_1(12).difference(closure_0, ref.current);
closure_128_0 = differenceResult;
if (!closure_2) {
if (!tmp46) {
if (0 !== arr.length) {
if (0 !== differenceResult.length) {
ref = 1;
v2 = 2;
c5 = 1;
const obj7 = { value: closure_2_0(9399).loadInAppSkus(differenceResult), done: false };
return obj7;
2026-07-29 08:29:29 +00:00
}
}
}
}
arr = closure_0;
const obj4 = closure_2_1(12);
tmp46 = closure_1;
}
} else {
if (1 === tmp8) {
2026-07-29 08:29:29 +00:00
ref = 0;
closure_128_1 = closure_2;
logger.error("Unable to fetch product IDs from google play store: ", closure_128_1);
v2("Unable to fetch");
const result = closure_2_0(4246).captureBillingException(closure_128_1);
const obj3 = closure_2_0(4246);
} else if (arg0 === 1) {
2026-07-29 08:29:29 +00:00
c5 = 3;
throw value;
} else if (arg0 !== 2) {
ref.current = closure_2_1(12).union(ref.current, closure_128_0);
v2(null);
ref = 0;
const obj = closure_2_1(12);
2026-07-29 08:29:29 +00:00
}
ref = 0;
2026-07-29 08:29:29 +00:00
c5 = 3;
const obj8 = { value, done: true };
return obj8;
}
c5 = 3;
} catch (tmp38) {
closure_2 = tmp38;
if (tmp4 === ref) {
c5 = tmp2;
throw tmp38;
} else {
v2 = tmp;
2026-07-20 16:05:17 +00:00
}
}
}
};
2026-07-23 10:11:24 +00:00
!(function fetch() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = closure_0.apply;
2026-07-29 08:29:29 +00:00
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
}, items1);
return { isFetchingGoogleSkus, fetchError: fetchError[0] };
}
function useResubscribeSubscription(arg0) {
2026-07-29 08:29:29 +00:00
return { resubscribeSubscription: notSupported, nativePaymentsConnected: closure_8.nativePaymentsConnected };
2026-07-20 16:05:17 +00:00
}
function useCancelSubscription(arg0, arg1) {
2026-07-29 08:29:29 +00:00
return { cancelSubscription: notSupported, nativePaymentsConnected: closure_8.nativePaymentsConnected };
2026-07-20 16:05:17 +00:00
}
function useCreateSubscription(arg0) {
if (arg0 == null) {
throw new TypeError("Cannot destructure 'undefined' or 'null'.");
2026-07-20 16:05:17 +00:00
} else {
const obj = { createSubscription: notSupportedReturnVoid, nativePaymentsConnected: closure_8.nativePaymentsConnected };
2026-07-20 16:05:17 +00:00
return obj;
}
}
let closure_7 = new LoggerDefault("NativePaymentHooks.android.tsx");
2026-07-23 10:11:24 +00:00
let closure_8 = { nativePaymentsConnected: true, storeFront: null };
const size = fn(2);
let result = size.fileFinishedImporting("modules/payments/native/hooks/NativePaymentHooks.android.tsx");
2026-07-20 16:05:17 +00:00
export default { useNativeIAPPayments, useGoogleSkuIds, useCreateSubscription, useCancelSubscription, useResubscribeSubscription };
export { useNativeIAPPayments };
export { useGoogleSkuIds };
export { useResubscribeSubscription };
export { useCancelSubscription };
export { useCreateSubscription };