233 lines
6.5 KiB
JavaScript
233 lines
6.5 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: d209710bf7c02a33.1dff92b6be.js
|
|
* Module id: 372566
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e) => {
|
|
"use strict";
|
|
e.i(935492), e.i(23741), e.i(511334);
|
|
var t = e.i(640404),
|
|
r = e.i(552659),
|
|
n = e.i(358379),
|
|
a = e.i(54168),
|
|
i = e.i(634885),
|
|
o = e.i(914528),
|
|
l = e.i(504997),
|
|
s = e.i(483926),
|
|
u = e.i(750149),
|
|
c = e.i(624977);
|
|
e.i(906816);
|
|
var f = e.i(221588),
|
|
d = ["b"],
|
|
p = ["v"],
|
|
m = function (e) {
|
|
return Math.round(Number(e || 0));
|
|
},
|
|
h = function (e) {
|
|
if (e instanceof f.FastColor) return e;
|
|
if (e && "object" === (0, c.default)(e) && "h" in e && "b" in e) {
|
|
var t = e.b,
|
|
r = (0, u.default)(e, d);
|
|
return (0, a.default)((0, a.default)({}, r), {}, { v: t });
|
|
}
|
|
return "string" == typeof e && /hsb/.test(e)
|
|
? e.replace(/hsb/, "hsv")
|
|
: e;
|
|
},
|
|
v = (function (e) {
|
|
(0, l.default)(r, e);
|
|
var t = (0, s.default)(r);
|
|
function r(e) {
|
|
return (0, i.default)(this, r), t.call(this, h(e));
|
|
}
|
|
return (
|
|
(0, o.default)(r, [
|
|
{
|
|
key: "toHsbString",
|
|
value: function () {
|
|
var e = this.toHsb(),
|
|
t = m(100 * e.s),
|
|
r = m(100 * e.b),
|
|
n = m(e.h),
|
|
a = e.a,
|
|
i = "hsb(".concat(n, ", ").concat(t, "%, ").concat(r, "%)"),
|
|
o = "hsba("
|
|
.concat(n, ", ")
|
|
.concat(t, "%, ")
|
|
.concat(r, "%, ")
|
|
.concat(a.toFixed(2 * (0 !== a)), ")");
|
|
return 1 === a ? i : o;
|
|
},
|
|
},
|
|
{
|
|
key: "toHsb",
|
|
value: function () {
|
|
var e = this.toHsv(),
|
|
t = e.v,
|
|
r = (0, u.default)(e, p);
|
|
return (0, a.default)(
|
|
(0, a.default)({}, r),
|
|
{},
|
|
{ b: t, a: this.a },
|
|
);
|
|
},
|
|
},
|
|
]),
|
|
r
|
|
);
|
|
})(f.FastColor);
|
|
e.s(["Color", () => v], 791566);
|
|
var g = function (e) {
|
|
return e instanceof v ? e : new v(e);
|
|
};
|
|
g("#1677ff");
|
|
var b = e.i(264458);
|
|
e.s(
|
|
[
|
|
"default",
|
|
0,
|
|
function (e) {
|
|
var t = e.color,
|
|
r = e.prefixCls,
|
|
a = e.className,
|
|
i = e.style,
|
|
o = e.onClick,
|
|
l = "".concat(r, "-color-block");
|
|
return n.default.createElement(
|
|
"div",
|
|
{ className: (0, b.default)(l, a), style: i, onClick: o },
|
|
n.default.createElement("div", {
|
|
className: "".concat(l, "-inner"),
|
|
style: { background: t },
|
|
}),
|
|
);
|
|
},
|
|
],
|
|
252174,
|
|
);
|
|
e.i(299916);
|
|
e.i(997928);
|
|
e.i(549195);
|
|
e.s([], 196312);
|
|
let y = (0, o.default)(
|
|
function e(t) {
|
|
var r;
|
|
if (((0, i.default)(this, e), (this.cleared = !1), t instanceof e)) {
|
|
(this.metaColor = t.metaColor.clone()),
|
|
(this.colors =
|
|
null == (r = t.colors)
|
|
? void 0
|
|
: r.map((t) => ({
|
|
color: new e(t.color),
|
|
percent: t.percent,
|
|
}))),
|
|
(this.cleared = t.cleared);
|
|
return;
|
|
}
|
|
let n = Array.isArray(t);
|
|
n && t.length
|
|
? ((this.colors = t.map(({ color: t, percent: r }) => ({
|
|
color: new e(t),
|
|
percent: r,
|
|
}))),
|
|
(this.metaColor = new v(this.colors[0].color.metaColor)))
|
|
: (this.metaColor = new v(n ? "" : t)),
|
|
(t && (!n || this.colors)) ||
|
|
((this.metaColor = this.metaColor.setA(0)), (this.cleared = !0));
|
|
},
|
|
[
|
|
{
|
|
key: "toHsb",
|
|
value: function () {
|
|
return this.metaColor.toHsb();
|
|
},
|
|
},
|
|
{
|
|
key: "toHsbString",
|
|
value: function () {
|
|
return this.metaColor.toHsbString();
|
|
},
|
|
},
|
|
{
|
|
key: "toHex",
|
|
value: function () {
|
|
var e, t;
|
|
return (
|
|
(e = this.toHexString()),
|
|
(t = this.metaColor.a < 1),
|
|
(e &&
|
|
(null == e
|
|
? void 0
|
|
: e.replace(/[^\w/]/g, "").slice(0, t ? 8 : 6))) ||
|
|
""
|
|
);
|
|
},
|
|
},
|
|
{
|
|
key: "toHexString",
|
|
value: function () {
|
|
return this.metaColor.toHexString();
|
|
},
|
|
},
|
|
{
|
|
key: "toRgb",
|
|
value: function () {
|
|
return this.metaColor.toRgb();
|
|
},
|
|
},
|
|
{
|
|
key: "toRgbString",
|
|
value: function () {
|
|
return this.metaColor.toRgbString();
|
|
},
|
|
},
|
|
{
|
|
key: "isGradient",
|
|
value: function () {
|
|
return !!this.colors && !this.cleared;
|
|
},
|
|
},
|
|
{
|
|
key: "getColors",
|
|
value: function () {
|
|
return this.colors || [{ color: this, percent: 0 }];
|
|
},
|
|
},
|
|
{
|
|
key: "toCssString",
|
|
value: function () {
|
|
let { colors: e } = this;
|
|
if (e) {
|
|
let t = e
|
|
.map((e) => `${e.color.toRgbString()} ${e.percent}%`)
|
|
.join(", ");
|
|
return `linear-gradient(90deg, ${t})`;
|
|
}
|
|
return this.metaColor.toRgbString();
|
|
},
|
|
},
|
|
{
|
|
key: "equals",
|
|
value: function (e) {
|
|
return (
|
|
!!e &&
|
|
this.isGradient() === e.isGradient() &&
|
|
(this.isGradient()
|
|
? this.colors.length === e.colors.length &&
|
|
this.colors.every((t, r) => {
|
|
let n = e.colors[r];
|
|
return t.percent === n.percent && t.color.equals(n.color);
|
|
})
|
|
: this.toHexString() === e.toHexString())
|
|
);
|
|
},
|
|
},
|
|
],
|
|
);
|
|
e.s(["AggregationColor", () => y], 372566),
|
|
e.s(["generateColor", 0, (e) => (e instanceof y ? e : new y(e))], 490116);
|
|
};
|
|
|
|
export default moduleFactory;
|