Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: block-editor.js
if (r && !r.done && (m = i["return"])) m.call(i);
[61500] Fix | Delete
}
[61501] Fix | Delete
finally { if (e) throw e.error; }
[61502] Fix | Delete
}
[61503] Fix | Delete
return ar;
[61504] Fix | Delete
}
[61505] Fix | Delete
[61506] Fix | Delete
/** @deprecated */
[61507] Fix | Delete
function __spread() {
[61508] Fix | Delete
for (var ar = [], i = 0; i < arguments.length; i++)
[61509] Fix | Delete
ar = ar.concat(__read(arguments[i]));
[61510] Fix | Delete
return ar;
[61511] Fix | Delete
}
[61512] Fix | Delete
[61513] Fix | Delete
/** @deprecated */
[61514] Fix | Delete
function __spreadArrays() {
[61515] Fix | Delete
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
[61516] Fix | Delete
for (var r = Array(s), k = 0, i = 0; i < il; i++)
[61517] Fix | Delete
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
[61518] Fix | Delete
r[k] = a[j];
[61519] Fix | Delete
return r;
[61520] Fix | Delete
}
[61521] Fix | Delete
[61522] Fix | Delete
function __spreadArray(to, from, pack) {
[61523] Fix | Delete
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
[61524] Fix | Delete
if (ar || !(i in from)) {
[61525] Fix | Delete
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
[61526] Fix | Delete
ar[i] = from[i];
[61527] Fix | Delete
}
[61528] Fix | Delete
}
[61529] Fix | Delete
return to.concat(ar || Array.prototype.slice.call(from));
[61530] Fix | Delete
}
[61531] Fix | Delete
[61532] Fix | Delete
function __await(v) {
[61533] Fix | Delete
return this instanceof __await ? (this.v = v, this) : new __await(v);
[61534] Fix | Delete
}
[61535] Fix | Delete
[61536] Fix | Delete
function __asyncGenerator(thisArg, _arguments, generator) {
[61537] Fix | Delete
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
[61538] Fix | Delete
var g = generator.apply(thisArg, _arguments || []), i, q = [];
[61539] Fix | Delete
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
[61540] Fix | Delete
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
[61541] Fix | Delete
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
[61542] Fix | Delete
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
[61543] Fix | Delete
function fulfill(value) { resume("next", value); }
[61544] Fix | Delete
function reject(value) { resume("throw", value); }
[61545] Fix | Delete
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
[61546] Fix | Delete
}
[61547] Fix | Delete
[61548] Fix | Delete
function __asyncDelegator(o) {
[61549] Fix | Delete
var i, p;
[61550] Fix | Delete
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
[61551] Fix | Delete
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
[61552] Fix | Delete
}
[61553] Fix | Delete
[61554] Fix | Delete
function __asyncValues(o) {
[61555] Fix | Delete
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
[61556] Fix | Delete
var m = o[Symbol.asyncIterator], i;
[61557] Fix | Delete
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
[61558] Fix | Delete
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
[61559] Fix | Delete
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
[61560] Fix | Delete
}
[61561] Fix | Delete
[61562] Fix | Delete
function __makeTemplateObject(cooked, raw) {
[61563] Fix | Delete
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
[61564] Fix | Delete
return cooked;
[61565] Fix | Delete
};
[61566] Fix | Delete
[61567] Fix | Delete
var __setModuleDefault = Object.create ? (function(o, v) {
[61568] Fix | Delete
Object.defineProperty(o, "default", { enumerable: true, value: v });
[61569] Fix | Delete
}) : function(o, v) {
[61570] Fix | Delete
o["default"] = v;
[61571] Fix | Delete
};
[61572] Fix | Delete
[61573] Fix | Delete
function __importStar(mod) {
[61574] Fix | Delete
if (mod && mod.__esModule) return mod;
[61575] Fix | Delete
var result = {};
[61576] Fix | Delete
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
[61577] Fix | Delete
__setModuleDefault(result, mod);
[61578] Fix | Delete
return result;
[61579] Fix | Delete
}
[61580] Fix | Delete
[61581] Fix | Delete
function __importDefault(mod) {
[61582] Fix | Delete
return (mod && mod.__esModule) ? mod : { default: mod };
[61583] Fix | Delete
}
[61584] Fix | Delete
[61585] Fix | Delete
function __classPrivateFieldGet(receiver, state, kind, f) {
[61586] Fix | Delete
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
[61587] Fix | Delete
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
[61588] Fix | Delete
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
[61589] Fix | Delete
}
[61590] Fix | Delete
[61591] Fix | Delete
function __classPrivateFieldSet(receiver, state, value, kind, f) {
[61592] Fix | Delete
if (kind === "m") throw new TypeError("Private method is not writable");
[61593] Fix | Delete
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
[61594] Fix | Delete
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
[61595] Fix | Delete
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
[61596] Fix | Delete
}
[61597] Fix | Delete
[61598] Fix | Delete
function __classPrivateFieldIn(state, receiver) {
[61599] Fix | Delete
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
[61600] Fix | Delete
return typeof state === "function" ? receiver === state : state.has(receiver);
[61601] Fix | Delete
}
[61602] Fix | Delete
[61603] Fix | Delete
function __addDisposableResource(env, value, async) {
[61604] Fix | Delete
if (value !== null && value !== void 0) {
[61605] Fix | Delete
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
[61606] Fix | Delete
var dispose;
[61607] Fix | Delete
if (async) {
[61608] Fix | Delete
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
[61609] Fix | Delete
dispose = value[Symbol.asyncDispose];
[61610] Fix | Delete
}
[61611] Fix | Delete
if (dispose === void 0) {
[61612] Fix | Delete
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
[61613] Fix | Delete
dispose = value[Symbol.dispose];
[61614] Fix | Delete
}
[61615] Fix | Delete
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
[61616] Fix | Delete
env.stack.push({ value: value, dispose: dispose, async: async });
[61617] Fix | Delete
}
[61618] Fix | Delete
else if (async) {
[61619] Fix | Delete
env.stack.push({ async: true });
[61620] Fix | Delete
}
[61621] Fix | Delete
return value;
[61622] Fix | Delete
}
[61623] Fix | Delete
[61624] Fix | Delete
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
[61625] Fix | Delete
var e = new Error(message);
[61626] Fix | Delete
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
[61627] Fix | Delete
};
[61628] Fix | Delete
[61629] Fix | Delete
function __disposeResources(env) {
[61630] Fix | Delete
function fail(e) {
[61631] Fix | Delete
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
[61632] Fix | Delete
env.hasError = true;
[61633] Fix | Delete
}
[61634] Fix | Delete
function next() {
[61635] Fix | Delete
while (env.stack.length) {
[61636] Fix | Delete
var rec = env.stack.pop();
[61637] Fix | Delete
try {
[61638] Fix | Delete
var result = rec.dispose && rec.dispose.call(rec.value);
[61639] Fix | Delete
if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
[61640] Fix | Delete
}
[61641] Fix | Delete
catch (e) {
[61642] Fix | Delete
fail(e);
[61643] Fix | Delete
}
[61644] Fix | Delete
}
[61645] Fix | Delete
if (env.hasError) throw env.error;
[61646] Fix | Delete
}
[61647] Fix | Delete
return next();
[61648] Fix | Delete
}
[61649] Fix | Delete
[61650] Fix | Delete
/* harmony default export */ const tslib_es6 = ({
[61651] Fix | Delete
__extends,
[61652] Fix | Delete
__assign,
[61653] Fix | Delete
__rest,
[61654] Fix | Delete
__decorate,
[61655] Fix | Delete
__param,
[61656] Fix | Delete
__metadata,
[61657] Fix | Delete
__awaiter,
[61658] Fix | Delete
__generator,
[61659] Fix | Delete
__createBinding,
[61660] Fix | Delete
__exportStar,
[61661] Fix | Delete
__values,
[61662] Fix | Delete
__read,
[61663] Fix | Delete
__spread,
[61664] Fix | Delete
__spreadArrays,
[61665] Fix | Delete
__spreadArray,
[61666] Fix | Delete
__await,
[61667] Fix | Delete
__asyncGenerator,
[61668] Fix | Delete
__asyncDelegator,
[61669] Fix | Delete
__asyncValues,
[61670] Fix | Delete
__makeTemplateObject,
[61671] Fix | Delete
__importStar,
[61672] Fix | Delete
__importDefault,
[61673] Fix | Delete
__classPrivateFieldGet,
[61674] Fix | Delete
__classPrivateFieldSet,
[61675] Fix | Delete
__classPrivateFieldIn,
[61676] Fix | Delete
__addDisposableResource,
[61677] Fix | Delete
__disposeResources,
[61678] Fix | Delete
});
[61679] Fix | Delete
[61680] Fix | Delete
// EXTERNAL MODULE: ./node_modules/normalize-wheel/index.js
[61681] Fix | Delete
var normalize_wheel = __webpack_require__(7520);
[61682] Fix | Delete
var normalize_wheel_default = /*#__PURE__*/__webpack_require__.n(normalize_wheel);
[61683] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/react-easy-crop/index.module.js
[61684] Fix | Delete
[61685] Fix | Delete
[61686] Fix | Delete
[61687] Fix | Delete
[61688] Fix | Delete
/**
[61689] Fix | Delete
* Compute the dimension of the crop area based on media size,
[61690] Fix | Delete
* aspect ratio and optionally rotation
[61691] Fix | Delete
*/
[61692] Fix | Delete
function getCropSize(mediaWidth, mediaHeight, containerWidth, containerHeight, aspect, rotation) {
[61693] Fix | Delete
if (rotation === void 0) {
[61694] Fix | Delete
rotation = 0;
[61695] Fix | Delete
}
[61696] Fix | Delete
var _a = rotateSize(mediaWidth, mediaHeight, rotation),
[61697] Fix | Delete
width = _a.width,
[61698] Fix | Delete
height = _a.height;
[61699] Fix | Delete
var fittingWidth = Math.min(width, containerWidth);
[61700] Fix | Delete
var fittingHeight = Math.min(height, containerHeight);
[61701] Fix | Delete
if (fittingWidth > fittingHeight * aspect) {
[61702] Fix | Delete
return {
[61703] Fix | Delete
width: fittingHeight * aspect,
[61704] Fix | Delete
height: fittingHeight
[61705] Fix | Delete
};
[61706] Fix | Delete
}
[61707] Fix | Delete
return {
[61708] Fix | Delete
width: fittingWidth,
[61709] Fix | Delete
height: fittingWidth / aspect
[61710] Fix | Delete
};
[61711] Fix | Delete
}
[61712] Fix | Delete
/**
[61713] Fix | Delete
* Compute media zoom.
[61714] Fix | Delete
* We fit the media into the container with "max-width: 100%; max-height: 100%;"
[61715] Fix | Delete
*/
[61716] Fix | Delete
function getMediaZoom(mediaSize) {
[61717] Fix | Delete
// Take the axis with more pixels to improve accuracy
[61718] Fix | Delete
return mediaSize.width > mediaSize.height ? mediaSize.width / mediaSize.naturalWidth : mediaSize.height / mediaSize.naturalHeight;
[61719] Fix | Delete
}
[61720] Fix | Delete
/**
[61721] Fix | Delete
* Ensure a new media position stays in the crop area.
[61722] Fix | Delete
*/
[61723] Fix | Delete
function restrictPosition(position, mediaSize, cropSize, zoom, rotation) {
[61724] Fix | Delete
if (rotation === void 0) {
[61725] Fix | Delete
rotation = 0;
[61726] Fix | Delete
}
[61727] Fix | Delete
var _a = rotateSize(mediaSize.width, mediaSize.height, rotation),
[61728] Fix | Delete
width = _a.width,
[61729] Fix | Delete
height = _a.height;
[61730] Fix | Delete
return {
[61731] Fix | Delete
x: restrictPositionCoord(position.x, width, cropSize.width, zoom),
[61732] Fix | Delete
y: restrictPositionCoord(position.y, height, cropSize.height, zoom)
[61733] Fix | Delete
};
[61734] Fix | Delete
}
[61735] Fix | Delete
function restrictPositionCoord(position, mediaSize, cropSize, zoom) {
[61736] Fix | Delete
var maxPosition = mediaSize * zoom / 2 - cropSize / 2;
[61737] Fix | Delete
return clamp(position, -maxPosition, maxPosition);
[61738] Fix | Delete
}
[61739] Fix | Delete
function getDistanceBetweenPoints(pointA, pointB) {
[61740] Fix | Delete
return Math.sqrt(Math.pow(pointA.y - pointB.y, 2) + Math.pow(pointA.x - pointB.x, 2));
[61741] Fix | Delete
}
[61742] Fix | Delete
function getRotationBetweenPoints(pointA, pointB) {
[61743] Fix | Delete
return Math.atan2(pointB.y - pointA.y, pointB.x - pointA.x) * 180 / Math.PI;
[61744] Fix | Delete
}
[61745] Fix | Delete
/**
[61746] Fix | Delete
* Compute the output cropped area of the media in percentages and pixels.
[61747] Fix | Delete
* x/y are the top-left coordinates on the src media
[61748] Fix | Delete
*/
[61749] Fix | Delete
function computeCroppedArea(crop, mediaSize, cropSize, aspect, zoom, rotation, restrictPosition) {
[61750] Fix | Delete
if (rotation === void 0) {
[61751] Fix | Delete
rotation = 0;
[61752] Fix | Delete
}
[61753] Fix | Delete
if (restrictPosition === void 0) {
[61754] Fix | Delete
restrictPosition = true;
[61755] Fix | Delete
}
[61756] Fix | Delete
// if the media is rotated by the user, we cannot limit the position anymore
[61757] Fix | Delete
// as it might need to be negative.
[61758] Fix | Delete
var limitAreaFn = restrictPosition ? limitArea : noOp;
[61759] Fix | Delete
var mediaBBoxSize = rotateSize(mediaSize.width, mediaSize.height, rotation);
[61760] Fix | Delete
var mediaNaturalBBoxSize = rotateSize(mediaSize.naturalWidth, mediaSize.naturalHeight, rotation);
[61761] Fix | Delete
// calculate the crop area in percentages
[61762] Fix | Delete
// in the rotated space
[61763] Fix | Delete
var croppedAreaPercentages = {
[61764] Fix | Delete
x: limitAreaFn(100, ((mediaBBoxSize.width - cropSize.width / zoom) / 2 - crop.x / zoom) / mediaBBoxSize.width * 100),
[61765] Fix | Delete
y: limitAreaFn(100, ((mediaBBoxSize.height - cropSize.height / zoom) / 2 - crop.y / zoom) / mediaBBoxSize.height * 100),
[61766] Fix | Delete
width: limitAreaFn(100, cropSize.width / mediaBBoxSize.width * 100 / zoom),
[61767] Fix | Delete
height: limitAreaFn(100, cropSize.height / mediaBBoxSize.height * 100 / zoom)
[61768] Fix | Delete
};
[61769] Fix | Delete
// we compute the pixels size naively
[61770] Fix | Delete
var widthInPixels = Math.round(limitAreaFn(mediaNaturalBBoxSize.width, croppedAreaPercentages.width * mediaNaturalBBoxSize.width / 100));
[61771] Fix | Delete
var heightInPixels = Math.round(limitAreaFn(mediaNaturalBBoxSize.height, croppedAreaPercentages.height * mediaNaturalBBoxSize.height / 100));
[61772] Fix | Delete
var isImgWiderThanHigh = mediaNaturalBBoxSize.width >= mediaNaturalBBoxSize.height * aspect;
[61773] Fix | Delete
// then we ensure the width and height exactly match the aspect (to avoid rounding approximations)
[61774] Fix | Delete
// if the media is wider than high, when zoom is 0, the crop height will be equals to image height
[61775] Fix | Delete
// thus we want to compute the width from the height and aspect for accuracy.
[61776] Fix | Delete
// Otherwise, we compute the height from width and aspect.
[61777] Fix | Delete
var sizePixels = isImgWiderThanHigh ? {
[61778] Fix | Delete
width: Math.round(heightInPixels * aspect),
[61779] Fix | Delete
height: heightInPixels
[61780] Fix | Delete
} : {
[61781] Fix | Delete
width: widthInPixels,
[61782] Fix | Delete
height: Math.round(widthInPixels / aspect)
[61783] Fix | Delete
};
[61784] Fix | Delete
var croppedAreaPixels = __assign(__assign({}, sizePixels), {
[61785] Fix | Delete
x: Math.round(limitAreaFn(mediaNaturalBBoxSize.width - sizePixels.width, croppedAreaPercentages.x * mediaNaturalBBoxSize.width / 100)),
[61786] Fix | Delete
y: Math.round(limitAreaFn(mediaNaturalBBoxSize.height - sizePixels.height, croppedAreaPercentages.y * mediaNaturalBBoxSize.height / 100))
[61787] Fix | Delete
});
[61788] Fix | Delete
return {
[61789] Fix | Delete
croppedAreaPercentages: croppedAreaPercentages,
[61790] Fix | Delete
croppedAreaPixels: croppedAreaPixels
[61791] Fix | Delete
};
[61792] Fix | Delete
}
[61793] Fix | Delete
/**
[61794] Fix | Delete
* Ensure the returned value is between 0 and max
[61795] Fix | Delete
*/
[61796] Fix | Delete
function limitArea(max, value) {
[61797] Fix | Delete
return Math.min(max, Math.max(0, value));
[61798] Fix | Delete
}
[61799] Fix | Delete
function noOp(_max, value) {
[61800] Fix | Delete
return value;
[61801] Fix | Delete
}
[61802] Fix | Delete
/**
[61803] Fix | Delete
* Compute crop and zoom from the croppedAreaPercentages.
[61804] Fix | Delete
*/
[61805] Fix | Delete
function getInitialCropFromCroppedAreaPercentages(croppedAreaPercentages, mediaSize, rotation, cropSize, minZoom, maxZoom) {
[61806] Fix | Delete
var mediaBBoxSize = rotateSize(mediaSize.width, mediaSize.height, rotation);
[61807] Fix | Delete
// This is the inverse process of computeCroppedArea
[61808] Fix | Delete
var zoom = clamp(cropSize.width / mediaBBoxSize.width * (100 / croppedAreaPercentages.width), minZoom, maxZoom);
[61809] Fix | Delete
var crop = {
[61810] Fix | Delete
x: zoom * mediaBBoxSize.width / 2 - cropSize.width / 2 - mediaBBoxSize.width * zoom * (croppedAreaPercentages.x / 100),
[61811] Fix | Delete
y: zoom * mediaBBoxSize.height / 2 - cropSize.height / 2 - mediaBBoxSize.height * zoom * (croppedAreaPercentages.y / 100)
[61812] Fix | Delete
};
[61813] Fix | Delete
return {
[61814] Fix | Delete
crop: crop,
[61815] Fix | Delete
zoom: zoom
[61816] Fix | Delete
};
[61817] Fix | Delete
}
[61818] Fix | Delete
/**
[61819] Fix | Delete
* Compute zoom from the croppedAreaPixels
[61820] Fix | Delete
*/
[61821] Fix | Delete
function getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) {
[61822] Fix | Delete
var mediaZoom = getMediaZoom(mediaSize);
[61823] Fix | Delete
return cropSize.height > cropSize.width ? cropSize.height / (croppedAreaPixels.height * mediaZoom) : cropSize.width / (croppedAreaPixels.width * mediaZoom);
[61824] Fix | Delete
}
[61825] Fix | Delete
/**
[61826] Fix | Delete
* Compute crop and zoom from the croppedAreaPixels
[61827] Fix | Delete
*/
[61828] Fix | Delete
function getInitialCropFromCroppedAreaPixels(croppedAreaPixels, mediaSize, rotation, cropSize, minZoom, maxZoom) {
[61829] Fix | Delete
if (rotation === void 0) {
[61830] Fix | Delete
rotation = 0;
[61831] Fix | Delete
}
[61832] Fix | Delete
var mediaNaturalBBoxSize = rotateSize(mediaSize.naturalWidth, mediaSize.naturalHeight, rotation);
[61833] Fix | Delete
var zoom = clamp(getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize), minZoom, maxZoom);
[61834] Fix | Delete
var cropZoom = cropSize.height > cropSize.width ? cropSize.height / croppedAreaPixels.height : cropSize.width / croppedAreaPixels.width;
[61835] Fix | Delete
var crop = {
[61836] Fix | Delete
x: ((mediaNaturalBBoxSize.width - croppedAreaPixels.width) / 2 - croppedAreaPixels.x) * cropZoom,
[61837] Fix | Delete
y: ((mediaNaturalBBoxSize.height - croppedAreaPixels.height) / 2 - croppedAreaPixels.y) * cropZoom
[61838] Fix | Delete
};
[61839] Fix | Delete
return {
[61840] Fix | Delete
crop: crop,
[61841] Fix | Delete
zoom: zoom
[61842] Fix | Delete
};
[61843] Fix | Delete
}
[61844] Fix | Delete
/**
[61845] Fix | Delete
* Return the point that is the center of point a and b
[61846] Fix | Delete
*/
[61847] Fix | Delete
function getCenter(a, b) {
[61848] Fix | Delete
return {
[61849] Fix | Delete
x: (b.x + a.x) / 2,
[61850] Fix | Delete
y: (b.y + a.y) / 2
[61851] Fix | Delete
};
[61852] Fix | Delete
}
[61853] Fix | Delete
function getRadianAngle(degreeValue) {
[61854] Fix | Delete
return degreeValue * Math.PI / 180;
[61855] Fix | Delete
}
[61856] Fix | Delete
/**
[61857] Fix | Delete
* Returns the new bounding area of a rotated rectangle.
[61858] Fix | Delete
*/
[61859] Fix | Delete
function rotateSize(width, height, rotation) {
[61860] Fix | Delete
var rotRad = getRadianAngle(rotation);
[61861] Fix | Delete
return {
[61862] Fix | Delete
width: Math.abs(Math.cos(rotRad) * width) + Math.abs(Math.sin(rotRad) * height),
[61863] Fix | Delete
height: Math.abs(Math.sin(rotRad) * width) + Math.abs(Math.cos(rotRad) * height)
[61864] Fix | Delete
};
[61865] Fix | Delete
}
[61866] Fix | Delete
/**
[61867] Fix | Delete
* Clamp value between min and max
[61868] Fix | Delete
*/
[61869] Fix | Delete
function clamp(value, min, max) {
[61870] Fix | Delete
return Math.min(Math.max(value, min), max);
[61871] Fix | Delete
}
[61872] Fix | Delete
/**
[61873] Fix | Delete
* Combine multiple class names into a single string.
[61874] Fix | Delete
*/
[61875] Fix | Delete
function classNames() {
[61876] Fix | Delete
var args = [];
[61877] Fix | Delete
for (var _i = 0; _i < arguments.length; _i++) {
[61878] Fix | Delete
args[_i] = arguments[_i];
[61879] Fix | Delete
}
[61880] Fix | Delete
return args.filter(function (value) {
[61881] Fix | Delete
if (typeof value === 'string' && value.length > 0) {
[61882] Fix | Delete
return true;
[61883] Fix | Delete
}
[61884] Fix | Delete
return false;
[61885] Fix | Delete
}).join(' ').trim();
[61886] Fix | Delete
}
[61887] Fix | Delete
[61888] Fix | Delete
var css_248z = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n";
[61889] Fix | Delete
[61890] Fix | Delete
var index_module_MIN_ZOOM = 1;
[61891] Fix | Delete
var index_module_MAX_ZOOM = 3;
[61892] Fix | Delete
var Cropper = /** @class */function (_super) {
[61893] Fix | Delete
__extends(Cropper, _super);
[61894] Fix | Delete
function Cropper() {
[61895] Fix | Delete
var _this = _super !== null && _super.apply(this, arguments) || this;
[61896] Fix | Delete
_this.imageRef = external_React_.createRef();
[61897] Fix | Delete
_this.videoRef = external_React_.createRef();
[61898] Fix | Delete
_this.containerPosition = {
[61899] Fix | Delete
x: 0,
[61900] Fix | Delete
y: 0
[61901] Fix | Delete
};
[61902] Fix | Delete
_this.containerRef = null;
[61903] Fix | Delete
_this.styleRef = null;
[61904] Fix | Delete
_this.containerRect = null;
[61905] Fix | Delete
_this.mediaSize = {
[61906] Fix | Delete
width: 0,
[61907] Fix | Delete
height: 0,
[61908] Fix | Delete
naturalWidth: 0,
[61909] Fix | Delete
naturalHeight: 0
[61910] Fix | Delete
};
[61911] Fix | Delete
_this.dragStartPosition = {
[61912] Fix | Delete
x: 0,
[61913] Fix | Delete
y: 0
[61914] Fix | Delete
};
[61915] Fix | Delete
_this.dragStartCrop = {
[61916] Fix | Delete
x: 0,
[61917] Fix | Delete
y: 0
[61918] Fix | Delete
};
[61919] Fix | Delete
_this.gestureZoomStart = 0;
[61920] Fix | Delete
_this.gestureRotationStart = 0;
[61921] Fix | Delete
_this.isTouching = false;
[61922] Fix | Delete
_this.lastPinchDistance = 0;
[61923] Fix | Delete
_this.lastPinchRotation = 0;
[61924] Fix | Delete
_this.rafDragTimeout = null;
[61925] Fix | Delete
_this.rafPinchTimeout = null;
[61926] Fix | Delete
_this.wheelTimer = null;
[61927] Fix | Delete
_this.currentDoc = typeof document !== 'undefined' ? document : null;
[61928] Fix | Delete
_this.currentWindow = typeof window !== 'undefined' ? window : null;
[61929] Fix | Delete
_this.resizeObserver = null;
[61930] Fix | Delete
_this.state = {
[61931] Fix | Delete
cropSize: null,
[61932] Fix | Delete
hasWheelJustStarted: false,
[61933] Fix | Delete
mediaObjectFit: undefined
[61934] Fix | Delete
};
[61935] Fix | Delete
_this.initResizeObserver = function () {
[61936] Fix | Delete
if (typeof window.ResizeObserver === 'undefined' || !_this.containerRef) {
[61937] Fix | Delete
return;
[61938] Fix | Delete
}
[61939] Fix | Delete
var isFirstResize = true;
[61940] Fix | Delete
_this.resizeObserver = new window.ResizeObserver(function (entries) {
[61941] Fix | Delete
if (isFirstResize) {
[61942] Fix | Delete
isFirstResize = false; // observe() is called on mount, we don't want to trigger a recompute on mount
[61943] Fix | Delete
return;
[61944] Fix | Delete
}
[61945] Fix | Delete
_this.computeSizes();
[61946] Fix | Delete
});
[61947] Fix | Delete
_this.resizeObserver.observe(_this.containerRef);
[61948] Fix | Delete
};
[61949] Fix | Delete
// this is to prevent Safari on iOS >= 10 to zoom the page
[61950] Fix | Delete
_this.preventZoomSafari = function (e) {
[61951] Fix | Delete
return e.preventDefault();
[61952] Fix | Delete
};
[61953] Fix | Delete
_this.cleanEvents = function () {
[61954] Fix | Delete
if (!_this.currentDoc) return;
[61955] Fix | Delete
_this.currentDoc.removeEventListener('mousemove', _this.onMouseMove);
[61956] Fix | Delete
_this.currentDoc.removeEventListener('mouseup', _this.onDragStopped);
[61957] Fix | Delete
_this.currentDoc.removeEventListener('touchmove', _this.onTouchMove);
[61958] Fix | Delete
_this.currentDoc.removeEventListener('touchend', _this.onDragStopped);
[61959] Fix | Delete
_this.currentDoc.removeEventListener('gesturemove', _this.onGestureMove);
[61960] Fix | Delete
_this.currentDoc.removeEventListener('gestureend', _this.onGestureEnd);
[61961] Fix | Delete
_this.currentDoc.removeEventListener('scroll', _this.onScroll);
[61962] Fix | Delete
};
[61963] Fix | Delete
_this.clearScrollEvent = function () {
[61964] Fix | Delete
if (_this.containerRef) _this.containerRef.removeEventListener('wheel', _this.onWheel);
[61965] Fix | Delete
if (_this.wheelTimer) {
[61966] Fix | Delete
clearTimeout(_this.wheelTimer);
[61967] Fix | Delete
}
[61968] Fix | Delete
};
[61969] Fix | Delete
_this.onMediaLoad = function () {
[61970] Fix | Delete
var cropSize = _this.computeSizes();
[61971] Fix | Delete
if (cropSize) {
[61972] Fix | Delete
_this.emitCropData();
[61973] Fix | Delete
_this.setInitialCrop(cropSize);
[61974] Fix | Delete
}
[61975] Fix | Delete
if (_this.props.onMediaLoaded) {
[61976] Fix | Delete
_this.props.onMediaLoaded(_this.mediaSize);
[61977] Fix | Delete
}
[61978] Fix | Delete
};
[61979] Fix | Delete
_this.setInitialCrop = function (cropSize) {
[61980] Fix | Delete
if (_this.props.initialCroppedAreaPercentages) {
[61981] Fix | Delete
var _a = getInitialCropFromCroppedAreaPercentages(_this.props.initialCroppedAreaPercentages, _this.mediaSize, _this.props.rotation, cropSize, _this.props.minZoom, _this.props.maxZoom),
[61982] Fix | Delete
crop = _a.crop,
[61983] Fix | Delete
zoom = _a.zoom;
[61984] Fix | Delete
_this.props.onCropChange(crop);
[61985] Fix | Delete
_this.props.onZoomChange && _this.props.onZoomChange(zoom);
[61986] Fix | Delete
} else if (_this.props.initialCroppedAreaPixels) {
[61987] Fix | Delete
var _b = getInitialCropFromCroppedAreaPixels(_this.props.initialCroppedAreaPixels, _this.mediaSize, _this.props.rotation, cropSize, _this.props.minZoom, _this.props.maxZoom),
[61988] Fix | Delete
crop = _b.crop,
[61989] Fix | Delete
zoom = _b.zoom;
[61990] Fix | Delete
_this.props.onCropChange(crop);
[61991] Fix | Delete
_this.props.onZoomChange && _this.props.onZoomChange(zoom);
[61992] Fix | Delete
}
[61993] Fix | Delete
};
[61994] Fix | Delete
_this.computeSizes = function () {
[61995] Fix | Delete
var _a, _b, _c, _d, _e, _f;
[61996] Fix | Delete
var mediaRef = _this.imageRef.current || _this.videoRef.current;
[61997] Fix | Delete
if (mediaRef && _this.containerRef) {
[61998] Fix | Delete
_this.containerRect = _this.containerRef.getBoundingClientRect();
[61999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function