decord/source/actions/native/AlertActionCreators.tsx

235 lines
6.4 KiB
TypeScript
Raw Normal View History

2026-09-03 10:05:34 +00:00
// Module ID: 4859
// Function ID: 4860
// Dependencies: [19, 21, 4445, 706, 4860, 1233, 4864, 4948, 4948, 2008, 2]
2026-07-20 16:05:17 +00:00
2026-09-03 10:05:34 +00:00
// Module 4859
2026-08-24 06:08:38 +00:00
import noopAll from "noop" /* 19 */;
2026-09-02 09:53:35 +00:00
import dispatcherDefault from "dispatcher" /* 706 */;
2026-09-03 10:05:34 +00:00
import useAlertStore from "useAlertStore" /* 4860 */;
2026-08-24 06:08:38 +00:00
import jsxProd from "jsxProd" /* 21 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
noopAll;
2026-07-29 08:29:29 +00:00
({ jsx: c3, Fragment: c4, jsxs: c5 } = jsxProd);
2026-07-23 10:11:24 +00:00
let c6 = null;
let c7 = 0;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("actions/native/AlertActionCreators.tsx");
2026-07-23 10:11:24 +00:00
export default {
2026-07-20 16:05:17 +00:00
openLazy(hideActionSheet) {
let flag = hideActionSheet.hideActionSheet;
if (flag === undefined) {
flag = true;
}
let flag2 = hideActionSheet.isDismissable;
if (flag2 === undefined) {
flag2 = false;
}
return hideActionSheet.importer().then((alert) => {
if (flag) {
2026-08-24 06:08:38 +00:00
let obj = flag2(closure_1_2[2]);
2026-07-20 16:05:17 +00:00
obj.hideActionSheet();
}
obj = { type: "ALERT_OPEN", alert, isDismissable: flag2 };
2026-08-24 06:08:38 +00:00
flag2(closure_1_2[3]).dispatch(obj);
2026-07-20 16:05:17 +00:00
});
},
close() {
2026-07-23 10:11:24 +00:00
if (null != c6) {
c6 = null;
2026-08-24 06:08:38 +00:00
useAlertStore.dismissAlert(tmp);
const obj = useAlertStore;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
dispatcherDefault.dispatch({ type: "ALERT_CLOSE" });
2026-07-20 16:05:17 +00:00
},
show(hideActionSheet) {
let flag = hideActionSheet.hideActionSheet;
if (flag === undefined) {
flag = true;
}
({ isDismissable, confirmText } = hideActionSheet);
if (confirmText === undefined) {
2026-09-02 09:53:35 +00:00
const intl = confirmText(1233).intl;
confirmText = intl.string(confirmText(1233).t.BddRzS);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let merged = Object.assign(hideActionSheet, Object.create(null));
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-20 16:05:17 +00:00
let callback;
2026-07-23 10:11:24 +00:00
c4 = undefined;
2026-08-24 06:08:38 +00:00
c5 = undefined;
2026-08-31 15:47:37 +00:00
let obj = {};
let merged1 = Object.assign(merged);
obj.confirmText = confirmText;
obj.isDismissable = isDismissable;
({ body, confirmText: confirmText2 } = obj);
let tmp5 = null != body && typeof body !== "string";
if (tmp5) {
const _Array = Array;
tmp5 = !Array.isArray(body);
}
let tmp7 = null == obj.title;
if (!tmp7) {
tmp7 = "" === obj.title;
}
if (!tmp7) {
tmp7 = null != confirmText2 && typeof confirmText2 !== "string";
const tmp8 = null != confirmText2 && typeof confirmText2 !== "string";
}
if (!tmp7) {
tmp7 = tmp5;
}
if (!tmp7) {
tmp7 = null != obj.footer;
}
if (!tmp7) {
tmp7 = null != obj.helpText;
}
if (!tmp7) {
tmp7 = null != obj.renderConfirmButton;
}
if (!tmp7) {
tmp7 = null != obj.renderConfirmIcon;
}
if (!tmp7) {
tmp7 = null != obj.renderConfirmRightIcon;
}
if (!tmp7) {
tmp7 = true === obj.noDefaultButtons;
}
if (!tmp7) {
tmp7 = null != obj.secondaryConfirmText;
}
if (!tmp7) {
tmp7 = null != obj.onConfirmSecondary;
}
if (!tmp7) {
tmp7 = true === obj.isConfirmButtonDisabled;
}
if (!tmp7) {
tmp7 = null != obj.confirming;
}
if (!tmp7) {
tmp7 = null != obj.style;
}
if (!tmp7) {
tmp7 = true === obj.fillCancelText;
}
if (!tmp7) {
tmp7 = false === obj.autoCloseOnConfirm;
}
if (!tmp7) {
tmp7 = null != obj.onClose;
}
if (!tmp7) {
if (flag) {
2026-09-01 10:26:29 +00:00
let obj3 = merged(4445);
2026-08-31 15:47:37 +00:00
obj3.hideActionSheet();
}
if (null != c6) {
2026-09-03 10:05:34 +00:00
let obj4 = confirmText(4860);
2026-08-31 15:47:37 +00:00
obj4.dismissAlert(c6);
}
2026-09-02 09:53:35 +00:00
merged(706).dispatch({ type: "ALERT_CLOSE" });
2026-08-31 15:47:37 +00:00
closure_7 = tmp27 + 1;
const text = `legacy-alert-${tmp27}`;
dependencyMap = text;
c6 = text;
({ cancelText, onConfirm: c3, onCancel: c4 } = merged);
c5 = false;
({ title, body: body2, children, confirmColor } = merged);
2026-09-03 10:05:34 +00:00
const obj7 = confirmText(4860);
2026-08-31 15:47:37 +00:00
obj = { title: null, content: null, extraContent: null, actions: null };
obj[0] = title;
obj[1] = body2;
obj[2] = children;
obj = { variant: null, text: null, onPress: null };
2026-09-02 09:53:35 +00:00
const obj6 = merged(706);
2026-08-31 15:47:37 +00:00
const tmp29 = confirmText;
const tmp31 = c5;
const tmp32 = c4;
2026-09-03 10:05:34 +00:00
obj[0] = confirmText(4948).getAlertButtonVariant(confirmColor);
2026-08-31 15:47:37 +00:00
obj[1] = confirmText;
obj[2] = function onPress() {
c5 = true;
if (c3 != null) {
tmp();
2026-07-20 16:05:17 +00:00
}
2026-08-31 15:47:37 +00:00
};
2026-09-03 10:05:34 +00:00
const items = [callback(confirmText(4864).AlertActionButton, obj), ];
2026-08-31 15:47:37 +00:00
let tmp30Result = null;
if (null != cancelText) {
obj1 = { variant: "secondary", text: null, onPress: null };
obj1[1] = cancelText;
2026-07-29 08:29:29 +00:00
obj1[2] = function onPress() {
2026-08-24 06:08:38 +00:00
c5 = true;
2026-08-31 15:47:37 +00:00
if (c4 != null) {
2026-07-29 08:29:29 +00:00
tmp();
}
2026-07-20 16:05:17 +00:00
};
2026-09-03 10:05:34 +00:00
tmp30Result = tmp30(tmp29(4864).AlertActionButton, obj1);
2026-08-31 15:47:37 +00:00
}
const obj2 = { children: null };
items[1] = tmp30Result;
obj2[0] = items;
obj[3] = tmp31(tmp32, obj2);
obj3 = { dismissable: null };
obj3[0] = true === isDismissable;
2026-09-03 10:05:34 +00:00
obj7.openAlert(text, callback(confirmText(4864).AlertModal, obj), () => {
2026-08-31 15:47:37 +00:00
if (!c5) {
if (c4 != null) {
tmp();
2026-07-20 16:05:17 +00:00
}
2026-08-31 15:47:37 +00:00
}
if (c6 === c2) {
c6 = null;
}
}, obj3);
2026-09-03 10:05:34 +00:00
const obj10 = confirmText(4948);
2026-08-31 15:47:37 +00:00
} else {
if (null != c6) {
2026-09-03 10:05:34 +00:00
obj1 = confirmText(4860);
2026-08-31 15:47:37 +00:00
obj1.dismissAlert(c6);
c6 = null;
}
const self = this;
obj4 = { importer: null, hideActionSheet: null, isDismissable: null };
obj4[0] = function importer() {
return confirmText(_undefined[9])(_undefined[8], _undefined.paths).then((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0.default;
2026-07-20 16:05:17 +00:00
return (arg0) => {
const obj = {};
2026-08-24 06:08:38 +00:00
merged = Object.assign(arg0);
const merged1 = Object.assign(closure_1_1);
2026-07-29 08:29:29 +00:00
obj.confirmText = closure_0;
2026-08-24 06:08:38 +00:00
return closure_2_3(closure_0, obj);
2026-07-20 16:05:17 +00:00
};
});
2026-08-31 15:47:37 +00:00
};
obj4[1] = flag;
obj4[2] = isDismissable;
this.openLazy(obj4);
}
2026-07-20 16:05:17 +00:00
},
confirm(arg0) {
2026-07-23 10:11:24 +00:00
const self = this;
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-20 16:05:17 +00:00
return new Promise((arg0) => {
2026-07-29 08:29:29 +00:00
const callback = arg0;
2026-07-20 16:05:17 +00:00
const obj = {
onConfirm() {
2026-07-23 10:11:24 +00:00
callback(true);
2026-07-29 08:29:29 +00:00
},
cancelText: null,
onCancel: null
2026-07-20 16:05:17 +00:00
};
2026-08-24 06:08:38 +00:00
const intl = callback(closure_1_2[5]).intl;
obj[1] = intl.string(callback(closure_1_2[5]).t["ETE/oC"]);
2026-07-29 08:29:29 +00:00
obj[2] = function onCancel() {
2026-07-23 10:11:24 +00:00
callback(false);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(callback);
self.show(obj);
2026-07-20 16:05:17 +00:00
});
}
};