image-beautifier 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/lib/image-beautifier.es.js +1201 -1013
- package/lib/style.css +1 -1
- package/package.json +8 -2
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import { ColorPicker as
|
|
6
|
-
import { observer as
|
|
7
|
-
import { Camera as
|
|
8
|
-
import { TinyColor as
|
|
9
|
-
import { clsx as
|
|
10
|
-
import { twMerge as
|
|
11
|
-
import { makeAutoObservable as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
1
|
+
var hr = Object.defineProperty;
|
|
2
|
+
var pr = (o, t, n) => t in o ? hr(o, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[t] = n;
|
|
3
|
+
var R = (o, t, n) => pr(o, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import kt, { useState as O, useMemo as le, useEffect as N, Children as it, cloneElement as st, useRef as ne } from "react";
|
|
5
|
+
import { ColorPicker as ur, Button as k, Dropdown as At, Popover as xe, Divider as mr, InputNumber as nt, Tooltip as L, Modal as gr, Switch as at, Input as xr, Radio as P, Segmented as lt, ConfigProvider as Nt, Popconfirm as br, Drawer as wr, Slider as pe, Upload as yr, message as vr, theme as ct } from "antd";
|
|
6
|
+
import { observer as B } from "mobx-react-lite";
|
|
7
|
+
import { Camera as jr, Check as Mr, Square as Cr, Circle as kr, Slash as Ar, MoveDownLeft as Nr, Pencil as Tr, Smile as Sr, Undo as Rr, Redo as Dr, ChevronRight as Hr, ChevronDown as zr, ChevronUp as _r, RotateCcw as Er, ZoomIn as Or, ZoomOut as Br, Hand as Yr, Crop as Ir, FlipHorizontal2 as Pr, FlipVertical2 as Wr, Sunset as Zr, Box as Gr, LayoutGrid as Fr, ImagePlus as Lr, Type as Ur, CodeXml as Vr, ClipboardPaste as Jr, ImagePlay as qr, Maximize as Xr, ListCollapse as Qr, ArrowUpRight as $r, ArrowDownRight as Kr, ImageDown as eo, Copy as to, Settings2 as ro, ChevronLeft as oo, Pipette as io, Trash2 as so, Sun as no, Moon as ao, icons as dt } from "lucide-react";
|
|
8
|
+
import { TinyColor as lo } from "@ctrl/tinycolor";
|
|
9
|
+
import { clsx as co } from "clsx";
|
|
10
|
+
import { twMerge as fo } from "tailwind-merge";
|
|
11
|
+
import { makeAutoObservable as Tt, toJS as St, runInAction as ho, action as po } from "mobx";
|
|
12
|
+
import { maxBy as uo } from "lodash";
|
|
13
|
+
import mo from "@emoji-mart/data";
|
|
14
|
+
import go from "@emoji-mart/react";
|
|
15
|
+
import { Frame as xo, Rect as ae, Box as ft, Ellipse as ht, Line as pt, Text as bo, Cursor as wo, App as yo, ZoomEvent as vo, ResizeEvent as jo, PointerEvent as Mo, DragEvent as De } from "leafer-ui";
|
|
16
|
+
import { addListener as Co, removeListener as ko } from "resize-detector";
|
|
17
|
+
import { Arrow as Ao } from "@leafer-in/arrow";
|
|
18
|
+
import { ScrollBar as No } from "@leafer-in/scroll";
|
|
19
|
+
import { tinykeys as Rt } from "tinykeys";
|
|
19
20
|
import "@leafer-in/editor";
|
|
20
21
|
import "@leafer-in/view";
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
import { StyleProvider as To } from "@ant-design/cssinjs";
|
|
23
|
+
import So from "react-cropper";
|
|
24
|
+
var ue = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
25
|
+
function Ro(o) {
|
|
24
26
|
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
25
27
|
}
|
|
26
|
-
var
|
|
28
|
+
var ze = { exports: {} }, oe = {};
|
|
27
29
|
/**
|
|
28
30
|
* @license React
|
|
29
31
|
* react-jsx-runtime.production.min.js
|
|
@@ -33,21 +35,21 @@ var He = { exports: {} }, oe = {};
|
|
|
33
35
|
* This source code is licensed under the MIT license found in the
|
|
34
36
|
* LICENSE file in the root directory of this source tree.
|
|
35
37
|
*/
|
|
36
|
-
var
|
|
37
|
-
function
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
var o =
|
|
41
|
-
function
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
for (
|
|
45
|
-
if (f && f.defaultProps) for (
|
|
46
|
-
return { $$typeof: t, type: f, key:
|
|
38
|
+
var ut;
|
|
39
|
+
function Do() {
|
|
40
|
+
if (ut) return oe;
|
|
41
|
+
ut = 1;
|
|
42
|
+
var o = kt, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, a = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
43
|
+
function h(f, d, p) {
|
|
44
|
+
var m, b = {}, C = null, A = null;
|
|
45
|
+
p !== void 0 && (C = "" + p), d.key !== void 0 && (C = "" + d.key), d.ref !== void 0 && (A = d.ref);
|
|
46
|
+
for (m in d) s.call(d, m) && !l.hasOwnProperty(m) && (b[m] = d[m]);
|
|
47
|
+
if (f && f.defaultProps) for (m in d = f.defaultProps, d) b[m] === void 0 && (b[m] = d[m]);
|
|
48
|
+
return { $$typeof: t, type: f, key: C, ref: A, props: b, _owner: a.current };
|
|
47
49
|
}
|
|
48
|
-
return oe.Fragment = n, oe.jsx =
|
|
50
|
+
return oe.Fragment = n, oe.jsx = h, oe.jsxs = h, oe;
|
|
49
51
|
}
|
|
50
|
-
var
|
|
52
|
+
var ie = {};
|
|
51
53
|
/**
|
|
52
54
|
* @license React
|
|
53
55
|
* react-jsx-runtime.development.js
|
|
@@ -57,61 +59,61 @@ var re = {};
|
|
|
57
59
|
* This source code is licensed under the MIT license found in the
|
|
58
60
|
* LICENSE file in the root directory of this source tree.
|
|
59
61
|
*/
|
|
60
|
-
var
|
|
61
|
-
function
|
|
62
|
-
return
|
|
63
|
-
var o =
|
|
64
|
-
function
|
|
65
|
-
if (
|
|
62
|
+
var mt;
|
|
63
|
+
function Ho() {
|
|
64
|
+
return mt || (mt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
65
|
+
var o = kt, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), f = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), A = Symbol.for("react.offscreen"), x = Symbol.iterator, w = "@@iterator";
|
|
66
|
+
function S(r) {
|
|
67
|
+
if (r === null || typeof r != "object")
|
|
66
68
|
return null;
|
|
67
|
-
var c = x &&
|
|
69
|
+
var c = x && r[x] || r[w];
|
|
68
70
|
return typeof c == "function" ? c : null;
|
|
69
71
|
}
|
|
70
72
|
var _ = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
71
|
-
function E(
|
|
73
|
+
function E(r) {
|
|
72
74
|
{
|
|
73
|
-
for (var c = arguments.length,
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
for (var c = arguments.length, u = new Array(c > 1 ? c - 1 : 0), g = 1; g < c; g++)
|
|
76
|
+
u[g - 1] = arguments[g];
|
|
77
|
+
ye("error", r, u);
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
|
-
function
|
|
80
|
+
function ye(r, c, u) {
|
|
79
81
|
{
|
|
80
|
-
var
|
|
81
|
-
j !== "" && (c += "%s",
|
|
82
|
-
var
|
|
83
|
-
return String(
|
|
82
|
+
var g = _.ReactDebugCurrentFrame, j = g.getStackAddendum();
|
|
83
|
+
j !== "" && (c += "%s", u = u.concat([j]));
|
|
84
|
+
var T = u.map(function(v) {
|
|
85
|
+
return String(v);
|
|
84
86
|
});
|
|
85
|
-
|
|
87
|
+
T.unshift("Warning: " + c), Function.prototype.apply.call(console[r], console, T);
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
|
-
var
|
|
90
|
+
var ve = !1, $ = !1, D = !1, G = !1, U = !1, K;
|
|
89
91
|
K = Symbol.for("react.module.reference");
|
|
90
|
-
function
|
|
91
|
-
return !!(typeof
|
|
92
|
+
function Bt(r) {
|
|
93
|
+
return !!(typeof r == "string" || typeof r == "function" || r === s || r === l || U || r === a || r === p || r === m || G || r === A || ve || $ || D || typeof r == "object" && r !== null && (r.$$typeof === C || r.$$typeof === b || r.$$typeof === h || r.$$typeof === f || r.$$typeof === d || // This needs to include all possible module reference object
|
|
92
94
|
// types supported by any Flight configuration anywhere since
|
|
93
95
|
// we don't know which Flight build this will end up being used
|
|
94
96
|
// with.
|
|
95
|
-
|
|
97
|
+
r.$$typeof === K || r.getModuleId !== void 0));
|
|
96
98
|
}
|
|
97
|
-
function
|
|
98
|
-
var
|
|
99
|
-
if (
|
|
100
|
-
return
|
|
99
|
+
function Yt(r, c, u) {
|
|
100
|
+
var g = r.displayName;
|
|
101
|
+
if (g)
|
|
102
|
+
return g;
|
|
101
103
|
var j = c.displayName || c.name || "";
|
|
102
|
-
return j !== "" ?
|
|
104
|
+
return j !== "" ? u + "(" + j + ")" : u;
|
|
103
105
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
106
|
+
function Ee(r) {
|
|
107
|
+
return r.displayName || "Context";
|
|
106
108
|
}
|
|
107
|
-
function
|
|
108
|
-
if (
|
|
109
|
+
function F(r) {
|
|
110
|
+
if (r == null)
|
|
109
111
|
return null;
|
|
110
|
-
if (typeof
|
|
111
|
-
return
|
|
112
|
-
if (typeof
|
|
113
|
-
return
|
|
114
|
-
switch (
|
|
112
|
+
if (typeof r.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
|
113
|
+
return r.displayName || r.name || null;
|
|
114
|
+
if (typeof r == "string")
|
|
115
|
+
return r;
|
|
116
|
+
switch (r) {
|
|
115
117
|
case s:
|
|
116
118
|
return "Fragment";
|
|
117
119
|
case n:
|
|
@@ -120,28 +122,28 @@ function Mo() {
|
|
|
120
122
|
return "Profiler";
|
|
121
123
|
case a:
|
|
122
124
|
return "StrictMode";
|
|
123
|
-
case
|
|
125
|
+
case p:
|
|
124
126
|
return "Suspense";
|
|
125
|
-
case
|
|
127
|
+
case m:
|
|
126
128
|
return "SuspenseList";
|
|
127
129
|
}
|
|
128
|
-
if (typeof
|
|
129
|
-
switch (
|
|
130
|
+
if (typeof r == "object")
|
|
131
|
+
switch (r.$$typeof) {
|
|
130
132
|
case f:
|
|
131
|
-
var c =
|
|
132
|
-
return
|
|
133
|
+
var c = r;
|
|
134
|
+
return Ee(c) + ".Consumer";
|
|
135
|
+
case h:
|
|
136
|
+
var u = r;
|
|
137
|
+
return Ee(u._context) + ".Provider";
|
|
133
138
|
case d:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return
|
|
138
|
-
case
|
|
139
|
-
var
|
|
140
|
-
return m !== null ? m : Z(i.type) || "Memo";
|
|
141
|
-
case S: {
|
|
142
|
-
var j = i, C = j._payload, w = j._init;
|
|
139
|
+
return Yt(r, r.render, "ForwardRef");
|
|
140
|
+
case b:
|
|
141
|
+
var g = r.displayName || null;
|
|
142
|
+
return g !== null ? g : F(r.type) || "Memo";
|
|
143
|
+
case C: {
|
|
144
|
+
var j = r, T = j._payload, v = j._init;
|
|
143
145
|
try {
|
|
144
|
-
return
|
|
146
|
+
return F(v(T));
|
|
145
147
|
} catch {
|
|
146
148
|
return null;
|
|
147
149
|
}
|
|
@@ -149,570 +151,572 @@ function Mo() {
|
|
|
149
151
|
}
|
|
150
152
|
return null;
|
|
151
153
|
}
|
|
152
|
-
var V = Object.assign, ee = 0,
|
|
153
|
-
function
|
|
154
|
+
var V = Object.assign, ee = 0, Oe, Be, Ye, Ie, Pe, We, Ze;
|
|
155
|
+
function Ge() {
|
|
154
156
|
}
|
|
155
|
-
|
|
156
|
-
function
|
|
157
|
+
Ge.__reactDisabledLog = !0;
|
|
158
|
+
function It() {
|
|
157
159
|
{
|
|
158
160
|
if (ee === 0) {
|
|
159
|
-
|
|
160
|
-
var
|
|
161
|
+
Oe = console.log, Be = console.info, Ye = console.warn, Ie = console.error, Pe = console.group, We = console.groupCollapsed, Ze = console.groupEnd;
|
|
162
|
+
var r = {
|
|
161
163
|
configurable: !0,
|
|
162
164
|
enumerable: !0,
|
|
163
|
-
value:
|
|
165
|
+
value: Ge,
|
|
164
166
|
writable: !0
|
|
165
167
|
};
|
|
166
168
|
Object.defineProperties(console, {
|
|
167
|
-
info:
|
|
168
|
-
log:
|
|
169
|
-
warn:
|
|
170
|
-
error:
|
|
171
|
-
group:
|
|
172
|
-
groupCollapsed:
|
|
173
|
-
groupEnd:
|
|
169
|
+
info: r,
|
|
170
|
+
log: r,
|
|
171
|
+
warn: r,
|
|
172
|
+
error: r,
|
|
173
|
+
group: r,
|
|
174
|
+
groupCollapsed: r,
|
|
175
|
+
groupEnd: r
|
|
174
176
|
});
|
|
175
177
|
}
|
|
176
178
|
ee++;
|
|
177
179
|
}
|
|
178
180
|
}
|
|
179
|
-
function
|
|
181
|
+
function Pt() {
|
|
180
182
|
{
|
|
181
183
|
if (ee--, ee === 0) {
|
|
182
|
-
var
|
|
184
|
+
var r = {
|
|
183
185
|
configurable: !0,
|
|
184
186
|
enumerable: !0,
|
|
185
187
|
writable: !0
|
|
186
188
|
};
|
|
187
189
|
Object.defineProperties(console, {
|
|
188
|
-
log: V({},
|
|
189
|
-
value: Ee
|
|
190
|
-
}),
|
|
191
|
-
info: V({}, i, {
|
|
190
|
+
log: V({}, r, {
|
|
192
191
|
value: Oe
|
|
193
192
|
}),
|
|
194
|
-
|
|
195
|
-
value:
|
|
193
|
+
info: V({}, r, {
|
|
194
|
+
value: Be
|
|
196
195
|
}),
|
|
197
|
-
|
|
196
|
+
warn: V({}, r, {
|
|
198
197
|
value: Ye
|
|
199
198
|
}),
|
|
200
|
-
|
|
199
|
+
error: V({}, r, {
|
|
201
200
|
value: Ie
|
|
202
201
|
}),
|
|
203
|
-
|
|
204
|
-
value: Be
|
|
205
|
-
}),
|
|
206
|
-
groupEnd: V({}, i, {
|
|
202
|
+
group: V({}, r, {
|
|
207
203
|
value: Pe
|
|
204
|
+
}),
|
|
205
|
+
groupCollapsed: V({}, r, {
|
|
206
|
+
value: We
|
|
207
|
+
}),
|
|
208
|
+
groupEnd: V({}, r, {
|
|
209
|
+
value: Ze
|
|
208
210
|
})
|
|
209
211
|
});
|
|
210
212
|
}
|
|
211
213
|
ee < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
212
214
|
}
|
|
213
215
|
}
|
|
214
|
-
var
|
|
215
|
-
function
|
|
216
|
+
var je = _.ReactCurrentDispatcher, Me;
|
|
217
|
+
function ce(r, c, u) {
|
|
216
218
|
{
|
|
217
|
-
if (
|
|
219
|
+
if (Me === void 0)
|
|
218
220
|
try {
|
|
219
221
|
throw Error();
|
|
220
222
|
} catch (j) {
|
|
221
|
-
var
|
|
222
|
-
|
|
223
|
+
var g = j.stack.trim().match(/\n( *(at )?)/);
|
|
224
|
+
Me = g && g[1] || "";
|
|
223
225
|
}
|
|
224
226
|
return `
|
|
225
|
-
` +
|
|
227
|
+
` + Me + r;
|
|
226
228
|
}
|
|
227
229
|
}
|
|
228
|
-
var
|
|
230
|
+
var Ce = !1, de;
|
|
229
231
|
{
|
|
230
|
-
var
|
|
231
|
-
|
|
232
|
+
var Wt = typeof WeakMap == "function" ? WeakMap : Map;
|
|
233
|
+
de = new Wt();
|
|
232
234
|
}
|
|
233
|
-
function
|
|
234
|
-
if (!
|
|
235
|
+
function Fe(r, c) {
|
|
236
|
+
if (!r || Ce)
|
|
235
237
|
return "";
|
|
236
238
|
{
|
|
237
|
-
var
|
|
238
|
-
if (
|
|
239
|
-
return
|
|
239
|
+
var u = de.get(r);
|
|
240
|
+
if (u !== void 0)
|
|
241
|
+
return u;
|
|
240
242
|
}
|
|
241
|
-
var
|
|
242
|
-
|
|
243
|
+
var g;
|
|
244
|
+
Ce = !0;
|
|
243
245
|
var j = Error.prepareStackTrace;
|
|
244
246
|
Error.prepareStackTrace = void 0;
|
|
245
|
-
var
|
|
246
|
-
|
|
247
|
+
var T;
|
|
248
|
+
T = je.current, je.current = null, It();
|
|
247
249
|
try {
|
|
248
250
|
if (c) {
|
|
249
|
-
var
|
|
251
|
+
var v = function() {
|
|
250
252
|
throw Error();
|
|
251
253
|
};
|
|
252
|
-
if (Object.defineProperty(
|
|
254
|
+
if (Object.defineProperty(v.prototype, "props", {
|
|
253
255
|
set: function() {
|
|
254
256
|
throw Error();
|
|
255
257
|
}
|
|
256
258
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
257
259
|
try {
|
|
258
|
-
Reflect.construct(
|
|
259
|
-
} catch (
|
|
260
|
-
|
|
260
|
+
Reflect.construct(v, []);
|
|
261
|
+
} catch (I) {
|
|
262
|
+
g = I;
|
|
261
263
|
}
|
|
262
|
-
Reflect.construct(
|
|
264
|
+
Reflect.construct(r, [], v);
|
|
263
265
|
} else {
|
|
264
266
|
try {
|
|
265
|
-
|
|
266
|
-
} catch (
|
|
267
|
-
|
|
267
|
+
v.call();
|
|
268
|
+
} catch (I) {
|
|
269
|
+
g = I;
|
|
268
270
|
}
|
|
269
|
-
|
|
271
|
+
r.call(v.prototype);
|
|
270
272
|
}
|
|
271
273
|
} else {
|
|
272
274
|
try {
|
|
273
275
|
throw Error();
|
|
274
|
-
} catch (
|
|
275
|
-
|
|
276
|
+
} catch (I) {
|
|
277
|
+
g = I;
|
|
276
278
|
}
|
|
277
|
-
|
|
279
|
+
r();
|
|
278
280
|
}
|
|
279
|
-
} catch (
|
|
280
|
-
if (
|
|
281
|
-
for (var
|
|
282
|
-
`),
|
|
283
|
-
`),
|
|
281
|
+
} catch (I) {
|
|
282
|
+
if (I && g && typeof I.stack == "string") {
|
|
283
|
+
for (var y = I.stack.split(`
|
|
284
|
+
`), Y = g.stack.split(`
|
|
285
|
+
`), H = y.length - 1, z = Y.length - 1; H >= 1 && z >= 0 && y[H] !== Y[z]; )
|
|
284
286
|
z--;
|
|
285
|
-
for (;
|
|
286
|
-
if (
|
|
287
|
-
if (
|
|
287
|
+
for (; H >= 1 && z >= 0; H--, z--)
|
|
288
|
+
if (y[H] !== Y[z]) {
|
|
289
|
+
if (H !== 1 || z !== 1)
|
|
288
290
|
do
|
|
289
|
-
if (
|
|
290
|
-
var
|
|
291
|
-
` +
|
|
292
|
-
return
|
|
291
|
+
if (H--, z--, z < 0 || y[H] !== Y[z]) {
|
|
292
|
+
var W = `
|
|
293
|
+
` + y[H].replace(" at new ", " at ");
|
|
294
|
+
return r.displayName && W.includes("<anonymous>") && (W = W.replace("<anonymous>", r.displayName)), typeof r == "function" && de.set(r, W), W;
|
|
293
295
|
}
|
|
294
|
-
while (
|
|
296
|
+
while (H >= 1 && z >= 0);
|
|
295
297
|
break;
|
|
296
298
|
}
|
|
297
299
|
}
|
|
298
300
|
} finally {
|
|
299
|
-
|
|
301
|
+
Ce = !1, je.current = T, Pt(), Error.prepareStackTrace = j;
|
|
300
302
|
}
|
|
301
|
-
var X =
|
|
302
|
-
return typeof
|
|
303
|
+
var X = r ? r.displayName || r.name : "", J = X ? ce(X) : "";
|
|
304
|
+
return typeof r == "function" && de.set(r, J), J;
|
|
303
305
|
}
|
|
304
|
-
function
|
|
305
|
-
return
|
|
306
|
+
function Zt(r, c, u) {
|
|
307
|
+
return Fe(r, !1);
|
|
306
308
|
}
|
|
307
|
-
function
|
|
308
|
-
var c =
|
|
309
|
+
function Gt(r) {
|
|
310
|
+
var c = r.prototype;
|
|
309
311
|
return !!(c && c.isReactComponent);
|
|
310
312
|
}
|
|
311
|
-
function
|
|
312
|
-
if (
|
|
313
|
+
function fe(r, c, u) {
|
|
314
|
+
if (r == null)
|
|
313
315
|
return "";
|
|
314
|
-
if (typeof
|
|
315
|
-
return
|
|
316
|
-
if (typeof
|
|
317
|
-
return
|
|
318
|
-
switch (
|
|
319
|
-
case
|
|
320
|
-
return
|
|
321
|
-
case
|
|
322
|
-
return
|
|
316
|
+
if (typeof r == "function")
|
|
317
|
+
return Fe(r, Gt(r));
|
|
318
|
+
if (typeof r == "string")
|
|
319
|
+
return ce(r);
|
|
320
|
+
switch (r) {
|
|
321
|
+
case p:
|
|
322
|
+
return ce("Suspense");
|
|
323
|
+
case m:
|
|
324
|
+
return ce("SuspenseList");
|
|
323
325
|
}
|
|
324
|
-
if (typeof
|
|
325
|
-
switch (
|
|
326
|
-
case
|
|
327
|
-
return
|
|
328
|
-
case
|
|
329
|
-
return
|
|
330
|
-
case
|
|
331
|
-
var
|
|
326
|
+
if (typeof r == "object")
|
|
327
|
+
switch (r.$$typeof) {
|
|
328
|
+
case d:
|
|
329
|
+
return Zt(r.render);
|
|
330
|
+
case b:
|
|
331
|
+
return fe(r.type, c, u);
|
|
332
|
+
case C: {
|
|
333
|
+
var g = r, j = g._payload, T = g._init;
|
|
332
334
|
try {
|
|
333
|
-
return
|
|
335
|
+
return fe(T(j), c, u);
|
|
334
336
|
} catch {
|
|
335
337
|
}
|
|
336
338
|
}
|
|
337
339
|
}
|
|
338
340
|
return "";
|
|
339
341
|
}
|
|
340
|
-
var te = Object.prototype.hasOwnProperty,
|
|
341
|
-
function
|
|
342
|
-
if (
|
|
343
|
-
var c =
|
|
344
|
-
|
|
342
|
+
var te = Object.prototype.hasOwnProperty, Le = {}, Ue = _.ReactDebugCurrentFrame;
|
|
343
|
+
function he(r) {
|
|
344
|
+
if (r) {
|
|
345
|
+
var c = r._owner, u = fe(r.type, r._source, c ? c.type : null);
|
|
346
|
+
Ue.setExtraStackFrame(u);
|
|
345
347
|
} else
|
|
346
|
-
|
|
348
|
+
Ue.setExtraStackFrame(null);
|
|
347
349
|
}
|
|
348
|
-
function
|
|
350
|
+
function Ft(r, c, u, g, j) {
|
|
349
351
|
{
|
|
350
|
-
var
|
|
351
|
-
for (var
|
|
352
|
-
if (
|
|
353
|
-
var
|
|
352
|
+
var T = Function.call.bind(te);
|
|
353
|
+
for (var v in r)
|
|
354
|
+
if (T(r, v)) {
|
|
355
|
+
var y = void 0;
|
|
354
356
|
try {
|
|
355
|
-
if (typeof
|
|
356
|
-
var
|
|
357
|
-
throw
|
|
357
|
+
if (typeof r[v] != "function") {
|
|
358
|
+
var Y = Error((g || "React class") + ": " + u + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
359
|
+
throw Y.name = "Invariant Violation", Y;
|
|
358
360
|
}
|
|
359
|
-
|
|
360
|
-
} catch (
|
|
361
|
-
|
|
361
|
+
y = r[v](c, v, g, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
362
|
+
} catch (H) {
|
|
363
|
+
y = H;
|
|
362
364
|
}
|
|
363
|
-
|
|
365
|
+
y && !(y instanceof Error) && (he(j), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", g || "React class", u, v, typeof y), he(null)), y instanceof Error && !(y.message in Le) && (Le[y.message] = !0, he(j), E("Failed %s type: %s", u, y.message), he(null));
|
|
364
366
|
}
|
|
365
367
|
}
|
|
366
368
|
}
|
|
367
|
-
var
|
|
368
|
-
function
|
|
369
|
-
return
|
|
369
|
+
var Lt = Array.isArray;
|
|
370
|
+
function ke(r) {
|
|
371
|
+
return Lt(r);
|
|
370
372
|
}
|
|
371
|
-
function
|
|
373
|
+
function Ut(r) {
|
|
372
374
|
{
|
|
373
|
-
var c = typeof Symbol == "function" && Symbol.toStringTag,
|
|
374
|
-
return
|
|
375
|
+
var c = typeof Symbol == "function" && Symbol.toStringTag, u = c && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
376
|
+
return u;
|
|
375
377
|
}
|
|
376
378
|
}
|
|
377
|
-
function
|
|
379
|
+
function Vt(r) {
|
|
378
380
|
try {
|
|
379
|
-
return
|
|
381
|
+
return Ve(r), !1;
|
|
380
382
|
} catch {
|
|
381
383
|
return !0;
|
|
382
384
|
}
|
|
383
385
|
}
|
|
384
|
-
function
|
|
385
|
-
return "" +
|
|
386
|
+
function Ve(r) {
|
|
387
|
+
return "" + r;
|
|
386
388
|
}
|
|
387
|
-
function
|
|
388
|
-
if (
|
|
389
|
-
return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
389
|
+
function Je(r) {
|
|
390
|
+
if (Vt(r))
|
|
391
|
+
return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ut(r)), Ve(r);
|
|
390
392
|
}
|
|
391
|
-
var
|
|
393
|
+
var re = _.ReactCurrentOwner, Jt = {
|
|
392
394
|
key: !0,
|
|
393
395
|
ref: !0,
|
|
394
396
|
__self: !0,
|
|
395
397
|
__source: !0
|
|
396
|
-
},
|
|
397
|
-
|
|
398
|
-
function
|
|
399
|
-
if (te.call(
|
|
400
|
-
var c = Object.getOwnPropertyDescriptor(
|
|
398
|
+
}, qe, Xe, Ae;
|
|
399
|
+
Ae = {};
|
|
400
|
+
function qt(r) {
|
|
401
|
+
if (te.call(r, "ref")) {
|
|
402
|
+
var c = Object.getOwnPropertyDescriptor(r, "ref").get;
|
|
401
403
|
if (c && c.isReactWarning)
|
|
402
404
|
return !1;
|
|
403
405
|
}
|
|
404
|
-
return
|
|
406
|
+
return r.ref !== void 0;
|
|
405
407
|
}
|
|
406
|
-
function
|
|
407
|
-
if (te.call(
|
|
408
|
-
var c = Object.getOwnPropertyDescriptor(
|
|
408
|
+
function Xt(r) {
|
|
409
|
+
if (te.call(r, "key")) {
|
|
410
|
+
var c = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
409
411
|
if (c && c.isReactWarning)
|
|
410
412
|
return !1;
|
|
411
413
|
}
|
|
412
|
-
return
|
|
414
|
+
return r.key !== void 0;
|
|
413
415
|
}
|
|
414
|
-
function
|
|
415
|
-
if (typeof
|
|
416
|
-
var
|
|
417
|
-
|
|
416
|
+
function Qt(r, c) {
|
|
417
|
+
if (typeof r.ref == "string" && re.current && c && re.current.stateNode !== c) {
|
|
418
|
+
var u = F(re.current.type);
|
|
419
|
+
Ae[u] || (E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', F(re.current.type), r.ref), Ae[u] = !0);
|
|
418
420
|
}
|
|
419
421
|
}
|
|
420
|
-
function
|
|
422
|
+
function $t(r, c) {
|
|
421
423
|
{
|
|
422
|
-
var
|
|
423
|
-
|
|
424
|
+
var u = function() {
|
|
425
|
+
qe || (qe = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", c));
|
|
424
426
|
};
|
|
425
|
-
|
|
426
|
-
get:
|
|
427
|
+
u.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
428
|
+
get: u,
|
|
427
429
|
configurable: !0
|
|
428
430
|
});
|
|
429
431
|
}
|
|
430
432
|
}
|
|
431
|
-
function
|
|
433
|
+
function Kt(r, c) {
|
|
432
434
|
{
|
|
433
|
-
var
|
|
434
|
-
|
|
435
|
+
var u = function() {
|
|
436
|
+
Xe || (Xe = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", c));
|
|
435
437
|
};
|
|
436
|
-
|
|
437
|
-
get:
|
|
438
|
+
u.isReactWarning = !0, Object.defineProperty(r, "ref", {
|
|
439
|
+
get: u,
|
|
438
440
|
configurable: !0
|
|
439
441
|
});
|
|
440
442
|
}
|
|
441
443
|
}
|
|
442
|
-
var
|
|
443
|
-
var
|
|
444
|
+
var er = function(r, c, u, g, j, T, v) {
|
|
445
|
+
var y = {
|
|
444
446
|
// This tag allows us to uniquely identify this as a React Element
|
|
445
447
|
$$typeof: t,
|
|
446
448
|
// Built-in properties that belong on the element
|
|
447
|
-
type:
|
|
449
|
+
type: r,
|
|
448
450
|
key: c,
|
|
449
|
-
ref:
|
|
450
|
-
props:
|
|
451
|
+
ref: u,
|
|
452
|
+
props: v,
|
|
451
453
|
// Record the component responsible for creating this element.
|
|
452
|
-
_owner:
|
|
454
|
+
_owner: T
|
|
453
455
|
};
|
|
454
|
-
return
|
|
456
|
+
return y._store = {}, Object.defineProperty(y._store, "validated", {
|
|
455
457
|
configurable: !1,
|
|
456
458
|
enumerable: !1,
|
|
457
459
|
writable: !0,
|
|
458
460
|
value: !1
|
|
459
|
-
}), Object.defineProperty(
|
|
461
|
+
}), Object.defineProperty(y, "_self", {
|
|
460
462
|
configurable: !1,
|
|
461
463
|
enumerable: !1,
|
|
462
464
|
writable: !1,
|
|
463
|
-
value:
|
|
464
|
-
}), Object.defineProperty(
|
|
465
|
+
value: g
|
|
466
|
+
}), Object.defineProperty(y, "_source", {
|
|
465
467
|
configurable: !1,
|
|
466
468
|
enumerable: !1,
|
|
467
469
|
writable: !1,
|
|
468
470
|
value: j
|
|
469
|
-
}), Object.freeze && (Object.freeze(
|
|
471
|
+
}), Object.freeze && (Object.freeze(y.props), Object.freeze(y)), y;
|
|
470
472
|
};
|
|
471
|
-
function
|
|
473
|
+
function tr(r, c, u, g, j) {
|
|
472
474
|
{
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
for (
|
|
476
|
-
te.call(c,
|
|
477
|
-
if (
|
|
478
|
-
var
|
|
479
|
-
for (
|
|
480
|
-
|
|
475
|
+
var T, v = {}, y = null, Y = null;
|
|
476
|
+
u !== void 0 && (Je(u), y = "" + u), Xt(c) && (Je(c.key), y = "" + c.key), qt(c) && (Y = c.ref, Qt(c, j));
|
|
477
|
+
for (T in c)
|
|
478
|
+
te.call(c, T) && !Jt.hasOwnProperty(T) && (v[T] = c[T]);
|
|
479
|
+
if (r && r.defaultProps) {
|
|
480
|
+
var H = r.defaultProps;
|
|
481
|
+
for (T in H)
|
|
482
|
+
v[T] === void 0 && (v[T] = H[T]);
|
|
481
483
|
}
|
|
482
|
-
if (
|
|
483
|
-
var z = typeof
|
|
484
|
-
|
|
484
|
+
if (y || Y) {
|
|
485
|
+
var z = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
486
|
+
y && $t(v, z), Y && Kt(v, z);
|
|
485
487
|
}
|
|
486
|
-
return
|
|
488
|
+
return er(r, y, Y, j, g, re.current, v);
|
|
487
489
|
}
|
|
488
490
|
}
|
|
489
|
-
var
|
|
490
|
-
function q(
|
|
491
|
-
if (
|
|
492
|
-
var c =
|
|
493
|
-
|
|
491
|
+
var Ne = _.ReactCurrentOwner, Qe = _.ReactDebugCurrentFrame;
|
|
492
|
+
function q(r) {
|
|
493
|
+
if (r) {
|
|
494
|
+
var c = r._owner, u = fe(r.type, r._source, c ? c.type : null);
|
|
495
|
+
Qe.setExtraStackFrame(u);
|
|
494
496
|
} else
|
|
495
|
-
|
|
497
|
+
Qe.setExtraStackFrame(null);
|
|
496
498
|
}
|
|
497
499
|
var Te;
|
|
498
500
|
Te = !1;
|
|
499
|
-
function
|
|
500
|
-
return typeof
|
|
501
|
+
function Se(r) {
|
|
502
|
+
return typeof r == "object" && r !== null && r.$$typeof === t;
|
|
501
503
|
}
|
|
502
|
-
function
|
|
504
|
+
function $e() {
|
|
503
505
|
{
|
|
504
|
-
if (
|
|
505
|
-
var
|
|
506
|
-
if (
|
|
506
|
+
if (Ne.current) {
|
|
507
|
+
var r = F(Ne.current.type);
|
|
508
|
+
if (r)
|
|
507
509
|
return `
|
|
508
510
|
|
|
509
|
-
Check the render method of \`` +
|
|
511
|
+
Check the render method of \`` + r + "`.";
|
|
510
512
|
}
|
|
511
513
|
return "";
|
|
512
514
|
}
|
|
513
515
|
}
|
|
514
|
-
function
|
|
516
|
+
function rr(r) {
|
|
515
517
|
return "";
|
|
516
518
|
}
|
|
517
|
-
var
|
|
518
|
-
function
|
|
519
|
+
var Ke = {};
|
|
520
|
+
function or(r) {
|
|
519
521
|
{
|
|
520
|
-
var c =
|
|
522
|
+
var c = $e();
|
|
521
523
|
if (!c) {
|
|
522
|
-
var
|
|
523
|
-
|
|
524
|
+
var u = typeof r == "string" ? r : r.displayName || r.name;
|
|
525
|
+
u && (c = `
|
|
524
526
|
|
|
525
|
-
Check the top-level render call using <` +
|
|
527
|
+
Check the top-level render call using <` + u + ">.");
|
|
526
528
|
}
|
|
527
529
|
return c;
|
|
528
530
|
}
|
|
529
531
|
}
|
|
530
|
-
function
|
|
532
|
+
function et(r, c) {
|
|
531
533
|
{
|
|
532
|
-
if (!
|
|
534
|
+
if (!r._store || r._store.validated || r.key != null)
|
|
533
535
|
return;
|
|
534
|
-
|
|
535
|
-
var
|
|
536
|
-
if (
|
|
536
|
+
r._store.validated = !0;
|
|
537
|
+
var u = or(c);
|
|
538
|
+
if (Ke[u])
|
|
537
539
|
return;
|
|
538
|
-
|
|
539
|
-
var
|
|
540
|
-
|
|
540
|
+
Ke[u] = !0;
|
|
541
|
+
var g = "";
|
|
542
|
+
r && r._owner && r._owner !== Ne.current && (g = " It was passed a child from " + F(r._owner.type) + "."), q(r), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, g), q(null);
|
|
541
543
|
}
|
|
542
544
|
}
|
|
543
|
-
function
|
|
545
|
+
function tt(r, c) {
|
|
544
546
|
{
|
|
545
|
-
if (typeof
|
|
547
|
+
if (typeof r != "object")
|
|
546
548
|
return;
|
|
547
|
-
if (
|
|
548
|
-
for (var
|
|
549
|
-
var
|
|
550
|
-
|
|
549
|
+
if (ke(r))
|
|
550
|
+
for (var u = 0; u < r.length; u++) {
|
|
551
|
+
var g = r[u];
|
|
552
|
+
Se(g) && et(g, c);
|
|
551
553
|
}
|
|
552
|
-
else if (
|
|
553
|
-
|
|
554
|
-
else if (
|
|
555
|
-
var j =
|
|
556
|
-
if (typeof j == "function" && j !==
|
|
557
|
-
for (var
|
|
558
|
-
|
|
554
|
+
else if (Se(r))
|
|
555
|
+
r._store && (r._store.validated = !0);
|
|
556
|
+
else if (r) {
|
|
557
|
+
var j = S(r);
|
|
558
|
+
if (typeof j == "function" && j !== r.entries)
|
|
559
|
+
for (var T = j.call(r), v; !(v = T.next()).done; )
|
|
560
|
+
Se(v.value) && et(v.value, c);
|
|
559
561
|
}
|
|
560
562
|
}
|
|
561
563
|
}
|
|
562
|
-
function
|
|
564
|
+
function ir(r) {
|
|
563
565
|
{
|
|
564
|
-
var c =
|
|
566
|
+
var c = r.type;
|
|
565
567
|
if (c == null || typeof c == "string")
|
|
566
568
|
return;
|
|
567
|
-
var
|
|
569
|
+
var u;
|
|
568
570
|
if (typeof c == "function")
|
|
569
|
-
|
|
570
|
-
else if (typeof c == "object" && (c.$$typeof ===
|
|
571
|
+
u = c.propTypes;
|
|
572
|
+
else if (typeof c == "object" && (c.$$typeof === d || // Note: Memo only checks outer props here.
|
|
571
573
|
// Inner props are checked in the reconciler.
|
|
572
|
-
c.$$typeof ===
|
|
573
|
-
|
|
574
|
+
c.$$typeof === b))
|
|
575
|
+
u = c.propTypes;
|
|
574
576
|
else
|
|
575
577
|
return;
|
|
576
|
-
if (
|
|
577
|
-
var
|
|
578
|
-
|
|
578
|
+
if (u) {
|
|
579
|
+
var g = F(c);
|
|
580
|
+
Ft(u, r.props, "prop", g, r);
|
|
579
581
|
} else if (c.PropTypes !== void 0 && !Te) {
|
|
580
582
|
Te = !0;
|
|
581
|
-
var j =
|
|
583
|
+
var j = F(c);
|
|
582
584
|
E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
|
|
583
585
|
}
|
|
584
586
|
typeof c.getDefaultProps == "function" && !c.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
585
587
|
}
|
|
586
588
|
}
|
|
587
|
-
function
|
|
589
|
+
function sr(r) {
|
|
588
590
|
{
|
|
589
|
-
for (var c = Object.keys(
|
|
590
|
-
var
|
|
591
|
-
if (
|
|
592
|
-
q(
|
|
591
|
+
for (var c = Object.keys(r.props), u = 0; u < c.length; u++) {
|
|
592
|
+
var g = c[u];
|
|
593
|
+
if (g !== "children" && g !== "key") {
|
|
594
|
+
q(r), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", g), q(null);
|
|
593
595
|
break;
|
|
594
596
|
}
|
|
595
597
|
}
|
|
596
|
-
|
|
598
|
+
r.ref !== null && (q(r), E("Invalid attribute `ref` supplied to `React.Fragment`."), q(null));
|
|
597
599
|
}
|
|
598
600
|
}
|
|
599
|
-
var
|
|
600
|
-
function
|
|
601
|
+
var rt = {};
|
|
602
|
+
function ot(r, c, u, g, j, T) {
|
|
601
603
|
{
|
|
602
|
-
var
|
|
603
|
-
if (!
|
|
604
|
-
var
|
|
605
|
-
(
|
|
606
|
-
var
|
|
607
|
-
|
|
608
|
-
var
|
|
609
|
-
|
|
604
|
+
var v = Bt(r);
|
|
605
|
+
if (!v) {
|
|
606
|
+
var y = "";
|
|
607
|
+
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (y += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
608
|
+
var Y = rr();
|
|
609
|
+
Y ? y += Y : y += $e();
|
|
610
|
+
var H;
|
|
611
|
+
r === null ? H = "null" : ke(r) ? H = "array" : r !== void 0 && r.$$typeof === t ? (H = "<" + (F(r.type) || "Unknown") + " />", y = " Did you accidentally export a JSX literal instead of a component?") : H = typeof r, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", H, y);
|
|
610
612
|
}
|
|
611
|
-
var z =
|
|
613
|
+
var z = tr(r, c, u, j, T);
|
|
612
614
|
if (z == null)
|
|
613
615
|
return z;
|
|
614
|
-
if (
|
|
615
|
-
var
|
|
616
|
-
if (
|
|
617
|
-
if (
|
|
618
|
-
if (
|
|
619
|
-
for (var X = 0; X <
|
|
620
|
-
|
|
621
|
-
Object.freeze && Object.freeze(
|
|
616
|
+
if (v) {
|
|
617
|
+
var W = c.children;
|
|
618
|
+
if (W !== void 0)
|
|
619
|
+
if (g)
|
|
620
|
+
if (ke(W)) {
|
|
621
|
+
for (var X = 0; X < W.length; X++)
|
|
622
|
+
tt(W[X], r);
|
|
623
|
+
Object.freeze && Object.freeze(W);
|
|
622
624
|
} else
|
|
623
625
|
E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
624
626
|
else
|
|
625
|
-
|
|
627
|
+
tt(W, r);
|
|
626
628
|
}
|
|
627
629
|
if (te.call(c, "key")) {
|
|
628
|
-
var J =
|
|
629
|
-
return
|
|
630
|
-
}),
|
|
631
|
-
if (!
|
|
632
|
-
var
|
|
630
|
+
var J = F(r), I = Object.keys(c).filter(function(fr) {
|
|
631
|
+
return fr !== "key";
|
|
632
|
+
}), Re = I.length > 0 ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
633
|
+
if (!rt[J + Re]) {
|
|
634
|
+
var dr = I.length > 0 ? "{" + I.join(": ..., ") + ": ...}" : "{}";
|
|
633
635
|
E(`A props object containing a "key" prop is being spread into JSX:
|
|
634
636
|
let props = %s;
|
|
635
637
|
<%s {...props} />
|
|
636
638
|
React keys must be passed directly to JSX without using spread:
|
|
637
639
|
let props = %s;
|
|
638
|
-
<%s key={someKey} {...props} />`,
|
|
640
|
+
<%s key={someKey} {...props} />`, Re, J, dr, J), rt[J + Re] = !0;
|
|
639
641
|
}
|
|
640
642
|
}
|
|
641
|
-
return
|
|
643
|
+
return r === s ? sr(z) : ir(z), z;
|
|
642
644
|
}
|
|
643
645
|
}
|
|
644
|
-
function
|
|
645
|
-
return
|
|
646
|
+
function nr(r, c, u) {
|
|
647
|
+
return ot(r, c, u, !0);
|
|
646
648
|
}
|
|
647
|
-
function
|
|
648
|
-
return
|
|
649
|
+
function ar(r, c, u) {
|
|
650
|
+
return ot(r, c, u, !1);
|
|
649
651
|
}
|
|
650
|
-
var
|
|
651
|
-
|
|
652
|
-
}()),
|
|
652
|
+
var lr = ar, cr = nr;
|
|
653
|
+
ie.Fragment = s, ie.jsx = lr, ie.jsxs = cr;
|
|
654
|
+
}()), ie;
|
|
653
655
|
}
|
|
654
|
-
process.env.NODE_ENV === "production" ?
|
|
655
|
-
var e =
|
|
656
|
-
const
|
|
657
|
-
Camera:
|
|
658
|
-
Check:
|
|
659
|
-
Square:
|
|
660
|
-
Circle:
|
|
661
|
-
Slash:
|
|
662
|
-
MoveDownLeft:
|
|
663
|
-
Pencil:
|
|
664
|
-
Smile:
|
|
665
|
-
Undo:
|
|
666
|
-
Redo:
|
|
667
|
-
ChevronRight:
|
|
668
|
-
ChevronDown:
|
|
669
|
-
ChevronUp:
|
|
670
|
-
RotateCcw:
|
|
671
|
-
ZoomIn:
|
|
672
|
-
ZoomOut:
|
|
673
|
-
Hand:
|
|
674
|
-
Crop:
|
|
675
|
-
FlipHorizontal2:
|
|
676
|
-
FlipVertical2:
|
|
677
|
-
Sunset:
|
|
678
|
-
Box:
|
|
679
|
-
LayoutGrid:
|
|
680
|
-
ImagePlus:
|
|
681
|
-
Type:
|
|
682
|
-
CodeXml:
|
|
683
|
-
ClipboardPaste:
|
|
684
|
-
ImagePlay:
|
|
685
|
-
Maximize:
|
|
686
|
-
ListCollapse:
|
|
687
|
-
ArrowUpRight:
|
|
688
|
-
ArrowDownRight:
|
|
689
|
-
ImageDown:
|
|
690
|
-
Copy:
|
|
691
|
-
Settings2:
|
|
692
|
-
ChevronLeft:
|
|
693
|
-
Pipette:
|
|
694
|
-
Trash2:
|
|
695
|
-
|
|
656
|
+
process.env.NODE_ENV === "production" ? ze.exports = Do() : ze.exports = Ho();
|
|
657
|
+
var e = ze.exports;
|
|
658
|
+
const M = {
|
|
659
|
+
Camera: jr,
|
|
660
|
+
Check: Mr,
|
|
661
|
+
Square: Cr,
|
|
662
|
+
Circle: kr,
|
|
663
|
+
Slash: Ar,
|
|
664
|
+
MoveDownLeft: Nr,
|
|
665
|
+
Pencil: Tr,
|
|
666
|
+
Smile: Sr,
|
|
667
|
+
Undo: Rr,
|
|
668
|
+
Redo: Dr,
|
|
669
|
+
ChevronRight: Hr,
|
|
670
|
+
ChevronDown: zr,
|
|
671
|
+
ChevronUp: _r,
|
|
672
|
+
RotateCcw: Er,
|
|
673
|
+
ZoomIn: Or,
|
|
674
|
+
ZoomOut: Br,
|
|
675
|
+
Hand: Yr,
|
|
676
|
+
Crop: Ir,
|
|
677
|
+
FlipHorizontal2: Pr,
|
|
678
|
+
FlipVertical2: Wr,
|
|
679
|
+
Sunset: Zr,
|
|
680
|
+
Box: Gr,
|
|
681
|
+
LayoutGrid: Fr,
|
|
682
|
+
ImagePlus: Lr,
|
|
683
|
+
Type: Ur,
|
|
684
|
+
CodeXml: Vr,
|
|
685
|
+
ClipboardPaste: Jr,
|
|
686
|
+
ImagePlay: qr,
|
|
687
|
+
Maximize: Xr,
|
|
688
|
+
ListCollapse: Qr,
|
|
689
|
+
ArrowUpRight: $r,
|
|
690
|
+
ArrowDownRight: Kr,
|
|
691
|
+
ImageDown: eo,
|
|
692
|
+
Copy: to,
|
|
693
|
+
Settings2: ro,
|
|
694
|
+
ChevronLeft: oo,
|
|
695
|
+
Pipette: io,
|
|
696
|
+
Trash2: so,
|
|
697
|
+
Sun: no,
|
|
698
|
+
Moon: ao
|
|
699
|
+
}, be = (o) => {
|
|
696
700
|
const t = () => {
|
|
697
701
|
if (!window.EyeDropper) return;
|
|
698
702
|
new EyeDropper().open().then((s) => {
|
|
699
703
|
const a = s.sRGBHex;
|
|
700
|
-
o != null && o.onChange && o.onChange(new
|
|
704
|
+
o != null && o.onChange && o.onChange(new lo(a));
|
|
701
705
|
}).catch((s) => {
|
|
702
706
|
console.log(s);
|
|
703
707
|
});
|
|
704
708
|
};
|
|
705
709
|
return /* @__PURE__ */ e.jsx(
|
|
706
|
-
|
|
710
|
+
ur,
|
|
707
711
|
{
|
|
708
712
|
...o,
|
|
709
713
|
panelRender: (n) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
710
|
-
window.EyeDropper && /* @__PURE__ */ e.jsx("div", { className: "mb-1", children: /* @__PURE__ */ e.jsx(
|
|
714
|
+
window.EyeDropper && /* @__PURE__ */ e.jsx("div", { className: "mb-1", children: /* @__PURE__ */ e.jsx(k, { type: "text", shape: "circle", size: "small", icon: /* @__PURE__ */ e.jsx(M.Pipette, { size: 16 }), onClick: t }) }),
|
|
711
715
|
n
|
|
712
716
|
] })
|
|
713
717
|
}
|
|
714
718
|
);
|
|
715
|
-
},
|
|
719
|
+
}, zo = [
|
|
716
720
|
{
|
|
717
721
|
label: /* @__PURE__ */ e.jsx("div", { className: "w-4 h-3 mt-1.5 items-center cursor-pointer", children: /* @__PURE__ */ e.jsx("i", { className: "block w-full origin-center rounded-lg bg-slate-600 -rotate-45 h-[1px]" }) }),
|
|
718
722
|
key: 1
|
|
@@ -733,18 +737,18 @@ const A = {
|
|
|
733
737
|
label: /* @__PURE__ */ e.jsx("div", { className: "w-4 h-3 mt-1.5 items-center cursor-pointer", children: /* @__PURE__ */ e.jsx("i", { className: "block w-full origin-center rounded-lg bg-slate-600 -rotate-45 h-[8px]" }) }),
|
|
734
738
|
key: 8
|
|
735
739
|
}
|
|
736
|
-
],
|
|
740
|
+
], _o = ({ defaultValue: o, onChange: t }) => {
|
|
737
741
|
const n = ({ key: s }) => {
|
|
738
742
|
t(s);
|
|
739
743
|
};
|
|
740
744
|
return /* @__PURE__ */ e.jsx(
|
|
741
|
-
|
|
745
|
+
At,
|
|
742
746
|
{
|
|
743
|
-
menu: { items:
|
|
747
|
+
menu: { items: zo, onClick: n, selectedKeys: [o] },
|
|
744
748
|
trigger: ["click"],
|
|
745
749
|
placement: "bottom",
|
|
746
750
|
children: /* @__PURE__ */ e.jsx(
|
|
747
|
-
|
|
751
|
+
k,
|
|
748
752
|
{
|
|
749
753
|
type: "text",
|
|
750
754
|
shape: "circle",
|
|
@@ -763,35 +767,35 @@ const A = {
|
|
|
763
767
|
}
|
|
764
768
|
);
|
|
765
769
|
};
|
|
766
|
-
let
|
|
770
|
+
let Eo = (o, t = 21) => (n = t) => {
|
|
767
771
|
let s = "", a = n;
|
|
768
772
|
for (; a--; )
|
|
769
773
|
s += o[Math.random() * o.length | 0];
|
|
770
774
|
return s;
|
|
771
775
|
};
|
|
772
|
-
const
|
|
776
|
+
const Oo = () => {
|
|
773
777
|
const o = typeof navigator == "object" ? navigator.platform : "";
|
|
774
778
|
return /Mac|iPod|iPhone|iPad/.test(o);
|
|
775
|
-
},
|
|
779
|
+
}, gt = Oo() ? "⌘" : "Ctrl", Dt = [
|
|
776
780
|
"image/jpeg",
|
|
777
781
|
"image/png",
|
|
778
782
|
"image/bmp",
|
|
779
783
|
"image/gif",
|
|
780
784
|
"image/webp"
|
|
781
785
|
];
|
|
782
|
-
function
|
|
783
|
-
return
|
|
786
|
+
function Z(...o) {
|
|
787
|
+
return fo(co(o));
|
|
784
788
|
}
|
|
785
|
-
const
|
|
789
|
+
const ge = Eo(
|
|
786
790
|
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
787
791
|
7
|
|
788
|
-
),
|
|
792
|
+
), Bo = (o, t) => {
|
|
789
793
|
let n = document.createElement("a");
|
|
790
794
|
n.href = o, n.download = t, n.style = "position: absolute; z-index: -111; visibility: none;", document.body.appendChild(n), n.click(), document.body.removeChild(n), n = null;
|
|
791
|
-
},
|
|
795
|
+
}, Yo = (o, t, n = 950, s = 450) => {
|
|
792
796
|
let a = o, l = t;
|
|
793
|
-
return a > n && (l *= n / a, a = n), l > s && (a *= s / l, l = s), { width: a, height: l };
|
|
794
|
-
},
|
|
797
|
+
return a > n && (l *= n / a, a = n), l > s && (a *= s / l, l = s), { width: Math.round(a), height: Math.round(l) };
|
|
798
|
+
}, Io = (o) => {
|
|
795
799
|
const t = new Image();
|
|
796
800
|
return o.startsWith("data") || (t.crossOrigin = "Anonymous"), new Promise(function(n, s) {
|
|
797
801
|
t.onload = function() {
|
|
@@ -804,7 +808,10 @@ const he = To(
|
|
|
804
808
|
};
|
|
805
809
|
t.onerror = a, t.onabort = a, t.src = o;
|
|
806
810
|
});
|
|
807
|
-
},
|
|
811
|
+
}, we = (o, t, n = 0.15) => {
|
|
812
|
+
const s = Math.min(o, t);
|
|
813
|
+
return Math.round(s * n);
|
|
814
|
+
}, Po = (o, t, n) => o === "top-left" ? {
|
|
808
815
|
x: 0,
|
|
809
816
|
y: 0
|
|
810
817
|
} : o === "top" ? {
|
|
@@ -828,45 +835,55 @@ const he = To(
|
|
|
828
835
|
} : o === "bottom-right" ? {
|
|
829
836
|
x: t,
|
|
830
837
|
y: n
|
|
831
|
-
} : { x: t / 2, y: n / 2 },
|
|
838
|
+
} : { x: t / 2, y: n / 2 }, Wo = (o, t, n) => {
|
|
832
839
|
const s = n * (Math.PI / 180), a = Math.abs(o * Math.cos(s)) + Math.abs(t * Math.sin(s)), l = Math.abs(o * Math.sin(s)) + Math.abs(t * Math.cos(s));
|
|
833
840
|
return {
|
|
834
841
|
width: Math.round(a),
|
|
835
842
|
height: Math.round(l)
|
|
836
843
|
};
|
|
837
|
-
},
|
|
844
|
+
}, _e = (o) => "data:image/svg+xml," + encodeURIComponent(o).replace(/'/g, "%27").replace(/"/g, "%22"), Zo = ({ text: o, color: t, angleDegrees: n }) => {
|
|
838
845
|
const s = document.createElement("div");
|
|
839
846
|
s.style = `text-align:center;white-space:nowrap;line-height:100px;transform: rotate(${n}deg);position: absolute;top:0;left:0;opacity: 0;`;
|
|
840
847
|
const a = document.createElement("span");
|
|
841
848
|
a.style.color = t, a.style.fontSize = "36px", a.innerText = o, s.append(a), document.body.append(s);
|
|
842
|
-
const { width: l, height:
|
|
849
|
+
const { width: l, height: h } = s.getBoundingClientRect();
|
|
843
850
|
document.body.removeChild(s);
|
|
844
|
-
const f =
|
|
851
|
+
const f = Wo(l, h, n), d = `
|
|
845
852
|
<div xmlns="http://www.w3.org/1999/xhtml" style="text-align:center;white-space:nowrap;line-height:${f.height}px;transform:rotate(${n}deg);">
|
|
846
853
|
<span style="color:${t};font-size:36px;">${o}</span>
|
|
847
854
|
</div>
|
|
848
|
-
`,
|
|
855
|
+
`, p = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${f.width} ${f.height}" width="${f.width}" height="${f.height}">
|
|
849
856
|
<foreignObject width="100%" height="100%">
|
|
850
|
-
${
|
|
857
|
+
${d}
|
|
851
858
|
</foreignObject>
|
|
852
|
-
</svg
|
|
853
|
-
return (
|
|
859
|
+
</svg>`;
|
|
860
|
+
return _e(p);
|
|
861
|
+
}, Go = (o) => {
|
|
862
|
+
const t = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32">
|
|
863
|
+
<foreignObject width="100%" height="100%">
|
|
864
|
+
<div xmlns="http://www.w3.org/1999/xhtml" style="text-align:center;white-space:nowrap;line-height:32px;">
|
|
865
|
+
<span style="color:#ffffff;font-size:18px;">${o}</span>
|
|
866
|
+
</div>
|
|
867
|
+
</foreignObject>
|
|
868
|
+
</svg>`;
|
|
869
|
+
return _e(t);
|
|
854
870
|
};
|
|
855
|
-
let
|
|
871
|
+
let xt, Fo = class {
|
|
856
872
|
constructor() {
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
873
|
+
R(this, "img", {});
|
|
874
|
+
R(this, "invalid", !1);
|
|
875
|
+
R(this, "app", null);
|
|
876
|
+
R(this, "scale", 100);
|
|
877
|
+
R(this, "useTool", null);
|
|
878
|
+
R(this, "annotateColor", "#ff0000");
|
|
879
|
+
R(this, "strokeWidth", 4);
|
|
880
|
+
R(this, "shapes", /* @__PURE__ */ new Map());
|
|
881
|
+
R(this, "message", null);
|
|
882
|
+
R(this, "theme", "light");
|
|
883
|
+
Tt(this);
|
|
867
884
|
}
|
|
868
885
|
get shapesList() {
|
|
869
|
-
return Array.from(
|
|
886
|
+
return Array.from(St(this.shapes).values());
|
|
870
887
|
}
|
|
871
888
|
get cursor() {
|
|
872
889
|
return this.useTool === "Pencil" ? "pencil" : this.useTool ? "crosshair" : "auto";
|
|
@@ -876,8 +893,20 @@ let pt, Eo = class {
|
|
|
876
893
|
const t = !!((n = this.app) != null && n.tree);
|
|
877
894
|
return t || (this.message.info("Please add a image"), this.setInvalid()), t;
|
|
878
895
|
}
|
|
896
|
+
get nextStep() {
|
|
897
|
+
const t = this.shapesList.filter((s) => s.type === "Step"), n = uo(t, (s) => Number(s.text));
|
|
898
|
+
return n != null && n.text ? Number(n.text) + 1 : 1;
|
|
899
|
+
}
|
|
900
|
+
get isDark() {
|
|
901
|
+
return this.theme === "dark";
|
|
902
|
+
}
|
|
903
|
+
setTheme(t) {
|
|
904
|
+
t !== this.theme && ho(() => {
|
|
905
|
+
t ? this.theme = t : this.theme = this.isDark ? "light" : "dark";
|
|
906
|
+
});
|
|
907
|
+
}
|
|
879
908
|
setInvalid() {
|
|
880
|
-
clearTimeout(
|
|
909
|
+
clearTimeout(xt), this.invalid = !0, xt = setTimeout(po(() => {
|
|
881
910
|
this.invalid = !1;
|
|
882
911
|
}), 200);
|
|
883
912
|
}
|
|
@@ -919,10 +948,10 @@ let pt, Eo = class {
|
|
|
919
948
|
}
|
|
920
949
|
destroy() {
|
|
921
950
|
var t;
|
|
922
|
-
(t = this.app) == null || t.destroy(), this.app = null;
|
|
951
|
+
(t = this.app) == null || t.destroy(!0), this.app = null, this.shapes.clear(), this.setUseTool(null);
|
|
923
952
|
}
|
|
924
953
|
};
|
|
925
|
-
const
|
|
954
|
+
const Lo = new Fo(), Q = {
|
|
926
955
|
default_1: {
|
|
927
956
|
class: "bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500",
|
|
928
957
|
fill: {
|
|
@@ -1309,25 +1338,25 @@ const Oo = new Eo(), Q = {
|
|
|
1309
1338
|
}
|
|
1310
1339
|
}
|
|
1311
1340
|
};
|
|
1312
|
-
class
|
|
1341
|
+
class Uo {
|
|
1313
1342
|
constructor() {
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1343
|
+
R(this, "scale", 1);
|
|
1344
|
+
R(this, "scaleX", !1);
|
|
1345
|
+
R(this, "scaleY", !1);
|
|
1346
|
+
R(this, "padding", 0);
|
|
1347
|
+
R(this, "paddingBg", "rgba(255,255,255, 100)");
|
|
1348
|
+
R(this, "round", 10);
|
|
1349
|
+
R(this, "shadow", 3);
|
|
1350
|
+
R(this, "frame", "none");
|
|
1351
|
+
R(this, "background", "default_1");
|
|
1352
|
+
R(this, "align", "center");
|
|
1353
|
+
R(this, "waterImg", null);
|
|
1354
|
+
R(this, "waterIndex", 1);
|
|
1355
|
+
R(this, "size", {
|
|
1327
1356
|
type: "auto",
|
|
1328
1357
|
title: "Auto"
|
|
1329
1358
|
});
|
|
1330
|
-
|
|
1359
|
+
R(this, "frameConf", {
|
|
1331
1360
|
width: 800,
|
|
1332
1361
|
height: 600,
|
|
1333
1362
|
background: {
|
|
@@ -1337,10 +1366,10 @@ class _o {
|
|
|
1337
1366
|
stops: ["#6366f1", "#a855f7", "#ec4899"]
|
|
1338
1367
|
}
|
|
1339
1368
|
});
|
|
1340
|
-
|
|
1369
|
+
Tt(this);
|
|
1341
1370
|
}
|
|
1342
1371
|
get waterSvg() {
|
|
1343
|
-
return
|
|
1372
|
+
return St(this.waterImg);
|
|
1344
1373
|
}
|
|
1345
1374
|
setScale(t) {
|
|
1346
1375
|
this.scale = t;
|
|
@@ -1357,6 +1386,9 @@ class _o {
|
|
|
1357
1386
|
setShadow(t) {
|
|
1358
1387
|
this.shadow = t;
|
|
1359
1388
|
}
|
|
1389
|
+
setFrame(t) {
|
|
1390
|
+
this.frame = t;
|
|
1391
|
+
}
|
|
1360
1392
|
setFrameSize(t, n) {
|
|
1361
1393
|
!t || !n || (this.frameConf.width = t, this.frameConf.height = n);
|
|
1362
1394
|
}
|
|
@@ -1379,37 +1411,37 @@ class _o {
|
|
|
1379
1411
|
this.waterIndex = t;
|
|
1380
1412
|
}
|
|
1381
1413
|
}
|
|
1382
|
-
const
|
|
1383
|
-
editor:
|
|
1384
|
-
option:
|
|
1385
|
-
},
|
|
1386
|
-
const [
|
|
1387
|
-
|
|
1388
|
-
},
|
|
1389
|
-
|
|
1390
|
-
},
|
|
1391
|
-
t(
|
|
1414
|
+
const Vo = new Uo(), i = {
|
|
1415
|
+
editor: Lo,
|
|
1416
|
+
option: Vo
|
|
1417
|
+
}, Jo = ({ disabled: o = !1, toSelect: t, locale: n = "en", theme: s = "auto" }) => {
|
|
1418
|
+
const [a, l] = O(!1), h = () => {
|
|
1419
|
+
l(!1);
|
|
1420
|
+
}, f = (p) => {
|
|
1421
|
+
l(p);
|
|
1422
|
+
}, d = (p) => {
|
|
1423
|
+
t(p.native), h();
|
|
1392
1424
|
};
|
|
1393
1425
|
return /* @__PURE__ */ e.jsx(
|
|
1394
|
-
|
|
1426
|
+
xe,
|
|
1395
1427
|
{
|
|
1396
|
-
content: /* @__PURE__ */ e.jsx(
|
|
1428
|
+
content: /* @__PURE__ */ e.jsx(go, { data: mo, locale: n, onEmojiSelect: d, previewPosition: "none", theme: s }),
|
|
1397
1429
|
title: "",
|
|
1398
1430
|
trigger: "click",
|
|
1399
|
-
open:
|
|
1400
|
-
onOpenChange:
|
|
1431
|
+
open: a,
|
|
1432
|
+
onOpenChange: f,
|
|
1401
1433
|
children: /* @__PURE__ */ e.jsx(
|
|
1402
|
-
|
|
1434
|
+
k,
|
|
1403
1435
|
{
|
|
1404
1436
|
type: "text",
|
|
1405
1437
|
shape: "circle",
|
|
1406
1438
|
disabled: o,
|
|
1407
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
1439
|
+
icon: /* @__PURE__ */ e.jsx(M.Smile, { size: 16 })
|
|
1408
1440
|
}
|
|
1409
1441
|
)
|
|
1410
1442
|
}
|
|
1411
1443
|
);
|
|
1412
|
-
},
|
|
1444
|
+
}, qo = () => /* @__PURE__ */ e.jsx("h1", { children: /* @__PURE__ */ e.jsxs("a", { href: "https://shoteasy.fun", target: "_blank", "aria-label": "ShotEasy", className: "flex gap-1 text-gray-700 dark:text-gray-300 items-center text-xs font-semibold", children: [
|
|
1413
1445
|
/* @__PURE__ */ e.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 510 510", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1414
1446
|
/* @__PURE__ */ e.jsxs("g", { filter: "url(#filter0_i_40_60)", children: [
|
|
1415
1447
|
/* @__PURE__ */ e.jsx("path", { d: "M60.1774 83.172C64.1232 61.4358 84.9426 47.0139 106.679 50.9598L271.777 80.9308C293.513 84.8767 307.935 105.696 303.989 127.432L247.462 438.817C243.516 460.553 222.696 474.975 200.96 471.029L35.8623 441.058C14.1261 437.112 -0.295702 416.293 3.65017 394.557L60.1774 83.172Z", fill: "#812BED" }),
|
|
@@ -1429,59 +1461,64 @@ const Yo = new _o(), r = {
|
|
|
1429
1461
|
] }) })
|
|
1430
1462
|
] }),
|
|
1431
1463
|
/* @__PURE__ */ e.jsx("span", { children: "ShotEasy" })
|
|
1432
|
-
] }) }),
|
|
1433
|
-
|
|
1434
|
-
/* @__PURE__ */ e.jsx("a", { href: "https://
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1464
|
+
] }) }), Xo = ({ children: o }) => /* @__PURE__ */ e.jsxs("div", { className: "flex-1 flex justify-end items-end gap-2 dark:text-gray-300", children: [
|
|
1465
|
+
o,
|
|
1466
|
+
/* @__PURE__ */ e.jsx("a", { href: "https://github.com/CH563/image-beautifier", target: "_blank", "aria-label": "GitHub", className: "block rounded-full p-2 hover:bg-slate-100 dark:hover:bg-slate-700", children: /* @__PURE__ */ e.jsx("svg", { viewBox: "64 64 896 896", focusable: "false", "data-icon": "github", width: "16", height: "16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx("path", { d: "M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z" }) }) }),
|
|
1467
|
+
/* @__PURE__ */ e.jsx("a", { href: "https://twitter.com/LiWen563", target: "_blank", "aria-label": "twitter:@LiWen563", className: "block rounded-full p-2 dark:hover:bg-slate-700", children: /* @__PURE__ */ e.jsx("svg", { fill: "currentColor", viewBox: "0 0 24 24", width: "16", height: "16", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx("g", { children: /* @__PURE__ */ e.jsx("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" }) }) }) })
|
|
1468
|
+
] }), Qo = ["Square", "SquareFill", "Circle", "Slash", "MoveDownLeft", "Pencil", "Step", "Smile"], $o = B(({ headLeft: o, headRight: t }) => {
|
|
1469
|
+
const [n, s] = O(!1), a = (d) => {
|
|
1470
|
+
if (!i.editor.isEditing) return;
|
|
1471
|
+
const { useTool: p } = i.editor;
|
|
1472
|
+
i.editor.setUseTool(p === d ? null : d), s(!1);
|
|
1473
|
+
}, l = (d) => {
|
|
1474
|
+
if (!i.editor.isEditing) return;
|
|
1475
|
+
const p = i.option.frameConf.width / 2 - 24, m = i.option.frameConf.height / 2 - 24;
|
|
1476
|
+
i.editor.setUseTool(null), s(!1), i.editor.addShape({
|
|
1477
|
+
id: ge(),
|
|
1445
1478
|
type: "emoji",
|
|
1446
|
-
text:
|
|
1447
|
-
zIndex:
|
|
1448
|
-
x:
|
|
1449
|
-
y:
|
|
1479
|
+
text: d,
|
|
1480
|
+
zIndex: i.editor.shapes.size + 1,
|
|
1481
|
+
x: p,
|
|
1482
|
+
y: m,
|
|
1450
1483
|
editable: !0
|
|
1451
1484
|
});
|
|
1452
|
-
},
|
|
1453
|
-
if (!
|
|
1454
|
-
const
|
|
1455
|
-
|
|
1485
|
+
}, h = () => {
|
|
1486
|
+
if (!i.editor.isEditing) return;
|
|
1487
|
+
const d = !n;
|
|
1488
|
+
i.editor.setUseTool(null), s(d), i.editor.app.config.move.drag = d;
|
|
1489
|
+
}, f = () => {
|
|
1490
|
+
i.editor.setTheme(), localStorage.setItem("SHOTEASY_BEAUTIFIER_THEME", i.editor.theme);
|
|
1456
1491
|
};
|
|
1457
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center shrink-0 gap-3 bg-white py-2 px-5 border-b border-b-gray-50 shadow-sm relative z-[11] select-none", children: [
|
|
1458
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex-1", children: /* @__PURE__ */ e.jsx(
|
|
1459
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex gap-1 justify-center items-center", children:
|
|
1460
|
-
if (
|
|
1461
|
-
let
|
|
1462
|
-
if (
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1465
|
-
} else
|
|
1466
|
-
|
|
1467
|
-
|
|
1492
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center shrink-0 gap-3 bg-white dark:bg-black py-2 px-5 border-b border-b-gray-50 dark:border-b-gray-700 shadow-sm relative z-[11] select-none", children: [
|
|
1493
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1", children: o || /* @__PURE__ */ e.jsx(qo, {}) }),
|
|
1494
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-1 justify-center items-center", children: Qo.map((d) => {
|
|
1495
|
+
if (d === "Smile") return /* @__PURE__ */ e.jsx(Jo, { disabled: !1, theme: i.editor.isDark ? "dark" : "light", toSelect: l }, d);
|
|
1496
|
+
let p;
|
|
1497
|
+
if (d.includes("Fill")) {
|
|
1498
|
+
const m = d.replace("Fill", ""), b = dt[m];
|
|
1499
|
+
p = /* @__PURE__ */ e.jsx(b, { size: 16, fill: "currentColor" });
|
|
1500
|
+
} else if (d === "Step")
|
|
1501
|
+
p = /* @__PURE__ */ e.jsx("div", { className: "border text-xs border-black dark:border-white w-4 h-4 rounded-full text-center leading-4", children: i.editor.nextStep }, d);
|
|
1502
|
+
else {
|
|
1503
|
+
const m = dt[d];
|
|
1504
|
+
p = /* @__PURE__ */ e.jsx(m, { name: d, size: 16 });
|
|
1468
1505
|
}
|
|
1469
1506
|
return /* @__PURE__ */ e.jsx(
|
|
1470
|
-
|
|
1507
|
+
k,
|
|
1471
1508
|
{
|
|
1472
1509
|
type: "text",
|
|
1473
1510
|
shape: "circle",
|
|
1474
|
-
icon:
|
|
1475
|
-
className:
|
|
1476
|
-
onClick: () =>
|
|
1511
|
+
icon: p,
|
|
1512
|
+
className: i.editor.useTool === d && "text-[#1a79ff] [&_.border]:border-[#1a79ff] bg-sky-100/50 hover:bg-sky-100 hover:text-[#1a79ff] [&_.border]:hover:text-[#1a79ff]",
|
|
1513
|
+
onClick: () => a(d)
|
|
1477
1514
|
},
|
|
1478
|
-
|
|
1515
|
+
d
|
|
1479
1516
|
);
|
|
1480
1517
|
}) }),
|
|
1481
|
-
/* @__PURE__ */ e.jsx(
|
|
1518
|
+
/* @__PURE__ */ e.jsx(mr, { type: "vertical" }),
|
|
1482
1519
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 justify-center items-center", children: [
|
|
1483
1520
|
/* @__PURE__ */ e.jsx(
|
|
1484
|
-
|
|
1521
|
+
be,
|
|
1485
1522
|
{
|
|
1486
1523
|
size: "small",
|
|
1487
1524
|
presets: [
|
|
@@ -1500,140 +1537,148 @@ const Yo = new _o(), r = {
|
|
|
1500
1537
|
]
|
|
1501
1538
|
}
|
|
1502
1539
|
],
|
|
1503
|
-
value:
|
|
1504
|
-
onChange: (
|
|
1540
|
+
value: i.editor.annotateColor,
|
|
1541
|
+
onChange: (d) => i.editor.setAnnotateColor(d.toHexString())
|
|
1505
1542
|
}
|
|
1506
1543
|
),
|
|
1507
|
-
/* @__PURE__ */ e.jsx(
|
|
1544
|
+
/* @__PURE__ */ e.jsx(_o, { defaultValue: i.editor.strokeWidth, onChange: (d) => i.editor.setStrokeWidth(d) }),
|
|
1508
1545
|
/* @__PURE__ */ e.jsx(
|
|
1509
|
-
|
|
1546
|
+
k,
|
|
1510
1547
|
{
|
|
1511
1548
|
type: "text",
|
|
1512
1549
|
shape: "circle",
|
|
1513
|
-
className:
|
|
1514
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
1515
|
-
onClick:
|
|
1550
|
+
className: n && "text-[#1677ff] bg-sky-100/50 hover:bg-sky-100 hover:text-[#1677ff]",
|
|
1551
|
+
icon: /* @__PURE__ */ e.jsx(M.Hand, { size: 16 }),
|
|
1552
|
+
onClick: h
|
|
1516
1553
|
}
|
|
1517
1554
|
)
|
|
1518
1555
|
] }),
|
|
1519
|
-
/* @__PURE__ */ e.jsx(
|
|
1556
|
+
t || /* @__PURE__ */ e.jsx(Xo, { children: /* @__PURE__ */ e.jsx(
|
|
1557
|
+
k,
|
|
1558
|
+
{
|
|
1559
|
+
type: "text",
|
|
1560
|
+
shape: "circle",
|
|
1561
|
+
icon: i.editor.isDark ? /* @__PURE__ */ e.jsx(M.Sun, { size: 16 }) : /* @__PURE__ */ e.jsx(M.Moon, { size: 16 }),
|
|
1562
|
+
onClick: f
|
|
1563
|
+
}
|
|
1564
|
+
) })
|
|
1520
1565
|
] });
|
|
1521
1566
|
});
|
|
1522
|
-
function
|
|
1567
|
+
function Ko(o) {
|
|
1523
1568
|
var t = typeof o;
|
|
1524
1569
|
return o != null && (t == "object" || t == "function");
|
|
1525
1570
|
}
|
|
1526
|
-
var
|
|
1527
|
-
return
|
|
1528
|
-
},
|
|
1529
|
-
function
|
|
1530
|
-
for (var t = o.length; t-- &&
|
|
1571
|
+
var Ht = Ko, ei = typeof ue == "object" && ue && ue.Object === Object && ue, ti = ei, ri = ti, oi = typeof self == "object" && self && self.Object === Object && self, ii = ri || oi || Function("return this")(), zt = ii, si = zt, ni = function() {
|
|
1572
|
+
return si.Date.now();
|
|
1573
|
+
}, ai = ni, li = /\s/;
|
|
1574
|
+
function ci(o) {
|
|
1575
|
+
for (var t = o.length; t-- && li.test(o.charAt(t)); )
|
|
1531
1576
|
;
|
|
1532
1577
|
return t;
|
|
1533
1578
|
}
|
|
1534
|
-
var
|
|
1535
|
-
function
|
|
1536
|
-
return o && o.slice(0,
|
|
1579
|
+
var di = ci, fi = di, hi = /^\s+/;
|
|
1580
|
+
function pi(o) {
|
|
1581
|
+
return o && o.slice(0, fi(o) + 1).replace(hi, "");
|
|
1537
1582
|
}
|
|
1538
|
-
var
|
|
1539
|
-
function
|
|
1540
|
-
var t =
|
|
1583
|
+
var ui = pi, mi = zt, gi = mi.Symbol, _t = gi, bt = _t, Et = Object.prototype, xi = Et.hasOwnProperty, bi = Et.toString, se = bt ? bt.toStringTag : void 0;
|
|
1584
|
+
function wi(o) {
|
|
1585
|
+
var t = xi.call(o, se), n = o[se];
|
|
1541
1586
|
try {
|
|
1542
1587
|
o[se] = void 0;
|
|
1543
1588
|
var s = !0;
|
|
1544
1589
|
} catch {
|
|
1545
1590
|
}
|
|
1546
|
-
var a =
|
|
1591
|
+
var a = bi.call(o);
|
|
1547
1592
|
return s && (t ? o[se] = n : delete o[se]), a;
|
|
1548
1593
|
}
|
|
1549
|
-
var
|
|
1550
|
-
function
|
|
1551
|
-
return
|
|
1594
|
+
var yi = wi, vi = Object.prototype, ji = vi.toString;
|
|
1595
|
+
function Mi(o) {
|
|
1596
|
+
return ji.call(o);
|
|
1552
1597
|
}
|
|
1553
|
-
var
|
|
1554
|
-
function
|
|
1555
|
-
return o == null ? o === void 0 ?
|
|
1598
|
+
var Ci = Mi, wt = _t, ki = yi, Ai = Ci, Ni = "[object Null]", Ti = "[object Undefined]", yt = wt ? wt.toStringTag : void 0;
|
|
1599
|
+
function Si(o) {
|
|
1600
|
+
return o == null ? o === void 0 ? Ti : Ni : yt && yt in Object(o) ? ki(o) : Ai(o);
|
|
1556
1601
|
}
|
|
1557
|
-
var
|
|
1558
|
-
function
|
|
1602
|
+
var Ri = Si;
|
|
1603
|
+
function Di(o) {
|
|
1559
1604
|
return o != null && typeof o == "object";
|
|
1560
1605
|
}
|
|
1561
|
-
var
|
|
1562
|
-
function
|
|
1563
|
-
return typeof o == "symbol" ||
|
|
1606
|
+
var Hi = Di, zi = Ri, _i = Hi, Ei = "[object Symbol]";
|
|
1607
|
+
function Oi(o) {
|
|
1608
|
+
return typeof o == "symbol" || _i(o) && zi(o) == Ei;
|
|
1564
1609
|
}
|
|
1565
|
-
var
|
|
1566
|
-
function
|
|
1610
|
+
var Bi = Oi, Yi = ui, vt = Ht, Ii = Bi, jt = NaN, Pi = /^[-+]0x[0-9a-f]+$/i, Wi = /^0b[01]+$/i, Zi = /^0o[0-7]+$/i, Gi = parseInt;
|
|
1611
|
+
function Fi(o) {
|
|
1567
1612
|
if (typeof o == "number")
|
|
1568
1613
|
return o;
|
|
1569
|
-
if (
|
|
1570
|
-
return
|
|
1571
|
-
if (
|
|
1614
|
+
if (Ii(o))
|
|
1615
|
+
return jt;
|
|
1616
|
+
if (vt(o)) {
|
|
1572
1617
|
var t = typeof o.valueOf == "function" ? o.valueOf() : o;
|
|
1573
|
-
o =
|
|
1618
|
+
o = vt(t) ? t + "" : t;
|
|
1574
1619
|
}
|
|
1575
1620
|
if (typeof o != "string")
|
|
1576
1621
|
return o === 0 ? o : +o;
|
|
1577
|
-
o =
|
|
1578
|
-
var n =
|
|
1579
|
-
return n ||
|
|
1622
|
+
o = Yi(o);
|
|
1623
|
+
var n = Wi.test(o);
|
|
1624
|
+
return n || Zi.test(o) ? Gi(o.slice(2), n ? 2 : 8) : Pi.test(o) ? jt : +o;
|
|
1580
1625
|
}
|
|
1581
|
-
var
|
|
1582
|
-
function
|
|
1583
|
-
var s, a, l,
|
|
1626
|
+
var Li = Fi, Ui = Ht, He = ai, Mt = Li, Vi = "Expected a function", Ji = Math.max, qi = Math.min;
|
|
1627
|
+
function Xi(o, t, n) {
|
|
1628
|
+
var s, a, l, h, f, d, p = 0, m = !1, b = !1, C = !0;
|
|
1584
1629
|
if (typeof o != "function")
|
|
1585
|
-
throw new TypeError(
|
|
1586
|
-
t =
|
|
1587
|
-
function
|
|
1588
|
-
var
|
|
1589
|
-
return s = a = void 0,
|
|
1630
|
+
throw new TypeError(Vi);
|
|
1631
|
+
t = Mt(t) || 0, Ui(n) && (m = !!n.leading, b = "maxWait" in n, l = b ? Ji(Mt(n.maxWait) || 0, t) : l, C = "trailing" in n ? !!n.trailing : C);
|
|
1632
|
+
function A(D) {
|
|
1633
|
+
var G = s, U = a;
|
|
1634
|
+
return s = a = void 0, p = D, h = o.apply(U, G), h;
|
|
1590
1635
|
}
|
|
1591
|
-
function x(
|
|
1592
|
-
return
|
|
1636
|
+
function x(D) {
|
|
1637
|
+
return p = D, f = setTimeout(_, t), m ? A(D) : h;
|
|
1593
1638
|
}
|
|
1594
|
-
function
|
|
1595
|
-
var
|
|
1596
|
-
return
|
|
1639
|
+
function w(D) {
|
|
1640
|
+
var G = D - d, U = D - p, K = t - G;
|
|
1641
|
+
return b ? qi(K, l - U) : K;
|
|
1597
1642
|
}
|
|
1598
|
-
function
|
|
1599
|
-
var
|
|
1600
|
-
return
|
|
1643
|
+
function S(D) {
|
|
1644
|
+
var G = D - d, U = D - p;
|
|
1645
|
+
return d === void 0 || G >= t || G < 0 || b && U >= l;
|
|
1601
1646
|
}
|
|
1602
1647
|
function _() {
|
|
1603
|
-
var
|
|
1604
|
-
if (
|
|
1605
|
-
return E(
|
|
1606
|
-
f = setTimeout(_,
|
|
1648
|
+
var D = He();
|
|
1649
|
+
if (S(D))
|
|
1650
|
+
return E(D);
|
|
1651
|
+
f = setTimeout(_, w(D));
|
|
1607
1652
|
}
|
|
1608
|
-
function E(
|
|
1609
|
-
return f = void 0,
|
|
1653
|
+
function E(D) {
|
|
1654
|
+
return f = void 0, C && s ? A(D) : (s = a = void 0, h);
|
|
1610
1655
|
}
|
|
1611
|
-
function
|
|
1612
|
-
f !== void 0 && clearTimeout(f),
|
|
1656
|
+
function ye() {
|
|
1657
|
+
f !== void 0 && clearTimeout(f), p = 0, s = d = a = f = void 0;
|
|
1613
1658
|
}
|
|
1614
|
-
function
|
|
1615
|
-
return f === void 0 ?
|
|
1659
|
+
function ve() {
|
|
1660
|
+
return f === void 0 ? h : E(He());
|
|
1616
1661
|
}
|
|
1617
1662
|
function $() {
|
|
1618
|
-
var
|
|
1619
|
-
if (s = arguments, a = this,
|
|
1663
|
+
var D = He(), G = S(D);
|
|
1664
|
+
if (s = arguments, a = this, d = D, G) {
|
|
1620
1665
|
if (f === void 0)
|
|
1621
|
-
return x(
|
|
1622
|
-
if (
|
|
1623
|
-
return clearTimeout(f), f = setTimeout(_, t),
|
|
1666
|
+
return x(d);
|
|
1667
|
+
if (b)
|
|
1668
|
+
return clearTimeout(f), f = setTimeout(_, t), A(d);
|
|
1624
1669
|
}
|
|
1625
|
-
return f === void 0 && (f = setTimeout(_, t)),
|
|
1670
|
+
return f === void 0 && (f = setTimeout(_, t)), h;
|
|
1626
1671
|
}
|
|
1627
|
-
return $.cancel =
|
|
1672
|
+
return $.cancel = ye, $.flush = ve, $;
|
|
1628
1673
|
}
|
|
1629
|
-
var
|
|
1630
|
-
const
|
|
1631
|
-
(s) =>
|
|
1674
|
+
var Qi = Xi;
|
|
1675
|
+
const $i = /* @__PURE__ */ Ro(Qi), Ki = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDUgNzkuMTYzNDk5LCAyMDE4LzA4LzEzLTE2OjQwOjIyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDI0LTA0LTE1VDEyOjUwOjI3KzA4OjAwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAyNC0wNC0xNVQxMjo1MzowOSswODowMCIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAyNC0wNC0xNVQxMjo1MzowOSswODowMCIgZGM6Zm9ybWF0PSJpbWFnZS9wbmciIHBob3Rvc2hvcDpDb2xvck1vZGU9IjMiIHBob3Rvc2hvcDpJQ0NQcm9maWxlPSJzUkdCIElFQzYxOTY2LTIuMSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxNTY3NDQxZC1lYmQxLWIwNGUtOWUwOS0yMWQ1Mjk3NzAxNzMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTU2NzQ0MWQtZWJkMS1iMDRlLTllMDktMjFkNTI5NzcwMTczIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6MTU2NzQ0MWQtZWJkMS1iMDRlLTllMDktMjFkNTI5NzcwMTczIj4gPHhtcE1NOkhpc3Rvcnk+IDxyZGY6U2VxPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY3JlYXRlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDoxNTY3NDQxZC1lYmQxLWIwNGUtOWUwOS0yMWQ1Mjk3NzAxNzMiIHN0RXZ0OndoZW49IjIwMjQtMDQtMTVUMTI6NTA6MjcrMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE5IChXaW5kb3dzKSIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7YEaJEAAAFqUlEQVRoge2Z709TVxjHT2kpFMpCLdSWdiWYFVK0IAV0yBqNYQ2CI062ie4PcJq9QZAfmRq0UwQmIRjjFBeXOJfAYHEYZ81ixQUmJhbkBb9aSotcpHDbYltbU0t69+LqXQPa9Nyit0v6zXlx2p7v8zyfe0977jmlYRgG/s+KorqAUBUBoFoRAKoVAaBaEQCqFQGgWhEAqsUIfqjZbG5parI7HLV1dRKJZPUAt9uNoqhucvKfgQGTyYRaLAtmMwBAIpGkpqbKsrJy5PLU1NS4uLg1Kx8AgAWtcy0tdADoANTX1vp8Pv+PrFZrT3f3gf37JRs24GPe2AQ83tcHDvx6/brFYgk+b2BBABytqsLr+PbwYY/Hg7/pdDp/6+r6rLQ0hsEIUPqKVlpc/HtPj9frDR0AYgpFRb36wtBoNBqNBgAYGhpSNTTcvn17eXmZGCaRSKRS6YdisSAlZR2HgyCI0WhEEGTk8WOHw4GPUavVmnv3KioqVKdPC4XC9zSF6mpq8OtXVVmJYVhXZ+dHaWnERWUxmV+Vl/9y7dro6OjS0tLy8jJhdLlc8/Pz9/v6TjY05GRn+9+Kop07dTpdKHeADMA3Bw+ebWzkJibiLxk02u6Skr6+PqfTGTiCz+czm82qU6dEKSkEw+asrIeDg+8VQMDjxcfG4v342NiWpqYXL15AZR0YGMiTy/0ZDAYDZOWvRAaAaHExMa3nzpFLPDo6qigsJEJ9vmePy+UiEYc8ADcx8ceLF0mkJDQ9Pb01Px+PxqTTz7e3kwhCHqCstPTp06cGg2HqtfR6/bNnz6DSa7VakUCAB9wklZpMJsj6YQBqqqv9AVLWr5dt3JiZkUE0aXr67pKSmZkZqArOnjlDxGxpboasHwbgu/r6YBapjsuXoSqw2Wxb8vJwr3zzZgRBoOwQD3OFCkVSUlJCQsIHb1duXt6OHTugFiIOh1N55Ai+Mk7p9dPT01B2iJVYqVT+pdHMPnlCrMT+wjCMwWBIMzNFIhFUBQCAjwsKxGLxzMyMy+XS6XQKhQLCDHW/3pGcTmfFvn34LDp86BCUNyz2A2w2WyaT4X2DXg/lDQsAAACfz8c7iygKZQwXgOTkZBaLBQBAFxehjOECwGazmUwmAOD58+dQxnABWFxcdLvdAIB1XC6UMVwAUBT1er0AAF5yMpQxLABevnw5OTGB95PeHQCGYT9duVJYUHD50iVsTf9ZW1hY0Ny9i/ezs7PhzMEvGWNjY2KhkA4Aj8vVarVQy01g/XHjBvEo1dPdDeWFuANxLFYihwMAsFqt59vb8SkbuhwOx4ULF/C+QCBIz8iA80Ph/vD6aIjFZN5Rq6G8b9PZxkb/PYbD4YCywwGYTCZZZiaeLE8un52dhbKv1uPhYWJDw2axujo7YSNAP8y1t7VFR0XhKUt27VpaWoKNQMhsNn+ybRtx+b/cu9ftdsMGgQaw2+3KoiIia7FSqdfrYYNgGIYgyJ6ysv/2dzzePY2GRBwyj9PDQ0NpYjGRe2t+/t/370NF6O/v35Kb63+60dbauuK8NUiR3A/c7O0V8fn+p7Ynjh+fn5/3P5BbLa/Xq9PpGk6cEItEhJdJpx8/doxcGRhpAAzDBh88WHFOmC2T1dfW3lGrjUaj1Wr1eDw+n8/tdttsNsPU1M3e3qrKSuIrizeRQNDS3BwYO7BoWAhr6uTExNHq6j9v3fJ/k8FgbJLJ+AKBSChMSEhAUdRms80hyMjIyAq7QqFoUKm2b99OugAAQt5S2u32n69e9f8xCaZlSCTfq1SwBxBv1Nrsiefm5q50dHxRXr4+KSlw6bk5OadOnhwfH1+TvFiIU2iFXC6X0Wh8ODioffTIYrFYLBar1RodHR0fH89ms3Pk8k+VyvT0dD6fv/pQg7TWEoAShcV+IBRFAKhWBIBqRQCoVgSAakUAqFYEgGr9C1O6hDD/uqSdAAAAAElFTkSuQmCC", es = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAPqSURBVFiFxdZ/TFVlGMDx7/seLnjFewE3B1xwM62tlGJYSCIBBbv2g8JMakaptZpzi2T2Y/lPqzblnzYG/cVG2tJ+mavl1qZm05rSykEO0QDBgIvA5e4yvRe4F7ic0x90b5d7D4JwWM9f55w9z57P+7xn7zmkHRj4Ie3AQBH/U8SgUrPCohx/97z3aFqiqQ20YdCGhSpvTSqqB5ThSx3t7oOl9zsXAyAAPrkwUptqlRV6CT6fv6dye1HqePL63d6G+sNGAySAzapc023u9/dWbtuY7u5sMo00Hfs09a0L+YsC0ITm0W1elmdz97RKACVppVCWrzmRfnAgx3iApnl1m3ddkcFn5nvtAAlonDISMbU6ZAjg8/t7K5/bOK05QGx6VvDSUMTUBFTVG2q+bVNo7NMSLSnht4YhpgAxije08u6rUc1zcvN446kMMm0mwxESoKWt1bX3hUeT9Vaek5vHiVPn2FOYwqGyJErXmSMRJ1dW9WcvCPDB1szBMVvOTmlO0CITHil4DCmnXFLA+8WWSESipoqf5juJ0IpHztd9Zc4q2yGXWKchfjl7BlVV/yvQR8x7O5TwmwlHU/PSh3e1T7o6tmqBMQHQ1+vgRq+DzU8+gxACACGgYE0cQ6MqV52BYPkSoMxa/PZZz88f35gXAGCip7ElEtHSfIn+oWHsdjv/GhBA3l0LR0QBQogNL3dOujqeDSIuN/6G954yCteuMBShCwD97bjS2o5n9RYKVscZhpgRANHbEXBfp2vZQ7hi0g1D3BYQQoRtx7ijEUd6KU5frCGIWQEwfTsmPf1iou8yDlsJzhHIj0BsWhXHX4MBem5OzgkxJ0DkJCYG20XA/TfdywtxjsrpCAGxMYLT7WPh5TMioo7e28VIQ/3RZdnlO6Q5QRtt/p7BuhK+a+jkozNe1LDjq9Md0CtPQOPkkeoj68MfijsBBCM+b/d2X+PXX6i+W0KaE7DkV/BEeQVbMq1cdweovzjKeCDqVKdeOX5us7iWhWSzeKfm93kDAOJzX3vJ13Tsc9XvEQBKYhrxD76I+b7HMaWui8r/TPn21yLREfylu4mqFYv9tY3zBughgqEkphFrewDFmoqIXcqXhSl/lMS7NkSU96GOZ8z5JdQLvcMKQPN7Cbg6GO/9kzp7RtfzKYHokYAFIX0LAoD+tyMYh19/tWvX3ZZVMxYLEb9gwEyIWZtPhWYIIBJx6JXy7jk0B0Hbgl5CvXhvZ4W9aq38BkicPVt8aDgAQKvam43k9CyIfkwy445OwrmG2F9zEVUrBvpmbK5qT4t91UOLMoFgaFV7kpCmN0GUAMmAE8SPmESt2Fc9BPAP1KEkwmzcLhwAAAAASUVORK5CYII=", ts = (o, t) => t instanceof Array ? t.map((n) => it.toArray(n).map(
|
|
1676
|
+
(s) => st(s, { ...o })
|
|
1632
1677
|
)) : it.toArray(t).map(
|
|
1633
|
-
(s) =>
|
|
1634
|
-
),
|
|
1635
|
-
const
|
|
1636
|
-
const f = new
|
|
1678
|
+
(s) => st(s, { ...o })
|
|
1679
|
+
), rs = ({ width: o, height: t, background: n, parent: s, children: a, cursor: l }) => {
|
|
1680
|
+
const h = le(() => {
|
|
1681
|
+
const f = new xo({
|
|
1637
1682
|
width: o,
|
|
1638
1683
|
height: t,
|
|
1639
1684
|
overflow: "hide",
|
|
@@ -1642,145 +1687,213 @@ const Zr = /* @__PURE__ */ vo(Wr), Gr = "data:image/png;base64,iVBORw0KGgoAAAANS
|
|
|
1642
1687
|
});
|
|
1643
1688
|
return f.name = "frame", f;
|
|
1644
1689
|
}, []);
|
|
1645
|
-
return
|
|
1646
|
-
|
|
1647
|
-
}, [o, t, n]),
|
|
1648
|
-
|
|
1649
|
-
}, [l]),
|
|
1650
|
-
|
|
1651
|
-
}), [s]), /* @__PURE__ */ e.jsx(e.Fragment, { children:
|
|
1652
|
-
},
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1690
|
+
return N(() => {
|
|
1691
|
+
h.width = o, h.height = t, h.fill = n;
|
|
1692
|
+
}, [o, t, n]), N(() => {
|
|
1693
|
+
h.cursor = l || "auto";
|
|
1694
|
+
}, [l]), N(() => (s.add(h), () => {
|
|
1695
|
+
h.remove();
|
|
1696
|
+
}), [s]), /* @__PURE__ */ e.jsx(e.Fragment, { children: ts({ parent: h }, a) });
|
|
1697
|
+
}, os = `
|
|
1698
|
+
<svg width="43" height="32" viewBox="0 0 52 38" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 24.75C9.17564 24.75 11.75 22.1756 11.75 19C11.75 15.8244 9.17564 13.25 6 13.25C2.82436 13.25 0.25 15.8244 0.25 19C0.25 22.1756 2.82436 24.75 6 24.75Z" fill="#FF5F57" stroke="black" stroke-opacity="0.2" stroke-width="0.5"></path><path d="M26 24.75C29.1756 24.75 31.75 22.1756 31.75 19C31.75 15.8244 29.1756 13.25 26 13.25C22.8244 13.25 20.25 15.8244 20.25 19C20.25 22.1756 22.8244 24.75 26 24.75Z" fill="#FEBC2E" stroke="black" stroke-opacity="0.2" stroke-width="0.5"></path><path d="M46 24.75C49.1756 24.75 51.75 22.1756 51.75 19C51.75 15.8244 49.1756 13.25 46 13.25C42.8244 13.25 40.25 15.8244 40.25 19C40.25 22.1756 42.8244 24.75 46 24.75Z" fill="#28C840" stroke="black" stroke-opacity="0.2" stroke-width="0.5"></path></svg>
|
|
1699
|
+
`, is = _e(os), ss = B(({ parent: o }) => {
|
|
1700
|
+
const t = ne(null), [n, s, a] = le(() => {
|
|
1701
|
+
const l = new ae({
|
|
1702
|
+
origin: "center",
|
|
1703
|
+
fill: {
|
|
1704
|
+
type: "image",
|
|
1705
|
+
url: i.editor.img.src
|
|
1706
|
+
}
|
|
1707
|
+
}), h = new ft({
|
|
1708
|
+
overflow: "hide",
|
|
1709
|
+
children: [l]
|
|
1710
|
+
}), f = new ft({
|
|
1658
1711
|
overflow: "hide",
|
|
1712
|
+
strokeAlign: "outside",
|
|
1659
1713
|
scale: 1,
|
|
1660
|
-
|
|
1714
|
+
fill: "#ffffff00",
|
|
1715
|
+
children: [h]
|
|
1661
1716
|
});
|
|
1662
|
-
return [
|
|
1717
|
+
return [l, h, f];
|
|
1663
1718
|
}, [o]);
|
|
1664
|
-
return
|
|
1665
|
-
|
|
1666
|
-
}, [
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1719
|
+
return N(() => {
|
|
1720
|
+
i.option.padding === 0 ? s.fill = "#ffffff00" : s.fill = i.option.paddingBg;
|
|
1721
|
+
}, [i.option.paddingBg, i.option.padding]), N(() => {
|
|
1722
|
+
const { round: l } = i.option;
|
|
1723
|
+
a.cornerRadius = l, t.current ? (t.current.cornerRadius = [l, l, 0, 0], s.cornerRadius = [0, 0, l, l], n.cornerRadius = [0, 0, l, l]) : (s.cornerRadius = l, n.cornerRadius = l);
|
|
1724
|
+
}, [i.option.round]), N(() => {
|
|
1725
|
+
const { shadow: l } = i.option;
|
|
1726
|
+
l === 0 ? a.shadow = null : a.shadow = {
|
|
1727
|
+
x: l * 4,
|
|
1728
|
+
y: l * 4,
|
|
1729
|
+
blur: l * 3,
|
|
1674
1730
|
color: "#00000045",
|
|
1675
1731
|
box: !0
|
|
1676
1732
|
};
|
|
1677
|
-
}, [
|
|
1678
|
-
|
|
1679
|
-
}, [
|
|
1680
|
-
|
|
1681
|
-
}, [
|
|
1682
|
-
|
|
1683
|
-
}, [
|
|
1684
|
-
|
|
1685
|
-
}, [
|
|
1686
|
-
const
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1733
|
+
}, [i.option.shadow]), N(() => {
|
|
1734
|
+
a.scale = i.option.scale;
|
|
1735
|
+
}, [i.option.scale]), N(() => {
|
|
1736
|
+
n.url = i.editor.img.src;
|
|
1737
|
+
}, [i.editor.img.src]), N(() => {
|
|
1738
|
+
n.scaleX = i.option.scaleX ? -1 : 1;
|
|
1739
|
+
}, [i.option.scaleX]), N(() => {
|
|
1740
|
+
n.scaleY = i.option.scaleY ? -1 : 1;
|
|
1741
|
+
}, [i.option.scaleY]), N(() => {
|
|
1742
|
+
const { align: l, round: h, frame: f, frameConf: d } = i.option, p = we(d.width, d.height), { width: m, height: b } = Yo(i.editor.img.width, i.editor.img.height, d.width - p, d.height - p);
|
|
1743
|
+
let C = b;
|
|
1744
|
+
switch (f) {
|
|
1745
|
+
case "light":
|
|
1746
|
+
a.strokeWidth = 8, a.stroke = "#ffffff80";
|
|
1747
|
+
break;
|
|
1748
|
+
case "dark":
|
|
1749
|
+
a.strokeWidth = 8, a.stroke = "#00000050";
|
|
1750
|
+
break;
|
|
1751
|
+
case "macosBarLight":
|
|
1752
|
+
case "macosBarDark":
|
|
1753
|
+
C += 32, t.current = new ae({
|
|
1754
|
+
x: 0,
|
|
1755
|
+
y: 0,
|
|
1756
|
+
height: 32,
|
|
1757
|
+
width: m,
|
|
1758
|
+
cornerRadius: [h, h, 0, 0],
|
|
1759
|
+
draggable: !0,
|
|
1760
|
+
fill: [
|
|
1761
|
+
{ type: "solid", color: f.includes("Dark") ? "#3a3a3b" : "#ffffff" },
|
|
1762
|
+
{ type: "image", url: is, format: "svg", mode: "clip", offset: { x: 10, y: 0 } }
|
|
1763
|
+
]
|
|
1764
|
+
}), a.addAfter(t.current, s), s.cornerRadius = [0, 0, h, h], n.cornerRadius = [0, 0, h, h];
|
|
1765
|
+
break;
|
|
1766
|
+
default:
|
|
1767
|
+
a.strokeWidth = null, a.stroke = null;
|
|
1768
|
+
}
|
|
1769
|
+
const { x: A, y: x } = Po(l, d.width - m, d.height - C);
|
|
1770
|
+
a.width = m, a.height = C, a.origin = l, a.x = A, a.y = x, s.width = m, s.height = b, s.x = 0, s.y = C - b;
|
|
1771
|
+
const w = m - i.option.padding, S = Math.round(w * b / m);
|
|
1772
|
+
return n.width = w + 2, n.height = S + 2, n.x = i.option.padding / 2 - 1, n.y = (b - S) / 2 - 1, () => {
|
|
1773
|
+
var _;
|
|
1774
|
+
a.strokeWidth = null, a.stroke = null, (_ = t.current) == null || _.remove(), t.current = null, s.cornerRadius = i.option.round, n.cornerRadius = i.option.round;
|
|
1775
|
+
};
|
|
1776
|
+
}, [i.option.frameConf.width, i.option.frameConf.height, i.option.padding, i.option.align, i.option.frame]), N(() => (o.add(a), () => {
|
|
1777
|
+
a.remove();
|
|
1692
1778
|
}), [o]), null;
|
|
1693
|
-
}),
|
|
1694
|
-
const t =
|
|
1779
|
+
}), ns = B(({ parent: o }) => {
|
|
1780
|
+
const t = le(() => new ae({
|
|
1695
1781
|
x: 0,
|
|
1696
1782
|
y: 0
|
|
1697
1783
|
}), [o]);
|
|
1698
|
-
return
|
|
1699
|
-
t.width =
|
|
1700
|
-
}, [
|
|
1701
|
-
t.zIndex =
|
|
1702
|
-
}, [
|
|
1784
|
+
return N(() => {
|
|
1785
|
+
t.width = i.option.frameConf.width, t.height = i.option.frameConf.height;
|
|
1786
|
+
}, [i.option.frameConf.width, i.option.frameConf.height]), N(() => {
|
|
1787
|
+
t.zIndex = i.option.waterIndex;
|
|
1788
|
+
}, [i.option.waterIndex]), N(() => {
|
|
1703
1789
|
t.fill = {
|
|
1704
1790
|
type: "image",
|
|
1705
|
-
url:
|
|
1791
|
+
url: i.option.waterSvg,
|
|
1706
1792
|
mode: "repeat",
|
|
1707
1793
|
format: "svg",
|
|
1708
|
-
size: Math.round(
|
|
1794
|
+
size: Math.round(i.option.frameConf.width / 6)
|
|
1709
1795
|
};
|
|
1710
|
-
}, [
|
|
1796
|
+
}, [i.option.waterSvg, i.option.frameConf.width]), N(() => (o.add(t), () => {
|
|
1711
1797
|
t.remove();
|
|
1712
1798
|
}), []), null;
|
|
1713
|
-
}),
|
|
1714
|
-
const
|
|
1715
|
-
const x = { id: n, x: l, y:
|
|
1716
|
-
return t === "SquareFill" ? new
|
|
1799
|
+
}), as = ({ parent: o, type: t, id: n, width: s, height: a, x: l, y: h, fill: f, strokeWidth: d, zIndex: p, points: m, editable: b, text: C }) => {
|
|
1800
|
+
const A = le(() => {
|
|
1801
|
+
const x = { id: n, x: l, y: h, zIndex: p };
|
|
1802
|
+
return t === "SquareFill" ? new ae({
|
|
1717
1803
|
cornerRadius: 8,
|
|
1718
1804
|
width: s,
|
|
1719
1805
|
height: a,
|
|
1720
1806
|
fill: f,
|
|
1721
1807
|
...x
|
|
1722
|
-
}) : t === "Circle" ? new
|
|
1808
|
+
}) : t === "Circle" ? new ht({
|
|
1723
1809
|
stroke: f,
|
|
1724
|
-
strokeWidth:
|
|
1810
|
+
strokeWidth: d,
|
|
1725
1811
|
width: s,
|
|
1726
1812
|
height: a,
|
|
1727
1813
|
...x
|
|
1728
|
-
}) : t === "Slash" ? new
|
|
1814
|
+
}) : t === "Slash" ? new pt({
|
|
1729
1815
|
id: n,
|
|
1730
|
-
points:
|
|
1731
|
-
zIndex:
|
|
1816
|
+
points: m,
|
|
1817
|
+
zIndex: p,
|
|
1732
1818
|
stroke: f,
|
|
1733
|
-
strokeWidth:
|
|
1734
|
-
}) : t === "MoveDownLeft" ? new
|
|
1819
|
+
strokeWidth: d
|
|
1820
|
+
}) : t === "MoveDownLeft" ? new Ao({
|
|
1735
1821
|
id: n,
|
|
1736
|
-
points:
|
|
1737
|
-
zIndex:
|
|
1822
|
+
points: m,
|
|
1823
|
+
zIndex: p,
|
|
1738
1824
|
strokeCap: "round",
|
|
1739
1825
|
strokeJoin: "round",
|
|
1740
1826
|
stroke: f,
|
|
1741
|
-
strokeWidth:
|
|
1742
|
-
}) : t === "Pencil" ? new
|
|
1827
|
+
strokeWidth: d
|
|
1828
|
+
}) : t === "Pencil" ? new pt({
|
|
1743
1829
|
id: n,
|
|
1744
|
-
points:
|
|
1745
|
-
zIndex:
|
|
1830
|
+
points: m,
|
|
1831
|
+
zIndex: p,
|
|
1746
1832
|
curve: !0,
|
|
1747
1833
|
stroke: f,
|
|
1748
|
-
strokeWidth:
|
|
1749
|
-
}) : t === "
|
|
1834
|
+
strokeWidth: d
|
|
1835
|
+
}) : t === "Step" ? new ht({
|
|
1836
|
+
...x,
|
|
1837
|
+
width: 32,
|
|
1838
|
+
height: 32,
|
|
1839
|
+
stroke: "#ffffff90",
|
|
1840
|
+
strokeWidth: 2,
|
|
1841
|
+
strokeAlign: "outside",
|
|
1842
|
+
lockRatio: !0,
|
|
1843
|
+
shadow: {
|
|
1844
|
+
x: 1,
|
|
1845
|
+
y: 1,
|
|
1846
|
+
blur: 2,
|
|
1847
|
+
color: "#00000045",
|
|
1848
|
+
box: !0
|
|
1849
|
+
},
|
|
1850
|
+
fill: [
|
|
1851
|
+
{
|
|
1852
|
+
type: "solid",
|
|
1853
|
+
color: f
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
type: "image",
|
|
1857
|
+
url: Go(C),
|
|
1858
|
+
format: "svg",
|
|
1859
|
+
align: "center"
|
|
1860
|
+
}
|
|
1861
|
+
]
|
|
1862
|
+
}) : t === "emoji" ? new bo({
|
|
1750
1863
|
id: n,
|
|
1751
|
-
zIndex:
|
|
1752
|
-
text:
|
|
1864
|
+
zIndex: p,
|
|
1865
|
+
text: C,
|
|
1753
1866
|
resizeFontSize: !0,
|
|
1754
1867
|
fontSize: 48
|
|
1755
|
-
}) : new
|
|
1868
|
+
}) : new ae({
|
|
1756
1869
|
cornerRadius: 8,
|
|
1757
1870
|
stroke: f,
|
|
1758
|
-
strokeWidth:
|
|
1871
|
+
strokeWidth: d,
|
|
1759
1872
|
width: s,
|
|
1760
1873
|
height: a,
|
|
1761
1874
|
...x
|
|
1762
1875
|
});
|
|
1763
1876
|
}, [o]);
|
|
1764
|
-
return
|
|
1765
|
-
["Slash", "MoveDownLeft", "Pencil"].includes(t) ?
|
|
1766
|
-
}, [l,
|
|
1767
|
-
|
|
1768
|
-
}, [
|
|
1769
|
-
|
|
1877
|
+
return N(() => {
|
|
1878
|
+
["Slash", "MoveDownLeft", "Pencil"].includes(t) ? A.points = m : t === "Step" || (A.x = l, A.y = h, A.width = s, A.height = a);
|
|
1879
|
+
}, [l, h, s, a]), N(() => {
|
|
1880
|
+
A.editable = !!b;
|
|
1881
|
+
}, [b]), N(() => (o.add(A), () => {
|
|
1882
|
+
A.remove();
|
|
1770
1883
|
}), [o]), null;
|
|
1771
|
-
},
|
|
1884
|
+
}, ls = B(() => (N(() => {
|
|
1772
1885
|
const o = (s) => {
|
|
1773
1886
|
var l;
|
|
1774
|
-
const { list: a } = (l =
|
|
1887
|
+
const { list: a } = (l = i.editor.app) == null ? void 0 : l.editor;
|
|
1775
1888
|
if (a != null && a.length) {
|
|
1776
|
-
for (let
|
|
1777
|
-
|
|
1778
|
-
|
|
1889
|
+
for (let h of a)
|
|
1890
|
+
h.remove(), i.editor.removeShape(h);
|
|
1891
|
+
i.editor.app.editor.cancel();
|
|
1779
1892
|
}
|
|
1780
1893
|
}, t = (s) => {
|
|
1781
1894
|
var a, l;
|
|
1782
|
-
s === "fit" ? (a =
|
|
1783
|
-
}, n =
|
|
1895
|
+
s === "fit" ? (a = i.editor.app) == null || a.tree.zoom(s, 100) : (l = i.editor.app) == null || l.tree.zoom(s), i.editor.setScale(i.editor.app.tree.scale);
|
|
1896
|
+
}, n = Rt(window, {
|
|
1784
1897
|
Backspace: o,
|
|
1785
1898
|
Delete: o,
|
|
1786
1899
|
"$mod+Minus": (s) => {
|
|
@@ -1797,11 +1910,11 @@ const Zr = /* @__PURE__ */ vo(Wr), Gr = "data:image/png;base64,iVBORw0KGgoAAAANS
|
|
|
1797
1910
|
n();
|
|
1798
1911
|
};
|
|
1799
1912
|
}, [window]), null));
|
|
1800
|
-
|
|
1801
|
-
const
|
|
1913
|
+
wo.set("pencil", { url: es });
|
|
1914
|
+
const cs = B(({ target: o }) => {
|
|
1802
1915
|
var t, n;
|
|
1803
|
-
return
|
|
1804
|
-
const s = new
|
|
1916
|
+
return N(() => {
|
|
1917
|
+
const s = new yo({
|
|
1805
1918
|
view: o,
|
|
1806
1919
|
editor: {
|
|
1807
1920
|
lockRatio: "corner",
|
|
@@ -1814,7 +1927,7 @@ const Qr = Y(({ target: o }) => {
|
|
|
1814
1927
|
height: 20,
|
|
1815
1928
|
fill: {
|
|
1816
1929
|
type: "image",
|
|
1817
|
-
url:
|
|
1930
|
+
url: Ki
|
|
1818
1931
|
}
|
|
1819
1932
|
}
|
|
1820
1933
|
},
|
|
@@ -1826,65 +1939,75 @@ const Qr = Y(({ target: o }) => {
|
|
|
1826
1939
|
usePartRender: !0
|
|
1827
1940
|
}
|
|
1828
1941
|
});
|
|
1829
|
-
new
|
|
1830
|
-
|
|
1831
|
-
}), s.tree.on(
|
|
1832
|
-
|
|
1942
|
+
new No(s), i.editor.setApp(s), s.tree.on(vo.ZOOM, () => {
|
|
1943
|
+
i.editor.setScale(s.tree.scale);
|
|
1944
|
+
}), s.tree.on(jo.RESIZE, () => {
|
|
1945
|
+
i.editor.setScale(s.tree.scale);
|
|
1833
1946
|
});
|
|
1834
1947
|
let a = null;
|
|
1835
|
-
|
|
1836
|
-
if (!
|
|
1837
|
-
const { target:
|
|
1838
|
-
if (
|
|
1839
|
-
a =
|
|
1840
|
-
const
|
|
1948
|
+
const l = (f) => {
|
|
1949
|
+
if (!i.editor.useTool) return;
|
|
1950
|
+
const { target: d } = f;
|
|
1951
|
+
if (i.editor.getShape(d.id)) return;
|
|
1952
|
+
a = ge();
|
|
1953
|
+
const m = f.getPageBounds ? f.getPageBounds() : f.getPage(), b = i.editor.useTool;
|
|
1954
|
+
return {
|
|
1841
1955
|
id: a,
|
|
1842
|
-
type:
|
|
1843
|
-
fill:
|
|
1844
|
-
strokeWidth:
|
|
1845
|
-
zIndex:
|
|
1846
|
-
...
|
|
1956
|
+
type: b,
|
|
1957
|
+
fill: i.editor.annotateColor,
|
|
1958
|
+
strokeWidth: i.editor.strokeWidth,
|
|
1959
|
+
zIndex: i.editor.shapes.size + 1,
|
|
1960
|
+
...m
|
|
1847
1961
|
};
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
if (
|
|
1851
|
-
const
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1962
|
+
};
|
|
1963
|
+
s.tree.on(Mo.DOWN, (f) => {
|
|
1964
|
+
if (i.editor.useTool !== "Step") return;
|
|
1965
|
+
const p = l(f);
|
|
1966
|
+
p && (p.text = i.editor.nextStep, p.editable = !0, i.editor.addShape(p), a = null, i.editor.setUseTool(null));
|
|
1967
|
+
}), s.tree.on(De.START, (f) => {
|
|
1968
|
+
const d = i.editor.useTool;
|
|
1969
|
+
if (d === "Step") return;
|
|
1970
|
+
const p = l(f);
|
|
1971
|
+
p && (["Slash", "MoveDownLeft", "Pencil"].includes(d) && (p.points = [p.x, p.y]), i.editor.addShape(p));
|
|
1972
|
+
}), s.tree.on(De.DRAG, (f) => {
|
|
1973
|
+
if (!i.editor.useTool || !a) return;
|
|
1974
|
+
const d = i.editor.getShape(a);
|
|
1975
|
+
if (!d) return;
|
|
1976
|
+
const p = f.getPageBounds(), m = Object.assign({}, d, p), { points: b, type: C } = m;
|
|
1977
|
+
if (b && b.length) {
|
|
1978
|
+
const { x: A, y: x } = f.getInnerTotal(), w = A > 0 ? p.x + A : p.x, S = x > 0 ? p.y + x : p.y;
|
|
1979
|
+
C === "Pencil" ? m.points = [...b, w, S] : m.points = [b[0], b[1], w, S];
|
|
1857
1980
|
}
|
|
1858
|
-
|
|
1859
|
-
}), s.tree.on(
|
|
1860
|
-
if (!
|
|
1861
|
-
const
|
|
1862
|
-
|
|
1981
|
+
i.editor.addShape(m);
|
|
1982
|
+
}), s.tree.on(De.END, () => {
|
|
1983
|
+
if (!i.editor.useTool || !a) return;
|
|
1984
|
+
const f = i.editor.getShape(a);
|
|
1985
|
+
f && ((f.width === 0 || f.height === 0) && !["Slash", "MoveDownLeft", "Pencil"].includes(f.type) ? i.editor.removeShape(f) : i.editor.addShape(Object.assign({}, f, { editable: !0 }))), a = null, i.editor.useTool !== "Pencil" && i.editor.setUseTool(null);
|
|
1863
1986
|
});
|
|
1864
|
-
const
|
|
1865
|
-
const { width:
|
|
1866
|
-
s.tree.zoom("fit", 100),
|
|
1987
|
+
const h = $i(() => {
|
|
1988
|
+
const { width: f, height: d } = o.getBoundingClientRect();
|
|
1989
|
+
s.tree.zoom("fit", 100), i.option.frameConf.width < f && i.option.frameConf.height < d && s.tree.zoom(1);
|
|
1867
1990
|
}, 10);
|
|
1868
|
-
return
|
|
1869
|
-
|
|
1991
|
+
return Co(o, h), () => {
|
|
1992
|
+
ko(o, h), i.editor.destroy();
|
|
1870
1993
|
};
|
|
1871
|
-
}, [o]),
|
|
1994
|
+
}, [o]), N(() => {
|
|
1872
1995
|
const s = setTimeout(() => {
|
|
1873
1996
|
const { width: a, height: l } = o.getBoundingClientRect();
|
|
1874
|
-
|
|
1997
|
+
i.editor.app.tree.zoom("fit", 100), i.option.frameConf.width < a && i.option.frameConf.height < l && i.editor.app.tree.zoom(1), i.editor.setScale(i.editor.app.tree.scale);
|
|
1875
1998
|
}, 20);
|
|
1876
1999
|
return () => {
|
|
1877
2000
|
clearTimeout(s);
|
|
1878
2001
|
};
|
|
1879
|
-
}, [
|
|
1880
|
-
/* @__PURE__ */ e.jsxs(
|
|
1881
|
-
|
|
1882
|
-
((n =
|
|
1883
|
-
|
|
2002
|
+
}, [i.option.frameConf.width, i.option.frameConf.height]), (t = i.editor.app) != null && t.tree ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2003
|
+
/* @__PURE__ */ e.jsxs(rs, { parent: i.editor.app.tree, cursor: i.editor.cursor, ...i.option.frameConf, children: [
|
|
2004
|
+
i.editor.shapesList.map((s) => /* @__PURE__ */ e.jsx(as, { ...s }, s.id)),
|
|
2005
|
+
((n = i.editor.img) == null ? void 0 : n.src) && /* @__PURE__ */ e.jsx(ss, {}),
|
|
2006
|
+
i.option.waterImg && /* @__PURE__ */ e.jsx(ns, {})
|
|
1884
2007
|
] }),
|
|
1885
|
-
/* @__PURE__ */ e.jsx(
|
|
2008
|
+
/* @__PURE__ */ e.jsx(ls, {})
|
|
1886
2009
|
] }) : null;
|
|
1887
|
-
}),
|
|
2010
|
+
}), ds = [
|
|
1888
2011
|
{
|
|
1889
2012
|
key: 0.5,
|
|
1890
2013
|
label: "50%"
|
|
@@ -1901,33 +2024,33 @@ const Qr = Y(({ target: o }) => {
|
|
|
1901
2024
|
key: 2,
|
|
1902
2025
|
label: "200%"
|
|
1903
2026
|
}
|
|
1904
|
-
],
|
|
2027
|
+
], fs = B(() => {
|
|
1905
2028
|
const o = (n) => {
|
|
1906
2029
|
var s;
|
|
1907
|
-
(s =
|
|
2030
|
+
(s = i.editor.app) == null || s.tree.zoom(n), i.editor.setScale(i.editor.app.tree.scale);
|
|
1908
2031
|
}, t = (n) => {
|
|
1909
2032
|
var a, l;
|
|
1910
2033
|
const s = Number(n.key);
|
|
1911
|
-
s === 4 ? (a =
|
|
2034
|
+
s === 4 ? (a = i.editor.app) == null || a.tree.zoom("fit", 100) : (l = i.editor.app) == null || l.tree.zoom(s), i.editor.setScale(i.editor.app.tree.scale);
|
|
1912
2035
|
};
|
|
1913
2036
|
return /* @__PURE__ */ e.jsxs("div", { className: "absolute z-10 bottom-4 gap-2 right-4 flex items-center ", children: [
|
|
1914
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex bg-white overflow-hidden rounded-full shadow-md", children: [
|
|
1915
|
-
/* @__PURE__ */ e.jsx(
|
|
1916
|
-
/* @__PURE__ */ e.jsx(
|
|
1917
|
-
|
|
2037
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex bg-white dark:bg-black overflow-hidden rounded-full shadow-md", children: [
|
|
2038
|
+
/* @__PURE__ */ e.jsx(k, { type: "text", icon: /* @__PURE__ */ e.jsx(M.ZoomIn, { size: 16 }), onClick: () => o("in") }),
|
|
2039
|
+
/* @__PURE__ */ e.jsx(At, { menu: { items: ds, onClick: t }, placement: "top", children: /* @__PURE__ */ e.jsxs(k, { type: "text", children: [
|
|
2040
|
+
i.editor.scale,
|
|
1918
2041
|
"%"
|
|
1919
2042
|
] }) }),
|
|
1920
|
-
/* @__PURE__ */ e.jsx(
|
|
2043
|
+
/* @__PURE__ */ e.jsx(k, { type: "text", icon: /* @__PURE__ */ e.jsx(M.ZoomOut, { size: 16 }), onClick: () => o("out") })
|
|
1921
2044
|
] }),
|
|
1922
|
-
/* @__PURE__ */ e.jsx("div", { className: "rounded-full bg-white shadow-md overflow-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2045
|
+
/* @__PURE__ */ e.jsx("div", { className: "rounded-full bg-white dark:bg-black shadow-md overflow-hidden", children: /* @__PURE__ */ e.jsx(k, { type: "text", icon: /* @__PURE__ */ e.jsx(M.Maximize, { size: 16 }), onClick: () => t({ key: 4 }) }) })
|
|
1923
2046
|
] });
|
|
1924
|
-
}),
|
|
2047
|
+
}), hs = B(() => {
|
|
1925
2048
|
const [o, t] = O(null);
|
|
1926
2049
|
return /* @__PURE__ */ e.jsxs("div", { className: "md:w-0 md:flex-1 overflow-hidden select-none relative", children: [
|
|
1927
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-full h-full relative z-0", ref: (n) => t(n), children: o && /* @__PURE__ */ e.jsx(
|
|
1928
|
-
/* @__PURE__ */ e.jsx(
|
|
2050
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-full relative z-0", ref: (n) => t(n), children: o && /* @__PURE__ */ e.jsx(cs, { target: o }) }),
|
|
2051
|
+
/* @__PURE__ */ e.jsx(fs, {})
|
|
1929
2052
|
] });
|
|
1930
|
-
}),
|
|
2053
|
+
}), ps = [
|
|
1931
2054
|
{
|
|
1932
2055
|
key: "default",
|
|
1933
2056
|
title: "Default",
|
|
@@ -2089,17 +2212,17 @@ const Qr = Y(({ target: o }) => {
|
|
|
2089
2212
|
}
|
|
2090
2213
|
]
|
|
2091
2214
|
}
|
|
2092
|
-
],
|
|
2093
|
-
const [a, l] = O(""), [
|
|
2215
|
+
], us = ({ frameWidth: o, frameHeight: t, type: n, onSet: s }) => {
|
|
2216
|
+
const [a, l] = O(""), [h, f] = O(""), d = () => {
|
|
2094
2217
|
s({ type: "auto", title: "Auto" });
|
|
2095
|
-
},
|
|
2096
|
-
s({ type: "custom", title: "Custom", width: a, height:
|
|
2218
|
+
}, p = () => {
|
|
2219
|
+
s({ type: "custom", title: "Custom", width: a, height: h });
|
|
2097
2220
|
};
|
|
2098
|
-
return
|
|
2221
|
+
return N(() => {
|
|
2099
2222
|
n === "custom" ? (l(o), f(t)) : (l(""), f(""));
|
|
2100
2223
|
}, [n]), /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center py-2 font-normal", children: [
|
|
2101
2224
|
/* @__PURE__ */ e.jsx(
|
|
2102
|
-
|
|
2225
|
+
nt,
|
|
2103
2226
|
{
|
|
2104
2227
|
min: 1,
|
|
2105
2228
|
value: a,
|
|
@@ -2111,10 +2234,10 @@ const Qr = Y(({ target: o }) => {
|
|
|
2111
2234
|
),
|
|
2112
2235
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs opacity-50", children: "x" }),
|
|
2113
2236
|
/* @__PURE__ */ e.jsx(
|
|
2114
|
-
|
|
2237
|
+
nt,
|
|
2115
2238
|
{
|
|
2116
2239
|
min: 1,
|
|
2117
|
-
value:
|
|
2240
|
+
value: h,
|
|
2118
2241
|
onChange: f,
|
|
2119
2242
|
placeholder: t,
|
|
2120
2243
|
prefix: /* @__PURE__ */ e.jsx("span", { className: "opacity-60 mx-1", children: "H" }),
|
|
@@ -2122,135 +2245,135 @@ const Qr = Y(({ target: o }) => {
|
|
|
2122
2245
|
}
|
|
2123
2246
|
),
|
|
2124
2247
|
/* @__PURE__ */ e.jsx(
|
|
2125
|
-
|
|
2248
|
+
k,
|
|
2126
2249
|
{
|
|
2127
2250
|
type: "primary",
|
|
2128
2251
|
shape: "circle",
|
|
2129
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2130
|
-
disabled: !a || !
|
|
2131
|
-
onClick:
|
|
2252
|
+
icon: /* @__PURE__ */ e.jsx(M.Check, { size: 18 }),
|
|
2253
|
+
disabled: !a || !h,
|
|
2254
|
+
onClick: p
|
|
2132
2255
|
}
|
|
2133
2256
|
),
|
|
2134
|
-
/* @__PURE__ */ e.jsx(
|
|
2135
|
-
|
|
2257
|
+
/* @__PURE__ */ e.jsx(L, { title: "Auto size", children: /* @__PURE__ */ e.jsx(
|
|
2258
|
+
k,
|
|
2136
2259
|
{
|
|
2137
2260
|
type: "primary",
|
|
2138
2261
|
shape: "circle",
|
|
2139
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2262
|
+
icon: /* @__PURE__ */ e.jsx(M.Maximize, { size: 18 }),
|
|
2140
2263
|
disabled: n === "auto",
|
|
2141
|
-
onClick:
|
|
2264
|
+
onClick: d
|
|
2142
2265
|
}
|
|
2143
2266
|
) })
|
|
2144
2267
|
] });
|
|
2145
|
-
},
|
|
2146
|
-
var
|
|
2147
|
-
const o =
|
|
2268
|
+
}, ms = B(() => {
|
|
2269
|
+
var A;
|
|
2270
|
+
const o = ne(null), [t, n] = O(!1), [s, a] = O(500), l = () => {
|
|
2148
2271
|
n(!1);
|
|
2149
|
-
},
|
|
2272
|
+
}, h = (x) => {
|
|
2150
2273
|
if (n(x), x && o.current) {
|
|
2151
|
-
const { height:
|
|
2274
|
+
const { height: w, y: S } = o.current.getBoundingClientRect(), _ = document.body.clientHeight - w - S - 80;
|
|
2152
2275
|
a(_);
|
|
2153
2276
|
}
|
|
2154
|
-
}, f = (x,
|
|
2155
|
-
if (l(), x.type === "auto" &&
|
|
2156
|
-
const
|
|
2157
|
-
|
|
2277
|
+
}, f = (x, w) => !(x !== i.option.size.type || w.height !== i.option.frameConf.height || w.width !== i.option.frameConf.width), d = (x) => {
|
|
2278
|
+
if (l(), x.type === "auto" && i.editor.img.width) {
|
|
2279
|
+
const w = we(i.editor.img.width, i.editor.img.height);
|
|
2280
|
+
i.option.setSize({ ...x, width: i.editor.img.width + w, height: i.editor.img.height + w });
|
|
2158
2281
|
return;
|
|
2159
2282
|
}
|
|
2160
|
-
|
|
2161
|
-
},
|
|
2162
|
-
l(),
|
|
2283
|
+
i.option.setSize(x);
|
|
2284
|
+
}, p = (x, w, S) => {
|
|
2285
|
+
l(), i.option.setSize({
|
|
2163
2286
|
type: x,
|
|
2164
|
-
title: `${
|
|
2165
|
-
width:
|
|
2166
|
-
height:
|
|
2287
|
+
title: `${w}${S.title ? ` ${S.title} ` : " "}${S.w} : ${S.h}`,
|
|
2288
|
+
width: S.width,
|
|
2289
|
+
height: S.height
|
|
2167
2290
|
});
|
|
2168
|
-
},
|
|
2291
|
+
}, m = ((A = i.editor.img) == null ? void 0 : A.src) || i.option.size.type !== "auto", b = /* @__PURE__ */ e.jsx(us, { type: i.option.size.type, frameWidth: i.option.frameConf.width, frameHeight: i.option.frameConf.height, onSet: d }), C = /* @__PURE__ */ e.jsx("div", { className: "border-t border-gray-200 dark:border-gray-800 py-2 divide-y dark:divide-gray-700", "data-mode": i.editor.isDark ? "dark" : "light", children: ps.map((x) => /* @__PURE__ */ e.jsxs("div", { children: [
|
|
2169
2292
|
x.key !== "default" && /* @__PURE__ */ e.jsx("div", { className: "font-semibold pt-2", children: x.title }),
|
|
2170
|
-
/* @__PURE__ */ e.jsx("section", { className: "flex flex-wrap items-end pb-2", children: x.lists.map((
|
|
2171
|
-
|
|
2293
|
+
/* @__PURE__ */ e.jsx("section", { className: "flex flex-wrap items-end pb-2", children: x.lists.map((w, S) => /* @__PURE__ */ e.jsxs(
|
|
2294
|
+
k,
|
|
2172
2295
|
{
|
|
2173
2296
|
type: "text",
|
|
2174
2297
|
className: "flex-[33%] p-3 h-auto flex-col gap-0 disabled:bg-blue-500/5 disabled:border-blue-500 disabled:cursor-default disabled:text-black",
|
|
2175
|
-
disabled: f(x.key,
|
|
2176
|
-
onClick: () =>
|
|
2298
|
+
disabled: f(x.key, w),
|
|
2299
|
+
onClick: () => p(x.key, x.title, w),
|
|
2177
2300
|
children: [
|
|
2178
2301
|
/* @__PURE__ */ e.jsx("div", { className: "py-2 px-3 w-full", children: /* @__PURE__ */ e.jsx(
|
|
2179
2302
|
"div",
|
|
2180
2303
|
{
|
|
2181
|
-
className: "border border-black/50 bg-black/10 w-full flex items-center justify-center rounded-md opacity-75",
|
|
2182
|
-
style: { aspectRatio:
|
|
2304
|
+
className: "border border-black/50 bg-black/10 dark:bg-white/20 dark:border-white/40 w-full flex items-center justify-center rounded-md opacity-75",
|
|
2305
|
+
style: { aspectRatio: w.w / w.h },
|
|
2183
2306
|
children: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2184
|
-
|
|
2307
|
+
w.w,
|
|
2185
2308
|
" : ",
|
|
2186
|
-
|
|
2309
|
+
w.h
|
|
2187
2310
|
] })
|
|
2188
2311
|
}
|
|
2189
2312
|
) }),
|
|
2190
|
-
|
|
2313
|
+
w.title && /* @__PURE__ */ e.jsx("div", { className: "text-xs", children: w.title }),
|
|
2191
2314
|
/* @__PURE__ */ e.jsxs("div", { className: "text-xs overflow-hidden text-gray-500", children: [
|
|
2192
|
-
|
|
2315
|
+
w.width,
|
|
2193
2316
|
" x ",
|
|
2194
|
-
|
|
2317
|
+
w.height
|
|
2195
2318
|
] })
|
|
2196
2319
|
]
|
|
2197
2320
|
},
|
|
2198
|
-
|
|
2321
|
+
S
|
|
2199
2322
|
)) })
|
|
2200
2323
|
] }, x.key)) });
|
|
2201
2324
|
return /* @__PURE__ */ e.jsx(
|
|
2202
|
-
|
|
2325
|
+
xe,
|
|
2203
2326
|
{
|
|
2204
|
-
content:
|
|
2205
|
-
title:
|
|
2327
|
+
content: C,
|
|
2328
|
+
title: b,
|
|
2206
2329
|
trigger: "click",
|
|
2207
2330
|
arrow: !1,
|
|
2208
2331
|
placement: "bottomRight",
|
|
2209
2332
|
open: t,
|
|
2210
|
-
overlayClassName: "[&_.ant-popover-inner]:h-full [&_.ant-popover-inner]:overflow-x-hidden [&_.ant-popover-inner]:overflow-y-auto [&_.ant-popover-content]:h-full",
|
|
2333
|
+
overlayClassName: Z("shoteasy-components [&_.ant-popover-inner]:h-full [&_.ant-popover-inner]:overflow-x-hidden [&_.ant-popover-inner]:overflow-y-auto [&_.ant-popover-content]:h-full", i.editor.isDark && "dark-mode"),
|
|
2211
2334
|
overlayStyle: {
|
|
2212
2335
|
width: "400px",
|
|
2213
2336
|
height: `${s}px`
|
|
2214
2337
|
},
|
|
2215
|
-
onOpenChange:
|
|
2216
|
-
children: /* @__PURE__ */ e.jsxs("div", { className:
|
|
2338
|
+
onOpenChange: h,
|
|
2339
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: Z("px-3 py-1.5 border shrink-0 border-gray-200 dark:border-gray-700 gap-3 shadow-sm overflow-hidden max-h-12 rounded-md hover:border-blue-500 [&_svg]:hover:text-blue-500 cursor-pointer flex items-center", t && "shadow-md"), ref: o, children: [
|
|
2217
2340
|
/* @__PURE__ */ e.jsx(
|
|
2218
2341
|
"div",
|
|
2219
2342
|
{
|
|
2220
|
-
className: "border border-black/50 bg-black/10 w-4 rounded-sm",
|
|
2221
|
-
style: { aspectRatio:
|
|
2343
|
+
className: "border border-black/50 bg-black/10 dark:bg-white/20 dark:border-white/40 w-4 rounded-sm",
|
|
2344
|
+
style: { aspectRatio: i.option.frameConf.width / i.option.frameConf.height }
|
|
2222
2345
|
}
|
|
2223
2346
|
),
|
|
2224
2347
|
/* @__PURE__ */ e.jsxs("div", { className: "text-xs", children: [
|
|
2225
|
-
/* @__PURE__ */ e.jsx("div", { className: "font-semibold leading-3 mb-0.5", children:
|
|
2226
|
-
|
|
2227
|
-
|
|
2348
|
+
/* @__PURE__ */ e.jsx("div", { className: "font-semibold leading-3 mb-0.5", children: i.option.size.title }),
|
|
2349
|
+
m ? /* @__PURE__ */ e.jsxs("div", { className: "text-gray-500 leading-3", children: [
|
|
2350
|
+
i.option.frameConf.width,
|
|
2228
2351
|
" x ",
|
|
2229
|
-
|
|
2352
|
+
i.option.frameConf.height,
|
|
2230
2353
|
" px"
|
|
2231
2354
|
] }) : /* @__PURE__ */ e.jsx("div", { className: "text-gray-500 leading-3", children: "Adaptive screenshot size" })
|
|
2232
2355
|
] }),
|
|
2233
2356
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1" }),
|
|
2234
|
-
t ? /* @__PURE__ */ e.jsx(
|
|
2357
|
+
t ? /* @__PURE__ */ e.jsx(M.ChevronUp, { size: 16 }) : /* @__PURE__ */ e.jsx(M.ChevronDown, { size: 16 })
|
|
2235
2358
|
] })
|
|
2236
2359
|
}
|
|
2237
2360
|
);
|
|
2238
|
-
}),
|
|
2239
|
-
const o =
|
|
2361
|
+
}), gs = B(() => {
|
|
2362
|
+
const o = ne(null), [t, n] = O(!1), s = () => {
|
|
2240
2363
|
n(!0);
|
|
2241
2364
|
}, a = () => {
|
|
2242
|
-
var
|
|
2243
|
-
if (typeof ((
|
|
2244
|
-
const
|
|
2245
|
-
if (
|
|
2246
|
-
const { width:
|
|
2247
|
-
if (
|
|
2248
|
-
src:
|
|
2249
|
-
width:
|
|
2250
|
-
height:
|
|
2251
|
-
})),
|
|
2252
|
-
const
|
|
2253
|
-
|
|
2365
|
+
var h, f;
|
|
2366
|
+
if (typeof ((h = o.current) == null ? void 0 : h.cropper) < "u") {
|
|
2367
|
+
const d = (f = o.current) == null ? void 0 : f.cropper.getCroppedCanvas();
|
|
2368
|
+
if (d) {
|
|
2369
|
+
const { width: p, height: m } = d, b = d.toDataURL();
|
|
2370
|
+
if (i.editor.setImg(Object.assign({}, i.editor.img, {
|
|
2371
|
+
src: b,
|
|
2372
|
+
width: p,
|
|
2373
|
+
height: m
|
|
2374
|
+
})), i.option.size.type === "auto") {
|
|
2375
|
+
const C = we(p, m);
|
|
2376
|
+
i.option.setFrameSize(p + C, m + C);
|
|
2254
2377
|
}
|
|
2255
2378
|
}
|
|
2256
2379
|
}
|
|
@@ -2259,17 +2382,17 @@ const Qr = Y(({ target: o }) => {
|
|
|
2259
2382
|
n(!1);
|
|
2260
2383
|
};
|
|
2261
2384
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2262
|
-
/* @__PURE__ */ e.jsx(
|
|
2263
|
-
|
|
2385
|
+
/* @__PURE__ */ e.jsx(L, { title: "Crop Image", children: /* @__PURE__ */ e.jsx(
|
|
2386
|
+
k,
|
|
2264
2387
|
{
|
|
2265
2388
|
type: "text",
|
|
2266
2389
|
shape: "circle",
|
|
2267
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2390
|
+
icon: /* @__PURE__ */ e.jsx(M.Crop, { size: 18 }),
|
|
2268
2391
|
onClick: s
|
|
2269
2392
|
}
|
|
2270
2393
|
) }),
|
|
2271
2394
|
/* @__PURE__ */ e.jsx(
|
|
2272
|
-
|
|
2395
|
+
gr,
|
|
2273
2396
|
{
|
|
2274
2397
|
title: "Cropper",
|
|
2275
2398
|
open: t,
|
|
@@ -2277,13 +2400,13 @@ const Qr = Y(({ target: o }) => {
|
|
|
2277
2400
|
onCancel: l,
|
|
2278
2401
|
destroyOnClose: !0,
|
|
2279
2402
|
children: /* @__PURE__ */ e.jsx(
|
|
2280
|
-
|
|
2403
|
+
So,
|
|
2281
2404
|
{
|
|
2282
2405
|
ref: o,
|
|
2283
2406
|
style: { height: 400, width: "100%" },
|
|
2284
2407
|
zoomTo: 0.5,
|
|
2285
|
-
initialAspectRatio:
|
|
2286
|
-
src:
|
|
2408
|
+
initialAspectRatio: i.editor.img.width / i.editor.img.height,
|
|
2409
|
+
src: i.editor.img.src,
|
|
2287
2410
|
dragMode: "move",
|
|
2288
2411
|
viewMode: 1,
|
|
2289
2412
|
minCropBoxHeight: 10,
|
|
@@ -2298,82 +2421,83 @@ const Qr = Y(({ target: o }) => {
|
|
|
2298
2421
|
}
|
|
2299
2422
|
)
|
|
2300
2423
|
] });
|
|
2301
|
-
}),
|
|
2424
|
+
}), xs = ["top-left", "top", "top-right", "left", "center", "right", "bottom-left", "bottom", "bottom-right"], bs = B(() => {
|
|
2302
2425
|
const [o, t] = O(!1), n = (l) => {
|
|
2303
2426
|
t(l);
|
|
2304
2427
|
}, s = (l) => {
|
|
2305
|
-
|
|
2306
|
-
}, a = /* @__PURE__ */ e.jsx("div", { className:
|
|
2428
|
+
i.option.setAlign(l);
|
|
2429
|
+
}, a = /* @__PURE__ */ e.jsx("div", { className: Z("flex flex-wrap w-24 position-block", i.option.align), children: xs.map((l) => /* @__PURE__ */ e.jsx("div", { className: "w-8 h-8 border border-[var(--c-br)] rounded-sm hover:bg-[var(--c-wb)] cursor-pointer", onClick: () => s(l) }, l)) });
|
|
2307
2430
|
return /* @__PURE__ */ e.jsx(
|
|
2308
|
-
|
|
2431
|
+
xe,
|
|
2309
2432
|
{
|
|
2310
2433
|
content: a,
|
|
2311
2434
|
trigger: "click",
|
|
2312
2435
|
arrow: !1,
|
|
2313
2436
|
placement: "bottomRight",
|
|
2437
|
+
overlayClassName: Z("shoteasy-components", i.editor.isDark && "dark-mode"),
|
|
2314
2438
|
open: o,
|
|
2315
2439
|
onOpenChange: n,
|
|
2316
2440
|
children: /* @__PURE__ */ e.jsx(
|
|
2317
|
-
|
|
2441
|
+
k,
|
|
2318
2442
|
{
|
|
2319
2443
|
type: "text",
|
|
2320
2444
|
shape: "circle",
|
|
2321
|
-
className:
|
|
2322
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2445
|
+
className: Z(o && "shadow-md"),
|
|
2446
|
+
icon: /* @__PURE__ */ e.jsx(M.LayoutGrid, { size: 18 })
|
|
2323
2447
|
}
|
|
2324
2448
|
)
|
|
2325
2449
|
}
|
|
2326
2450
|
);
|
|
2327
|
-
}),
|
|
2328
|
-
const [o, t] = O(!1), [n, s] = O("ShotEasy"), [a, l] = O("#00000030"), [
|
|
2329
|
-
l(typeof
|
|
2451
|
+
}), ws = B(() => {
|
|
2452
|
+
const [o, t] = O(!1), [n, s] = O("ShotEasy"), [a, l] = O("#00000030"), [h, f] = O(45), d = (p) => {
|
|
2453
|
+
l(typeof p == "string" ? p : p.toRgbString());
|
|
2330
2454
|
};
|
|
2331
|
-
return
|
|
2455
|
+
return N(() => {
|
|
2332
2456
|
if (o && n.trim()) {
|
|
2333
|
-
const
|
|
2457
|
+
const p = Zo({
|
|
2334
2458
|
text: n,
|
|
2335
2459
|
color: a,
|
|
2336
|
-
angleDegrees:
|
|
2460
|
+
angleDegrees: h
|
|
2337
2461
|
});
|
|
2338
|
-
|
|
2462
|
+
i.option.setWaterImg(p);
|
|
2339
2463
|
} else
|
|
2340
|
-
|
|
2341
|
-
}, [o, n, a,
|
|
2464
|
+
i.option.setWaterImg(null);
|
|
2465
|
+
}, [o, n, a, h]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2342
2466
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm flex gap-4 items-center justify-between", children: [
|
|
2343
2467
|
/* @__PURE__ */ e.jsx("label", { children: "Watermark" }),
|
|
2344
|
-
/* @__PURE__ */ e.jsx(
|
|
2468
|
+
/* @__PURE__ */ e.jsx(at, { defaultChecked: o, onChange: t, size: "small", className: "bg-slate-200" })
|
|
2345
2469
|
] }),
|
|
2346
2470
|
o && /* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-xs grid gap-3 pl-2 pt-2", children: [
|
|
2347
|
-
/* @__PURE__ */ e.jsx(
|
|
2471
|
+
/* @__PURE__ */ e.jsx(xr, { defaultValue: n, placeholder: "Watermark content", onChange: (p) => s(p.target.value) }),
|
|
2348
2472
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2349
2473
|
/* @__PURE__ */ e.jsx("label", { children: "Color" }),
|
|
2350
|
-
/* @__PURE__ */ e.jsx(
|
|
2474
|
+
/* @__PURE__ */ e.jsx(be, { value: a, onChange: d, size: "small" })
|
|
2351
2475
|
] }),
|
|
2352
2476
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2353
2477
|
/* @__PURE__ */ e.jsx("label", { children: "Direction" }),
|
|
2354
|
-
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(
|
|
2355
|
-
/* @__PURE__ */ e.jsx(
|
|
2356
|
-
/* @__PURE__ */ e.jsx(
|
|
2478
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(P.Group, { defaultValue: h, onChange: (p) => f(p.target.value), size: "small", children: [
|
|
2479
|
+
/* @__PURE__ */ e.jsx(P.Button, { value: -45, children: /* @__PURE__ */ e.jsx(M.ArrowUpRight, { size: 16, className: "mt-[3px]" }) }),
|
|
2480
|
+
/* @__PURE__ */ e.jsx(P.Button, { value: 45, children: /* @__PURE__ */ e.jsx(M.ArrowDownRight, { size: 16, className: "mt-[3px]" }) })
|
|
2357
2481
|
] }) })
|
|
2358
2482
|
] }),
|
|
2359
2483
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2360
2484
|
/* @__PURE__ */ e.jsx("label", { children: "Only Background" }),
|
|
2361
|
-
/* @__PURE__ */ e.jsx(
|
|
2485
|
+
/* @__PURE__ */ e.jsx(at, { size: "small", onChange: (p) => i.option.setWaterIndex(p ? -1 : 1), className: "bg-slate-200" })
|
|
2362
2486
|
] })
|
|
2363
2487
|
] })
|
|
2364
2488
|
] });
|
|
2365
2489
|
});
|
|
2366
|
-
function
|
|
2367
|
-
const s =
|
|
2368
|
-
|
|
2490
|
+
function ys(o, t, n) {
|
|
2491
|
+
const s = ne(o), a = ne(t);
|
|
2492
|
+
N(() => {
|
|
2369
2493
|
s.current = o, a.current = t;
|
|
2370
|
-
}, [...n]),
|
|
2371
|
-
const l =
|
|
2372
|
-
"$mod+KeyS": (
|
|
2373
|
-
|
|
2494
|
+
}, [...n]), N(() => {
|
|
2495
|
+
const l = Rt(window, {
|
|
2496
|
+
"$mod+KeyS": (h) => {
|
|
2497
|
+
h.preventDefault(), s.current && s.current();
|
|
2374
2498
|
},
|
|
2375
|
-
"$mod+KeyC": (
|
|
2376
|
-
|
|
2499
|
+
"$mod+KeyC": (h) => {
|
|
2500
|
+
h.preventDefault(), a && a.current();
|
|
2377
2501
|
}
|
|
2378
2502
|
});
|
|
2379
2503
|
return () => {
|
|
@@ -2381,68 +2505,68 @@ function ls(o, t, n) {
|
|
|
2381
2505
|
};
|
|
2382
2506
|
}, [window]);
|
|
2383
2507
|
}
|
|
2384
|
-
const
|
|
2385
|
-
var
|
|
2386
|
-
const [o, t] = O(!1), [n, s] = O(!1), [a, l] = O("png"), [
|
|
2508
|
+
const vs = B(() => {
|
|
2509
|
+
var A;
|
|
2510
|
+
const [o, t] = O(!1), [n, s] = O(!1), [a, l] = O("png"), [h, f] = O(1), d = (x) => {
|
|
2387
2511
|
s(x);
|
|
2388
|
-
},
|
|
2389
|
-
if (!
|
|
2512
|
+
}, p = async () => {
|
|
2513
|
+
if (!i.editor.isEditing || o) return;
|
|
2390
2514
|
const x = {
|
|
2391
|
-
pixelRatio:
|
|
2515
|
+
pixelRatio: h
|
|
2392
2516
|
};
|
|
2393
2517
|
["jpg", "webp"].includes(a) && (x.quality = 0.9, x.fill = "#ffffff");
|
|
2394
|
-
const
|
|
2395
|
-
t(!0),
|
|
2396
|
-
key:
|
|
2518
|
+
const w = ge();
|
|
2519
|
+
t(!0), i.editor.message.open({
|
|
2520
|
+
key: w,
|
|
2397
2521
|
type: "loading",
|
|
2398
2522
|
content: "Downloading..."
|
|
2399
|
-
}), await
|
|
2523
|
+
}), await i.editor.app.tree.export(a, x).then((S) => {
|
|
2400
2524
|
let _ = "ShotEasy";
|
|
2401
|
-
|
|
2402
|
-
key:
|
|
2525
|
+
h > 1 && (_ += `@${h}`), Bo(S.data, `${_}.${a}`), i.editor.message.open({
|
|
2526
|
+
key: w,
|
|
2403
2527
|
type: "success",
|
|
2404
2528
|
content: "Download Success!"
|
|
2405
2529
|
});
|
|
2406
2530
|
}).catch(() => {
|
|
2407
|
-
|
|
2408
|
-
key:
|
|
2531
|
+
i.editor.message.open({
|
|
2532
|
+
key: w,
|
|
2409
2533
|
type: "error",
|
|
2410
2534
|
content: "Download failed!"
|
|
2411
2535
|
});
|
|
2412
2536
|
}), t(!1);
|
|
2413
|
-
},
|
|
2414
|
-
if (!
|
|
2415
|
-
const x =
|
|
2416
|
-
t(!0),
|
|
2537
|
+
}, m = async () => {
|
|
2538
|
+
if (!i.editor.isEditing || o) return;
|
|
2539
|
+
const x = ge();
|
|
2540
|
+
t(!0), i.editor.message.open({
|
|
2417
2541
|
key: x,
|
|
2418
2542
|
type: "loading",
|
|
2419
2543
|
content: "Copying..."
|
|
2420
|
-
}), await
|
|
2421
|
-
const { data:
|
|
2544
|
+
}), await i.editor.app.tree.export("png", { blob: !0, pixelRatio: h }).then(async (w) => {
|
|
2545
|
+
const { data: S } = w;
|
|
2422
2546
|
await navigator.clipboard.write([
|
|
2423
2547
|
new ClipboardItem({
|
|
2424
|
-
[
|
|
2548
|
+
[S.type]: S
|
|
2425
2549
|
})
|
|
2426
|
-
]),
|
|
2550
|
+
]), i.editor.message.open({
|
|
2427
2551
|
key: x,
|
|
2428
2552
|
type: "success",
|
|
2429
2553
|
content: "Copy Success!"
|
|
2430
2554
|
});
|
|
2431
2555
|
}).catch(() => {
|
|
2432
|
-
|
|
2556
|
+
i.editor.message.open({
|
|
2433
2557
|
key: x,
|
|
2434
2558
|
type: "error",
|
|
2435
2559
|
content: "Copy failed!"
|
|
2436
2560
|
});
|
|
2437
2561
|
}), t(!1);
|
|
2438
|
-
},
|
|
2439
|
-
|
|
2562
|
+
}, b = () => {
|
|
2563
|
+
i.editor.destroy(), i.editor.clearImg();
|
|
2440
2564
|
};
|
|
2441
|
-
|
|
2442
|
-
const
|
|
2565
|
+
ys(() => p(), () => m(), [p, m]);
|
|
2566
|
+
const C = /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "p-2 [&_.ant-segmented]:w-full [&_.ant-segmented-item]:w-[33%]", children: [
|
|
2443
2567
|
/* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400 mb-2", children: "Format" }),
|
|
2444
2568
|
/* @__PURE__ */ e.jsx(
|
|
2445
|
-
|
|
2569
|
+
lt,
|
|
2446
2570
|
{
|
|
2447
2571
|
options: ["png", "jpg", "webp"],
|
|
2448
2572
|
size: "middle",
|
|
@@ -2451,72 +2575,72 @@ const cs = Y(() => {
|
|
|
2451
2575
|
),
|
|
2452
2576
|
/* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400 mt-2 mb-2", children: "Pixel Ratio" }),
|
|
2453
2577
|
/* @__PURE__ */ e.jsx(
|
|
2454
|
-
|
|
2578
|
+
lt,
|
|
2455
2579
|
{
|
|
2456
2580
|
options: [{ value: 1, icon: "1x" }, { value: 2, icon: "2x" }, { value: 3, icon: "3x" }],
|
|
2457
2581
|
size: "middle",
|
|
2458
2582
|
onChange: f
|
|
2459
2583
|
}
|
|
2460
2584
|
),
|
|
2461
|
-
|
|
2585
|
+
i.option.frameConf.width && /* @__PURE__ */ e.jsxs("div", { className: "text-xs p-3 mt-4 flex justify-between bg-black/5 rounded-md", children: [
|
|
2462
2586
|
/* @__PURE__ */ e.jsx("span", { className: "text-gray-400", children: "Download Size" }),
|
|
2463
2587
|
/* @__PURE__ */ e.jsxs("span", { className: "text-gray-700", children: [
|
|
2464
|
-
|
|
2588
|
+
i.option.frameConf.width * h,
|
|
2465
2589
|
" x ",
|
|
2466
|
-
|
|
2590
|
+
i.option.frameConf.height * h
|
|
2467
2591
|
] })
|
|
2468
2592
|
] })
|
|
2469
2593
|
] }) });
|
|
2470
2594
|
return /* @__PURE__ */ e.jsxs("div", { className: "shrink-0 py-4 px-6 flex gap-2 justify-center items-center", children: [
|
|
2471
2595
|
/* @__PURE__ */ e.jsx(
|
|
2472
|
-
|
|
2596
|
+
Nt,
|
|
2473
2597
|
{
|
|
2474
2598
|
theme: {
|
|
2475
2599
|
components: {
|
|
2476
2600
|
Button: {
|
|
2477
|
-
colorPrimary: "#000",
|
|
2601
|
+
colorPrimary: i.editor.isDark ? "#2b4acb" : "#000",
|
|
2478
2602
|
algorithm: !0
|
|
2479
2603
|
// 启用算法
|
|
2480
2604
|
}
|
|
2481
2605
|
}
|
|
2482
2606
|
},
|
|
2483
2607
|
children: /* @__PURE__ */ e.jsxs("div", { className: "ant-space-compact flex flex-1", children: [
|
|
2484
|
-
/* @__PURE__ */ e.jsx(
|
|
2608
|
+
/* @__PURE__ */ e.jsx(L, { placement: "top", title: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2485
2609
|
"Download ",
|
|
2486
|
-
|
|
2610
|
+
gt,
|
|
2487
2611
|
" + S"
|
|
2488
2612
|
] }), children: /* @__PURE__ */ e.jsx(
|
|
2489
|
-
|
|
2613
|
+
k,
|
|
2490
2614
|
{
|
|
2491
2615
|
type: "primary",
|
|
2492
2616
|
size: "large",
|
|
2493
2617
|
loading: o,
|
|
2494
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2618
|
+
icon: /* @__PURE__ */ e.jsx(M.ImageDown, { size: 18 }),
|
|
2495
2619
|
className: "rounded-se-none flex-1 rounded-ee-none me-[-1px] hover:z-[1] border-r-white/30",
|
|
2496
|
-
onClick:
|
|
2620
|
+
onClick: p,
|
|
2497
2621
|
children: /* @__PURE__ */ e.jsxs("div", { className: "leading-4 px-2", children: [
|
|
2498
2622
|
/* @__PURE__ */ e.jsx("div", { className: "text-sm leading-4 font-semibold", children: "Download" }),
|
|
2499
2623
|
/* @__PURE__ */ e.jsxs("div", { className: "text-xs", children: [
|
|
2500
|
-
|
|
2624
|
+
h,
|
|
2501
2625
|
"x as ",
|
|
2502
2626
|
a.toLocaleUpperCase()
|
|
2503
2627
|
] })
|
|
2504
2628
|
] })
|
|
2505
2629
|
}
|
|
2506
2630
|
) }),
|
|
2507
|
-
/* @__PURE__ */ e.jsx(
|
|
2631
|
+
/* @__PURE__ */ e.jsx(L, { placement: "top", title: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2508
2632
|
"Copy ",
|
|
2509
|
-
|
|
2633
|
+
gt,
|
|
2510
2634
|
" + C"
|
|
2511
2635
|
] }), children: /* @__PURE__ */ e.jsx(
|
|
2512
|
-
|
|
2636
|
+
k,
|
|
2513
2637
|
{
|
|
2514
2638
|
type: "primary",
|
|
2515
2639
|
size: "large",
|
|
2516
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2640
|
+
icon: /* @__PURE__ */ e.jsx(M.Copy, { size: 18 }),
|
|
2517
2641
|
loading: o,
|
|
2518
2642
|
className: "rounded-ss-none rounded-es-none border-l-white/30",
|
|
2519
|
-
onClick:
|
|
2643
|
+
onClick: m
|
|
2520
2644
|
}
|
|
2521
2645
|
) })
|
|
2522
2646
|
] })
|
|
@@ -2524,9 +2648,9 @@ const cs = Y(() => {
|
|
|
2524
2648
|
),
|
|
2525
2649
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
2526
2650
|
/* @__PURE__ */ e.jsx(
|
|
2527
|
-
|
|
2651
|
+
xe,
|
|
2528
2652
|
{
|
|
2529
|
-
content:
|
|
2653
|
+
content: C,
|
|
2530
2654
|
trigger: "click",
|
|
2531
2655
|
arrow: !1,
|
|
2532
2656
|
placement: "topRight",
|
|
@@ -2534,70 +2658,71 @@ const cs = Y(() => {
|
|
|
2534
2658
|
overlayStyle: {
|
|
2535
2659
|
width: "320px"
|
|
2536
2660
|
},
|
|
2537
|
-
onOpenChange:
|
|
2538
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2661
|
+
onOpenChange: d,
|
|
2662
|
+
children: /* @__PURE__ */ e.jsx(k, { size: "large", icon: /* @__PURE__ */ e.jsx(M.Settings2, { size: 18 }) })
|
|
2539
2663
|
}
|
|
2540
2664
|
),
|
|
2541
|
-
((
|
|
2542
|
-
|
|
2665
|
+
((A = i.editor.img) == null ? void 0 : A.src) && /* @__PURE__ */ e.jsx(
|
|
2666
|
+
br,
|
|
2543
2667
|
{
|
|
2544
2668
|
title: "Delete the screenshot",
|
|
2545
2669
|
description: "Are you sure to delete this screenshot?",
|
|
2546
|
-
|
|
2670
|
+
placement: "topRight",
|
|
2671
|
+
onConfirm: b,
|
|
2547
2672
|
okText: "Yes",
|
|
2548
2673
|
cancelText: "No",
|
|
2549
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2674
|
+
children: /* @__PURE__ */ e.jsx(k, { size: "large", icon: /* @__PURE__ */ e.jsx(M.Trash2, { size: 18 }) })
|
|
2550
2675
|
}
|
|
2551
2676
|
)
|
|
2552
2677
|
] })
|
|
2553
2678
|
] });
|
|
2554
|
-
}),
|
|
2679
|
+
}), js = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='22'%20height='22'%3e%3cpath%20d='M311.296%20428.544V40.96C186.368%2094.208%2087.552%20195.072%2036.864%20321.024l274.432%20274.432V428.544z'%20fill='%2337C15C'%3e%3c/path%3e%3cpath%20d='M428.544%20311.296l274.432-274.432C642.048%2012.288%20577.536%200%20512%200%20440.832%200%20372.736%2014.848%20311.296%2040.96v387.584l117.248-117.248z'%20fill='%23A9E247'%3e%3c/path%3e%3cpath%20d='M983.04%20311.296h-387.584l117.248%20117.248%20274.432%20274.432c24.576-60.416%2036.864-125.44%2036.864-190.976%200-71.168-14.848-139.264-40.96-200.704z'%20fill='%23FF7D12'%3e%3c/path%3e%3cpath%20d='M712.704%20595.456V983.04c124.928-53.248%20223.744-154.112%20274.432-280.064l-274.432-274.432v166.912z'%20fill='%23F93B21'%3e%3c/path%3e%3cpath%20d='M595.456%20712.704l-274.432%20274.432c60.928%2024.576%20125.44%2036.864%20190.976%2036.864%2071.168%200%20139.264-14.848%20200.704-40.96v-387.584l-117.248%20117.248z'%20fill='%23846FEF'%3e%3c/path%3e%3cpath%20d='M428.544%20712.704H40.96c53.248%20124.928%20154.112%20223.744%20280.064%20274.432l274.432-274.432H428.544z'%20fill='%231E95FF'%3e%3c/path%3e%3cpath%20d='M311.296%20595.456L36.864%20321.024C12.288%20381.952%200%20446.464%200%20512c0%2071.168%2014.848%20139.264%2040.96%20200.704h387.584l-117.248-117.248z'%20fill='%2314EFEF'%3e%3c/path%3e%3cpath%20d='M595.456%20311.296H983.04c-53.248-124.928-154.112-223.744-280.064-274.432L428.544%20311.296h166.912z'%20fill='%23FFC931'%3e%3c/path%3e%3c/svg%3e", Ct = ["cosmic", "desktop"], me = ({ type: o, options: t, onChange: n, value: s }) => {
|
|
2555
2680
|
let a = [];
|
|
2556
2681
|
if (t && t.length)
|
|
2557
2682
|
a = t;
|
|
2558
2683
|
else {
|
|
2559
2684
|
const l = [];
|
|
2560
|
-
Object.keys(Q).map((
|
|
2561
|
-
|
|
2562
|
-
key:
|
|
2563
|
-
value: Q[
|
|
2685
|
+
Object.keys(Q).map((h) => {
|
|
2686
|
+
h.includes(o) && l.push({
|
|
2687
|
+
key: h,
|
|
2688
|
+
value: Q[h]
|
|
2564
2689
|
});
|
|
2565
2690
|
}), a = l;
|
|
2566
2691
|
}
|
|
2567
2692
|
return /* @__PURE__ */ e.jsx(
|
|
2568
|
-
|
|
2693
|
+
P.Group,
|
|
2569
2694
|
{
|
|
2570
2695
|
onChange: (l) => n(l.target.value),
|
|
2571
2696
|
value: s,
|
|
2572
|
-
rootClassName:
|
|
2697
|
+
rootClassName: Z(
|
|
2573
2698
|
"grid [&_span]:ps-0",
|
|
2574
|
-
|
|
2699
|
+
Ct.includes(o) ? "grid-cols-5 gap-y-1.5" : "grid-cols-7 gap-y-3"
|
|
2575
2700
|
),
|
|
2576
|
-
children: a.map((l,
|
|
2577
|
-
|
|
2701
|
+
children: a.map((l, h) => /* @__PURE__ */ e.jsx(
|
|
2702
|
+
P,
|
|
2578
2703
|
{
|
|
2579
2704
|
className: "[&_.ant-radio]:hidden [&_span]:p-0 mr-0",
|
|
2580
2705
|
value: l.key,
|
|
2581
|
-
children:
|
|
2706
|
+
children: Ct.includes(o) ? /* @__PURE__ */ e.jsx("div", { className: Z("w-12 h-8 rounded-md overflow-hidden"), children: /* @__PURE__ */ e.jsx("img", { src: `${l.value.class}&w=48`, className: "w-full h-full object-cover object-center" }) }) : /* @__PURE__ */ e.jsx("div", { className: Z("w-8 h-8 rounded-full overflow-hidden", l.value.class) })
|
|
2582
2707
|
},
|
|
2583
|
-
|
|
2708
|
+
h
|
|
2584
2709
|
))
|
|
2585
2710
|
}
|
|
2586
2711
|
);
|
|
2587
|
-
},
|
|
2712
|
+
}, Ms = B(({ showMore: o, onChange: t }) => {
|
|
2588
2713
|
const n = () => {
|
|
2589
2714
|
t(!1);
|
|
2590
2715
|
}, s = (l) => {
|
|
2591
|
-
const
|
|
2592
|
-
|
|
2716
|
+
const h = l.toHexString();
|
|
2717
|
+
i.option.frameConf.background = {
|
|
2593
2718
|
type: "solid",
|
|
2594
|
-
color:
|
|
2719
|
+
color: h
|
|
2595
2720
|
};
|
|
2596
2721
|
}, a = (l) => {
|
|
2597
|
-
|
|
2722
|
+
i.option.setBackground(l);
|
|
2598
2723
|
};
|
|
2599
2724
|
return /* @__PURE__ */ e.jsx(
|
|
2600
|
-
|
|
2725
|
+
wr,
|
|
2601
2726
|
{
|
|
2602
2727
|
title: "",
|
|
2603
2728
|
placement: "right",
|
|
@@ -2610,121 +2735,173 @@ const cs = Y(() => {
|
|
|
2610
2735
|
className: "[&_.ant-drawer-body]:p-0",
|
|
2611
2736
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 h-full overflow-hidden", children: [
|
|
2612
2737
|
/* @__PURE__ */ e.jsx("div", { className: "shrink-0 pt-4 px-4", children: /* @__PURE__ */ e.jsx(
|
|
2613
|
-
|
|
2738
|
+
k,
|
|
2614
2739
|
{
|
|
2615
2740
|
type: "text",
|
|
2616
2741
|
size: "small",
|
|
2617
2742
|
className: "text-xs flex items-center opacity-80 m-0",
|
|
2618
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2743
|
+
icon: /* @__PURE__ */ e.jsx(M.ChevronRight, { size: 16 }),
|
|
2744
|
+
iconPosition: "end",
|
|
2619
2745
|
onClick: () => t(!1),
|
|
2620
2746
|
children: "Back"
|
|
2621
2747
|
}
|
|
2622
2748
|
) }),
|
|
2623
2749
|
/* @__PURE__ */ e.jsxs("div", { className: "h-0 flex-1 overflow-y-auto px-4 py-2", children: [
|
|
2624
2750
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Custom" }),
|
|
2625
|
-
/* @__PURE__ */ e.jsx("div", { className: "py-1", children: /* @__PURE__ */ e.jsx(
|
|
2751
|
+
/* @__PURE__ */ e.jsx("div", { className: "py-1", children: /* @__PURE__ */ e.jsx(be, { onChange: s, children: /* @__PURE__ */ e.jsx(k, { type: "default", size: "small", shape: "circle", icon: /* @__PURE__ */ e.jsx("img", { src: js, width: 18 }) }) }) }),
|
|
2626
2752
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Solid Colors" }),
|
|
2627
|
-
/* @__PURE__ */ e.jsx(
|
|
2753
|
+
/* @__PURE__ */ e.jsx(me, { type: "solid", onChange: a, value: i.option.background }),
|
|
2628
2754
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Gradients" }),
|
|
2629
|
-
/* @__PURE__ */ e.jsx(
|
|
2755
|
+
/* @__PURE__ */ e.jsx(me, { type: "gradient", onChange: a, value: i.option.background }),
|
|
2630
2756
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Cosmic Gradients" }),
|
|
2631
|
-
/* @__PURE__ */ e.jsx(
|
|
2757
|
+
/* @__PURE__ */ e.jsx(me, { type: "cosmic", onChange: a, value: i.option.background }),
|
|
2632
2758
|
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Desktop" }),
|
|
2633
|
-
/* @__PURE__ */ e.jsx(
|
|
2759
|
+
/* @__PURE__ */ e.jsx(me, { type: "desktop", onChange: a, value: i.option.background })
|
|
2634
2760
|
] })
|
|
2635
2761
|
] })
|
|
2636
2762
|
}
|
|
2637
2763
|
);
|
|
2638
|
-
}),
|
|
2764
|
+
}), Cs = B(() => {
|
|
2765
|
+
const [o, t] = O(!1), n = (s) => {
|
|
2766
|
+
i.option.setFrame(s.target.value);
|
|
2767
|
+
};
|
|
2768
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2769
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
2770
|
+
/* @__PURE__ */ e.jsx("label", { children: "Frame" }),
|
|
2771
|
+
/* @__PURE__ */ e.jsxs(
|
|
2772
|
+
k,
|
|
2773
|
+
{
|
|
2774
|
+
type: "text",
|
|
2775
|
+
size: "small",
|
|
2776
|
+
className: "text-xs flex items-center opacity-80 m-0",
|
|
2777
|
+
disabled: !0,
|
|
2778
|
+
onClick: () => t(!0),
|
|
2779
|
+
children: [
|
|
2780
|
+
"More ",
|
|
2781
|
+
/* @__PURE__ */ e.jsx(M.ChevronRight, { size: 16 })
|
|
2782
|
+
]
|
|
2783
|
+
}
|
|
2784
|
+
)
|
|
2785
|
+
] }),
|
|
2786
|
+
/* @__PURE__ */ e.jsx("div", { className: "py-3 [&_.ant-radio-wrapper_span]:p-0 [&_.ant-radio-wrapper_span]:px-1", children: /* @__PURE__ */ e.jsxs(
|
|
2787
|
+
P.Group,
|
|
2788
|
+
{
|
|
2789
|
+
rootClassName: "grid grid-cols-5",
|
|
2790
|
+
onChange: n,
|
|
2791
|
+
value: i.option.frame,
|
|
2792
|
+
children: [
|
|
2793
|
+
/* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:mr-0 [&_span]:block [&_span]:w-full", value: "none", children: /* @__PURE__ */ e.jsx("div", { className: "bg-gray-300/30 rounded-md h-8 overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "bg-slate-300/40 h-7 w-[85%] rounded-md shadow-md -mt-1 -ml-1" }) }) }),
|
|
2794
|
+
/* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:mr-0 [&_span]:block [&_span]:w-full", value: "light", children: /* @__PURE__ */ e.jsx("div", { className: "bg-gray-300/30 rounded-md h-8 overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "bg-slate-300/40 border-2 border-white/80 h-7 w-[85%] rounded-md shadow-md -mt-1 -ml-1" }) }) }),
|
|
2795
|
+
/* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:mr-0 [&_span]:block [&_span]:w-full", value: "dark", children: /* @__PURE__ */ e.jsx("div", { className: "bg-gray-300/30 rounded-md h-8 overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "bg-slate-300/40 border-2 border-black/40 h-7 w-[85%] rounded-md shadow-md -mt-1 -ml-1" }) }) }),
|
|
2796
|
+
/* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:mr-0 [&_span]:block [&_span]:w-full", value: "macosBarLight", children: /* @__PURE__ */ e.jsx("div", { className: "bg-gray-300/30 rounded-md h-8 overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "bg-slate-300/40 h-7 w-[85%] rounded-sm shadow-md mt-2 ml-3 overflow-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2797
|
+
"div",
|
|
2798
|
+
{
|
|
2799
|
+
className: "h-1.5 bg-white/90 px-0.5 flex items-center gap-[1px] before:block before:rounded-full before:w-0.5 before:h-0.5 before:bg-red-500 after:w-0.5 after:h-0.5 after:bg-green-500",
|
|
2800
|
+
children: /* @__PURE__ */ e.jsx("i", { className: "block w-0.5 h-0.5 bg-yellow-500" })
|
|
2801
|
+
}
|
|
2802
|
+
) }) }) }),
|
|
2803
|
+
/* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:mr-0 [&_span]:block [&_span]:w-full", value: "macosBarDark", children: /* @__PURE__ */ e.jsx("div", { className: "bg-gray-300/30 rounded-md h-8 overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "bg-slate-300/40 h-7 w-[85%] rounded-sm shadow-md mt-2 ml-3 overflow-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2804
|
+
"div",
|
|
2805
|
+
{
|
|
2806
|
+
className: "h-1.5 bg-black/90 px-0.5 flex items-center gap-[1px] before:block before:rounded-full before:w-0.5 before:h-0.5 before:bg-red-500 after:w-0.5 after:h-0.5 after:bg-green-500",
|
|
2807
|
+
children: /* @__PURE__ */ e.jsx("i", { className: "block w-0.5 h-0.5 bg-yellow-500" })
|
|
2808
|
+
}
|
|
2809
|
+
) }) }) })
|
|
2810
|
+
]
|
|
2811
|
+
}
|
|
2812
|
+
) })
|
|
2813
|
+
] });
|
|
2814
|
+
}), ks = B(() => {
|
|
2639
2815
|
const [o, t] = O(!1), n = (s) => {
|
|
2640
2816
|
const a = s.target.value;
|
|
2641
|
-
|
|
2817
|
+
i.option.setBackground(a);
|
|
2642
2818
|
};
|
|
2643
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "bg-white flex flex-col md:w-[340px] border-l border-l-gray-50 shadow-lg relative z-10 select-none", children: [
|
|
2819
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "bg-white dark:bg-black flex flex-col md:w-[340px] border-l border-l-gray-50 dark:border-l-gray-700 dark:text-gray-400 shadow-lg relative z-10 select-none", children: [
|
|
2644
2820
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 flex-col gap-2 p-4 overflow-y-auto overflow-x-hidden", children: [
|
|
2645
|
-
/* @__PURE__ */ e.jsx(
|
|
2821
|
+
/* @__PURE__ */ e.jsx(ms, {}),
|
|
2646
2822
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold pt-2 [&_label]:text-sm", children: [
|
|
2647
2823
|
/* @__PURE__ */ e.jsx("label", { children: "Quick" }),
|
|
2648
2824
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-center py-2", children: [
|
|
2649
|
-
/* @__PURE__ */ e.jsx(
|
|
2825
|
+
/* @__PURE__ */ e.jsx(gs, {}),
|
|
2650
2826
|
/* @__PURE__ */ e.jsx(
|
|
2651
|
-
|
|
2827
|
+
k,
|
|
2652
2828
|
{
|
|
2653
2829
|
type: "text",
|
|
2654
2830
|
shape: "circle",
|
|
2655
|
-
onClick: () =>
|
|
2656
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2831
|
+
onClick: () => i.option.toggleFlip("x"),
|
|
2832
|
+
icon: /* @__PURE__ */ e.jsx(M.FlipHorizontal2, { size: 18 })
|
|
2657
2833
|
}
|
|
2658
2834
|
),
|
|
2659
2835
|
/* @__PURE__ */ e.jsx(
|
|
2660
|
-
|
|
2836
|
+
k,
|
|
2661
2837
|
{
|
|
2662
2838
|
type: "text",
|
|
2663
2839
|
shape: "circle",
|
|
2664
|
-
onClick: () =>
|
|
2665
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2840
|
+
onClick: () => i.option.toggleFlip("y"),
|
|
2841
|
+
icon: /* @__PURE__ */ e.jsx(M.FlipVertical2, { size: 18 })
|
|
2666
2842
|
}
|
|
2667
2843
|
),
|
|
2668
|
-
/* @__PURE__ */ e.jsx(
|
|
2844
|
+
/* @__PURE__ */ e.jsx(bs, {})
|
|
2669
2845
|
] })
|
|
2670
2846
|
] }),
|
|
2671
2847
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2672
2848
|
/* @__PURE__ */ e.jsx("label", { children: "Scale" }),
|
|
2673
2849
|
/* @__PURE__ */ e.jsx(
|
|
2674
|
-
|
|
2850
|
+
pe,
|
|
2675
2851
|
{
|
|
2676
2852
|
min: 0.1,
|
|
2677
2853
|
max: 2,
|
|
2678
2854
|
step: 0.1,
|
|
2679
|
-
onChange: (s) =>
|
|
2680
|
-
value: typeof
|
|
2855
|
+
onChange: (s) => i.option.setScale(s),
|
|
2856
|
+
value: typeof i.option.scale == "number" ? i.option.scale : 1
|
|
2681
2857
|
}
|
|
2682
2858
|
)
|
|
2683
2859
|
] }),
|
|
2684
2860
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2685
2861
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between", children: [
|
|
2686
2862
|
/* @__PURE__ */ e.jsx("label", { children: "Padding" }),
|
|
2687
|
-
/* @__PURE__ */ e.jsx(
|
|
2863
|
+
/* @__PURE__ */ e.jsx(be, { value: i.option.paddingBg, onChange: (s) => i.option.setPaddingBg(s.toRgbString()), size: "small" })
|
|
2688
2864
|
] }),
|
|
2689
2865
|
/* @__PURE__ */ e.jsx(
|
|
2690
|
-
|
|
2866
|
+
pe,
|
|
2691
2867
|
{
|
|
2692
2868
|
min: 0,
|
|
2693
2869
|
max: 60,
|
|
2694
|
-
onChange: (s) =>
|
|
2695
|
-
value: typeof
|
|
2870
|
+
onChange: (s) => i.option.setPadding(s),
|
|
2871
|
+
value: typeof i.option.padding == "number" ? i.option.padding : 0
|
|
2696
2872
|
}
|
|
2697
2873
|
)
|
|
2698
2874
|
] }),
|
|
2699
2875
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2700
2876
|
/* @__PURE__ */ e.jsx("label", { children: "Rounded" }),
|
|
2701
2877
|
/* @__PURE__ */ e.jsx(
|
|
2702
|
-
|
|
2878
|
+
pe,
|
|
2703
2879
|
{
|
|
2704
2880
|
min: 0,
|
|
2705
2881
|
max: 20,
|
|
2706
|
-
onChange: (s) =>
|
|
2707
|
-
value: typeof
|
|
2882
|
+
onChange: (s) => i.option.setRound(s),
|
|
2883
|
+
value: typeof i.option.round == "number" ? i.option.round : 0
|
|
2708
2884
|
}
|
|
2709
2885
|
)
|
|
2710
2886
|
] }),
|
|
2711
2887
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2712
2888
|
/* @__PURE__ */ e.jsx("label", { children: "Shadow" }),
|
|
2713
2889
|
/* @__PURE__ */ e.jsx(
|
|
2714
|
-
|
|
2890
|
+
pe,
|
|
2715
2891
|
{
|
|
2716
2892
|
min: 0,
|
|
2717
2893
|
max: 6,
|
|
2718
|
-
onChange: (s) =>
|
|
2719
|
-
value: typeof
|
|
2894
|
+
onChange: (s) => i.option.setShadow(s),
|
|
2895
|
+
value: typeof i.option.shadow == "number" ? i.option.shadow : 0
|
|
2720
2896
|
}
|
|
2721
2897
|
)
|
|
2722
2898
|
] }),
|
|
2899
|
+
/* @__PURE__ */ e.jsx(Cs, {}),
|
|
2723
2900
|
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2724
2901
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
2725
2902
|
/* @__PURE__ */ e.jsx("label", { children: "Background" }),
|
|
2726
2903
|
/* @__PURE__ */ e.jsxs(
|
|
2727
|
-
|
|
2904
|
+
k,
|
|
2728
2905
|
{
|
|
2729
2906
|
type: "text",
|
|
2730
2907
|
size: "small",
|
|
@@ -2732,48 +2909,60 @@ const cs = Y(() => {
|
|
|
2732
2909
|
onClick: () => t(!0),
|
|
2733
2910
|
children: [
|
|
2734
2911
|
"More ",
|
|
2735
|
-
/* @__PURE__ */ e.jsx(
|
|
2912
|
+
/* @__PURE__ */ e.jsx(M.ChevronRight, { size: 16 })
|
|
2736
2913
|
]
|
|
2737
2914
|
}
|
|
2738
2915
|
)
|
|
2739
2916
|
] }),
|
|
2740
2917
|
/* @__PURE__ */ e.jsx("div", { className: "py-3", children: /* @__PURE__ */ e.jsxs(
|
|
2741
|
-
|
|
2918
|
+
P.Group,
|
|
2742
2919
|
{
|
|
2743
2920
|
onChange: n,
|
|
2744
|
-
value:
|
|
2921
|
+
value: i.option.background,
|
|
2745
2922
|
rootClassName: "grid grid-cols-7 [&_span]:ps-0",
|
|
2746
2923
|
children: [
|
|
2747
|
-
/* @__PURE__ */ e.jsx(
|
|
2924
|
+
/* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:p-0 mr-0", value: "default_1", children: /* @__PURE__ */ e.jsx("div", { className: Z("w-8 h-8 rounded-full", Q.default_1.class) }) }),
|
|
2748
2925
|
Object.keys(Q).map((s) => {
|
|
2749
|
-
if (s.includes("default") && s !== "default_1") return /* @__PURE__ */ e.jsx(
|
|
2926
|
+
if (s.includes("default") && s !== "default_1") return /* @__PURE__ */ e.jsx(P, { className: "[&_.ant-radio]:hidden [&_span]:p-0 mr-0", value: s, children: /* @__PURE__ */ e.jsx("div", { className: Z("w-8 h-8 rounded-full", Q[s].class) }) }, s);
|
|
2750
2927
|
})
|
|
2751
2928
|
]
|
|
2752
2929
|
}
|
|
2753
2930
|
) })
|
|
2754
2931
|
] }),
|
|
2755
|
-
/* @__PURE__ */ e.jsx(
|
|
2932
|
+
/* @__PURE__ */ e.jsx(ws, {})
|
|
2756
2933
|
] }),
|
|
2757
|
-
/* @__PURE__ */ e.jsx(
|
|
2758
|
-
/* @__PURE__ */ e.jsx(
|
|
2934
|
+
/* @__PURE__ */ e.jsx(vs, {}),
|
|
2935
|
+
/* @__PURE__ */ e.jsx(Ms, { showMore: o, onChange: t })
|
|
2759
2936
|
] });
|
|
2760
|
-
}),
|
|
2761
|
-
|
|
2937
|
+
}), As = (o, t = []) => {
|
|
2938
|
+
N(() => {
|
|
2762
2939
|
const n = async (s) => {
|
|
2763
2940
|
const a = s.clipboardData;
|
|
2764
2941
|
if (!a || !a.items) return;
|
|
2765
2942
|
const l = Array.from(a.items).filter(
|
|
2766
|
-
(f) =>
|
|
2943
|
+
(f) => Dt.includes(f.type)
|
|
2767
2944
|
);
|
|
2768
2945
|
if (!l.length) return;
|
|
2769
|
-
const
|
|
2770
|
-
o && o(
|
|
2946
|
+
const h = l[0].getAsFile();
|
|
2947
|
+
o && o(h);
|
|
2771
2948
|
};
|
|
2772
2949
|
return document.addEventListener("paste", n, !1), () => {
|
|
2773
2950
|
document.removeEventListener("paste", n);
|
|
2774
2951
|
};
|
|
2775
2952
|
}, [...t]);
|
|
2776
|
-
},
|
|
2953
|
+
}, Ot = (o) => async (n, s = "blob") => {
|
|
2954
|
+
const a = window.URL || window.webkitURL || window, l = s === "blob" ? a.createObjectURL(n) : n, h = await Io(l), f = Math.round(h.width), d = Math.round(h.height);
|
|
2955
|
+
if (o.editor.setImg({
|
|
2956
|
+
src: l,
|
|
2957
|
+
width: f,
|
|
2958
|
+
height: d,
|
|
2959
|
+
type: s === "blob" ? n.type : "image/png",
|
|
2960
|
+
name: s === "blob" ? n.name : "ShotEasy.png"
|
|
2961
|
+
}), o.option.size.type === "auto") {
|
|
2962
|
+
const p = we(f, d);
|
|
2963
|
+
o.option.setFrameSize(f + p, d + p);
|
|
2964
|
+
}
|
|
2965
|
+
}, Ns = async () => {
|
|
2777
2966
|
try {
|
|
2778
2967
|
const o = await navigator.mediaDevices.getDisplayMedia(), t = document.createElement("video");
|
|
2779
2968
|
t.srcObject = o, t.play(), await new Promise((l) => t.onplaying = l);
|
|
@@ -2784,38 +2973,26 @@ const cs = Y(() => {
|
|
|
2784
2973
|
} catch (o) {
|
|
2785
2974
|
console.log("Error capturing screen:", o);
|
|
2786
2975
|
}
|
|
2787
|
-
}, { Dragger:
|
|
2788
|
-
const o = async (a,
|
|
2789
|
-
const
|
|
2790
|
-
if (r.editor.setImg({
|
|
2791
|
-
src: f,
|
|
2792
|
-
width: h,
|
|
2793
|
-
height: g,
|
|
2794
|
-
type: l === "blob" ? a.type : "image/png",
|
|
2795
|
-
name: l === "blob" ? a.name : "ShotEasy.png"
|
|
2796
|
-
}), r.option.size.type === "auto") {
|
|
2797
|
-
const y = Math.round(h * 0.2);
|
|
2798
|
-
r.option.setFrameSize(h + y, g + y);
|
|
2799
|
-
}
|
|
2800
|
-
}, t = async (a) => (await o(a), Promise.reject()), n = async () => {
|
|
2801
|
-
const a = await hs();
|
|
2976
|
+
}, { Dragger: Ts } = yr, Ss = B(() => {
|
|
2977
|
+
const o = Ot(i), t = async (a) => (await o(a), Promise.reject()), n = async () => {
|
|
2978
|
+
const a = await Ns();
|
|
2802
2979
|
a && o(a, "dataURL");
|
|
2803
2980
|
}, s = () => {
|
|
2804
|
-
|
|
2981
|
+
i.editor.message.info("Developing, Coming soon!");
|
|
2805
2982
|
};
|
|
2806
|
-
return
|
|
2983
|
+
return As((a) => {
|
|
2807
2984
|
o(a);
|
|
2808
|
-
}), /* @__PURE__ */ e.jsx("div", { className: "md:w-0 md:flex-1 flex flex-col justify-center items-center overflow-hidden select-none relative", children: /* @__PURE__ */ e.jsxs("div", { className:
|
|
2985
|
+
}), /* @__PURE__ */ e.jsx("div", { className: "md:w-0 md:flex-1 flex flex-col justify-center items-center overflow-hidden select-none relative", children: /* @__PURE__ */ e.jsxs("div", { className: Z("max-w-[600px]", i.editor.invalid && "invalid"), children: [
|
|
2809
2986
|
/* @__PURE__ */ e.jsx(
|
|
2810
|
-
|
|
2987
|
+
Ts,
|
|
2811
2988
|
{
|
|
2812
|
-
accept:
|
|
2989
|
+
accept: Dt.join(","),
|
|
2813
2990
|
name: "file",
|
|
2814
2991
|
showUploadList: !1,
|
|
2815
2992
|
beforeUpload: t,
|
|
2816
|
-
rootClassName: "p-4 rounded-md bg-white block shadow-sm",
|
|
2993
|
+
rootClassName: "p-4 rounded-md bg-white dark:bg-black dark:text-gray-400 block shadow-sm",
|
|
2817
2994
|
children: /* @__PURE__ */ e.jsxs("div", { className: "text-center p-10", children: [
|
|
2818
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-2xl my-2 opacity-60", children: /* @__PURE__ */ e.jsx(
|
|
2995
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-2xl my-2 opacity-60", children: /* @__PURE__ */ e.jsx(M.ImagePlus, { className: "mx-auto", size: 36 }) }),
|
|
2819
2996
|
/* @__PURE__ */ e.jsxs("p", { className: "text-sm px-4", children: [
|
|
2820
2997
|
"Click or Drag image to this area",
|
|
2821
2998
|
/* @__PURE__ */ e.jsx("br", {}),
|
|
@@ -2824,29 +3001,40 @@ const cs = Y(() => {
|
|
|
2824
3001
|
] })
|
|
2825
3002
|
}
|
|
2826
3003
|
),
|
|
2827
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between mt-
|
|
2828
|
-
/* @__PURE__ */ e.jsx(
|
|
2829
|
-
/* @__PURE__ */ e.jsx(
|
|
2830
|
-
/* @__PURE__ */ e.jsx(
|
|
2831
|
-
/* @__PURE__ */ e.jsx(
|
|
3004
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between mt-2 py-4 px-6 rounded-md bg-white dark:bg-black shadow-sm", children: [
|
|
3005
|
+
/* @__PURE__ */ e.jsx(L, { placement: "top", arrow: !1, title: "Take a screenshot of desktop windows", children: /* @__PURE__ */ e.jsx(k, { shape: "round", type: "default", size: "large", icon: /* @__PURE__ */ e.jsx(M.Camera, { size: 20 }), onClick: n }) }),
|
|
3006
|
+
/* @__PURE__ */ e.jsx(L, { placement: "top", arrow: !1, title: "Beautify text", children: /* @__PURE__ */ e.jsx(k, { shape: "round", type: "default", size: "large", icon: /* @__PURE__ */ e.jsx(M.Type, { size: 20 }), onClick: s }) }),
|
|
3007
|
+
/* @__PURE__ */ e.jsx(L, { placement: "top", arrow: !1, title: "Beautify Code", children: /* @__PURE__ */ e.jsx(k, { shape: "round", type: "default", size: "large", icon: /* @__PURE__ */ e.jsx(M.CodeXml, { size: 20, onClick: s }) }) }),
|
|
3008
|
+
/* @__PURE__ */ e.jsx(L, { placement: "top", arrow: !1, title: "Create gif animate", children: /* @__PURE__ */ e.jsx(k, { shape: "round", type: "default", size: "large", icon: /* @__PURE__ */ e.jsx(M.ImagePlay, { size: 20, onClick: s }) }) })
|
|
2832
3009
|
] })
|
|
2833
3010
|
] }) });
|
|
2834
|
-
}),
|
|
2835
|
-
var
|
|
2836
|
-
const
|
|
2837
|
-
return
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
3011
|
+
}), $s = B(({ defaultImg: o, headLeft: t, headRight: n, isDark: s, boxClassName: a = "" }) => {
|
|
3012
|
+
var p;
|
|
3013
|
+
const l = Ot(i), h = (p = i.editor.img) != null && p.src ? /* @__PURE__ */ e.jsx(hs, {}) : /* @__PURE__ */ e.jsx(Ss, {}), [f, d] = vr.useMessage();
|
|
3014
|
+
return i.editor.setMessage(f), le(() => {
|
|
3015
|
+
const m = s || localStorage.getItem("SHOTEASY_BEAUTIFIER_THEME") === "dark" ? "dark" : "light";
|
|
3016
|
+
i.editor.setTheme(m);
|
|
3017
|
+
}, [s]), N(() => {
|
|
3018
|
+
o && l(o, "dataURL");
|
|
3019
|
+
}, [o]), /* @__PURE__ */ e.jsx(To, { children: /* @__PURE__ */ e.jsxs(
|
|
3020
|
+
Nt,
|
|
3021
|
+
{
|
|
3022
|
+
theme: {
|
|
3023
|
+
algorithm: i.editor.isDark ? ct.darkAlgorithm : ct.defaultAlgorithm
|
|
3024
|
+
},
|
|
3025
|
+
children: [
|
|
3026
|
+
d,
|
|
3027
|
+
/* @__PURE__ */ e.jsxs("div", { id: "shoteasy-container", className: Z("polka flex flex-col overflow-hidden antialiased w-full h-[100vh] dark:bg-black", a), "data-mode": i.editor.isDark ? "dark" : "light", children: [
|
|
3028
|
+
/* @__PURE__ */ e.jsx($o, { headLeft: t, headRight: n }),
|
|
3029
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col flex-1 h-0 md:flex-row md:items-stretch", children: [
|
|
3030
|
+
h,
|
|
3031
|
+
/* @__PURE__ */ e.jsx(ks, {})
|
|
3032
|
+
] })
|
|
3033
|
+
] })
|
|
3034
|
+
]
|
|
3035
|
+
}
|
|
3036
|
+
) });
|
|
2849
3037
|
});
|
|
2850
3038
|
export {
|
|
2851
|
-
|
|
3039
|
+
$s as ImageBeautifier
|
|
2852
3040
|
};
|