decord/source/modules/parent_tools/native/ChangeSpendingLimitModal.tsx

226 lines
8.9 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 14362
// Function ID: 14363
2026-07-29 08:29:29 +00:00
// Name: ChangeSpendingLimitScreen
2026-08-25 06:04:03 +00:00
// Dependencies: [5, 19, 17, 21, 4380, 712, 8113, 4376, 1236, 2337, 14363, 4098, 4340, 4611, 4097, 5962, 7952, 7953, 4813, 7935, 11495, 5257, 4815, 5376, 11497, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 14362 (ChangeSpendingLimitScreen)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import jsxProd from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function ChangeSpendingLimitScreen(teenId) {
2026-07-23 10:11:24 +00:00
let _require;
2026-07-20 16:05:17 +00:00
function _handleSave(arg0) {
2026-07-29 08:29:29 +00:00
const self = this;
2026-08-24 06:08:38 +00:00
const tmp = closure_1_3(function*() {
closure_0 = tmp3;
dependencyMap = 1;
yield closure_1_0();
2026-08-04 21:03:28 +00:00
if (1 === tmp7) {
dependencyMap = 0;
2026-08-25 06:04:03 +00:00
obj1 = closure_1_0(4097);
2026-08-24 06:08:38 +00:00
const intl = closure_1_0(1236).intl;
2026-08-25 06:04:03 +00:00
obj1.presentFailedToast(intl.string(v0(2337).Wu8BK2));
2026-08-24 06:08:38 +00:00
c3 = 3;
2026-08-04 21:03:28 +00:00
} else if (arg0 === 1) {
2026-07-29 08:29:29 +00:00
c3 = 3;
2026-08-04 21:03:28 +00:00
throw arg1;
} else if (arg0 !== 2) {
const obj2 = { key: "SPENDING_CONTROLS_CHANGED", content: null, IconComponent: null, iconColor: "status-positive" };
2026-08-24 06:08:38 +00:00
const intl2 = closure_1_0(1236).intl;
2026-08-25 06:04:03 +00:00
obj2[1] = intl2.string(v0(2337)["2WKfG1"]);
obj2[2] = closure_1_0(4340).CircleCheckIcon;
v0(4098).open(obj2);
let arr = v0(4611);
2026-08-04 21:03:28 +00:00
arr = arr.pop();
dependencyMap = 0;
2026-08-25 06:04:03 +00:00
const obj6 = v0(4098);
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
dependencyMap = 0;
return arg1;
2026-07-29 08:29:29 +00:00
});
2026-08-24 06:08:38 +00:00
closure_1 = 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-24 06:08:38 +00:00
let formatToPlainStringResult = callback2();
2026-08-25 06:04:03 +00:00
let obj = _require(14363);
2026-07-20 16:05:17 +00:00
const changeSpendingLimitFormState = obj.useChangeSpendingLimitFormState(teenId.teenId);
2026-07-29 08:29:29 +00:00
({ amountInput, isOverspending, canSave, isSubmitting, monthlySpend, save: c0 } = changeSpendingLimitFormState);
2026-07-20 16:05:17 +00:00
let formatPriceResult = null;
2026-07-29 08:29:29 +00:00
({ handleAmountChange, currencySymbol, exponent, isClearingCap, renewalDate } = changeSpendingLimitFormState);
2026-07-20 16:05:17 +00:00
if (null != monthlySpend) {
formatPriceResult = null;
if (monthlySpend > 0) {
2026-08-25 06:04:03 +00:00
formatPriceResult = tmp2(5962).formatPrice(monthlySpend, tmp5);
const tmp2Result = tmp2(5962);
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
obj = { spacing: _handleSave(712).space.PX_16, children: null };
2026-07-29 08:29:29 +00:00
obj = { variant: "text-sm/normal", children: null };
let intl = tmp2(1236).intl;
2026-08-25 06:04:03 +00:00
obj[1] = intl.string(_handleSave(2337).IFguF2);
const items = [callback(_require(4376).Text, obj), ];
2026-08-24 06:08:38 +00:00
obj1 = { spacing: _handleSave(712).space.PX_8, children: null };
2026-07-29 08:29:29 +00:00
let obj2 = { variant: "text-sm/semibold", color: "text-subtle", children: null };
let intl2 = tmp2(1236).intl;
2026-08-25 06:04:03 +00:00
obj2[2] = intl2.string(_handleSave(2337)["1fHSu2"]);
const items1 = [callback(_require(4376).Text, obj2), , ];
2026-07-29 08:29:29 +00:00
const obj3 = { accessibilityLabel: null, value: null, onChange: null, leadingText: null, placeholder: null, keyboardType: null, isClearable: true };
const intl3 = tmp2(1236).intl;
2026-08-25 06:04:03 +00:00
obj3[0] = intl3.string(_handleSave(2337)["1fHSu2"]);
2026-07-29 08:29:29 +00:00
obj3[1] = amountInput;
obj3[2] = handleAmountChange;
let tmp12;
2026-07-20 16:05:17 +00:00
if (tmp7) {
2026-07-29 08:29:29 +00:00
tmp12 = currencySymbol;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj3[3] = tmp12;
const intl4 = tmp2(1236).intl;
2026-08-25 06:04:03 +00:00
obj3[4] = intl4.string(_handleSave(2337).DjSv82);
2026-07-20 16:05:17 +00:00
let str = "number-pad";
if (exponent > 0) {
str = "decimal-pad";
}
2026-07-29 08:29:29 +00:00
obj3[5] = str;
2026-08-25 06:04:03 +00:00
const items2 = [callback(_require(7935).TextInput, obj3), ];
2026-07-29 08:29:29 +00:00
let tmp9Result = null;
2026-07-20 16:05:17 +00:00
if (isOverspending) {
2026-07-29 08:29:29 +00:00
const obj4 = { style: null, pointerEvents: "none" };
obj4[0] = formatToPlainStringResult.warningOverlay;
tmp9Result = tmp9(tmp11, obj4);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items2[1] = tmp9Result;
items1[1] = closure_7(closure_5, { children: items2 });
if (null == formatPriceResult) {
function handleSave() {
const self = this;
const apply = _handleSave.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}
const obj5 = { children: null };
items1[2] = null;
obj1[1] = items1;
2026-08-25 06:04:03 +00:00
items[1] = tmp8(tmp2(4813).Stack, obj1);
2026-07-29 08:29:29 +00:00
obj[1] = items;
2026-08-25 06:04:03 +00:00
obj5[0] = tmp8(tmp2(4813).Stack, obj);
const items3 = [tmp9(tmp2(7953).ModalContent, obj5), ];
2026-07-29 08:29:29 +00:00
if (isClearingCap) {
let obj6 = { variant: "destructive", text: null, onPress: null, disabled: null, loading: null };
const intl8 = tmp2(1236).intl;
2026-08-25 06:04:03 +00:00
obj6[1] = intl8.string(tmp10(2337).JZDGJ8);
2026-07-29 08:29:29 +00:00
obj6[2] = handleSave;
obj6[3] = isSubmitting;
obj6[4] = isSubmitting;
let obj7 = obj6;
} else {
obj7 = { text: null, onPress: null, disabled: null, loading: null };
const intl7 = tmp2(1236).intl;
obj7[0] = intl7.string(tmp2(1236).t["R3BPH+"]);
obj7[1] = handleSave;
let tmp16 = !canSave;
if (canSave) {
tmp16 = isSubmitting;
}
obj7[2] = tmp16;
obj7[3] = isSubmitting;
}
const obj8 = { children: null };
const obj9 = { children: null };
const obj10 = { children: null };
2026-08-25 06:04:03 +00:00
const items4 = [tmp9(tmp2(4815).Button, obj7), ];
2026-07-29 08:29:29 +00:00
const obj11 = { variant: "tertiary", text: null, onPress: null };
const intl9 = tmp2(1236).intl;
obj11[1] = intl9.string(tmp2(1236).t["ETE/oC"]);
2026-08-25 06:04:03 +00:00
obj11[2] = tmp10(4611).pop;
items4[1] = tmp9(tmp2(4815).Button, obj11);
2026-07-29 08:29:29 +00:00
obj10[0] = items4;
2026-08-25 06:04:03 +00:00
obj9[0] = tmp8(tmp2(5257).ButtonGroup, obj10);
items3[1] = tmp9(tmp2(11495).ModalFooter, obj9);
2026-07-29 08:29:29 +00:00
obj8[0] = items3;
2026-08-25 06:04:03 +00:00
return tmp8(tmp2(7952).ModalScreen, obj8);
2026-07-29 08:29:29 +00:00
} else if (isOverspending) {
const obj12 = { style: null, children: null };
obj12[0] = formatToPlainStringResult.warningRow;
const obj13 = { size: "xs", color: null };
obj13[1] = tmp10(712).colors.ICON_FEEDBACK_WARNING;
2026-08-25 06:04:03 +00:00
const items5 = [tmp9(tmp2(8113).WarningIcon, obj13), ];
2026-07-29 08:29:29 +00:00
const obj14 = { variant: "text-sm/normal", style: null, children: null };
obj14[1] = formatToPlainStringResult.warningText;
const intl6 = tmp2(1236).intl;
const obj15 = { amount: null, date: null };
obj15[0] = formatPriceResult;
obj15[1] = renewalDate;
2026-08-25 06:04:03 +00:00
formatToPlainStringResult = intl6.formatToPlainString(tmp10(2337).Tk6x4X, obj15);
2026-07-29 08:29:29 +00:00
obj14[2] = formatToPlainStringResult;
2026-08-25 06:04:03 +00:00
items5[1] = tmp9(tmp2(4376).Text, obj14);
2026-07-29 08:29:29 +00:00
obj12[1] = items5;
tmp9Result = tmp8(tmp11, obj12);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj16 = { variant: "text-sm/normal", color: "text-muted", children: null };
const intl5 = tmp2(1236).intl;
const obj17 = { amount: null };
obj17[0] = formatPriceResult;
2026-08-25 06:04:03 +00:00
obj16[2] = intl5.formatToPlainString(tmp10(2337).pfAlRY, obj17);
tmp9Result = tmp9(tmp2(4376).Text, obj16);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
({ View: c5, StyleSheet } = get_ActivityIndicator);
({ jsx: closure_6, jsxs: error } = jsxProd);
createCacheKey = { warningOverlay: null, warningRow: null, warningText: null };
createCacheKey = {};
const merged = Object.assign(StyleSheet.absoluteFillObject);
2026-08-24 06:08:38 +00:00
createCacheKey.borderRadius = ThemesDefault.modules.mobile.INPUT_FIELD_RADIUS_LG;
2026-07-29 08:29:29 +00:00
createCacheKey.borderWidth = 1;
2026-08-24 06:08:38 +00:00
createCacheKey.borderColor = ThemesDefault.colors.ICON_FEEDBACK_WARNING;
createCacheKey.backgroundColor = ThemesDefault.colors.BACKGROUND_FEEDBACK_WARNING;
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
2026-08-24 06:08:38 +00:00
createCacheKey[1] = { flexDirection: "row", gap: ThemesDefault.space.PX_8, alignItems: "flex-start" };
let obj1 = { flexDirection: "row", gap: ThemesDefault.space.PX_8, alignItems: "flex-start" };
createCacheKey[2] = { flex: 1, color: ThemesDefault.colors.ICON_FEEDBACK_WARNING };
let closure_8 = createCacheKey.createStyles(createCacheKey);
let obj2 = { flex: 1, color: ThemesDefault.colors.ICON_FEEDBACK_WARNING };
const result = require("set").fileFinishedImporting("modules/parent_tools/native/ChangeSpendingLimitModal.tsx");
2026-07-20 16:05:17 +00:00
export default function ChangeSpendingLimitModal(teenId) {
teenId = teenId.teenId;
const items = [teenId];
2026-07-29 08:29:29 +00:00
const memo = React.useMemo(() => {
let obj = { CHANGE_SPENDING_LIMIT: null };
2026-08-24 06:08:38 +00:00
obj = {
headerShown: true,
headerLeft: teenId(closure_1_2[23]).getHeaderCloseButton(closure_1_1(closure_1_2[13]).pop),
headerTitle() {
const obj = { variant: "text-md/semibold", children: null };
const intl = callback(1236).intl;
2026-08-25 06:04:03 +00:00
obj[1] = intl.string(callback2(2337).xMRO6A);
return callback3(callback(4376).Text, obj);
2026-08-24 06:08:38 +00:00
},
render() {
return closure_1_6(closure_1_9, { teenId: closure_0 });
}
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[0] = obj;
2026-07-20 16:05:17 +00:00
return obj;
2026-07-29 08:29:29 +00:00
}, items);
let obj = { initialRouteName: "CHANGE_SPENDING_LIMIT", screens: memo, headerBackTitle: null };
let intl = teenId(1236).intl;
obj[2] = intl.string(teenId(1236).t["13/7kX"]);
2026-08-25 06:04:03 +00:00
return callback(teenId(11497).Modal, obj);
2026-07-20 16:05:17 +00:00
};