{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { getClientSize } from \"rc-util/es/Dom/css\";\nfunction fixPoint(key, start, width, clientWidth) {\n var startAddWidth = start + width;\n var offsetStart = (width - clientWidth) / 2;\n if (width > clientWidth) {\n if (start > 0) {\n return _defineProperty({}, key, offsetStart);\n }\n if (start < 0 && startAddWidth < clientWidth) {\n return _defineProperty({}, key, -offsetStart);\n }\n } else if (start < 0 || startAddWidth > clientWidth) {\n return _defineProperty({}, key, start < 0 ? offsetStart : -offsetStart);\n }\n return {};\n}\n\n/**\n * Fix positon x,y point when\n *\n * Ele width && height < client\n * - Back origin\n *\n * - Ele width | height > clientWidth | clientHeight\n * - left | top > 0 -> Back 0\n * - left | top + width | height < clientWidth | clientHeight -> Back left | top + width | height === clientWidth | clientHeight\n *\n * Regardless of other\n */\nexport default function getFixScaleEleTransPosition(width, height, left, top) {\n var _getClientSize = getClientSize(),\n clientWidth = _getClientSize.width,\n clientHeight = _getClientSize.height;\n var fixPos = null;\n if (width <= clientWidth && height <= clientHeight) {\n fixPos = {\n x: 0,\n y: 0\n };\n } else if (width > clientWidth || height > clientHeight) {\n fixPos = _objectSpread(_objectSpread({}, fixPoint('x', left, width, clientWidth)), fixPoint('y', top, height, clientHeight));\n }\n return fixPos;\n}","map":{"version":3,"names":["_objectSpread","_defineProperty","getClientSize","fixPoint","key","start","width","clientWidth","startAddWidth","offsetStart","getFixScaleEleTransPosition","height","left","top","_getClientSize","clientHeight","fixPos","x","y"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/rc-image/es/getFixScaleEleTransPosition.js"],"sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { getClientSize } from \"rc-util/es/Dom/css\";\nfunction fixPoint(key, start, width, clientWidth) {\n var startAddWidth = start + width;\n var offsetStart = (width - clientWidth) / 2;\n if (width > clientWidth) {\n if (start > 0) {\n return _defineProperty({}, key, offsetStart);\n }\n if (start < 0 && startAddWidth < clientWidth) {\n return _defineProperty({}, key, -offsetStart);\n }\n } else if (start < 0 || startAddWidth > clientWidth) {\n return _defineProperty({}, key, start < 0 ? offsetStart : -offsetStart);\n }\n return {};\n}\n\n/**\n * Fix positon x,y point when\n *\n * Ele width && height < client\n * - Back origin\n *\n * - Ele width | height > clientWidth | clientHeight\n * - left | top > 0 -> Back 0\n * - left | top + width | height < clientWidth | clientHeight -> Back left | top + width | height === clientWidth | clientHeight\n *\n * Regardless of other\n */\nexport default function getFixScaleEleTransPosition(width, height, left, top) {\n var _getClientSize = getClientSize(),\n clientWidth = _getClientSize.width,\n clientHeight = _getClientSize.height;\n var fixPos = null;\n if (width <= clientWidth && height <= clientHeight) {\n fixPos = {\n x: 0,\n y: 0\n };\n } else if (width > clientWidth || height > clientHeight) {\n fixPos = _objectSpread(_objectSpread({}, fixPoint('x', left, width, clientWidth)), fixPoint('y', top, height, clientHeight));\n }\n return fixPos;\n}"],"mappings":"AAAA,OAAOA,aAAa,MAAM,0CAA0C;AACpE,OAAOC,eAAe,MAAM,2CAA2C;AACvE,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,QAAQA,CAACC,GAAG,EAAEC,KAAK,EAAEC,KAAK,EAAEC,WAAW,EAAE;EAChD,IAAIC,aAAa,GAAGH,KAAK,GAAGC,KAAK;EACjC,IAAIG,WAAW,GAAG,CAACH,KAAK,GAAGC,WAAW,IAAI,CAAC;EAC3C,IAAID,KAAK,GAAGC,WAAW,EAAE;IACvB,IAAIF,KAAK,GAAG,CAAC,EAAE;MACb,OAAOJ,eAAe,CAAC,CAAC,CAAC,EAAEG,GAAG,EAAEK,WAAW,CAAC;IAC9C;IACA,IAAIJ,KAAK,GAAG,CAAC,IAAIG,aAAa,GAAGD,WAAW,EAAE;MAC5C,OAAON,eAAe,CAAC,CAAC,CAAC,EAAEG,GA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