185 lines
11 KiB
TypeScript
185 lines
11 KiB
TypeScript
/* Metro module 15328; source: modules/launchpad/native/shared/CutoutImage.tsx; dependencies: [57, 31, 27, 33, 491, 7744, 10255, 2] */
|
|
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Module07744 from '../../../../by-id/module-07744.js'; /* Metro dependency 7744 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as Module00491Module from '../../../../by-id/module-00491.js'; /* Metro dependency 491 */
|
|
|
|
function _fun117226(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117226, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15525:6, offset: 0x024a99e0, size: 199 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
value = value.memo(CutoutImage);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/launchpad/native/shared/CutoutImage.tsx');
|
|
exports.default = value;
|
|
function CutoutImage({style, cutoutTopLeftSize, cutoutTopLeftInsetX, cutoutTopLeftInsetY, cutoutTopRightSize, cutoutTopRightInsetX, cutoutTopRightInsetY, cutoutBottomLeftSize, cutoutBottomLeftInsetX, cutoutBottomLeftInsetY, cutoutBottomRightSize, cutoutBottomRightInsetX, cutoutBottomRightInsetY, imageSize, imageSource, imageBorderRadius = imageSize / 2, imageBackgroundColor, imageTintColor, clipInnerAmount, clipOuterAmount, borderStroke, borderStrokeColor}) { // fn#117227, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15525:173, offset: 0x024a9aa7, size: 1937 bytes, params: 2, frame: 53
|
|
var r17;
|
|
var ClipPath;
|
|
var object2;
|
|
cutoutTopLeftSize = cutoutTopLeftSize === undefined ? 0 : cutoutTopLeftSize;
|
|
cutoutTopLeftInsetX = cutoutTopLeftInsetX === undefined ? 0 : cutoutTopLeftInsetX;
|
|
cutoutTopLeftInsetY = cutoutTopLeftInsetY === undefined ? 0 : cutoutTopLeftInsetY;
|
|
cutoutTopRightSize = cutoutTopRightSize === undefined ? 0 : cutoutTopRightSize;
|
|
cutoutTopRightInsetX = cutoutTopRightInsetX === undefined ? 0 : cutoutTopRightInsetX;
|
|
cutoutTopRightInsetY = cutoutTopRightInsetY === undefined ? 0 : cutoutTopRightInsetY;
|
|
cutoutBottomLeftSize = cutoutBottomLeftSize === undefined ? 0 : cutoutBottomLeftSize;
|
|
cutoutBottomLeftInsetX = cutoutBottomLeftInsetX === undefined ? 0 : cutoutBottomLeftInsetX;
|
|
cutoutBottomLeftInsetY = cutoutBottomLeftInsetY === undefined ? 0 : cutoutBottomLeftInsetY;
|
|
cutoutBottomRightSize = cutoutBottomRightSize === undefined ? 0 : cutoutBottomRightSize;
|
|
cutoutBottomRightInsetX = cutoutBottomRightInsetX === undefined ? 0 : cutoutBottomRightInsetX;
|
|
cutoutBottomRightInsetY = cutoutBottomRightInsetY === undefined ? 0 : cutoutBottomRightInsetY;
|
|
clipInnerAmount = clipInnerAmount === undefined ? 0 : clipInnerAmount;
|
|
clipOuterAmount = clipOuterAmount === undefined ? 0 : clipOuterAmount;
|
|
let binding = env0_4;
|
|
const useState = binding.useState;
|
|
const value19 = Module00057(Reflect.apply(useState, binding, [Module00491Module.v4()]), 2);
|
|
const property = value19[0];
|
|
const env0_1 = value19[1];
|
|
const r11 = property != null ? 'url(#' + property + ')' : undefined;
|
|
let r24 = clipOuterAmount > 0 ? Module00491Module.v4() : undefined;
|
|
const r10 = r24 != null ? 'url(#' + r24 + ')' : undefined;
|
|
binding = env0_4;
|
|
const value24 = binding.useCallback(_fun117228, []);
|
|
binding.useLayoutEffect(_fun117229, [imageTintColor]);
|
|
const defaultImport = Module07744;
|
|
const Defs = (require(7744) /* metro dependency 7744 */).Defs;
|
|
const Mask = (require(7744) /* metro dependency 7744 */).Mask;
|
|
const items2 = [
|
|
imageBorderRadius === imageSize / 2
|
|
? ((Circle) => <Circle cx={imageSize / 2} cy={imageSize / 2} r={imageSize / 2} fill="white" />)((require(7744) /* metro dependency 7744 */).Circle)
|
|
: ((Rect) => <Rect x={0} y={0} width={imageSize} height={imageSize} rx={imageBorderRadius} ry={imageBorderRadius} fill="white" />)((require(7744) /* metro dependency 7744 */).Rect),
|
|
|
|
];
|
|
items2[1] = (
|
|
cutoutTopLeftSize > 0
|
|
? ((Circle) => <Circle cx={cutoutTopLeftInsetX} cy={cutoutTopLeftInsetY} r={cutoutTopLeftSize} fill="black" />)((require(7744) /* metro dependency 7744 */).Circle)
|
|
: null
|
|
);
|
|
items2[2] = (
|
|
cutoutTopRightSize > 0
|
|
? ((Circle) => <Circle cx={imageSize - cutoutTopRightInsetX} cy={cutoutTopRightInsetY} r={cutoutTopRightSize} fill="black" />)((require(7744) /* metro dependency 7744 */).Circle)
|
|
: null
|
|
);
|
|
items2[3] = (
|
|
cutoutBottomLeftSize > 0
|
|
? ((Circle) => <Circle cx={cutoutBottomLeftInsetX} cy={imageSize - cutoutBottomLeftInsetY} r={cutoutBottomLeftSize} fill="black" />)((require(7744) /* metro dependency 7744 */).Circle)
|
|
: null
|
|
);
|
|
items2[4] = (
|
|
cutoutBottomRightSize > 0
|
|
? ((Circle) => <Circle cx={imageSize - cutoutBottomRightInsetX} cy={imageSize - cutoutBottomRightInsetY} r={cutoutBottomRightSize} fill="black" />)((require(7744) /* metro dependency 7744 */).Circle)
|
|
: null
|
|
);
|
|
items2[5] = (
|
|
clipInnerAmount > 0
|
|
? (
|
|
imageBorderRadius === imageSize / 2
|
|
? ((Circle) => <Circle cx={imageSize / 2} cy={imageSize / 2} r={clipInnerAmount / 2} fill="black" />)((require(7744) /* metro dependency 7744 */).Circle)
|
|
: ((Rect) => <Rect x={(imageSize - clipInnerAmount) / 2} y={(imageSize - clipInnerAmount) / 2} width={clipInnerAmount} height={clipInnerAmount} rx={imageBorderRadius * (clipInnerAmount / imageSize)} ry={imageBorderRadius * (clipInnerAmount / imageSize)} fill="black" />)((require(7744) /* metro dependency 7744 */).Rect)
|
|
)
|
|
: null
|
|
);
|
|
const mask = (
|
|
<Mask
|
|
width={imageSize}
|
|
height={imageSize}
|
|
id={property}
|
|
>
|
|
{items2}
|
|
</Mask>
|
|
);
|
|
if (r24 != null) {
|
|
ClipPath = (require(7744) /* metro dependency 7744 */).ClipPath;
|
|
object2 = {id: r24};
|
|
if (imageBorderRadius === imageSize / 2) {
|
|
const Circle = (require(7744) /* metro dependency 7744 */).Circle;
|
|
r24 = (
|
|
<Circle
|
|
cx={imageSize / 2}
|
|
cy={imageSize / 2}
|
|
r={imageSize / 4}
|
|
fill="white"
|
|
/>
|
|
);
|
|
} else {
|
|
const Rect = (require(7744) /* metro dependency 7744 */).Rect;
|
|
r24 = (
|
|
<Rect
|
|
x={clipOuterAmount}
|
|
y={clipOuterAmount}
|
|
width={imageSize - 2 * clipOuterAmount}
|
|
height={imageSize - 2 * clipOuterAmount}
|
|
rx={imageBorderRadius * ((imageSize - 2 * clipOuterAmount) / imageSize)}
|
|
ry={imageBorderRadius * ((imageSize - 2 * clipOuterAmount) / imageSize)}
|
|
fill="white"
|
|
/>
|
|
);
|
|
}
|
|
r17 = (
|
|
<ClipPath {...object2}>
|
|
{r24}
|
|
</ClipPath>
|
|
);
|
|
} else {
|
|
r17 = null;
|
|
}
|
|
const items3 = [
|
|
<Defs>
|
|
{mask}
|
|
{r17}
|
|
</Defs>,
|
|
];
|
|
items3[1] = (
|
|
imageBackgroundColor != null
|
|
? ((Rect) => <Rect height={imageSize} width={imageSize} fill={imageBackgroundColor} mask={r11} clipPath={r10} />)((require(7744) /* metro dependency 7744 */).Rect)
|
|
: null
|
|
);
|
|
items3[2] = (
|
|
imageSource != null
|
|
? (
|
|
typeof imageSource !== 'number'
|
|
? ((Image) => <Image height={imageSize} width={imageSize} href={(importDefault(10255) /* metro dependency 10255: getReactNativeSVGImageSource */)(imageSource)} mask={r11} clipPath={r10} />)((require(7744) /* metro dependency 7744 */).Image)
|
|
: (
|
|
imageTintColor != null
|
|
? ((ForeignObject) => <ForeignObject height={imageSize} width={imageSize} mask={r11} clipPath={r10}><Image style={{width: imageSize,
|
|
height: imageSize,
|
|
tintColor: imageTintColor}} source={imageSource} onLoad={value24} /></ForeignObject>)((require(7744) /* metro dependency 7744 */).ForeignObject)
|
|
: ((Image) => <Image height={imageSize} width={imageSize} href={(importDefault(10255) /* metro dependency 10255: getReactNativeSVGImageSource */)(imageSource)} mask={r11} clipPath={r10} />)((require(7744) /* metro dependency 7744 */).Image)
|
|
)
|
|
)
|
|
: null
|
|
);
|
|
items3[3] = (
|
|
borderStroke != null
|
|
? ((Rect) => <Rect height={imageSize} width={imageSize} fill="transparent" stroke={borderStrokeColor} strokeWidth={2 * borderStroke} mask={r11} clipPath={r10} rx={imageBorderRadius} ry={imageBorderRadius} />)((require(7744) /* metro dependency 7744 */).Rect)
|
|
: null
|
|
);
|
|
return ((Component) => <Component style={style} height={imageSize} width={imageSize}>{items3}</Component>)(defaultImport);
|
|
function _fun117228() { // fn#117228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15525:831, offset: 0x024aa238, size: 49 bytes, params: 1, frame: 12
|
|
const binding = env0_1;
|
|
let value = environment.__proto__;
|
|
value = require(491) /* metro dependency 491 */;
|
|
binding(value.v4());
|
|
}
|
|
|
|
function _fun117229() { // fn#117229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15525:884, offset: 0x024aa269, size: 61 bytes, params: 1, frame: 12
|
|
var binding;
|
|
var value;
|
|
if (imageTintColor != null) {
|
|
binding = env0_1;
|
|
value = environment.__proto__;
|
|
value = require(491) /* metro dependency 491 */;
|
|
binding(value.v4());
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun117226, 15328, [57, 31, 27, 33, 491, 7744, 10255,
|
|
2]) /* metro module 15328, dependencies: [57, 31, 27, 33, 491, 7744, 10255, 2] */;
|