{"ast":null,"code":"import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport * as React from 'react';\nvar Block = function Block(_ref) {\n var bg = _ref.bg,\n children = _ref.children;\n return /*#__PURE__*/React.createElement(\"div\", {\n style: {\n width: '100%',\n height: '100%',\n background: bg\n }\n }, children);\n};\nfunction getPtgColors(color, scale) {\n return Object.keys(color).map(function (key) {\n var parsedKey = parseFloat(key);\n var ptgKey = \"\".concat(Math.floor(parsedKey * scale), \"%\");\n return \"\".concat(color[key], \" \").concat(ptgKey);\n });\n}\nvar PtgCircle = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var prefixCls = props.prefixCls,\n color = props.color,\n gradientId = props.gradientId,\n radius = props.radius,\n circleStyleForStack = props.style,\n ptg = props.ptg,\n strokeLinecap = props.strokeLinecap,\n strokeWidth = props.strokeWidth,\n size = props.size,\n gapDegree = props.gapDegree;\n var isGradient = color && _typeof(color) === 'object';\n var stroke = isGradient ? \"#FFF\" : undefined;\n\n // ========================== Circle ==========================\n var halfSize = size / 2;\n var circleNode = /*#__PURE__*/React.createElement(\"circle\", {\n className: \"\".concat(prefixCls, \"-circle-path\"),\n r: radius,\n cx: halfSize,\n cy: halfSize,\n stroke: stroke,\n strokeLinecap: strokeLinecap,\n strokeWidth: strokeWidth,\n opacity: ptg === 0 ? 0 : 1,\n style: circleStyleForStack,\n ref: ref\n });\n\n // ========================== Render ==========================\n if (!isGradient) {\n return circleNode;\n }\n var maskId = \"\".concat(gradientId, \"-conic\");\n var fromDeg = gapDegree ? \"\".concat(180 + gapDegree / 2, \"deg\") : '0deg';\n var conicColors = getPtgColors(color, (360 - gapDegree) / 360);\n var linearColors = getPtgColors(color, 1);\n var conicColorBg = \"conic-gradient(from \".concat(fromDeg, \", \").concat(conicColors.join(', '), \")\");\n var linearColorBg = \"linear-gradient(to \".concat(gapDegree ? 'bottom' : 'top', \", \").concat(linearColors.join(', '), \")\");\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"mask\", {\n id: maskId\n }, circleNode), /*#__PURE__*/React.createElement(\"foreignObject\", {\n x: 0,\n y: 0,\n width: size,\n height: size,\n mask: \"url(#\".concat(maskId, \")\")\n }, /*#__PURE__*/React.createElement(Block, {\n bg: linearColorBg\n }, /*#__PURE__*/React.createElement(Block, {\n bg: conicColorBg\n }))));\n});\nif (process.env.NODE_ENV !== 'production') {\n PtgCircle.displayName = 'PtgCircle';\n}\nexport default PtgCircle;","map":{"version":3,"names":["_typeof","React","Block","_ref","bg","children","createElement","style","width","height","background","getPtgColors","color","scale","Object","keys","map","key","parsedKey","parseFloat","ptgKey","concat","Math","floor","PtgCircle","forwardRef","props","ref","prefixCls","gradientId","radius","circleStyleForStack","ptg","strokeLinecap","strokeWidth","size","gapDegree","isGradient","stroke","undefined","halfSize","circleNode","className","r","cx","cy","opacity","maskId","fromDeg","conicColors","linearColors","conicColorBg","join","linearColorBg","Fragment","id","x","y","mask","process","env","NODE_ENV","displayName"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-progress/es/Circle/PtgCircle.js"],"sourcesContent":["import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport * as React from 'react';\nvar Block = function Block(_ref) {\n var bg = _ref.bg,\n children = _ref.children;\n return /*#__PURE__*/React.createElement(\"div\", {\n style: {\n width: '100%',\n height: '100%',\n background: bg\n }\n }, children);\n};\nfunction getPtgColors(color, scale) {\n return Object.keys(color).map(function (key) {\n var parsedKey = parseFloat(key);\n var ptgKey = \"\".concat(Math.floor(parsedKey * scale), \"%\");\n return \"\".concat(color[key], \" \").concat(ptgKey);\n });\n}\nvar PtgCircle = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var prefixCls = props.prefixCls,\n color = props.color,\n gradientId = props.gradientId,\n radius = props.radius,\n circleStyleForStack = props.style,\n ptg = props.ptg,\n strokeLinecap = props.strokeLinecap,\n strokeWidth = props.strokeWidth,\n size = props.size,\n gapDegree = props.gapDegree;\n var isGradient = color && _typeof(color) === 'object';\n var stroke = isGradient ? \"#FFF\" : undefined;\n\n // ========================== Circle ==========================\n var halfSize = size / 2;\n var circleNode = /*#__PURE__*/React.createElement(\"circle\", {\n className: \"\".concat(prefixCls, \"-circle-path\"),\n r: radius,\n cx: halfSize,\n cy: halfSize,\n stroke: stroke,\n strokeLinecap: strokeLinecap,\n strokeWidth: strokeWidth,\n opacity: ptg === 0 ? 0 : 1,\n style: circleStyleForStack,\n ref: ref\n });\n\n // ========================== Render ==========================\n if (!isGradient) {\n return circleNode;\n }\n var maskId = \"\".concat(gradientId, \"-conic\");\n var fromDeg = gapDegree ? \"\".concat(180 + gapDegree / 2, \"deg\") : '0deg';\n var conicColors = getPtgColors(color, (360 - gapDegree) / 360);\n var linearColors = getPtgColors(color, 1);\n var conicColorBg = \"conic-gradient(from \".concat(fromDeg, \", \").concat(conicColors.join(', '), \")\");\n var linearColorBg = \"linear-gradient(to \".concat(gapDegree ? 'bottom' : 'top', \", \").concat(linearColors.join(', '), \")\");\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"mask\", {\n id: maskId\n }, circleNode), /*#__PURE__*/React.createElement(\"foreignObject\", {\n x: 0,\n y: 0,\n width: size,\n height: size,\n mask: \"url(#\".concat(maskId, \")\")\n }, /*#__PURE__*/React.createElement(Block, {\n bg: linearColorBg\n }, /*#__PURE__*/React.createElement(Block, {\n bg: conicColorBg\n }))));\n});\nif (process.env.NODE_ENV !== 'production') {\n PtgCircle.displayName = 'PtgCircle';\n}\nexport default PtgCircle;"],"mappings":"AAAA,OAAOA,OAAO,MAAM,mCAAmC;AACvD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,IAAIC,KAAK,GAAG,SAASA,KAAKA,CAACC,IAAI,EAAE;EAC/B,IAAIC,EAAE,GAAGD,IAAI,CAACC,EAAE;IACdC,QAAQ,GAAGF,IAAI,CAACE,QAAQ;EAC1B,OAAO,aAAaJ,KAAK,CAACK,aAAa,CAAC,KAAK,EAAE;IAC7CC,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