image-beautifier 1.0.0 → 1.0.2
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 +6 -0
- package/lib/image-beautifier.es.js +2852 -0
- package/lib/style.css +9 -0
- package/package.json +19 -3
- package/.eslintrc.cjs +0 -25
- package/favicon.svg +0 -20
- package/index.html +0 -13
- package/jsconfig.json +0 -12
- package/postcss.config.mjs +0 -6
- package/preview.png +0 -0
- package/public/vite.svg +0 -1
- package/src/App.jsx +0 -29
- package/src/assets/blur.svg +0 -8
- package/src/assets/color.svg +0 -1
- package/src/assets/demo.png +0 -0
- package/src/assets/pencil.png +0 -0
- package/src/assets/rotate.png +0 -0
- package/src/components/ColorPicker.jsx +0 -27
- package/src/components/Icon.jsx +0 -81
- package/src/components/editor/Editor.jsx +0 -19
- package/src/components/editor/HotKeys.jsx +0 -48
- package/src/components/editor/View.jsx +0 -167
- package/src/components/editor/Zoom.jsx +0 -54
- package/src/components/editor/layers/FrameBox.jsx +0 -51
- package/src/components/editor/layers/Screenshot.jsx +0 -89
- package/src/components/editor/layers/ShapeLine.jsx +0 -97
- package/src/components/editor/layers/Watermark.jsx +0 -41
- package/src/components/header/EmojiSelect.jsx +0 -35
- package/src/components/header/Header.jsx +0 -134
- package/src/components/header/Logo.jsx +0 -29
- package/src/components/header/MediaLogo.jsx +0 -10
- package/src/components/header/WidthDropdown.jsx +0 -74
- package/src/components/init/Init.jsx +0 -77
- package/src/components/sideBar/BackgroundSelect.jsx +0 -49
- package/src/components/sideBar/CropperImage.jsx +0 -73
- package/src/components/sideBar/CustomSize.jsx +0 -60
- package/src/components/sideBar/DownloadBar.jsx +0 -179
- package/src/components/sideBar/DrawerBar.jsx +0 -64
- package/src/components/sideBar/Position.jsx +0 -45
- package/src/components/sideBar/SideBar.jsx +0 -131
- package/src/components/sideBar/SizeBar.jsx +0 -114
- package/src/components/sideBar/Watermark.jsx +0 -59
- package/src/hooks/useKeyboardShortcuts.js +0 -28
- package/src/hooks/usePaste.js +0 -21
- package/src/index.js +0 -1
- package/src/main.jsx +0 -9
- package/src/stores/editor.js +0 -106
- package/src/stores/index.js +0 -7
- package/src/stores/option.js +0 -96
- package/src/style/main.css +0 -132
- package/src/utils/UndoRedoManager.js +0 -83
- package/src/utils/backgroundConfig.js +0 -387
- package/src/utils/captureScreen.js +0 -28
- package/src/utils/sizeConfig.js +0 -163
- package/src/utils/utils.js +0 -154
- package/tailwind.config.mjs +0 -15
- package/vite.config.js +0 -21
|
@@ -0,0 +1,2852 @@
|
|
|
1
|
+
var si = Object.defineProperty;
|
|
2
|
+
var ni = (o, t, n) => t in o ? si(o, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[t] = n;
|
|
3
|
+
var k = (o, t, n) => ni(o, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import yt, { useState as O, useMemo as me, useEffect as M, Children as it, cloneElement as ot, useRef as ue } from "react";
|
|
5
|
+
import { ColorPicker as ai, Button as T, Dropdown as vt, Popover as ge, Divider as li, InputNumber as rt, Tooltip as F, Modal as ci, Switch as st, Input as di, Radio as L, Segmented as nt, ConfigProvider as fi, Popconfirm as pi, Drawer as ui, Slider as de, Upload as hi, message as mi } from "antd";
|
|
6
|
+
import { observer as Y } from "mobx-react-lite";
|
|
7
|
+
import { Camera as gi, Check as xi, Square as bi, Circle as wi, Slash as yi, MoveDownLeft as vi, Pencil as ji, Smile as Mi, Undo as Ci, Redo as Ai, ChevronRight as Ti, ChevronDown as Ni, ChevronUp as Si, RotateCcw as ki, ZoomIn as Ri, ZoomOut as Di, Hand as Hi, Crop as zi, FlipHorizontal2 as Ei, FlipVertical2 as Oi, Sunset as _i, Box as Yi, LayoutGrid as Ii, ImagePlus as Bi, Type as Pi, CodeXml as Wi, ClipboardPaste as Zi, ImagePlay as Gi, Maximize as Fi, ListCollapse as Li, ArrowUpRight as Ui, ArrowDownRight as Vi, ImageDown as Ji, Copy as qi, Settings2 as Xi, ChevronLeft as Qi, Pipette as $i, Trash2 as Ki, icons as at } from "lucide-react";
|
|
8
|
+
import { TinyColor as eo } from "@ctrl/tinycolor";
|
|
9
|
+
import { clsx as to } from "clsx";
|
|
10
|
+
import { twMerge as io } from "tailwind-merge";
|
|
11
|
+
import { makeAutoObservable as jt, toJS as Mt, action as oo } from "mobx";
|
|
12
|
+
import ro from "@emoji-mart/data";
|
|
13
|
+
import so from "@emoji-mart/react";
|
|
14
|
+
import { Frame as no, Image as ao, Box as lo, Rect as De, Ellipse as co, Line as lt, Text as fo, Cursor as po, App as uo, ZoomEvent as ho, ResizeEvent as mo, DragEvent as ke } from "leafer-ui";
|
|
15
|
+
import { addListener as go, removeListener as xo } from "resize-detector";
|
|
16
|
+
import { Arrow as bo } from "@leafer-in/arrow";
|
|
17
|
+
import { ScrollBar as wo } from "@leafer-in/scroll";
|
|
18
|
+
import { tinykeys as Ct } from "tinykeys";
|
|
19
|
+
import "@leafer-in/editor";
|
|
20
|
+
import "@leafer-in/view";
|
|
21
|
+
import yo from "react-cropper";
|
|
22
|
+
var fe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
23
|
+
function vo(o) {
|
|
24
|
+
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
25
|
+
}
|
|
26
|
+
var He = { exports: {} }, oe = {};
|
|
27
|
+
/**
|
|
28
|
+
* @license React
|
|
29
|
+
* react-jsx-runtime.production.min.js
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license found in the
|
|
34
|
+
* LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/
|
|
36
|
+
var ct;
|
|
37
|
+
function jo() {
|
|
38
|
+
if (ct) return oe;
|
|
39
|
+
ct = 1;
|
|
40
|
+
var o = yt, 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 };
|
|
41
|
+
function d(f, u, h) {
|
|
42
|
+
var g, y = {}, S = null, N = null;
|
|
43
|
+
h !== void 0 && (S = "" + h), u.key !== void 0 && (S = "" + u.key), u.ref !== void 0 && (N = u.ref);
|
|
44
|
+
for (g in u) s.call(u, g) && !l.hasOwnProperty(g) && (y[g] = u[g]);
|
|
45
|
+
if (f && f.defaultProps) for (g in u = f.defaultProps, u) y[g] === void 0 && (y[g] = u[g]);
|
|
46
|
+
return { $$typeof: t, type: f, key: S, ref: N, props: y, _owner: a.current };
|
|
47
|
+
}
|
|
48
|
+
return oe.Fragment = n, oe.jsx = d, oe.jsxs = d, oe;
|
|
49
|
+
}
|
|
50
|
+
var re = {};
|
|
51
|
+
/**
|
|
52
|
+
* @license React
|
|
53
|
+
* react-jsx-runtime.development.js
|
|
54
|
+
*
|
|
55
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the MIT license found in the
|
|
58
|
+
* LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/
|
|
60
|
+
var dt;
|
|
61
|
+
function Mo() {
|
|
62
|
+
return dt || (dt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
63
|
+
var o = yt, 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"), d = Symbol.for("react.provider"), f = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), N = Symbol.for("react.offscreen"), x = Symbol.iterator, v = "@@iterator";
|
|
64
|
+
function H(i) {
|
|
65
|
+
if (i === null || typeof i != "object")
|
|
66
|
+
return null;
|
|
67
|
+
var c = x && i[x] || i[v];
|
|
68
|
+
return typeof c == "function" ? c : null;
|
|
69
|
+
}
|
|
70
|
+
var _ = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
71
|
+
function E(i) {
|
|
72
|
+
{
|
|
73
|
+
for (var c = arguments.length, p = new Array(c > 1 ? c - 1 : 0), m = 1; m < c; m++)
|
|
74
|
+
p[m - 1] = arguments[m];
|
|
75
|
+
be("error", i, p);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function be(i, c, p) {
|
|
79
|
+
{
|
|
80
|
+
var m = _.ReactDebugCurrentFrame, j = m.getStackAddendum();
|
|
81
|
+
j !== "" && (c += "%s", p = p.concat([j]));
|
|
82
|
+
var C = p.map(function(w) {
|
|
83
|
+
return String(w);
|
|
84
|
+
});
|
|
85
|
+
C.unshift("Warning: " + c), Function.prototype.apply.call(console[i], console, C);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
var we = !1, $ = !1, R = !1, W = !1, U = !1, K;
|
|
89
|
+
K = Symbol.for("react.module.reference");
|
|
90
|
+
function Rt(i) {
|
|
91
|
+
return !!(typeof i == "string" || typeof i == "function" || i === s || i === l || U || i === a || i === h || i === g || W || i === N || we || $ || R || typeof i == "object" && i !== null && (i.$$typeof === S || i.$$typeof === y || i.$$typeof === d || i.$$typeof === f || i.$$typeof === u || // This needs to include all possible module reference object
|
|
92
|
+
// types supported by any Flight configuration anywhere since
|
|
93
|
+
// we don't know which Flight build this will end up being used
|
|
94
|
+
// with.
|
|
95
|
+
i.$$typeof === K || i.getModuleId !== void 0));
|
|
96
|
+
}
|
|
97
|
+
function Dt(i, c, p) {
|
|
98
|
+
var m = i.displayName;
|
|
99
|
+
if (m)
|
|
100
|
+
return m;
|
|
101
|
+
var j = c.displayName || c.name || "";
|
|
102
|
+
return j !== "" ? p + "(" + j + ")" : p;
|
|
103
|
+
}
|
|
104
|
+
function ze(i) {
|
|
105
|
+
return i.displayName || "Context";
|
|
106
|
+
}
|
|
107
|
+
function Z(i) {
|
|
108
|
+
if (i == null)
|
|
109
|
+
return null;
|
|
110
|
+
if (typeof i.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
|
|
111
|
+
return i.displayName || i.name || null;
|
|
112
|
+
if (typeof i == "string")
|
|
113
|
+
return i;
|
|
114
|
+
switch (i) {
|
|
115
|
+
case s:
|
|
116
|
+
return "Fragment";
|
|
117
|
+
case n:
|
|
118
|
+
return "Portal";
|
|
119
|
+
case l:
|
|
120
|
+
return "Profiler";
|
|
121
|
+
case a:
|
|
122
|
+
return "StrictMode";
|
|
123
|
+
case h:
|
|
124
|
+
return "Suspense";
|
|
125
|
+
case g:
|
|
126
|
+
return "SuspenseList";
|
|
127
|
+
}
|
|
128
|
+
if (typeof i == "object")
|
|
129
|
+
switch (i.$$typeof) {
|
|
130
|
+
case f:
|
|
131
|
+
var c = i;
|
|
132
|
+
return ze(c) + ".Consumer";
|
|
133
|
+
case d:
|
|
134
|
+
var p = i;
|
|
135
|
+
return ze(p._context) + ".Provider";
|
|
136
|
+
case u:
|
|
137
|
+
return Dt(i, i.render, "ForwardRef");
|
|
138
|
+
case y:
|
|
139
|
+
var m = i.displayName || null;
|
|
140
|
+
return m !== null ? m : Z(i.type) || "Memo";
|
|
141
|
+
case S: {
|
|
142
|
+
var j = i, C = j._payload, w = j._init;
|
|
143
|
+
try {
|
|
144
|
+
return Z(w(C));
|
|
145
|
+
} catch {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
var V = Object.assign, ee = 0, Ee, Oe, _e, Ye, Ie, Be, Pe;
|
|
153
|
+
function We() {
|
|
154
|
+
}
|
|
155
|
+
We.__reactDisabledLog = !0;
|
|
156
|
+
function Ht() {
|
|
157
|
+
{
|
|
158
|
+
if (ee === 0) {
|
|
159
|
+
Ee = console.log, Oe = console.info, _e = console.warn, Ye = console.error, Ie = console.group, Be = console.groupCollapsed, Pe = console.groupEnd;
|
|
160
|
+
var i = {
|
|
161
|
+
configurable: !0,
|
|
162
|
+
enumerable: !0,
|
|
163
|
+
value: We,
|
|
164
|
+
writable: !0
|
|
165
|
+
};
|
|
166
|
+
Object.defineProperties(console, {
|
|
167
|
+
info: i,
|
|
168
|
+
log: i,
|
|
169
|
+
warn: i,
|
|
170
|
+
error: i,
|
|
171
|
+
group: i,
|
|
172
|
+
groupCollapsed: i,
|
|
173
|
+
groupEnd: i
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
ee++;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
function zt() {
|
|
180
|
+
{
|
|
181
|
+
if (ee--, ee === 0) {
|
|
182
|
+
var i = {
|
|
183
|
+
configurable: !0,
|
|
184
|
+
enumerable: !0,
|
|
185
|
+
writable: !0
|
|
186
|
+
};
|
|
187
|
+
Object.defineProperties(console, {
|
|
188
|
+
log: V({}, i, {
|
|
189
|
+
value: Ee
|
|
190
|
+
}),
|
|
191
|
+
info: V({}, i, {
|
|
192
|
+
value: Oe
|
|
193
|
+
}),
|
|
194
|
+
warn: V({}, i, {
|
|
195
|
+
value: _e
|
|
196
|
+
}),
|
|
197
|
+
error: V({}, i, {
|
|
198
|
+
value: Ye
|
|
199
|
+
}),
|
|
200
|
+
group: V({}, i, {
|
|
201
|
+
value: Ie
|
|
202
|
+
}),
|
|
203
|
+
groupCollapsed: V({}, i, {
|
|
204
|
+
value: Be
|
|
205
|
+
}),
|
|
206
|
+
groupEnd: V({}, i, {
|
|
207
|
+
value: Pe
|
|
208
|
+
})
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
ee < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
var ye = _.ReactCurrentDispatcher, ve;
|
|
215
|
+
function ne(i, c, p) {
|
|
216
|
+
{
|
|
217
|
+
if (ve === void 0)
|
|
218
|
+
try {
|
|
219
|
+
throw Error();
|
|
220
|
+
} catch (j) {
|
|
221
|
+
var m = j.stack.trim().match(/\n( *(at )?)/);
|
|
222
|
+
ve = m && m[1] || "";
|
|
223
|
+
}
|
|
224
|
+
return `
|
|
225
|
+
` + ve + i;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
var je = !1, ae;
|
|
229
|
+
{
|
|
230
|
+
var Et = typeof WeakMap == "function" ? WeakMap : Map;
|
|
231
|
+
ae = new Et();
|
|
232
|
+
}
|
|
233
|
+
function Ze(i, c) {
|
|
234
|
+
if (!i || je)
|
|
235
|
+
return "";
|
|
236
|
+
{
|
|
237
|
+
var p = ae.get(i);
|
|
238
|
+
if (p !== void 0)
|
|
239
|
+
return p;
|
|
240
|
+
}
|
|
241
|
+
var m;
|
|
242
|
+
je = !0;
|
|
243
|
+
var j = Error.prepareStackTrace;
|
|
244
|
+
Error.prepareStackTrace = void 0;
|
|
245
|
+
var C;
|
|
246
|
+
C = ye.current, ye.current = null, Ht();
|
|
247
|
+
try {
|
|
248
|
+
if (c) {
|
|
249
|
+
var w = function() {
|
|
250
|
+
throw Error();
|
|
251
|
+
};
|
|
252
|
+
if (Object.defineProperty(w.prototype, "props", {
|
|
253
|
+
set: function() {
|
|
254
|
+
throw Error();
|
|
255
|
+
}
|
|
256
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
257
|
+
try {
|
|
258
|
+
Reflect.construct(w, []);
|
|
259
|
+
} catch (B) {
|
|
260
|
+
m = B;
|
|
261
|
+
}
|
|
262
|
+
Reflect.construct(i, [], w);
|
|
263
|
+
} else {
|
|
264
|
+
try {
|
|
265
|
+
w.call();
|
|
266
|
+
} catch (B) {
|
|
267
|
+
m = B;
|
|
268
|
+
}
|
|
269
|
+
i.call(w.prototype);
|
|
270
|
+
}
|
|
271
|
+
} else {
|
|
272
|
+
try {
|
|
273
|
+
throw Error();
|
|
274
|
+
} catch (B) {
|
|
275
|
+
m = B;
|
|
276
|
+
}
|
|
277
|
+
i();
|
|
278
|
+
}
|
|
279
|
+
} catch (B) {
|
|
280
|
+
if (B && m && typeof B.stack == "string") {
|
|
281
|
+
for (var b = B.stack.split(`
|
|
282
|
+
`), I = m.stack.split(`
|
|
283
|
+
`), D = b.length - 1, z = I.length - 1; D >= 1 && z >= 0 && b[D] !== I[z]; )
|
|
284
|
+
z--;
|
|
285
|
+
for (; D >= 1 && z >= 0; D--, z--)
|
|
286
|
+
if (b[D] !== I[z]) {
|
|
287
|
+
if (D !== 1 || z !== 1)
|
|
288
|
+
do
|
|
289
|
+
if (D--, z--, z < 0 || b[D] !== I[z]) {
|
|
290
|
+
var P = `
|
|
291
|
+
` + b[D].replace(" at new ", " at ");
|
|
292
|
+
return i.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", i.displayName)), typeof i == "function" && ae.set(i, P), P;
|
|
293
|
+
}
|
|
294
|
+
while (D >= 1 && z >= 0);
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
} finally {
|
|
299
|
+
je = !1, ye.current = C, zt(), Error.prepareStackTrace = j;
|
|
300
|
+
}
|
|
301
|
+
var X = i ? i.displayName || i.name : "", J = X ? ne(X) : "";
|
|
302
|
+
return typeof i == "function" && ae.set(i, J), J;
|
|
303
|
+
}
|
|
304
|
+
function Ot(i, c, p) {
|
|
305
|
+
return Ze(i, !1);
|
|
306
|
+
}
|
|
307
|
+
function _t(i) {
|
|
308
|
+
var c = i.prototype;
|
|
309
|
+
return !!(c && c.isReactComponent);
|
|
310
|
+
}
|
|
311
|
+
function le(i, c, p) {
|
|
312
|
+
if (i == null)
|
|
313
|
+
return "";
|
|
314
|
+
if (typeof i == "function")
|
|
315
|
+
return Ze(i, _t(i));
|
|
316
|
+
if (typeof i == "string")
|
|
317
|
+
return ne(i);
|
|
318
|
+
switch (i) {
|
|
319
|
+
case h:
|
|
320
|
+
return ne("Suspense");
|
|
321
|
+
case g:
|
|
322
|
+
return ne("SuspenseList");
|
|
323
|
+
}
|
|
324
|
+
if (typeof i == "object")
|
|
325
|
+
switch (i.$$typeof) {
|
|
326
|
+
case u:
|
|
327
|
+
return Ot(i.render);
|
|
328
|
+
case y:
|
|
329
|
+
return le(i.type, c, p);
|
|
330
|
+
case S: {
|
|
331
|
+
var m = i, j = m._payload, C = m._init;
|
|
332
|
+
try {
|
|
333
|
+
return le(C(j), c, p);
|
|
334
|
+
} catch {
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return "";
|
|
339
|
+
}
|
|
340
|
+
var te = Object.prototype.hasOwnProperty, Ge = {}, Fe = _.ReactDebugCurrentFrame;
|
|
341
|
+
function ce(i) {
|
|
342
|
+
if (i) {
|
|
343
|
+
var c = i._owner, p = le(i.type, i._source, c ? c.type : null);
|
|
344
|
+
Fe.setExtraStackFrame(p);
|
|
345
|
+
} else
|
|
346
|
+
Fe.setExtraStackFrame(null);
|
|
347
|
+
}
|
|
348
|
+
function Yt(i, c, p, m, j) {
|
|
349
|
+
{
|
|
350
|
+
var C = Function.call.bind(te);
|
|
351
|
+
for (var w in i)
|
|
352
|
+
if (C(i, w)) {
|
|
353
|
+
var b = void 0;
|
|
354
|
+
try {
|
|
355
|
+
if (typeof i[w] != "function") {
|
|
356
|
+
var I = Error((m || "React class") + ": " + p + " type `" + w + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[w] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
357
|
+
throw I.name = "Invariant Violation", I;
|
|
358
|
+
}
|
|
359
|
+
b = i[w](c, w, m, p, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
360
|
+
} catch (D) {
|
|
361
|
+
b = D;
|
|
362
|
+
}
|
|
363
|
+
b && !(b instanceof Error) && (ce(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).", m || "React class", p, w, typeof b), ce(null)), b instanceof Error && !(b.message in Ge) && (Ge[b.message] = !0, ce(j), E("Failed %s type: %s", p, b.message), ce(null));
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
var It = Array.isArray;
|
|
368
|
+
function Me(i) {
|
|
369
|
+
return It(i);
|
|
370
|
+
}
|
|
371
|
+
function Bt(i) {
|
|
372
|
+
{
|
|
373
|
+
var c = typeof Symbol == "function" && Symbol.toStringTag, p = c && i[Symbol.toStringTag] || i.constructor.name || "Object";
|
|
374
|
+
return p;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function Pt(i) {
|
|
378
|
+
try {
|
|
379
|
+
return Le(i), !1;
|
|
380
|
+
} catch {
|
|
381
|
+
return !0;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
function Le(i) {
|
|
385
|
+
return "" + i;
|
|
386
|
+
}
|
|
387
|
+
function Ue(i) {
|
|
388
|
+
if (Pt(i))
|
|
389
|
+
return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Bt(i)), Le(i);
|
|
390
|
+
}
|
|
391
|
+
var ie = _.ReactCurrentOwner, Wt = {
|
|
392
|
+
key: !0,
|
|
393
|
+
ref: !0,
|
|
394
|
+
__self: !0,
|
|
395
|
+
__source: !0
|
|
396
|
+
}, Ve, Je, Ce;
|
|
397
|
+
Ce = {};
|
|
398
|
+
function Zt(i) {
|
|
399
|
+
if (te.call(i, "ref")) {
|
|
400
|
+
var c = Object.getOwnPropertyDescriptor(i, "ref").get;
|
|
401
|
+
if (c && c.isReactWarning)
|
|
402
|
+
return !1;
|
|
403
|
+
}
|
|
404
|
+
return i.ref !== void 0;
|
|
405
|
+
}
|
|
406
|
+
function Gt(i) {
|
|
407
|
+
if (te.call(i, "key")) {
|
|
408
|
+
var c = Object.getOwnPropertyDescriptor(i, "key").get;
|
|
409
|
+
if (c && c.isReactWarning)
|
|
410
|
+
return !1;
|
|
411
|
+
}
|
|
412
|
+
return i.key !== void 0;
|
|
413
|
+
}
|
|
414
|
+
function Ft(i, c) {
|
|
415
|
+
if (typeof i.ref == "string" && ie.current && c && ie.current.stateNode !== c) {
|
|
416
|
+
var p = Z(ie.current.type);
|
|
417
|
+
Ce[p] || (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', Z(ie.current.type), i.ref), Ce[p] = !0);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
function Lt(i, c) {
|
|
421
|
+
{
|
|
422
|
+
var p = function() {
|
|
423
|
+
Ve || (Ve = !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
|
+
};
|
|
425
|
+
p.isReactWarning = !0, Object.defineProperty(i, "key", {
|
|
426
|
+
get: p,
|
|
427
|
+
configurable: !0
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
function Ut(i, c) {
|
|
432
|
+
{
|
|
433
|
+
var p = function() {
|
|
434
|
+
Je || (Je = !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
|
+
};
|
|
436
|
+
p.isReactWarning = !0, Object.defineProperty(i, "ref", {
|
|
437
|
+
get: p,
|
|
438
|
+
configurable: !0
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
var Vt = function(i, c, p, m, j, C, w) {
|
|
443
|
+
var b = {
|
|
444
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
445
|
+
$$typeof: t,
|
|
446
|
+
// Built-in properties that belong on the element
|
|
447
|
+
type: i,
|
|
448
|
+
key: c,
|
|
449
|
+
ref: p,
|
|
450
|
+
props: w,
|
|
451
|
+
// Record the component responsible for creating this element.
|
|
452
|
+
_owner: C
|
|
453
|
+
};
|
|
454
|
+
return b._store = {}, Object.defineProperty(b._store, "validated", {
|
|
455
|
+
configurable: !1,
|
|
456
|
+
enumerable: !1,
|
|
457
|
+
writable: !0,
|
|
458
|
+
value: !1
|
|
459
|
+
}), Object.defineProperty(b, "_self", {
|
|
460
|
+
configurable: !1,
|
|
461
|
+
enumerable: !1,
|
|
462
|
+
writable: !1,
|
|
463
|
+
value: m
|
|
464
|
+
}), Object.defineProperty(b, "_source", {
|
|
465
|
+
configurable: !1,
|
|
466
|
+
enumerable: !1,
|
|
467
|
+
writable: !1,
|
|
468
|
+
value: j
|
|
469
|
+
}), Object.freeze && (Object.freeze(b.props), Object.freeze(b)), b;
|
|
470
|
+
};
|
|
471
|
+
function Jt(i, c, p, m, j) {
|
|
472
|
+
{
|
|
473
|
+
var C, w = {}, b = null, I = null;
|
|
474
|
+
p !== void 0 && (Ue(p), b = "" + p), Gt(c) && (Ue(c.key), b = "" + c.key), Zt(c) && (I = c.ref, Ft(c, j));
|
|
475
|
+
for (C in c)
|
|
476
|
+
te.call(c, C) && !Wt.hasOwnProperty(C) && (w[C] = c[C]);
|
|
477
|
+
if (i && i.defaultProps) {
|
|
478
|
+
var D = i.defaultProps;
|
|
479
|
+
for (C in D)
|
|
480
|
+
w[C] === void 0 && (w[C] = D[C]);
|
|
481
|
+
}
|
|
482
|
+
if (b || I) {
|
|
483
|
+
var z = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
|
|
484
|
+
b && Lt(w, z), I && Ut(w, z);
|
|
485
|
+
}
|
|
486
|
+
return Vt(i, b, I, j, m, ie.current, w);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
var Ae = _.ReactCurrentOwner, qe = _.ReactDebugCurrentFrame;
|
|
490
|
+
function q(i) {
|
|
491
|
+
if (i) {
|
|
492
|
+
var c = i._owner, p = le(i.type, i._source, c ? c.type : null);
|
|
493
|
+
qe.setExtraStackFrame(p);
|
|
494
|
+
} else
|
|
495
|
+
qe.setExtraStackFrame(null);
|
|
496
|
+
}
|
|
497
|
+
var Te;
|
|
498
|
+
Te = !1;
|
|
499
|
+
function Ne(i) {
|
|
500
|
+
return typeof i == "object" && i !== null && i.$$typeof === t;
|
|
501
|
+
}
|
|
502
|
+
function Xe() {
|
|
503
|
+
{
|
|
504
|
+
if (Ae.current) {
|
|
505
|
+
var i = Z(Ae.current.type);
|
|
506
|
+
if (i)
|
|
507
|
+
return `
|
|
508
|
+
|
|
509
|
+
Check the render method of \`` + i + "`.";
|
|
510
|
+
}
|
|
511
|
+
return "";
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
function qt(i) {
|
|
515
|
+
return "";
|
|
516
|
+
}
|
|
517
|
+
var Qe = {};
|
|
518
|
+
function Xt(i) {
|
|
519
|
+
{
|
|
520
|
+
var c = Xe();
|
|
521
|
+
if (!c) {
|
|
522
|
+
var p = typeof i == "string" ? i : i.displayName || i.name;
|
|
523
|
+
p && (c = `
|
|
524
|
+
|
|
525
|
+
Check the top-level render call using <` + p + ">.");
|
|
526
|
+
}
|
|
527
|
+
return c;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
function $e(i, c) {
|
|
531
|
+
{
|
|
532
|
+
if (!i._store || i._store.validated || i.key != null)
|
|
533
|
+
return;
|
|
534
|
+
i._store.validated = !0;
|
|
535
|
+
var p = Xt(c);
|
|
536
|
+
if (Qe[p])
|
|
537
|
+
return;
|
|
538
|
+
Qe[p] = !0;
|
|
539
|
+
var m = "";
|
|
540
|
+
i && i._owner && i._owner !== Ae.current && (m = " It was passed a child from " + Z(i._owner.type) + "."), q(i), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', p, m), q(null);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
function Ke(i, c) {
|
|
544
|
+
{
|
|
545
|
+
if (typeof i != "object")
|
|
546
|
+
return;
|
|
547
|
+
if (Me(i))
|
|
548
|
+
for (var p = 0; p < i.length; p++) {
|
|
549
|
+
var m = i[p];
|
|
550
|
+
Ne(m) && $e(m, c);
|
|
551
|
+
}
|
|
552
|
+
else if (Ne(i))
|
|
553
|
+
i._store && (i._store.validated = !0);
|
|
554
|
+
else if (i) {
|
|
555
|
+
var j = H(i);
|
|
556
|
+
if (typeof j == "function" && j !== i.entries)
|
|
557
|
+
for (var C = j.call(i), w; !(w = C.next()).done; )
|
|
558
|
+
Ne(w.value) && $e(w.value, c);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
function Qt(i) {
|
|
563
|
+
{
|
|
564
|
+
var c = i.type;
|
|
565
|
+
if (c == null || typeof c == "string")
|
|
566
|
+
return;
|
|
567
|
+
var p;
|
|
568
|
+
if (typeof c == "function")
|
|
569
|
+
p = c.propTypes;
|
|
570
|
+
else if (typeof c == "object" && (c.$$typeof === u || // Note: Memo only checks outer props here.
|
|
571
|
+
// Inner props are checked in the reconciler.
|
|
572
|
+
c.$$typeof === y))
|
|
573
|
+
p = c.propTypes;
|
|
574
|
+
else
|
|
575
|
+
return;
|
|
576
|
+
if (p) {
|
|
577
|
+
var m = Z(c);
|
|
578
|
+
Yt(p, i.props, "prop", m, i);
|
|
579
|
+
} else if (c.PropTypes !== void 0 && !Te) {
|
|
580
|
+
Te = !0;
|
|
581
|
+
var j = Z(c);
|
|
582
|
+
E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
|
|
583
|
+
}
|
|
584
|
+
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
|
+
}
|
|
586
|
+
}
|
|
587
|
+
function $t(i) {
|
|
588
|
+
{
|
|
589
|
+
for (var c = Object.keys(i.props), p = 0; p < c.length; p++) {
|
|
590
|
+
var m = c[p];
|
|
591
|
+
if (m !== "children" && m !== "key") {
|
|
592
|
+
q(i), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", m), q(null);
|
|
593
|
+
break;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
i.ref !== null && (q(i), E("Invalid attribute `ref` supplied to `React.Fragment`."), q(null));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
var et = {};
|
|
600
|
+
function tt(i, c, p, m, j, C) {
|
|
601
|
+
{
|
|
602
|
+
var w = Rt(i);
|
|
603
|
+
if (!w) {
|
|
604
|
+
var b = "";
|
|
605
|
+
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (b += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
606
|
+
var I = qt();
|
|
607
|
+
I ? b += I : b += Xe();
|
|
608
|
+
var D;
|
|
609
|
+
i === null ? D = "null" : Me(i) ? D = "array" : i !== void 0 && i.$$typeof === t ? (D = "<" + (Z(i.type) || "Unknown") + " />", b = " Did you accidentally export a JSX literal instead of a component?") : D = typeof i, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", D, b);
|
|
610
|
+
}
|
|
611
|
+
var z = Jt(i, c, p, j, C);
|
|
612
|
+
if (z == null)
|
|
613
|
+
return z;
|
|
614
|
+
if (w) {
|
|
615
|
+
var P = c.children;
|
|
616
|
+
if (P !== void 0)
|
|
617
|
+
if (m)
|
|
618
|
+
if (Me(P)) {
|
|
619
|
+
for (var X = 0; X < P.length; X++)
|
|
620
|
+
Ke(P[X], i);
|
|
621
|
+
Object.freeze && Object.freeze(P);
|
|
622
|
+
} else
|
|
623
|
+
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
|
+
else
|
|
625
|
+
Ke(P, i);
|
|
626
|
+
}
|
|
627
|
+
if (te.call(c, "key")) {
|
|
628
|
+
var J = Z(i), B = Object.keys(c).filter(function(ri) {
|
|
629
|
+
return ri !== "key";
|
|
630
|
+
}), Se = B.length > 0 ? "{key: someKey, " + B.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
631
|
+
if (!et[J + Se]) {
|
|
632
|
+
var oi = B.length > 0 ? "{" + B.join(": ..., ") + ": ...}" : "{}";
|
|
633
|
+
E(`A props object containing a "key" prop is being spread into JSX:
|
|
634
|
+
let props = %s;
|
|
635
|
+
<%s {...props} />
|
|
636
|
+
React keys must be passed directly to JSX without using spread:
|
|
637
|
+
let props = %s;
|
|
638
|
+
<%s key={someKey} {...props} />`, Se, J, oi, J), et[J + Se] = !0;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
return i === s ? $t(z) : Qt(z), z;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
function Kt(i, c, p) {
|
|
645
|
+
return tt(i, c, p, !0);
|
|
646
|
+
}
|
|
647
|
+
function ei(i, c, p) {
|
|
648
|
+
return tt(i, c, p, !1);
|
|
649
|
+
}
|
|
650
|
+
var ti = ei, ii = Kt;
|
|
651
|
+
re.Fragment = s, re.jsx = ti, re.jsxs = ii;
|
|
652
|
+
}()), re;
|
|
653
|
+
}
|
|
654
|
+
process.env.NODE_ENV === "production" ? He.exports = jo() : He.exports = Mo();
|
|
655
|
+
var e = He.exports;
|
|
656
|
+
const A = {
|
|
657
|
+
Camera: gi,
|
|
658
|
+
Check: xi,
|
|
659
|
+
Square: bi,
|
|
660
|
+
Circle: wi,
|
|
661
|
+
Slash: yi,
|
|
662
|
+
MoveDownLeft: vi,
|
|
663
|
+
Pencil: ji,
|
|
664
|
+
Smile: Mi,
|
|
665
|
+
Undo: Ci,
|
|
666
|
+
Redo: Ai,
|
|
667
|
+
ChevronRight: Ti,
|
|
668
|
+
ChevronDown: Ni,
|
|
669
|
+
ChevronUp: Si,
|
|
670
|
+
RotateCcw: ki,
|
|
671
|
+
ZoomIn: Ri,
|
|
672
|
+
ZoomOut: Di,
|
|
673
|
+
Hand: Hi,
|
|
674
|
+
Crop: zi,
|
|
675
|
+
FlipHorizontal2: Ei,
|
|
676
|
+
FlipVertical2: Oi,
|
|
677
|
+
Sunset: _i,
|
|
678
|
+
Box: Yi,
|
|
679
|
+
LayoutGrid: Ii,
|
|
680
|
+
ImagePlus: Bi,
|
|
681
|
+
Type: Pi,
|
|
682
|
+
CodeXml: Wi,
|
|
683
|
+
ClipboardPaste: Zi,
|
|
684
|
+
ImagePlay: Gi,
|
|
685
|
+
Maximize: Fi,
|
|
686
|
+
ListCollapse: Li,
|
|
687
|
+
ArrowUpRight: Ui,
|
|
688
|
+
ArrowDownRight: Vi,
|
|
689
|
+
ImageDown: Ji,
|
|
690
|
+
Copy: qi,
|
|
691
|
+
Settings2: Xi,
|
|
692
|
+
ChevronLeft: Qi,
|
|
693
|
+
Pipette: $i,
|
|
694
|
+
Trash2: Ki
|
|
695
|
+
}, xe = (o) => {
|
|
696
|
+
const t = () => {
|
|
697
|
+
if (!window.EyeDropper) return;
|
|
698
|
+
new EyeDropper().open().then((s) => {
|
|
699
|
+
const a = s.sRGBHex;
|
|
700
|
+
o != null && o.onChange && o.onChange(new eo(a));
|
|
701
|
+
}).catch((s) => {
|
|
702
|
+
console.log(s);
|
|
703
|
+
});
|
|
704
|
+
};
|
|
705
|
+
return /* @__PURE__ */ e.jsx(
|
|
706
|
+
ai,
|
|
707
|
+
{
|
|
708
|
+
...o,
|
|
709
|
+
panelRender: (n) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
710
|
+
window.EyeDropper && /* @__PURE__ */ e.jsx("div", { className: "mb-1", children: /* @__PURE__ */ e.jsx(T, { type: "text", shape: "circle", size: "small", icon: /* @__PURE__ */ e.jsx(A.Pipette, { size: 16 }), onClick: t }) }),
|
|
711
|
+
n
|
|
712
|
+
] })
|
|
713
|
+
}
|
|
714
|
+
);
|
|
715
|
+
}, Co = [
|
|
716
|
+
{
|
|
717
|
+
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
|
+
key: 1
|
|
719
|
+
},
|
|
720
|
+
{
|
|
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-[2px]" }) }),
|
|
722
|
+
key: 2
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
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-[4px]" }) }),
|
|
726
|
+
key: 4
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
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-[6px]" }) }),
|
|
730
|
+
key: 6
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
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
|
+
key: 8
|
|
735
|
+
}
|
|
736
|
+
], Ao = ({ defaultValue: o, onChange: t }) => {
|
|
737
|
+
const n = ({ key: s }) => {
|
|
738
|
+
t(s);
|
|
739
|
+
};
|
|
740
|
+
return /* @__PURE__ */ e.jsx(
|
|
741
|
+
vt,
|
|
742
|
+
{
|
|
743
|
+
menu: { items: Co, onClick: n, selectedKeys: [o] },
|
|
744
|
+
trigger: ["click"],
|
|
745
|
+
placement: "bottom",
|
|
746
|
+
children: /* @__PURE__ */ e.jsx(
|
|
747
|
+
T,
|
|
748
|
+
{
|
|
749
|
+
type: "text",
|
|
750
|
+
shape: "circle",
|
|
751
|
+
className: "px-1.5 py-0 flex items-center justify-center",
|
|
752
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "w-4 h-4 flex items-center cursor-pointer", children: /* @__PURE__ */ e.jsx(
|
|
753
|
+
"i",
|
|
754
|
+
{
|
|
755
|
+
className: "block w-full origin-center rounded-lg bg-slate-600 -rotate-45",
|
|
756
|
+
style: {
|
|
757
|
+
height: o + "px"
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
) })
|
|
761
|
+
}
|
|
762
|
+
)
|
|
763
|
+
}
|
|
764
|
+
);
|
|
765
|
+
};
|
|
766
|
+
let To = (o, t = 21) => (n = t) => {
|
|
767
|
+
let s = "", a = n;
|
|
768
|
+
for (; a--; )
|
|
769
|
+
s += o[Math.random() * o.length | 0];
|
|
770
|
+
return s;
|
|
771
|
+
};
|
|
772
|
+
const No = () => {
|
|
773
|
+
const o = typeof navigator == "object" ? navigator.platform : "";
|
|
774
|
+
return /Mac|iPod|iPhone|iPad/.test(o);
|
|
775
|
+
}, ft = No() ? "⌘" : "Ctrl", At = [
|
|
776
|
+
"image/jpeg",
|
|
777
|
+
"image/png",
|
|
778
|
+
"image/bmp",
|
|
779
|
+
"image/gif",
|
|
780
|
+
"image/webp"
|
|
781
|
+
];
|
|
782
|
+
function G(...o) {
|
|
783
|
+
return io(to(o));
|
|
784
|
+
}
|
|
785
|
+
const he = To(
|
|
786
|
+
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
787
|
+
7
|
|
788
|
+
), So = (o, t) => {
|
|
789
|
+
let n = document.createElement("a");
|
|
790
|
+
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
|
+
}, ko = (o, t, n = 950, s = 450) => {
|
|
792
|
+
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
|
+
}, Ro = (o) => {
|
|
795
|
+
const t = new Image();
|
|
796
|
+
return o.startsWith("data") || (t.crossOrigin = "Anonymous"), new Promise(function(n, s) {
|
|
797
|
+
t.onload = function() {
|
|
798
|
+
n(t);
|
|
799
|
+
};
|
|
800
|
+
const a = function() {
|
|
801
|
+
return s(
|
|
802
|
+
new Error("An error occurred attempting to load image")
|
|
803
|
+
);
|
|
804
|
+
};
|
|
805
|
+
t.onerror = a, t.onabort = a, t.src = o;
|
|
806
|
+
});
|
|
807
|
+
}, Do = (o, t, n) => o === "top-left" ? {
|
|
808
|
+
x: 0,
|
|
809
|
+
y: 0
|
|
810
|
+
} : o === "top" ? {
|
|
811
|
+
x: t / 2,
|
|
812
|
+
y: 0
|
|
813
|
+
} : o === "top-right" ? {
|
|
814
|
+
x: t,
|
|
815
|
+
y: 0
|
|
816
|
+
} : o === "left" ? {
|
|
817
|
+
x: 0,
|
|
818
|
+
y: n / 2
|
|
819
|
+
} : o === "right" ? {
|
|
820
|
+
x: t,
|
|
821
|
+
y: n / 2
|
|
822
|
+
} : o === "bottom-left" ? {
|
|
823
|
+
x: 0,
|
|
824
|
+
y: n
|
|
825
|
+
} : o === "bottom" ? {
|
|
826
|
+
x: t / 2,
|
|
827
|
+
y: n
|
|
828
|
+
} : o === "bottom-right" ? {
|
|
829
|
+
x: t,
|
|
830
|
+
y: n
|
|
831
|
+
} : { x: t / 2, y: n / 2 }, Ho = (o, t, n) => {
|
|
832
|
+
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
|
+
return {
|
|
834
|
+
width: Math.round(a),
|
|
835
|
+
height: Math.round(l)
|
|
836
|
+
};
|
|
837
|
+
}, zo = ({ text: o, color: t, angleDegrees: n }) => {
|
|
838
|
+
const s = document.createElement("div");
|
|
839
|
+
s.style = `text-align:center;white-space:nowrap;line-height:100px;transform: rotate(${n}deg);position: absolute;top:0;left:0;opacity: 0;`;
|
|
840
|
+
const a = document.createElement("span");
|
|
841
|
+
a.style.color = t, a.style.fontSize = "36px", a.innerText = o, s.append(a), document.body.append(s);
|
|
842
|
+
const { width: l, height: d } = s.getBoundingClientRect();
|
|
843
|
+
document.body.removeChild(s);
|
|
844
|
+
const f = Ho(l, d, n), u = `
|
|
845
|
+
<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
|
+
<span style="color:${t};font-size:36px;">${o}</span>
|
|
847
|
+
</div>
|
|
848
|
+
`, h = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${f.width} ${f.height}" width="${f.width}" height="${f.height}">
|
|
849
|
+
<foreignObject width="100%" height="100%">
|
|
850
|
+
${u}
|
|
851
|
+
</foreignObject>
|
|
852
|
+
</svg>`, g = new Blob([h], { type: "image/svg+xml;charset=utf-8" });
|
|
853
|
+
return (window.URL || window.webkitURL || window).createObjectURL(g);
|
|
854
|
+
};
|
|
855
|
+
let pt, Eo = class {
|
|
856
|
+
constructor() {
|
|
857
|
+
k(this, "img", {});
|
|
858
|
+
k(this, "invalid", !1);
|
|
859
|
+
k(this, "app", null);
|
|
860
|
+
k(this, "scale", 100);
|
|
861
|
+
k(this, "useTool", null);
|
|
862
|
+
k(this, "annotateColor", "#ff0000");
|
|
863
|
+
k(this, "strokeWidth", 4);
|
|
864
|
+
k(this, "shapes", /* @__PURE__ */ new Map());
|
|
865
|
+
k(this, "message", null);
|
|
866
|
+
jt(this);
|
|
867
|
+
}
|
|
868
|
+
get shapesList() {
|
|
869
|
+
return Array.from(Mt(this.shapes).values());
|
|
870
|
+
}
|
|
871
|
+
get cursor() {
|
|
872
|
+
return this.useTool === "Pencil" ? "pencil" : this.useTool ? "crosshair" : "auto";
|
|
873
|
+
}
|
|
874
|
+
get isEditing() {
|
|
875
|
+
var n;
|
|
876
|
+
const t = !!((n = this.app) != null && n.tree);
|
|
877
|
+
return t || (this.message.info("Please add a image"), this.setInvalid()), t;
|
|
878
|
+
}
|
|
879
|
+
setInvalid() {
|
|
880
|
+
clearTimeout(pt), this.invalid = !0, pt = setTimeout(oo(() => {
|
|
881
|
+
this.invalid = !1;
|
|
882
|
+
}), 200);
|
|
883
|
+
}
|
|
884
|
+
setImg(t) {
|
|
885
|
+
this.img = t;
|
|
886
|
+
}
|
|
887
|
+
setMessage(t) {
|
|
888
|
+
this.message = t;
|
|
889
|
+
}
|
|
890
|
+
getShape(t) {
|
|
891
|
+
return this.shapes.get(t);
|
|
892
|
+
}
|
|
893
|
+
addShape(t) {
|
|
894
|
+
this.shapes.set(t.id, t);
|
|
895
|
+
}
|
|
896
|
+
removeShape(t) {
|
|
897
|
+
this.shapes.delete(t.id);
|
|
898
|
+
}
|
|
899
|
+
setApp(t) {
|
|
900
|
+
this.app = t;
|
|
901
|
+
}
|
|
902
|
+
setScale(t) {
|
|
903
|
+
this.scale = parseInt(t * 100);
|
|
904
|
+
}
|
|
905
|
+
setUseTool(t) {
|
|
906
|
+
this.useTool = t, t ? this.setSelect(!1) : this.setSelect(!0);
|
|
907
|
+
}
|
|
908
|
+
setSelect(t) {
|
|
909
|
+
this.app && (this.app.editor.app.config.move.drag = !1, this.app.editor.hittable = t);
|
|
910
|
+
}
|
|
911
|
+
setAnnotateColor(t) {
|
|
912
|
+
this.annotateColor = t;
|
|
913
|
+
}
|
|
914
|
+
setStrokeWidth(t) {
|
|
915
|
+
this.strokeWidth = t;
|
|
916
|
+
}
|
|
917
|
+
clearImg() {
|
|
918
|
+
this.img = {};
|
|
919
|
+
}
|
|
920
|
+
destroy() {
|
|
921
|
+
var t;
|
|
922
|
+
(t = this.app) == null || t.destroy(), this.app = null;
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
const Oo = new Eo(), Q = {
|
|
926
|
+
default_1: {
|
|
927
|
+
class: "bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500",
|
|
928
|
+
fill: {
|
|
929
|
+
type: "linear",
|
|
930
|
+
from: "left",
|
|
931
|
+
to: "right",
|
|
932
|
+
stops: ["#6366f1", "#a855f7", "#ec4899"]
|
|
933
|
+
}
|
|
934
|
+
},
|
|
935
|
+
default_2: {
|
|
936
|
+
class: "bg-gradient-to-r from-red-500 via-pink-500 to-violet-500",
|
|
937
|
+
fill: {
|
|
938
|
+
type: "linear",
|
|
939
|
+
from: "left",
|
|
940
|
+
to: "right",
|
|
941
|
+
stops: ["#ef4444", "#ec4899", "#8b5cf6"]
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
default_3: {
|
|
945
|
+
class: "bg-gradient-to-r from-violet-800 via-pink-600 to-orange-500",
|
|
946
|
+
fill: {
|
|
947
|
+
type: "linear",
|
|
948
|
+
from: "left",
|
|
949
|
+
to: "right",
|
|
950
|
+
stops: ["#5b21b6", "#db2777", "#f97316"]
|
|
951
|
+
}
|
|
952
|
+
},
|
|
953
|
+
default_4: {
|
|
954
|
+
class: "bg-gradient-to-r from-orange-400 to-rose-400",
|
|
955
|
+
fill: {
|
|
956
|
+
type: "linear",
|
|
957
|
+
from: "left",
|
|
958
|
+
to: "right",
|
|
959
|
+
stops: ["#fb923c", "#fb7185"]
|
|
960
|
+
}
|
|
961
|
+
},
|
|
962
|
+
default_5: {
|
|
963
|
+
class: "bg-gradient-to-r from-[#4284DB] to-[#29EAC4]",
|
|
964
|
+
fill: {
|
|
965
|
+
type: "linear",
|
|
966
|
+
from: "left",
|
|
967
|
+
to: "right",
|
|
968
|
+
stops: ["#4284DB", "#29EAC4"]
|
|
969
|
+
}
|
|
970
|
+
},
|
|
971
|
+
default_6: {
|
|
972
|
+
class: "bg-gradient-to-r from-[#fc00ff] to-[#00dbde]",
|
|
973
|
+
fill: {
|
|
974
|
+
type: "linear",
|
|
975
|
+
from: "left",
|
|
976
|
+
to: "right",
|
|
977
|
+
stops: ["#fc00ff", "#00dbde"]
|
|
978
|
+
}
|
|
979
|
+
},
|
|
980
|
+
default_7: {
|
|
981
|
+
class: "bg-gradient-to-br from-[#eeddf3] via-[#ee92b1] to-[#6330b4]",
|
|
982
|
+
fill: {
|
|
983
|
+
type: "linear",
|
|
984
|
+
from: "left",
|
|
985
|
+
to: "right",
|
|
986
|
+
stops: ["#eeddf3", "#ee92b1", "#6330b4"]
|
|
987
|
+
}
|
|
988
|
+
},
|
|
989
|
+
solid_1: {
|
|
990
|
+
class: "bg-transparent",
|
|
991
|
+
fill: {
|
|
992
|
+
type: "solid",
|
|
993
|
+
color: "#ffffff00"
|
|
994
|
+
}
|
|
995
|
+
},
|
|
996
|
+
solid_2: {
|
|
997
|
+
class: "bg-slate-400",
|
|
998
|
+
fill: {
|
|
999
|
+
type: "solid",
|
|
1000
|
+
color: "#94a3b8"
|
|
1001
|
+
}
|
|
1002
|
+
},
|
|
1003
|
+
solid_3: {
|
|
1004
|
+
class: "bg-gray-400",
|
|
1005
|
+
fill: {
|
|
1006
|
+
type: "solid",
|
|
1007
|
+
color: "#9ca3af"
|
|
1008
|
+
}
|
|
1009
|
+
},
|
|
1010
|
+
solid_4: {
|
|
1011
|
+
class: "bg-stone-400",
|
|
1012
|
+
fill: {
|
|
1013
|
+
type: "solid",
|
|
1014
|
+
color: "#a8a29e"
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
solid_5: {
|
|
1018
|
+
class: "bg-red-400",
|
|
1019
|
+
fill: {
|
|
1020
|
+
type: "solid",
|
|
1021
|
+
color: "#f87171"
|
|
1022
|
+
}
|
|
1023
|
+
},
|
|
1024
|
+
solid_6: {
|
|
1025
|
+
class: "bg-orange-400",
|
|
1026
|
+
fill: {
|
|
1027
|
+
type: "solid",
|
|
1028
|
+
color: "#fb923c"
|
|
1029
|
+
}
|
|
1030
|
+
},
|
|
1031
|
+
solid_7: {
|
|
1032
|
+
class: "bg-amber-400",
|
|
1033
|
+
fill: {
|
|
1034
|
+
type: "solid",
|
|
1035
|
+
color: "#facc15"
|
|
1036
|
+
}
|
|
1037
|
+
},
|
|
1038
|
+
solid_8: {
|
|
1039
|
+
class: "bg-yellow-400",
|
|
1040
|
+
fill: {
|
|
1041
|
+
type: "solid",
|
|
1042
|
+
color: "#fbbf24"
|
|
1043
|
+
}
|
|
1044
|
+
},
|
|
1045
|
+
solid_9: {
|
|
1046
|
+
class: "bg-lime-400",
|
|
1047
|
+
fill: {
|
|
1048
|
+
type: "solid",
|
|
1049
|
+
color: "#a3e635"
|
|
1050
|
+
}
|
|
1051
|
+
},
|
|
1052
|
+
solid_10: {
|
|
1053
|
+
class: "bg-green-400",
|
|
1054
|
+
fill: {
|
|
1055
|
+
type: "solid",
|
|
1056
|
+
color: "#4ade80"
|
|
1057
|
+
}
|
|
1058
|
+
},
|
|
1059
|
+
solid_11: {
|
|
1060
|
+
class: "bg-emerald-400",
|
|
1061
|
+
fill: {
|
|
1062
|
+
type: "solid",
|
|
1063
|
+
color: "#34d399"
|
|
1064
|
+
}
|
|
1065
|
+
},
|
|
1066
|
+
solid_12: {
|
|
1067
|
+
class: "bg-teal-400",
|
|
1068
|
+
fill: {
|
|
1069
|
+
type: "solid",
|
|
1070
|
+
color: "#2dd4bf"
|
|
1071
|
+
}
|
|
1072
|
+
},
|
|
1073
|
+
solid_13: {
|
|
1074
|
+
class: "bg-cyan-400",
|
|
1075
|
+
fill: {
|
|
1076
|
+
type: "solid",
|
|
1077
|
+
color: "#22d3ee"
|
|
1078
|
+
}
|
|
1079
|
+
},
|
|
1080
|
+
solid_14: {
|
|
1081
|
+
class: "bg-sky-400",
|
|
1082
|
+
fill: {
|
|
1083
|
+
type: "solid",
|
|
1084
|
+
color: "#38bdf8"
|
|
1085
|
+
}
|
|
1086
|
+
},
|
|
1087
|
+
solid_15: {
|
|
1088
|
+
class: "bg-blue-400",
|
|
1089
|
+
fill: {
|
|
1090
|
+
type: "solid",
|
|
1091
|
+
color: "#60a5fa"
|
|
1092
|
+
}
|
|
1093
|
+
},
|
|
1094
|
+
solid_16: {
|
|
1095
|
+
class: "bg-indigo-400",
|
|
1096
|
+
fill: {
|
|
1097
|
+
type: "solid",
|
|
1098
|
+
color: "#818cf8"
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1101
|
+
solid_17: {
|
|
1102
|
+
class: "bg-violet-400",
|
|
1103
|
+
fill: {
|
|
1104
|
+
type: "solid",
|
|
1105
|
+
color: "#a78bfa"
|
|
1106
|
+
}
|
|
1107
|
+
},
|
|
1108
|
+
solid_18: {
|
|
1109
|
+
class: "bg-purple-400",
|
|
1110
|
+
fill: {
|
|
1111
|
+
type: "solid",
|
|
1112
|
+
color: "#c084fc"
|
|
1113
|
+
}
|
|
1114
|
+
},
|
|
1115
|
+
solid_19: {
|
|
1116
|
+
class: "bg-fuchsia-400",
|
|
1117
|
+
fill: {
|
|
1118
|
+
type: "solid",
|
|
1119
|
+
color: "#e879f9"
|
|
1120
|
+
}
|
|
1121
|
+
},
|
|
1122
|
+
solid_20: {
|
|
1123
|
+
class: "bg-pink-400",
|
|
1124
|
+
fill: {
|
|
1125
|
+
type: "solid",
|
|
1126
|
+
color: "#f472b6"
|
|
1127
|
+
}
|
|
1128
|
+
},
|
|
1129
|
+
solid_21: {
|
|
1130
|
+
class: "bg-rose-400",
|
|
1131
|
+
fill: {
|
|
1132
|
+
type: "solid",
|
|
1133
|
+
color: "#fb7185"
|
|
1134
|
+
}
|
|
1135
|
+
},
|
|
1136
|
+
gradient_1: {
|
|
1137
|
+
class: "bg-gradient-to-br from-[#ff6432] from-12.8% via-[#ff0065] via-43.52% to-[#7b2eff] to-84.34%",
|
|
1138
|
+
fill: {
|
|
1139
|
+
type: "linear",
|
|
1140
|
+
from: "top-left",
|
|
1141
|
+
to: "bottom-right",
|
|
1142
|
+
stops: [
|
|
1143
|
+
{ offset: 0.12, color: "#ff6432" },
|
|
1144
|
+
{ offset: 0.44, color: "#ff0065" },
|
|
1145
|
+
{ offset: 0.84, color: "#7b2eff" }
|
|
1146
|
+
]
|
|
1147
|
+
}
|
|
1148
|
+
},
|
|
1149
|
+
gradient_2: {
|
|
1150
|
+
class: "bg-gradient-to-br from-[#69eacb] from-0% via-[#eaccf8] via-48% to-[#6654f1] to-100%",
|
|
1151
|
+
fill: {
|
|
1152
|
+
type: "linear",
|
|
1153
|
+
from: "top-left",
|
|
1154
|
+
to: "bottom-right",
|
|
1155
|
+
stops: [
|
|
1156
|
+
{ offset: 0, color: "#69eacb" },
|
|
1157
|
+
{ offset: 0.48, color: "#eaccf8" },
|
|
1158
|
+
{ offset: 1, color: "#6654f1" }
|
|
1159
|
+
]
|
|
1160
|
+
}
|
|
1161
|
+
},
|
|
1162
|
+
gradient_3: {
|
|
1163
|
+
class: "bg-gradient-to-br from-[#f9f047] to-[#0fd850]",
|
|
1164
|
+
fill: {
|
|
1165
|
+
type: "linear",
|
|
1166
|
+
from: "top-left",
|
|
1167
|
+
to: "bottom-right",
|
|
1168
|
+
stops: ["#f9f047", "#0fd850"]
|
|
1169
|
+
}
|
|
1170
|
+
},
|
|
1171
|
+
cosmic_img_1: {
|
|
1172
|
+
class: "https://images.unsplash.com/photo-1579546929518-9e396f3cc809?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxfHxncmFkaWVudHxlbnwwfHx8fDE3MDMwNjAzNjh8MA&ixlib=rb-4.0.3&q=80",
|
|
1173
|
+
fill: {
|
|
1174
|
+
type: "image",
|
|
1175
|
+
url: "https://images.unsplash.com/photo-1579546929518-9e396f3cc809?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxfHxncmFkaWVudHxlbnwwfHx8fDE3MDMwNjAzNjh8MA&ixlib=rb-4.0.3&q=80"
|
|
1176
|
+
}
|
|
1177
|
+
},
|
|
1178
|
+
cosmic_img_2: {
|
|
1179
|
+
class: "https://images.unsplash.com/photo-1604076913837-52ab5629fba9?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwzfHxncmFkaWVudHxlbnwwfHx8fDE3MDMwNjAzNjh8MA&ixlib=rb-4.0.3&q=80",
|
|
1180
|
+
fill: {
|
|
1181
|
+
type: "image",
|
|
1182
|
+
url: "https://images.unsplash.com/photo-1604076913837-52ab5629fba9?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwzfHxncmFkaWVudHxlbnwwfHx8fDE3MDMwNjAzNjh8MA&ixlib=rb-4.0.3&q=80"
|
|
1183
|
+
}
|
|
1184
|
+
},
|
|
1185
|
+
cosmic_img_3: {
|
|
1186
|
+
class: "https://images.unsplash.com/photo-1553356084-58ef4a67b2a7?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxN3x8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDYwMzY4fDA&ixlib=rb-4.0.3&q=80",
|
|
1187
|
+
fill: {
|
|
1188
|
+
type: "image",
|
|
1189
|
+
url: "https://images.unsplash.com/photo-1553356084-58ef4a67b2a7?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxN3x8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDYwMzY4fDA&ixlib=rb-4.0.3&q=80"
|
|
1190
|
+
}
|
|
1191
|
+
},
|
|
1192
|
+
cosmic_img_4: {
|
|
1193
|
+
class: "https://images.unsplash.com/photo-1618397746666-63405ce5d015?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwyN3x8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDM3NjcwfDA&ixlib=rb-4.0.3&q=80",
|
|
1194
|
+
fill: {
|
|
1195
|
+
type: "image",
|
|
1196
|
+
url: "https://images.unsplash.com/photo-1618397746666-63405ce5d015?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwyN3x8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDM3NjcwfDA&ixlib=rb-4.0.3&q=80"
|
|
1197
|
+
}
|
|
1198
|
+
},
|
|
1199
|
+
cosmic_img_5: {
|
|
1200
|
+
class: "https://images.unsplash.com/photo-1579548122080-c35fd6820ecb?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwzNnx8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDM3NjcwfDA&ixlib=rb-4.0.3&q=80",
|
|
1201
|
+
fill: {
|
|
1202
|
+
type: "image",
|
|
1203
|
+
url: "https://images.unsplash.com/photo-1579548122080-c35fd6820ecb?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwzNnx8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDM3NjcwfDA&ixlib=rb-4.0.3&q=80"
|
|
1204
|
+
}
|
|
1205
|
+
},
|
|
1206
|
+
cosmic_img_6: {
|
|
1207
|
+
class: "https://images.unsplash.com/photo-1564951434112-64d74cc2a2d7?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw0Nnx8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDMyNzM1fDA&ixlib=rb-4.0.3&q=80",
|
|
1208
|
+
fill: {
|
|
1209
|
+
type: "image",
|
|
1210
|
+
url: "https://images.unsplash.com/photo-1564951434112-64d74cc2a2d7?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw0Nnx8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDMyNzM1fDA&ixlib=rb-4.0.3&q=80"
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1213
|
+
cosmic_img_7: {
|
|
1214
|
+
class: "https://images.unsplash.com/photo-1636990649778-fd699d27c875?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw1Mnx8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDMyNzM1fDA&ixlib=rb-4.0.3&q=80",
|
|
1215
|
+
fill: {
|
|
1216
|
+
type: "image",
|
|
1217
|
+
url: "https://images.unsplash.com/photo-1636990649778-fd699d27c875?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw1Mnx8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDMyNzM1fDA&ixlib=rb-4.0.3&q=80"
|
|
1218
|
+
}
|
|
1219
|
+
},
|
|
1220
|
+
cosmic_img_8: {
|
|
1221
|
+
class: "https://images.unsplash.com/photo-1640177155742-835de7b2a9a0?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw5MHx8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDU0Njg3fDA&ixlib=rb-4.0.3&q=80",
|
|
1222
|
+
fill: {
|
|
1223
|
+
type: "image",
|
|
1224
|
+
url: "https://images.unsplash.com/photo-1640177155742-835de7b2a9a0?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw5MHx8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDU0Njg3fDA&ixlib=rb-4.0.3&q=80"
|
|
1225
|
+
}
|
|
1226
|
+
},
|
|
1227
|
+
cosmic_img_9: {
|
|
1228
|
+
class: "https://images.unsplash.com/photo-1523396206913-a003efa7861b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxMTh8fGdyYWRpZW50fGVufDB8fHx8MTcwMzEyMDMzOHww&ixlib=rb-4.0.3&q=80",
|
|
1229
|
+
fill: {
|
|
1230
|
+
type: "image",
|
|
1231
|
+
url: "https://images.unsplash.com/photo-1523396206913-a003efa7861b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxMTh8fGdyYWRpZW50fGVufDB8fHx8MTcwMzEyMDMzOHww&ixlib=rb-4.0.3&q=80"
|
|
1232
|
+
}
|
|
1233
|
+
},
|
|
1234
|
+
cosmic_img_10: {
|
|
1235
|
+
class: "https://images.unsplash.com/photo-1552152370-fb05b25ff17d?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxNjJ8fGdyYWRpZW50fGVufDB8fHx8MTcwMzA3ODE5Mnww&ixlib=rb-4.0.3&q=80",
|
|
1236
|
+
fill: {
|
|
1237
|
+
type: "image",
|
|
1238
|
+
url: "https://images.unsplash.com/photo-1552152370-fb05b25ff17d?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxNjJ8fGdyYWRpZW50fGVufDB8fHx8MTcwMzA3ODE5Mnww&ixlib=rb-4.0.3&q=80"
|
|
1239
|
+
}
|
|
1240
|
+
},
|
|
1241
|
+
cosmic_img_11: {
|
|
1242
|
+
class: "https://images.unsplash.com/photo-1635776063043-ab23b4c226f6?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwyMjZ8fGdyYWRpZW50fGVufDB8fHx8MTcwMzA4MjI2NHww&ixlib=rb-4.0.3&q=80",
|
|
1243
|
+
fill: {
|
|
1244
|
+
type: "image",
|
|
1245
|
+
url: "https://images.unsplash.com/photo-1635776063043-ab23b4c226f6?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwyMjZ8fGdyYWRpZW50fGVufDB8fHx8MTcwMzA4MjI2NHww&ixlib=rb-4.0.3&q=80"
|
|
1246
|
+
}
|
|
1247
|
+
},
|
|
1248
|
+
cosmic_img_12: {
|
|
1249
|
+
class: "https://images.unsplash.com/photo-1640963269654-3fe248c5fba6?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwyNTZ8fGdyYWRpZW50fGVufDB8fHx8MTcwMzA4NDU3Nnww&ixlib=rb-4.0.3&q=80",
|
|
1250
|
+
fill: {
|
|
1251
|
+
type: "image",
|
|
1252
|
+
url: "https://images.unsplash.com/photo-1640963269654-3fe248c5fba6?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwyNTZ8fGdyYWRpZW50fGVufDB8fHx8MTcwMzA4NDU3Nnww&ixlib=rb-4.0.3&q=80"
|
|
1253
|
+
}
|
|
1254
|
+
},
|
|
1255
|
+
cosmic_img_13: {
|
|
1256
|
+
class: "https://images.unsplash.com/photo-1595131264179-84bb2f9e17b9?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwyNjh8fGdyYWRpZW50fGVufDB8fHx8MTcwMzA2NzI3OXww&ixlib=rb-4.0.3&q=80",
|
|
1257
|
+
fill: {
|
|
1258
|
+
type: "image",
|
|
1259
|
+
url: "https://images.unsplash.com/photo-1595131264179-84bb2f9e17b9?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwyNjh8fGdyYWRpZW50fGVufDB8fHx8MTcwMzA2NzI3OXww&ixlib=rb-4.0.3&q=80"
|
|
1260
|
+
}
|
|
1261
|
+
},
|
|
1262
|
+
cosmic_img_14: {
|
|
1263
|
+
class: "https://images.unsplash.com/photo-1642116876554-b17f937ee90b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxNzV8fGdyYWRpZW50fGVufDB8fHx8MTcwMzA3ODE5Mnww&ixlib=rb-4.0.3&q=80",
|
|
1264
|
+
fill: {
|
|
1265
|
+
type: "image",
|
|
1266
|
+
url: "https://images.unsplash.com/photo-1642116876554-b17f937ee90b?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHwxNzV8fGdyYWRpZW50fGVufDB8fHx8MTcwMzA3ODE5Mnww&ixlib=rb-4.0.3&q=80"
|
|
1267
|
+
}
|
|
1268
|
+
},
|
|
1269
|
+
cosmic_img_15: {
|
|
1270
|
+
class: "https://images.unsplash.com/photo-1586455122341-927f2dec0691?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw3MHx8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDQ3MjE1fDA&ixlib=rb-4.0.3&q=80",
|
|
1271
|
+
fill: {
|
|
1272
|
+
type: "image",
|
|
1273
|
+
url: "https://images.unsplash.com/photo-1586455122341-927f2dec0691?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTY5OTZ8MHwxfHNlYXJjaHw3MHx8Z3JhZGllbnR8ZW58MHx8fHwxNzAzMDQ3MjE1fDA&ixlib=rb-4.0.3&q=80"
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
desktop_img_1: {
|
|
1277
|
+
class: "https://images.unsplash.com/photo-1511860810434-a92f84c6f01e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80",
|
|
1278
|
+
fill: {
|
|
1279
|
+
type: "image",
|
|
1280
|
+
url: "https://images.unsplash.com/photo-1511860810434-a92f84c6f01e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80"
|
|
1281
|
+
}
|
|
1282
|
+
},
|
|
1283
|
+
desktop_img_2: {
|
|
1284
|
+
class: "https://images.unsplash.com/photo-1554110397-9bac083977c6?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80",
|
|
1285
|
+
fill: {
|
|
1286
|
+
type: "image",
|
|
1287
|
+
url: "https://images.unsplash.com/photo-1554110397-9bac083977c6?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80"
|
|
1288
|
+
}
|
|
1289
|
+
},
|
|
1290
|
+
desktop_img_3: {
|
|
1291
|
+
class: "https://images.unsplash.com/photo-1671180881490-8af6e9c3eaf1?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80",
|
|
1292
|
+
fill: {
|
|
1293
|
+
type: "image",
|
|
1294
|
+
url: "https://images.unsplash.com/photo-1671180881490-8af6e9c3eaf1?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80"
|
|
1295
|
+
}
|
|
1296
|
+
},
|
|
1297
|
+
desktop_img_4: {
|
|
1298
|
+
class: "https://images.unsplash.com/photo-1671549296089-88b3a6eb347e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80",
|
|
1299
|
+
fill: {
|
|
1300
|
+
type: "image",
|
|
1301
|
+
url: "https://images.unsplash.com/photo-1671549296089-88b3a6eb347e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80"
|
|
1302
|
+
}
|
|
1303
|
+
},
|
|
1304
|
+
desktop_img_5: {
|
|
1305
|
+
class: "https://images.unsplash.com/photo-1668718031554-9c05b5d03750?&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&q=80",
|
|
1306
|
+
fill: {
|
|
1307
|
+
type: "image",
|
|
1308
|
+
url: "https://images.unsplash.com/photo-1668718031554-9c05b5d03750?&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&q=80"
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
};
|
|
1312
|
+
class _o {
|
|
1313
|
+
constructor() {
|
|
1314
|
+
k(this, "scale", 1);
|
|
1315
|
+
k(this, "scaleX", !1);
|
|
1316
|
+
k(this, "scaleY", !1);
|
|
1317
|
+
k(this, "padding", 0);
|
|
1318
|
+
k(this, "paddingBg", "rgba(255,255,255, 100)");
|
|
1319
|
+
k(this, "round", 10);
|
|
1320
|
+
k(this, "shadow", 3);
|
|
1321
|
+
k(this, "frame", "none");
|
|
1322
|
+
k(this, "background", "default_1");
|
|
1323
|
+
k(this, "align", "center");
|
|
1324
|
+
k(this, "waterImg", null);
|
|
1325
|
+
k(this, "waterIndex", 1);
|
|
1326
|
+
k(this, "size", {
|
|
1327
|
+
type: "auto",
|
|
1328
|
+
title: "Auto"
|
|
1329
|
+
});
|
|
1330
|
+
k(this, "frameConf", {
|
|
1331
|
+
width: 800,
|
|
1332
|
+
height: 600,
|
|
1333
|
+
background: {
|
|
1334
|
+
type: "linear",
|
|
1335
|
+
from: "left",
|
|
1336
|
+
to: "right",
|
|
1337
|
+
stops: ["#6366f1", "#a855f7", "#ec4899"]
|
|
1338
|
+
}
|
|
1339
|
+
});
|
|
1340
|
+
jt(this);
|
|
1341
|
+
}
|
|
1342
|
+
get waterSvg() {
|
|
1343
|
+
return Mt(this.waterImg);
|
|
1344
|
+
}
|
|
1345
|
+
setScale(t) {
|
|
1346
|
+
this.scale = t;
|
|
1347
|
+
}
|
|
1348
|
+
setPadding(t) {
|
|
1349
|
+
this.padding = t;
|
|
1350
|
+
}
|
|
1351
|
+
setPaddingBg(t) {
|
|
1352
|
+
this.paddingBg = t;
|
|
1353
|
+
}
|
|
1354
|
+
setRound(t) {
|
|
1355
|
+
this.round = t;
|
|
1356
|
+
}
|
|
1357
|
+
setShadow(t) {
|
|
1358
|
+
this.shadow = t;
|
|
1359
|
+
}
|
|
1360
|
+
setFrameSize(t, n) {
|
|
1361
|
+
!t || !n || (this.frameConf.width = t, this.frameConf.height = n);
|
|
1362
|
+
}
|
|
1363
|
+
setAlign(t) {
|
|
1364
|
+
this.align = t;
|
|
1365
|
+
}
|
|
1366
|
+
setSize(t) {
|
|
1367
|
+
this.size.type = t.type, this.size.title = t.title, this.setFrameSize(t.width, t.height);
|
|
1368
|
+
}
|
|
1369
|
+
setBackground(t) {
|
|
1370
|
+
this.background = t, this.frameConf.background = Q[t].fill;
|
|
1371
|
+
}
|
|
1372
|
+
toggleFlip(t) {
|
|
1373
|
+
t === "x" && (this.scaleX = !this.scaleX), t === "y" && (this.scaleY = !this.scaleY);
|
|
1374
|
+
}
|
|
1375
|
+
setWaterImg(t) {
|
|
1376
|
+
this.waterImg = t;
|
|
1377
|
+
}
|
|
1378
|
+
setWaterIndex(t) {
|
|
1379
|
+
this.waterIndex = t;
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
const Yo = new _o(), r = {
|
|
1383
|
+
editor: Oo,
|
|
1384
|
+
option: Yo
|
|
1385
|
+
}, Io = ({ disabled: o = !1, toSelect: t, locale: n = "en" }) => {
|
|
1386
|
+
const [s, a] = O(!1), l = () => {
|
|
1387
|
+
a(!1);
|
|
1388
|
+
}, d = (u) => {
|
|
1389
|
+
a(u);
|
|
1390
|
+
}, f = (u) => {
|
|
1391
|
+
t(u.native), l();
|
|
1392
|
+
};
|
|
1393
|
+
return /* @__PURE__ */ e.jsx(
|
|
1394
|
+
ge,
|
|
1395
|
+
{
|
|
1396
|
+
content: /* @__PURE__ */ e.jsx(so, { data: ro, locale: n, onEmojiSelect: f, previewPosition: "none" }),
|
|
1397
|
+
title: "",
|
|
1398
|
+
trigger: "click",
|
|
1399
|
+
open: s,
|
|
1400
|
+
onOpenChange: d,
|
|
1401
|
+
children: /* @__PURE__ */ e.jsx(
|
|
1402
|
+
T,
|
|
1403
|
+
{
|
|
1404
|
+
type: "text",
|
|
1405
|
+
shape: "circle",
|
|
1406
|
+
disabled: o,
|
|
1407
|
+
icon: /* @__PURE__ */ e.jsx(A.Smile, { size: 16 })
|
|
1408
|
+
}
|
|
1409
|
+
)
|
|
1410
|
+
}
|
|
1411
|
+
);
|
|
1412
|
+
}, Bo = () => /* @__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 items-center text-xs font-semibold", children: [
|
|
1413
|
+
/* @__PURE__ */ e.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 510 510", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1414
|
+
/* @__PURE__ */ e.jsxs("g", { filter: "url(#filter0_i_40_60)", children: [
|
|
1415
|
+
/* @__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" }),
|
|
1416
|
+
/* @__PURE__ */ e.jsx("path", { d: "M179.201 136.846C173.053 115.627 185.269 93.4418 206.488 87.2932L367.654 40.5909C388.872 34.4423 411.058 46.6588 417.206 67.8773L505.29 371.846C511.438 393.065 499.222 415.25 478.003 421.399L316.837 468.101C295.619 474.25 273.433 462.033 267.285 440.815L179.201 136.846Z", fill: "#0DB7FF" }),
|
|
1417
|
+
/* @__PURE__ */ e.jsx("path", { d: "M206.488 87.2932C185.269 93.4418 173.053 115.627 179.201 136.846L254.874 397.986L303.989 127.432C307.935 105.696 293.513 84.8767 271.777 80.9308L245.134 76.0943L206.488 87.2932Z", fill: "#EC83FD" }),
|
|
1418
|
+
/* @__PURE__ */ e.jsx("path", { d: "M401 404C401 416.703 390.703 427 378 427C365.297 427 355 416.703 355 404C355 391.297 365.297 381 378 381C390.703 381 401 391.297 401 404Z", fill: "#0D97D3" }),
|
|
1419
|
+
/* @__PURE__ */ e.jsx("path", { d: "M144 404C144 416.703 133.703 427 121 427C108.297 427 98 416.703 98 404C98 391.297 108.297 381 121 381C133.703 381 144 391.297 144 404Z", fill: "#6616CB" })
|
|
1420
|
+
] }),
|
|
1421
|
+
/* @__PURE__ */ e.jsx("defs", { children: /* @__PURE__ */ e.jsxs("filter", { id: "filter0_i_40_60", x: "3", y: "39", width: "503.881", height: "432.679", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB", children: [
|
|
1422
|
+
/* @__PURE__ */ e.jsx("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
1423
|
+
/* @__PURE__ */ e.jsx("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
1424
|
+
/* @__PURE__ */ e.jsx("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }),
|
|
1425
|
+
/* @__PURE__ */ e.jsx("feOffset", { dx: "-2" }),
|
|
1426
|
+
/* @__PURE__ */ e.jsx("feComposite", { in2: "hardAlpha", operator: "arithmetic", k2: "-1", k3: "1" }),
|
|
1427
|
+
/* @__PURE__ */ e.jsx("feColorMatrix", { type: "matrix", values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0" }),
|
|
1428
|
+
/* @__PURE__ */ e.jsx("feBlend", { mode: "normal", in2: "shape", result: "effect1_innerShadow_40_60" })
|
|
1429
|
+
] }) })
|
|
1430
|
+
] }),
|
|
1431
|
+
/* @__PURE__ */ e.jsx("span", { children: "ShotEasy" })
|
|
1432
|
+
] }) }), Po = () => /* @__PURE__ */ e.jsxs("div", { className: "flex-1 flex justify-end items-end gap-2", children: [
|
|
1433
|
+
/* @__PURE__ */ e.jsx("a", { href: "https://github.com/CH563/image-beautifier", target: "_blank", "aria-label": "GitHub", className: "block rounded-full p-1.5 hover:bg-slate-100", 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" }) }) }),
|
|
1434
|
+
/* @__PURE__ */ e.jsx("a", { href: "https://twitter.com/LiWen563", target: "_blank", "aria-label": "twitter:@LiWen563", className: "block rounded-full p-1.5 hover:bg-slate-100", 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" }) }) }) })
|
|
1435
|
+
] }), Wo = ["Square", "SquareFill", "Circle", "Slash", "MoveDownLeft", "Pencil", "Smile"], Zo = Y(() => {
|
|
1436
|
+
const [o, t] = O(!1), n = (l) => {
|
|
1437
|
+
if (!r.editor.isEditing) return;
|
|
1438
|
+
const { useTool: d } = r.editor;
|
|
1439
|
+
r.editor.setUseTool(d === l ? null : l), t(!1);
|
|
1440
|
+
}, s = (l) => {
|
|
1441
|
+
if (!r.editor.isEditing) return;
|
|
1442
|
+
const d = r.option.frameConf.width / 2 - 24, f = r.option.frameConf.height / 2 - 24;
|
|
1443
|
+
r.editor.setUseTool(null), t(!1), r.editor.addShape({
|
|
1444
|
+
id: he(),
|
|
1445
|
+
type: "emoji",
|
|
1446
|
+
text: l,
|
|
1447
|
+
zIndex: r.editor.shapes.size + 1,
|
|
1448
|
+
x: d,
|
|
1449
|
+
y: f,
|
|
1450
|
+
editable: !0
|
|
1451
|
+
});
|
|
1452
|
+
}, a = () => {
|
|
1453
|
+
if (!r.editor.isEditing) return;
|
|
1454
|
+
const l = !o;
|
|
1455
|
+
r.editor.setUseTool(null), t(l), r.editor.app.config.move.drag = l;
|
|
1456
|
+
};
|
|
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(Bo, {}) }),
|
|
1459
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-1 justify-center items-center", children: Wo.map((l) => {
|
|
1460
|
+
if (l === "Smile") return /* @__PURE__ */ e.jsx(Io, { disabled: !1, toSelect: s }, l);
|
|
1461
|
+
let d;
|
|
1462
|
+
if (l.includes("Fill")) {
|
|
1463
|
+
const f = l.replace("Fill", ""), u = at[f];
|
|
1464
|
+
d = /* @__PURE__ */ e.jsx(u, { size: 16, fill: "currentColor" });
|
|
1465
|
+
} else {
|
|
1466
|
+
const f = at[l];
|
|
1467
|
+
d = /* @__PURE__ */ e.jsx(f, { name: l, size: 16 });
|
|
1468
|
+
}
|
|
1469
|
+
return /* @__PURE__ */ e.jsx(
|
|
1470
|
+
T,
|
|
1471
|
+
{
|
|
1472
|
+
type: "text",
|
|
1473
|
+
shape: "circle",
|
|
1474
|
+
icon: d,
|
|
1475
|
+
className: r.editor.useTool === l && "text-[#1677ff] bg-sky-100/50 hover:bg-sky-100 hover:text-[#1677ff]",
|
|
1476
|
+
onClick: () => n(l)
|
|
1477
|
+
},
|
|
1478
|
+
l
|
|
1479
|
+
);
|
|
1480
|
+
}) }),
|
|
1481
|
+
/* @__PURE__ */ e.jsx(li, { type: "vertical" }),
|
|
1482
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 justify-center items-center", children: [
|
|
1483
|
+
/* @__PURE__ */ e.jsx(
|
|
1484
|
+
xe,
|
|
1485
|
+
{
|
|
1486
|
+
size: "small",
|
|
1487
|
+
presets: [
|
|
1488
|
+
{
|
|
1489
|
+
label: "Recommended",
|
|
1490
|
+
colors: [
|
|
1491
|
+
"#ffffff",
|
|
1492
|
+
"#444444",
|
|
1493
|
+
"#df4b26",
|
|
1494
|
+
"#1677ff",
|
|
1495
|
+
"#52C41A",
|
|
1496
|
+
"#FA8C16",
|
|
1497
|
+
"#FADB14",
|
|
1498
|
+
"#EB2F96",
|
|
1499
|
+
"#722ED1"
|
|
1500
|
+
]
|
|
1501
|
+
}
|
|
1502
|
+
],
|
|
1503
|
+
value: r.editor.annotateColor,
|
|
1504
|
+
onChange: (l) => r.editor.setAnnotateColor(l.toHexString())
|
|
1505
|
+
}
|
|
1506
|
+
),
|
|
1507
|
+
/* @__PURE__ */ e.jsx(Ao, { defaultValue: r.editor.strokeWidth, onChange: (l) => r.editor.setStrokeWidth(l) }),
|
|
1508
|
+
/* @__PURE__ */ e.jsx(
|
|
1509
|
+
T,
|
|
1510
|
+
{
|
|
1511
|
+
type: "text",
|
|
1512
|
+
shape: "circle",
|
|
1513
|
+
className: o && "text-[#1677ff] bg-sky-100/50 hover:bg-sky-100 hover:text-[#1677ff]",
|
|
1514
|
+
icon: /* @__PURE__ */ e.jsx(A.Hand, { size: 16 }),
|
|
1515
|
+
onClick: a
|
|
1516
|
+
}
|
|
1517
|
+
)
|
|
1518
|
+
] }),
|
|
1519
|
+
/* @__PURE__ */ e.jsx(Po, {})
|
|
1520
|
+
] });
|
|
1521
|
+
});
|
|
1522
|
+
function Go(o) {
|
|
1523
|
+
var t = typeof o;
|
|
1524
|
+
return o != null && (t == "object" || t == "function");
|
|
1525
|
+
}
|
|
1526
|
+
var Tt = Go, Fo = typeof fe == "object" && fe && fe.Object === Object && fe, Lo = Fo, Uo = Lo, Vo = typeof self == "object" && self && self.Object === Object && self, Jo = Uo || Vo || Function("return this")(), Nt = Jo, qo = Nt, Xo = function() {
|
|
1527
|
+
return qo.Date.now();
|
|
1528
|
+
}, Qo = Xo, $o = /\s/;
|
|
1529
|
+
function Ko(o) {
|
|
1530
|
+
for (var t = o.length; t-- && $o.test(o.charAt(t)); )
|
|
1531
|
+
;
|
|
1532
|
+
return t;
|
|
1533
|
+
}
|
|
1534
|
+
var er = Ko, tr = er, ir = /^\s+/;
|
|
1535
|
+
function or(o) {
|
|
1536
|
+
return o && o.slice(0, tr(o) + 1).replace(ir, "");
|
|
1537
|
+
}
|
|
1538
|
+
var rr = or, sr = Nt, nr = sr.Symbol, St = nr, ut = St, kt = Object.prototype, ar = kt.hasOwnProperty, lr = kt.toString, se = ut ? ut.toStringTag : void 0;
|
|
1539
|
+
function cr(o) {
|
|
1540
|
+
var t = ar.call(o, se), n = o[se];
|
|
1541
|
+
try {
|
|
1542
|
+
o[se] = void 0;
|
|
1543
|
+
var s = !0;
|
|
1544
|
+
} catch {
|
|
1545
|
+
}
|
|
1546
|
+
var a = lr.call(o);
|
|
1547
|
+
return s && (t ? o[se] = n : delete o[se]), a;
|
|
1548
|
+
}
|
|
1549
|
+
var dr = cr, fr = Object.prototype, pr = fr.toString;
|
|
1550
|
+
function ur(o) {
|
|
1551
|
+
return pr.call(o);
|
|
1552
|
+
}
|
|
1553
|
+
var hr = ur, ht = St, mr = dr, gr = hr, xr = "[object Null]", br = "[object Undefined]", mt = ht ? ht.toStringTag : void 0;
|
|
1554
|
+
function wr(o) {
|
|
1555
|
+
return o == null ? o === void 0 ? br : xr : mt && mt in Object(o) ? mr(o) : gr(o);
|
|
1556
|
+
}
|
|
1557
|
+
var yr = wr;
|
|
1558
|
+
function vr(o) {
|
|
1559
|
+
return o != null && typeof o == "object";
|
|
1560
|
+
}
|
|
1561
|
+
var jr = vr, Mr = yr, Cr = jr, Ar = "[object Symbol]";
|
|
1562
|
+
function Tr(o) {
|
|
1563
|
+
return typeof o == "symbol" || Cr(o) && Mr(o) == Ar;
|
|
1564
|
+
}
|
|
1565
|
+
var Nr = Tr, Sr = rr, gt = Tt, kr = Nr, xt = NaN, Rr = /^[-+]0x[0-9a-f]+$/i, Dr = /^0b[01]+$/i, Hr = /^0o[0-7]+$/i, zr = parseInt;
|
|
1566
|
+
function Er(o) {
|
|
1567
|
+
if (typeof o == "number")
|
|
1568
|
+
return o;
|
|
1569
|
+
if (kr(o))
|
|
1570
|
+
return xt;
|
|
1571
|
+
if (gt(o)) {
|
|
1572
|
+
var t = typeof o.valueOf == "function" ? o.valueOf() : o;
|
|
1573
|
+
o = gt(t) ? t + "" : t;
|
|
1574
|
+
}
|
|
1575
|
+
if (typeof o != "string")
|
|
1576
|
+
return o === 0 ? o : +o;
|
|
1577
|
+
o = Sr(o);
|
|
1578
|
+
var n = Dr.test(o);
|
|
1579
|
+
return n || Hr.test(o) ? zr(o.slice(2), n ? 2 : 8) : Rr.test(o) ? xt : +o;
|
|
1580
|
+
}
|
|
1581
|
+
var Or = Er, _r = Tt, Re = Qo, bt = Or, Yr = "Expected a function", Ir = Math.max, Br = Math.min;
|
|
1582
|
+
function Pr(o, t, n) {
|
|
1583
|
+
var s, a, l, d, f, u, h = 0, g = !1, y = !1, S = !0;
|
|
1584
|
+
if (typeof o != "function")
|
|
1585
|
+
throw new TypeError(Yr);
|
|
1586
|
+
t = bt(t) || 0, _r(n) && (g = !!n.leading, y = "maxWait" in n, l = y ? Ir(bt(n.maxWait) || 0, t) : l, S = "trailing" in n ? !!n.trailing : S);
|
|
1587
|
+
function N(R) {
|
|
1588
|
+
var W = s, U = a;
|
|
1589
|
+
return s = a = void 0, h = R, d = o.apply(U, W), d;
|
|
1590
|
+
}
|
|
1591
|
+
function x(R) {
|
|
1592
|
+
return h = R, f = setTimeout(_, t), g ? N(R) : d;
|
|
1593
|
+
}
|
|
1594
|
+
function v(R) {
|
|
1595
|
+
var W = R - u, U = R - h, K = t - W;
|
|
1596
|
+
return y ? Br(K, l - U) : K;
|
|
1597
|
+
}
|
|
1598
|
+
function H(R) {
|
|
1599
|
+
var W = R - u, U = R - h;
|
|
1600
|
+
return u === void 0 || W >= t || W < 0 || y && U >= l;
|
|
1601
|
+
}
|
|
1602
|
+
function _() {
|
|
1603
|
+
var R = Re();
|
|
1604
|
+
if (H(R))
|
|
1605
|
+
return E(R);
|
|
1606
|
+
f = setTimeout(_, v(R));
|
|
1607
|
+
}
|
|
1608
|
+
function E(R) {
|
|
1609
|
+
return f = void 0, S && s ? N(R) : (s = a = void 0, d);
|
|
1610
|
+
}
|
|
1611
|
+
function be() {
|
|
1612
|
+
f !== void 0 && clearTimeout(f), h = 0, s = u = a = f = void 0;
|
|
1613
|
+
}
|
|
1614
|
+
function we() {
|
|
1615
|
+
return f === void 0 ? d : E(Re());
|
|
1616
|
+
}
|
|
1617
|
+
function $() {
|
|
1618
|
+
var R = Re(), W = H(R);
|
|
1619
|
+
if (s = arguments, a = this, u = R, W) {
|
|
1620
|
+
if (f === void 0)
|
|
1621
|
+
return x(u);
|
|
1622
|
+
if (y)
|
|
1623
|
+
return clearTimeout(f), f = setTimeout(_, t), N(u);
|
|
1624
|
+
}
|
|
1625
|
+
return f === void 0 && (f = setTimeout(_, t)), d;
|
|
1626
|
+
}
|
|
1627
|
+
return $.cancel = be, $.flush = we, $;
|
|
1628
|
+
}
|
|
1629
|
+
var Wr = Pr;
|
|
1630
|
+
const Zr = /* @__PURE__ */ vo(Wr), Gr = "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", Fr = "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=", Lr = (o, t) => t instanceof Array ? t.map((n) => it.toArray(n).map(
|
|
1631
|
+
(s) => ot(s, { ...o })
|
|
1632
|
+
)) : it.toArray(t).map(
|
|
1633
|
+
(s) => ot(s, { ...o })
|
|
1634
|
+
), Ur = ({ width: o, height: t, background: n, parent: s, children: a, cursor: l }) => {
|
|
1635
|
+
const d = me(() => {
|
|
1636
|
+
const f = new no({
|
|
1637
|
+
width: o,
|
|
1638
|
+
height: t,
|
|
1639
|
+
overflow: "hide",
|
|
1640
|
+
fill: n,
|
|
1641
|
+
cursor: "auto"
|
|
1642
|
+
});
|
|
1643
|
+
return f.name = "frame", f;
|
|
1644
|
+
}, []);
|
|
1645
|
+
return M(() => {
|
|
1646
|
+
d.width = o, d.height = t, d.fill = n;
|
|
1647
|
+
}, [o, t, n]), M(() => {
|
|
1648
|
+
d.cursor = l || "auto";
|
|
1649
|
+
}, [l]), M(() => (s.add(d), () => {
|
|
1650
|
+
d.remove();
|
|
1651
|
+
}), [s]), /* @__PURE__ */ e.jsx(e.Fragment, { children: Lr({ parent: d }, a) });
|
|
1652
|
+
}, Vr = Y(({ parent: o }) => {
|
|
1653
|
+
const [t, n] = me(() => {
|
|
1654
|
+
const s = new ao({
|
|
1655
|
+
url: r.editor.img.src,
|
|
1656
|
+
origin: "center"
|
|
1657
|
+
}), a = new lo({
|
|
1658
|
+
overflow: "hide",
|
|
1659
|
+
scale: 1,
|
|
1660
|
+
children: [s]
|
|
1661
|
+
});
|
|
1662
|
+
return [s, a];
|
|
1663
|
+
}, [o]);
|
|
1664
|
+
return M(() => {
|
|
1665
|
+
r.option.padding === 0 ? n.fill = "#ffffff00" : n.fill = r.option.paddingBg;
|
|
1666
|
+
}, [r.option.paddingBg, r.option.padding]), M(() => {
|
|
1667
|
+
n.cornerRadius = r.option.round, t.cornerRadius = r.option.round - 2;
|
|
1668
|
+
}, [r.option.round]), M(() => {
|
|
1669
|
+
const { shadow: s } = r.option;
|
|
1670
|
+
s === 0 ? n.shadow = null : n.shadow = {
|
|
1671
|
+
x: s * 4,
|
|
1672
|
+
y: s * 4,
|
|
1673
|
+
blur: s * 3,
|
|
1674
|
+
color: "#00000045",
|
|
1675
|
+
box: !0
|
|
1676
|
+
};
|
|
1677
|
+
}, [r.option.shadow]), M(() => {
|
|
1678
|
+
n.scale = r.option.scale;
|
|
1679
|
+
}, [r.option.scale]), M(() => {
|
|
1680
|
+
t.url = r.editor.img.src;
|
|
1681
|
+
}, [r.editor.img.src]), M(() => {
|
|
1682
|
+
t.scaleX = r.option.scaleX ? -1 : 1;
|
|
1683
|
+
}, [r.option.scaleX]), M(() => {
|
|
1684
|
+
t.scaleY = r.option.scaleY ? -1 : 1;
|
|
1685
|
+
}, [r.option.scaleY]), M(() => {
|
|
1686
|
+
const s = Math.round(r.option.frameConf.width * 0.2), { width: a, height: l } = ko(r.editor.img.width, r.editor.img.height, r.option.frameConf.width - s, r.option.frameConf.height - s);
|
|
1687
|
+
t.width = a - r.option.padding, t.height = l - r.option.padding, n.width = a, n.height = l, n.origin = r.option.align;
|
|
1688
|
+
const { x: d, y: f } = Do(r.option.align, r.option.frameConf.width - a, r.option.frameConf.height - l);
|
|
1689
|
+
n.x = d, n.y = f, r.option.padding > 0 && (t.x = r.option.padding / 2, t.y = r.option.padding / 2);
|
|
1690
|
+
}, [r.option.frameConf.width, r.option.frameConf.height, r.option.padding, r.option.align]), M(() => (o.add(n), () => {
|
|
1691
|
+
n.remove();
|
|
1692
|
+
}), [o]), null;
|
|
1693
|
+
}), Jr = Y(({ parent: o }) => {
|
|
1694
|
+
const t = me(() => new De({
|
|
1695
|
+
x: 0,
|
|
1696
|
+
y: 0
|
|
1697
|
+
}), [o]);
|
|
1698
|
+
return M(() => {
|
|
1699
|
+
t.width = r.option.frameConf.width, t.height = r.option.frameConf.height;
|
|
1700
|
+
}, [r.option.frameConf.width, r.option.frameConf.height]), M(() => {
|
|
1701
|
+
t.zIndex = r.option.waterIndex;
|
|
1702
|
+
}, [r.option.waterIndex]), M(() => {
|
|
1703
|
+
t.fill = {
|
|
1704
|
+
type: "image",
|
|
1705
|
+
url: r.option.waterSvg,
|
|
1706
|
+
mode: "repeat",
|
|
1707
|
+
format: "svg",
|
|
1708
|
+
size: Math.round(r.option.frameConf.width / 6)
|
|
1709
|
+
};
|
|
1710
|
+
}, [r.option.waterSvg, r.option.frameConf.width]), M(() => (o.add(t), () => {
|
|
1711
|
+
t.remove();
|
|
1712
|
+
}), []), null;
|
|
1713
|
+
}), qr = ({ parent: o, type: t, id: n, width: s, height: a, x: l, y: d, fill: f, strokeWidth: u, zIndex: h, points: g, editable: y, text: S }) => {
|
|
1714
|
+
const N = me(() => {
|
|
1715
|
+
const x = { id: n, x: l, y: d, zIndex: h };
|
|
1716
|
+
return t === "SquareFill" ? new De({
|
|
1717
|
+
cornerRadius: 8,
|
|
1718
|
+
width: s,
|
|
1719
|
+
height: a,
|
|
1720
|
+
fill: f,
|
|
1721
|
+
...x
|
|
1722
|
+
}) : t === "Circle" ? new co({
|
|
1723
|
+
stroke: f,
|
|
1724
|
+
strokeWidth: u,
|
|
1725
|
+
width: s,
|
|
1726
|
+
height: a,
|
|
1727
|
+
...x
|
|
1728
|
+
}) : t === "Slash" ? new lt({
|
|
1729
|
+
id: n,
|
|
1730
|
+
points: g,
|
|
1731
|
+
zIndex: h,
|
|
1732
|
+
stroke: f,
|
|
1733
|
+
strokeWidth: u
|
|
1734
|
+
}) : t === "MoveDownLeft" ? new bo({
|
|
1735
|
+
id: n,
|
|
1736
|
+
points: g,
|
|
1737
|
+
zIndex: h,
|
|
1738
|
+
strokeCap: "round",
|
|
1739
|
+
strokeJoin: "round",
|
|
1740
|
+
stroke: f,
|
|
1741
|
+
strokeWidth: u
|
|
1742
|
+
}) : t === "Pencil" ? new lt({
|
|
1743
|
+
id: n,
|
|
1744
|
+
points: g,
|
|
1745
|
+
zIndex: h,
|
|
1746
|
+
curve: !0,
|
|
1747
|
+
stroke: f,
|
|
1748
|
+
strokeWidth: u
|
|
1749
|
+
}) : t === "emoji" ? new fo({
|
|
1750
|
+
id: n,
|
|
1751
|
+
zIndex: h,
|
|
1752
|
+
text: S,
|
|
1753
|
+
resizeFontSize: !0,
|
|
1754
|
+
fontSize: 48
|
|
1755
|
+
}) : new De({
|
|
1756
|
+
cornerRadius: 8,
|
|
1757
|
+
stroke: f,
|
|
1758
|
+
strokeWidth: u,
|
|
1759
|
+
width: s,
|
|
1760
|
+
height: a,
|
|
1761
|
+
...x
|
|
1762
|
+
});
|
|
1763
|
+
}, [o]);
|
|
1764
|
+
return M(() => {
|
|
1765
|
+
["Slash", "MoveDownLeft", "Pencil"].includes(t) ? N.points = g : (N.x = l, N.y = d, N.width = s, N.height = a);
|
|
1766
|
+
}, [l, d, s, a]), M(() => {
|
|
1767
|
+
N.editable = !!y;
|
|
1768
|
+
}, [y]), M(() => (o.add(N), () => {
|
|
1769
|
+
N.remove();
|
|
1770
|
+
}), [o]), null;
|
|
1771
|
+
}, Xr = Y(() => (M(() => {
|
|
1772
|
+
const o = (s) => {
|
|
1773
|
+
var l;
|
|
1774
|
+
const { list: a } = (l = r.editor.app) == null ? void 0 : l.editor;
|
|
1775
|
+
if (a != null && a.length) {
|
|
1776
|
+
for (let d of a)
|
|
1777
|
+
d.remove(), r.editor.removeShape(d);
|
|
1778
|
+
r.editor.app.editor.cancel();
|
|
1779
|
+
}
|
|
1780
|
+
}, t = (s) => {
|
|
1781
|
+
var a, l;
|
|
1782
|
+
s === "fit" ? (a = r.editor.app) == null || a.tree.zoom(s, 100) : (l = r.editor.app) == null || l.tree.zoom(s), r.editor.setScale(r.editor.app.tree.scale);
|
|
1783
|
+
}, n = Ct(window, {
|
|
1784
|
+
Backspace: o,
|
|
1785
|
+
Delete: o,
|
|
1786
|
+
"$mod+Minus": (s) => {
|
|
1787
|
+
s.preventDefault(), t("out");
|
|
1788
|
+
},
|
|
1789
|
+
"$mod+Equal": (s) => {
|
|
1790
|
+
s.preventDefault(), t("in");
|
|
1791
|
+
},
|
|
1792
|
+
"$mod+Digit0": (s) => {
|
|
1793
|
+
s.preventDefault(), t("fit");
|
|
1794
|
+
}
|
|
1795
|
+
});
|
|
1796
|
+
return () => {
|
|
1797
|
+
n();
|
|
1798
|
+
};
|
|
1799
|
+
}, [window]), null));
|
|
1800
|
+
po.set("pencil", { url: Fr });
|
|
1801
|
+
const Qr = Y(({ target: o }) => {
|
|
1802
|
+
var t, n;
|
|
1803
|
+
return M(() => {
|
|
1804
|
+
const s = new uo({
|
|
1805
|
+
view: o,
|
|
1806
|
+
editor: {
|
|
1807
|
+
lockRatio: "corner",
|
|
1808
|
+
stroke: "#3f99f7",
|
|
1809
|
+
skewable: !1,
|
|
1810
|
+
hover: !1,
|
|
1811
|
+
middlePoint: { cornerRadius: 100, width: 20, height: 6 },
|
|
1812
|
+
rotatePoint: {
|
|
1813
|
+
width: 20,
|
|
1814
|
+
height: 20,
|
|
1815
|
+
fill: {
|
|
1816
|
+
type: "image",
|
|
1817
|
+
url: Gr
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
},
|
|
1821
|
+
tree: {
|
|
1822
|
+
usePartRender: !0
|
|
1823
|
+
},
|
|
1824
|
+
sky: {
|
|
1825
|
+
type: "draw",
|
|
1826
|
+
usePartRender: !0
|
|
1827
|
+
}
|
|
1828
|
+
});
|
|
1829
|
+
new wo(s), r.editor.setApp(s), s.tree.on(ho.ZOOM, () => {
|
|
1830
|
+
r.editor.setScale(s.tree.scale);
|
|
1831
|
+
}), s.tree.on(mo.RESIZE, () => {
|
|
1832
|
+
r.editor.setScale(s.tree.scale);
|
|
1833
|
+
});
|
|
1834
|
+
let a = null;
|
|
1835
|
+
s.tree.on(ke.START, (d) => {
|
|
1836
|
+
if (!r.editor.useTool) return;
|
|
1837
|
+
const { target: f } = d;
|
|
1838
|
+
if (r.editor.getShape(f.id)) return;
|
|
1839
|
+
a = he();
|
|
1840
|
+
const h = d.getPageBounds(), g = r.editor.useTool, y = {
|
|
1841
|
+
id: a,
|
|
1842
|
+
type: g,
|
|
1843
|
+
fill: r.editor.annotateColor,
|
|
1844
|
+
strokeWidth: r.editor.strokeWidth,
|
|
1845
|
+
zIndex: r.editor.shapes.size + 1,
|
|
1846
|
+
...h
|
|
1847
|
+
};
|
|
1848
|
+
["Slash", "MoveDownLeft", "Pencil"].includes(g) && (y.points = [h.x, h.y]), r.editor.addShape(y);
|
|
1849
|
+
}), s.tree.on(ke.DRAG, (d) => {
|
|
1850
|
+
if (!r.editor.useTool || !a) return;
|
|
1851
|
+
const f = r.editor.getShape(a);
|
|
1852
|
+
if (!f) return;
|
|
1853
|
+
const u = d.getPageBounds(), h = Object.assign({}, f, u), { points: g, type: y } = h;
|
|
1854
|
+
if (g && g.length) {
|
|
1855
|
+
const { x: S, y: N } = d.getInnerTotal(), x = S > 0 ? u.x + S : u.x, v = N > 0 ? u.y + N : u.y;
|
|
1856
|
+
y === "Pencil" ? h.points = [...g, x, v] : h.points = [g[0], g[1], x, v];
|
|
1857
|
+
}
|
|
1858
|
+
r.editor.addShape(h);
|
|
1859
|
+
}), s.tree.on(ke.END, () => {
|
|
1860
|
+
if (!r.editor.useTool || !a) return;
|
|
1861
|
+
const d = r.editor.getShape(a);
|
|
1862
|
+
d && ((d.width === 0 || d.height === 0) && !["Slash", "MoveDownLeft", "Pencil"].includes(d.type) ? r.editor.removeShape(d) : r.editor.addShape(Object.assign({}, d, { editable: !0 }))), a = null, r.editor.useTool !== "Pencil" && r.editor.setUseTool(null);
|
|
1863
|
+
});
|
|
1864
|
+
const l = Zr(() => {
|
|
1865
|
+
const { width: d, height: f } = o.getBoundingClientRect();
|
|
1866
|
+
s.tree.zoom("fit", 100), r.option.frameConf.width < d && r.option.frameConf.height < f && s.tree.zoom(1);
|
|
1867
|
+
}, 10);
|
|
1868
|
+
return go(o, l), () => {
|
|
1869
|
+
xo(o, l), r.editor.destroy();
|
|
1870
|
+
};
|
|
1871
|
+
}, [o]), M(() => {
|
|
1872
|
+
const s = setTimeout(() => {
|
|
1873
|
+
const { width: a, height: l } = o.getBoundingClientRect();
|
|
1874
|
+
r.editor.app.tree.zoom("fit", 100), r.option.frameConf.width < a && r.option.frameConf.height < l && r.editor.app.tree.zoom(1), r.editor.setScale(r.editor.app.tree.scale);
|
|
1875
|
+
}, 20);
|
|
1876
|
+
return () => {
|
|
1877
|
+
clearTimeout(s);
|
|
1878
|
+
};
|
|
1879
|
+
}, [r.option.frameConf.width, r.option.frameConf.height]), (t = r.editor.app) != null && t.tree ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1880
|
+
/* @__PURE__ */ e.jsxs(Ur, { parent: r.editor.app.tree, cursor: r.editor.cursor, ...r.option.frameConf, children: [
|
|
1881
|
+
r.editor.shapesList.map((s) => /* @__PURE__ */ e.jsx(qr, { ...s }, s.id)),
|
|
1882
|
+
((n = r.editor.img) == null ? void 0 : n.src) && /* @__PURE__ */ e.jsx(Vr, {}),
|
|
1883
|
+
r.option.waterImg && /* @__PURE__ */ e.jsx(Jr, {})
|
|
1884
|
+
] }),
|
|
1885
|
+
/* @__PURE__ */ e.jsx(Xr, {})
|
|
1886
|
+
] }) : null;
|
|
1887
|
+
}), $r = [
|
|
1888
|
+
{
|
|
1889
|
+
key: 0.5,
|
|
1890
|
+
label: "50%"
|
|
1891
|
+
},
|
|
1892
|
+
{
|
|
1893
|
+
key: 1,
|
|
1894
|
+
label: "100%"
|
|
1895
|
+
},
|
|
1896
|
+
{
|
|
1897
|
+
key: 1.5,
|
|
1898
|
+
label: "150%"
|
|
1899
|
+
},
|
|
1900
|
+
{
|
|
1901
|
+
key: 2,
|
|
1902
|
+
label: "200%"
|
|
1903
|
+
}
|
|
1904
|
+
], Kr = Y(() => {
|
|
1905
|
+
const o = (n) => {
|
|
1906
|
+
var s;
|
|
1907
|
+
(s = r.editor.app) == null || s.tree.zoom(n), r.editor.setScale(r.editor.app.tree.scale);
|
|
1908
|
+
}, t = (n) => {
|
|
1909
|
+
var a, l;
|
|
1910
|
+
const s = Number(n.key);
|
|
1911
|
+
s === 4 ? (a = r.editor.app) == null || a.tree.zoom("fit", 100) : (l = r.editor.app) == null || l.tree.zoom(s), r.editor.setScale(r.editor.app.tree.scale);
|
|
1912
|
+
};
|
|
1913
|
+
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(T, { type: "text", icon: /* @__PURE__ */ e.jsx(A.ZoomIn, { size: 16 }), onClick: () => o("in") }),
|
|
1916
|
+
/* @__PURE__ */ e.jsx(vt, { menu: { items: $r, onClick: t }, placement: "top", children: /* @__PURE__ */ e.jsxs(T, { type: "text", children: [
|
|
1917
|
+
r.editor.scale,
|
|
1918
|
+
"%"
|
|
1919
|
+
] }) }),
|
|
1920
|
+
/* @__PURE__ */ e.jsx(T, { type: "text", icon: /* @__PURE__ */ e.jsx(A.ZoomOut, { size: 16 }), onClick: () => o("out") })
|
|
1921
|
+
] }),
|
|
1922
|
+
/* @__PURE__ */ e.jsx("div", { className: "rounded-full bg-white shadow-md overflow-hidden", children: /* @__PURE__ */ e.jsx(T, { type: "text", icon: /* @__PURE__ */ e.jsx(A.Maximize, { size: 16 }), onClick: () => t({ key: 4 }) }) })
|
|
1923
|
+
] });
|
|
1924
|
+
}), es = Y(() => {
|
|
1925
|
+
const [o, t] = O(null);
|
|
1926
|
+
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(Qr, { target: o }) }),
|
|
1928
|
+
/* @__PURE__ */ e.jsx(Kr, {})
|
|
1929
|
+
] });
|
|
1930
|
+
}), ts = [
|
|
1931
|
+
{
|
|
1932
|
+
key: "default",
|
|
1933
|
+
title: "Default",
|
|
1934
|
+
lists: [
|
|
1935
|
+
{
|
|
1936
|
+
width: 1920,
|
|
1937
|
+
height: 1080,
|
|
1938
|
+
w: 16,
|
|
1939
|
+
h: 9
|
|
1940
|
+
},
|
|
1941
|
+
{
|
|
1942
|
+
width: 1920,
|
|
1943
|
+
height: 1280,
|
|
1944
|
+
w: 3,
|
|
1945
|
+
h: 2
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
width: 1920,
|
|
1949
|
+
height: 1440,
|
|
1950
|
+
w: 4,
|
|
1951
|
+
h: 3
|
|
1952
|
+
},
|
|
1953
|
+
{
|
|
1954
|
+
width: 1920,
|
|
1955
|
+
height: 1536,
|
|
1956
|
+
w: 5,
|
|
1957
|
+
h: 4
|
|
1958
|
+
},
|
|
1959
|
+
{
|
|
1960
|
+
width: 1920,
|
|
1961
|
+
height: 1920,
|
|
1962
|
+
w: 1,
|
|
1963
|
+
h: 1
|
|
1964
|
+
},
|
|
1965
|
+
{
|
|
1966
|
+
width: 1080,
|
|
1967
|
+
height: 1350,
|
|
1968
|
+
w: 4,
|
|
1969
|
+
h: 5
|
|
1970
|
+
},
|
|
1971
|
+
{
|
|
1972
|
+
width: 1080,
|
|
1973
|
+
height: 1440,
|
|
1974
|
+
w: 3,
|
|
1975
|
+
h: 4
|
|
1976
|
+
},
|
|
1977
|
+
{
|
|
1978
|
+
width: 1080,
|
|
1979
|
+
height: 1620,
|
|
1980
|
+
w: 2,
|
|
1981
|
+
h: 3
|
|
1982
|
+
},
|
|
1983
|
+
{
|
|
1984
|
+
width: 1080,
|
|
1985
|
+
height: 1920,
|
|
1986
|
+
w: 9,
|
|
1987
|
+
h: 16
|
|
1988
|
+
}
|
|
1989
|
+
]
|
|
1990
|
+
},
|
|
1991
|
+
{
|
|
1992
|
+
key: "instagram",
|
|
1993
|
+
title: "Instagram",
|
|
1994
|
+
lists: [
|
|
1995
|
+
{
|
|
1996
|
+
title: "Post",
|
|
1997
|
+
width: 1080,
|
|
1998
|
+
height: 1080,
|
|
1999
|
+
w: 1,
|
|
2000
|
+
h: 1
|
|
2001
|
+
},
|
|
2002
|
+
{
|
|
2003
|
+
title: "Portrait",
|
|
2004
|
+
width: 1080,
|
|
2005
|
+
height: 1350,
|
|
2006
|
+
w: 4,
|
|
2007
|
+
h: 5
|
|
2008
|
+
},
|
|
2009
|
+
{
|
|
2010
|
+
title: "Stroy",
|
|
2011
|
+
width: 1080,
|
|
2012
|
+
height: 1920,
|
|
2013
|
+
w: 9,
|
|
2014
|
+
h: 16
|
|
2015
|
+
}
|
|
2016
|
+
]
|
|
2017
|
+
},
|
|
2018
|
+
{
|
|
2019
|
+
key: "x",
|
|
2020
|
+
title: "X",
|
|
2021
|
+
lists: [
|
|
2022
|
+
{
|
|
2023
|
+
title: "Tweet",
|
|
2024
|
+
width: 1200,
|
|
2025
|
+
height: 675,
|
|
2026
|
+
w: 16,
|
|
2027
|
+
h: 9
|
|
2028
|
+
},
|
|
2029
|
+
{
|
|
2030
|
+
title: "Cover",
|
|
2031
|
+
width: 1500,
|
|
2032
|
+
height: 500,
|
|
2033
|
+
w: 3,
|
|
2034
|
+
h: 1
|
|
2035
|
+
}
|
|
2036
|
+
]
|
|
2037
|
+
},
|
|
2038
|
+
{
|
|
2039
|
+
key: "youtube",
|
|
2040
|
+
title: "YouTube",
|
|
2041
|
+
lists: [
|
|
2042
|
+
{
|
|
2043
|
+
title: "Banner",
|
|
2044
|
+
width: 2560,
|
|
2045
|
+
height: 1440,
|
|
2046
|
+
w: 16,
|
|
2047
|
+
h: 9
|
|
2048
|
+
},
|
|
2049
|
+
{
|
|
2050
|
+
title: "Thumbnail",
|
|
2051
|
+
width: 1280,
|
|
2052
|
+
height: 720,
|
|
2053
|
+
w: 16,
|
|
2054
|
+
h: 9
|
|
2055
|
+
},
|
|
2056
|
+
{
|
|
2057
|
+
title: "Video",
|
|
2058
|
+
width: 1920,
|
|
2059
|
+
height: 1080,
|
|
2060
|
+
w: 16,
|
|
2061
|
+
h: 9
|
|
2062
|
+
}
|
|
2063
|
+
]
|
|
2064
|
+
},
|
|
2065
|
+
{
|
|
2066
|
+
key: "pinterest",
|
|
2067
|
+
title: "Pinterest",
|
|
2068
|
+
lists: [
|
|
2069
|
+
{
|
|
2070
|
+
title: "Long",
|
|
2071
|
+
width: 1e3,
|
|
2072
|
+
height: 2100,
|
|
2073
|
+
w: 10,
|
|
2074
|
+
h: 21
|
|
2075
|
+
},
|
|
2076
|
+
{
|
|
2077
|
+
title: "Optimal",
|
|
2078
|
+
width: 1e3,
|
|
2079
|
+
height: 1500,
|
|
2080
|
+
w: 2,
|
|
2081
|
+
h: 3
|
|
2082
|
+
},
|
|
2083
|
+
{
|
|
2084
|
+
title: "Square",
|
|
2085
|
+
width: 1e3,
|
|
2086
|
+
height: 1e3,
|
|
2087
|
+
w: 1,
|
|
2088
|
+
h: 1
|
|
2089
|
+
}
|
|
2090
|
+
]
|
|
2091
|
+
}
|
|
2092
|
+
], is = ({ frameWidth: o, frameHeight: t, type: n, onSet: s }) => {
|
|
2093
|
+
const [a, l] = O(""), [d, f] = O(""), u = () => {
|
|
2094
|
+
s({ type: "auto", title: "Auto" });
|
|
2095
|
+
}, h = () => {
|
|
2096
|
+
s({ type: "custom", title: "Custom", width: a, height: d });
|
|
2097
|
+
};
|
|
2098
|
+
return M(() => {
|
|
2099
|
+
n === "custom" ? (l(o), f(t)) : (l(""), f(""));
|
|
2100
|
+
}, [n]), /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center py-2 font-normal", children: [
|
|
2101
|
+
/* @__PURE__ */ e.jsx(
|
|
2102
|
+
rt,
|
|
2103
|
+
{
|
|
2104
|
+
min: 1,
|
|
2105
|
+
value: a,
|
|
2106
|
+
onChange: l,
|
|
2107
|
+
placeholder: o,
|
|
2108
|
+
prefix: /* @__PURE__ */ e.jsx("span", { className: "opacity-60 mx-1", children: "W" }),
|
|
2109
|
+
className: "flex-1"
|
|
2110
|
+
}
|
|
2111
|
+
),
|
|
2112
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-xs opacity-50", children: "x" }),
|
|
2113
|
+
/* @__PURE__ */ e.jsx(
|
|
2114
|
+
rt,
|
|
2115
|
+
{
|
|
2116
|
+
min: 1,
|
|
2117
|
+
value: d,
|
|
2118
|
+
onChange: f,
|
|
2119
|
+
placeholder: t,
|
|
2120
|
+
prefix: /* @__PURE__ */ e.jsx("span", { className: "opacity-60 mx-1", children: "H" }),
|
|
2121
|
+
className: "flex-1"
|
|
2122
|
+
}
|
|
2123
|
+
),
|
|
2124
|
+
/* @__PURE__ */ e.jsx(
|
|
2125
|
+
T,
|
|
2126
|
+
{
|
|
2127
|
+
type: "primary",
|
|
2128
|
+
shape: "circle",
|
|
2129
|
+
icon: /* @__PURE__ */ e.jsx(A.Check, { size: 18 }),
|
|
2130
|
+
disabled: !a || !d,
|
|
2131
|
+
onClick: h
|
|
2132
|
+
}
|
|
2133
|
+
),
|
|
2134
|
+
/* @__PURE__ */ e.jsx(F, { title: "Auto size", children: /* @__PURE__ */ e.jsx(
|
|
2135
|
+
T,
|
|
2136
|
+
{
|
|
2137
|
+
type: "primary",
|
|
2138
|
+
shape: "circle",
|
|
2139
|
+
icon: /* @__PURE__ */ e.jsx(A.Maximize, { size: 18 }),
|
|
2140
|
+
disabled: n === "auto",
|
|
2141
|
+
onClick: u
|
|
2142
|
+
}
|
|
2143
|
+
) })
|
|
2144
|
+
] });
|
|
2145
|
+
}, os = Y(() => {
|
|
2146
|
+
var N;
|
|
2147
|
+
const o = ue(null), [t, n] = O(!1), [s, a] = O(500), l = () => {
|
|
2148
|
+
n(!1);
|
|
2149
|
+
}, d = (x) => {
|
|
2150
|
+
if (n(x), x && o.current) {
|
|
2151
|
+
const { height: v, y: H } = o.current.getBoundingClientRect(), _ = document.body.clientHeight - v - H - 80;
|
|
2152
|
+
a(_);
|
|
2153
|
+
}
|
|
2154
|
+
}, f = (x, v) => !(x !== r.option.size.type || v.height !== r.option.frameConf.height || v.width !== r.option.frameConf.width), u = (x) => {
|
|
2155
|
+
if (l(), x.type === "auto" && r.editor.img.width) {
|
|
2156
|
+
const v = Math.round(r.editor.img.width * 0.2);
|
|
2157
|
+
r.option.setSize({ ...x, width: r.editor.img.width + v, height: r.editor.img.height + v });
|
|
2158
|
+
return;
|
|
2159
|
+
}
|
|
2160
|
+
r.option.setSize(x);
|
|
2161
|
+
}, h = (x, v, H) => {
|
|
2162
|
+
l(), r.option.setSize({
|
|
2163
|
+
type: x,
|
|
2164
|
+
title: `${v}${H.title ? ` ${H.title} ` : " "}${H.w} : ${H.h}`,
|
|
2165
|
+
width: H.width,
|
|
2166
|
+
height: H.height
|
|
2167
|
+
});
|
|
2168
|
+
}, g = ((N = r.editor.img) == null ? void 0 : N.src) || r.option.size.type !== "auto", y = /* @__PURE__ */ e.jsx(is, { type: r.option.size.type, frameWidth: r.option.frameConf.width, frameHeight: r.option.frameConf.height, onSet: u }), S = /* @__PURE__ */ e.jsx("div", { className: "border-t border-gray-200 py-2 divide-y", children: ts.map((x) => /* @__PURE__ */ e.jsxs("div", { children: [
|
|
2169
|
+
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((v, H) => /* @__PURE__ */ e.jsxs(
|
|
2171
|
+
T,
|
|
2172
|
+
{
|
|
2173
|
+
type: "text",
|
|
2174
|
+
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, v),
|
|
2176
|
+
onClick: () => h(x.key, x.title, v),
|
|
2177
|
+
children: [
|
|
2178
|
+
/* @__PURE__ */ e.jsx("div", { className: "py-2 px-3 w-full", children: /* @__PURE__ */ e.jsx(
|
|
2179
|
+
"div",
|
|
2180
|
+
{
|
|
2181
|
+
className: "border border-black/50 bg-black/10 w-full flex items-center justify-center rounded-md opacity-75",
|
|
2182
|
+
style: { aspectRatio: v.w / v.h },
|
|
2183
|
+
children: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2184
|
+
v.w,
|
|
2185
|
+
" : ",
|
|
2186
|
+
v.h
|
|
2187
|
+
] })
|
|
2188
|
+
}
|
|
2189
|
+
) }),
|
|
2190
|
+
v.title && /* @__PURE__ */ e.jsx("div", { className: "text-xs", children: v.title }),
|
|
2191
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-xs overflow-hidden text-gray-500", children: [
|
|
2192
|
+
v.width,
|
|
2193
|
+
" x ",
|
|
2194
|
+
v.height
|
|
2195
|
+
] })
|
|
2196
|
+
]
|
|
2197
|
+
},
|
|
2198
|
+
H
|
|
2199
|
+
)) })
|
|
2200
|
+
] }, x.key)) });
|
|
2201
|
+
return /* @__PURE__ */ e.jsx(
|
|
2202
|
+
ge,
|
|
2203
|
+
{
|
|
2204
|
+
content: S,
|
|
2205
|
+
title: y,
|
|
2206
|
+
trigger: "click",
|
|
2207
|
+
arrow: !1,
|
|
2208
|
+
placement: "bottomRight",
|
|
2209
|
+
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",
|
|
2211
|
+
overlayStyle: {
|
|
2212
|
+
width: "400px",
|
|
2213
|
+
height: `${s}px`
|
|
2214
|
+
},
|
|
2215
|
+
onOpenChange: d,
|
|
2216
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: G("px-3 py-1.5 border shrink-0 border-gray-200 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
|
+
/* @__PURE__ */ e.jsx(
|
|
2218
|
+
"div",
|
|
2219
|
+
{
|
|
2220
|
+
className: "border border-black/50 bg-black/10 w-4 rounded-sm",
|
|
2221
|
+
style: { aspectRatio: r.option.frameConf.width / r.option.frameConf.height }
|
|
2222
|
+
}
|
|
2223
|
+
),
|
|
2224
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-xs", children: [
|
|
2225
|
+
/* @__PURE__ */ e.jsx("div", { className: "font-semibold leading-3 mb-0.5", children: r.option.size.title }),
|
|
2226
|
+
g ? /* @__PURE__ */ e.jsxs("div", { className: "text-gray-500 leading-3", children: [
|
|
2227
|
+
r.option.frameConf.width,
|
|
2228
|
+
" x ",
|
|
2229
|
+
r.option.frameConf.height,
|
|
2230
|
+
" px"
|
|
2231
|
+
] }) : /* @__PURE__ */ e.jsx("div", { className: "text-gray-500 leading-3", children: "Adaptive screenshot size" })
|
|
2232
|
+
] }),
|
|
2233
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1" }),
|
|
2234
|
+
t ? /* @__PURE__ */ e.jsx(A.ChevronUp, { size: 16 }) : /* @__PURE__ */ e.jsx(A.ChevronDown, { size: 16 })
|
|
2235
|
+
] })
|
|
2236
|
+
}
|
|
2237
|
+
);
|
|
2238
|
+
}), rs = Y(() => {
|
|
2239
|
+
const o = ue(null), [t, n] = O(!1), s = () => {
|
|
2240
|
+
n(!0);
|
|
2241
|
+
}, a = () => {
|
|
2242
|
+
var d, f;
|
|
2243
|
+
if (typeof ((d = o.current) == null ? void 0 : d.cropper) < "u") {
|
|
2244
|
+
const u = (f = o.current) == null ? void 0 : f.cropper.getCroppedCanvas();
|
|
2245
|
+
if (u) {
|
|
2246
|
+
const { width: h, height: g } = u, y = u.toDataURL();
|
|
2247
|
+
if (r.editor.setImg(Object.assign({}, r.editor.img, {
|
|
2248
|
+
src: y,
|
|
2249
|
+
width: h,
|
|
2250
|
+
height: g
|
|
2251
|
+
})), r.option.size.type === "auto") {
|
|
2252
|
+
const S = Math.round(h * 0.2);
|
|
2253
|
+
r.option.setFrameSize(h + S, g + S);
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
n(!1);
|
|
2258
|
+
}, l = () => {
|
|
2259
|
+
n(!1);
|
|
2260
|
+
};
|
|
2261
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2262
|
+
/* @__PURE__ */ e.jsx(F, { title: "Crop Image", children: /* @__PURE__ */ e.jsx(
|
|
2263
|
+
T,
|
|
2264
|
+
{
|
|
2265
|
+
type: "text",
|
|
2266
|
+
shape: "circle",
|
|
2267
|
+
icon: /* @__PURE__ */ e.jsx(A.Crop, { size: 18 }),
|
|
2268
|
+
onClick: s
|
|
2269
|
+
}
|
|
2270
|
+
) }),
|
|
2271
|
+
/* @__PURE__ */ e.jsx(
|
|
2272
|
+
ci,
|
|
2273
|
+
{
|
|
2274
|
+
title: "Cropper",
|
|
2275
|
+
open: t,
|
|
2276
|
+
onOk: a,
|
|
2277
|
+
onCancel: l,
|
|
2278
|
+
destroyOnClose: !0,
|
|
2279
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2280
|
+
yo,
|
|
2281
|
+
{
|
|
2282
|
+
ref: o,
|
|
2283
|
+
style: { height: 400, width: "100%" },
|
|
2284
|
+
zoomTo: 0.5,
|
|
2285
|
+
initialAspectRatio: r.editor.img.width / r.editor.img.height,
|
|
2286
|
+
src: r.editor.img.src,
|
|
2287
|
+
dragMode: "move",
|
|
2288
|
+
viewMode: 1,
|
|
2289
|
+
minCropBoxHeight: 10,
|
|
2290
|
+
minCropBoxWidth: 10,
|
|
2291
|
+
background: !1,
|
|
2292
|
+
responsive: !0,
|
|
2293
|
+
autoCropArea: 1,
|
|
2294
|
+
checkOrientation: !1,
|
|
2295
|
+
guides: !0
|
|
2296
|
+
}
|
|
2297
|
+
)
|
|
2298
|
+
}
|
|
2299
|
+
)
|
|
2300
|
+
] });
|
|
2301
|
+
}), ss = ["top-left", "top", "top-right", "left", "center", "right", "bottom-left", "bottom", "bottom-right"], ns = Y(() => {
|
|
2302
|
+
const [o, t] = O(!1), n = (l) => {
|
|
2303
|
+
t(l);
|
|
2304
|
+
}, s = (l) => {
|
|
2305
|
+
r.option.setAlign(l);
|
|
2306
|
+
}, a = /* @__PURE__ */ e.jsx("div", { className: G("flex flex-wrap w-24 position-block", r.option.align), children: ss.map((l) => /* @__PURE__ */ e.jsx("div", { className: "w-8 h-8 border border-gray-200 rounded-sm hover:bg-gray-100 cursor-pointer", onClick: () => s(l) }, l)) });
|
|
2307
|
+
return /* @__PURE__ */ e.jsx(
|
|
2308
|
+
ge,
|
|
2309
|
+
{
|
|
2310
|
+
content: a,
|
|
2311
|
+
trigger: "click",
|
|
2312
|
+
arrow: !1,
|
|
2313
|
+
placement: "bottomRight",
|
|
2314
|
+
open: o,
|
|
2315
|
+
onOpenChange: n,
|
|
2316
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2317
|
+
T,
|
|
2318
|
+
{
|
|
2319
|
+
type: "text",
|
|
2320
|
+
shape: "circle",
|
|
2321
|
+
className: G(o && "shadow-md"),
|
|
2322
|
+
icon: /* @__PURE__ */ e.jsx(A.LayoutGrid, { size: 18 })
|
|
2323
|
+
}
|
|
2324
|
+
)
|
|
2325
|
+
}
|
|
2326
|
+
);
|
|
2327
|
+
}), as = Y(() => {
|
|
2328
|
+
const [o, t] = O(!1), [n, s] = O("ShotEasy"), [a, l] = O("#00000030"), [d, f] = O(45), u = (h) => {
|
|
2329
|
+
l(typeof h == "string" ? h : h.toRgbString());
|
|
2330
|
+
};
|
|
2331
|
+
return M(() => {
|
|
2332
|
+
if (o && n.trim()) {
|
|
2333
|
+
const h = zo({
|
|
2334
|
+
text: n,
|
|
2335
|
+
color: a,
|
|
2336
|
+
angleDegrees: d
|
|
2337
|
+
});
|
|
2338
|
+
r.option.setWaterImg(h);
|
|
2339
|
+
} else
|
|
2340
|
+
r.option.setWaterImg(null);
|
|
2341
|
+
}, [o, n, a, d]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2342
|
+
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm flex gap-4 items-center justify-between", children: [
|
|
2343
|
+
/* @__PURE__ */ e.jsx("label", { children: "Watermark" }),
|
|
2344
|
+
/* @__PURE__ */ e.jsx(st, { defaultChecked: o, onChange: t, size: "small", className: "bg-slate-200" })
|
|
2345
|
+
] }),
|
|
2346
|
+
o && /* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-xs grid gap-3 pl-2 pt-2", children: [
|
|
2347
|
+
/* @__PURE__ */ e.jsx(di, { defaultValue: n, placeholder: "Watermark content", onChange: (h) => s(h.target.value) }),
|
|
2348
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2349
|
+
/* @__PURE__ */ e.jsx("label", { children: "Color" }),
|
|
2350
|
+
/* @__PURE__ */ e.jsx(xe, { value: a, onChange: u, size: "small" })
|
|
2351
|
+
] }),
|
|
2352
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2353
|
+
/* @__PURE__ */ e.jsx("label", { children: "Direction" }),
|
|
2354
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(L.Group, { defaultValue: d, onChange: (h) => f(h.target.value), size: "small", children: [
|
|
2355
|
+
/* @__PURE__ */ e.jsx(L.Button, { value: -45, children: /* @__PURE__ */ e.jsx(A.ArrowUpRight, { size: 16, className: "mt-[3px]" }) }),
|
|
2356
|
+
/* @__PURE__ */ e.jsx(L.Button, { value: 45, children: /* @__PURE__ */ e.jsx(A.ArrowDownRight, { size: 16, className: "mt-[3px]" }) })
|
|
2357
|
+
] }) })
|
|
2358
|
+
] }),
|
|
2359
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2360
|
+
/* @__PURE__ */ e.jsx("label", { children: "Only Background" }),
|
|
2361
|
+
/* @__PURE__ */ e.jsx(st, { size: "small", onChange: (h) => r.option.setWaterIndex(h ? -1 : 1), className: "bg-slate-200" })
|
|
2362
|
+
] })
|
|
2363
|
+
] })
|
|
2364
|
+
] });
|
|
2365
|
+
});
|
|
2366
|
+
function ls(o, t, n) {
|
|
2367
|
+
const s = ue(o), a = ue(t);
|
|
2368
|
+
M(() => {
|
|
2369
|
+
s.current = o, a.current = t;
|
|
2370
|
+
}, [...n]), M(() => {
|
|
2371
|
+
const l = Ct(window, {
|
|
2372
|
+
"$mod+KeyS": (d) => {
|
|
2373
|
+
d.preventDefault(), s.current && s.current();
|
|
2374
|
+
},
|
|
2375
|
+
"$mod+KeyC": (d) => {
|
|
2376
|
+
d.preventDefault(), a && a.current();
|
|
2377
|
+
}
|
|
2378
|
+
});
|
|
2379
|
+
return () => {
|
|
2380
|
+
l();
|
|
2381
|
+
};
|
|
2382
|
+
}, [window]);
|
|
2383
|
+
}
|
|
2384
|
+
const cs = Y(() => {
|
|
2385
|
+
var N;
|
|
2386
|
+
const [o, t] = O(!1), [n, s] = O(!1), [a, l] = O("png"), [d, f] = O(1), u = (x) => {
|
|
2387
|
+
s(x);
|
|
2388
|
+
}, h = async () => {
|
|
2389
|
+
if (!r.editor.isEditing || o) return;
|
|
2390
|
+
const x = {
|
|
2391
|
+
pixelRatio: d
|
|
2392
|
+
};
|
|
2393
|
+
["jpg", "webp"].includes(a) && (x.quality = 0.9, x.fill = "#ffffff");
|
|
2394
|
+
const v = he();
|
|
2395
|
+
t(!0), r.editor.message.open({
|
|
2396
|
+
key: v,
|
|
2397
|
+
type: "loading",
|
|
2398
|
+
content: "Downloading..."
|
|
2399
|
+
}), await r.editor.app.tree.export(a, x).then((H) => {
|
|
2400
|
+
let _ = "ShotEasy";
|
|
2401
|
+
d > 1 && (_ += `@${d}`), So(H.data, `${_}.${a}`), r.editor.message.open({
|
|
2402
|
+
key: v,
|
|
2403
|
+
type: "success",
|
|
2404
|
+
content: "Download Success!"
|
|
2405
|
+
});
|
|
2406
|
+
}).catch(() => {
|
|
2407
|
+
r.editor.message.open({
|
|
2408
|
+
key: v,
|
|
2409
|
+
type: "error",
|
|
2410
|
+
content: "Download failed!"
|
|
2411
|
+
});
|
|
2412
|
+
}), t(!1);
|
|
2413
|
+
}, g = async () => {
|
|
2414
|
+
if (!r.editor.isEditing || o) return;
|
|
2415
|
+
const x = he();
|
|
2416
|
+
t(!0), r.editor.message.open({
|
|
2417
|
+
key: x,
|
|
2418
|
+
type: "loading",
|
|
2419
|
+
content: "Copying..."
|
|
2420
|
+
}), await r.editor.app.tree.export("png", { blob: !0, pixelRatio: d }).then(async (v) => {
|
|
2421
|
+
const { data: H } = v;
|
|
2422
|
+
await navigator.clipboard.write([
|
|
2423
|
+
new ClipboardItem({
|
|
2424
|
+
[H.type]: H
|
|
2425
|
+
})
|
|
2426
|
+
]), r.editor.message.open({
|
|
2427
|
+
key: x,
|
|
2428
|
+
type: "success",
|
|
2429
|
+
content: "Copy Success!"
|
|
2430
|
+
});
|
|
2431
|
+
}).catch(() => {
|
|
2432
|
+
r.editor.message.open({
|
|
2433
|
+
key: x,
|
|
2434
|
+
type: "error",
|
|
2435
|
+
content: "Copy failed!"
|
|
2436
|
+
});
|
|
2437
|
+
}), t(!1);
|
|
2438
|
+
}, y = () => {
|
|
2439
|
+
r.editor.clearImg();
|
|
2440
|
+
};
|
|
2441
|
+
ls(() => h(), () => g(), [h, g]);
|
|
2442
|
+
const S = /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "p-2 [&_.ant-segmented]:w-full [&_.ant-segmented-item]:w-[33%]", children: [
|
|
2443
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400 mb-2", children: "Format" }),
|
|
2444
|
+
/* @__PURE__ */ e.jsx(
|
|
2445
|
+
nt,
|
|
2446
|
+
{
|
|
2447
|
+
options: ["png", "jpg", "webp"],
|
|
2448
|
+
size: "middle",
|
|
2449
|
+
onChange: l
|
|
2450
|
+
}
|
|
2451
|
+
),
|
|
2452
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-400 mt-2 mb-2", children: "Pixel Ratio" }),
|
|
2453
|
+
/* @__PURE__ */ e.jsx(
|
|
2454
|
+
nt,
|
|
2455
|
+
{
|
|
2456
|
+
options: [{ value: 1, icon: "1x" }, { value: 2, icon: "2x" }, { value: 3, icon: "3x" }],
|
|
2457
|
+
size: "middle",
|
|
2458
|
+
onChange: f
|
|
2459
|
+
}
|
|
2460
|
+
),
|
|
2461
|
+
r.option.frameConf.width && /* @__PURE__ */ e.jsxs("div", { className: "text-xs p-3 mt-4 flex justify-between bg-black/5 rounded-md", children: [
|
|
2462
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-gray-400", children: "Download Size" }),
|
|
2463
|
+
/* @__PURE__ */ e.jsxs("span", { className: "text-gray-700", children: [
|
|
2464
|
+
r.option.frameConf.width * d,
|
|
2465
|
+
" x ",
|
|
2466
|
+
r.option.frameConf.height * d
|
|
2467
|
+
] })
|
|
2468
|
+
] })
|
|
2469
|
+
] }) });
|
|
2470
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "shrink-0 py-4 px-6 flex gap-2 justify-center items-center", children: [
|
|
2471
|
+
/* @__PURE__ */ e.jsx(
|
|
2472
|
+
fi,
|
|
2473
|
+
{
|
|
2474
|
+
theme: {
|
|
2475
|
+
components: {
|
|
2476
|
+
Button: {
|
|
2477
|
+
colorPrimary: "#000",
|
|
2478
|
+
algorithm: !0
|
|
2479
|
+
// 启用算法
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
},
|
|
2483
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "ant-space-compact flex flex-1", children: [
|
|
2484
|
+
/* @__PURE__ */ e.jsx(F, { placement: "top", title: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2485
|
+
"Download ",
|
|
2486
|
+
ft,
|
|
2487
|
+
" + S"
|
|
2488
|
+
] }), children: /* @__PURE__ */ e.jsx(
|
|
2489
|
+
T,
|
|
2490
|
+
{
|
|
2491
|
+
type: "primary",
|
|
2492
|
+
size: "large",
|
|
2493
|
+
loading: o,
|
|
2494
|
+
icon: /* @__PURE__ */ e.jsx(A.ImageDown, { size: 18 }),
|
|
2495
|
+
className: "rounded-se-none flex-1 rounded-ee-none me-[-1px] hover:z-[1] border-r-white/30",
|
|
2496
|
+
onClick: h,
|
|
2497
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "leading-4 px-2", children: [
|
|
2498
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-sm leading-4 font-semibold", children: "Download" }),
|
|
2499
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-xs", children: [
|
|
2500
|
+
d,
|
|
2501
|
+
"x as ",
|
|
2502
|
+
a.toLocaleUpperCase()
|
|
2503
|
+
] })
|
|
2504
|
+
] })
|
|
2505
|
+
}
|
|
2506
|
+
) }),
|
|
2507
|
+
/* @__PURE__ */ e.jsx(F, { placement: "top", title: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2508
|
+
"Copy ",
|
|
2509
|
+
ft,
|
|
2510
|
+
" + C"
|
|
2511
|
+
] }), children: /* @__PURE__ */ e.jsx(
|
|
2512
|
+
T,
|
|
2513
|
+
{
|
|
2514
|
+
type: "primary",
|
|
2515
|
+
size: "large",
|
|
2516
|
+
icon: /* @__PURE__ */ e.jsx(A.Copy, { size: 18 }),
|
|
2517
|
+
loading: o,
|
|
2518
|
+
className: "rounded-ss-none rounded-es-none border-l-white/30",
|
|
2519
|
+
onClick: g
|
|
2520
|
+
}
|
|
2521
|
+
) })
|
|
2522
|
+
] })
|
|
2523
|
+
}
|
|
2524
|
+
),
|
|
2525
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
2526
|
+
/* @__PURE__ */ e.jsx(
|
|
2527
|
+
ge,
|
|
2528
|
+
{
|
|
2529
|
+
content: S,
|
|
2530
|
+
trigger: "click",
|
|
2531
|
+
arrow: !1,
|
|
2532
|
+
placement: "topRight",
|
|
2533
|
+
open: n,
|
|
2534
|
+
overlayStyle: {
|
|
2535
|
+
width: "320px"
|
|
2536
|
+
},
|
|
2537
|
+
onOpenChange: u,
|
|
2538
|
+
children: /* @__PURE__ */ e.jsx(T, { size: "large", icon: /* @__PURE__ */ e.jsx(A.Settings2, { size: 18 }) })
|
|
2539
|
+
}
|
|
2540
|
+
),
|
|
2541
|
+
((N = r.editor.img) == null ? void 0 : N.src) && /* @__PURE__ */ e.jsx(
|
|
2542
|
+
pi,
|
|
2543
|
+
{
|
|
2544
|
+
title: "Delete the screenshot",
|
|
2545
|
+
description: "Are you sure to delete this screenshot?",
|
|
2546
|
+
onConfirm: y,
|
|
2547
|
+
okText: "Yes",
|
|
2548
|
+
cancelText: "No",
|
|
2549
|
+
children: /* @__PURE__ */ e.jsx(T, { size: "large", icon: /* @__PURE__ */ e.jsx(A.Trash2, { size: 18 }) })
|
|
2550
|
+
}
|
|
2551
|
+
)
|
|
2552
|
+
] })
|
|
2553
|
+
] });
|
|
2554
|
+
}), ds = "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", wt = ["cosmic", "desktop"], pe = ({ type: o, options: t, onChange: n, value: s }) => {
|
|
2555
|
+
let a = [];
|
|
2556
|
+
if (t && t.length)
|
|
2557
|
+
a = t;
|
|
2558
|
+
else {
|
|
2559
|
+
const l = [];
|
|
2560
|
+
Object.keys(Q).map((d) => {
|
|
2561
|
+
d.includes(o) && l.push({
|
|
2562
|
+
key: d,
|
|
2563
|
+
value: Q[d]
|
|
2564
|
+
});
|
|
2565
|
+
}), a = l;
|
|
2566
|
+
}
|
|
2567
|
+
return /* @__PURE__ */ e.jsx(
|
|
2568
|
+
L.Group,
|
|
2569
|
+
{
|
|
2570
|
+
onChange: (l) => n(l.target.value),
|
|
2571
|
+
value: s,
|
|
2572
|
+
rootClassName: G(
|
|
2573
|
+
"grid [&_span]:ps-0",
|
|
2574
|
+
wt.includes(o) ? "grid-cols-5 gap-y-1.5" : "grid-cols-7 gap-y-3"
|
|
2575
|
+
),
|
|
2576
|
+
children: a.map((l, d) => /* @__PURE__ */ e.jsx(
|
|
2577
|
+
L,
|
|
2578
|
+
{
|
|
2579
|
+
className: "[&_.ant-radio]:hidden [&_span]:p-0 mr-0",
|
|
2580
|
+
value: l.key,
|
|
2581
|
+
children: wt.includes(o) ? /* @__PURE__ */ e.jsx("div", { className: G("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: G("w-8 h-8 rounded-full overflow-hidden", l.value.class) })
|
|
2582
|
+
},
|
|
2583
|
+
d
|
|
2584
|
+
))
|
|
2585
|
+
}
|
|
2586
|
+
);
|
|
2587
|
+
}, fs = Y(({ showMore: o, onChange: t }) => {
|
|
2588
|
+
const n = () => {
|
|
2589
|
+
t(!1);
|
|
2590
|
+
}, s = (l) => {
|
|
2591
|
+
const d = l.toHexString();
|
|
2592
|
+
r.option.frameConf.background = {
|
|
2593
|
+
type: "solid",
|
|
2594
|
+
color: d
|
|
2595
|
+
};
|
|
2596
|
+
}, a = (l) => {
|
|
2597
|
+
r.option.setBackground(l);
|
|
2598
|
+
};
|
|
2599
|
+
return /* @__PURE__ */ e.jsx(
|
|
2600
|
+
ui,
|
|
2601
|
+
{
|
|
2602
|
+
title: "",
|
|
2603
|
+
placement: "right",
|
|
2604
|
+
closable: !1,
|
|
2605
|
+
mask: !1,
|
|
2606
|
+
onClose: n,
|
|
2607
|
+
open: o,
|
|
2608
|
+
getContainer: !1,
|
|
2609
|
+
width: "100%",
|
|
2610
|
+
className: "[&_.ant-drawer-body]:p-0",
|
|
2611
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 h-full overflow-hidden", children: [
|
|
2612
|
+
/* @__PURE__ */ e.jsx("div", { className: "shrink-0 pt-4 px-4", children: /* @__PURE__ */ e.jsx(
|
|
2613
|
+
T,
|
|
2614
|
+
{
|
|
2615
|
+
type: "text",
|
|
2616
|
+
size: "small",
|
|
2617
|
+
className: "text-xs flex items-center opacity-80 m-0",
|
|
2618
|
+
icon: /* @__PURE__ */ e.jsx(A.ChevronLeft, { size: 16 }),
|
|
2619
|
+
onClick: () => t(!1),
|
|
2620
|
+
children: "Back"
|
|
2621
|
+
}
|
|
2622
|
+
) }),
|
|
2623
|
+
/* @__PURE__ */ e.jsxs("div", { className: "h-0 flex-1 overflow-y-auto px-4 py-2", children: [
|
|
2624
|
+
/* @__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(xe, { onChange: s, children: /* @__PURE__ */ e.jsx(T, { type: "default", size: "small", shape: "circle", icon: /* @__PURE__ */ e.jsx("img", { src: ds, width: 18 }) }) }) }),
|
|
2626
|
+
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Solid Colors" }),
|
|
2627
|
+
/* @__PURE__ */ e.jsx(pe, { type: "solid", onChange: a, value: r.option.background }),
|
|
2628
|
+
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Gradients" }),
|
|
2629
|
+
/* @__PURE__ */ e.jsx(pe, { type: "gradient", onChange: a, value: r.option.background }),
|
|
2630
|
+
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Cosmic Gradients" }),
|
|
2631
|
+
/* @__PURE__ */ e.jsx(pe, { type: "cosmic", onChange: a, value: r.option.background }),
|
|
2632
|
+
/* @__PURE__ */ e.jsx("h4", { className: "text-sm font-bold py-2", children: "Desktop" }),
|
|
2633
|
+
/* @__PURE__ */ e.jsx(pe, { type: "desktop", onChange: a, value: r.option.background })
|
|
2634
|
+
] })
|
|
2635
|
+
] })
|
|
2636
|
+
}
|
|
2637
|
+
);
|
|
2638
|
+
}), ps = Y(() => {
|
|
2639
|
+
const [o, t] = O(!1), n = (s) => {
|
|
2640
|
+
const a = s.target.value;
|
|
2641
|
+
r.option.setBackground(a);
|
|
2642
|
+
};
|
|
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: [
|
|
2644
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 flex-col gap-2 p-4 overflow-y-auto overflow-x-hidden", children: [
|
|
2645
|
+
/* @__PURE__ */ e.jsx(os, {}),
|
|
2646
|
+
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold pt-2 [&_label]:text-sm", children: [
|
|
2647
|
+
/* @__PURE__ */ e.jsx("label", { children: "Quick" }),
|
|
2648
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-4 items-center py-2", children: [
|
|
2649
|
+
/* @__PURE__ */ e.jsx(rs, {}),
|
|
2650
|
+
/* @__PURE__ */ e.jsx(
|
|
2651
|
+
T,
|
|
2652
|
+
{
|
|
2653
|
+
type: "text",
|
|
2654
|
+
shape: "circle",
|
|
2655
|
+
onClick: () => r.option.toggleFlip("x"),
|
|
2656
|
+
icon: /* @__PURE__ */ e.jsx(A.FlipHorizontal2, { size: 18 })
|
|
2657
|
+
}
|
|
2658
|
+
),
|
|
2659
|
+
/* @__PURE__ */ e.jsx(
|
|
2660
|
+
T,
|
|
2661
|
+
{
|
|
2662
|
+
type: "text",
|
|
2663
|
+
shape: "circle",
|
|
2664
|
+
onClick: () => r.option.toggleFlip("y"),
|
|
2665
|
+
icon: /* @__PURE__ */ e.jsx(A.FlipVertical2, { size: 18 })
|
|
2666
|
+
}
|
|
2667
|
+
),
|
|
2668
|
+
/* @__PURE__ */ e.jsx(ns, {})
|
|
2669
|
+
] })
|
|
2670
|
+
] }),
|
|
2671
|
+
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2672
|
+
/* @__PURE__ */ e.jsx("label", { children: "Scale" }),
|
|
2673
|
+
/* @__PURE__ */ e.jsx(
|
|
2674
|
+
de,
|
|
2675
|
+
{
|
|
2676
|
+
min: 0.1,
|
|
2677
|
+
max: 2,
|
|
2678
|
+
step: 0.1,
|
|
2679
|
+
onChange: (s) => r.option.setScale(s),
|
|
2680
|
+
value: typeof r.option.scale == "number" ? r.option.scale : 1
|
|
2681
|
+
}
|
|
2682
|
+
)
|
|
2683
|
+
] }),
|
|
2684
|
+
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2685
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between", children: [
|
|
2686
|
+
/* @__PURE__ */ e.jsx("label", { children: "Padding" }),
|
|
2687
|
+
/* @__PURE__ */ e.jsx(xe, { value: r.option.paddingBg, onChange: (s) => r.option.setPaddingBg(s.toRgbString()), size: "small" })
|
|
2688
|
+
] }),
|
|
2689
|
+
/* @__PURE__ */ e.jsx(
|
|
2690
|
+
de,
|
|
2691
|
+
{
|
|
2692
|
+
min: 0,
|
|
2693
|
+
max: 60,
|
|
2694
|
+
onChange: (s) => r.option.setPadding(s),
|
|
2695
|
+
value: typeof r.option.padding == "number" ? r.option.padding : 0
|
|
2696
|
+
}
|
|
2697
|
+
)
|
|
2698
|
+
] }),
|
|
2699
|
+
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2700
|
+
/* @__PURE__ */ e.jsx("label", { children: "Rounded" }),
|
|
2701
|
+
/* @__PURE__ */ e.jsx(
|
|
2702
|
+
de,
|
|
2703
|
+
{
|
|
2704
|
+
min: 0,
|
|
2705
|
+
max: 20,
|
|
2706
|
+
onChange: (s) => r.option.setRound(s),
|
|
2707
|
+
value: typeof r.option.round == "number" ? r.option.round : 0
|
|
2708
|
+
}
|
|
2709
|
+
)
|
|
2710
|
+
] }),
|
|
2711
|
+
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2712
|
+
/* @__PURE__ */ e.jsx("label", { children: "Shadow" }),
|
|
2713
|
+
/* @__PURE__ */ e.jsx(
|
|
2714
|
+
de,
|
|
2715
|
+
{
|
|
2716
|
+
min: 0,
|
|
2717
|
+
max: 6,
|
|
2718
|
+
onChange: (s) => r.option.setShadow(s),
|
|
2719
|
+
value: typeof r.option.shadow == "number" ? r.option.shadow : 0
|
|
2720
|
+
}
|
|
2721
|
+
)
|
|
2722
|
+
] }),
|
|
2723
|
+
/* @__PURE__ */ e.jsxs("div", { className: "[&_label]:font-semibold [&_label]:text-sm", children: [
|
|
2724
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
2725
|
+
/* @__PURE__ */ e.jsx("label", { children: "Background" }),
|
|
2726
|
+
/* @__PURE__ */ e.jsxs(
|
|
2727
|
+
T,
|
|
2728
|
+
{
|
|
2729
|
+
type: "text",
|
|
2730
|
+
size: "small",
|
|
2731
|
+
className: "text-xs flex items-center opacity-80 m-0",
|
|
2732
|
+
onClick: () => t(!0),
|
|
2733
|
+
children: [
|
|
2734
|
+
"More ",
|
|
2735
|
+
/* @__PURE__ */ e.jsx(A.ChevronRight, { size: 16 })
|
|
2736
|
+
]
|
|
2737
|
+
}
|
|
2738
|
+
)
|
|
2739
|
+
] }),
|
|
2740
|
+
/* @__PURE__ */ e.jsx("div", { className: "py-3", children: /* @__PURE__ */ e.jsxs(
|
|
2741
|
+
L.Group,
|
|
2742
|
+
{
|
|
2743
|
+
onChange: n,
|
|
2744
|
+
value: r.option.background,
|
|
2745
|
+
rootClassName: "grid grid-cols-7 [&_span]:ps-0",
|
|
2746
|
+
children: [
|
|
2747
|
+
/* @__PURE__ */ e.jsx(L, { className: "[&_.ant-radio]:hidden [&_span]:p-0 mr-0", value: "default_1", children: /* @__PURE__ */ e.jsx("div", { className: G("w-8 h-8 rounded-full", Q.default_1.class) }) }),
|
|
2748
|
+
Object.keys(Q).map((s) => {
|
|
2749
|
+
if (s.includes("default") && s !== "default_1") return /* @__PURE__ */ e.jsx(L, { className: "[&_.ant-radio]:hidden [&_span]:p-0 mr-0", value: s, children: /* @__PURE__ */ e.jsx("div", { className: G("w-8 h-8 rounded-full", Q[s].class) }) }, s);
|
|
2750
|
+
})
|
|
2751
|
+
]
|
|
2752
|
+
}
|
|
2753
|
+
) })
|
|
2754
|
+
] }),
|
|
2755
|
+
/* @__PURE__ */ e.jsx(as, {})
|
|
2756
|
+
] }),
|
|
2757
|
+
/* @__PURE__ */ e.jsx(cs, {}),
|
|
2758
|
+
/* @__PURE__ */ e.jsx(fs, { showMore: o, onChange: t })
|
|
2759
|
+
] });
|
|
2760
|
+
}), us = (o, t = []) => {
|
|
2761
|
+
M(() => {
|
|
2762
|
+
const n = async (s) => {
|
|
2763
|
+
const a = s.clipboardData;
|
|
2764
|
+
if (!a || !a.items) return;
|
|
2765
|
+
const l = Array.from(a.items).filter(
|
|
2766
|
+
(f) => At.includes(f.type)
|
|
2767
|
+
);
|
|
2768
|
+
if (!l.length) return;
|
|
2769
|
+
const d = l[0].getAsFile();
|
|
2770
|
+
o && o(d);
|
|
2771
|
+
};
|
|
2772
|
+
return document.addEventListener("paste", n, !1), () => {
|
|
2773
|
+
document.removeEventListener("paste", n);
|
|
2774
|
+
};
|
|
2775
|
+
}, [...t]);
|
|
2776
|
+
}, hs = async () => {
|
|
2777
|
+
try {
|
|
2778
|
+
const o = await navigator.mediaDevices.getDisplayMedia(), t = document.createElement("video");
|
|
2779
|
+
t.srcObject = o, t.play(), await new Promise((l) => t.onplaying = l);
|
|
2780
|
+
const n = document.createElement("canvas");
|
|
2781
|
+
n.width = t.videoWidth, n.height = t.videoHeight, n.getContext("2d").drawImage(t, 0, 0);
|
|
2782
|
+
const a = n.toDataURL("image/png");
|
|
2783
|
+
return t.srcObject.getTracks().forEach((l) => l.stop()), a;
|
|
2784
|
+
} catch (o) {
|
|
2785
|
+
console.log("Error capturing screen:", o);
|
|
2786
|
+
}
|
|
2787
|
+
}, { Dragger: ms } = hi, gs = Y(() => {
|
|
2788
|
+
const o = async (a, l = "blob") => {
|
|
2789
|
+
const d = window.URL || window.webkitURL || window, f = l === "blob" ? d.createObjectURL(a) : a, u = await Ro(f), h = Math.round(u.width), g = Math.round(u.height);
|
|
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();
|
|
2802
|
+
a && o(a, "dataURL");
|
|
2803
|
+
}, s = () => {
|
|
2804
|
+
r.editor.message.info("Developing, Coming soon!");
|
|
2805
|
+
};
|
|
2806
|
+
return us((a) => {
|
|
2807
|
+
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: G("max-w-[600px]", r.editor.invalid && "invalid"), children: [
|
|
2809
|
+
/* @__PURE__ */ e.jsx(
|
|
2810
|
+
ms,
|
|
2811
|
+
{
|
|
2812
|
+
accept: At.join(","),
|
|
2813
|
+
name: "file",
|
|
2814
|
+
showUploadList: !1,
|
|
2815
|
+
beforeUpload: t,
|
|
2816
|
+
rootClassName: "p-4 rounded-md bg-white block shadow-sm",
|
|
2817
|
+
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(A.ImagePlus, { className: "mx-auto", size: 36 }) }),
|
|
2819
|
+
/* @__PURE__ */ e.jsxs("p", { className: "text-sm px-4", children: [
|
|
2820
|
+
"Click or Drag image to this area",
|
|
2821
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
2822
|
+
"or Paste image"
|
|
2823
|
+
] })
|
|
2824
|
+
] })
|
|
2825
|
+
}
|
|
2826
|
+
),
|
|
2827
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between mt-4 py-4 px-6 rounded-md bg-white shadow-sm", children: [
|
|
2828
|
+
/* @__PURE__ */ e.jsx(F, { placement: "top", arrow: !1, title: "Take a screenshot of desktop windows", children: /* @__PURE__ */ e.jsx(T, { shape: "round", type: "default", size: "large", icon: /* @__PURE__ */ e.jsx(A.Camera, { size: 20 }), onClick: n }) }),
|
|
2829
|
+
/* @__PURE__ */ e.jsx(F, { placement: "top", arrow: !1, title: "Beautify text", children: /* @__PURE__ */ e.jsx(T, { shape: "round", type: "default", size: "large", icon: /* @__PURE__ */ e.jsx(A.Type, { size: 20 }), onClick: s }) }),
|
|
2830
|
+
/* @__PURE__ */ e.jsx(F, { placement: "top", arrow: !1, title: "Beautify Code", children: /* @__PURE__ */ e.jsx(T, { shape: "round", type: "default", size: "large", icon: /* @__PURE__ */ e.jsx(A.CodeXml, { size: 20, onClick: s }) }) }),
|
|
2831
|
+
/* @__PURE__ */ e.jsx(F, { placement: "top", arrow: !1, title: "Create gif animate", children: /* @__PURE__ */ e.jsx(T, { shape: "round", type: "default", size: "large", icon: /* @__PURE__ */ e.jsx(A.ImagePlay, { size: 20, onClick: s }) }) })
|
|
2832
|
+
] })
|
|
2833
|
+
] }) });
|
|
2834
|
+
}), Ys = Y(() => {
|
|
2835
|
+
var s;
|
|
2836
|
+
const o = (s = r.editor.img) != null && s.src ? /* @__PURE__ */ e.jsx(es, {}) : /* @__PURE__ */ e.jsx(gs, {}), [t, n] = mi.useMessage();
|
|
2837
|
+
return M(() => {
|
|
2838
|
+
r.editor.setMessage(t);
|
|
2839
|
+
}, [t]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2840
|
+
n,
|
|
2841
|
+
/* @__PURE__ */ e.jsxs("div", { className: "polka flex flex-col overflow-hidden antialiased w-full h-[100vh]", children: [
|
|
2842
|
+
/* @__PURE__ */ e.jsx(Zo, {}),
|
|
2843
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col flex-1 h-0 md:flex-row md:items-stretch", children: [
|
|
2844
|
+
o,
|
|
2845
|
+
/* @__PURE__ */ e.jsx(ps, {})
|
|
2846
|
+
] })
|
|
2847
|
+
] })
|
|
2848
|
+
] });
|
|
2849
|
+
});
|
|
2850
|
+
export {
|
|
2851
|
+
Ys as ImageBeautifier
|
|
2852
|
+
};
|