eddyter 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/style.css +1 -1
- package/dist/components/SpecialCharactersWidget/SpecialCharactersWidget.d.ts +1 -1
- package/dist/{generateDocxThumbnail-DMHM2faY.js → generateDocxThumbnail-BeH7SNAr.js} +1 -1
- package/dist/{generatePdfThumbnail-DPyHgUN3.js → generatePdfThumbnail-CJxW0G8e.js} +1 -1
- package/dist/{generateXlsxThumbnail-DUT9G8ak.js → generateXlsxThumbnail-DyRikb2K.js} +1 -1
- package/dist/{html2pdf.bundle.min-IWThDYz1.js → html2pdf.bundle.min-C6p5g5F8.js} +1 -1
- package/dist/{index-CoePV4Hh.js → index-CXbW2YzF.js} +656 -597
- package/dist/{index-DEq8XY_W.js → index-TGGbJHQ1.js} +17772 -17611
- package/dist/{index-CLkqYaRT.js → index-XFLcBXFz.js} +5 -5
- package/dist/{index-yAe6i5D7.js → index-oZCQTqYq.js} +24 -24
- package/dist/index.js +1 -1
- package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRuleNode.d.ts +2 -0
- package/dist/plugins/CustomHorizontalRulePlugin/OpenHorizontalRuleDialogPlugin.d.ts +6 -0
- package/dist/plugins/CustomHorizontalRulePlugin/index.d.ts +2 -1
- package/dist/ui/Icons.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { I as
|
|
3
|
-
import { CodeNode as
|
|
4
|
-
import { LinkNode as
|
|
5
|
-
import { AutoFocusPlugin as
|
|
6
|
-
import { useCollaborationContext as
|
|
7
|
-
import { useLexicalComposerContext as
|
|
8
|
-
import { ContentEditable as
|
|
9
|
-
import { LexicalErrorBoundary as
|
|
10
|
-
import { HistoryPlugin as
|
|
11
|
-
import { LexicalNestedComposer as
|
|
12
|
-
import { OnChangePlugin as
|
|
13
|
-
import { RichTextPlugin as
|
|
14
|
-
import { useLexicalEditable as
|
|
15
|
-
import { useLexicalNodeSelection as
|
|
16
|
-
import { mergeRegister as
|
|
17
|
-
import { RootNode as
|
|
18
|
-
import
|
|
19
|
-
import { c as
|
|
1
|
+
import { jsx as r, jsxs as h, Fragment as Ft } from "react/jsx-runtime";
|
|
2
|
+
import { I as Ye } from "./ImageResizer-Bt7kgv0a.js";
|
|
3
|
+
import { CodeNode as Jt } from "@lexical/code";
|
|
4
|
+
import { LinkNode as Qt } from "@lexical/link";
|
|
5
|
+
import { AutoFocusPlugin as _e } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
6
|
+
import { useCollaborationContext as Oe } from "@lexical/react/LexicalCollaborationContext";
|
|
7
|
+
import { useLexicalComposerContext as He } from "@lexical/react/LexicalComposerContext";
|
|
8
|
+
import { ContentEditable as Zt } from "@lexical/react/LexicalContentEditable";
|
|
9
|
+
import { LexicalErrorBoundary as te } from "@lexical/react/LexicalErrorBoundary";
|
|
10
|
+
import { HistoryPlugin as ee } from "@lexical/react/LexicalHistoryPlugin";
|
|
11
|
+
import { LexicalNestedComposer as re } from "@lexical/react/LexicalNestedComposer";
|
|
12
|
+
import { OnChangePlugin as oe } from "@lexical/react/LexicalOnChangePlugin";
|
|
13
|
+
import { RichTextPlugin as ie } from "@lexical/react/LexicalRichTextPlugin";
|
|
14
|
+
import { useLexicalEditable as Fe } from "@lexical/react/useLexicalEditable";
|
|
15
|
+
import { useLexicalNodeSelection as Xe } from "@lexical/react/useLexicalNodeSelection";
|
|
16
|
+
import { mergeRegister as Be } from "@lexical/utils";
|
|
17
|
+
import { RootNode as ae, TextNode as ne, LineBreakNode as se, ParagraphNode as de, $isNodeSelection as at, $getSelection as nt, $isParagraphNode as $t, $setSelection as bt, $isRangeSelection as Ue, SELECTION_CHANGE_COMMAND as Ke, COMMAND_PRIORITY_LOW as Q, CLICK_COMMAND as qe, DRAGSTART_COMMAND as Ge, KEY_DELETE_COMMAND as Ve, KEY_BACKSPACE_COMMAND as Je, KEY_ENTER_COMMAND as Qe, KEY_ESCAPE_COMMAND as Ze, $getNodeByKey as st, createCommand as tr } from "lexical";
|
|
18
|
+
import yt, { useState as I, useRef as K, useMemo as Xt, useCallback as S, useEffect as tt, useLayoutEffect as Bt, Suspense as er } from "react";
|
|
19
|
+
import { c as xt, D as ce, a as le, b as ue, d as me, e as ge, f as fe, B as Ut, L as he, i as pe, C as Et, I as rr, S as or, u as ir, $ as Z, t as M, g as ar, h as nr, j as sr, W as dr, k as cr, A as lr, l as ur, m as mr, T as gr, n as fr, o as hr, E as pr, p as br, X as yr, q as xr, r as vr, s as wr } from "./index-TGGbJHQ1.js";
|
|
20
20
|
import "react-dom";
|
|
21
|
-
const
|
|
21
|
+
const be = xt("Crop", [
|
|
22
22
|
["path", { d: "M6 2v14a2 2 0 0 0 2 2h14", key: "ron5a4" }],
|
|
23
23
|
["path", { d: "M18 22V8a2 2 0 0 0-2-2H2", key: "7s9ehn" }]
|
|
24
24
|
]);
|
|
25
|
-
const
|
|
25
|
+
const Cr = xt("Link2", [
|
|
26
26
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
27
27
|
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
28
28
|
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
29
29
|
]);
|
|
30
|
-
const
|
|
30
|
+
const Kt = xt("RectangleHorizontal", [
|
|
31
31
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }]
|
|
32
32
|
]);
|
|
33
|
-
const
|
|
33
|
+
const qt = xt("RectangleVertical", [
|
|
34
34
|
["rect", { width: "12", height: "20", x: "6", y: "2", rx: "2", key: "1oxtiu" }]
|
|
35
35
|
]);
|
|
36
|
-
const
|
|
36
|
+
const Nr = xt("RotateCcw", [
|
|
37
37
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
38
38
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
39
|
-
]),
|
|
39
|
+
]), kr = ({
|
|
40
40
|
open: i,
|
|
41
41
|
onOpenChange: o,
|
|
42
42
|
oldImageUrl: e,
|
|
43
43
|
newImageUrl: d,
|
|
44
|
-
onReplace:
|
|
45
|
-
onCancel:
|
|
46
|
-
}) => /* @__PURE__ */ r(
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
44
|
+
onReplace: w,
|
|
45
|
+
onCancel: x
|
|
46
|
+
}) => /* @__PURE__ */ r(ce, { open: i, onOpenChange: o, children: /* @__PURE__ */ h(le, { className: "sm:max-w-[800px] max-h-[90vh] overflow-y-auto", children: [
|
|
47
|
+
/* @__PURE__ */ h(ue, { children: [
|
|
48
|
+
/* @__PURE__ */ h(me, { className: "flex items-center gap-2 text-xl", children: [
|
|
49
49
|
/* @__PURE__ */ r("span", { className: "text-2xl", children: "🔄" }),
|
|
50
50
|
"Compare Images"
|
|
51
51
|
] }),
|
|
52
|
-
/* @__PURE__ */ r(
|
|
52
|
+
/* @__PURE__ */ r(ge, { className: "text-sm pt-1", children: "Choose whether to replace the original image with the refined version." })
|
|
53
53
|
] }),
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ h("div", { className: "space-y-4 py-4", children: [
|
|
55
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-4", children: /* @__PURE__ */ h("div", { className: "space-y-2", children: [
|
|
56
|
+
/* @__PURE__ */ h("div", { className: "flex items-center justify-between", children: [
|
|
57
57
|
/* @__PURE__ */ r("span", { className: "text-sm font-semibold text-gray-700 dark:text-gray-300", children: "Refined Image" }),
|
|
58
58
|
/* @__PURE__ */ r("span", { className: "text-xs px-2 py-1 rounded-full bg-blue-100 dark:bg-blue-950/30 text-blue-600 dark:text-blue-400", children: "New" })
|
|
59
59
|
] }),
|
|
@@ -66,24 +66,24 @@ const fr = ft("RotateCcw", [
|
|
|
66
66
|
}
|
|
67
67
|
) })
|
|
68
68
|
] }) }),
|
|
69
|
-
/* @__PURE__ */ r("div", { className: "p-3 rounded-lg bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800", children: /* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ r("div", { className: "p-3 rounded-lg bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800", children: /* @__PURE__ */ h("p", { className: "text-sm text-blue-800 dark:text-blue-200", children: [
|
|
70
70
|
/* @__PURE__ */ r("span", { className: "font-semibold", children: "Note:" }),
|
|
71
71
|
' Clicking "Replace" will update the image in your document. This action cannot be undone.'
|
|
72
72
|
] }) })
|
|
73
73
|
] }),
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ h(fe, { className: "gap-2", children: [
|
|
75
75
|
/* @__PURE__ */ r(
|
|
76
|
-
|
|
76
|
+
Ut,
|
|
77
77
|
{
|
|
78
78
|
variant: "outline",
|
|
79
|
-
onClick:
|
|
79
|
+
onClick: x,
|
|
80
80
|
children: "Keep Original"
|
|
81
81
|
}
|
|
82
82
|
),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
83
|
+
/* @__PURE__ */ h(
|
|
84
|
+
Ut,
|
|
85
85
|
{
|
|
86
|
-
onClick:
|
|
86
|
+
onClick: w,
|
|
87
87
|
className: "bg-blue-500 hover:bg-blue-600 text-white",
|
|
88
88
|
children: [
|
|
89
89
|
/* @__PURE__ */ r("span", { className: "mr-2", children: "✓" }),
|
|
@@ -93,27 +93,27 @@ const fr = ft("RotateCcw", [
|
|
|
93
93
|
)
|
|
94
94
|
] })
|
|
95
95
|
] }) });
|
|
96
|
-
function
|
|
96
|
+
function Rr({
|
|
97
97
|
caption: i
|
|
98
98
|
}) {
|
|
99
|
-
return /* @__PURE__ */ r("div", { className: "signature-caption-container", children: /* @__PURE__ */
|
|
100
|
-
|
|
99
|
+
return /* @__PURE__ */ r("div", { className: "signature-caption-container", children: /* @__PURE__ */ h(
|
|
100
|
+
re,
|
|
101
101
|
{
|
|
102
102
|
initialEditor: i,
|
|
103
103
|
initialNodes: [
|
|
104
|
+
ae,
|
|
105
|
+
ne,
|
|
106
|
+
se,
|
|
107
|
+
de,
|
|
104
108
|
Qt,
|
|
105
|
-
|
|
106
|
-
te,
|
|
107
|
-
ee,
|
|
108
|
-
Bt,
|
|
109
|
-
Xt
|
|
109
|
+
Jt
|
|
110
110
|
],
|
|
111
111
|
children: [
|
|
112
112
|
/* @__PURE__ */ r(
|
|
113
|
-
|
|
113
|
+
ie,
|
|
114
114
|
{
|
|
115
115
|
contentEditable: /* @__PURE__ */ r(
|
|
116
|
-
|
|
116
|
+
Zt,
|
|
117
117
|
{
|
|
118
118
|
"aria-placeholder": "Enter signature name...",
|
|
119
119
|
placeholder: /* @__PURE__ */ r("div", { style: {
|
|
@@ -129,30 +129,30 @@ function br({
|
|
|
129
129
|
className: "signature-caption-editable"
|
|
130
130
|
}
|
|
131
131
|
),
|
|
132
|
-
ErrorBoundary:
|
|
132
|
+
ErrorBoundary: te
|
|
133
133
|
}
|
|
134
134
|
),
|
|
135
|
-
/* @__PURE__ */ r(
|
|
135
|
+
/* @__PURE__ */ r(oe, { onChange: () => {
|
|
136
136
|
} }),
|
|
137
|
-
/* @__PURE__ */ r(
|
|
138
|
-
/* @__PURE__ */ r(
|
|
137
|
+
/* @__PURE__ */ r(ee, {}),
|
|
138
|
+
/* @__PURE__ */ r(he, { namespace: pe.namespace })
|
|
139
139
|
]
|
|
140
140
|
}
|
|
141
141
|
) });
|
|
142
142
|
}
|
|
143
|
-
const
|
|
144
|
-
function
|
|
145
|
-
if (!
|
|
143
|
+
const Er = "/transform-image/";
|
|
144
|
+
function gt(i) {
|
|
145
|
+
if (!Et || i.startsWith("data:") || i.toLowerCase().endsWith(".svg"))
|
|
146
146
|
return !1;
|
|
147
147
|
try {
|
|
148
|
-
const o = new URL(i).origin, e = new URL(
|
|
148
|
+
const o = new URL(i).origin, e = new URL(Et).origin;
|
|
149
149
|
return o === e;
|
|
150
150
|
} catch {
|
|
151
151
|
return !1;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
if (!
|
|
154
|
+
function ye(i) {
|
|
155
|
+
if (!gt(i))
|
|
156
156
|
return null;
|
|
157
157
|
try {
|
|
158
158
|
const e = new URL(i).pathname.replace(/^\//, ""), d = "transform-image/";
|
|
@@ -161,17 +161,17 @@ function ue(i) {
|
|
|
161
161
|
return null;
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
if (!
|
|
164
|
+
function Ir(i, o) {
|
|
165
|
+
if (!gt(i))
|
|
166
166
|
return i;
|
|
167
|
-
const e =
|
|
167
|
+
const e = ye(i);
|
|
168
168
|
if (!e)
|
|
169
169
|
return i;
|
|
170
170
|
const d = `${o.x},${o.y},${o.width},${o.height}`;
|
|
171
|
-
return `${
|
|
171
|
+
return `${Et.replace(/\/$/, "")}${Er}${e}?crop=${d}`;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
if (!
|
|
173
|
+
function Gt(i) {
|
|
174
|
+
if (!gt(i))
|
|
175
175
|
return i;
|
|
176
176
|
try {
|
|
177
177
|
const o = new URL(i);
|
|
@@ -180,21 +180,21 @@ function Ht(i) {
|
|
|
180
180
|
return i;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
if (!
|
|
185
|
-
return
|
|
186
|
-
const o =
|
|
187
|
-
return o ? `${
|
|
183
|
+
function kt(i) {
|
|
184
|
+
if (!gt(i))
|
|
185
|
+
return Gt(i);
|
|
186
|
+
const o = ye(i);
|
|
187
|
+
return o ? `${Et.replace(/\/$/, "")}/${o}` : Gt(i);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function Pr(i) {
|
|
190
190
|
if (typeof document > "u")
|
|
191
191
|
return;
|
|
192
192
|
let o = document.head || document.getElementsByTagName("head")[0], e = document.createElement("style");
|
|
193
193
|
e.type = "text/css", o.appendChild(e), e.styleSheet ? e.styleSheet.cssText = i : e.appendChild(document.createTextNode(i));
|
|
194
194
|
}
|
|
195
195
|
Array(12).fill(0);
|
|
196
|
-
let
|
|
197
|
-
class
|
|
196
|
+
let Tt = 1;
|
|
197
|
+
class Sr {
|
|
198
198
|
constructor() {
|
|
199
199
|
this.subscribe = (o) => (this.subscribers.push(o), () => {
|
|
200
200
|
const e = this.subscribers.indexOf(o);
|
|
@@ -208,24 +208,24 @@ class wr {
|
|
|
208
208
|
];
|
|
209
209
|
}, this.create = (o) => {
|
|
210
210
|
var e;
|
|
211
|
-
const { message: d, ...
|
|
212
|
-
return this.dismissedToasts.has(
|
|
213
|
-
...
|
|
211
|
+
const { message: d, ...w } = o, x = typeof o?.id == "number" || ((e = o.id) == null ? void 0 : e.length) > 0 ? o.id : Tt++, L = this.toasts.find((N) => N.id === x), P = o.dismissible === void 0 ? !0 : o.dismissible;
|
|
212
|
+
return this.dismissedToasts.has(x) && this.dismissedToasts.delete(x), L ? this.toasts = this.toasts.map((N) => N.id === x ? (this.publish({
|
|
213
|
+
...N,
|
|
214
214
|
...o,
|
|
215
|
-
id:
|
|
215
|
+
id: x,
|
|
216
216
|
title: d
|
|
217
217
|
}), {
|
|
218
|
-
...
|
|
218
|
+
...N,
|
|
219
219
|
...o,
|
|
220
|
-
id:
|
|
220
|
+
id: x,
|
|
221
221
|
dismissible: P,
|
|
222
222
|
title: d
|
|
223
|
-
}) :
|
|
223
|
+
}) : N) : this.addToast({
|
|
224
224
|
title: d,
|
|
225
|
-
...
|
|
225
|
+
...w,
|
|
226
226
|
dismissible: P,
|
|
227
|
-
id:
|
|
228
|
-
}),
|
|
227
|
+
id: x
|
|
228
|
+
}), x;
|
|
229
229
|
}, this.dismiss = (o) => (o ? (this.dismissedToasts.add(o), requestAnimationFrame(() => this.subscribers.forEach((e) => e({
|
|
230
230
|
id: o,
|
|
231
231
|
dismiss: !0
|
|
@@ -268,59 +268,59 @@ class wr {
|
|
|
268
268
|
message: e.loading,
|
|
269
269
|
description: typeof e.description != "function" ? e.description : void 0
|
|
270
270
|
}));
|
|
271
|
-
const
|
|
272
|
-
let
|
|
273
|
-
const P =
|
|
271
|
+
const w = Promise.resolve(o instanceof Function ? o() : o);
|
|
272
|
+
let x = d !== void 0, L;
|
|
273
|
+
const P = w.then(async (C) => {
|
|
274
274
|
if (L = [
|
|
275
275
|
"resolve",
|
|
276
|
-
|
|
277
|
-
],
|
|
278
|
-
|
|
276
|
+
C
|
|
277
|
+
], yt.isValidElement(C))
|
|
278
|
+
x = !1, this.create({
|
|
279
279
|
id: d,
|
|
280
280
|
type: "default",
|
|
281
|
-
message:
|
|
281
|
+
message: C
|
|
282
282
|
});
|
|
283
|
-
else if (
|
|
284
|
-
|
|
285
|
-
const c = typeof e.error == "function" ? await e.error(`HTTP error! status: ${
|
|
283
|
+
else if (Mr(C) && !C.ok) {
|
|
284
|
+
x = !1;
|
|
285
|
+
const c = typeof e.error == "function" ? await e.error(`HTTP error! status: ${C.status}`) : e.error, k = typeof e.description == "function" ? await e.description(`HTTP error! status: ${C.status}`) : e.description, D = typeof c == "object" && !yt.isValidElement(c) ? c : {
|
|
286
286
|
message: c
|
|
287
287
|
};
|
|
288
288
|
this.create({
|
|
289
289
|
id: d,
|
|
290
290
|
type: "error",
|
|
291
|
-
description:
|
|
292
|
-
...
|
|
291
|
+
description: k,
|
|
292
|
+
...D
|
|
293
293
|
});
|
|
294
|
-
} else if (
|
|
295
|
-
|
|
296
|
-
const c = typeof e.error == "function" ? await e.error(
|
|
294
|
+
} else if (C instanceof Error) {
|
|
295
|
+
x = !1;
|
|
296
|
+
const c = typeof e.error == "function" ? await e.error(C) : e.error, k = typeof e.description == "function" ? await e.description(C) : e.description, D = typeof c == "object" && !yt.isValidElement(c) ? c : {
|
|
297
297
|
message: c
|
|
298
298
|
};
|
|
299
299
|
this.create({
|
|
300
300
|
id: d,
|
|
301
301
|
type: "error",
|
|
302
|
-
description:
|
|
303
|
-
...
|
|
302
|
+
description: k,
|
|
303
|
+
...D
|
|
304
304
|
});
|
|
305
305
|
} else if (e.success !== void 0) {
|
|
306
|
-
|
|
307
|
-
const c = typeof e.success == "function" ? await e.success(
|
|
306
|
+
x = !1;
|
|
307
|
+
const c = typeof e.success == "function" ? await e.success(C) : e.success, k = typeof e.description == "function" ? await e.description(C) : e.description, D = typeof c == "object" && !yt.isValidElement(c) ? c : {
|
|
308
308
|
message: c
|
|
309
309
|
};
|
|
310
310
|
this.create({
|
|
311
311
|
id: d,
|
|
312
312
|
type: "success",
|
|
313
|
-
description:
|
|
314
|
-
...
|
|
313
|
+
description: k,
|
|
314
|
+
...D
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
|
-
}).catch(async (
|
|
317
|
+
}).catch(async (C) => {
|
|
318
318
|
if (L = [
|
|
319
319
|
"reject",
|
|
320
|
-
|
|
320
|
+
C
|
|
321
321
|
], e.error !== void 0) {
|
|
322
|
-
|
|
323
|
-
const E = typeof e.error == "function" ? await e.error(
|
|
322
|
+
x = !1;
|
|
323
|
+
const E = typeof e.error == "function" ? await e.error(C) : e.error, c = typeof e.description == "function" ? await e.description(C) : e.description, v = typeof E == "object" && !yt.isValidElement(E) ? E : {
|
|
324
324
|
message: E
|
|
325
325
|
};
|
|
326
326
|
this.create({
|
|
@@ -331,15 +331,15 @@ class wr {
|
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
333
|
}).finally(() => {
|
|
334
|
-
|
|
335
|
-
}),
|
|
334
|
+
x && (this.dismiss(d), d = void 0), e.finally == null || e.finally.call(e);
|
|
335
|
+
}), N = () => new Promise((C, E) => P.then(() => L[0] === "reject" ? E(L[1]) : C(L[1])).catch(E));
|
|
336
336
|
return typeof d != "string" && typeof d != "number" ? {
|
|
337
|
-
unwrap:
|
|
337
|
+
unwrap: N
|
|
338
338
|
} : Object.assign(d, {
|
|
339
|
-
unwrap:
|
|
339
|
+
unwrap: N
|
|
340
340
|
});
|
|
341
341
|
}, this.custom = (o, e) => {
|
|
342
|
-
const d = e?.id ||
|
|
342
|
+
const d = e?.id || Tt++;
|
|
343
343
|
return this.create({
|
|
344
344
|
jsx: o(d),
|
|
345
345
|
id: d,
|
|
@@ -348,41 +348,41 @@ class wr {
|
|
|
348
348
|
}, this.getActiveToasts = () => this.toasts.filter((o) => !this.dismissedToasts.has(o.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
const
|
|
352
|
-
const e = o?.id ||
|
|
353
|
-
return
|
|
351
|
+
const W = new Sr(), zr = (i, o) => {
|
|
352
|
+
const e = o?.id || Tt++;
|
|
353
|
+
return W.addToast({
|
|
354
354
|
title: i,
|
|
355
355
|
...o,
|
|
356
356
|
id: e
|
|
357
357
|
}), e;
|
|
358
|
-
},
|
|
359
|
-
success:
|
|
360
|
-
info:
|
|
361
|
-
warning:
|
|
362
|
-
error:
|
|
363
|
-
custom:
|
|
364
|
-
message:
|
|
365
|
-
promise:
|
|
366
|
-
dismiss:
|
|
367
|
-
loading:
|
|
358
|
+
}, Mr = (i) => i && typeof i == "object" && "ok" in i && typeof i.ok == "boolean" && "status" in i && typeof i.status == "number", Ar = zr, Dr = () => W.toasts, Lr = () => W.getActiveToasts(), $r = Object.assign(Ar, {
|
|
359
|
+
success: W.success,
|
|
360
|
+
info: W.info,
|
|
361
|
+
warning: W.warning,
|
|
362
|
+
error: W.error,
|
|
363
|
+
custom: W.custom,
|
|
364
|
+
message: W.message,
|
|
365
|
+
promise: W.promise,
|
|
366
|
+
dismiss: W.dismiss,
|
|
367
|
+
loading: W.loading
|
|
368
368
|
}, {
|
|
369
|
-
getHistory:
|
|
370
|
-
getToasts:
|
|
369
|
+
getHistory: Dr,
|
|
370
|
+
getToasts: Lr
|
|
371
371
|
});
|
|
372
|
-
vr("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
|
|
373
|
-
function
|
|
372
|
+
Pr("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
|
|
373
|
+
function Tr({
|
|
374
374
|
open: i,
|
|
375
375
|
onOpenChange: o,
|
|
376
376
|
src: e,
|
|
377
377
|
altText: d,
|
|
378
|
-
width:
|
|
379
|
-
height:
|
|
378
|
+
width: w,
|
|
379
|
+
height: x,
|
|
380
380
|
onCropApply: L
|
|
381
381
|
}) {
|
|
382
|
-
const [P,
|
|
382
|
+
const [P, N] = I("freeform"), [C, E] = I(e), [c, k] = I(!1), v = K(null), D = K(null), [n, T] = I({ x: 0, y: 0, width: 0, height: 0 }), [R, $] = I({ x: 0, y: 0, width: 0, height: 0 }), et = K(null), dt = Xt(() => typeof w == "number" && typeof x == "number" && x > 0 ? w / x : n.width > 0 && n.height > 0 ? n.width / n.height : null, [n.height, n.width, x, w]), ft = Xt(() => {
|
|
383
383
|
switch (P) {
|
|
384
384
|
case "original":
|
|
385
|
-
return
|
|
385
|
+
return dt;
|
|
386
386
|
case "1:1":
|
|
387
387
|
return 1;
|
|
388
388
|
case "4:3":
|
|
@@ -396,14 +396,14 @@ function Ir({
|
|
|
396
396
|
default:
|
|
397
397
|
return null;
|
|
398
398
|
}
|
|
399
|
-
}, [
|
|
399
|
+
}, [dt, P]), m = 24, j = S(
|
|
400
400
|
(s) => {
|
|
401
|
-
let { x:
|
|
402
|
-
const O = n.width,
|
|
403
|
-
return
|
|
401
|
+
let { x: p, y: b, width: g, height: y } = s;
|
|
402
|
+
const O = n.width, ct = n.height;
|
|
403
|
+
return p = Math.max(0, Math.min(p, O - m)), b = Math.max(0, Math.min(b, ct - m)), g = Math.max(m, Math.min(g, O - p)), y = Math.max(m, Math.min(y, ct - b)), { x: p, y: b, width: g, height: y };
|
|
404
404
|
},
|
|
405
405
|
[n.height, n.width]
|
|
406
|
-
),
|
|
406
|
+
), ht = S(
|
|
407
407
|
(s) => {
|
|
408
408
|
if (n.width <= 0 || n.height <= 0)
|
|
409
409
|
return;
|
|
@@ -416,34 +416,34 @@ function Ir({
|
|
|
416
416
|
});
|
|
417
417
|
return;
|
|
418
418
|
}
|
|
419
|
-
const
|
|
420
|
-
let
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
x: (n.width -
|
|
424
|
-
y: (n.height -
|
|
425
|
-
width:
|
|
426
|
-
height:
|
|
419
|
+
const p = n.width * 0.9, b = n.height * 0.9;
|
|
420
|
+
let g = p, y = g / s;
|
|
421
|
+
y > b && (y = b, g = y * s), $(
|
|
422
|
+
j({
|
|
423
|
+
x: (n.width - g) / 2,
|
|
424
|
+
y: (n.height - y) / 2,
|
|
425
|
+
width: g,
|
|
426
|
+
height: y
|
|
427
427
|
})
|
|
428
428
|
);
|
|
429
429
|
},
|
|
430
|
-
[n.height, n.width,
|
|
431
|
-
),
|
|
432
|
-
const s = v.current,
|
|
433
|
-
if (!s || !
|
|
430
|
+
[n.height, n.width, j]
|
|
431
|
+
), rt = S(() => {
|
|
432
|
+
const s = v.current, p = D.current;
|
|
433
|
+
if (!s || !p)
|
|
434
434
|
return;
|
|
435
|
-
let
|
|
436
|
-
for (;
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
x:
|
|
440
|
-
y:
|
|
441
|
-
width:
|
|
442
|
-
height:
|
|
435
|
+
let b = 0, g = 0, y = p;
|
|
436
|
+
for (; y && y !== s; )
|
|
437
|
+
b += y.offsetLeft, g += y.offsetTop, y = y.offsetParent;
|
|
438
|
+
T({
|
|
439
|
+
x: b,
|
|
440
|
+
y: g,
|
|
441
|
+
width: p.offsetWidth,
|
|
442
|
+
height: p.offsetHeight
|
|
443
443
|
});
|
|
444
|
-
}, []),
|
|
444
|
+
}, []), q = S(
|
|
445
445
|
(s) => {
|
|
446
|
-
n.width <= 0 || n.height <= 0 || (s.preventDefault(), s.stopPropagation(), s.target.setPointerCapture?.(s.pointerId),
|
|
446
|
+
n.width <= 0 || n.height <= 0 || (s.preventDefault(), s.stopPropagation(), s.target.setPointerCapture?.(s.pointerId), et.current = {
|
|
447
447
|
mode: "move",
|
|
448
448
|
startX: s.clientX,
|
|
449
449
|
startY: s.clientY,
|
|
@@ -451,100 +451,100 @@ function Ir({
|
|
|
451
451
|
});
|
|
452
452
|
},
|
|
453
453
|
[n.height, n.width, R]
|
|
454
|
-
),
|
|
455
|
-
(s,
|
|
456
|
-
n.width <= 0 || n.height <= 0 || (s.preventDefault(), s.stopPropagation(), s.target.setPointerCapture?.(s.pointerId),
|
|
457
|
-
mode:
|
|
454
|
+
), It = S(
|
|
455
|
+
(s, p) => {
|
|
456
|
+
n.width <= 0 || n.height <= 0 || (s.preventDefault(), s.stopPropagation(), s.target.setPointerCapture?.(s.pointerId), et.current = {
|
|
457
|
+
mode: p,
|
|
458
458
|
startX: s.clientX,
|
|
459
459
|
startY: s.clientY,
|
|
460
460
|
initialRect: { ...R }
|
|
461
461
|
});
|
|
462
462
|
},
|
|
463
463
|
[n.height, n.width, R]
|
|
464
|
-
),
|
|
464
|
+
), Pt = S(async () => {
|
|
465
465
|
if (n.width <= 0 || n.height <= 0) {
|
|
466
466
|
o(!1);
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
469
|
-
const s =
|
|
469
|
+
const s = D.current;
|
|
470
470
|
if (!s || !s.naturalWidth || !s.naturalHeight) {
|
|
471
|
-
|
|
471
|
+
$r.error("Could not read image dimensions");
|
|
472
472
|
return;
|
|
473
473
|
}
|
|
474
|
-
const
|
|
475
|
-
x: Math.max(0, Math.round(R.x *
|
|
476
|
-
y: Math.max(0, Math.round(R.y *
|
|
477
|
-
width: Math.max(1, Math.round(R.width *
|
|
478
|
-
height: Math.max(1, Math.round(R.height *
|
|
474
|
+
const p = s.naturalWidth / n.width, b = s.naturalHeight / n.height, g = {
|
|
475
|
+
x: Math.max(0, Math.round(R.x * p)),
|
|
476
|
+
y: Math.max(0, Math.round(R.y * b)),
|
|
477
|
+
width: Math.max(1, Math.round(R.width * p)),
|
|
478
|
+
height: Math.max(1, Math.round(R.height * b)),
|
|
479
479
|
naturalWidth: s.naturalWidth,
|
|
480
480
|
naturalHeight: s.naturalHeight
|
|
481
481
|
};
|
|
482
|
-
|
|
482
|
+
g.width = Math.min(g.width, s.naturalWidth - g.x), g.height = Math.min(g.height, s.naturalHeight - g.y), await Promise.resolve(L(g)), o(!1);
|
|
483
483
|
}, [n, R, L, o]);
|
|
484
|
-
return
|
|
485
|
-
i && (
|
|
486
|
-
}, [i, e]),
|
|
484
|
+
return tt(() => {
|
|
485
|
+
i && (T({ x: 0, y: 0, width: 0, height: 0 }), $({ x: 0, y: 0, width: 0, height: 0 }), k(!1), E(kt(e)));
|
|
486
|
+
}, [i, e]), tt(() => {
|
|
487
487
|
if (!i)
|
|
488
488
|
return;
|
|
489
489
|
const s = v.current;
|
|
490
490
|
if (!s)
|
|
491
491
|
return;
|
|
492
|
-
const
|
|
493
|
-
|
|
492
|
+
const p = new ResizeObserver(() => {
|
|
493
|
+
rt();
|
|
494
494
|
});
|
|
495
|
-
|
|
496
|
-
const
|
|
497
|
-
|
|
498
|
-
const
|
|
499
|
-
return window.addEventListener("resize",
|
|
500
|
-
|
|
495
|
+
p.observe(s);
|
|
496
|
+
const b = D.current;
|
|
497
|
+
b && p.observe(b);
|
|
498
|
+
const g = () => rt();
|
|
499
|
+
return window.addEventListener("resize", g), () => {
|
|
500
|
+
p.disconnect(), window.removeEventListener("resize", g);
|
|
501
501
|
};
|
|
502
|
-
}, [i,
|
|
502
|
+
}, [i, rt]), tt(() => {
|
|
503
503
|
if (!i)
|
|
504
504
|
return;
|
|
505
|
-
const s = (
|
|
506
|
-
const
|
|
507
|
-
if (!
|
|
505
|
+
const s = (b) => {
|
|
506
|
+
const g = et.current;
|
|
507
|
+
if (!g)
|
|
508
508
|
return;
|
|
509
|
-
|
|
510
|
-
const
|
|
511
|
-
if (
|
|
512
|
-
const
|
|
509
|
+
b.preventDefault();
|
|
510
|
+
const y = b.clientX - g.startX, O = b.clientY - g.startY, ct = n.width, lt = n.height, G = ft ?? null, { x: B, y: ot, width: Y, height: U } = g.initialRect;
|
|
511
|
+
if (g.mode === "move") {
|
|
512
|
+
const ut = Math.max(0, ct - Y), vt = Math.max(0, lt - U);
|
|
513
513
|
$(
|
|
514
|
-
|
|
515
|
-
x: Math.max(0, Math.min(
|
|
516
|
-
y: Math.max(0, Math.min(
|
|
517
|
-
width:
|
|
518
|
-
height:
|
|
514
|
+
j({
|
|
515
|
+
x: Math.max(0, Math.min(ut, B + y)),
|
|
516
|
+
y: Math.max(0, Math.min(vt, ot + O)),
|
|
517
|
+
width: Y,
|
|
518
|
+
height: U
|
|
519
519
|
})
|
|
520
520
|
);
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
|
-
const
|
|
524
|
-
let
|
|
525
|
-
|
|
526
|
-
},
|
|
527
|
-
|
|
523
|
+
const A = g.mode;
|
|
524
|
+
let _ = B, V = ot, H = Y, F = U;
|
|
525
|
+
A.includes("e") && (H = Y + y), A.includes("w") && (_ = B + y, H = Y - y), A.includes("s") && (F = U + O), A.includes("n") && (V = ot + O, F = U - O), G != null && G > 0 && (A === "e" || A === "w" ? (F = H / G, A.includes("n") && (V = ot + U - F)) : A === "n" || A === "s" ? (H = F * G, A.includes("w") && (_ = B + Y - H)) : (F = H / G, A.includes("n") && (V = ot + U - F), A.includes("w") && (_ = B + Y - H))), $(j({ x: _, y: V, width: H, height: F }));
|
|
526
|
+
}, p = () => {
|
|
527
|
+
et.current = null;
|
|
528
528
|
};
|
|
529
|
-
return window.addEventListener("pointermove", s), window.addEventListener("pointerup",
|
|
530
|
-
window.removeEventListener("pointermove", s), window.removeEventListener("pointerup",
|
|
529
|
+
return window.addEventListener("pointermove", s), window.addEventListener("pointerup", p), () => {
|
|
530
|
+
window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", p);
|
|
531
531
|
};
|
|
532
532
|
}, [
|
|
533
533
|
i,
|
|
534
534
|
n.width,
|
|
535
535
|
n.height,
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
]),
|
|
539
|
-
i &&
|
|
540
|
-
}, [i,
|
|
541
|
-
|
|
536
|
+
ft,
|
|
537
|
+
j
|
|
538
|
+
]), tt(() => {
|
|
539
|
+
i && ht(ft);
|
|
540
|
+
}, [i, ft, n, ht]), /* @__PURE__ */ r(ce, { open: i, onOpenChange: o, children: /* @__PURE__ */ r(
|
|
541
|
+
le,
|
|
542
542
|
{
|
|
543
543
|
className: "sm:cteditor-max-w-[860px] cteditor-max-w-[calc(100%-2rem)] cteditor-rounded-xl cteditor-overflow-hidden cteditor-p-0",
|
|
544
544
|
onClick: (s) => s.stopPropagation(),
|
|
545
545
|
onPointerDown: (s) => s.stopPropagation(),
|
|
546
|
-
children: /* @__PURE__ */
|
|
547
|
-
/* @__PURE__ */ r("div", { className: "cteditor-bg-muted/20 cteditor-p-4 md:cteditor-p-6", children: /* @__PURE__ */
|
|
546
|
+
children: /* @__PURE__ */ h("div", { className: "cteditor-grid md:cteditor-grid-cols-[1.4fr_320px]", children: [
|
|
547
|
+
/* @__PURE__ */ r("div", { className: "cteditor-bg-muted/20 cteditor-p-4 md:cteditor-p-6", children: /* @__PURE__ */ h(
|
|
548
548
|
"div",
|
|
549
549
|
{
|
|
550
550
|
ref: v,
|
|
@@ -553,23 +553,23 @@ function Ir({
|
|
|
553
553
|
/* @__PURE__ */ r("div", { className: "cteditor-overflow-hidden cteditor-rounded-lg cteditor-flex cteditor-items-center cteditor-justify-center cteditor-w-full", children: c ? /* @__PURE__ */ r("div", { className: "cteditor-text-sm cteditor-text-muted-foreground", children: "Failed to load image preview" }) : /* @__PURE__ */ r(
|
|
554
554
|
"img",
|
|
555
555
|
{
|
|
556
|
-
ref:
|
|
557
|
-
src:
|
|
556
|
+
ref: D,
|
|
557
|
+
src: C,
|
|
558
558
|
alt: d || "Crop preview",
|
|
559
559
|
className: "cteditor-max-w-full cteditor-max-h-[460px] cteditor-w-auto cteditor-h-auto cteditor-select-none cteditor-block",
|
|
560
560
|
draggable: !1,
|
|
561
561
|
onLoad: () => {
|
|
562
|
-
|
|
562
|
+
k(!1), rt();
|
|
563
563
|
},
|
|
564
564
|
onError: () => {
|
|
565
|
-
|
|
565
|
+
k(!0);
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
) }),
|
|
569
|
-
n.width > 0 && n.height > 0 && !c && /* @__PURE__ */
|
|
569
|
+
n.width > 0 && n.height > 0 && !c && /* @__PURE__ */ h(
|
|
570
570
|
"div",
|
|
571
571
|
{
|
|
572
|
-
className: "cteditor-absolute cteditor-border-2 cteditor-border-blue-500 cteditor-
|
|
572
|
+
className: "cteditor-absolute cteditor-border-2 cteditor-border-blue-500 cteditor-cursor-move cteditor-select-none",
|
|
573
573
|
style: {
|
|
574
574
|
left: n.x + R.x,
|
|
575
575
|
top: n.y + R.y,
|
|
@@ -582,12 +582,12 @@ function Ir({
|
|
|
582
582
|
{
|
|
583
583
|
className: "cteditor-absolute cteditor-inset-0 cteditor-grid cteditor-grid-cols-3 cteditor-grid-rows-3 cteditor-pointer-events-none",
|
|
584
584
|
"aria-hidden": !0,
|
|
585
|
-
children: Array.from({ length: 9 }).map((s,
|
|
585
|
+
children: Array.from({ length: 9 }).map((s, p) => /* @__PURE__ */ r(
|
|
586
586
|
"div",
|
|
587
587
|
{
|
|
588
588
|
className: "cteditor-border cteditor-border-white/30"
|
|
589
589
|
},
|
|
590
|
-
|
|
590
|
+
p
|
|
591
591
|
))
|
|
592
592
|
}
|
|
593
593
|
),
|
|
@@ -595,7 +595,7 @@ function Ir({
|
|
|
595
595
|
"div",
|
|
596
596
|
{
|
|
597
597
|
className: "cteditor-absolute cteditor-inset-0 cteditor-pointer-events-auto",
|
|
598
|
-
onPointerDown:
|
|
598
|
+
onPointerDown: q,
|
|
599
599
|
"aria-label": "Move crop area"
|
|
600
600
|
}
|
|
601
601
|
),
|
|
@@ -608,11 +608,11 @@ function Ir({
|
|
|
608
608
|
["ne", "cteditor-right-0 cteditor-top-0 cteditor-translate-x-1/2 cteditor--translate-y-1/2", "cteditor-cursor-ne-resize", "cteditor-size-4"],
|
|
609
609
|
["sw", "cteditor-left-0 cteditor-bottom-0 cteditor--translate-x-1/2 cteditor-translate-y-1/2", "cteditor-cursor-sw-resize", "cteditor-size-4"],
|
|
610
610
|
["se", "cteditor-right-0 cteditor-bottom-0 cteditor-translate-x-1/2 cteditor-translate-y-1/2", "cteditor-cursor-se-resize", "cteditor-size-4"]
|
|
611
|
-
].map(([s,
|
|
611
|
+
].map(([s, p, b, g]) => /* @__PURE__ */ r(
|
|
612
612
|
"div",
|
|
613
613
|
{
|
|
614
|
-
className: `cteditor-absolute cteditor-border-2 cteditor-border-white cteditor-bg-blue-500 cteditor-rounded-sm cteditor-pointer-events-auto cteditor-shadow ${
|
|
615
|
-
onPointerDown: (
|
|
614
|
+
className: `cteditor-absolute cteditor-border-2 cteditor-border-white cteditor-bg-blue-500 cteditor-rounded-sm cteditor-pointer-events-auto cteditor-shadow ${p} ${b} ${g}`,
|
|
615
|
+
onPointerDown: (y) => It(y, s),
|
|
616
616
|
"aria-label": `Resize ${s}`
|
|
617
617
|
},
|
|
618
618
|
s
|
|
@@ -623,34 +623,34 @@ function Ir({
|
|
|
623
623
|
]
|
|
624
624
|
}
|
|
625
625
|
) }),
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
/* @__PURE__ */ r(
|
|
629
|
-
/* @__PURE__ */ r(
|
|
626
|
+
/* @__PURE__ */ h("div", { className: "cteditor-p-4 md:cteditor-p-5 cteditor-border-l cteditor-border-border cteditor-bg-background", children: [
|
|
627
|
+
/* @__PURE__ */ h(ue, { className: "cteditor-mb-4 cteditor-space-y-1", children: [
|
|
628
|
+
/* @__PURE__ */ r(me, { children: "Crop" }),
|
|
629
|
+
/* @__PURE__ */ r(ge, { children: "Choose an aspect ratio and adjust the crop area, then click Apply." })
|
|
630
630
|
] }),
|
|
631
|
-
/* @__PURE__ */
|
|
632
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ h("div", { className: "cteditor-space-y-4", children: [
|
|
632
|
+
/* @__PURE__ */ h("div", { children: [
|
|
633
633
|
/* @__PURE__ */ r("p", { className: "cteditor-text-sm cteditor-font-medium cteditor-mb-2", children: "Aspect ratio" }),
|
|
634
634
|
/* @__PURE__ */ r("div", { className: "cteditor-grid cteditor-grid-cols-3 cteditor-gap-2", children: [
|
|
635
|
-
{ id: "freeform", label: "Freeform", icon:
|
|
636
|
-
{ id: "original", label: "Original", icon:
|
|
637
|
-
{ id: "1:1", label: "1:1", icon:
|
|
638
|
-
{ id: "4:3", label: "4:3", icon:
|
|
639
|
-
{ id: "16:9", label: "16:9", icon:
|
|
640
|
-
{ id: "3:4", label: "3:4", icon:
|
|
641
|
-
{ id: "9:16", label: "9:16", icon:
|
|
635
|
+
{ id: "freeform", label: "Freeform", icon: be },
|
|
636
|
+
{ id: "original", label: "Original", icon: rr },
|
|
637
|
+
{ id: "1:1", label: "1:1", icon: or },
|
|
638
|
+
{ id: "4:3", label: "4:3", icon: Kt },
|
|
639
|
+
{ id: "16:9", label: "16:9", icon: Kt },
|
|
640
|
+
{ id: "3:4", label: "3:4", icon: qt },
|
|
641
|
+
{ id: "9:16", label: "9:16", icon: qt }
|
|
642
642
|
].map((s) => {
|
|
643
|
-
const
|
|
644
|
-
return /* @__PURE__ */
|
|
643
|
+
const p = s.icon, b = P === s.id;
|
|
644
|
+
return /* @__PURE__ */ h(
|
|
645
645
|
"button",
|
|
646
646
|
{
|
|
647
647
|
type: "button",
|
|
648
648
|
onClick: () => {
|
|
649
|
-
|
|
649
|
+
N(s.id);
|
|
650
650
|
},
|
|
651
|
-
className: `cteditor-h-20 cteditor-rounded-md cteditor-border cteditor-text-sm cteditor-transition-colors cteditor-flex cteditor-flex-col cteditor-items-center cteditor-justify-center cteditor-gap-1.5 ${
|
|
651
|
+
className: `cteditor-h-20 cteditor-rounded-md cteditor-border cteditor-text-sm cteditor-transition-colors cteditor-flex cteditor-flex-col cteditor-items-center cteditor-justify-center cteditor-gap-1.5 ${b ? "cteditor-border-primary cteditor-bg-primary/10 cteditor-text-primary" : "cteditor-border-border hover:cteditor-bg-accent"}`,
|
|
652
652
|
children: [
|
|
653
|
-
/* @__PURE__ */ r(
|
|
653
|
+
/* @__PURE__ */ r(p, { className: "cteditor-w-4 cteditor-h-4" }),
|
|
654
654
|
/* @__PURE__ */ r("span", { children: s.label })
|
|
655
655
|
]
|
|
656
656
|
},
|
|
@@ -658,29 +658,29 @@ function Ir({
|
|
|
658
658
|
);
|
|
659
659
|
}) })
|
|
660
660
|
] }),
|
|
661
|
-
/* @__PURE__ */
|
|
662
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ h("div", { className: "cteditor-rounded-md cteditor-border cteditor-border-border cteditor-p-3 cteditor-bg-muted/20 cteditor-space-y-2", children: [
|
|
662
|
+
/* @__PURE__ */ h("div", { children: [
|
|
663
663
|
/* @__PURE__ */ r("p", { className: "cteditor-text-xs cteditor-text-muted-foreground cteditor-mb-0.5", children: "Crop size" }),
|
|
664
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ h("p", { className: "cteditor-text-sm cteditor-font-medium", children: [
|
|
665
665
|
Math.round(R.width),
|
|
666
666
|
" × ",
|
|
667
667
|
Math.round(R.height),
|
|
668
668
|
" px"
|
|
669
669
|
] })
|
|
670
670
|
] }),
|
|
671
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ h("div", { children: [
|
|
672
672
|
/* @__PURE__ */ r("p", { className: "cteditor-text-xs cteditor-text-muted-foreground cteditor-mb-0.5", children: "Aspect ratio" }),
|
|
673
673
|
/* @__PURE__ */ r("p", { className: "cteditor-text-sm", children: P === "freeform" ? "Free" : P === "original" ? "Original" : P })
|
|
674
674
|
] })
|
|
675
675
|
] })
|
|
676
676
|
] }),
|
|
677
|
-
/* @__PURE__ */
|
|
677
|
+
/* @__PURE__ */ h(fe, { className: "cteditor-gap-2 cteditor-mt-4", children: [
|
|
678
678
|
/* @__PURE__ */ r(
|
|
679
679
|
"button",
|
|
680
680
|
{
|
|
681
681
|
type: "button",
|
|
682
682
|
onClick: () => {
|
|
683
|
-
|
|
683
|
+
N("freeform"), ht(null);
|
|
684
684
|
},
|
|
685
685
|
className: "cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-rounded-md cteditor-bg-background cteditor-border cteditor-border-border cteditor-text-foreground hover:cteditor-bg-accent cteditor-transition-colors",
|
|
686
686
|
children: "Reset"
|
|
@@ -699,7 +699,7 @@ function Ir({
|
|
|
699
699
|
"button",
|
|
700
700
|
{
|
|
701
701
|
type: "button",
|
|
702
|
-
onClick:
|
|
702
|
+
onClick: Pt,
|
|
703
703
|
className: "cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-rounded-md cteditor-bg-primary cteditor-text-primary-foreground hover:cteditor-bg-primary/90 cteditor-transition-colors",
|
|
704
704
|
children: "Apply"
|
|
705
705
|
}
|
|
@@ -710,31 +710,31 @@ function Ir({
|
|
|
710
710
|
}
|
|
711
711
|
) });
|
|
712
712
|
}
|
|
713
|
-
const
|
|
714
|
-
function
|
|
715
|
-
if (!
|
|
713
|
+
const Rt = /* @__PURE__ */ new Set(), Vt = tr("RIGHT_CLICK_IMAGE_COMMAND");
|
|
714
|
+
function jr(i) {
|
|
715
|
+
if (!Rt.has(i))
|
|
716
716
|
throw new Promise((o) => {
|
|
717
717
|
const e = new Image();
|
|
718
718
|
e.src = i, e.onload = () => {
|
|
719
|
-
|
|
719
|
+
Rt.add(i), o(null);
|
|
720
720
|
}, e.onerror = () => {
|
|
721
|
-
|
|
721
|
+
Rt.add(i);
|
|
722
722
|
};
|
|
723
723
|
});
|
|
724
724
|
}
|
|
725
|
-
function
|
|
725
|
+
function Wr({
|
|
726
726
|
altText: i,
|
|
727
727
|
className: o,
|
|
728
728
|
imageRef: e,
|
|
729
729
|
src: d,
|
|
730
|
-
width:
|
|
731
|
-
height:
|
|
730
|
+
width: w,
|
|
731
|
+
height: x,
|
|
732
732
|
maxWidth: L,
|
|
733
733
|
onError: P,
|
|
734
|
-
onLoad:
|
|
734
|
+
onLoad: N
|
|
735
735
|
}) {
|
|
736
|
-
|
|
737
|
-
const
|
|
736
|
+
jr(d);
|
|
737
|
+
const C = typeof w == "number" && typeof x == "number", E = typeof w == "number" ? w : "auto";
|
|
738
738
|
return /* @__PURE__ */ r(
|
|
739
739
|
"img",
|
|
740
740
|
{
|
|
@@ -742,14 +742,14 @@ function zr({
|
|
|
742
742
|
src: d,
|
|
743
743
|
alt: i,
|
|
744
744
|
ref: e,
|
|
745
|
-
style:
|
|
745
|
+
style: C ? {
|
|
746
746
|
width: E,
|
|
747
747
|
// Use height: auto + aspect-ratio so the image scales
|
|
748
748
|
// proportionally when max-width constrains on small screens.
|
|
749
749
|
// The useLayoutEffect in ImageComponent widens the container
|
|
750
750
|
// to fit the explicit width on desktop.
|
|
751
751
|
height: "auto",
|
|
752
|
-
aspectRatio: `${E} / ${typeof
|
|
752
|
+
aspectRatio: `${E} / ${typeof x == "number" ? x : "auto"}`,
|
|
753
753
|
maxWidth: "100%"
|
|
754
754
|
} : {
|
|
755
755
|
// No dimensions specified - use original image size.
|
|
@@ -757,12 +757,12 @@ function zr({
|
|
|
757
757
|
height: "auto"
|
|
758
758
|
},
|
|
759
759
|
onError: P,
|
|
760
|
-
onLoad:
|
|
760
|
+
onLoad: N,
|
|
761
761
|
draggable: "false"
|
|
762
762
|
}
|
|
763
763
|
);
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function Yr() {
|
|
766
766
|
return /* @__PURE__ */ r(
|
|
767
767
|
"img",
|
|
768
768
|
{
|
|
@@ -776,174 +776,205 @@ function Mr() {
|
|
|
776
776
|
}
|
|
777
777
|
);
|
|
778
778
|
}
|
|
779
|
-
function
|
|
779
|
+
function co({
|
|
780
780
|
src: i,
|
|
781
781
|
altText: o,
|
|
782
782
|
nodeKey: e,
|
|
783
783
|
width: d,
|
|
784
|
-
height:
|
|
785
|
-
maxWidth:
|
|
784
|
+
height: w,
|
|
785
|
+
maxWidth: x,
|
|
786
786
|
resizable: L,
|
|
787
787
|
showCaption: P,
|
|
788
|
-
caption:
|
|
789
|
-
captionsEnabled:
|
|
788
|
+
caption: N,
|
|
789
|
+
captionsEnabled: C,
|
|
790
790
|
originalPrompt: E,
|
|
791
791
|
position: c = "none",
|
|
792
|
-
linkUrl:
|
|
792
|
+
linkUrl: k
|
|
793
793
|
}) {
|
|
794
|
-
const v =
|
|
795
|
-
|
|
794
|
+
const v = K(null), D = K(null), [n, T, R] = Xe(e), [$, et] = I(!1), dt = K(!1), { isCollabActive: ft } = Oe(), [m] = He(), [j, ht] = I(null), rt = K(null), [q, It] = I(!1), Pt = Fe(), [s, p] = I(!1), [b, g] = I(""), [y, O] = I(!1), [ct, lt] = I(!1), [G, B] = I(""), [ot, Y] = I(""), [U, A] = I(!1), _ = K(null), [V, H] = I(0), [F, ut] = I(!1), vt = K(null), [xe, pt] = I(null), [St, zt] = I(!1), wt = ir()?.apiKey, Mt = V > 0 && V < 350;
|
|
795
|
+
Bt(() => {
|
|
796
|
+
if (!n || !at(j) || q) {
|
|
797
|
+
pt(null);
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
const t = vt.current, a = m.getRootElement(), l = t?.parentElement;
|
|
801
|
+
if (!t || !a || !l) {
|
|
802
|
+
pt(null);
|
|
803
|
+
return;
|
|
804
|
+
}
|
|
805
|
+
const u = a.getBoundingClientRect(), f = l.getBoundingClientRect(), z = t.getBoundingClientRect(), X = 8, J = z.width;
|
|
806
|
+
if (J <= 0) {
|
|
807
|
+
pt(null);
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
if (Mt) {
|
|
811
|
+
const Ct = f.left + f.width / 2 - J / 2, it = Math.max(u.left + X, Math.min(Ct, u.right - X - J));
|
|
812
|
+
pt({
|
|
813
|
+
left: it - f.left,
|
|
814
|
+
bottom: 0,
|
|
815
|
+
right: "auto",
|
|
816
|
+
transform: "translateY(100%) translateY(4px)"
|
|
817
|
+
});
|
|
818
|
+
} else {
|
|
819
|
+
const Ct = f.right - X - J, it = Math.max(u.left + X, Math.min(Ct, u.right - X - J));
|
|
820
|
+
pt({
|
|
821
|
+
left: it - f.left,
|
|
822
|
+
top: X,
|
|
823
|
+
right: "auto"
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
}, [n, j, q, Mt, m, V]), tt(() => {
|
|
796
827
|
if (v.current) {
|
|
797
828
|
const t = () => {
|
|
798
|
-
|
|
829
|
+
dt.current || v.current && H(v.current.offsetWidth);
|
|
799
830
|
};
|
|
800
831
|
t();
|
|
801
832
|
const a = new ResizeObserver(t);
|
|
802
833
|
return a.observe(v.current), () => a.disconnect();
|
|
803
834
|
}
|
|
804
|
-
}, [d,
|
|
835
|
+
}, [d, w, n]), Bt(() => {
|
|
805
836
|
if ((c === "left" || c === "right") && typeof d == "number" && v.current) {
|
|
806
|
-
const t = v.current.closest(".editor-image"), a = t?.parentElement,
|
|
807
|
-
return t && (t.style.removeProperty("display"), t.style.setProperty("max-width",
|
|
837
|
+
const t = v.current.closest(".editor-image"), a = t?.parentElement, l = m.getRootElement(), u = l ? l.getBoundingClientRect().width : d + 32, f = `${Math.min(d + 32, u)}px`;
|
|
838
|
+
return t && (t.style.removeProperty("display"), t.style.setProperty("max-width", f, "important")), a && a.style.setProperty("max-width", f, "important"), () => {
|
|
808
839
|
t && (t.style.removeProperty("max-width"), t.style.removeProperty("display")), a && a.style.removeProperty("max-width");
|
|
809
840
|
};
|
|
810
841
|
}
|
|
811
|
-
}, [c, d,
|
|
812
|
-
const
|
|
842
|
+
}, [c, d, m]);
|
|
843
|
+
const At = S(
|
|
813
844
|
(t) => {
|
|
814
|
-
const a =
|
|
815
|
-
return n &&
|
|
816
|
-
a.getNodes().forEach((
|
|
817
|
-
if (
|
|
818
|
-
const
|
|
819
|
-
|
|
845
|
+
const a = nt();
|
|
846
|
+
return n && at(a) && (t.preventDefault(), m.update(() => {
|
|
847
|
+
a.getNodes().forEach((u) => {
|
|
848
|
+
if (Z(u)) {
|
|
849
|
+
const f = u.getParent();
|
|
850
|
+
u.remove(), f && $t(f) && f.getChildrenSize() === 0 && f.setFormat("left");
|
|
820
851
|
}
|
|
821
852
|
});
|
|
822
853
|
})), !1;
|
|
823
854
|
},
|
|
824
|
-
[
|
|
825
|
-
),
|
|
855
|
+
[m, n]
|
|
856
|
+
), jt = S(
|
|
826
857
|
(t) => {
|
|
827
|
-
const a =
|
|
828
|
-
if (n &&
|
|
858
|
+
const a = nt(), l = D.current;
|
|
859
|
+
if (n && at(a) && a.getNodes().length === 1) {
|
|
829
860
|
if (P)
|
|
830
|
-
return
|
|
831
|
-
if (
|
|
832
|
-
return t.preventDefault(),
|
|
861
|
+
return bt(null), t.preventDefault(), N.focus(), !0;
|
|
862
|
+
if (l !== null && l !== document.activeElement)
|
|
863
|
+
return t.preventDefault(), l.focus(), !0;
|
|
833
864
|
}
|
|
834
865
|
return !1;
|
|
835
866
|
},
|
|
836
|
-
[
|
|
837
|
-
),
|
|
838
|
-
(t) =>
|
|
839
|
-
|
|
840
|
-
const a =
|
|
867
|
+
[N, n, P]
|
|
868
|
+
), Wt = S(
|
|
869
|
+
(t) => rt.current === N || D.current === t.target ? (bt(null), m.update(() => {
|
|
870
|
+
T(!0);
|
|
871
|
+
const a = m.getRootElement();
|
|
841
872
|
a !== null && a.focus();
|
|
842
873
|
}), !0) : !1,
|
|
843
|
-
[
|
|
844
|
-
),
|
|
874
|
+
[N, m, T]
|
|
875
|
+
), Dt = S(
|
|
845
876
|
(t) => {
|
|
846
877
|
const a = t;
|
|
847
878
|
if ($)
|
|
848
879
|
return !0;
|
|
849
|
-
const
|
|
850
|
-
if (
|
|
880
|
+
const l = a.target;
|
|
881
|
+
if (l.closest("button") && v.current && l.closest(".editor-image") === v.current.closest(".editor-image"))
|
|
851
882
|
return !0;
|
|
852
|
-
const
|
|
853
|
-
let
|
|
854
|
-
if (!
|
|
855
|
-
const
|
|
856
|
-
|
|
883
|
+
const u = l === v.current;
|
|
884
|
+
let f = !1;
|
|
885
|
+
if (!u && v.current) {
|
|
886
|
+
const z = v.current.getBoundingClientRect();
|
|
887
|
+
f = a.clientX >= z.left && a.clientX <= z.right && a.clientY >= z.top && a.clientY <= z.bottom;
|
|
857
888
|
}
|
|
858
|
-
return
|
|
889
|
+
return u || f ? (a.shiftKey ? T(!n) : (R(), T(!0)), !0) : !1;
|
|
859
890
|
},
|
|
860
|
-
[$, n,
|
|
861
|
-
),
|
|
891
|
+
[$, n, T, R]
|
|
892
|
+
), Lt = S(
|
|
862
893
|
(t) => {
|
|
863
|
-
|
|
864
|
-
const a =
|
|
865
|
-
t.target.tagName === "IMG" &&
|
|
866
|
-
|
|
894
|
+
m.getEditorState().read(() => {
|
|
895
|
+
const a = nt();
|
|
896
|
+
t.target.tagName === "IMG" && Ue(a) && a.getNodes().length === 1 && m.dispatchCommand(
|
|
897
|
+
Vt,
|
|
867
898
|
t
|
|
868
899
|
);
|
|
869
900
|
});
|
|
870
901
|
},
|
|
871
|
-
[
|
|
902
|
+
[m]
|
|
872
903
|
);
|
|
873
|
-
|
|
904
|
+
tt(() => {
|
|
874
905
|
let t = !0;
|
|
875
|
-
const a =
|
|
876
|
-
|
|
877
|
-
t &&
|
|
906
|
+
const a = m.getRootElement(), l = Be(
|
|
907
|
+
m.registerUpdateListener(({ editorState: u }) => {
|
|
908
|
+
t && ht(u.read(() => nt()));
|
|
878
909
|
}),
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
(
|
|
882
|
-
|
|
910
|
+
m.registerCommand(
|
|
911
|
+
Ke,
|
|
912
|
+
(u, f) => (rt.current = f, !1),
|
|
913
|
+
Q
|
|
883
914
|
),
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
915
|
+
m.registerCommand(
|
|
916
|
+
qe,
|
|
917
|
+
Dt,
|
|
918
|
+
Q
|
|
888
919
|
),
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
920
|
+
m.registerCommand(
|
|
921
|
+
Vt,
|
|
922
|
+
Dt,
|
|
923
|
+
Q
|
|
893
924
|
),
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
(
|
|
897
|
-
|
|
925
|
+
m.registerCommand(
|
|
926
|
+
Ge,
|
|
927
|
+
(u) => u.target === v.current ? (u.preventDefault(), !0) : !1,
|
|
928
|
+
Q
|
|
898
929
|
),
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
),
|
|
904
|
-
l.registerCommand(
|
|
905
|
-
Xe,
|
|
906
|
-
Ct,
|
|
907
|
-
K
|
|
930
|
+
m.registerCommand(
|
|
931
|
+
Ve,
|
|
932
|
+
At,
|
|
933
|
+
Q
|
|
908
934
|
),
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
Ue,
|
|
935
|
+
m.registerCommand(
|
|
936
|
+
Je,
|
|
912
937
|
At,
|
|
913
|
-
|
|
938
|
+
Q
|
|
939
|
+
),
|
|
940
|
+
m.registerCommand(Qe, jt, Q),
|
|
941
|
+
m.registerCommand(
|
|
942
|
+
Ze,
|
|
943
|
+
Wt,
|
|
944
|
+
Q
|
|
914
945
|
)
|
|
915
946
|
);
|
|
916
|
-
return a?.addEventListener("contextmenu",
|
|
917
|
-
t = !1,
|
|
947
|
+
return a?.addEventListener("contextmenu", Lt), () => {
|
|
948
|
+
t = !1, l(), a?.removeEventListener("contextmenu", Lt);
|
|
918
949
|
};
|
|
919
950
|
}, [
|
|
920
951
|
R,
|
|
921
|
-
|
|
952
|
+
m,
|
|
922
953
|
$,
|
|
923
954
|
n,
|
|
924
955
|
e,
|
|
925
|
-
Ct,
|
|
926
|
-
Mt,
|
|
927
956
|
At,
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
957
|
+
jt,
|
|
958
|
+
Wt,
|
|
959
|
+
Dt,
|
|
960
|
+
Lt,
|
|
961
|
+
T
|
|
931
962
|
]);
|
|
932
|
-
const
|
|
933
|
-
|
|
934
|
-
const t =
|
|
935
|
-
|
|
963
|
+
const ve = () => {
|
|
964
|
+
m.update(() => {
|
|
965
|
+
const t = st(e);
|
|
966
|
+
Z(t) && t.setShowCaption(!0);
|
|
936
967
|
});
|
|
937
|
-
},
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
}, 200),
|
|
941
|
-
const
|
|
942
|
-
|
|
968
|
+
}, we = (t, a) => {
|
|
969
|
+
dt.current = !1, setTimeout(() => {
|
|
970
|
+
et(!1);
|
|
971
|
+
}, 200), m.update(() => {
|
|
972
|
+
const l = st(e);
|
|
973
|
+
Z(l) && l.setWidthAndHeight(t, a);
|
|
943
974
|
});
|
|
944
|
-
},
|
|
945
|
-
|
|
946
|
-
},
|
|
975
|
+
}, Ce = () => {
|
|
976
|
+
dt.current = !0, et(!0);
|
|
977
|
+
}, Ne = (t) => {
|
|
947
978
|
if (t.preventDefault(), t.stopPropagation(), i.startsWith("data:")) {
|
|
948
979
|
const a = window.open("", "_blank");
|
|
949
980
|
a && (a.document.write(`
|
|
@@ -974,112 +1005,112 @@ function eo({
|
|
|
974
1005
|
`), a.document.close());
|
|
975
1006
|
} else
|
|
976
1007
|
window.open(i, "_blank");
|
|
977
|
-
},
|
|
978
|
-
t.preventDefault(), t.stopPropagation(),
|
|
979
|
-
const a =
|
|
980
|
-
if (
|
|
981
|
-
const
|
|
982
|
-
a.remove(),
|
|
1008
|
+
}, ke = (t) => {
|
|
1009
|
+
t.preventDefault(), t.stopPropagation(), m.update(() => {
|
|
1010
|
+
const a = st(e);
|
|
1011
|
+
if (Z(a)) {
|
|
1012
|
+
const l = a.getParent();
|
|
1013
|
+
a.remove(), l && $t(l) && l.getChildrenSize() === 0 && l.setFormat("left");
|
|
983
1014
|
}
|
|
984
1015
|
});
|
|
985
|
-
},
|
|
986
|
-
t.preventDefault(), t.stopPropagation(),
|
|
987
|
-
const
|
|
988
|
-
if (
|
|
989
|
-
|
|
990
|
-
const
|
|
991
|
-
|
|
1016
|
+
}, mt = (t, a) => {
|
|
1017
|
+
t.preventDefault(), t.stopPropagation(), m.update(() => {
|
|
1018
|
+
const l = st(e);
|
|
1019
|
+
if (Z(l)) {
|
|
1020
|
+
l.setPosition(a);
|
|
1021
|
+
const u = l.getParent();
|
|
1022
|
+
u && $t(u) && (a === "left" ? u.setFormat("left") : a === "right" ? u.setFormat("right") : u.setFormat(""));
|
|
992
1023
|
}
|
|
993
1024
|
});
|
|
994
|
-
},
|
|
995
|
-
t.preventDefault(), t.stopPropagation(),
|
|
996
|
-
},
|
|
997
|
-
t.preventDefault(), t.stopPropagation(),
|
|
998
|
-
}, []),
|
|
1025
|
+
}, Re = (t) => {
|
|
1026
|
+
t.preventDefault(), t.stopPropagation(), p(!s);
|
|
1027
|
+
}, Ee = S((t) => {
|
|
1028
|
+
t.preventDefault(), t.stopPropagation(), ut(!0);
|
|
1029
|
+
}, []), Ie = S(
|
|
999
1030
|
(t) => {
|
|
1000
1031
|
t.preventDefault(), t.stopPropagation();
|
|
1001
|
-
const a =
|
|
1002
|
-
if (!(
|
|
1032
|
+
const a = kt(i);
|
|
1033
|
+
if (!(gt(i) && i !== a) && !(typeof d == "number" || typeof w == "number"))
|
|
1003
1034
|
return;
|
|
1004
|
-
|
|
1035
|
+
m.update(
|
|
1005
1036
|
() => {
|
|
1006
|
-
const
|
|
1007
|
-
if (!
|
|
1037
|
+
const z = st(e);
|
|
1038
|
+
if (!Z(z))
|
|
1008
1039
|
return;
|
|
1009
|
-
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1040
|
+
z.setSrc(a), z.setWidthAndHeight("inherit", "inherit");
|
|
1041
|
+
const X = nt();
|
|
1042
|
+
X && bt(X.clone());
|
|
1012
1043
|
},
|
|
1013
1044
|
{ tag: "image-reset" }
|
|
1014
1045
|
);
|
|
1015
|
-
const
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
}),
|
|
1046
|
+
const f = v.current;
|
|
1047
|
+
f && requestAnimationFrame(() => {
|
|
1048
|
+
f.src = a, f.style.removeProperty("width"), f.style.removeProperty("height");
|
|
1049
|
+
}), M.success("Image reset to original size and crop");
|
|
1019
1050
|
},
|
|
1020
|
-
[
|
|
1021
|
-
),
|
|
1051
|
+
[m, e, i, d, w]
|
|
1052
|
+
), Pe = S(
|
|
1022
1053
|
async (t) => {
|
|
1023
1054
|
let a = i;
|
|
1024
|
-
if (
|
|
1025
|
-
a =
|
|
1055
|
+
if (gt(i))
|
|
1056
|
+
a = kt(i);
|
|
1026
1057
|
else {
|
|
1027
|
-
if (!
|
|
1028
|
-
|
|
1058
|
+
if (!wt) {
|
|
1059
|
+
M.error("API key is required to upload and crop external images.");
|
|
1029
1060
|
return;
|
|
1030
1061
|
}
|
|
1031
|
-
const
|
|
1062
|
+
const u = M.loading("Uploading image…");
|
|
1032
1063
|
try {
|
|
1033
|
-
a = (await
|
|
1034
|
-
|
|
1064
|
+
a = (await ar.post(
|
|
1065
|
+
nr.project.fileUploadFromUrl,
|
|
1035
1066
|
{ url: i, prefix: "uploads" },
|
|
1036
|
-
{ headers: { "x-api-key":
|
|
1037
|
-
)).data.fileUrl,
|
|
1067
|
+
{ headers: { "x-api-key": wt } }
|
|
1068
|
+
)).data.fileUrl, M.dismiss(u);
|
|
1038
1069
|
} catch {
|
|
1039
|
-
|
|
1070
|
+
M.dismiss(u), M.error("Failed to upload image. Try again.");
|
|
1040
1071
|
return;
|
|
1041
1072
|
}
|
|
1042
1073
|
}
|
|
1043
|
-
const
|
|
1044
|
-
if (
|
|
1045
|
-
|
|
1074
|
+
const l = Ir(a, t);
|
|
1075
|
+
if (l === a) {
|
|
1076
|
+
M.error("Cropping is only supported for images hosted on the CDN.");
|
|
1046
1077
|
return;
|
|
1047
1078
|
}
|
|
1048
|
-
|
|
1049
|
-
const
|
|
1050
|
-
if (!
|
|
1079
|
+
zt(!0), m.update(() => {
|
|
1080
|
+
const u = st(e);
|
|
1081
|
+
if (!Z(u))
|
|
1051
1082
|
return;
|
|
1052
|
-
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1055
|
-
}),
|
|
1083
|
+
u.setSrc(l), u.setWidthAndHeight(t.width, t.height);
|
|
1084
|
+
const f = nt();
|
|
1085
|
+
f && bt(f.clone());
|
|
1086
|
+
}), M.success("Image cropped");
|
|
1056
1087
|
},
|
|
1057
|
-
[
|
|
1058
|
-
),
|
|
1059
|
-
|
|
1060
|
-
|
|
1088
|
+
[m, e, i, wt]
|
|
1089
|
+
), Se = S(() => {
|
|
1090
|
+
k && !n && (_.current = setTimeout(() => {
|
|
1091
|
+
A(!0);
|
|
1061
1092
|
}, 300));
|
|
1062
|
-
}, [
|
|
1063
|
-
|
|
1064
|
-
}, []),
|
|
1065
|
-
t.preventDefault(), t.stopPropagation(),
|
|
1066
|
-
}, [
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
}, []),
|
|
1070
|
-
n ||
|
|
1093
|
+
}, [k, n]), ze = S(() => {
|
|
1094
|
+
_.current && (clearTimeout(_.current), _.current = null), A(!1);
|
|
1095
|
+
}, []), Yt = S((t) => {
|
|
1096
|
+
t.preventDefault(), t.stopPropagation(), k && window.open(k, "_blank", "noopener,noreferrer");
|
|
1097
|
+
}, [k]);
|
|
1098
|
+
tt(() => () => {
|
|
1099
|
+
_.current && clearTimeout(_.current);
|
|
1100
|
+
}, []), tt(() => {
|
|
1101
|
+
n || ut(!1);
|
|
1071
1102
|
}, [n]);
|
|
1072
|
-
const
|
|
1073
|
-
if (!
|
|
1103
|
+
const _t = async () => {
|
|
1104
|
+
if (!b.trim() || y)
|
|
1074
1105
|
return;
|
|
1075
1106
|
O(!0);
|
|
1076
|
-
const t =
|
|
1107
|
+
const t = M.loading("Refining image...", {
|
|
1077
1108
|
description: "This may take 10-30 seconds. Please wait."
|
|
1078
1109
|
});
|
|
1079
1110
|
try {
|
|
1080
|
-
let a =
|
|
1081
|
-
const
|
|
1082
|
-
const
|
|
1111
|
+
let a = b.trim();
|
|
1112
|
+
const u = b.trim().replace(/^(add|also add|include|with|and)\s+(some|a|an)\s+/gi, "").replace(/^(add|also add|include|with|and)\s+/gi, "").trim(), f = (Nt) => {
|
|
1113
|
+
const je = Nt.toLowerCase();
|
|
1083
1114
|
return [
|
|
1084
1115
|
"article",
|
|
1085
1116
|
"write",
|
|
@@ -1096,59 +1127,59 @@ function eo({
|
|
|
1096
1127
|
"add some images",
|
|
1097
1128
|
"include images",
|
|
1098
1129
|
"include pictures"
|
|
1099
|
-
].some((
|
|
1130
|
+
].some((We) => je.includes(We));
|
|
1100
1131
|
};
|
|
1101
|
-
let
|
|
1132
|
+
let z = "";
|
|
1102
1133
|
if (E && E.trim()) {
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1134
|
+
const Nt = E.trim();
|
|
1135
|
+
f(Nt) && o && o !== "Generated image" && o.trim() ? z = o.trim() : z = Nt;
|
|
1105
1136
|
} else
|
|
1106
|
-
o && o !== "Generated image" && o.trim() && (
|
|
1107
|
-
|
|
1108
|
-
const
|
|
1137
|
+
o && o !== "Generated image" && o.trim() && (z = o.trim());
|
|
1138
|
+
z ? a = `${z} with ${u}` : a = u;
|
|
1139
|
+
const J = (await xr({
|
|
1109
1140
|
content: `Generate Image: ${a}`,
|
|
1110
|
-
apiKey:
|
|
1141
|
+
apiKey: wt || void 0
|
|
1111
1142
|
}))?.data;
|
|
1112
|
-
if (!
|
|
1143
|
+
if (!J)
|
|
1113
1144
|
throw new Error("Failed to generate image - empty response");
|
|
1114
|
-
const
|
|
1115
|
-
if (!
|
|
1145
|
+
const it = new DOMParser().parseFromString(J, "text/html").querySelector("img");
|
|
1146
|
+
if (!it || !it.src)
|
|
1116
1147
|
throw new Error("No image found in response");
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1148
|
+
const Te = it.src;
|
|
1149
|
+
M.dismiss(t), M.success("Image refined successfully!", {
|
|
1119
1150
|
description: "Compare the images and choose which to keep."
|
|
1120
|
-
}),
|
|
1151
|
+
}), B(Te), Y(a), lt(!0), g(""), p(!1);
|
|
1121
1152
|
} catch (a) {
|
|
1122
|
-
if (
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1153
|
+
if (M.dismiss(t), a instanceof vr) {
|
|
1154
|
+
const l = a.code === "API_KEYS_DISABLED" ? "API Keys Disabled" : "API Key Required";
|
|
1155
|
+
M.error(l, {
|
|
1125
1156
|
description: a.message,
|
|
1126
1157
|
duration: 8e3
|
|
1127
1158
|
});
|
|
1128
1159
|
} else
|
|
1129
|
-
a instanceof
|
|
1160
|
+
a instanceof wr ? M.error("Credits Issue", {
|
|
1130
1161
|
description: a.message,
|
|
1131
1162
|
duration: 8e3
|
|
1132
|
-
}) :
|
|
1163
|
+
}) : M.error("Failed to refine image", {
|
|
1133
1164
|
description: a instanceof Error ? a.message : "Unknown error. Please try again."
|
|
1134
1165
|
});
|
|
1135
1166
|
} finally {
|
|
1136
1167
|
O(!1);
|
|
1137
1168
|
}
|
|
1138
|
-
},
|
|
1139
|
-
|
|
1140
|
-
const t =
|
|
1141
|
-
if (
|
|
1142
|
-
t.setSrc(
|
|
1143
|
-
const a =
|
|
1144
|
-
a &&
|
|
1169
|
+
}, Me = () => {
|
|
1170
|
+
m.update(() => {
|
|
1171
|
+
const t = st(e);
|
|
1172
|
+
if (Z(t)) {
|
|
1173
|
+
t.setSrc(G), t.setOriginalPrompt(ot);
|
|
1174
|
+
const a = nt();
|
|
1175
|
+
a && bt(a.clone());
|
|
1145
1176
|
}
|
|
1146
|
-
}),
|
|
1177
|
+
}), lt(!1), B(""), Y(""), M.success("Image replaced successfully!", {
|
|
1147
1178
|
description: "The image has been updated with the refined version."
|
|
1148
1179
|
});
|
|
1149
|
-
},
|
|
1150
|
-
|
|
1151
|
-
},
|
|
1180
|
+
}, Ae = () => {
|
|
1181
|
+
lt(!1), B(""), Y("");
|
|
1182
|
+
}, De = n && at(j) && !$, Ot = (n || $) && Pt, Le = () => c === "left" || c === "right" ? {
|
|
1152
1183
|
position: "relative",
|
|
1153
1184
|
display: "block",
|
|
1154
1185
|
width: "100%"
|
|
@@ -1176,55 +1207,81 @@ function eo({
|
|
|
1176
1207
|
} : {
|
|
1177
1208
|
position: "relative",
|
|
1178
1209
|
display: "inline-block"
|
|
1179
|
-
},
|
|
1210
|
+
}, $e = S(
|
|
1180
1211
|
(t) => {
|
|
1181
1212
|
if ($ || t.target.closest("button"))
|
|
1182
1213
|
return;
|
|
1183
|
-
const
|
|
1184
|
-
let
|
|
1185
|
-
if (!
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1214
|
+
const l = t.target === v.current;
|
|
1215
|
+
let u = !1;
|
|
1216
|
+
if (!l && v.current) {
|
|
1217
|
+
const f = v.current.getBoundingClientRect();
|
|
1218
|
+
u = t.clientX >= f.left && t.clientX <= f.right && t.clientY >= f.top && t.clientY <= f.bottom;
|
|
1188
1219
|
}
|
|
1189
|
-
!
|
|
1220
|
+
!l && !u || (t.stopPropagation(), t.shiftKey ? T(!n) : (R(), T(!0)));
|
|
1190
1221
|
},
|
|
1191
|
-
[$, n,
|
|
1222
|
+
[$, n, T, R]
|
|
1192
1223
|
);
|
|
1193
|
-
return /* @__PURE__ */ r(
|
|
1194
|
-
/* @__PURE__ */
|
|
1224
|
+
return /* @__PURE__ */ r(er, { fallback: null, children: /* @__PURE__ */ h(Ft, { children: [
|
|
1225
|
+
/* @__PURE__ */ h(
|
|
1195
1226
|
"div",
|
|
1196
1227
|
{
|
|
1197
|
-
draggable:
|
|
1198
|
-
style:
|
|
1199
|
-
onClick:
|
|
1200
|
-
onMouseEnter:
|
|
1201
|
-
onMouseLeave:
|
|
1228
|
+
draggable: De,
|
|
1229
|
+
style: Le(),
|
|
1230
|
+
onClick: $e,
|
|
1231
|
+
onMouseEnter: Se,
|
|
1232
|
+
onMouseLeave: ze,
|
|
1202
1233
|
children: [
|
|
1203
|
-
|
|
1204
|
-
|
|
1234
|
+
St ? /* @__PURE__ */ h(
|
|
1235
|
+
"div",
|
|
1236
|
+
{
|
|
1237
|
+
className: "cteditor-relative cteditor-inline-block cteditor-my-2 cteditor-select-none cteditor-rounded-lg cteditor-overflow-hidden",
|
|
1238
|
+
style: {
|
|
1239
|
+
...typeof d == "number" && typeof w == "number" ? { width: d, height: w, aspectRatio: `${d} / ${w}`, maxWidth: "100%" } : { minWidth: 200, minHeight: 150 }
|
|
1240
|
+
},
|
|
1241
|
+
children: [
|
|
1242
|
+
/* @__PURE__ */ r(
|
|
1243
|
+
"img",
|
|
1244
|
+
{
|
|
1245
|
+
src: i,
|
|
1246
|
+
alt: "",
|
|
1247
|
+
className: "cteditor-absolute cteditor-opacity-0 cteditor-pointer-events-none cteditor-w-full cteditor-h-full cteditor-object-cover",
|
|
1248
|
+
onLoad: () => {
|
|
1249
|
+
Rt.add(i), zt(!1);
|
|
1250
|
+
},
|
|
1251
|
+
onError: () => zt(!1)
|
|
1252
|
+
}
|
|
1253
|
+
),
|
|
1254
|
+
/* @__PURE__ */ h("div", { className: "cteditor-absolute cteditor-inset-0 cteditor-flex cteditor-flex-col cteditor-items-center cteditor-justify-center cteditor-rounded-lg cteditor-bg-muted", children: [
|
|
1255
|
+
/* @__PURE__ */ r(sr, { className: "cteditor-w-10 cteditor-h-10 cteditor-text-muted-foreground cteditor-animate-spin cteditor-mb-2", "aria-hidden": !0 }),
|
|
1256
|
+
/* @__PURE__ */ r("span", { className: "cteditor-text-sm cteditor-font-medium cteditor-text-muted-foreground", children: "Applying crop…" })
|
|
1257
|
+
] })
|
|
1258
|
+
]
|
|
1259
|
+
}
|
|
1260
|
+
) : q ? /* @__PURE__ */ r(Yr, {}) : /* @__PURE__ */ r(
|
|
1261
|
+
Wr,
|
|
1205
1262
|
{
|
|
1206
|
-
className:
|
|
1263
|
+
className: Ot ? `focused ${at(j) ? "draggable" : ""}` : k ? "cteditor-cursor-pointer" : null,
|
|
1207
1264
|
src: i,
|
|
1208
1265
|
altText: o,
|
|
1209
1266
|
imageRef: v,
|
|
1210
1267
|
width: d,
|
|
1211
|
-
height:
|
|
1212
|
-
maxWidth:
|
|
1213
|
-
onError: () =>
|
|
1268
|
+
height: w,
|
|
1269
|
+
maxWidth: x,
|
|
1270
|
+
onError: () => It(!0)
|
|
1214
1271
|
}
|
|
1215
1272
|
),
|
|
1216
|
-
|
|
1273
|
+
U && k && !n && /* @__PURE__ */ h(
|
|
1217
1274
|
"div",
|
|
1218
1275
|
{
|
|
1219
1276
|
className: "cteditor-absolute cteditor-bottom-2 cteditor-left-2 cteditor-right-2 cteditor-bg-background cteditor-rounded-lg cteditor-shadow-lg cteditor-border cteditor-border-border cteditor-p-2 cteditor-flex cteditor-items-center cteditor-gap-2",
|
|
1220
1277
|
style: { zIndex: 10 },
|
|
1221
1278
|
children: [
|
|
1222
|
-
/* @__PURE__ */ r(
|
|
1223
|
-
/* @__PURE__ */ r("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children:
|
|
1279
|
+
/* @__PURE__ */ r(Cr, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-muted-foreground cteditor-flex-shrink-0" }),
|
|
1280
|
+
/* @__PURE__ */ r("span", { className: "cteditor-text-sm cteditor-text-foreground cteditor-truncate cteditor-flex-1", children: k }),
|
|
1224
1281
|
/* @__PURE__ */ r(
|
|
1225
1282
|
"button",
|
|
1226
1283
|
{
|
|
1227
|
-
onClick:
|
|
1284
|
+
onClick: Yt,
|
|
1228
1285
|
className: "cteditor-px-2 cteditor-py-1.5 cteditor-text-xs cteditor-rounded cteditor-bg-primary cteditor-text-primary-foreground hover:cteditor-bg-primary/90 cteditor-transition-colors cteditor-flex-shrink-0",
|
|
1229
1286
|
children: "Open"
|
|
1230
1287
|
}
|
|
@@ -1232,165 +1289,167 @@ function eo({
|
|
|
1232
1289
|
]
|
|
1233
1290
|
}
|
|
1234
1291
|
),
|
|
1235
|
-
n &&
|
|
1292
|
+
n && at(j) && !q && !St && /* @__PURE__ */ h(
|
|
1236
1293
|
"div",
|
|
1237
1294
|
{
|
|
1238
|
-
|
|
1295
|
+
ref: vt,
|
|
1296
|
+
className: "cteditor-absolute cteditor-flex cteditor-gap-1 z-10 cteditor-text-foreground",
|
|
1297
|
+
style: xe ?? (Mt ? { left: "50%", transform: "translateX(-50%) translateY(100%) translateY(4px)", bottom: 0 } : { top: 8, right: 8 }),
|
|
1239
1298
|
children: [
|
|
1240
|
-
/* @__PURE__ */
|
|
1299
|
+
/* @__PURE__ */ h("div", { className: "cteditor-flex cteditor-items-center cteditor-gap-0.5 cteditor-bg-accent cteditor-border cteditor-border-foreground/10 cteditor-rounded-md cteditor-shadow-md cteditor-p-0.5", children: [
|
|
1241
1300
|
/* @__PURE__ */ r(
|
|
1242
1301
|
"button",
|
|
1243
1302
|
{
|
|
1244
|
-
onClick: (t) =>
|
|
1245
|
-
className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-
|
|
1303
|
+
onClick: (t) => mt(t, "left"),
|
|
1304
|
+
className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "left" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1246
1305
|
"aria-label": "Wrap text left",
|
|
1247
1306
|
title: "Wrap text left",
|
|
1248
|
-
children: /* @__PURE__ */ r(
|
|
1307
|
+
children: /* @__PURE__ */ r(dr, {})
|
|
1249
1308
|
}
|
|
1250
1309
|
),
|
|
1251
1310
|
/* @__PURE__ */ r(
|
|
1252
1311
|
"button",
|
|
1253
1312
|
{
|
|
1254
|
-
onClick: (t) =>
|
|
1255
|
-
className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-
|
|
1313
|
+
onClick: (t) => mt(t, "right"),
|
|
1314
|
+
className: ` cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "right" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1256
1315
|
"aria-label": "Wrap text right",
|
|
1257
1316
|
title: "Wrap text right",
|
|
1258
|
-
children: /* @__PURE__ */ r(
|
|
1317
|
+
children: /* @__PURE__ */ r(cr, {})
|
|
1259
1318
|
}
|
|
1260
1319
|
),
|
|
1261
|
-
/* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-
|
|
1320
|
+
/* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-foreground/10 cteditor-mx-0.5" }),
|
|
1262
1321
|
/* @__PURE__ */ r(
|
|
1263
1322
|
"button",
|
|
1264
1323
|
{
|
|
1265
|
-
onClick: (t) =>
|
|
1266
|
-
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-
|
|
1324
|
+
onClick: (t) => mt(t, "inline-left"),
|
|
1325
|
+
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "inline-left" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1267
1326
|
"aria-label": "Align left",
|
|
1268
1327
|
title: "Align left (no text wrap)",
|
|
1269
|
-
children: /* @__PURE__ */ r(
|
|
1328
|
+
children: /* @__PURE__ */ r(lr, {})
|
|
1270
1329
|
}
|
|
1271
1330
|
),
|
|
1272
1331
|
/* @__PURE__ */ r(
|
|
1273
1332
|
"button",
|
|
1274
1333
|
{
|
|
1275
|
-
onClick: (t) =>
|
|
1276
|
-
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-
|
|
1334
|
+
onClick: (t) => mt(t, "inline-center"),
|
|
1335
|
+
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "inline-center" || c === "full" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1277
1336
|
"aria-label": "Align center",
|
|
1278
1337
|
title: "Align center (no text wrap)",
|
|
1279
|
-
children: /* @__PURE__ */ r(
|
|
1338
|
+
children: /* @__PURE__ */ r(ur, {})
|
|
1280
1339
|
}
|
|
1281
1340
|
),
|
|
1282
1341
|
/* @__PURE__ */ r(
|
|
1283
1342
|
"button",
|
|
1284
1343
|
{
|
|
1285
|
-
onClick: (t) =>
|
|
1286
|
-
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-
|
|
1344
|
+
onClick: (t) => mt(t, "inline-right"),
|
|
1345
|
+
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "inline-right" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1287
1346
|
"aria-label": "Align right",
|
|
1288
1347
|
title: "Align right (no text wrap)",
|
|
1289
|
-
children: /* @__PURE__ */ r(
|
|
1348
|
+
children: /* @__PURE__ */ r(mr, {})
|
|
1290
1349
|
}
|
|
1291
1350
|
),
|
|
1292
|
-
/* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-
|
|
1351
|
+
/* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-foreground/10 cteditor-mx-0.5" }),
|
|
1293
1352
|
/* @__PURE__ */ r(
|
|
1294
1353
|
"button",
|
|
1295
1354
|
{
|
|
1296
|
-
onClick: (t) =>
|
|
1297
|
-
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-
|
|
1355
|
+
onClick: (t) => mt(t, "none"),
|
|
1356
|
+
className: `cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors ${c === "none" ? "cteditor-bg-foreground/10" : ""}`,
|
|
1298
1357
|
"aria-label": "Inline",
|
|
1299
1358
|
title: "Inline with text",
|
|
1300
|
-
children: /* @__PURE__ */ r(
|
|
1359
|
+
children: /* @__PURE__ */ r(gr, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
|
|
1301
1360
|
}
|
|
1302
1361
|
),
|
|
1303
|
-
/* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-
|
|
1304
|
-
!i.startsWith("data:") && !i.toLowerCase().endsWith(".svg") && /* @__PURE__ */
|
|
1362
|
+
/* @__PURE__ */ r("div", { className: "cteditor-w-px cteditor-h-5 cteditor-bg-foreground/10 cteditor-mx-0.5" }),
|
|
1363
|
+
!i.startsWith("data:") && !i.toLowerCase().endsWith(".svg") && /* @__PURE__ */ h(Ft, { children: [
|
|
1305
1364
|
/* @__PURE__ */ r(
|
|
1306
1365
|
"button",
|
|
1307
1366
|
{
|
|
1308
|
-
onClick:
|
|
1309
|
-
className: "cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded
|
|
1367
|
+
onClick: Ee,
|
|
1368
|
+
className: "cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors",
|
|
1310
1369
|
"aria-label": "Crop image",
|
|
1311
1370
|
title: "Crop image",
|
|
1312
|
-
children: /* @__PURE__ */ r(
|
|
1371
|
+
children: /* @__PURE__ */ r(be, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
|
|
1313
1372
|
}
|
|
1314
1373
|
),
|
|
1315
|
-
(
|
|
1374
|
+
(kt(i) !== i || typeof d == "number" || typeof w == "number") && /* @__PURE__ */ r(
|
|
1316
1375
|
"button",
|
|
1317
1376
|
{
|
|
1318
|
-
onClick:
|
|
1319
|
-
className: "cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-
|
|
1377
|
+
onClick: Ie,
|
|
1378
|
+
className: "cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded hover:cteditor-bg-foreground/10 cteditor-transition-colors",
|
|
1320
1379
|
"aria-label": "Reset image to original size and crop",
|
|
1321
1380
|
title: "Reset to original size and crop",
|
|
1322
|
-
children: /* @__PURE__ */ r(
|
|
1381
|
+
children: /* @__PURE__ */ r(Nr, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
|
|
1323
1382
|
}
|
|
1324
1383
|
)
|
|
1325
1384
|
] })
|
|
1326
1385
|
] }),
|
|
1327
|
-
|
|
1386
|
+
k && /* @__PURE__ */ r(
|
|
1328
1387
|
"button",
|
|
1329
1388
|
{
|
|
1330
|
-
onClick:
|
|
1331
|
-
className: " cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-
|
|
1389
|
+
onClick: Yt,
|
|
1390
|
+
className: " cteditor-size-6 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-accent hover:cteditor-bg-accent/95 cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-foreground/20",
|
|
1332
1391
|
"aria-label": "Visit link",
|
|
1333
|
-
title: `Visit: ${
|
|
1334
|
-
children: /* @__PURE__ */ r(
|
|
1392
|
+
title: `Visit: ${k}`,
|
|
1393
|
+
children: /* @__PURE__ */ r(fr, {})
|
|
1335
1394
|
}
|
|
1336
1395
|
),
|
|
1337
1396
|
E && /* @__PURE__ */ r(
|
|
1338
1397
|
"button",
|
|
1339
1398
|
{
|
|
1340
1399
|
onClick: (t) => {
|
|
1341
|
-
t.stopPropagation(),
|
|
1400
|
+
t.stopPropagation(), Re(t);
|
|
1342
1401
|
},
|
|
1343
|
-
className: " cteditor-size-
|
|
1402
|
+
className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-accent hover:cteditor-bg-accent/90 cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-foreground/20",
|
|
1344
1403
|
"aria-label": "Refine image",
|
|
1345
1404
|
title: "Refine image",
|
|
1346
|
-
children: /* @__PURE__ */ r(
|
|
1405
|
+
children: /* @__PURE__ */ r(hr, { className: "cteditor-w-4 cteditor-h-4 cteditor-text-foreground" })
|
|
1347
1406
|
}
|
|
1348
1407
|
),
|
|
1349
1408
|
/* @__PURE__ */ r(
|
|
1350
1409
|
"button",
|
|
1351
1410
|
{
|
|
1352
1411
|
onClick: (t) => {
|
|
1353
|
-
t.stopPropagation(),
|
|
1412
|
+
t.stopPropagation(), Ne(t);
|
|
1354
1413
|
},
|
|
1355
|
-
className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-
|
|
1414
|
+
className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-accent hover:cteditor-bg-accent/90 cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-foreground/20",
|
|
1356
1415
|
"aria-label": "Open image in new tab",
|
|
1357
1416
|
title: "Open in new tab",
|
|
1358
|
-
children: /* @__PURE__ */ r(
|
|
1417
|
+
children: /* @__PURE__ */ r(pr, {})
|
|
1359
1418
|
}
|
|
1360
1419
|
),
|
|
1361
1420
|
/* @__PURE__ */ r(
|
|
1362
1421
|
"button",
|
|
1363
1422
|
{
|
|
1364
1423
|
onClick: (t) => {
|
|
1365
|
-
t.stopPropagation(),
|
|
1424
|
+
t.stopPropagation(), ke(t);
|
|
1366
1425
|
},
|
|
1367
|
-
className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-
|
|
1426
|
+
className: " cteditor-size-8 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-rounded-md cteditor-bg-accent hover:cteditor-bg-destructive hover:cteditor-text-destructive-foreground cteditor-transition-colors cteditor-shadow-md cteditor-border cteditor-border-foreground/20",
|
|
1368
1427
|
"aria-label": "Delete image",
|
|
1369
1428
|
title: "Delete image",
|
|
1370
|
-
children: /* @__PURE__ */ r(
|
|
1429
|
+
children: /* @__PURE__ */ r(br, {})
|
|
1371
1430
|
}
|
|
1372
1431
|
)
|
|
1373
1432
|
]
|
|
1374
1433
|
}
|
|
1375
1434
|
),
|
|
1376
|
-
s && n && !
|
|
1435
|
+
s && n && !q && E && /* @__PURE__ */ r(
|
|
1377
1436
|
"div",
|
|
1378
1437
|
{
|
|
1379
|
-
className: "cteditor-absolute cteditor-bottom-2 cteditor-left-2 cteditor-right-2 cteditor-bg-background cteditor-rounded-lg cteditor-shadow-xl cteditor-border cteditor-border-
|
|
1438
|
+
className: "cteditor-absolute cteditor-bottom-2 cteditor-left-2 cteditor-right-2 cteditor-bg-background/85 cteditor-rounded-lg cteditor-shadow-xl cteditor-border cteditor-border-foreground/20 cteditor-p-3 cteditor-backdrop-blur-lg md:cteditor-min-w-80",
|
|
1380
1439
|
style: { zIndex: 10 },
|
|
1381
1440
|
onClick: (t) => t.stopPropagation(),
|
|
1382
1441
|
onKeyDown: (t) => t.stopPropagation(),
|
|
1383
1442
|
onKeyUp: (t) => t.stopPropagation(),
|
|
1384
|
-
children: /* @__PURE__ */
|
|
1443
|
+
children: /* @__PURE__ */ h("div", { className: "cteditor-flex cteditor-flex-col cteditor-gap-2", children: [
|
|
1385
1444
|
/* @__PURE__ */ r("label", { className: "cteditor-text-xs cteditor-font-medium cteditor-text-foreground", children: "What else do you want in this scene?" }),
|
|
1386
1445
|
/* @__PURE__ */ r(
|
|
1387
1446
|
"input",
|
|
1388
1447
|
{
|
|
1389
1448
|
type: "text",
|
|
1390
|
-
value:
|
|
1391
|
-
onChange: (t) =>
|
|
1449
|
+
value: b,
|
|
1450
|
+
onChange: (t) => g(t.target.value),
|
|
1392
1451
|
onKeyDown: (t) => {
|
|
1393
|
-
t.stopPropagation(), t.key === "Enter" &&
|
|
1452
|
+
t.stopPropagation(), t.key === "Enter" && b.trim() && !y && _t(), t.key === "Escape" && (p(!1), g(""));
|
|
1394
1453
|
},
|
|
1395
1454
|
onKeyUp: (t) => {
|
|
1396
1455
|
t.stopPropagation();
|
|
@@ -1399,22 +1458,22 @@ function eo({
|
|
|
1399
1458
|
t.stopPropagation();
|
|
1400
1459
|
},
|
|
1401
1460
|
placeholder: "e.g., flying birds, golden sunset, stormy clouds...",
|
|
1402
|
-
className: "cteditor-w-full cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-border cteditor-border-border cteditor-rounded-md cteditor-bg-background cteditor-text-foreground
|
|
1403
|
-
disabled:
|
|
1461
|
+
className: "cteditor-w-full cteditor-px-3 cteditor-py-2 cteditor-text-sm cteditor-border cteditor-border-foreground/10 focus:cteditor-border-foreground cteditor-rounded-md cteditor-bg-background cteditor-text-foreground ",
|
|
1462
|
+
disabled: y,
|
|
1404
1463
|
autoFocus: !0
|
|
1405
1464
|
}
|
|
1406
1465
|
),
|
|
1407
|
-
/* @__PURE__ */
|
|
1466
|
+
/* @__PURE__ */ h("div", { className: "cteditor-flex cteditor-gap-2 cteditor-justify-end", children: [
|
|
1408
1467
|
/* @__PURE__ */ r(
|
|
1409
1468
|
"button",
|
|
1410
1469
|
{
|
|
1411
1470
|
onClick: (t) => {
|
|
1412
|
-
t.stopPropagation(),
|
|
1471
|
+
t.stopPropagation(), _t();
|
|
1413
1472
|
},
|
|
1414
|
-
disabled:
|
|
1415
|
-
className: "
|
|
1416
|
-
children:
|
|
1417
|
-
/* @__PURE__ */ r("span", { className: "cteditor-inline-block cteditor-w-4 cteditor-h-4 cteditor-border-2
|
|
1473
|
+
disabled: y || !b.trim(),
|
|
1474
|
+
className: " cteditor-px-5 cteditor-py-2 cteditor-text-sm cteditor-rounded-md cteditor-bg-foreground cteditor-text-background hover:cteditor-bg-foreground/95 disabled:cteditor-opacity-50 disabled:cteditor-cursor-not-allowed cteditor-transition-colors focus:cteditor-outline-none focus:cteditor-ring-2 focus:cteditor-ring-background",
|
|
1475
|
+
children: y ? /* @__PURE__ */ h("span", { className: "cteditor-flex cteditor-items-center cteditor-justify-center cteditor-gap-2", children: [
|
|
1476
|
+
/* @__PURE__ */ r("span", { className: "cteditor-inline-block cteditor-w-4 cteditor-h-4 cteditor-border-2 cteditor-border-t-transparent cteditor-rounded-full cteditor-animate-spin" }),
|
|
1418
1477
|
"Refining..."
|
|
1419
1478
|
] }) : "Refine Image"
|
|
1420
1479
|
}
|
|
@@ -1423,35 +1482,35 @@ function eo({
|
|
|
1423
1482
|
"button",
|
|
1424
1483
|
{
|
|
1425
1484
|
onClick: (t) => {
|
|
1426
|
-
t.stopPropagation(),
|
|
1485
|
+
t.stopPropagation(), p(!1), g("");
|
|
1427
1486
|
},
|
|
1428
|
-
disabled:
|
|
1429
|
-
className: "cteditor-
|
|
1430
|
-
children:
|
|
1487
|
+
disabled: y,
|
|
1488
|
+
className: "cteditor-size-9 cteditor-flex cteditor-items-center cteditor-justify-center cteditor-text-sm cteditor-rounded-md cteditor-bg-background cteditor-border cteditor-border-border cteditor-text-foreground hover:cteditor-bg-accent disabled:cteditor-opacity-50 disabled:cteditor-cursor-not-allowed cteditor-transition-colors",
|
|
1489
|
+
children: /* @__PURE__ */ r(yr, { size: 16 })
|
|
1431
1490
|
}
|
|
1432
1491
|
)
|
|
1433
1492
|
] })
|
|
1434
1493
|
] })
|
|
1435
1494
|
}
|
|
1436
1495
|
),
|
|
1437
|
-
L &&
|
|
1438
|
-
|
|
1496
|
+
L && at(j) && Ot && !St && /* @__PURE__ */ r(
|
|
1497
|
+
Ye,
|
|
1439
1498
|
{
|
|
1440
1499
|
showCaption: P,
|
|
1441
|
-
setShowCaption:
|
|
1442
|
-
editor:
|
|
1443
|
-
buttonRef:
|
|
1500
|
+
setShowCaption: ve,
|
|
1501
|
+
editor: m,
|
|
1502
|
+
buttonRef: D,
|
|
1444
1503
|
imageRef: v,
|
|
1445
|
-
maxWidth:
|
|
1446
|
-
onResizeStart:
|
|
1447
|
-
onResizeEnd:
|
|
1448
|
-
captionsEnabled: !
|
|
1504
|
+
maxWidth: x,
|
|
1505
|
+
onResizeStart: Ce,
|
|
1506
|
+
onResizeEnd: we,
|
|
1507
|
+
captionsEnabled: !q && C
|
|
1449
1508
|
}
|
|
1450
1509
|
)
|
|
1451
1510
|
]
|
|
1452
1511
|
}
|
|
1453
1512
|
),
|
|
1454
|
-
P && (o.startsWith("Signature by") ? /* @__PURE__ */ r(
|
|
1513
|
+
P && (o.startsWith("Signature by") ? /* @__PURE__ */ r(Rr, { caption: N }) : /* @__PURE__ */ r(
|
|
1455
1514
|
"div",
|
|
1456
1515
|
{
|
|
1457
1516
|
className: "image-caption-container",
|
|
@@ -1461,74 +1520,74 @@ function eo({
|
|
|
1461
1520
|
// Match the image's alignment
|
|
1462
1521
|
...c === "inline-center" || c === "full" ? { margin: "0 auto" } : c === "inline-right" ? { marginLeft: "auto" } : c === "left" ? { float: "left", clear: "left" } : c === "right" ? { float: "right", clear: "right" } : {}
|
|
1463
1522
|
},
|
|
1464
|
-
children: /* @__PURE__ */
|
|
1465
|
-
|
|
1523
|
+
children: /* @__PURE__ */ h(
|
|
1524
|
+
re,
|
|
1466
1525
|
{
|
|
1467
|
-
initialEditor:
|
|
1526
|
+
initialEditor: N,
|
|
1468
1527
|
initialNodes: [
|
|
1528
|
+
ae,
|
|
1529
|
+
ne,
|
|
1530
|
+
se,
|
|
1531
|
+
de,
|
|
1469
1532
|
Qt,
|
|
1470
|
-
|
|
1471
|
-
te,
|
|
1472
|
-
ee,
|
|
1473
|
-
Bt,
|
|
1474
|
-
Xt
|
|
1533
|
+
Jt
|
|
1475
1534
|
],
|
|
1476
1535
|
children: [
|
|
1477
|
-
/* @__PURE__ */ r(
|
|
1536
|
+
/* @__PURE__ */ r(_e, {}),
|
|
1478
1537
|
/* @__PURE__ */ r(
|
|
1479
|
-
|
|
1538
|
+
ie,
|
|
1480
1539
|
{
|
|
1481
1540
|
contentEditable: /* @__PURE__ */ r(
|
|
1482
|
-
|
|
1541
|
+
Zt,
|
|
1483
1542
|
{
|
|
1484
1543
|
"aria-placeholder": "Enter a caption...",
|
|
1485
1544
|
placeholder: () => /* @__PURE__ */ r("span", { className: "cteditor-text-xs", children: "Enter a caption..." }),
|
|
1486
1545
|
className: " cteditor-outline-none !cteditor-shadow-none cteditor-bg-foreground/10 cteditor-border !cteditor-border-foreground/15 cteditor-py-1 cteditor-px-2 cteditor-rounded-sm cteditor-text-xs"
|
|
1487
1546
|
}
|
|
1488
1547
|
),
|
|
1489
|
-
ErrorBoundary:
|
|
1548
|
+
ErrorBoundary: te
|
|
1490
1549
|
}
|
|
1491
1550
|
),
|
|
1492
1551
|
/* @__PURE__ */ r(
|
|
1493
|
-
|
|
1552
|
+
oe,
|
|
1494
1553
|
{
|
|
1495
1554
|
onChange: () => {
|
|
1496
1555
|
}
|
|
1497
1556
|
}
|
|
1498
1557
|
),
|
|
1499
|
-
/* @__PURE__ */ r(
|
|
1500
|
-
/* @__PURE__ */ r(
|
|
1558
|
+
/* @__PURE__ */ r(ee, {}),
|
|
1559
|
+
/* @__PURE__ */ r(he, { namespace: pe.namespace })
|
|
1501
1560
|
]
|
|
1502
1561
|
}
|
|
1503
1562
|
)
|
|
1504
1563
|
}
|
|
1505
1564
|
)),
|
|
1506
1565
|
/* @__PURE__ */ r(
|
|
1507
|
-
|
|
1566
|
+
Tr,
|
|
1508
1567
|
{
|
|
1509
1568
|
open: F,
|
|
1510
|
-
onOpenChange:
|
|
1569
|
+
onOpenChange: ut,
|
|
1511
1570
|
src: i,
|
|
1512
1571
|
altText: o,
|
|
1513
1572
|
width: d,
|
|
1514
|
-
height:
|
|
1515
|
-
onCropApply:
|
|
1573
|
+
height: w,
|
|
1574
|
+
onCropApply: Pe
|
|
1516
1575
|
}
|
|
1517
1576
|
),
|
|
1518
1577
|
/* @__PURE__ */ r(
|
|
1519
|
-
|
|
1578
|
+
kr,
|
|
1520
1579
|
{
|
|
1521
|
-
open:
|
|
1522
|
-
onOpenChange:
|
|
1580
|
+
open: ct,
|
|
1581
|
+
onOpenChange: lt,
|
|
1523
1582
|
oldImageUrl: i,
|
|
1524
|
-
newImageUrl:
|
|
1525
|
-
onReplace:
|
|
1526
|
-
onCancel:
|
|
1583
|
+
newImageUrl: G,
|
|
1584
|
+
onReplace: Me,
|
|
1585
|
+
onCancel: Ae
|
|
1527
1586
|
}
|
|
1528
1587
|
)
|
|
1529
1588
|
] }) });
|
|
1530
1589
|
}
|
|
1531
1590
|
export {
|
|
1532
|
-
|
|
1533
|
-
|
|
1591
|
+
Vt as RIGHT_CLICK_IMAGE_COMMAND,
|
|
1592
|
+
co as default
|
|
1534
1593
|
};
|