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