240 lines
10 KiB
TypeScript
240 lines
10 KiB
TypeScript
// Module ID: 14581
|
|
// Function ID: 14582
|
|
// Name: QUEST_PROGRESS_DIAMETER_BY_SIZE
|
|
// Dependencies: [19, 17, 4372, 21, 4120, 7985, 4380, 712, 589, 4381, 4949, 1236, 5825, 14582, 11329, 2]
|
|
|
|
// Module 14581 (QUEST_PROGRESS_DIAMETER_BY_SIZE)
|
|
import set from "set" /* 2 */;
|
|
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
|
|
import ThemesDefault from "Themes" /* 712 */;
|
|
import inlineStyles from "inlineStyles" /* 7985 */;
|
|
import noop from "noop" /* 19 */;
|
|
import importDefaultResult from "noop" /* 19 */;
|
|
import closure_8 from "maybeApplyNoTextColorForLightCustomTheme" /* 4372 */;
|
|
import jsxProd from "jsxProd" /* 21 */;
|
|
import createCacheKey from "createCacheKey" /* 4380 */;
|
|
import importDefaultResult1 from "module_4120" /* 4120 */;
|
|
|
|
({ useMemo: c3, useEffect: c4, useRef: c5 } = noop);
|
|
const View = get_ActivityIndicator.View;
|
|
({ jsx: c9, jsxs: c10 } = jsxProd);
|
|
let closure_11 = ["#666777", "#535564"];
|
|
let closure_12 = importDefaultResult1.createAnimatedComponent(inlineStyles.Circle);
|
|
let obj = { "x-sm": 40, sm: 64, md: 70, "md-lg": 100, lg: 128 };
|
|
let closure_14 = createCacheKey.createStyles((arg0) => {
|
|
obj = { wrapper: { position: "relative" }, container: { position: "relative", display: "flex", justifyContent: "center", alignItems: "center", zIndex: 1 }, completionGlow: { shadowOffset: { width: 0, height: 0 }, shadowRadius: 20, shadowOpacity: 0, elevation: 4, shadowColor: "#30C77399" }, canvas: { transform: items }, imageContainer: null, progressPath: null, confetti: null, opacityMask: null };
|
|
items = [{ rotate: "-90deg" }];
|
|
obj = { position: "absolute", height: 0.78 * arg0, width: 0.78 * arg0, borderRadius: ThemesDefault.radii.round, overflow: "hidden" };
|
|
obj[4] = obj;
|
|
obj = { color: ThemesDefault.colors.STATUS_POSITIVE };
|
|
obj[5] = obj;
|
|
obj[6] = { position: "absolute", pointerEvents: "none" };
|
|
obj[7] = { backgroundColor: ThemesDefault.colors.CARD_BACKGROUND_DEFAULT, position: "absolute", top: 0, left: 0, right: 0, bottom: 0, zIndex: 2 };
|
|
return obj;
|
|
});
|
|
let closure_15 = { code: "function QuestProgressIndicatorTsx1(){const{glowOpacity}=this.__closure;return{shadowOpacity:glowOpacity.get()};}" };
|
|
let closure_16 = { code: "function QuestProgressIndicatorTsx2(){const{circumference,animatedProgress}=this.__closure;return{strokeDashoffset:circumference-circumference*animatedProgress.get()};}" };
|
|
let closure_17 = { code: "function QuestProgressIndicatorTsx3(){const{underlayOpacity,styles}=this.__closure;return{opacity:underlayOpacity.get(),...styles.opacityMask};}" };
|
|
const memoResult = importDefaultResult.memo(function QuestProgressIndicator(loading) {
|
|
({ quest, size, progress } = loading);
|
|
let flag = loading.loading;
|
|
if (flag === undefined) {
|
|
flag = false;
|
|
}
|
|
let flag2 = loading.hasConfetti;
|
|
if (flag2 === undefined) {
|
|
flag2 = false;
|
|
}
|
|
({ onPress, accessibilityLabel } = loading);
|
|
let stateFromStores;
|
|
let callback;
|
|
let callback2;
|
|
let callback3;
|
|
importDefaultResult = undefined;
|
|
let sharedValue;
|
|
let sharedValue1;
|
|
closure_9 = undefined;
|
|
let sharedValue2;
|
|
dependencyMap = undefined;
|
|
obj = progress(stateFromStores[8]);
|
|
let items = [sharedValue1];
|
|
stateFromStores = obj.useStateFromStores(items, () => sharedValue1.useReducedMotion);
|
|
const tmp4 = { "x-sm": 3, sm: 3, md: 3, "md-lg": 4, lg: 6 }[size];
|
|
callback = tmp5;
|
|
const tmp6 = { "x-sm": 1.6, sm: 1, md: 1.4, "md-lg": 1.5, lg: 1.6 }[size];
|
|
callback2 = tmp6;
|
|
const diff = tmp5 / 2 - tmp4 / 2;
|
|
let result = 2 * Math.PI * diff;
|
|
callback3 = result;
|
|
const tmp9 = callback4(obj[size]);
|
|
importDefaultResult = tmp9;
|
|
obj1 = progress(stateFromStores[4]);
|
|
sharedValue = obj1.useSharedValue(progress);
|
|
let obj2 = progress(stateFromStores[4]);
|
|
let num = 0;
|
|
if (flag) {
|
|
num = 0.7;
|
|
}
|
|
sharedValue1 = obj2.useSharedValue(num);
|
|
const userStatus = quest.userStatus;
|
|
let completedAt;
|
|
if (userStatus != null) {
|
|
completedAt = userStatus.completedAt;
|
|
}
|
|
closure_9 = tmp13;
|
|
let tmpResult = tmp(tmp2[4]);
|
|
let num2 = 0;
|
|
if (null != completedAt) {
|
|
num2 = 1;
|
|
}
|
|
sharedValue2 = tmpResult.useSharedValue(num2);
|
|
tmpResult = tmp(tmp2[4]);
|
|
class T {
|
|
constructor() {
|
|
obj = { shadowOpacity: closure_10.get() };
|
|
return obj;
|
|
}
|
|
}
|
|
T.__closure = { glowOpacity: sharedValue2 };
|
|
T.__workletHash = 17183837725505;
|
|
T.__initData = closure_15;
|
|
const animatedStyle = tmpResult.useAnimatedStyle(T);
|
|
class D {
|
|
constructor() {
|
|
obj = { strokeDashoffset: closure_5 - closure_5 * closure_7.get() };
|
|
return obj;
|
|
}
|
|
}
|
|
D.__closure = { circumference: result, animatedProgress: sharedValue };
|
|
D.__workletHash = 17281152506254;
|
|
D.__initData = closure_16;
|
|
const animatedProps = progress(stateFromStores[4]).useAnimatedProps(D);
|
|
const tmpResult1 = progress(stateFromStores[4]);
|
|
class R {
|
|
constructor() {
|
|
obj = { opacity: closure_8.get() };
|
|
merged = Object.assign(closure_6.opacityMask);
|
|
return obj;
|
|
}
|
|
}
|
|
R.__closure = { underlayOpacity: sharedValue1, styles: tmp9 };
|
|
R.__workletHash = 4427598698568;
|
|
R.__initData = closure_17;
|
|
const items1 = [sharedValue, progress, stateFromStores];
|
|
const animatedStyle1 = progress(stateFromStores[4]).useAnimatedStyle(R);
|
|
callback2(() => {
|
|
let num = 500;
|
|
if (stateFromStores) {
|
|
num = 0;
|
|
}
|
|
const result = sharedValue.set(progress(stateFromStores[9]).withTiming(progress, { duration: num }));
|
|
return () => {
|
|
closure_1_0(closure_1_2[4]).cancelAnimation(closure_7);
|
|
};
|
|
}, items1);
|
|
const items2 = [sharedValue1, flag];
|
|
callback2(() => {
|
|
let num = 0;
|
|
if (flag) {
|
|
num = 0.7;
|
|
}
|
|
const result = sharedValue1.set(progress(stateFromStores[9]).withTiming(num, { duration: 500 }));
|
|
return () => {
|
|
closure_1_0(closure_1_2[4]).cancelAnimation(closure_8);
|
|
};
|
|
}, items2);
|
|
const tmp20 = callback3(null);
|
|
dependencyMap = tmp20;
|
|
const items3 = [tmp9.confetti, tmp6, obj[size]];
|
|
const items4 = [null != completedAt, sharedValue2, stateFromStores];
|
|
const tmpResult2 = progress(stateFromStores[4]);
|
|
callback2(() => {
|
|
if (!stateFromStores) {
|
|
if (closure_9) {
|
|
const result = sharedValue2.set(progress(stateFromStores[9]).withTiming(1, { duration: 500 }));
|
|
const current = ref.current;
|
|
if (current != null) {
|
|
current.play();
|
|
}
|
|
obj = progress(stateFromStores[9]);
|
|
}
|
|
}
|
|
const result1 = sharedValue2.set(0);
|
|
const current2 = ref.current;
|
|
if (current2 != null) {
|
|
current2.reset();
|
|
}
|
|
}, items4);
|
|
if (null == onPress) {
|
|
let PressableOpacity = importDefaultResult.Fragment;
|
|
} else {
|
|
PressableOpacity = tmp(tmp2[10]).PressableOpacity;
|
|
}
|
|
const rounded = Math.round(100 * progress);
|
|
if (null == onPress) {
|
|
obj = {};
|
|
} else {
|
|
obj = { onPress: null };
|
|
obj[0] = onPress;
|
|
}
|
|
obj = {};
|
|
let merged = Object.assign(obj);
|
|
obj1 = { style: items5, accessible: true, accessibilityRole: "progressbar", accessibilityLabel: null, accessibilityValue: null, children: null };
|
|
items5 = [, , ];
|
|
({ wrapper: arr6[0], completionGlow: arr6[1] } = tmp9);
|
|
items5[2] = animatedStyle;
|
|
let formatToPlainStringResult = accessibilityLabel;
|
|
if (accessibilityLabel == null) {
|
|
const intl = tmp(tmp2[11]).intl;
|
|
obj2 = { percent: null };
|
|
obj2[0] = rounded;
|
|
formatToPlainStringResult = intl.formatToPlainString(tmp(tmp2[11]).t.Gj8Jqn, obj2);
|
|
}
|
|
obj1[3] = formatToPlainStringResult;
|
|
obj1[4] = { min: 0, max: 100, now: rounded };
|
|
const items6 = [closure_9(flag(stateFromStores[4]).View, { style: animatedStyle1 }), ];
|
|
const obj3 = { style: tmp9.container, children: null };
|
|
const obj4 = { height: obj[size], width: obj[size], style: tmp9.canvas, children: null };
|
|
const obj5 = { children: null };
|
|
const obj6 = { id: "underlayGradient", x1: "0", y1: "0.5", x2: "1", y2: "0.5", children: null };
|
|
const items7 = [closure_9(progress(stateFromStores[5]).Stop, { offset: "0", stopColor: 19 }), closure_9(progress(stateFromStores[5]).Stop, { offset: "1", stopColor: 17 })];
|
|
obj6[5] = items7;
|
|
obj5[0] = sharedValue2(progress(stateFromStores[5]).LinearGradient, obj6);
|
|
const items8 = [closure_9(progress(stateFromStores[5]).Defs, obj5), closure_9(progress(stateFromStores[5]).Circle, { cx: obj[size] / 2, cy: obj[size] / 2, r: diff, fill: "none", stroke: "url(#underlayGradient)", strokeWidth: tmp4 }), closure_9(closure_12, { cx: obj[size] / 2, cy: obj[size] / 2, r: diff, fill: "none", stroke: tmp9.progressPath.color, strokeWidth: tmp4, strokeDasharray: result, strokeLinecap: "round", animatedProps })];
|
|
obj4[3] = items8;
|
|
const items9 = [sharedValue2(progress(stateFromStores[5]).Svg, obj4), , ];
|
|
let tmp25Result = null;
|
|
if (flag2) {
|
|
const obj11 = { ref: null, style: null, source: null, autoPlay: false, loop: false };
|
|
obj11[0] = tmp20;
|
|
obj11[1] = tmp21;
|
|
obj11[2] = tmp(tmp2[13]);
|
|
tmp25Result = tmp25(tmp28(tmp2[12]), obj11);
|
|
const tmp28Result = tmp28(tmp2[12]);
|
|
}
|
|
items9[1] = tmp25Result;
|
|
const obj10 = { cx: obj[size] / 2, cy: obj[size] / 2, r: diff, fill: "none", stroke: tmp9.progressPath.color, strokeWidth: tmp4, strokeDasharray: result, strokeLinecap: "round", animatedProps };
|
|
const obj7 = { offset: "0", stopColor: 19 };
|
|
const obj8 = { offset: "1", stopColor: 17 };
|
|
const obj9 = { cx: obj[size] / 2, cy: obj[size] / 2, r: diff, fill: "none", stroke: "url(#underlayGradient)", strokeWidth: tmp4 };
|
|
tmp21 = callback(() => {
|
|
obj = {};
|
|
const merged = Object.assign(closure_6.confetti);
|
|
obj.width = closure_3;
|
|
obj.height = closure_3;
|
|
obj = { scale: closure_4 };
|
|
const items = [obj];
|
|
obj.transform = items;
|
|
return obj;
|
|
}, items3);
|
|
items9[2] = closure_9(sharedValue, { style: tmp9.imageContainer, children: closure_9(flag(stateFromStores[14]), obj13) });
|
|
obj3[1] = items9;
|
|
items6[1] = sharedValue2(sharedValue, obj3);
|
|
obj1[5] = items6;
|
|
obj.children = sharedValue2(flag(stateFromStores[4]).View, obj1);
|
|
return closure_9(PressableOpacity, obj);
|
|
});
|
|
let result = set.fileFinishedImporting("modules/quests/native/QuestProgressIndicator.tsx");
|
|
|
|
export default memoResult;
|
|
export const QUEST_PROGRESS_DIAMETER_BY_SIZE = obj;
|