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

175 lines
6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 7974
// Function ID: 7975
2026-07-20 16:05:17 +00:00
// Name: notSupported
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 32, 19, 5324, 3, 589, 12, 7700, 4057, 2]
2026-07-29 08:29:29 +00:00
// Exports: useCancelSubscription, useCreateSubscription, useGoogleSkuIds, useNativeIAPPayments, useResubscribeSubscription
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 7974 (notSupported)
import timestampDefault from "timestamp" /* 3 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "_slicedToArray" /* 32 */;
import closure_5 from "noop" /* 19 */;
import closure_6 from "updateProduct" /* 5324 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function notSupported() {
2026-08-24 06:08:38 +00:00
error = new Error("Native hook not supported for android");
2026-07-20 16:05:17 +00:00
throw error;
}
function notSupportedReturnVoid() {
2026-08-24 06:08:38 +00:00
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) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
const items = [closure_6];
2026-07-29 08:29:29 +00:00
isFetchingGoogleSkus = _require(isFetchingGoogleSkus[5]).useStateFromStores(items, () => fetchingGoogleSkus.isFetchingGoogleSkus());
2026-08-24 06:08:38 +00:00
closure_3 = React.useRef([]);
2026-07-20 16:05:17 +00:00
const fetchError = callback(React.useState(null), 2);
2026-07-23 10:11:24 +00:00
callback = fetchError[1];
2026-07-20 16:05:17 +00:00
const items1 = [arg1, isFetchingGoogleSkus, arg0];
const effect = React.useEffect(() => {
2026-07-29 08:29:29 +00:00
function _fetch() {
const self = this;
const tmp = callback(function*() {
if (c5 === 2) {
c5 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp7 === 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 === v0) {
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;
c0 = tmp5;
2026-07-29 08:29:29 +00:00
c0 = undefined;
2026-08-24 06:08:38 +00:00
if (closure_1) {
2026-07-29 08:29:29 +00:00
ref.current = [];
}
2026-08-24 06:08:38 +00:00
const differenceResult = closure_2_1(closure_2_2[6]).difference(closure_1_0, ref.current);
2026-07-29 08:29:29 +00:00
c0 = differenceResult;
2026-08-24 06:08:38 +00:00
if (!closure_1_2) {
2026-07-29 08:29:29 +00:00
if (!tmp47) {
if (0 !== arr.length) {
if (0 !== differenceResult.length) {
ref = 1;
v0 = 2;
c5 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
obj1[0] = callback(closure_2_2[7]).loadInAppSkus(differenceResult);
2026-07-29 08:29:29 +00:00
return obj1;
}
}
}
}
2026-08-24 06:08:38 +00:00
arr = closure_1_0;
const obj4 = closure_2_1(closure_2_2[6]);
tmp47 = closure_1;
2026-07-29 08:29:29 +00:00
}
} else {
if (1 === tmp8) {
ref = 0;
2026-08-24 06:08:38 +00:00
closure_1 = closure_2;
closure_2_7.error("Unable to fetch product IDs from google play store: ", closure_1);
2026-07-29 08:29:29 +00:00
v0("Unable to fetch");
2026-08-24 06:08:38 +00:00
let obj2 = callback(closure_2_2[8]);
const result = obj2.captureBillingException(closure_1);
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
obj = closure_2_1(closure_2_2[6]);
2026-07-29 08:29:29 +00:00
ref.current = obj.union(ref.current, c0);
v0(null);
ref = 0;
}
ref = 0;
c5 = 3;
obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
}
c5 = 3;
} catch (tmp38) {
closure_2 = tmp38;
if (tmp4 === ref) {
c5 = tmp2;
throw tmp38;
} else {
v0 = tmp;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
});
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);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult;
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 = _fetch.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
}, 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) {
2026-07-29 08:29:29 +00:00
HermesBuiltin.throwTypeError();
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj = { createSubscription: null, nativePaymentsConnected: null };
obj[0] = notSupportedReturnVoid;
obj[1] = closure_8.nativePaymentsConnected;
2026-07-20 16:05:17 +00:00
return obj;
}
}
2026-08-24 06:08:38 +00:00
let closure_7 = new timestampDefault("NativePaymentHooks.android.tsx");
2026-07-23 10:11:24 +00:00
let closure_8 = { nativePaymentsConnected: true, storeFront: null };
2026-08-24 06:08:38 +00:00
const tmp2 = new timestampDefault("NativePaymentHooks.android.tsx");
let result = require("set").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 };