artifactuse 0.1.21 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -2
- package/dist/core/detector.d.ts +27 -0
- package/dist/core/editor.d.ts +13 -0
- package/dist/core/index.d.ts +31 -0
- package/dist/{index-ZmmxlD3v.js → index-CQXV7Rft.js} +1552 -1185
- package/dist/index.js +89 -88
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +739 -699
- package/dist/styles/components/panel.css +30 -2
- package/dist/svelte/index.d.ts +171 -0
- package/dist/svelte/index.js +1844 -1761
- package/dist/vue/index.d.ts +114 -0
- package/dist/vue/index.js +1375 -1304
- package/dist/vue2/composables.d.ts +114 -0
- package/dist/vue2/index.js +817 -123
- package/package.json +33 -1
package/dist/vue/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ref as M, computed as
|
|
2
|
-
import { g as
|
|
3
|
-
import { J as
|
|
4
|
-
const
|
|
1
|
+
import { ref as M, computed as b, createElementBlock as s, openBlock as a, normalizeClass as N, createElementVNode as e, toDisplayString as n, withModifiers as he, onMounted as we, watch as fe, Fragment as R, createCommentVNode as d, renderList as ue, createTextVNode as K, h as le, normalizeStyle as $e, createStaticVNode as Pt, createBlock as ke, resolveDynamicComponent as Bt, nextTick as ge, onUnmounted as Oe, Teleport as Et, createVNode as Ae, Transition as Me, withCtx as Le, withKeys as St, onBeforeUnmount as zt, unref as y, withDirectives as Qe, vShow as Ge, reactive as et, provide as It, inject as Ft } from "vue";
|
|
2
|
+
import { g as Te, f as tt, a as Re, b as qe, n as Vt, i as Rt, D as qt, c as at } from "../index-CQXV7Rft.js";
|
|
3
|
+
import { J as Ot } from "../jszip.min-CdmYyw5L.js";
|
|
4
|
+
const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class: "artifactuse-card__content" }, Nt = { class: "artifactuse-card__title" }, Jt = { class: "artifactuse-card__meta" }, Xt = { class: "artifactuse-card__type" }, Zt = { class: "artifactuse-card__size" }, Wt = { class: "artifactuse-card__actions" }, Kt = ["title"], Yt = {
|
|
5
5
|
key: 0,
|
|
6
6
|
viewBox: "0 0 24 24",
|
|
7
7
|
fill: "none",
|
|
8
8
|
stroke: "currentColor",
|
|
9
9
|
"stroke-width": "2"
|
|
10
|
-
},
|
|
10
|
+
}, Qt = {
|
|
11
11
|
key: 1,
|
|
12
12
|
viewBox: "0 0 24 24",
|
|
13
13
|
fill: "none",
|
|
14
14
|
stroke: "currentColor",
|
|
15
15
|
"stroke-width": "2"
|
|
16
|
-
},
|
|
16
|
+
}, Gt = {
|
|
17
17
|
__name: "ArtifactuseCard",
|
|
18
18
|
props: {
|
|
19
19
|
artifact: {
|
|
@@ -26,58 +26,58 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
emits: ["open", "copy", "download"],
|
|
29
|
-
setup(H, { emit:
|
|
30
|
-
const
|
|
29
|
+
setup(H, { emit: u }) {
|
|
30
|
+
const h = H, k = u, l = M(!1), U = b(() => Te(h.artifact.language)), S = b(() => {
|
|
31
31
|
var C;
|
|
32
|
-
return
|
|
33
|
-
}), A =
|
|
34
|
-
function
|
|
35
|
-
C.stopPropagation(),
|
|
32
|
+
return tt(h.artifact.size || ((C = h.artifact.code) == null ? void 0 : C.length) || 0);
|
|
33
|
+
}), A = b(() => Re(h.artifact.language));
|
|
34
|
+
function g(C) {
|
|
35
|
+
C.stopPropagation(), k("open", h.artifact);
|
|
36
36
|
}
|
|
37
|
-
async function
|
|
37
|
+
async function o() {
|
|
38
38
|
try {
|
|
39
|
-
await navigator.clipboard.writeText(
|
|
40
|
-
|
|
41
|
-
}, 2e3),
|
|
39
|
+
await navigator.clipboard.writeText(h.artifact.code), l.value = !0, setTimeout(() => {
|
|
40
|
+
l.value = !1;
|
|
41
|
+
}, 2e3), k("copy", h.artifact);
|
|
42
42
|
} catch (C) {
|
|
43
43
|
console.error("Failed to copy:", C);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
var
|
|
48
|
-
const C = new Blob([
|
|
49
|
-
|
|
46
|
+
function m() {
|
|
47
|
+
var F;
|
|
48
|
+
const C = new Blob([h.artifact.code], { type: "text/plain" }), $ = URL.createObjectURL(C), q = document.createElement("a"), O = qe(h.artifact.language), J = ((F = h.artifact.title) == null ? void 0 : F.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
|
|
49
|
+
q.href = $, q.download = `${J}.${O}`, document.body.appendChild(q), q.click(), document.body.removeChild(q), URL.revokeObjectURL($), k("download", h.artifact);
|
|
50
50
|
}
|
|
51
51
|
return (C, $) => (a(), s("div", {
|
|
52
|
-
class:
|
|
53
|
-
onClick:
|
|
52
|
+
class: N(["artifactuse-card", { "artifactuse-card--active": H.isActive }]),
|
|
53
|
+
onClick: g
|
|
54
54
|
}, [
|
|
55
|
-
e("div",
|
|
55
|
+
e("div", Ut, [
|
|
56
56
|
(a(), s("svg", {
|
|
57
57
|
viewBox: "0 0 24 24",
|
|
58
58
|
fill: "none",
|
|
59
59
|
stroke: "currentColor",
|
|
60
60
|
"stroke-width": "1.5",
|
|
61
61
|
innerHTML: A.value
|
|
62
|
-
}, null, 8,
|
|
62
|
+
}, null, 8, Dt))
|
|
63
63
|
]),
|
|
64
|
-
e("div",
|
|
65
|
-
e("div",
|
|
66
|
-
e("div",
|
|
67
|
-
e("span",
|
|
64
|
+
e("div", jt, [
|
|
65
|
+
e("div", Nt, n(H.artifact.title), 1),
|
|
66
|
+
e("div", Jt, [
|
|
67
|
+
e("span", Xt, n(U.value), 1),
|
|
68
68
|
$[0] || ($[0] = e("span", { class: "artifactuse-card__separator" }, "•", -1)),
|
|
69
|
-
e("span",
|
|
69
|
+
e("span", Zt, n(S.value), 1)
|
|
70
70
|
])
|
|
71
71
|
]),
|
|
72
|
-
e("div",
|
|
72
|
+
e("div", Wt, [
|
|
73
73
|
e("button", {
|
|
74
74
|
class: "artifactuse-card__action",
|
|
75
|
-
onClick:
|
|
76
|
-
title:
|
|
75
|
+
onClick: he(o, ["stop"]),
|
|
76
|
+
title: l.value ? "Copied!" : "Copy code"
|
|
77
77
|
}, [
|
|
78
|
-
|
|
78
|
+
l.value ? (a(), s("svg", Qt, [...$[2] || ($[2] = [
|
|
79
79
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
80
|
-
])])) : (a(), s("svg",
|
|
80
|
+
])])) : (a(), s("svg", Yt, [...$[1] || ($[1] = [
|
|
81
81
|
e("rect", {
|
|
82
82
|
x: "9",
|
|
83
83
|
y: "9",
|
|
@@ -88,10 +88,10 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
88
88
|
}, null, -1),
|
|
89
89
|
e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
|
|
90
90
|
])]))
|
|
91
|
-
], 8,
|
|
91
|
+
], 8, Kt),
|
|
92
92
|
e("button", {
|
|
93
93
|
class: "artifactuse-card__action",
|
|
94
|
-
onClick:
|
|
94
|
+
onClick: he(m, ["stop"]),
|
|
95
95
|
title: "Download file"
|
|
96
96
|
}, [...$[3] || ($[3] = [
|
|
97
97
|
e("svg", {
|
|
@@ -123,10 +123,10 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
123
123
|
], -1))
|
|
124
124
|
], 2));
|
|
125
125
|
}
|
|
126
|
-
},
|
|
126
|
+
}, ea = ["data-artifactuse-theme"], ta = {
|
|
127
127
|
key: 0,
|
|
128
128
|
class: "artifactuse-form-collapsed"
|
|
129
|
-
},
|
|
129
|
+
}, aa = { class: "artifactuse-form-collapsed-icon" }, sa = {
|
|
130
130
|
key: 0,
|
|
131
131
|
viewBox: "0 0 24 24",
|
|
132
132
|
fill: "none",
|
|
@@ -134,7 +134,7 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
134
134
|
"stroke-width": "2.5",
|
|
135
135
|
"stroke-linecap": "round",
|
|
136
136
|
"stroke-linejoin": "round"
|
|
137
|
-
},
|
|
137
|
+
}, ia = {
|
|
138
138
|
key: 1,
|
|
139
139
|
viewBox: "0 0 24 24",
|
|
140
140
|
fill: "none",
|
|
@@ -142,7 +142,7 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
142
142
|
"stroke-width": "2.5",
|
|
143
143
|
"stroke-linecap": "round",
|
|
144
144
|
"stroke-linejoin": "round"
|
|
145
|
-
},
|
|
145
|
+
}, la = {
|
|
146
146
|
key: 2,
|
|
147
147
|
viewBox: "0 0 24 24",
|
|
148
148
|
fill: "none",
|
|
@@ -150,64 +150,64 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
150
150
|
"stroke-width": "2.5",
|
|
151
151
|
"stroke-linecap": "round",
|
|
152
152
|
"stroke-linejoin": "round"
|
|
153
|
-
},
|
|
153
|
+
}, na = { class: "artifactuse-form-collapsed-title" }, oa = {
|
|
154
154
|
key: 0,
|
|
155
155
|
class: "artifactuse-form-header"
|
|
156
|
-
},
|
|
156
|
+
}, ra = {
|
|
157
157
|
key: 0,
|
|
158
158
|
class: "artifactuse-form-title"
|
|
159
|
-
},
|
|
159
|
+
}, ca = {
|
|
160
160
|
key: 1,
|
|
161
161
|
class: "artifactuse-form-description"
|
|
162
|
-
},
|
|
162
|
+
}, ua = {
|
|
163
163
|
key: 1,
|
|
164
164
|
class: "artifactuse-form-buttons"
|
|
165
|
-
},
|
|
165
|
+
}, da = ["disabled", "onClick"], va = ["innerHTML"], fa = { class: "artifactuse-form-fields" }, pa = {
|
|
166
166
|
key: 0,
|
|
167
167
|
class: "artifactuse-form-buttons"
|
|
168
|
-
},
|
|
168
|
+
}, _a = ["type", "disabled", "onClick"], ha = {
|
|
169
169
|
key: 0,
|
|
170
170
|
class: "artifactuse-form-btn-spinner"
|
|
171
|
-
},
|
|
171
|
+
}, ma = ["innerHTML"], ya = {
|
|
172
172
|
key: 1,
|
|
173
173
|
class: "artifactuse-form-divider"
|
|
174
|
-
},
|
|
174
|
+
}, ga = {
|
|
175
175
|
key: 2,
|
|
176
176
|
class: "artifactuse-form-heading"
|
|
177
|
-
},
|
|
177
|
+
}, ka = {
|
|
178
178
|
key: 3,
|
|
179
179
|
class: "artifactuse-form-field"
|
|
180
|
-
},
|
|
180
|
+
}, wa = { class: "artifactuse-checkbox-label" }, Ca = ["checked", "disabled", "onChange"], ba = { class: "artifactuse-checkbox-text" }, xa = {
|
|
181
181
|
key: 0,
|
|
182
182
|
class: "artifactuse-required"
|
|
183
|
-
},
|
|
183
|
+
}, $a = {
|
|
184
184
|
key: 0,
|
|
185
185
|
class: "artifactuse-help-text"
|
|
186
|
-
},
|
|
186
|
+
}, Ma = {
|
|
187
187
|
key: 1,
|
|
188
188
|
class: "artifactuse-error-text"
|
|
189
|
-
},
|
|
189
|
+
}, La = {
|
|
190
190
|
key: 4,
|
|
191
191
|
class: "artifactuse-form-field"
|
|
192
|
-
},
|
|
192
|
+
}, Ta = ["for"], Aa = {
|
|
193
193
|
key: 0,
|
|
194
194
|
class: "artifactuse-required"
|
|
195
|
-
},
|
|
195
|
+
}, Ha = ["id", "type", "value", "placeholder", "disabled", "required", "onInput"], Pa = ["id", "value", "placeholder", "disabled", "required", "rows", "onInput"], Ba = ["id", "value", "disabled", "required", "onChange"], Ea = { value: "" }, Sa = ["value", "disabled"], za = {
|
|
196
196
|
key: 3,
|
|
197
197
|
class: "artifactuse-radio-group"
|
|
198
|
-
},
|
|
198
|
+
}, Ia = ["name", "value", "checked", "disabled", "onChange"], Fa = {
|
|
199
199
|
key: 4,
|
|
200
200
|
class: "artifactuse-help-text"
|
|
201
|
-
},
|
|
201
|
+
}, Va = {
|
|
202
202
|
key: 5,
|
|
203
203
|
class: "artifactuse-error-text"
|
|
204
|
-
},
|
|
204
|
+
}, Ra = {
|
|
205
205
|
key: 0,
|
|
206
206
|
class: "artifactuse-form-buttons artifactuse-form-buttons-default"
|
|
207
|
-
},
|
|
207
|
+
}, qa = ["disabled"], Oa = {
|
|
208
208
|
key: 0,
|
|
209
209
|
class: "artifactuse-form-btn-spinner"
|
|
210
|
-
},
|
|
210
|
+
}, Ua = {
|
|
211
211
|
__name: "ArtifactuseInlineForm",
|
|
212
212
|
props: {
|
|
213
213
|
artifact: { type: Object, required: !0 },
|
|
@@ -220,146 +220,146 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
220
220
|
}
|
|
221
221
|
},
|
|
222
222
|
emits: ["submit", "cancel", "reset", "button-click"],
|
|
223
|
-
setup(H, { emit:
|
|
224
|
-
const
|
|
225
|
-
function A(
|
|
226
|
-
|
|
223
|
+
setup(H, { emit: u }) {
|
|
224
|
+
const h = H, k = u, l = M(h.initialState), U = b(() => l.value !== "active"), S = b(() => l.value === "active" ? "" : `artifactuse-form--${l.value}`);
|
|
225
|
+
function A(_) {
|
|
226
|
+
l.value = _;
|
|
227
227
|
}
|
|
228
|
-
const
|
|
228
|
+
const g = b(() => {
|
|
229
229
|
try {
|
|
230
|
-
return JSON.parse(
|
|
230
|
+
return JSON.parse(h.artifact.code);
|
|
231
231
|
} catch {
|
|
232
232
|
return { title: "Invalid Form", variant: "fields", data: { fields: [] } };
|
|
233
233
|
}
|
|
234
|
-
}),
|
|
235
|
-
var
|
|
236
|
-
return ((
|
|
237
|
-
}), ee =
|
|
238
|
-
var
|
|
239
|
-
return
|
|
240
|
-
}),
|
|
241
|
-
function
|
|
242
|
-
if (!
|
|
243
|
-
const T =
|
|
234
|
+
}), o = M(null), m = b(() => h.artifact.id || g.value.id || `form-${Date.now()}`), C = b(() => `artifactuse-form-${g.value.variant || "fields"}`), $ = b(() => g.value.title || "Form"), q = M({}), O = M({}), J = M(!1), F = b(() => {
|
|
235
|
+
var _;
|
|
236
|
+
return ((_ = g.value.data) == null ? void 0 : _.fields) || [];
|
|
237
|
+
}), ee = b(() => {
|
|
238
|
+
var _;
|
|
239
|
+
return g.value.variant === "buttons" ? ((_ = g.value.data) == null ? void 0 : _.fields) || [] : [];
|
|
240
|
+
}), I = b(() => F.value.some((_) => _.type === "buttons"));
|
|
241
|
+
function te(_) {
|
|
242
|
+
if (!_) return null;
|
|
243
|
+
const T = _.trim();
|
|
244
244
|
if (T.startsWith("#")) {
|
|
245
245
|
let c = T.slice(1);
|
|
246
|
-
if (c.length === 3 && (c = c.split("").map((
|
|
247
|
-
const
|
|
248
|
-
if (!isNaN(
|
|
246
|
+
if (c.length === 3 && (c = c.split("").map((P) => P + P).join("")), c.length === 6) {
|
|
247
|
+
const P = parseInt(c.slice(0, 2), 16), ne = parseInt(c.slice(2, 4), 16), ce = parseInt(c.slice(4, 6), 16);
|
|
248
|
+
if (!isNaN(P) && !isNaN(ne) && !isNaN(ce)) return `${P}, ${ne}, ${ce}`;
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
251
|
+
const r = T.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
|
|
252
|
+
if (r) return `${r[1]}, ${r[2]}, ${r[3]}`;
|
|
253
253
|
const E = T.split(/[\s,]+/).map(Number).filter((c) => !isNaN(c));
|
|
254
254
|
return E.length >= 3 ? `${E[0]}, ${E[1]}, ${E[2]}` : null;
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
if (
|
|
258
|
-
const
|
|
259
|
-
|
|
256
|
+
function X() {
|
|
257
|
+
if (o.value && h.accent) {
|
|
258
|
+
const _ = te(h.accent);
|
|
259
|
+
_ && o.value.style.setProperty("--artifactuse-primary", _);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
we(() => {
|
|
263
|
-
|
|
264
|
-
}),
|
|
265
|
-
|
|
263
|
+
X(), l.value = h.initialState;
|
|
264
|
+
}), fe(() => h.accent, X), fe(() => h.initialState, (_) => {
|
|
265
|
+
l.value = _;
|
|
266
266
|
});
|
|
267
|
-
function
|
|
268
|
-
var
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
["buttons", "divider", "heading"].includes(E.type) || (E.defaultValue !== void 0 ?
|
|
272
|
-
}), (
|
|
267
|
+
function Z() {
|
|
268
|
+
var r;
|
|
269
|
+
const _ = {};
|
|
270
|
+
F.value.forEach((E) => {
|
|
271
|
+
["buttons", "divider", "heading"].includes(E.type) || (E.defaultValue !== void 0 ? _[E.name] = E.defaultValue : E.type === "checkbox" ? _[E.name] = !1 : _[E.name] = "");
|
|
272
|
+
}), (r = g.value.data) != null && r.defaults && Object.assign(_, g.value.data.defaults), q.value = _;
|
|
273
273
|
}
|
|
274
|
-
|
|
275
|
-
function
|
|
276
|
-
return ["text", "email", "password", "tel", "url", "number", "date", "time", "datetime-local"].includes(
|
|
274
|
+
Z(), fe(() => h.artifact.code, Z);
|
|
275
|
+
function oe(_) {
|
|
276
|
+
return ["text", "email", "password", "tel", "url", "number", "date", "time", "datetime-local"].includes(_);
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
return
|
|
278
|
+
function f(_) {
|
|
279
|
+
return _ ? _.map((T) => typeof T == "string" ? { label: T, value: T } : T) : [];
|
|
280
280
|
}
|
|
281
|
-
function p(
|
|
282
|
-
|
|
281
|
+
function p(_, T) {
|
|
282
|
+
q.value[_] = T, O.value[_] && delete O.value[_];
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function ae() {
|
|
285
285
|
var E;
|
|
286
|
-
const
|
|
287
|
-
|
|
286
|
+
const _ = {};
|
|
287
|
+
F.value.forEach((c) => {
|
|
288
288
|
if (["buttons", "divider", "heading"].includes(c.type)) return;
|
|
289
|
-
const
|
|
290
|
-
if (c.required && !
|
|
291
|
-
|
|
289
|
+
const P = q.value[c.name];
|
|
290
|
+
if (c.required && !P && P !== 0 && P !== !1) {
|
|
291
|
+
_[c.name] = `${c.label || "This field"} is required`;
|
|
292
292
|
return;
|
|
293
293
|
}
|
|
294
|
-
if (c.pattern &&
|
|
295
|
-
|
|
294
|
+
if (c.pattern && P && !new RegExp(c.pattern).test(P)) {
|
|
295
|
+
_[c.name] = c.patternMessage || `${c.label || "This field"} is invalid`;
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (c.type === "email" &&
|
|
299
|
-
|
|
298
|
+
if (c.type === "email" && P && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(P)) {
|
|
299
|
+
_[c.name] = "Please enter a valid email address";
|
|
300
300
|
return;
|
|
301
301
|
}
|
|
302
|
-
if (c.minLength &&
|
|
303
|
-
|
|
302
|
+
if (c.minLength && P && P.length < c.minLength) {
|
|
303
|
+
_[c.name] = `Minimum ${c.minLength} characters required`;
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
|
-
if (c.maxLength &&
|
|
307
|
-
|
|
306
|
+
if (c.maxLength && P && P.length > c.maxLength) {
|
|
307
|
+
_[c.name] = `Maximum ${c.maxLength} characters allowed`;
|
|
308
308
|
return;
|
|
309
309
|
}
|
|
310
310
|
});
|
|
311
|
-
const
|
|
312
|
-
return
|
|
313
|
-
if (
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
}),
|
|
317
|
-
}
|
|
318
|
-
function
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
function
|
|
322
|
-
|
|
323
|
-
formId:
|
|
311
|
+
const r = (E = g.value.data) == null ? void 0 : E.validation;
|
|
312
|
+
return r && Object.entries(r).forEach(([c, P]) => {
|
|
313
|
+
if (_[c]) return;
|
|
314
|
+
const ne = q.value[c];
|
|
315
|
+
P.pattern && ne && (new RegExp(P.pattern).test(ne) || (_[c] = P.message || `${c} is invalid`));
|
|
316
|
+
}), O.value = _, Object.keys(_).length === 0;
|
|
317
|
+
}
|
|
318
|
+
function L() {
|
|
319
|
+
Z(), O.value = {};
|
|
320
|
+
}
|
|
321
|
+
function Y() {
|
|
322
|
+
ae() && (J.value = !0, k("submit", {
|
|
323
|
+
formId: m.value,
|
|
324
324
|
action: "submit",
|
|
325
|
-
values: { ...
|
|
325
|
+
values: { ...q.value },
|
|
326
326
|
timestamp: Date.now()
|
|
327
327
|
}), setTimeout(() => {
|
|
328
|
-
|
|
328
|
+
J.value = !1, A("submitted");
|
|
329
329
|
}, 300));
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
const T =
|
|
331
|
+
function Q(_) {
|
|
332
|
+
const T = _.action || "custom";
|
|
333
333
|
switch (T) {
|
|
334
334
|
case "submit":
|
|
335
|
-
|
|
335
|
+
Y();
|
|
336
336
|
break;
|
|
337
337
|
case "cancel":
|
|
338
|
-
|
|
339
|
-
formId:
|
|
338
|
+
k("cancel", {
|
|
339
|
+
formId: m.value,
|
|
340
340
|
action: "cancel",
|
|
341
|
-
buttonName:
|
|
341
|
+
buttonName: _.name || "cancel",
|
|
342
342
|
timestamp: Date.now()
|
|
343
343
|
}), setTimeout(() => {
|
|
344
344
|
A("cancelled");
|
|
345
345
|
}, 150);
|
|
346
346
|
break;
|
|
347
347
|
case "reset":
|
|
348
|
-
|
|
349
|
-
formId:
|
|
348
|
+
L(), k("reset", {
|
|
349
|
+
formId: m.value,
|
|
350
350
|
action: "reset",
|
|
351
|
-
buttonName:
|
|
351
|
+
buttonName: _.name || "reset",
|
|
352
352
|
timestamp: Date.now()
|
|
353
353
|
});
|
|
354
354
|
break;
|
|
355
355
|
case "custom":
|
|
356
356
|
default:
|
|
357
|
-
|
|
358
|
-
formId:
|
|
357
|
+
k("button-click", {
|
|
358
|
+
formId: m.value,
|
|
359
359
|
action: T,
|
|
360
|
-
buttonName:
|
|
361
|
-
buttonLabel:
|
|
362
|
-
values: { ...
|
|
360
|
+
buttonName: _.name || _.label,
|
|
361
|
+
buttonLabel: _.label,
|
|
362
|
+
values: { ...q.value },
|
|
363
363
|
timestamp: Date.now()
|
|
364
364
|
}), setTimeout(() => {
|
|
365
365
|
A("submitted");
|
|
@@ -367,21 +367,21 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
367
367
|
break;
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
return (
|
|
370
|
+
return (_, T) => (a(), s("div", {
|
|
371
371
|
ref_key: "containerRef",
|
|
372
|
-
ref:
|
|
373
|
-
class:
|
|
372
|
+
ref: o,
|
|
373
|
+
class: N([
|
|
374
374
|
"artifactuse-inline-form",
|
|
375
375
|
C.value,
|
|
376
|
-
|
|
376
|
+
S.value
|
|
377
377
|
]),
|
|
378
378
|
"data-artifactuse-theme": H.theme
|
|
379
379
|
}, [
|
|
380
|
-
|
|
381
|
-
e("div",
|
|
382
|
-
|
|
380
|
+
U.value ? (a(), s("div", ta, [
|
|
381
|
+
e("div", aa, [
|
|
382
|
+
l.value === "submitted" ? (a(), s("svg", sa, [...T[1] || (T[1] = [
|
|
383
383
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
384
|
-
])])) :
|
|
384
|
+
])])) : l.value === "cancelled" ? (a(), s("svg", ia, [...T[2] || (T[2] = [
|
|
385
385
|
e("line", {
|
|
386
386
|
x1: "18",
|
|
387
387
|
y1: "6",
|
|
@@ -394,7 +394,7 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
394
394
|
x2: "18",
|
|
395
395
|
y2: "18"
|
|
396
396
|
}, null, -1)
|
|
397
|
-
])])) : (a(), s("svg",
|
|
397
|
+
])])) : (a(), s("svg", la, [...T[3] || (T[3] = [
|
|
398
398
|
e("line", {
|
|
399
399
|
x1: "5",
|
|
400
400
|
y1: "12",
|
|
@@ -403,216 +403,216 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
403
403
|
}, null, -1)
|
|
404
404
|
])]))
|
|
405
405
|
]),
|
|
406
|
-
e("span",
|
|
407
|
-
])) : (a(), s(
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
])) :
|
|
412
|
-
|
|
413
|
-
(a(!0), s(
|
|
414
|
-
key:
|
|
406
|
+
e("span", na, n($.value), 1)
|
|
407
|
+
])) : (a(), s(R, { key: 1 }, [
|
|
408
|
+
g.value.title || g.value.description ? (a(), s("div", oa, [
|
|
409
|
+
g.value.title ? (a(), s("div", ra, n(g.value.title), 1)) : d("", !0),
|
|
410
|
+
g.value.description ? (a(), s("p", ca, n(g.value.description), 1)) : d("", !0)
|
|
411
|
+
])) : d("", !0),
|
|
412
|
+
g.value.variant === "buttons" ? (a(), s("div", ua, [
|
|
413
|
+
(a(!0), s(R, null, ue(ee.value, (r) => (a(), s("button", {
|
|
414
|
+
key: r.name || r.label,
|
|
415
415
|
type: "button",
|
|
416
|
-
class:
|
|
417
|
-
disabled:
|
|
418
|
-
onClick: (E) =>
|
|
416
|
+
class: N(["artifactuse-form-btn", `artifactuse-form-btn-${r.variant || "secondary"}`]),
|
|
417
|
+
disabled: r.disabled || J.value,
|
|
418
|
+
onClick: (E) => Q(r)
|
|
419
419
|
}, [
|
|
420
|
-
|
|
420
|
+
r.icon ? (a(), s("span", {
|
|
421
421
|
key: 0,
|
|
422
422
|
class: "artifactuse-form-btn-icon",
|
|
423
|
-
innerHTML:
|
|
424
|
-
}, null, 8,
|
|
425
|
-
K(" " +
|
|
426
|
-
], 10,
|
|
423
|
+
innerHTML: r.icon
|
|
424
|
+
}, null, 8, va)) : d("", !0),
|
|
425
|
+
K(" " + n(r.label), 1)
|
|
426
|
+
], 10, da))), 128))
|
|
427
427
|
])) : (a(), s("form", {
|
|
428
428
|
key: 2,
|
|
429
429
|
class: "artifactuse-form",
|
|
430
|
-
onSubmit:
|
|
430
|
+
onSubmit: he(Y, ["prevent"])
|
|
431
431
|
}, [
|
|
432
|
-
e("div",
|
|
433
|
-
(a(!0), s(
|
|
434
|
-
key:
|
|
432
|
+
e("div", fa, [
|
|
433
|
+
(a(!0), s(R, null, ue(F.value, (r, E) => (a(), s(R, {
|
|
434
|
+
key: r.name || E
|
|
435
435
|
}, [
|
|
436
|
-
|
|
437
|
-
(a(!0), s(
|
|
436
|
+
r.type === "buttons" ? (a(), s("div", pa, [
|
|
437
|
+
(a(!0), s(R, null, ue(r.fields || [], (c) => (a(), s("button", {
|
|
438
438
|
key: c.name || c.label,
|
|
439
439
|
type: c.action === "submit" ? "submit" : "button",
|
|
440
|
-
class:
|
|
441
|
-
disabled: c.disabled || c.action === "submit" &&
|
|
442
|
-
onClick: (
|
|
440
|
+
class: N(["artifactuse-form-btn", `artifactuse-form-btn-${c.variant || "secondary"}`]),
|
|
441
|
+
disabled: c.disabled || c.action === "submit" && J.value,
|
|
442
|
+
onClick: (P) => c.action !== "submit" ? Q(c) : null
|
|
443
443
|
}, [
|
|
444
|
-
|
|
444
|
+
J.value && c.action === "submit" ? (a(), s("span", ha)) : c.icon ? (a(), s("span", {
|
|
445
445
|
key: 1,
|
|
446
446
|
class: "artifactuse-form-btn-icon",
|
|
447
447
|
innerHTML: c.icon
|
|
448
|
-
}, null, 8,
|
|
449
|
-
K(" " +
|
|
450
|
-
], 10,
|
|
451
|
-
])) :
|
|
452
|
-
e("label",
|
|
448
|
+
}, null, 8, ma)) : d("", !0),
|
|
449
|
+
K(" " + n(J.value && c.action === "submit" ? "Submitting..." : c.label), 1)
|
|
450
|
+
], 10, _a))), 128))
|
|
451
|
+
])) : r.type === "divider" ? (a(), s("div", ya)) : r.type === "heading" ? (a(), s("div", ga, n(r.label), 1)) : r.type === "checkbox" ? (a(), s("div", ka, [
|
|
452
|
+
e("label", wa, [
|
|
453
453
|
e("input", {
|
|
454
454
|
type: "checkbox",
|
|
455
|
-
checked:
|
|
456
|
-
disabled:
|
|
455
|
+
checked: q.value[r.name],
|
|
456
|
+
disabled: r.disabled,
|
|
457
457
|
class: "artifactuse-checkbox",
|
|
458
|
-
onChange: (c) => p(
|
|
459
|
-
}, null, 40,
|
|
460
|
-
e("span",
|
|
461
|
-
K(
|
|
462
|
-
|
|
458
|
+
onChange: (c) => p(r.name, c.target.checked)
|
|
459
|
+
}, null, 40, Ca),
|
|
460
|
+
e("span", ba, [
|
|
461
|
+
K(n(r.label) + " ", 1),
|
|
462
|
+
r.required ? (a(), s("span", xa, "*")) : d("", !0)
|
|
463
463
|
])
|
|
464
464
|
]),
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
])) : (a(), s("div",
|
|
465
|
+
r.helpText ? (a(), s("span", $a, n(r.helpText), 1)) : d("", !0),
|
|
466
|
+
O.value[r.name] ? (a(), s("span", Ma, n(O.value[r.name]), 1)) : d("", !0)
|
|
467
|
+
])) : (a(), s("div", La, [
|
|
468
468
|
e("label", {
|
|
469
|
-
for: `${
|
|
469
|
+
for: `${m.value}-${r.name}`,
|
|
470
470
|
class: "artifactuse-label"
|
|
471
471
|
}, [
|
|
472
|
-
K(
|
|
473
|
-
|
|
474
|
-
], 8,
|
|
475
|
-
|
|
472
|
+
K(n(r.label) + " ", 1),
|
|
473
|
+
r.required ? (a(), s("span", Aa, "*")) : d("", !0)
|
|
474
|
+
], 8, Ta),
|
|
475
|
+
oe(r.type) ? (a(), s("input", {
|
|
476
476
|
key: 0,
|
|
477
|
-
id: `${
|
|
478
|
-
type:
|
|
479
|
-
value:
|
|
480
|
-
placeholder:
|
|
481
|
-
disabled:
|
|
482
|
-
required:
|
|
477
|
+
id: `${m.value}-${r.name}`,
|
|
478
|
+
type: r.type,
|
|
479
|
+
value: q.value[r.name],
|
|
480
|
+
placeholder: r.placeholder,
|
|
481
|
+
disabled: r.disabled,
|
|
482
|
+
required: r.required,
|
|
483
483
|
class: "artifactuse-input",
|
|
484
|
-
onInput: (c) => p(
|
|
485
|
-
}, null, 40,
|
|
484
|
+
onInput: (c) => p(r.name, c.target.value)
|
|
485
|
+
}, null, 40, Ha)) : r.type === "textarea" ? (a(), s("textarea", {
|
|
486
486
|
key: 1,
|
|
487
|
-
id: `${
|
|
488
|
-
value:
|
|
489
|
-
placeholder:
|
|
490
|
-
disabled:
|
|
491
|
-
required:
|
|
492
|
-
rows:
|
|
487
|
+
id: `${m.value}-${r.name}`,
|
|
488
|
+
value: q.value[r.name],
|
|
489
|
+
placeholder: r.placeholder,
|
|
490
|
+
disabled: r.disabled,
|
|
491
|
+
required: r.required,
|
|
492
|
+
rows: r.rows || 3,
|
|
493
493
|
class: "artifactuse-textarea",
|
|
494
|
-
onInput: (c) => p(
|
|
495
|
-
}, null, 40,
|
|
494
|
+
onInput: (c) => p(r.name, c.target.value)
|
|
495
|
+
}, null, 40, Pa)) : r.type === "select" ? (a(), s("select", {
|
|
496
496
|
key: 2,
|
|
497
|
-
id: `${
|
|
498
|
-
value:
|
|
499
|
-
disabled:
|
|
500
|
-
required:
|
|
497
|
+
id: `${m.value}-${r.name}`,
|
|
498
|
+
value: q.value[r.name],
|
|
499
|
+
disabled: r.disabled,
|
|
500
|
+
required: r.required,
|
|
501
501
|
class: "artifactuse-select",
|
|
502
|
-
onChange: (c) => p(
|
|
502
|
+
onChange: (c) => p(r.name, c.target.value)
|
|
503
503
|
}, [
|
|
504
|
-
e("option",
|
|
505
|
-
(a(!0), s(
|
|
504
|
+
e("option", Ea, n(r.placeholder || "Select..."), 1),
|
|
505
|
+
(a(!0), s(R, null, ue(f(r.options), (c) => (a(), s("option", {
|
|
506
506
|
key: c.value,
|
|
507
507
|
value: c.value,
|
|
508
508
|
disabled: c.disabled
|
|
509
|
-
},
|
|
510
|
-
], 40,
|
|
511
|
-
(a(!0), s(
|
|
509
|
+
}, n(c.label), 9, Sa))), 128))
|
|
510
|
+
], 40, Ba)) : r.type === "radio" ? (a(), s("div", za, [
|
|
511
|
+
(a(!0), s(R, null, ue(f(r.options), (c) => (a(), s("label", {
|
|
512
512
|
key: c.value,
|
|
513
513
|
class: "artifactuse-radio-label"
|
|
514
514
|
}, [
|
|
515
515
|
e("input", {
|
|
516
516
|
type: "radio",
|
|
517
|
-
name:
|
|
517
|
+
name: r.name,
|
|
518
518
|
value: c.value,
|
|
519
|
-
checked:
|
|
520
|
-
disabled: c.disabled ||
|
|
519
|
+
checked: q.value[r.name] === c.value,
|
|
520
|
+
disabled: c.disabled || r.disabled,
|
|
521
521
|
class: "artifactuse-radio",
|
|
522
|
-
onChange: (
|
|
523
|
-
}, null, 40,
|
|
524
|
-
e("span", null,
|
|
522
|
+
onChange: (P) => p(r.name, c.value)
|
|
523
|
+
}, null, 40, Ia),
|
|
524
|
+
e("span", null, n(c.label), 1)
|
|
525
525
|
]))), 128))
|
|
526
|
-
])) :
|
|
527
|
-
|
|
528
|
-
|
|
526
|
+
])) : d("", !0),
|
|
527
|
+
r.helpText ? (a(), s("span", Fa, n(r.helpText), 1)) : d("", !0),
|
|
528
|
+
O.value[r.name] ? (a(), s("span", Va, n(O.value[r.name]), 1)) : d("", !0)
|
|
529
529
|
]))
|
|
530
530
|
], 64))), 128))
|
|
531
531
|
]),
|
|
532
|
-
|
|
532
|
+
I.value ? d("", !0) : (a(), s("div", Ra, [
|
|
533
533
|
e("button", {
|
|
534
534
|
type: "button",
|
|
535
535
|
class: "artifactuse-form-btn artifactuse-form-btn-ghost",
|
|
536
|
-
onClick: T[0] || (T[0] = (
|
|
536
|
+
onClick: T[0] || (T[0] = (r) => Q({ action: "cancel", label: "Cancel" }))
|
|
537
537
|
}, " Cancel "),
|
|
538
538
|
e("button", {
|
|
539
539
|
type: "submit",
|
|
540
540
|
class: "artifactuse-form-btn artifactuse-form-btn-primary",
|
|
541
|
-
disabled:
|
|
541
|
+
disabled: J.value
|
|
542
542
|
}, [
|
|
543
|
-
|
|
544
|
-
K(" " +
|
|
545
|
-
], 8,
|
|
543
|
+
J.value ? (a(), s("span", Oa)) : d("", !0),
|
|
544
|
+
K(" " + n(J.value ? "Submitting..." : "Submit"), 1)
|
|
545
|
+
], 8, qa)
|
|
546
546
|
]))
|
|
547
547
|
], 32))
|
|
548
548
|
], 64))
|
|
549
|
-
], 10,
|
|
549
|
+
], 10, ea));
|
|
550
550
|
}
|
|
551
|
-
},
|
|
551
|
+
}, Da = ["data-artifactuse-theme"], ja = { class: "artifactuse-social-header" }, Na = ["src", "alt"], Ja = { class: "artifactuse-social-author" }, Xa = { class: "artifactuse-social-author-name" }, Za = { class: "artifactuse-social-author-meta" }, Wa = { class: "artifactuse-social-author-handle" }, Ka = { class: "artifactuse-social-timestamp" }, Ya = { class: "artifactuse-social-content" }, Qa = ["innerHTML"], Ga = {
|
|
552
552
|
key: 0,
|
|
553
553
|
class: "artifactuse-social-media"
|
|
554
|
-
},
|
|
554
|
+
}, es = ["data-count"], ts = ["src", "alt"], as = {
|
|
555
555
|
key: 1,
|
|
556
556
|
class: "artifactuse-social-link-card"
|
|
557
|
-
},
|
|
557
|
+
}, ss = ["src", "alt"], is = { class: "artifactuse-social-link-info" }, ls = { class: "artifactuse-social-link-domain" }, ns = { class: "artifactuse-social-link-title" }, os = {
|
|
558
558
|
key: 0,
|
|
559
559
|
class: "artifactuse-social-link-description"
|
|
560
|
-
},
|
|
560
|
+
}, rs = {
|
|
561
561
|
key: 2,
|
|
562
562
|
class: "artifactuse-social-poll"
|
|
563
|
-
},
|
|
563
|
+
}, cs = { class: "artifactuse-social-poll-label" }, us = { class: "artifactuse-social-poll-label-percent" }, ds = { class: "artifactuse-social-poll-meta" }, vs = {
|
|
564
564
|
key: 3,
|
|
565
565
|
class: "artifactuse-social-quote"
|
|
566
|
-
},
|
|
566
|
+
}, fs = { class: "artifactuse-social-quote-header" }, ps = ["src"], _s = { class: "artifactuse-social-quote-author" }, hs = { class: "artifactuse-social-quote-handle" }, ms = { class: "artifactuse-social-quote-text" }, ys = {
|
|
567
567
|
key: 0,
|
|
568
568
|
class: "artifactuse-social-engagement"
|
|
569
|
-
},
|
|
569
|
+
}, gs = { class: "artifactuse-social-stat" }, ks = { class: "artifactuse-social-stat" }, ws = { class: "artifactuse-social-stat" }, Cs = { class: "artifactuse-social-stat" }, bs = { class: "artifactuse-social-header" }, xs = ["src", "alt"], $s = { class: "artifactuse-social-author-info" }, Ms = { class: "artifactuse-social-author-name" }, Ls = {
|
|
570
570
|
key: 0,
|
|
571
571
|
class: "artifactuse-social-author-connection"
|
|
572
|
-
},
|
|
572
|
+
}, Ts = { class: "artifactuse-social-author-headline" }, As = { class: "artifactuse-social-timestamp" }, Hs = { class: "artifactuse-social-content" }, Ps = ["innerHTML"], Bs = {
|
|
573
573
|
key: 0,
|
|
574
574
|
class: "artifactuse-social-link-card"
|
|
575
|
-
},
|
|
575
|
+
}, Es = ["src", "alt"], Ss = { class: "artifactuse-social-link-info" }, zs = { class: "artifactuse-social-link-title" }, Is = { class: "artifactuse-social-link-domain" }, Fs = {
|
|
576
576
|
key: 0,
|
|
577
577
|
class: "artifactuse-social-engagement"
|
|
578
|
-
},
|
|
578
|
+
}, Vs = { class: "artifactuse-social-reactions" }, Rs = { class: "artifactuse-social-header" }, qs = ["src", "alt"], Os = { class: "artifactuse-social-author-name" }, Us = {
|
|
579
579
|
key: 0,
|
|
580
580
|
class: "artifactuse-social-verified",
|
|
581
581
|
viewBox: "0 0 24 24",
|
|
582
582
|
fill: "currentColor"
|
|
583
|
-
},
|
|
583
|
+
}, Ds = {
|
|
584
584
|
key: 0,
|
|
585
585
|
class: "artifactuse-social-media"
|
|
586
|
-
},
|
|
586
|
+
}, js = ["src", "alt"], Ns = { class: "artifactuse-social-likes" }, Js = { class: "artifactuse-social-caption" }, Xs = { class: "artifactuse-social-caption-author" }, Zs = ["innerHTML"], Ws = { class: "artifactuse-social-timestamp" }, Ks = { class: "artifactuse-social-header" }, Ys = ["src", "alt"], Qs = { class: "artifactuse-social-author-info" }, Gs = { class: "artifactuse-social-author-name" }, ei = { class: "artifactuse-social-timestamp" }, ti = { class: "artifactuse-social-content" }, ai = ["innerHTML"], si = {
|
|
587
587
|
key: 0,
|
|
588
588
|
class: "artifactuse-social-link-card"
|
|
589
|
-
},
|
|
589
|
+
}, ii = ["src", "alt"], li = { class: "artifactuse-social-link-info" }, ni = { class: "artifactuse-social-link-domain" }, oi = { class: "artifactuse-social-link-title" }, ri = {
|
|
590
590
|
key: 0,
|
|
591
591
|
class: "artifactuse-social-link-description"
|
|
592
|
-
},
|
|
592
|
+
}, ci = {
|
|
593
593
|
key: 0,
|
|
594
594
|
class: "artifactuse-social-engagement"
|
|
595
|
-
},
|
|
595
|
+
}, ui = { class: "artifactuse-social-reactions" }, di = { class: "artifactuse-social-reaction-count" }, vi = { class: "artifactuse-social-comments-shares" }, fi = { class: "artifactuse-social-header" }, pi = ["src", "alt"], _i = { class: "artifactuse-social-author-info" }, hi = { class: "artifactuse-social-author-name" }, mi = {
|
|
596
596
|
key: 0,
|
|
597
597
|
class: "artifactuse-social-verified",
|
|
598
598
|
viewBox: "0 0 24 24",
|
|
599
599
|
fill: "currentColor"
|
|
600
|
-
},
|
|
600
|
+
}, yi = { class: "artifactuse-social-timestamp" }, gi = { class: "artifactuse-social-content" }, ki = ["innerHTML"], wi = {
|
|
601
601
|
key: 0,
|
|
602
602
|
class: "artifactuse-social-engagement"
|
|
603
|
-
},
|
|
603
|
+
}, Ci = { class: "artifactuse-social-stat" }, bi = { class: "artifactuse-social-stat" }, xi = { class: "artifactuse-social-stat" }, $i = { class: "artifactuse-social-thumbnail" }, Mi = ["src", "alt"], Li = {
|
|
604
604
|
key: 1,
|
|
605
605
|
class: "artifactuse-social-duration"
|
|
606
|
-
},
|
|
606
|
+
}, Ti = { class: "artifactuse-social-info" }, Ai = { class: "artifactuse-social-header" }, Hi = ["src", "alt"], Pi = { class: "artifactuse-social-author-name" }, Bi = ["innerHTML"], Ei = {
|
|
607
607
|
key: 0,
|
|
608
608
|
class: "artifactuse-social-sound"
|
|
609
|
-
},
|
|
609
|
+
}, Si = {
|
|
610
610
|
key: 1,
|
|
611
611
|
class: "artifactuse-social-engagement"
|
|
612
|
-
},
|
|
612
|
+
}, zi = { class: "artifactuse-social-thumbnail" }, Ii = ["src", "alt"], Fi = {
|
|
613
613
|
key: 1,
|
|
614
614
|
class: "artifactuse-social-duration"
|
|
615
|
-
},
|
|
615
|
+
}, Vi = { class: "artifactuse-social-info" }, Ri = ["src", "alt"], qi = { class: "artifactuse-social-title" }, Oi = { class: "artifactuse-social-channel" }, Ui = { class: "artifactuse-social-meta" }, Di = { class: "artifactuse-social-actions-bar" }, ji = { class: "artifactuse-social-platform-badge" }, _e = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23888"><circle cx="12" cy="8" r="4"/><path d="M12 14c-6 0-8 3-8 6v2h16v-2c0-3-2-6-8-6z"/></svg>', Ni = {
|
|
616
616
|
__name: "ArtifactuseSocialPreview",
|
|
617
617
|
props: {
|
|
618
618
|
artifact: {
|
|
@@ -625,37 +625,37 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
625
625
|
}
|
|
626
626
|
},
|
|
627
627
|
emits: ["copy", "edit"],
|
|
628
|
-
setup(H, { emit:
|
|
629
|
-
const
|
|
628
|
+
setup(H, { emit: u }) {
|
|
629
|
+
const h = H, k = u, l = M(null), U = M("Copy"), S = b(() => {
|
|
630
630
|
try {
|
|
631
|
-
return JSON.parse(
|
|
631
|
+
return JSON.parse(h.artifact.code);
|
|
632
632
|
} catch {
|
|
633
633
|
return { platform: "twitter", data: {} };
|
|
634
634
|
}
|
|
635
|
-
}), A =
|
|
636
|
-
var
|
|
637
|
-
return ((
|
|
635
|
+
}), A = b(() => {
|
|
636
|
+
var f;
|
|
637
|
+
return ((f = S.value) == null ? void 0 : f.platform) || "twitter";
|
|
638
638
|
});
|
|
639
|
-
|
|
640
|
-
var
|
|
641
|
-
return ((
|
|
639
|
+
b(() => {
|
|
640
|
+
var f;
|
|
641
|
+
return ((f = S.value) == null ? void 0 : f.variant) || "post";
|
|
642
642
|
});
|
|
643
|
-
const
|
|
644
|
-
var
|
|
645
|
-
return ((p = (
|
|
646
|
-
}),
|
|
647
|
-
var
|
|
648
|
-
return ((p = (
|
|
649
|
-
}),
|
|
650
|
-
var
|
|
651
|
-
return ((p = (
|
|
652
|
-
}), C =
|
|
653
|
-
var
|
|
654
|
-
return ((p = (
|
|
655
|
-
}), $ =
|
|
656
|
-
const
|
|
657
|
-
return
|
|
658
|
-
}),
|
|
643
|
+
const g = b(() => {
|
|
644
|
+
var f, p;
|
|
645
|
+
return ((p = (f = S.value) == null ? void 0 : f.data) == null ? void 0 : p.author) || {};
|
|
646
|
+
}), o = b(() => {
|
|
647
|
+
var f, p;
|
|
648
|
+
return ((p = (f = S.value) == null ? void 0 : f.data) == null ? void 0 : p.content) || {};
|
|
649
|
+
}), m = b(() => {
|
|
650
|
+
var f, p;
|
|
651
|
+
return ((p = (f = S.value) == null ? void 0 : f.data) == null ? void 0 : p.engagement) || {};
|
|
652
|
+
}), C = b(() => {
|
|
653
|
+
var f, p;
|
|
654
|
+
return ((p = (f = S.value) == null ? void 0 : f.data) == null ? void 0 : p.meta) || {};
|
|
655
|
+
}), $ = b(() => {
|
|
656
|
+
const f = m.value;
|
|
657
|
+
return f.likes || f.comments || f.shares || f.retweets || f.replies || f.views;
|
|
658
|
+
}), q = b(() => `artifactuse-social-verified-${g.value.verifiedType || "blue"}`), O = b(() => ({
|
|
659
659
|
twitter: "X",
|
|
660
660
|
linkedin: "LinkedIn",
|
|
661
661
|
instagram: "Instagram",
|
|
@@ -663,127 +663,127 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
663
663
|
threads: "Threads",
|
|
664
664
|
tiktok: "TikTok",
|
|
665
665
|
youtube: "YouTube"
|
|
666
|
-
})[A.value] || A.value),
|
|
667
|
-
const
|
|
668
|
-
twitter: () =>
|
|
669
|
-
|
|
666
|
+
})[A.value] || A.value), J = b(() => {
|
|
667
|
+
const f = {
|
|
668
|
+
twitter: () => le("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
669
|
+
le("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" })
|
|
670
670
|
]),
|
|
671
|
-
linkedin: () =>
|
|
672
|
-
|
|
671
|
+
linkedin: () => le("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
672
|
+
le("path", { d: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" })
|
|
673
673
|
]),
|
|
674
|
-
instagram: () =>
|
|
675
|
-
|
|
674
|
+
instagram: () => le("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
675
|
+
le("path", { d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z" })
|
|
676
676
|
]),
|
|
677
|
-
facebook: () =>
|
|
678
|
-
|
|
677
|
+
facebook: () => le("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
678
|
+
le("path", { d: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" })
|
|
679
679
|
]),
|
|
680
|
-
threads: () =>
|
|
681
|
-
|
|
680
|
+
threads: () => le("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
681
|
+
le("path", { d: "M12.186 24h-.007c-3.581-.024-6.334-1.205-8.184-3.509C2.35 18.44 1.5 15.586 1.472 12.01v-.017c.03-3.579.879-6.43 2.525-8.482C5.845 1.205 8.6.024 12.18 0h.014c2.746.02 5.043.725 6.826 2.098 1.677 1.29 2.858 3.13 3.509 5.467l-2.04.569c-1.104-3.96-3.898-5.984-8.304-6.015-2.91.022-5.11.936-6.54 2.717C4.307 6.504 3.616 8.914 3.59 12c.025 3.086.718 5.496 2.057 7.164 1.43 1.783 3.631 2.698 6.54 2.717 2.623-.02 4.358-.631 5.8-2.045 1.647-1.613 1.618-3.593 1.09-4.798-.31-.71-.873-1.3-1.634-1.75-.192 1.352-.622 2.446-1.284 3.272-.886 1.102-2.14 1.704-3.73 1.79-1.202.065-2.361-.218-3.259-.801-1.063-.689-1.685-1.74-1.752-2.96-.065-1.182.408-2.256 1.33-3.022.88-.73 2.108-1.152 3.457-1.187 1.357-.035 2.573.283 3.58.89.034-.497.04-1.017.015-1.558-.083-1.792-.648-3.095-1.68-3.876-.99-.75-2.453-1.123-4.35-1.108-.987.008-1.866.09-2.613.246l-.464-2.086c.912-.19 1.965-.29 3.133-.298 2.467-.02 4.42.554 5.807 1.706 1.46 1.213 2.24 3.007 2.354 5.411.039.827.026 1.69-.04 2.576.962.681 1.735 1.542 2.268 2.553.846 1.6 1.026 3.639.508 5.622-.57 2.181-1.782 3.94-3.503 5.079C17.194 23.394 14.88 24 12.186 24zM9.15 13.476c-.927.037-1.628.282-2.085.728-.418.408-.618.945-.578 1.553.04.638.347 1.165.866 1.483.586.36 1.39.521 2.266.45 1.053-.085 1.86-.473 2.4-1.153.457-.576.763-1.39.884-2.356-.893-.41-1.944-.636-3.095-.705h-.009c-.216-.008-.436-.008-.65 0z" })
|
|
682
682
|
]),
|
|
683
|
-
tiktok: () =>
|
|
684
|
-
|
|
683
|
+
tiktok: () => le("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
684
|
+
le("path", { d: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z" })
|
|
685
685
|
]),
|
|
686
|
-
youtube: () =>
|
|
687
|
-
|
|
686
|
+
youtube: () => le("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
687
|
+
le("path", { d: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" })
|
|
688
688
|
])
|
|
689
689
|
};
|
|
690
|
-
return
|
|
691
|
-
}),
|
|
692
|
-
let
|
|
693
|
-
return
|
|
690
|
+
return f[A.value] || f.twitter;
|
|
691
|
+
}), F = b(() => {
|
|
692
|
+
let f = o.value.text || "";
|
|
693
|
+
return f = f.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), f = f.replace(/#(\w+)/g, '<span class="artifactuse-social-hashtag">#$1</span>'), f = f.replace(/@(\w+)/g, '<span class="artifactuse-social-mention">@$1</span>'), f = f.replace(
|
|
694
694
|
/(https?:\/\/[^\s]+)/g,
|
|
695
695
|
'<a href="$1" target="_blank" rel="noopener">$1</a>'
|
|
696
|
-
),
|
|
697
|
-
}), ee =
|
|
698
|
-
const
|
|
699
|
-
return Object.values(
|
|
696
|
+
), f;
|
|
697
|
+
}), ee = b(() => {
|
|
698
|
+
const f = m.value.reactions || {};
|
|
699
|
+
return Object.values(f).reduce((p, ae) => p + (ae || 0), 0) || m.value.likes || 0;
|
|
700
700
|
});
|
|
701
|
-
function
|
|
702
|
-
return
|
|
701
|
+
function I(f) {
|
|
702
|
+
return f ? f >= 1e6 ? `${(f / 1e6).toFixed(1)}M` : f >= 1e3 ? `${(f / 1e3).toFixed(1)}K` : f.toString() : "0";
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function te(f) {
|
|
705
705
|
try {
|
|
706
|
-
return new URL(
|
|
706
|
+
return new URL(f).hostname.replace("www.", "");
|
|
707
707
|
} catch {
|
|
708
|
-
return
|
|
708
|
+
return f;
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
|
-
function
|
|
712
|
-
|
|
711
|
+
function X(f) {
|
|
712
|
+
f.target.src = _e;
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
|
|
714
|
+
function Z(f) {
|
|
715
|
+
f.target.style.display = "none";
|
|
716
716
|
}
|
|
717
|
-
function
|
|
718
|
-
const
|
|
719
|
-
navigator.clipboard.writeText(
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
}, 2e3),
|
|
717
|
+
function oe() {
|
|
718
|
+
const f = o.value.text || "";
|
|
719
|
+
navigator.clipboard.writeText(f).then(() => {
|
|
720
|
+
U.value = "Copied!", setTimeout(() => {
|
|
721
|
+
U.value = "Copy";
|
|
722
|
+
}, 2e3), k("copy", { platform: A.value, text: f });
|
|
723
723
|
});
|
|
724
724
|
}
|
|
725
|
-
return (
|
|
726
|
-
var
|
|
725
|
+
return (f, p) => {
|
|
726
|
+
var ae, L, Y, Q, _, T;
|
|
727
727
|
return a(), s("div", {
|
|
728
728
|
ref_key: "containerRef",
|
|
729
|
-
ref:
|
|
730
|
-
class:
|
|
729
|
+
ref: l,
|
|
730
|
+
class: N(["artifactuse-social", [`artifactuse-social-${A.value}`]]),
|
|
731
731
|
"data-artifactuse-theme": H.theme
|
|
732
732
|
}, [
|
|
733
|
-
A.value === "twitter" ? (a(), s(
|
|
734
|
-
e("div",
|
|
733
|
+
A.value === "twitter" ? (a(), s(R, { key: 0 }, [
|
|
734
|
+
e("div", ja, [
|
|
735
735
|
e("img", {
|
|
736
|
-
src:
|
|
737
|
-
alt:
|
|
736
|
+
src: g.value.avatar || _e,
|
|
737
|
+
alt: g.value.name,
|
|
738
738
|
class: "artifactuse-social-avatar",
|
|
739
|
-
onError:
|
|
740
|
-
}, null, 40,
|
|
741
|
-
e("div",
|
|
742
|
-
e("div",
|
|
743
|
-
e("span", null,
|
|
744
|
-
|
|
739
|
+
onError: X
|
|
740
|
+
}, null, 40, Na),
|
|
741
|
+
e("div", Ja, [
|
|
742
|
+
e("div", Xa, [
|
|
743
|
+
e("span", null, n(g.value.name), 1),
|
|
744
|
+
g.value.verified ? (a(), s("svg", {
|
|
745
745
|
key: 0,
|
|
746
|
-
class:
|
|
746
|
+
class: N(["artifactuse-social-verified", q.value]),
|
|
747
747
|
viewBox: "0 0 24 24",
|
|
748
748
|
fill: "currentColor"
|
|
749
749
|
}, [...p[0] || (p[0] = [
|
|
750
750
|
e("path", { d: "M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.34 2.19c-1.39-.46-2.9-.2-3.91.81s-1.27 2.52-.81 3.91C2.63 9.33 1.75 10.57 1.75 12s.88 2.67 2.19 3.34c-.46 1.39-.2 2.9.81 3.91s2.52 1.27 3.91.81c.66 1.31 1.91 2.19 3.34 2.19s2.67-.88 3.34-2.19c1.39.46 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z" }, null, -1)
|
|
751
|
-
])], 2)) :
|
|
751
|
+
])], 2)) : d("", !0)
|
|
752
752
|
]),
|
|
753
|
-
e("div",
|
|
754
|
-
e("span",
|
|
755
|
-
e("span",
|
|
753
|
+
e("div", Za, [
|
|
754
|
+
e("span", Wa, n(g.value.handle), 1),
|
|
755
|
+
e("span", Ka, "· " + n(C.value.timestamp || "Just now"), 1)
|
|
756
756
|
])
|
|
757
757
|
])
|
|
758
758
|
]),
|
|
759
|
-
e("div",
|
|
759
|
+
e("div", Ya, [
|
|
760
760
|
e("p", {
|
|
761
761
|
class: "artifactuse-social-text",
|
|
762
|
-
innerHTML:
|
|
763
|
-
}, null, 8,
|
|
764
|
-
(
|
|
762
|
+
innerHTML: F.value
|
|
763
|
+
}, null, 8, Qa),
|
|
764
|
+
(ae = o.value.media) != null && ae.length ? (a(), s("div", Ga, [
|
|
765
765
|
e("div", {
|
|
766
|
-
class:
|
|
767
|
-
"data-count":
|
|
766
|
+
class: N(["artifactuse-social-media-grid", { "artifactuse-social-media-single": o.value.media.length === 1 }]),
|
|
767
|
+
"data-count": o.value.media.length
|
|
768
768
|
}, [
|
|
769
|
-
(a(!0), s(
|
|
769
|
+
(a(!0), s(R, null, ue(o.value.media.slice(0, 4), (r, E) => (a(), s("img", {
|
|
770
770
|
key: E,
|
|
771
|
-
src:
|
|
772
|
-
alt:
|
|
773
|
-
onError:
|
|
774
|
-
}, null, 40,
|
|
775
|
-
], 10,
|
|
776
|
-
])) :
|
|
777
|
-
|
|
778
|
-
|
|
771
|
+
src: r.url,
|
|
772
|
+
alt: r.alt || "",
|
|
773
|
+
onError: Z
|
|
774
|
+
}, null, 40, ts))), 128))
|
|
775
|
+
], 10, es)
|
|
776
|
+
])) : d("", !0),
|
|
777
|
+
o.value.link && !((L = o.value.media) != null && L.length) ? (a(), s("div", as, [
|
|
778
|
+
o.value.link.image ? (a(), s("img", {
|
|
779
779
|
key: 0,
|
|
780
|
-
src:
|
|
781
|
-
alt:
|
|
780
|
+
src: o.value.link.image,
|
|
781
|
+
alt: o.value.link.title,
|
|
782
782
|
class: "artifactuse-social-link-image",
|
|
783
|
-
onError:
|
|
784
|
-
}, null, 40,
|
|
785
|
-
e("div",
|
|
786
|
-
e("div",
|
|
783
|
+
onError: Z
|
|
784
|
+
}, null, 40, ss)) : d("", !0),
|
|
785
|
+
e("div", is, [
|
|
786
|
+
e("div", ls, [
|
|
787
787
|
p[1] || (p[1] = e("svg", {
|
|
788
788
|
fill: "none",
|
|
789
789
|
viewBox: "0 0 24 24",
|
|
@@ -796,45 +796,45 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
796
796
|
d: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
|
|
797
797
|
})
|
|
798
798
|
], -1)),
|
|
799
|
-
K(" " +
|
|
799
|
+
K(" " + n(o.value.link.domain || te(o.value.link.url)), 1)
|
|
800
800
|
]),
|
|
801
|
-
e("div",
|
|
802
|
-
|
|
801
|
+
e("div", ns, n(o.value.link.title), 1),
|
|
802
|
+
o.value.link.description ? (a(), s("div", os, n(o.value.link.description), 1)) : d("", !0)
|
|
803
803
|
])
|
|
804
|
-
])) :
|
|
805
|
-
|
|
806
|
-
(a(!0), s(
|
|
807
|
-
var c,
|
|
804
|
+
])) : d("", !0),
|
|
805
|
+
o.value.poll ? (a(), s("div", rs, [
|
|
806
|
+
(a(!0), s(R, null, ue(o.value.poll.options, (r, E) => {
|
|
807
|
+
var c, P;
|
|
808
808
|
return a(), s("div", {
|
|
809
809
|
key: E,
|
|
810
810
|
class: "artifactuse-social-poll-option"
|
|
811
811
|
}, [
|
|
812
812
|
e("div", {
|
|
813
813
|
class: "artifactuse-social-poll-bar",
|
|
814
|
-
style:
|
|
814
|
+
style: $e({ width: `${((c = o.value.poll.votes) == null ? void 0 : c[E]) || 0}%` })
|
|
815
815
|
}, null, 4),
|
|
816
|
-
e("div",
|
|
817
|
-
e("span", null,
|
|
818
|
-
e("span",
|
|
816
|
+
e("div", cs, [
|
|
817
|
+
e("span", null, n(r), 1),
|
|
818
|
+
e("span", us, n(((P = o.value.poll.votes) == null ? void 0 : P[E]) || 0) + "%", 1)
|
|
819
819
|
])
|
|
820
820
|
]);
|
|
821
821
|
}), 128)),
|
|
822
|
-
e("div",
|
|
823
|
-
])) :
|
|
824
|
-
|
|
825
|
-
e("div",
|
|
822
|
+
e("div", ds, n(I(o.value.poll.totalVotes || 0)) + " votes · " + n(o.value.poll.duration || "Poll ended"), 1)
|
|
823
|
+
])) : d("", !0),
|
|
824
|
+
o.value.quote ? (a(), s("div", vs, [
|
|
825
|
+
e("div", fs, [
|
|
826
826
|
e("img", {
|
|
827
|
-
src: ((
|
|
827
|
+
src: ((Y = o.value.quote.author) == null ? void 0 : Y.avatar) || _e,
|
|
828
828
|
class: "artifactuse-social-quote-avatar"
|
|
829
|
-
}, null, 8,
|
|
830
|
-
e("span",
|
|
831
|
-
e("span",
|
|
829
|
+
}, null, 8, ps),
|
|
830
|
+
e("span", _s, n((Q = o.value.quote.author) == null ? void 0 : Q.name), 1),
|
|
831
|
+
e("span", hs, n((_ = o.value.quote.author) == null ? void 0 : _.handle), 1)
|
|
832
832
|
]),
|
|
833
|
-
e("p",
|
|
834
|
-
])) :
|
|
833
|
+
e("p", ms, n(o.value.quote.text), 1)
|
|
834
|
+
])) : d("", !0)
|
|
835
835
|
]),
|
|
836
|
-
$.value ? (a(), s("div",
|
|
837
|
-
e("div",
|
|
836
|
+
$.value ? (a(), s("div", ys, [
|
|
837
|
+
e("div", gs, [
|
|
838
838
|
p[2] || (p[2] = e("svg", {
|
|
839
839
|
viewBox: "0 0 24 24",
|
|
840
840
|
fill: "none",
|
|
@@ -843,9 +843,9 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
843
843
|
}, [
|
|
844
844
|
e("path", { d: "M12 21C6.5 21 2 16.5 2 11V3l7 3 3-3 3 3 7-3v8c0 5.5-4.5 10-10 10z" })
|
|
845
845
|
], -1)),
|
|
846
|
-
e("span", null,
|
|
846
|
+
e("span", null, n(I(m.value.replies || 0)), 1)
|
|
847
847
|
]),
|
|
848
|
-
e("div",
|
|
848
|
+
e("div", ks, [
|
|
849
849
|
p[3] || (p[3] = e("svg", {
|
|
850
850
|
viewBox: "0 0 24 24",
|
|
851
851
|
fill: "none",
|
|
@@ -854,9 +854,9 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
854
854
|
}, [
|
|
855
855
|
e("path", { d: "M7 17L17 7M17 7H8M17 7V16" })
|
|
856
856
|
], -1)),
|
|
857
|
-
e("span", null,
|
|
857
|
+
e("span", null, n(I(m.value.retweets || 0)), 1)
|
|
858
858
|
]),
|
|
859
|
-
e("div",
|
|
859
|
+
e("div", ws, [
|
|
860
860
|
p[4] || (p[4] = e("svg", {
|
|
861
861
|
viewBox: "0 0 24 24",
|
|
862
862
|
fill: "none",
|
|
@@ -865,9 +865,9 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
865
865
|
}, [
|
|
866
866
|
e("path", { d: "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" })
|
|
867
867
|
], -1)),
|
|
868
|
-
e("span", null,
|
|
868
|
+
e("span", null, n(I(m.value.likes || 0)), 1)
|
|
869
869
|
]),
|
|
870
|
-
e("div",
|
|
870
|
+
e("div", Cs, [
|
|
871
871
|
p[5] || (p[5] = e("svg", {
|
|
872
872
|
viewBox: "0 0 24 24",
|
|
873
873
|
fill: "none",
|
|
@@ -876,25 +876,25 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
876
876
|
}, [
|
|
877
877
|
e("path", { d: "M15 3h4a2 2 0 012 2v14a2 2 0 01-2 2h-4M10 17l5-5-5-5M13.8 12H3" })
|
|
878
878
|
], -1)),
|
|
879
|
-
e("span", null,
|
|
879
|
+
e("span", null, n(I(m.value.views || 0)), 1)
|
|
880
880
|
])
|
|
881
|
-
])) :
|
|
882
|
-
], 64)) : A.value === "linkedin" ? (a(), s(
|
|
883
|
-
e("div",
|
|
881
|
+
])) : d("", !0)
|
|
882
|
+
], 64)) : A.value === "linkedin" ? (a(), s(R, { key: 1 }, [
|
|
883
|
+
e("div", bs, [
|
|
884
884
|
e("img", {
|
|
885
|
-
src:
|
|
886
|
-
alt:
|
|
885
|
+
src: g.value.avatar || _e,
|
|
886
|
+
alt: g.value.name,
|
|
887
887
|
class: "artifactuse-social-avatar",
|
|
888
|
-
onError:
|
|
889
|
-
}, null, 40,
|
|
890
|
-
e("div",
|
|
891
|
-
e("div",
|
|
892
|
-
K(
|
|
893
|
-
|
|
888
|
+
onError: X
|
|
889
|
+
}, null, 40, xs),
|
|
890
|
+
e("div", $s, [
|
|
891
|
+
e("div", Ms, [
|
|
892
|
+
K(n(g.value.name) + " ", 1),
|
|
893
|
+
g.value.connection ? (a(), s("span", Ls, "· " + n(g.value.connection), 1)) : d("", !0)
|
|
894
894
|
]),
|
|
895
|
-
e("div",
|
|
896
|
-
e("div",
|
|
897
|
-
K(
|
|
895
|
+
e("div", Ts, n(g.value.headline), 1),
|
|
896
|
+
e("div", As, [
|
|
897
|
+
K(n(C.value.timestamp || "Just now") + " · ", 1),
|
|
898
898
|
p[6] || (p[6] = e("svg", {
|
|
899
899
|
viewBox: "0 0 24 24",
|
|
900
900
|
fill: "currentColor"
|
|
@@ -904,80 +904,80 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
904
904
|
])
|
|
905
905
|
])
|
|
906
906
|
]),
|
|
907
|
-
e("div",
|
|
907
|
+
e("div", Hs, [
|
|
908
908
|
e("p", {
|
|
909
909
|
class: "artifactuse-social-text",
|
|
910
|
-
innerHTML:
|
|
911
|
-
}, null, 8,
|
|
912
|
-
|
|
913
|
-
|
|
910
|
+
innerHTML: F.value
|
|
911
|
+
}, null, 8, Ps),
|
|
912
|
+
o.value.link ? (a(), s("div", Bs, [
|
|
913
|
+
o.value.link.image ? (a(), s("img", {
|
|
914
914
|
key: 0,
|
|
915
|
-
src:
|
|
916
|
-
alt:
|
|
915
|
+
src: o.value.link.image,
|
|
916
|
+
alt: o.value.link.title,
|
|
917
917
|
class: "artifactuse-social-link-image",
|
|
918
|
-
onError:
|
|
919
|
-
}, null, 40,
|
|
920
|
-
e("div",
|
|
921
|
-
e("div",
|
|
922
|
-
e("div",
|
|
918
|
+
onError: Z
|
|
919
|
+
}, null, 40, Es)) : d("", !0),
|
|
920
|
+
e("div", Ss, [
|
|
921
|
+
e("div", zs, n(o.value.link.title), 1),
|
|
922
|
+
e("div", Is, n(o.value.link.domain || te(o.value.link.url)), 1)
|
|
923
923
|
])
|
|
924
|
-
])) :
|
|
924
|
+
])) : d("", !0)
|
|
925
925
|
]),
|
|
926
|
-
$.value ? (a(), s("div",
|
|
927
|
-
e("div",
|
|
926
|
+
$.value ? (a(), s("div", Fs, [
|
|
927
|
+
e("div", Vs, [
|
|
928
928
|
p[7] || (p[7] = e("div", { class: "artifactuse-social-reaction-icons" }, [
|
|
929
929
|
e("span", { class: "artifactuse-social-reaction-icon" }, "👍"),
|
|
930
930
|
e("span", { class: "artifactuse-social-reaction-icon" }, "❤️"),
|
|
931
931
|
e("span", { class: "artifactuse-social-reaction-icon" }, "👏")
|
|
932
932
|
], -1)),
|
|
933
|
-
e("span", null,
|
|
933
|
+
e("span", null, n(I(m.value.likes || 0)), 1)
|
|
934
934
|
]),
|
|
935
|
-
e("span", null,
|
|
936
|
-
])) :
|
|
937
|
-
], 64)) : A.value === "instagram" ? (a(), s(
|
|
938
|
-
e("div",
|
|
935
|
+
e("span", null, n(I(m.value.comments || 0)) + " comments · " + n(I(m.value.shares || 0)) + " shares", 1)
|
|
936
|
+
])) : d("", !0)
|
|
937
|
+
], 64)) : A.value === "instagram" ? (a(), s(R, { key: 2 }, [
|
|
938
|
+
e("div", Rs, [
|
|
939
939
|
e("img", {
|
|
940
|
-
src:
|
|
941
|
-
alt:
|
|
940
|
+
src: g.value.avatar || _e,
|
|
941
|
+
alt: g.value.name,
|
|
942
942
|
class: "artifactuse-social-avatar",
|
|
943
|
-
onError:
|
|
944
|
-
}, null, 40,
|
|
945
|
-
e("div",
|
|
946
|
-
K(
|
|
947
|
-
|
|
943
|
+
onError: X
|
|
944
|
+
}, null, 40, qs),
|
|
945
|
+
e("div", Os, [
|
|
946
|
+
K(n(g.value.name) + " ", 1),
|
|
947
|
+
g.value.verified ? (a(), s("svg", Us, [...p[8] || (p[8] = [
|
|
948
948
|
e("path", { d: "M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.34 2.19c-1.39-.46-2.9-.2-3.91.81s-1.27 2.52-.81 3.91C2.63 9.33 1.75 10.57 1.75 12s.88 2.67 2.19 3.34c-.46 1.39-.2 2.9.81 3.91s2.52 1.27 3.91.81c.66 1.31 1.91 2.19 3.34 2.19s2.67-.88 3.34-2.19c1.39.46 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z" }, null, -1)
|
|
949
|
-
])])) :
|
|
949
|
+
])])) : d("", !0)
|
|
950
950
|
])
|
|
951
951
|
]),
|
|
952
|
-
(T =
|
|
952
|
+
(T = o.value.media) != null && T.length ? (a(), s("div", Ds, [
|
|
953
953
|
e("img", {
|
|
954
|
-
src:
|
|
955
|
-
alt:
|
|
956
|
-
onError:
|
|
957
|
-
}, null, 40,
|
|
958
|
-
])) :
|
|
959
|
-
p[9] || (p[9] =
|
|
960
|
-
e("div",
|
|
961
|
-
e("div",
|
|
962
|
-
e("span",
|
|
954
|
+
src: o.value.media[0].url,
|
|
955
|
+
alt: o.value.media[0].alt || "",
|
|
956
|
+
onError: Z
|
|
957
|
+
}, null, 40, js)
|
|
958
|
+
])) : d("", !0),
|
|
959
|
+
p[9] || (p[9] = Pt('<div class="artifactuse-social-actions"><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"></path></svg></div><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z"></path></svg></div><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"></path></svg></div></div>', 1)),
|
|
960
|
+
e("div", Ns, n(I(m.value.likes || 0)) + " likes", 1),
|
|
961
|
+
e("div", Js, [
|
|
962
|
+
e("span", Xs, n(g.value.name), 1),
|
|
963
963
|
e("span", {
|
|
964
964
|
class: "artifactuse-social-caption-text",
|
|
965
|
-
innerHTML:
|
|
966
|
-
}, null, 8,
|
|
965
|
+
innerHTML: F.value
|
|
966
|
+
}, null, 8, Zs)
|
|
967
967
|
]),
|
|
968
|
-
e("div",
|
|
969
|
-
], 64)) : A.value === "facebook" ? (a(), s(
|
|
970
|
-
e("div",
|
|
968
|
+
e("div", Ws, n(C.value.timestamp || "Just now"), 1)
|
|
969
|
+
], 64)) : A.value === "facebook" ? (a(), s(R, { key: 3 }, [
|
|
970
|
+
e("div", Ks, [
|
|
971
971
|
e("img", {
|
|
972
|
-
src:
|
|
973
|
-
alt:
|
|
972
|
+
src: g.value.avatar || _e,
|
|
973
|
+
alt: g.value.name,
|
|
974
974
|
class: "artifactuse-social-avatar",
|
|
975
|
-
onError:
|
|
976
|
-
}, null, 40,
|
|
977
|
-
e("div",
|
|
978
|
-
e("div",
|
|
979
|
-
e("div",
|
|
980
|
-
K(
|
|
975
|
+
onError: X
|
|
976
|
+
}, null, 40, Ys),
|
|
977
|
+
e("div", Qs, [
|
|
978
|
+
e("div", Gs, n(g.value.name), 1),
|
|
979
|
+
e("div", ei, [
|
|
980
|
+
K(n(C.value.timestamp || "Just now") + " · ", 1),
|
|
981
981
|
p[10] || (p[10] = e("svg", {
|
|
982
982
|
viewBox: "0 0 24 24",
|
|
983
983
|
fill: "currentColor"
|
|
@@ -987,63 +987,63 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
987
987
|
])
|
|
988
988
|
])
|
|
989
989
|
]),
|
|
990
|
-
e("div",
|
|
990
|
+
e("div", ti, [
|
|
991
991
|
e("p", {
|
|
992
992
|
class: "artifactuse-social-text",
|
|
993
|
-
innerHTML:
|
|
994
|
-
}, null, 8,
|
|
995
|
-
|
|
996
|
-
|
|
993
|
+
innerHTML: F.value
|
|
994
|
+
}, null, 8, ai),
|
|
995
|
+
o.value.link ? (a(), s("div", si, [
|
|
996
|
+
o.value.link.image ? (a(), s("img", {
|
|
997
997
|
key: 0,
|
|
998
|
-
src:
|
|
999
|
-
alt:
|
|
998
|
+
src: o.value.link.image,
|
|
999
|
+
alt: o.value.link.title,
|
|
1000
1000
|
class: "artifactuse-social-link-image",
|
|
1001
|
-
onError:
|
|
1002
|
-
}, null, 40,
|
|
1003
|
-
e("div",
|
|
1004
|
-
e("div",
|
|
1005
|
-
e("div",
|
|
1006
|
-
|
|
1001
|
+
onError: Z
|
|
1002
|
+
}, null, 40, ii)) : d("", !0),
|
|
1003
|
+
e("div", li, [
|
|
1004
|
+
e("div", ni, n(o.value.link.domain || te(o.value.link.url)), 1),
|
|
1005
|
+
e("div", oi, n(o.value.link.title), 1),
|
|
1006
|
+
o.value.link.description ? (a(), s("div", ri, n(o.value.link.description), 1)) : d("", !0)
|
|
1007
1007
|
])
|
|
1008
|
-
])) :
|
|
1008
|
+
])) : d("", !0)
|
|
1009
1009
|
]),
|
|
1010
|
-
$.value ? (a(), s("div",
|
|
1011
|
-
e("div",
|
|
1010
|
+
$.value ? (a(), s("div", ci, [
|
|
1011
|
+
e("div", ui, [
|
|
1012
1012
|
p[11] || (p[11] = e("div", { class: "artifactuse-social-reaction-emojis" }, [
|
|
1013
1013
|
e("span", { class: "artifactuse-social-reaction-emoji" }, "👍"),
|
|
1014
1014
|
e("span", { class: "artifactuse-social-reaction-emoji" }, "❤️"),
|
|
1015
1015
|
e("span", { class: "artifactuse-social-reaction-emoji" }, "😂")
|
|
1016
1016
|
], -1)),
|
|
1017
|
-
e("span",
|
|
1017
|
+
e("span", di, n(I(ee.value)), 1)
|
|
1018
1018
|
]),
|
|
1019
|
-
e("span",
|
|
1020
|
-
])) :
|
|
1021
|
-
], 64)) : A.value === "threads" ? (a(), s(
|
|
1022
|
-
e("div",
|
|
1019
|
+
e("span", vi, n(I(m.value.comments || 0)) + " comments · " + n(I(m.value.shares || 0)) + " shares", 1)
|
|
1020
|
+
])) : d("", !0)
|
|
1021
|
+
], 64)) : A.value === "threads" ? (a(), s(R, { key: 4 }, [
|
|
1022
|
+
e("div", fi, [
|
|
1023
1023
|
e("img", {
|
|
1024
|
-
src:
|
|
1025
|
-
alt:
|
|
1024
|
+
src: g.value.avatar || _e,
|
|
1025
|
+
alt: g.value.name,
|
|
1026
1026
|
class: "artifactuse-social-avatar",
|
|
1027
|
-
onError:
|
|
1028
|
-
}, null, 40,
|
|
1029
|
-
e("div",
|
|
1030
|
-
e("div",
|
|
1031
|
-
K(
|
|
1032
|
-
|
|
1027
|
+
onError: X
|
|
1028
|
+
}, null, 40, pi),
|
|
1029
|
+
e("div", _i, [
|
|
1030
|
+
e("div", hi, [
|
|
1031
|
+
K(n(g.value.name) + " ", 1),
|
|
1032
|
+
g.value.verified ? (a(), s("svg", mi, [...p[12] || (p[12] = [
|
|
1033
1033
|
e("path", { d: "M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.34 2.19c-1.39-.46-2.9-.2-3.91.81s-1.27 2.52-.81 3.91C2.63 9.33 1.75 10.57 1.75 12s.88 2.67 2.19 3.34c-.46 1.39-.2 2.9.81 3.91s2.52 1.27 3.91.81c.66 1.31 1.91 2.19 3.34 2.19s2.67-.88 3.34-2.19c1.39.46 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z" }, null, -1)
|
|
1034
|
-
])])) :
|
|
1034
|
+
])])) : d("", !0)
|
|
1035
1035
|
]),
|
|
1036
|
-
e("span",
|
|
1036
|
+
e("span", yi, n(C.value.timestamp || "Just now"), 1)
|
|
1037
1037
|
])
|
|
1038
1038
|
]),
|
|
1039
|
-
e("div",
|
|
1039
|
+
e("div", gi, [
|
|
1040
1040
|
e("p", {
|
|
1041
1041
|
class: "artifactuse-social-text",
|
|
1042
|
-
innerHTML:
|
|
1043
|
-
}, null, 8,
|
|
1042
|
+
innerHTML: F.value
|
|
1043
|
+
}, null, 8, ki)
|
|
1044
1044
|
]),
|
|
1045
|
-
$.value ? (a(), s("div",
|
|
1046
|
-
e("div",
|
|
1045
|
+
$.value ? (a(), s("div", wi, [
|
|
1046
|
+
e("div", Ci, [
|
|
1047
1047
|
p[13] || (p[13] = e("svg", {
|
|
1048
1048
|
viewBox: "0 0 24 24",
|
|
1049
1049
|
fill: "none",
|
|
@@ -1052,9 +1052,9 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
1052
1052
|
}, [
|
|
1053
1053
|
e("path", { d: "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" })
|
|
1054
1054
|
], -1)),
|
|
1055
|
-
e("span", null,
|
|
1055
|
+
e("span", null, n(I(m.value.likes || 0)), 1)
|
|
1056
1056
|
]),
|
|
1057
|
-
e("div",
|
|
1057
|
+
e("div", bi, [
|
|
1058
1058
|
p[14] || (p[14] = e("svg", {
|
|
1059
1059
|
viewBox: "0 0 24 24",
|
|
1060
1060
|
fill: "none",
|
|
@@ -1063,9 +1063,9 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
1063
1063
|
}, [
|
|
1064
1064
|
e("path", { d: "M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z" })
|
|
1065
1065
|
], -1)),
|
|
1066
|
-
e("span", null,
|
|
1066
|
+
e("span", null, n(I(m.value.comments || 0)), 1)
|
|
1067
1067
|
]),
|
|
1068
|
-
e("div",
|
|
1068
|
+
e("div", xi, [
|
|
1069
1069
|
p[15] || (p[15] = e("svg", {
|
|
1070
1070
|
viewBox: "0 0 24 24",
|
|
1071
1071
|
fill: "none",
|
|
@@ -1074,17 +1074,17 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
1074
1074
|
}, [
|
|
1075
1075
|
e("path", { d: "M7 17L17 7M17 7H8M17 7V16" })
|
|
1076
1076
|
], -1)),
|
|
1077
|
-
e("span", null,
|
|
1077
|
+
e("span", null, n(I(m.value.shares || 0)), 1)
|
|
1078
1078
|
])
|
|
1079
|
-
])) :
|
|
1080
|
-
], 64)) : A.value === "tiktok" ? (a(), s(
|
|
1081
|
-
e("div",
|
|
1082
|
-
|
|
1079
|
+
])) : d("", !0)
|
|
1080
|
+
], 64)) : A.value === "tiktok" ? (a(), s(R, { key: 5 }, [
|
|
1081
|
+
e("div", $i, [
|
|
1082
|
+
o.value.thumbnail ? (a(), s("img", {
|
|
1083
1083
|
key: 0,
|
|
1084
|
-
src:
|
|
1085
|
-
alt:
|
|
1086
|
-
onError:
|
|
1087
|
-
}, null, 40,
|
|
1084
|
+
src: o.value.thumbnail,
|
|
1085
|
+
alt: o.value.text,
|
|
1086
|
+
onError: Z
|
|
1087
|
+
}, null, 40, Mi)) : d("", !0),
|
|
1088
1088
|
p[16] || (p[16] = e("div", { class: "artifactuse-social-play-button" }, [
|
|
1089
1089
|
e("div", { class: "artifactuse-social-play-icon" }, [
|
|
1090
1090
|
e("svg", {
|
|
@@ -1095,69 +1095,69 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
1095
1095
|
])
|
|
1096
1096
|
])
|
|
1097
1097
|
], -1)),
|
|
1098
|
-
|
|
1098
|
+
o.value.duration ? (a(), s("div", Li, n(o.value.duration), 1)) : d("", !0)
|
|
1099
1099
|
]),
|
|
1100
|
-
e("div",
|
|
1101
|
-
e("div",
|
|
1100
|
+
e("div", Ti, [
|
|
1101
|
+
e("div", Ai, [
|
|
1102
1102
|
e("img", {
|
|
1103
|
-
src:
|
|
1104
|
-
alt:
|
|
1103
|
+
src: g.value.avatar || _e,
|
|
1104
|
+
alt: g.value.name,
|
|
1105
1105
|
class: "artifactuse-social-avatar",
|
|
1106
|
-
onError:
|
|
1107
|
-
}, null, 40,
|
|
1108
|
-
e("span",
|
|
1106
|
+
onError: X
|
|
1107
|
+
}, null, 40, Hi),
|
|
1108
|
+
e("span", Pi, n(g.value.name), 1)
|
|
1109
1109
|
]),
|
|
1110
1110
|
e("p", {
|
|
1111
1111
|
class: "artifactuse-social-text",
|
|
1112
|
-
innerHTML:
|
|
1113
|
-
}, null, 8,
|
|
1114
|
-
|
|
1112
|
+
innerHTML: F.value
|
|
1113
|
+
}, null, 8, Bi),
|
|
1114
|
+
o.value.sound ? (a(), s("div", Ei, [
|
|
1115
1115
|
p[17] || (p[17] = e("svg", {
|
|
1116
1116
|
viewBox: "0 0 24 24",
|
|
1117
1117
|
fill: "currentColor"
|
|
1118
1118
|
}, [
|
|
1119
1119
|
e("path", { d: "M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z" })
|
|
1120
1120
|
], -1)),
|
|
1121
|
-
K(" " +
|
|
1122
|
-
])) :
|
|
1123
|
-
$.value ? (a(), s("div",
|
|
1124
|
-
e("span", null,
|
|
1125
|
-
e("span", null,
|
|
1126
|
-
e("span", null,
|
|
1127
|
-
])) :
|
|
1121
|
+
K(" " + n(o.value.sound), 1)
|
|
1122
|
+
])) : d("", !0),
|
|
1123
|
+
$.value ? (a(), s("div", Si, [
|
|
1124
|
+
e("span", null, n(I(m.value.likes || 0)) + " likes", 1),
|
|
1125
|
+
e("span", null, n(I(m.value.comments || 0)) + " comments", 1),
|
|
1126
|
+
e("span", null, n(I(m.value.shares || 0)) + " shares", 1)
|
|
1127
|
+
])) : d("", !0)
|
|
1128
1128
|
])
|
|
1129
|
-
], 64)) : A.value === "youtube" ? (a(), s(
|
|
1130
|
-
e("div",
|
|
1131
|
-
|
|
1129
|
+
], 64)) : A.value === "youtube" ? (a(), s(R, { key: 6 }, [
|
|
1130
|
+
e("div", zi, [
|
|
1131
|
+
o.value.thumbnail ? (a(), s("img", {
|
|
1132
1132
|
key: 0,
|
|
1133
|
-
src:
|
|
1134
|
-
alt:
|
|
1135
|
-
onError:
|
|
1136
|
-
}, null, 40,
|
|
1137
|
-
|
|
1133
|
+
src: o.value.thumbnail,
|
|
1134
|
+
alt: o.value.title,
|
|
1135
|
+
onError: Z
|
|
1136
|
+
}, null, 40, Ii)) : d("", !0),
|
|
1137
|
+
o.value.duration ? (a(), s("div", Fi, n(o.value.duration), 1)) : d("", !0)
|
|
1138
1138
|
]),
|
|
1139
|
-
e("div",
|
|
1139
|
+
e("div", Vi, [
|
|
1140
1140
|
e("img", {
|
|
1141
|
-
src:
|
|
1142
|
-
alt:
|
|
1141
|
+
src: g.value.avatar || _e,
|
|
1142
|
+
alt: g.value.name,
|
|
1143
1143
|
class: "artifactuse-social-avatar",
|
|
1144
|
-
onError:
|
|
1145
|
-
}, null, 40,
|
|
1144
|
+
onError: X
|
|
1145
|
+
}, null, 40, Ri),
|
|
1146
1146
|
e("div", null, [
|
|
1147
|
-
e("div",
|
|
1148
|
-
e("div",
|
|
1149
|
-
e("div",
|
|
1147
|
+
e("div", qi, n(o.value.title || o.value.text), 1),
|
|
1148
|
+
e("div", Oi, n(g.value.name), 1),
|
|
1149
|
+
e("div", Ui, n(I(m.value.views || 0)) + " views · " + n(C.value.timestamp || "Just now"), 1)
|
|
1150
1150
|
])
|
|
1151
1151
|
])
|
|
1152
|
-
], 64)) :
|
|
1153
|
-
e("div",
|
|
1154
|
-
e("div",
|
|
1155
|
-
(a(), ke(
|
|
1156
|
-
e("span", null,
|
|
1152
|
+
], 64)) : d("", !0),
|
|
1153
|
+
e("div", Di, [
|
|
1154
|
+
e("div", ji, [
|
|
1155
|
+
(a(), ke(Bt(J.value))),
|
|
1156
|
+
e("span", null, n(O.value), 1)
|
|
1157
1157
|
]),
|
|
1158
1158
|
e("button", {
|
|
1159
1159
|
class: "artifactuse-social-copy-btn",
|
|
1160
|
-
onClick:
|
|
1160
|
+
onClick: oe
|
|
1161
1161
|
}, [
|
|
1162
1162
|
p[18] || (p[18] = e("svg", {
|
|
1163
1163
|
viewBox: "0 0 24 24",
|
|
@@ -1175,31 +1175,31 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
1175
1175
|
}),
|
|
1176
1176
|
e("path", { d: "M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" })
|
|
1177
1177
|
], -1)),
|
|
1178
|
-
K(" " +
|
|
1178
|
+
K(" " + n(U.value), 1)
|
|
1179
1179
|
])
|
|
1180
1180
|
])
|
|
1181
|
-
], 10,
|
|
1181
|
+
], 10, Da);
|
|
1182
1182
|
};
|
|
1183
1183
|
}
|
|
1184
|
-
},
|
|
1184
|
+
}, Ji = ["src", "alt"], Xi = ["src"], Zi = {
|
|
1185
1185
|
key: 2,
|
|
1186
1186
|
class: "artifactuse-viewer-controls"
|
|
1187
|
-
},
|
|
1187
|
+
}, Wi = ["title"], Ki = {
|
|
1188
1188
|
key: 0,
|
|
1189
1189
|
viewBox: "0 0 24 24",
|
|
1190
1190
|
fill: "none",
|
|
1191
1191
|
stroke: "currentColor",
|
|
1192
1192
|
"stroke-width": "2"
|
|
1193
|
-
},
|
|
1193
|
+
}, Yi = {
|
|
1194
1194
|
key: 1,
|
|
1195
1195
|
viewBox: "0 0 24 24",
|
|
1196
1196
|
fill: "none",
|
|
1197
1197
|
stroke: "currentColor",
|
|
1198
1198
|
"stroke-width": "2"
|
|
1199
|
-
},
|
|
1199
|
+
}, Qi = {
|
|
1200
1200
|
key: 3,
|
|
1201
1201
|
class: "artifactuse-viewer-caption"
|
|
1202
|
-
},
|
|
1202
|
+
}, Gi = {
|
|
1203
1203
|
__name: "ArtifactuseViewer",
|
|
1204
1204
|
props: {
|
|
1205
1205
|
// Whether the viewer is open
|
|
@@ -1229,61 +1229,61 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
1229
1229
|
}
|
|
1230
1230
|
},
|
|
1231
1231
|
emits: ["close"],
|
|
1232
|
-
setup(H, { emit:
|
|
1233
|
-
const
|
|
1234
|
-
function
|
|
1235
|
-
|
|
1232
|
+
setup(H, { emit: u }) {
|
|
1233
|
+
const h = H, k = u, l = M(null), U = M(!1);
|
|
1234
|
+
function S() {
|
|
1235
|
+
U.value = !1, k("close");
|
|
1236
1236
|
}
|
|
1237
1237
|
function A() {
|
|
1238
|
-
|
|
1238
|
+
h.type === "image" && (U.value = !U.value);
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1240
|
+
function g() {
|
|
1241
|
+
const m = document.createElement("a");
|
|
1242
|
+
m.href = h.src, m.download = h.alt || "download", document.body.appendChild(m), m.click(), document.body.removeChild(m);
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1245
|
-
|
|
1244
|
+
function o(m) {
|
|
1245
|
+
m.key === "Escape" && h.isOpen && S();
|
|
1246
1246
|
}
|
|
1247
|
-
return
|
|
1248
|
-
|
|
1247
|
+
return fe(() => h.isOpen, (m) => {
|
|
1248
|
+
m ? (ge(() => {
|
|
1249
1249
|
var C;
|
|
1250
|
-
(C =
|
|
1251
|
-
}), document.body.style.overflow = "hidden") : (document.body.style.overflow = "",
|
|
1250
|
+
(C = l.value) == null || C.focus();
|
|
1251
|
+
}), document.body.style.overflow = "hidden") : (document.body.style.overflow = "", U.value = !1);
|
|
1252
1252
|
}), we(() => {
|
|
1253
|
-
document.addEventListener("keydown",
|
|
1254
|
-
}),
|
|
1255
|
-
document.removeEventListener("keydown",
|
|
1256
|
-
}), (
|
|
1257
|
-
Ae(
|
|
1258
|
-
default:
|
|
1253
|
+
document.addEventListener("keydown", o);
|
|
1254
|
+
}), Oe(() => {
|
|
1255
|
+
document.removeEventListener("keydown", o), document.body.style.overflow = "";
|
|
1256
|
+
}), (m, C) => (a(), ke(Et, { to: "body" }, [
|
|
1257
|
+
Ae(Me, { name: "artifactuse-viewer" }, {
|
|
1258
|
+
default: Le(() => [
|
|
1259
1259
|
H.isOpen ? (a(), s("div", {
|
|
1260
1260
|
key: 0,
|
|
1261
1261
|
class: "artifactuse-viewer-overlay",
|
|
1262
|
-
onClick:
|
|
1263
|
-
onKeydown:
|
|
1262
|
+
onClick: S,
|
|
1263
|
+
onKeydown: St(S, ["escape"]),
|
|
1264
1264
|
tabindex: "-1",
|
|
1265
1265
|
ref_key: "overlayRef",
|
|
1266
|
-
ref:
|
|
1266
|
+
ref: l
|
|
1267
1267
|
}, [
|
|
1268
1268
|
e("div", {
|
|
1269
1269
|
class: "artifactuse-viewer-content",
|
|
1270
|
-
onClick: C[0] || (C[0] =
|
|
1270
|
+
onClick: C[0] || (C[0] = he(() => {
|
|
1271
1271
|
}, ["stop"]))
|
|
1272
1272
|
}, [
|
|
1273
1273
|
H.type === "image" ? (a(), s("img", {
|
|
1274
1274
|
key: 0,
|
|
1275
1275
|
src: H.src,
|
|
1276
1276
|
alt: H.alt,
|
|
1277
|
-
class:
|
|
1277
|
+
class: N(["artifactuse-viewer-image", { "artifactuse-viewer-image--zoomed": U.value }]),
|
|
1278
1278
|
onClick: A
|
|
1279
|
-
}, null, 10,
|
|
1279
|
+
}, null, 10, Ji)) : H.type === "pdf" ? (a(), s("iframe", {
|
|
1280
1280
|
key: 1,
|
|
1281
1281
|
src: H.src,
|
|
1282
1282
|
class: "artifactuse-viewer-pdf"
|
|
1283
|
-
}, null, 8,
|
|
1283
|
+
}, null, 8, Xi)) : d("", !0),
|
|
1284
1284
|
e("button", {
|
|
1285
1285
|
class: "artifactuse-viewer-close",
|
|
1286
|
-
onClick:
|
|
1286
|
+
onClick: S,
|
|
1287
1287
|
title: "Close (Esc)"
|
|
1288
1288
|
}, [...C[1] || (C[1] = [
|
|
1289
1289
|
e("svg", {
|
|
@@ -1306,13 +1306,13 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
1306
1306
|
})
|
|
1307
1307
|
], -1)
|
|
1308
1308
|
])]),
|
|
1309
|
-
H.type === "image" ? (a(), s("div",
|
|
1309
|
+
H.type === "image" ? (a(), s("div", Zi, [
|
|
1310
1310
|
e("button", {
|
|
1311
1311
|
class: "artifactuse-viewer-control",
|
|
1312
|
-
onClick:
|
|
1313
|
-
title:
|
|
1312
|
+
onClick: he(A, ["stop"]),
|
|
1313
|
+
title: U.value ? "Zoom out" : "Zoom in"
|
|
1314
1314
|
}, [
|
|
1315
|
-
|
|
1315
|
+
U.value ? (a(), s("svg", Yi, [...C[3] || (C[3] = [
|
|
1316
1316
|
e("circle", {
|
|
1317
1317
|
cx: "11",
|
|
1318
1318
|
cy: "11",
|
|
@@ -1330,7 +1330,7 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
1330
1330
|
x2: "14",
|
|
1331
1331
|
y2: "11"
|
|
1332
1332
|
}, null, -1)
|
|
1333
|
-
])])) : (a(), s("svg",
|
|
1333
|
+
])])) : (a(), s("svg", Ki, [...C[2] || (C[2] = [
|
|
1334
1334
|
e("circle", {
|
|
1335
1335
|
cx: "11",
|
|
1336
1336
|
cy: "11",
|
|
@@ -1355,10 +1355,10 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
1355
1355
|
y2: "11"
|
|
1356
1356
|
}, null, -1)
|
|
1357
1357
|
])]))
|
|
1358
|
-
], 8,
|
|
1358
|
+
], 8, Wi),
|
|
1359
1359
|
e("button", {
|
|
1360
1360
|
class: "artifactuse-viewer-control",
|
|
1361
|
-
onClick:
|
|
1361
|
+
onClick: he(g, ["stop"]),
|
|
1362
1362
|
title: "Download"
|
|
1363
1363
|
}, [...C[4] || (C[4] = [
|
|
1364
1364
|
e("svg", {
|
|
@@ -1377,16 +1377,16 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
1377
1377
|
})
|
|
1378
1378
|
], -1)
|
|
1379
1379
|
])])
|
|
1380
|
-
])) :
|
|
1381
|
-
H.caption ? (a(), s("div",
|
|
1380
|
+
])) : d("", !0),
|
|
1381
|
+
H.caption ? (a(), s("div", Qi, n(H.caption), 1)) : d("", !0)
|
|
1382
1382
|
])
|
|
1383
|
-
], 544)) :
|
|
1383
|
+
], 544)) : d("", !0)
|
|
1384
1384
|
]),
|
|
1385
1385
|
_: 1
|
|
1386
1386
|
})
|
|
1387
1387
|
]));
|
|
1388
1388
|
}
|
|
1389
|
-
},
|
|
1389
|
+
}, el = ["innerHTML"], Fn = {
|
|
1390
1390
|
__name: "ArtifactuseAgentMessage",
|
|
1391
1391
|
props: {
|
|
1392
1392
|
// The raw message content (markdown/HTML from AI)
|
|
@@ -1427,656 +1427,678 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
1427
1427
|
"social-copy",
|
|
1428
1428
|
"media-open"
|
|
1429
1429
|
],
|
|
1430
|
-
setup(H, { expose:
|
|
1431
|
-
const
|
|
1432
|
-
processMessage:
|
|
1433
|
-
openArtifact:
|
|
1430
|
+
setup(H, { expose: u, emit: h }) {
|
|
1431
|
+
const k = H, l = h, {
|
|
1432
|
+
processMessage: U,
|
|
1433
|
+
openArtifact: S,
|
|
1434
1434
|
state: A,
|
|
1435
|
-
getTheme:
|
|
1436
|
-
instance:
|
|
1437
|
-
} = He(),
|
|
1438
|
-
let
|
|
1439
|
-
const
|
|
1435
|
+
getTheme: g,
|
|
1436
|
+
instance: o
|
|
1437
|
+
} = He(), m = M(null), C = M(null), $ = M(""), q = M([]);
|
|
1438
|
+
let O = null;
|
|
1439
|
+
const J = M(!1), F = M("image"), ee = M(""), I = M(""), te = M(""), X = b(() => (g == null ? void 0 : g()) || "dark"), Z = b(() => A.activeArtifactId), oe = M(!1);
|
|
1440
1440
|
we(() => {
|
|
1441
|
-
|
|
1442
|
-
}),
|
|
1443
|
-
|
|
1441
|
+
k.typing && (oe.value = !0);
|
|
1442
|
+
}), fe(() => k.typing, (x) => {
|
|
1443
|
+
x && (oe.value = !0);
|
|
1444
1444
|
});
|
|
1445
|
-
const
|
|
1446
|
-
function p(
|
|
1447
|
-
if (!
|
|
1445
|
+
const f = b(() => oe.value || k.isLastMessage ? "active" : "inactive");
|
|
1446
|
+
function p(x) {
|
|
1447
|
+
if (!x) return null;
|
|
1448
1448
|
try {
|
|
1449
|
-
const
|
|
1450
|
-
return JSON.parse(
|
|
1449
|
+
const V = decodeURIComponent(escape(atob(x)));
|
|
1450
|
+
return JSON.parse(V);
|
|
1451
1451
|
} catch {
|
|
1452
1452
|
try {
|
|
1453
|
-
const
|
|
1453
|
+
const D = x.replace(/ /g, `
|
|
1454
1454
|
`).replace(/ /g, "\r").replace(/	/g, " ").replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
1455
|
-
return JSON.parse(
|
|
1456
|
-
} catch (
|
|
1457
|
-
return console.error("Failed to parse artifact data:",
|
|
1455
|
+
return JSON.parse(D);
|
|
1456
|
+
} catch (D) {
|
|
1457
|
+
return console.error("Failed to parse artifact data:", D), null;
|
|
1458
1458
|
}
|
|
1459
1459
|
}
|
|
1460
1460
|
}
|
|
1461
|
-
const
|
|
1462
|
-
const
|
|
1463
|
-
if (!
|
|
1464
|
-
const
|
|
1465
|
-
let
|
|
1466
|
-
for (; (
|
|
1467
|
-
if (
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1461
|
+
const ae = b(() => {
|
|
1462
|
+
const x = [], V = $.value;
|
|
1463
|
+
if (!V) return x;
|
|
1464
|
+
const D = /<div\s+class="artifactuse-placeholder[^"]*"[^>]*data-artifact-id="([^"]+)"[^>]*data-artifact-type="([^"]+)"[^>]*data-artifact=["']([^"']*)["'][^>]*><\/div>/gi;
|
|
1465
|
+
let re = 0, z;
|
|
1466
|
+
for (; (z = D.exec(V)) !== null; ) {
|
|
1467
|
+
if (z.index > re) {
|
|
1468
|
+
const B = V.slice(re, z.index);
|
|
1469
|
+
B.trim() && x.push({ type: "html", content: B });
|
|
1470
1470
|
}
|
|
1471
|
-
const
|
|
1472
|
-
|
|
1471
|
+
const G = p(z[3]), v = z[2];
|
|
1472
|
+
G && (v === "form" && G.isInline ? x.push({ type: "form", artifact: G }) : v === "social" ? x.push({ type: "social", artifact: G }) : x.push({ type: "panel", artifact: G })), re = z.index + z[0].length;
|
|
1473
1473
|
}
|
|
1474
|
-
if (
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1474
|
+
if (re < V.length) {
|
|
1475
|
+
const G = V.slice(re);
|
|
1476
|
+
G.trim() && x.push({ type: "html", content: G });
|
|
1477
1477
|
}
|
|
1478
|
-
return
|
|
1478
|
+
return x.length === 0 && V.trim() && x.push({ type: "html", content: V }), x;
|
|
1479
1479
|
});
|
|
1480
|
-
function
|
|
1481
|
-
|
|
1480
|
+
function L(x) {
|
|
1481
|
+
F.value = x.type || "image", ee.value = x.src || "", I.value = x.alt || "", te.value = x.caption || "", J.value = !0, l("media-open", x);
|
|
1482
1482
|
}
|
|
1483
|
-
function
|
|
1484
|
-
|
|
1483
|
+
function Y() {
|
|
1484
|
+
J.value = !1, ee.value = "", I.value = "", te.value = "";
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1486
|
+
function Q() {
|
|
1487
1487
|
if (!C.value) return;
|
|
1488
|
-
C.value.querySelectorAll('img[data-lightbox="true"]').forEach((
|
|
1489
|
-
|
|
1490
|
-
|
|
1488
|
+
C.value.querySelectorAll('img[data-lightbox="true"]').forEach((v) => {
|
|
1489
|
+
v._lightboxHandler && v.removeEventListener("click", v._lightboxHandler), v._lightboxHandler = (B) => {
|
|
1490
|
+
B.preventDefault(), B.stopPropagation(), L({
|
|
1491
1491
|
type: "image",
|
|
1492
|
-
src:
|
|
1493
|
-
alt:
|
|
1494
|
-
caption:
|
|
1492
|
+
src: v.src,
|
|
1493
|
+
alt: v.alt || "",
|
|
1494
|
+
caption: v.dataset.caption || v.alt || ""
|
|
1495
1495
|
});
|
|
1496
|
-
},
|
|
1497
|
-
}), C.value.querySelectorAll(".artifactuse-image-container img").forEach((
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
const
|
|
1501
|
-
|
|
1496
|
+
}, v.addEventListener("click", v._lightboxHandler), v.style.cursor = "zoom-in";
|
|
1497
|
+
}), C.value.querySelectorAll(".artifactuse-image-container img").forEach((v) => {
|
|
1498
|
+
v._lightboxHandler || (v._lightboxHandler = (B) => {
|
|
1499
|
+
B.preventDefault(), B.stopPropagation();
|
|
1500
|
+
const W = v.closest(".artifactuse-image-container"), se = W == null ? void 0 : W.querySelector(".artifactuse-image-caption"), Ce = (se == null ? void 0 : se.textContent) || v.dataset.caption || v.alt || "";
|
|
1501
|
+
L({
|
|
1502
1502
|
type: "image",
|
|
1503
|
-
src:
|
|
1504
|
-
alt:
|
|
1505
|
-
caption:
|
|
1503
|
+
src: v.src,
|
|
1504
|
+
alt: v.alt || "",
|
|
1505
|
+
caption: Ce
|
|
1506
1506
|
});
|
|
1507
|
-
},
|
|
1508
|
-
}), C.value.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
const
|
|
1512
|
-
|
|
1507
|
+
}, v.addEventListener("click", v._lightboxHandler), v.style.cursor = "zoom-in");
|
|
1508
|
+
}), C.value.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((v) => {
|
|
1509
|
+
v._lightboxHandler || (v._lightboxHandler = (B) => {
|
|
1510
|
+
B.preventDefault(), B.stopPropagation();
|
|
1511
|
+
const W = v.closest(".artifactuse-gallery-item"), se = W == null ? void 0 : W.querySelector(".artifactuse-gallery-caption"), Ce = (se == null ? void 0 : se.textContent) || v.dataset.caption || v.alt || "";
|
|
1512
|
+
L({
|
|
1513
1513
|
type: "image",
|
|
1514
|
-
src:
|
|
1515
|
-
alt:
|
|
1516
|
-
caption:
|
|
1514
|
+
src: v.src,
|
|
1515
|
+
alt: v.alt || "",
|
|
1516
|
+
caption: Ce
|
|
1517
1517
|
});
|
|
1518
|
-
},
|
|
1519
|
-
}), C.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((
|
|
1520
|
-
|
|
1521
|
-
|
|
1518
|
+
}, v.addEventListener("click", v._lightboxHandler), v.style.cursor = "zoom-in");
|
|
1519
|
+
}), C.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((v) => {
|
|
1520
|
+
v._pdfHandler && v.removeEventListener("click", v._pdfHandler), v._pdfHandler = (B) => {
|
|
1521
|
+
B.preventDefault(), B.stopPropagation(), L({
|
|
1522
1522
|
type: "pdf",
|
|
1523
|
-
src:
|
|
1524
|
-
alt:
|
|
1525
|
-
caption:
|
|
1523
|
+
src: v.href,
|
|
1524
|
+
alt: v.textContent || "PDF Document",
|
|
1525
|
+
caption: v.title || v.textContent || ""
|
|
1526
1526
|
});
|
|
1527
|
-
},
|
|
1528
|
-
}), C.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((
|
|
1529
|
-
var
|
|
1530
|
-
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1533
|
-
|
|
1527
|
+
}, v.addEventListener("click", v._pdfHandler);
|
|
1528
|
+
}), C.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((v) => {
|
|
1529
|
+
var W;
|
|
1530
|
+
v._pdfHandler && v.removeEventListener("click", v._pdfHandler);
|
|
1531
|
+
const B = v.dataset.pdfSrc || ((W = v.querySelector("iframe")) == null ? void 0 : W.src) || "";
|
|
1532
|
+
B && (v._pdfHandler = (se) => {
|
|
1533
|
+
se.preventDefault(), se.stopPropagation(), L({
|
|
1534
1534
|
type: "pdf",
|
|
1535
|
-
src:
|
|
1535
|
+
src: B,
|
|
1536
1536
|
alt: "PDF Document",
|
|
1537
|
-
caption:
|
|
1537
|
+
caption: v.dataset.caption || ""
|
|
1538
1538
|
});
|
|
1539
|
-
},
|
|
1540
|
-
}), C.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((
|
|
1541
|
-
|
|
1542
|
-
if (
|
|
1543
|
-
const
|
|
1544
|
-
|
|
1545
|
-
},
|
|
1539
|
+
}, v.addEventListener("click", v._pdfHandler), v.style.cursor = "pointer");
|
|
1540
|
+
}), C.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((v) => {
|
|
1541
|
+
v._clickHandler && v.removeEventListener("click", v._clickHandler), v._clickHandler = (B) => {
|
|
1542
|
+
if (B.target.closest(".artifactuse-video-play-button")) return;
|
|
1543
|
+
const W = v.dataset.videoUrl || v.dataset.url;
|
|
1544
|
+
W && window.open(W, "_blank", "noopener,noreferrer");
|
|
1545
|
+
}, v.addEventListener("click", v._clickHandler);
|
|
1546
1546
|
});
|
|
1547
1547
|
}
|
|
1548
|
-
function
|
|
1548
|
+
function _() {
|
|
1549
1549
|
if (!C.value) return;
|
|
1550
|
-
C.value.querySelectorAll("img").forEach((
|
|
1551
|
-
|
|
1552
|
-
}), C.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((
|
|
1553
|
-
|
|
1554
|
-
}), C.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((
|
|
1555
|
-
|
|
1556
|
-
}), C.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((
|
|
1557
|
-
|
|
1550
|
+
C.value.querySelectorAll("img").forEach((z) => {
|
|
1551
|
+
z._lightboxHandler && (z.removeEventListener("click", z._lightboxHandler), delete z._lightboxHandler);
|
|
1552
|
+
}), C.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((z) => {
|
|
1553
|
+
z._pdfHandler && (z.removeEventListener("click", z._pdfHandler), delete z._pdfHandler);
|
|
1554
|
+
}), C.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((z) => {
|
|
1555
|
+
z._pdfHandler && (z.removeEventListener("click", z._pdfHandler), delete z._pdfHandler);
|
|
1556
|
+
}), C.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((z) => {
|
|
1557
|
+
z._clickHandler && (z.removeEventListener("click", z._clickHandler), delete z._clickHandler);
|
|
1558
1558
|
});
|
|
1559
1559
|
}
|
|
1560
1560
|
function T() {
|
|
1561
|
-
|
|
1562
|
-
if (await
|
|
1561
|
+
O && clearTimeout(O), O = setTimeout(async () => {
|
|
1562
|
+
if (await ge(), o != null && o.initializeContent && C.value)
|
|
1563
1563
|
try {
|
|
1564
|
-
await
|
|
1565
|
-
} catch (
|
|
1566
|
-
console.error("Failed to initialize content:",
|
|
1564
|
+
await o.initializeContent(C.value);
|
|
1565
|
+
} catch (x) {
|
|
1566
|
+
console.error("Failed to initialize content:", x);
|
|
1567
1567
|
}
|
|
1568
|
-
|
|
1568
|
+
Q();
|
|
1569
1569
|
}, 100);
|
|
1570
1570
|
}
|
|
1571
|
-
|
|
1572
|
-
() =>
|
|
1573
|
-
(
|
|
1574
|
-
if (
|
|
1575
|
-
const
|
|
1576
|
-
$.value =
|
|
1571
|
+
fe(
|
|
1572
|
+
() => k.content,
|
|
1573
|
+
(x) => {
|
|
1574
|
+
if (x) {
|
|
1575
|
+
const V = U(x, k.messageId);
|
|
1576
|
+
$.value = V.html, q.value = V.artifacts, V.artifacts.length > 0 && l("artifact-detected", V.artifacts), k.typing || T();
|
|
1577
1577
|
}
|
|
1578
1578
|
},
|
|
1579
1579
|
{ immediate: !0 }
|
|
1580
|
-
),
|
|
1581
|
-
() =>
|
|
1582
|
-
(
|
|
1583
|
-
|
|
1580
|
+
), fe(
|
|
1581
|
+
() => k.typing,
|
|
1582
|
+
(x, V) => {
|
|
1583
|
+
V === !0 && x === !1 && T();
|
|
1584
1584
|
}
|
|
1585
1585
|
), we(() => {
|
|
1586
|
-
|
|
1587
|
-
}),
|
|
1588
|
-
|
|
1586
|
+
k.typing || T();
|
|
1587
|
+
}), zt(() => {
|
|
1588
|
+
O && clearTimeout(O), _();
|
|
1589
1589
|
});
|
|
1590
|
-
function
|
|
1591
|
-
|
|
1590
|
+
function r(x) {
|
|
1591
|
+
S(x), l("artifact-open", x);
|
|
1592
1592
|
}
|
|
1593
|
-
function E(
|
|
1594
|
-
|
|
1593
|
+
function E(x) {
|
|
1594
|
+
l("artifact-copy", x);
|
|
1595
1595
|
}
|
|
1596
|
-
function c(
|
|
1597
|
-
|
|
1596
|
+
function c(x) {
|
|
1597
|
+
l("artifact-download", x);
|
|
1598
1598
|
}
|
|
1599
|
-
function
|
|
1600
|
-
|
|
1599
|
+
function P(x) {
|
|
1600
|
+
l("form-submit", x);
|
|
1601
1601
|
}
|
|
1602
|
-
function
|
|
1603
|
-
|
|
1602
|
+
function ne(x) {
|
|
1603
|
+
l("form-cancel", x);
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1606
|
-
|
|
1605
|
+
function ce(x) {
|
|
1606
|
+
l("form-button-click", x);
|
|
1607
1607
|
}
|
|
1608
|
-
function
|
|
1609
|
-
|
|
1608
|
+
function de(x) {
|
|
1609
|
+
l("social-copy", x);
|
|
1610
1610
|
}
|
|
1611
|
-
return
|
|
1612
|
-
openViewer:
|
|
1613
|
-
closeViewer:
|
|
1614
|
-
attachMediaListeners:
|
|
1615
|
-
}), (
|
|
1611
|
+
return b(() => A.artifacts.filter((x) => x.messageId === k.messageId)), u({
|
|
1612
|
+
openViewer: L,
|
|
1613
|
+
closeViewer: Y,
|
|
1614
|
+
attachMediaListeners: Q
|
|
1615
|
+
}), (x, V) => (a(), s("div", {
|
|
1616
1616
|
class: "artifactuse-agent-message",
|
|
1617
1617
|
ref_key: "messageRef",
|
|
1618
|
-
ref:
|
|
1618
|
+
ref: m
|
|
1619
1619
|
}, [
|
|
1620
1620
|
e("div", {
|
|
1621
1621
|
class: "artifactuse-message-content",
|
|
1622
1622
|
ref_key: "contentRef",
|
|
1623
1623
|
ref: C
|
|
1624
1624
|
}, [
|
|
1625
|
-
(a(!0), s(
|
|
1626
|
-
|
|
1625
|
+
(a(!0), s(R, null, ue(ae.value, (D, re) => (a(), s(R, { key: re }, [
|
|
1626
|
+
D.type === "html" ? (a(), s("div", {
|
|
1627
1627
|
key: 0,
|
|
1628
|
-
innerHTML:
|
|
1629
|
-
}, null, 8,
|
|
1628
|
+
innerHTML: D.content
|
|
1629
|
+
}, null, 8, el)) : D.type === "form" && D.artifact.isInline ? (a(), ke(Ua, {
|
|
1630
1630
|
key: 1,
|
|
1631
|
-
artifact:
|
|
1632
|
-
theme:
|
|
1633
|
-
"initial-state":
|
|
1634
|
-
onSubmit:
|
|
1635
|
-
onCancel:
|
|
1636
|
-
onButtonClick:
|
|
1637
|
-
}, null, 8, ["artifact", "theme", "initial-state"])) :
|
|
1631
|
+
artifact: D.artifact,
|
|
1632
|
+
theme: X.value,
|
|
1633
|
+
"initial-state": f.value,
|
|
1634
|
+
onSubmit: P,
|
|
1635
|
+
onCancel: ne,
|
|
1636
|
+
onButtonClick: ce
|
|
1637
|
+
}, null, 8, ["artifact", "theme", "initial-state"])) : D.type === "social" ? (a(), ke(Ni, {
|
|
1638
1638
|
key: 2,
|
|
1639
|
-
artifact:
|
|
1640
|
-
theme:
|
|
1641
|
-
onCopy:
|
|
1642
|
-
}, null, 8, ["artifact", "theme"])) :
|
|
1639
|
+
artifact: D.artifact,
|
|
1640
|
+
theme: X.value,
|
|
1641
|
+
onCopy: de
|
|
1642
|
+
}, null, 8, ["artifact", "theme"])) : D.type === "panel" && H.inlineCards ? (a(), ke(Gt, {
|
|
1643
1643
|
key: 3,
|
|
1644
|
-
artifact:
|
|
1645
|
-
"is-active":
|
|
1646
|
-
onOpen:
|
|
1644
|
+
artifact: D.artifact,
|
|
1645
|
+
"is-active": Z.value === D.artifact.id,
|
|
1646
|
+
onOpen: r,
|
|
1647
1647
|
onCopy: E,
|
|
1648
1648
|
onDownload: c
|
|
1649
|
-
}, null, 8, ["artifact", "is-active"])) :
|
|
1649
|
+
}, null, 8, ["artifact", "is-active"])) : d("", !0)
|
|
1650
1650
|
], 64))), 128))
|
|
1651
1651
|
], 512),
|
|
1652
|
-
Ae(
|
|
1653
|
-
"is-open":
|
|
1654
|
-
type:
|
|
1652
|
+
Ae(Gi, {
|
|
1653
|
+
"is-open": J.value,
|
|
1654
|
+
type: F.value,
|
|
1655
1655
|
src: ee.value,
|
|
1656
|
-
alt:
|
|
1657
|
-
caption:
|
|
1658
|
-
onClose:
|
|
1656
|
+
alt: I.value,
|
|
1657
|
+
caption: te.value,
|
|
1658
|
+
onClose: Y
|
|
1659
1659
|
}, null, 8, ["is-open", "type", "src", "alt", "caption"])
|
|
1660
1660
|
], 512));
|
|
1661
1661
|
}
|
|
1662
|
-
},
|
|
1662
|
+
}, tl = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, al = { class: "artifactuse-panel__actions" }, sl = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, il = {
|
|
1663
1663
|
key: 0,
|
|
1664
1664
|
href: "https://artifactuse.com",
|
|
1665
1665
|
target: "_blank",
|
|
1666
1666
|
rel: "noopener noreferrer",
|
|
1667
1667
|
class: "artifactuse-panel__branding"
|
|
1668
|
-
},
|
|
1668
|
+
}, ll = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, nl = { class: "artifactuse-panel__title" }, ol = { class: "artifactuse-panel__title-content" }, rl = { class: "artifactuse-panel__meta" }, cl = { class: "artifactuse-panel__actions" }, ul = ["disabled"], dl = {
|
|
1669
1669
|
key: 0,
|
|
1670
1670
|
viewBox: "0 0 24 24",
|
|
1671
1671
|
fill: "none",
|
|
1672
1672
|
stroke: "currentColor",
|
|
1673
1673
|
"stroke-width": "2"
|
|
1674
|
-
},
|
|
1674
|
+
}, vl = {
|
|
1675
1675
|
key: 1,
|
|
1676
1676
|
class: "artifactuse-panel__spinner-icon",
|
|
1677
1677
|
viewBox: "0 0 24 24",
|
|
1678
1678
|
fill: "none",
|
|
1679
1679
|
stroke: "currentColor",
|
|
1680
1680
|
"stroke-width": "2"
|
|
1681
|
-
},
|
|
1681
|
+
}, fl = { class: "artifactuse-panel__list" }, pl = { class: "artifactuse-panel__list-items" }, _l = ["onClick"], hl = ["innerHTML"], ml = { class: "artifactuse-panel__list-item-content" }, yl = { class: "artifactuse-panel__list-item-title" }, gl = { class: "artifactuse-panel__list-item-meta" }, kl = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, wl = {
|
|
1682
1682
|
key: 0,
|
|
1683
1683
|
href: "https://artifactuse.com",
|
|
1684
1684
|
target: "_blank",
|
|
1685
1685
|
rel: "noopener noreferrer",
|
|
1686
1686
|
class: "artifactuse-panel__branding"
|
|
1687
|
-
},
|
|
1687
|
+
}, Cl = { class: "artifactuse-panel__header" }, bl = { class: "artifactuse-panel__title" }, xl = ["innerHTML"], $l = { class: "artifactuse-panel__title-content" }, Ml = { class: "artifactuse-panel__name" }, Ll = { class: "artifactuse-panel__meta" }, Tl = { class: "artifactuse-panel__tabs" }, Al = ["disabled"], Hl = ["disabled"], Pl = { class: "artifactuse-panel__actions" }, Bl = ["title"], El = {
|
|
1688
1688
|
key: 0,
|
|
1689
1689
|
viewBox: "0 0 24 24",
|
|
1690
1690
|
fill: "none",
|
|
1691
1691
|
stroke: "currentColor",
|
|
1692
1692
|
"stroke-width": "2"
|
|
1693
|
-
},
|
|
1693
|
+
}, Sl = {
|
|
1694
1694
|
key: 1,
|
|
1695
1695
|
viewBox: "0 0 24 24",
|
|
1696
1696
|
fill: "none",
|
|
1697
1697
|
stroke: "currentColor",
|
|
1698
1698
|
"stroke-width": "2"
|
|
1699
|
-
},
|
|
1699
|
+
}, zl = {
|
|
1700
1700
|
key: 0,
|
|
1701
1701
|
class: "artifactuse-panel__loading"
|
|
1702
|
-
},
|
|
1702
|
+
}, Il = {
|
|
1703
1703
|
key: 0,
|
|
1704
1704
|
class: "artifactuse-panel__loading"
|
|
1705
|
-
},
|
|
1705
|
+
}, Fl = ["src"], Vl = {
|
|
1706
1706
|
key: 2,
|
|
1707
1707
|
class: "artifactuse-panel__no-preview"
|
|
1708
|
-
},
|
|
1708
|
+
}, Rl = { class: "artifactuse-panel__edit" }, ql = { class: "artifactuse-panel__footer" }, Ol = { class: "artifactuse-panel__footer-left" }, Ul = {
|
|
1709
1709
|
key: 0,
|
|
1710
1710
|
href: "https://artifactuse.com",
|
|
1711
1711
|
target: "_blank",
|
|
1712
1712
|
rel: "noopener noreferrer",
|
|
1713
1713
|
class: "artifactuse-panel__branding"
|
|
1714
|
-
},
|
|
1714
|
+
}, Dl = {
|
|
1715
1715
|
key: 1,
|
|
1716
1716
|
class: "artifactuse-panel__badge"
|
|
1717
|
-
},
|
|
1717
|
+
}, jl = { class: "artifactuse-panel__footer-right" }, Nl = ["title"], Jl = {
|
|
1718
1718
|
key: 0,
|
|
1719
1719
|
viewBox: "0 0 24 24",
|
|
1720
1720
|
fill: "none",
|
|
1721
1721
|
stroke: "currentColor",
|
|
1722
1722
|
"stroke-width": "2"
|
|
1723
|
-
},
|
|
1723
|
+
}, Xl = {
|
|
1724
1724
|
key: 1,
|
|
1725
1725
|
viewBox: "0 0 24 24",
|
|
1726
1726
|
fill: "none",
|
|
1727
1727
|
stroke: "currentColor",
|
|
1728
1728
|
"stroke-width": "2"
|
|
1729
|
-
},
|
|
1729
|
+
}, Zl = {
|
|
1730
1730
|
key: 0,
|
|
1731
1731
|
style: { position: "relative" }
|
|
1732
|
-
},
|
|
1732
|
+
}, Wl = {
|
|
1733
1733
|
key: 0,
|
|
1734
1734
|
class: "artifactuse-share-popup"
|
|
1735
|
-
},
|
|
1735
|
+
}, Kl = { class: "artifactuse-share-popup__header" }, Yl = { class: "artifactuse-share-popup__title" }, Ql = { class: "artifactuse-share-popup__body" }, Gl = {
|
|
1736
1736
|
key: 0,
|
|
1737
1737
|
class: "artifactuse-share-popup__loading"
|
|
1738
|
-
},
|
|
1738
|
+
}, en = { key: 1 }, tn = { class: "artifactuse-share-popup__error" }, an = { class: "artifactuse-share-popup__error-text" }, sn = { class: "artifactuse-share-popup__actions" }, ln = {
|
|
1739
1739
|
key: 2,
|
|
1740
1740
|
class: "artifactuse-share-popup__options"
|
|
1741
|
-
},
|
|
1741
|
+
}, nn = { key: 3 }, on = {
|
|
1742
1742
|
key: 0,
|
|
1743
1743
|
class: "artifactuse-share-popup__loading"
|
|
1744
|
-
},
|
|
1744
|
+
}, rn = {
|
|
1745
1745
|
key: 1,
|
|
1746
1746
|
class: "artifactuse-share-popup__empty"
|
|
1747
|
-
},
|
|
1747
|
+
}, cn = {
|
|
1748
1748
|
key: 2,
|
|
1749
1749
|
class: "artifactuse-share-popup__artifact-list"
|
|
1750
|
-
},
|
|
1750
|
+
}, un = ["onClick"], dn = { class: "artifactuse-share-popup__artifact-name" }, vn = { class: "artifactuse-share-popup__artifact-date" }, fn = {
|
|
1751
1751
|
key: 4,
|
|
1752
1752
|
class: "artifactuse-share-popup__success"
|
|
1753
|
-
},
|
|
1753
|
+
}, pn = { class: "artifactuse-share-popup__link-wrapper" }, _n = ["value"], hn = {
|
|
1754
1754
|
key: 0,
|
|
1755
1755
|
class: "artifactuse-share-popup__expiry"
|
|
1756
|
-
},
|
|
1756
|
+
}, mn = { class: "artifactuse-share-popup__expiry-text" }, yn = {
|
|
1757
1757
|
key: 1,
|
|
1758
1758
|
class: "artifactuse-share-popup__save-prompt"
|
|
1759
|
-
},
|
|
1759
|
+
}, gn = {
|
|
1760
1760
|
key: 2,
|
|
1761
1761
|
class: "artifactuse-panel__nav"
|
|
1762
|
-
},
|
|
1762
|
+
}, kn = ["disabled"], wn = ["disabled"], Cn = {
|
|
1763
1763
|
key: 0,
|
|
1764
1764
|
class: "artifactuse-panel__artifact-list"
|
|
1765
|
-
},
|
|
1765
|
+
}, bn = { class: "artifactuse-panel__artifact-list-header" }, xn = { class: "artifactuse-panel__artifact-list-items" }, $n = ["onClick"], Mn = ["innerHTML"], Ln = { class: "artifactuse-panel__artifact-item-content" }, Tn = { class: "artifactuse-panel__artifact-item-title" }, An = { class: "artifactuse-panel__artifact-item-meta" }, Hn = { class: "artifactuse-panel__artifact-item-index" }, Vn = {
|
|
1766
1766
|
__name: "ArtifactusePanel",
|
|
1767
1767
|
emits: ["close", "ai-request", "save", "export", "resize"],
|
|
1768
|
-
setup(H, { emit:
|
|
1769
|
-
const
|
|
1770
|
-
state:
|
|
1771
|
-
activeArtifact:
|
|
1772
|
-
artifactCount:
|
|
1773
|
-
hasArtifacts:
|
|
1768
|
+
setup(H, { emit: u }) {
|
|
1769
|
+
const h = u, {
|
|
1770
|
+
state: k,
|
|
1771
|
+
activeArtifact: l,
|
|
1772
|
+
artifactCount: U,
|
|
1773
|
+
hasArtifacts: S,
|
|
1774
1774
|
closePanel: A,
|
|
1775
|
-
toggleFullscreen:
|
|
1776
|
-
setViewMode:
|
|
1777
|
-
getPanelUrl:
|
|
1775
|
+
toggleFullscreen: g,
|
|
1776
|
+
setViewMode: o,
|
|
1777
|
+
getPanelUrl: m,
|
|
1778
1778
|
openArtifact: C,
|
|
1779
1779
|
instance: $
|
|
1780
|
-
} = He(),
|
|
1781
|
-
let
|
|
1782
|
-
const
|
|
1783
|
-
|
|
1784
|
-
|
|
1780
|
+
} = He(), q = M(null), O = M(null), J = M(null), F = M(null), ee = M(null), I = M(null), te = M(!1), X = M(!1), Z = M(!0), oe = M(!1), f = M(!1), p = M(!1), ae = M(!1), L = M("options"), Y = M(""), Q = M(null), _ = M(""), T = M(!1), r = M(!1), E = M([]), c = M(!1), P = M("");
|
|
1781
|
+
let ne = null, ce = null, de = null;
|
|
1782
|
+
const x = b(() => {
|
|
1783
|
+
var i;
|
|
1784
|
+
return ((i = $.editor) == null ? void 0 : i.isAvailable()) || !1;
|
|
1785
|
+
}), V = M(65), D = M(50), re = b(() => l.value ? Te(l.value.language) : ""), z = b(() => l.value ? `<svg viewBox="0 0 24 24" fill="currentColor">${Re(l.value.language)}</svg>` : ""), G = b(() => l.value ? m(l.value) : null);
|
|
1786
|
+
b(() => !l.value || !k.artifacts.length ? -1 : k.artifacts.findIndex((i) => i.id === l.value.id));
|
|
1787
|
+
const v = b(() => l.value ? Vt(l.value.language || "plaintext") : "plaintext"), B = b(() => k.artifacts.filter((i) => !i.isInline)), W = b(() => l.value ? B.value.findIndex((i) => i.id === l.value.id) : -1), se = b(() => {
|
|
1785
1788
|
var i;
|
|
1786
1789
|
return ((i = $.config) == null ? void 0 : i.branding) !== !1;
|
|
1787
|
-
}),
|
|
1790
|
+
}), Ce = b(() => {
|
|
1788
1791
|
var i;
|
|
1789
1792
|
return ((i = $.share) == null ? void 0 : i.enabled) !== !1;
|
|
1790
|
-
}),
|
|
1793
|
+
}), Ue = b(() => {
|
|
1791
1794
|
var i;
|
|
1792
1795
|
return ((i = $.share) == null ? void 0 : i.isAuthenticated()) || !1;
|
|
1793
|
-
}),
|
|
1794
|
-
function
|
|
1795
|
-
return `<svg viewBox="0 0 24 24" fill="currentColor">${
|
|
1796
|
+
}), lt = b(() => l.value ? V.value : Math.min(V.value, 30));
|
|
1797
|
+
function De(i) {
|
|
1798
|
+
return `<svg viewBox="0 0 24 24" fill="currentColor">${Re(i)}</svg>`;
|
|
1796
1799
|
}
|
|
1797
|
-
function
|
|
1798
|
-
|
|
1800
|
+
function nt() {
|
|
1801
|
+
f.value = !1, $.state.clearActiveArtifact();
|
|
1799
1802
|
}
|
|
1800
|
-
function
|
|
1803
|
+
function ot() {
|
|
1801
1804
|
var i;
|
|
1802
|
-
if (
|
|
1803
|
-
const t =
|
|
1805
|
+
if (F.value && ((i = l.value) != null && i.code)) {
|
|
1806
|
+
const t = l.value.code.split(`
|
|
1804
1807
|
`);
|
|
1805
|
-
|
|
1808
|
+
F.value.innerHTML = t.map((w, j) => `<div>${j + 1}</div>`).join("");
|
|
1806
1809
|
}
|
|
1807
1810
|
}
|
|
1808
|
-
function
|
|
1811
|
+
function rt() {
|
|
1809
1812
|
var i;
|
|
1810
|
-
if (
|
|
1811
|
-
const t = window.Prism.languages[
|
|
1812
|
-
t ?
|
|
1813
|
-
|
|
1813
|
+
if (O.value && Rt() && ((i = l.value) != null && i.code)) {
|
|
1814
|
+
const t = window.Prism.languages[v.value];
|
|
1815
|
+
t ? O.value.innerHTML = window.Prism.highlight(
|
|
1816
|
+
l.value.code,
|
|
1814
1817
|
t,
|
|
1815
|
-
|
|
1816
|
-
) :
|
|
1817
|
-
|
|
1818
|
+
v.value
|
|
1819
|
+
) : O.value.textContent = l.value.code, O.value.dataset.highlighted = "true", ge(() => {
|
|
1820
|
+
ct();
|
|
1818
1821
|
});
|
|
1819
1822
|
}
|
|
1820
1823
|
}
|
|
1821
|
-
function
|
|
1824
|
+
function ct() {
|
|
1822
1825
|
var t;
|
|
1823
|
-
const i = (t =
|
|
1824
|
-
if (i && ee.value &&
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1826
|
+
const i = (t = O.value) == null ? void 0 : t.closest("pre");
|
|
1827
|
+
if (i && ee.value && F.value) {
|
|
1828
|
+
const j = window.getComputedStyle(i).backgroundColor;
|
|
1829
|
+
j && j !== "rgba(0, 0, 0, 0)" && j !== "transparent" && (ee.value.style.backgroundColor = j, F.value.style.backgroundColor = j);
|
|
1827
1830
|
}
|
|
1828
1831
|
}
|
|
1829
|
-
function
|
|
1830
|
-
ee.value && (ee.value.style.backgroundColor = ""),
|
|
1832
|
+
function ut() {
|
|
1833
|
+
ee.value && (ee.value.style.backgroundColor = ""), F.value && (F.value.style.backgroundColor = "");
|
|
1831
1834
|
}
|
|
1832
|
-
function
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
+
function xe() {
|
|
1836
|
+
ge(() => {
|
|
1837
|
+
ot(), rt();
|
|
1835
1838
|
});
|
|
1836
1839
|
}
|
|
1837
|
-
function
|
|
1838
|
-
|
|
1840
|
+
function je() {
|
|
1841
|
+
!x.value || !I.value || !l.value || (Pe(), de = $.editor.create(I.value, {
|
|
1842
|
+
code: l.value.code || "",
|
|
1843
|
+
language: l.value.language || "plaintext",
|
|
1844
|
+
sdkTheme: $.getTheme()
|
|
1845
|
+
}));
|
|
1839
1846
|
}
|
|
1840
|
-
function
|
|
1841
|
-
|
|
1847
|
+
function Pe() {
|
|
1848
|
+
de && (de.destroy(), de = null);
|
|
1842
1849
|
}
|
|
1843
|
-
function
|
|
1844
|
-
|
|
1850
|
+
function dt() {
|
|
1851
|
+
if (!de || !l.value) return;
|
|
1852
|
+
const i = de.getCode();
|
|
1853
|
+
$.emit("edit:save", {
|
|
1854
|
+
artifactId: l.value.id,
|
|
1855
|
+
artifact: l.value,
|
|
1856
|
+
code: i
|
|
1857
|
+
});
|
|
1858
|
+
}
|
|
1859
|
+
function vt() {
|
|
1860
|
+
clearTimeout(ce), Z.value = !1, q.value && l.value && ($.bridge.setIframe(q.value), $.bridge.loadArtifact(l.value));
|
|
1861
|
+
}
|
|
1862
|
+
function ft() {
|
|
1863
|
+
clearTimeout(ce), Z.value = !1;
|
|
1864
|
+
}
|
|
1865
|
+
function pt() {
|
|
1866
|
+
clearTimeout(ce), ce = setTimeout(() => {
|
|
1845
1867
|
Z.value = !1;
|
|
1846
1868
|
}, 1e3);
|
|
1847
1869
|
}
|
|
1848
|
-
async function
|
|
1849
|
-
if (
|
|
1870
|
+
async function _t() {
|
|
1871
|
+
if (l.value)
|
|
1850
1872
|
try {
|
|
1851
|
-
await navigator.clipboard.writeText(
|
|
1852
|
-
|
|
1873
|
+
await navigator.clipboard.writeText(l.value.code), te.value = !0, setTimeout(() => {
|
|
1874
|
+
te.value = !1;
|
|
1853
1875
|
}, 2e3);
|
|
1854
1876
|
} catch (i) {
|
|
1855
1877
|
console.error("Failed to copy:", i);
|
|
1856
1878
|
}
|
|
1857
1879
|
}
|
|
1858
|
-
function
|
|
1859
|
-
if (!
|
|
1860
|
-
const { code: i, language: t, title:
|
|
1861
|
-
|
|
1880
|
+
function ht() {
|
|
1881
|
+
if (!l.value) return;
|
|
1882
|
+
const { code: i, language: t, title: w } = l.value, j = qe(t), ie = `${w.toLowerCase().replace(/\s+/g, "-")}.${j}`, me = new Blob([i], { type: "text/plain" }), pe = URL.createObjectURL(me), ve = document.createElement("a");
|
|
1883
|
+
ve.href = pe, ve.download = ie, document.body.appendChild(ve), ve.click(), document.body.removeChild(ve), URL.revokeObjectURL(pe);
|
|
1862
1884
|
}
|
|
1863
|
-
async function
|
|
1864
|
-
if (!(
|
|
1865
|
-
|
|
1885
|
+
async function mt() {
|
|
1886
|
+
if (!(p.value || B.value.length === 0)) {
|
|
1887
|
+
p.value = !0;
|
|
1866
1888
|
try {
|
|
1867
|
-
const i = new
|
|
1868
|
-
for (const
|
|
1869
|
-
if (!
|
|
1870
|
-
const
|
|
1871
|
-
let
|
|
1872
|
-
const Ve = t.get(
|
|
1873
|
-
Ve > 0 && (
|
|
1889
|
+
const i = new Ot(), t = /* @__PURE__ */ new Map();
|
|
1890
|
+
for (const ve of B.value) {
|
|
1891
|
+
if (!ve.code) continue;
|
|
1892
|
+
const ze = qe(ve.language);
|
|
1893
|
+
let Ie = (ve.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Fe = `${Ie}.${ze}`;
|
|
1894
|
+
const Ve = t.get(Fe) || 0;
|
|
1895
|
+
Ve > 0 && (Fe = `${Ie}-${Ve}.${ze}`), t.set(`${Ie}.${ze}`, Ve + 1), i.file(Fe, ve.code);
|
|
1874
1896
|
}
|
|
1875
|
-
const
|
|
1876
|
-
|
|
1897
|
+
const w = await i.generateAsync({ type: "blob" }), ie = `artifacts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`, me = URL.createObjectURL(w), pe = document.createElement("a");
|
|
1898
|
+
pe.href = me, pe.download = ie, document.body.appendChild(pe), pe.click(), document.body.removeChild(pe), URL.revokeObjectURL(me);
|
|
1877
1899
|
} catch (i) {
|
|
1878
1900
|
console.error("Failed to create ZIP:", i);
|
|
1879
1901
|
} finally {
|
|
1880
|
-
|
|
1902
|
+
p.value = !1;
|
|
1881
1903
|
}
|
|
1882
1904
|
}
|
|
1883
1905
|
}
|
|
1884
|
-
function
|
|
1885
|
-
if (
|
|
1886
|
-
|
|
1906
|
+
function yt() {
|
|
1907
|
+
if (ae.value) {
|
|
1908
|
+
ae.value = !1;
|
|
1887
1909
|
return;
|
|
1888
1910
|
}
|
|
1889
|
-
|
|
1911
|
+
l.value && (L.value = "options", Y.value = "", Q.value = null, _.value = "", T.value = !1, r.value = !1, E.value = [], c.value = !1, P.value = "", ae.value = !0);
|
|
1890
1912
|
}
|
|
1891
|
-
function
|
|
1892
|
-
|
|
1913
|
+
function gt() {
|
|
1914
|
+
ae.value = !1;
|
|
1893
1915
|
}
|
|
1894
|
-
function
|
|
1916
|
+
function Ne(i) {
|
|
1895
1917
|
return i ? new Date(i).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : "";
|
|
1896
1918
|
}
|
|
1897
|
-
async function
|
|
1898
|
-
if (!(!
|
|
1899
|
-
|
|
1919
|
+
async function Je() {
|
|
1920
|
+
if (!(!l.value || !$.share)) {
|
|
1921
|
+
L.value = "loading", _.value = "";
|
|
1900
1922
|
try {
|
|
1901
|
-
const i = await $.share.share(
|
|
1902
|
-
|
|
1923
|
+
const i = await $.share.share(l.value);
|
|
1924
|
+
Y.value = i.url, Q.value = i.expiresAt, r.value = !1, L.value = "success";
|
|
1903
1925
|
} catch (i) {
|
|
1904
|
-
|
|
1926
|
+
_.value = i.message || "Failed to create share link", L.value = "error";
|
|
1905
1927
|
}
|
|
1906
1928
|
}
|
|
1907
1929
|
}
|
|
1908
|
-
async function
|
|
1909
|
-
if (
|
|
1910
|
-
|
|
1930
|
+
async function Xe() {
|
|
1931
|
+
if (Ue.value)
|
|
1932
|
+
Be();
|
|
1911
1933
|
else {
|
|
1912
|
-
|
|
1934
|
+
L.value = "loading";
|
|
1913
1935
|
try {
|
|
1914
|
-
await $.share.openAuthPopup(),
|
|
1936
|
+
await $.share.openAuthPopup(), Be();
|
|
1915
1937
|
} catch (i) {
|
|
1916
|
-
i.message === "Authentication cancelled" ?
|
|
1938
|
+
i.message === "Authentication cancelled" ? L.value = "options" : (_.value = i.message || "Authentication failed", L.value = "error");
|
|
1917
1939
|
}
|
|
1918
1940
|
}
|
|
1919
1941
|
}
|
|
1920
|
-
async function
|
|
1921
|
-
if (!(!
|
|
1922
|
-
|
|
1942
|
+
async function Be() {
|
|
1943
|
+
if (!(!l.value || !$.share)) {
|
|
1944
|
+
L.value = "loading", _.value = "";
|
|
1923
1945
|
try {
|
|
1924
|
-
const i = await $.share.save(
|
|
1925
|
-
|
|
1946
|
+
const i = await $.share.save(l.value);
|
|
1947
|
+
Y.value = i.url, Q.value = null, r.value = !0, L.value = "success";
|
|
1926
1948
|
} catch (i) {
|
|
1927
|
-
|
|
1949
|
+
_.value = i.message || "Failed to save artifact", L.value = "error";
|
|
1928
1950
|
}
|
|
1929
1951
|
}
|
|
1930
1952
|
}
|
|
1931
|
-
function
|
|
1932
|
-
|
|
1953
|
+
function kt() {
|
|
1954
|
+
r.value ? Be() : Je();
|
|
1933
1955
|
}
|
|
1934
|
-
async function
|
|
1956
|
+
async function wt() {
|
|
1935
1957
|
var i;
|
|
1936
1958
|
if ($.share) {
|
|
1937
|
-
if (!
|
|
1938
|
-
|
|
1959
|
+
if (!Ue.value) {
|
|
1960
|
+
L.value = "loading";
|
|
1939
1961
|
try {
|
|
1940
1962
|
await $.share.openAuthPopup();
|
|
1941
1963
|
} catch (t) {
|
|
1942
|
-
t.message === "Authentication cancelled" ?
|
|
1964
|
+
t.message === "Authentication cancelled" ? L.value = "options" : (_.value = t.message || "Authentication failed", L.value = "error");
|
|
1943
1965
|
return;
|
|
1944
1966
|
}
|
|
1945
1967
|
}
|
|
1946
|
-
|
|
1968
|
+
L.value = "update-list", c.value = !0;
|
|
1947
1969
|
try {
|
|
1948
|
-
const t = ((i =
|
|
1949
|
-
|
|
1970
|
+
const t = ((i = l.value) == null ? void 0 : i.language) || null, w = await $.share.listArtifacts(t);
|
|
1971
|
+
E.value = w.projects || [];
|
|
1950
1972
|
} catch (t) {
|
|
1951
|
-
|
|
1973
|
+
_.value = t.message || "Failed to load artifacts", L.value = "error";
|
|
1952
1974
|
} finally {
|
|
1953
|
-
|
|
1975
|
+
c.value = !1;
|
|
1954
1976
|
}
|
|
1955
1977
|
}
|
|
1956
1978
|
}
|
|
1957
|
-
async function
|
|
1958
|
-
var
|
|
1959
|
-
if (!
|
|
1960
|
-
const t = (
|
|
1979
|
+
async function Ct(i) {
|
|
1980
|
+
var w, j;
|
|
1981
|
+
if (!l.value || !$.share) return;
|
|
1982
|
+
const t = (w = i.project) == null ? void 0 : w.uuid;
|
|
1961
1983
|
if (t) {
|
|
1962
|
-
|
|
1984
|
+
L.value = "loading", _.value = "";
|
|
1963
1985
|
try {
|
|
1964
|
-
const
|
|
1965
|
-
|
|
1966
|
-
} catch (
|
|
1967
|
-
|
|
1986
|
+
const ie = await $.share.updateArtifact(t, l.value);
|
|
1987
|
+
Y.value = ie.url || "", Q.value = null, r.value = !0, P.value = ((j = i.project) == null ? void 0 : j.name) || "Untitled", L.value = "success";
|
|
1988
|
+
} catch (ie) {
|
|
1989
|
+
_.value = ie.message || "Failed to update artifact", L.value = "error";
|
|
1968
1990
|
}
|
|
1969
1991
|
}
|
|
1970
1992
|
}
|
|
1971
|
-
async function
|
|
1972
|
-
if (
|
|
1993
|
+
async function bt() {
|
|
1994
|
+
if (Y.value)
|
|
1973
1995
|
try {
|
|
1974
|
-
await navigator.clipboard.writeText(
|
|
1975
|
-
|
|
1996
|
+
await navigator.clipboard.writeText(Y.value), T.value = !0, setTimeout(() => {
|
|
1997
|
+
T.value = !1;
|
|
1976
1998
|
}, 2e3);
|
|
1977
1999
|
} catch (i) {
|
|
1978
2000
|
console.error("Failed to copy link:", i);
|
|
1979
2001
|
}
|
|
1980
2002
|
}
|
|
1981
|
-
function
|
|
1982
|
-
|
|
2003
|
+
function xt() {
|
|
2004
|
+
G.value && window.open(G.value, "_blank");
|
|
1983
2005
|
}
|
|
1984
|
-
function
|
|
1985
|
-
|
|
2006
|
+
function $t() {
|
|
2007
|
+
F.value && ee.value && (F.value.style.transform = `translateY(-${ee.value.scrollTop}px)`);
|
|
1986
2008
|
}
|
|
1987
|
-
function
|
|
1988
|
-
|
|
2009
|
+
function Mt() {
|
|
2010
|
+
X.value = !X.value;
|
|
1989
2011
|
}
|
|
1990
|
-
function
|
|
1991
|
-
|
|
2012
|
+
function Ze(i) {
|
|
2013
|
+
f.value = !0, C(i), X.value = !1;
|
|
1992
2014
|
}
|
|
1993
|
-
function
|
|
1994
|
-
const i =
|
|
1995
|
-
i >= 0 && C(
|
|
2015
|
+
function Lt() {
|
|
2016
|
+
const i = W.value - 1;
|
|
2017
|
+
i >= 0 && C(B.value[i]);
|
|
1996
2018
|
}
|
|
1997
|
-
function
|
|
1998
|
-
const i =
|
|
1999
|
-
i <
|
|
2019
|
+
function Tt() {
|
|
2020
|
+
const i = W.value + 1;
|
|
2021
|
+
i < B.value.length && C(B.value[i]);
|
|
2000
2022
|
}
|
|
2001
|
-
function
|
|
2023
|
+
function We(i) {
|
|
2002
2024
|
const t = document.querySelector(".artifactuse-panel__nav");
|
|
2003
|
-
t && !t.contains(i.target) && (
|
|
2025
|
+
t && !t.contains(i.target) && (X.value = !1);
|
|
2004
2026
|
}
|
|
2005
|
-
let
|
|
2006
|
-
function
|
|
2007
|
-
|
|
2027
|
+
let ye = null;
|
|
2028
|
+
function At(i) {
|
|
2029
|
+
ye = {
|
|
2008
2030
|
startX: i.clientX,
|
|
2009
|
-
startWidth:
|
|
2010
|
-
}, document.addEventListener("mousemove",
|
|
2011
|
-
}
|
|
2012
|
-
function
|
|
2013
|
-
if (!
|
|
2014
|
-
const t = window.innerWidth,
|
|
2015
|
-
|
|
2016
|
-
}
|
|
2017
|
-
function
|
|
2018
|
-
const i =
|
|
2019
|
-
|
|
2020
|
-
}
|
|
2021
|
-
let
|
|
2022
|
-
function
|
|
2023
|
-
if (!
|
|
2024
|
-
const t =
|
|
2025
|
-
|
|
2031
|
+
startWidth: V.value
|
|
2032
|
+
}, document.addEventListener("mousemove", Ke), document.addEventListener("mouseup", Ee), document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((w) => w.style.pointerEvents = "none");
|
|
2033
|
+
}
|
|
2034
|
+
function Ke(i) {
|
|
2035
|
+
if (!ye) return;
|
|
2036
|
+
const t = window.innerWidth, j = (ye.startX - i.clientX) / t * 100, ie = ye.startWidth + j;
|
|
2037
|
+
V.value = Math.min(Math.max(ie, 25), 75), h("resize", { width: V.value });
|
|
2038
|
+
}
|
|
2039
|
+
function Ee() {
|
|
2040
|
+
const i = ye !== null;
|
|
2041
|
+
ye = null, document.removeEventListener("mousemove", Ke), document.removeEventListener("mouseup", Ee), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((w) => w.style.pointerEvents = ""), i && h("resize", { width: V.value });
|
|
2042
|
+
}
|
|
2043
|
+
let be = null;
|
|
2044
|
+
function Ht(i) {
|
|
2045
|
+
if (!J.value) return;
|
|
2046
|
+
const t = J.value.getBoundingClientRect();
|
|
2047
|
+
be = {
|
|
2026
2048
|
startX: i.clientX,
|
|
2027
|
-
startPosition:
|
|
2049
|
+
startPosition: D.value,
|
|
2028
2050
|
contentLeft: t.left,
|
|
2029
2051
|
contentWidth: t.width
|
|
2030
|
-
}, document.addEventListener("mousemove",
|
|
2052
|
+
}, document.addEventListener("mousemove", Ye), document.addEventListener("mouseup", Se), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((j) => j.style.pointerEvents = "none");
|
|
2031
2053
|
}
|
|
2032
|
-
function
|
|
2033
|
-
if (!
|
|
2034
|
-
const
|
|
2035
|
-
|
|
2054
|
+
function Ye(i) {
|
|
2055
|
+
if (!be) return;
|
|
2056
|
+
const w = (i.clientX - be.contentLeft) / be.contentWidth * 100;
|
|
2057
|
+
D.value = Math.min(Math.max(w, 20), 80);
|
|
2036
2058
|
}
|
|
2037
2059
|
function Se() {
|
|
2038
|
-
|
|
2060
|
+
be = null, document.removeEventListener("mousemove", Ye), document.removeEventListener("mouseup", Se), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((t) => t.style.pointerEvents = "");
|
|
2039
2061
|
}
|
|
2040
|
-
return
|
|
2041
|
-
i && (t && t.isPreviewable !== i.isPreviewable && (
|
|
2042
|
-
|
|
2043
|
-
}, 150)), (!t || i.id !== t.id) && (
|
|
2044
|
-
|
|
2062
|
+
return fe(l, (i, t) => {
|
|
2063
|
+
i && (t && t.isPreviewable !== i.isPreviewable && (oe.value = !0, setTimeout(() => {
|
|
2064
|
+
oe.value = !1;
|
|
2065
|
+
}, 150)), (!t || i.id !== t.id) && (ut(), Z.value = !0, pt()), (!t || i.id !== t.id || i.code !== t.code) && (xe(), k.viewMode === "edit" && (!t || i.id !== t.id ? ge(() => je()) : de && de.setCode(i.code || "")), clearTimeout(ne), ne = setTimeout(() => {
|
|
2066
|
+
q.value && i.isPreviewable && $.bridge.loadArtifact(i);
|
|
2045
2067
|
}, 500)));
|
|
2046
|
-
}, { deep: !0 }),
|
|
2047
|
-
(i === "code" || i === "split") &&
|
|
2048
|
-
}),
|
|
2049
|
-
i &&
|
|
2068
|
+
}, { deep: !0 }), fe(() => k.viewMode, (i) => {
|
|
2069
|
+
(i === "code" || i === "split") && xe(), i === "edit" && ge(() => je());
|
|
2070
|
+
}), fe(() => k.isPanelOpen, (i) => {
|
|
2071
|
+
i && l.value && xe(), i || Pe();
|
|
2050
2072
|
}), we(() => {
|
|
2051
|
-
$.on("ai:request", (i) =>
|
|
2052
|
-
}),
|
|
2053
|
-
|
|
2054
|
-
}), (i, t) => (a(), ke(
|
|
2055
|
-
default:
|
|
2056
|
-
|
|
2073
|
+
$.on("ai:request", (i) => h("ai-request", i)), $.on("save:request", (i) => h("save", i)), $.on("export:complete", (i) => h("export", i)), document.addEventListener("click", We), k.isPanelOpen && l.value && xe();
|
|
2074
|
+
}), Oe(() => {
|
|
2075
|
+
Ee(), Se(), Pe(), document.removeEventListener("click", We), clearTimeout(ne), clearTimeout(ce);
|
|
2076
|
+
}), (i, t) => (a(), ke(Me, { name: "artifactuse-panel" }, {
|
|
2077
|
+
default: Le(() => [
|
|
2078
|
+
y(k).isPanelOpen ? (a(), s("div", {
|
|
2057
2079
|
key: 0,
|
|
2058
|
-
class:
|
|
2059
|
-
"artifactuse-panel--fullscreen":
|
|
2060
|
-
"artifactuse-panel--list": !
|
|
2061
|
-
"artifactuse-panel--empty": !
|
|
2080
|
+
class: N(["artifactuse-panel", {
|
|
2081
|
+
"artifactuse-panel--fullscreen": y(k).isFullscreen,
|
|
2082
|
+
"artifactuse-panel--list": !y(l) && y(S),
|
|
2083
|
+
"artifactuse-panel--empty": !y(S)
|
|
2062
2084
|
}]),
|
|
2063
|
-
style:
|
|
2085
|
+
style: $e(y(k).isFullscreen ? void 0 : { width: `${lt.value}%` })
|
|
2064
2086
|
}, [
|
|
2065
|
-
|
|
2087
|
+
y(k).isFullscreen ? d("", !0) : (a(), s("div", {
|
|
2066
2088
|
key: 0,
|
|
2067
2089
|
class: "artifactuse-panel__resize-handle",
|
|
2068
|
-
onMousedown:
|
|
2069
|
-
}, [...t[
|
|
2090
|
+
onMousedown: he(At, ["prevent"])
|
|
2091
|
+
}, [...t[12] || (t[12] = [
|
|
2070
2092
|
e("div", { class: "artifactuse-panel__resize-handle-line" }, null, -1)
|
|
2071
2093
|
])], 32)),
|
|
2072
|
-
|
|
2073
|
-
e("header",
|
|
2074
|
-
|
|
2094
|
+
y(S) ? y(l) ? (a(), s(R, { key: 3 }, [
|
|
2095
|
+
e("header", Cl, [
|
|
2096
|
+
f.value ? (a(), s("button", {
|
|
2075
2097
|
key: 0,
|
|
2076
2098
|
class: "artifactuse-panel__back",
|
|
2077
2099
|
title: "Back to list",
|
|
2078
|
-
onClick:
|
|
2079
|
-
}, [...t[
|
|
2100
|
+
onClick: nt
|
|
2101
|
+
}, [...t[24] || (t[24] = [
|
|
2080
2102
|
e("svg", {
|
|
2081
2103
|
viewBox: "0 0 24 24",
|
|
2082
2104
|
fill: "none",
|
|
@@ -2085,29 +2107,30 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2085
2107
|
}, [
|
|
2086
2108
|
e("polyline", { points: "15 18 9 12 15 6" })
|
|
2087
2109
|
], -1)
|
|
2088
|
-
])])) :
|
|
2089
|
-
e("div",
|
|
2110
|
+
])])) : d("", !0),
|
|
2111
|
+
e("div", bl, [
|
|
2090
2112
|
e("span", {
|
|
2091
2113
|
class: "artifactuse-panel__icon",
|
|
2092
|
-
innerHTML:
|
|
2093
|
-
}, null, 8,
|
|
2094
|
-
e("div",
|
|
2095
|
-
e("span",
|
|
2096
|
-
e("span",
|
|
2097
|
-
K(
|
|
2098
|
-
|
|
2099
|
-
K(" • " +
|
|
2100
|
-
], 64)) :
|
|
2114
|
+
innerHTML: z.value
|
|
2115
|
+
}, null, 8, xl),
|
|
2116
|
+
e("div", $l, [
|
|
2117
|
+
e("span", Ml, n(y(l).title || "Untitled"), 1),
|
|
2118
|
+
e("span", Ll, [
|
|
2119
|
+
K(n(re.value) + " ", 1),
|
|
2120
|
+
y(l).lineCount ? (a(), s(R, { key: 0 }, [
|
|
2121
|
+
K(" • " + n(y(l).lineCount) + " lines ", 1)
|
|
2122
|
+
], 64)) : d("", !0)
|
|
2101
2123
|
])
|
|
2102
2124
|
])
|
|
2103
2125
|
]),
|
|
2104
|
-
e("div",
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2126
|
+
e("div", Tl, [
|
|
2127
|
+
!y(l).tabs || y(l).tabs.includes("preview") ? (a(), s("button", {
|
|
2128
|
+
key: 0,
|
|
2129
|
+
class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(k).viewMode === "preview" }]),
|
|
2130
|
+
disabled: !y(l).isPreviewable,
|
|
2108
2131
|
title: "Preview",
|
|
2109
|
-
onClick: t[2] || (t[2] = (
|
|
2110
|
-
}, [...t[
|
|
2132
|
+
onClick: t[2] || (t[2] = (w) => y(o)("preview"))
|
|
2133
|
+
}, [...t[25] || (t[25] = [
|
|
2111
2134
|
e("svg", {
|
|
2112
2135
|
viewBox: "0 0 24 24",
|
|
2113
2136
|
fill: "none",
|
|
@@ -2121,12 +2144,13 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2121
2144
|
r: "3"
|
|
2122
2145
|
})
|
|
2123
2146
|
], -1)
|
|
2124
|
-
])], 10,
|
|
2125
|
-
|
|
2126
|
-
|
|
2147
|
+
])], 10, Al)) : d("", !0),
|
|
2148
|
+
!y(l).tabs || y(l).tabs.includes("code") ? (a(), s("button", {
|
|
2149
|
+
key: 1,
|
|
2150
|
+
class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(k).viewMode === "code" }]),
|
|
2127
2151
|
title: "Code",
|
|
2128
|
-
onClick: t[3] || (t[3] = (
|
|
2129
|
-
}, [...t[
|
|
2152
|
+
onClick: t[3] || (t[3] = (w) => y(o)("code"))
|
|
2153
|
+
}, [...t[26] || (t[26] = [
|
|
2130
2154
|
e("svg", {
|
|
2131
2155
|
viewBox: "0 0 24 24",
|
|
2132
2156
|
fill: "none",
|
|
@@ -2136,13 +2160,14 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2136
2160
|
e("polyline", { points: "16 18 22 12 16 6" }),
|
|
2137
2161
|
e("polyline", { points: "8 6 2 12 8 18" })
|
|
2138
2162
|
], -1)
|
|
2139
|
-
])], 2),
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2163
|
+
])], 2)) : d("", !0),
|
|
2164
|
+
!y(l).tabs || y(l).tabs.includes("split") ? (a(), s("button", {
|
|
2165
|
+
key: 2,
|
|
2166
|
+
class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(k).viewMode === "split" }]),
|
|
2167
|
+
disabled: !y(l).isPreviewable,
|
|
2143
2168
|
title: "Split view",
|
|
2144
|
-
onClick: t[4] || (t[4] = (
|
|
2145
|
-
}, [...t[
|
|
2169
|
+
onClick: t[4] || (t[4] = (w) => y(o)("split"))
|
|
2170
|
+
}, [...t[27] || (t[27] = [
|
|
2146
2171
|
e("svg", {
|
|
2147
2172
|
viewBox: "0 0 24 24",
|
|
2148
2173
|
fill: "none",
|
|
@@ -2164,15 +2189,48 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2164
2189
|
y2: "21"
|
|
2165
2190
|
})
|
|
2166
2191
|
], -1)
|
|
2167
|
-
])], 10,
|
|
2192
|
+
])], 10, Hl)) : d("", !0),
|
|
2193
|
+
y(l).tabs && y(l).tabs.includes("edit") && x.value ? (a(), s("button", {
|
|
2194
|
+
key: 3,
|
|
2195
|
+
class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(k).viewMode === "edit" }]),
|
|
2196
|
+
title: "Edit",
|
|
2197
|
+
onClick: t[5] || (t[5] = (w) => y(o)("edit"))
|
|
2198
|
+
}, [...t[28] || (t[28] = [
|
|
2199
|
+
e("svg", {
|
|
2200
|
+
viewBox: "0 0 24 24",
|
|
2201
|
+
fill: "none",
|
|
2202
|
+
stroke: "currentColor",
|
|
2203
|
+
"stroke-width": "2"
|
|
2204
|
+
}, [
|
|
2205
|
+
e("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
|
|
2206
|
+
e("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
|
|
2207
|
+
], -1)
|
|
2208
|
+
])], 2)) : d("", !0)
|
|
2168
2209
|
]),
|
|
2169
|
-
e("div",
|
|
2210
|
+
e("div", Pl, [
|
|
2211
|
+
y(k).viewMode === "edit" ? (a(), s("button", {
|
|
2212
|
+
key: 0,
|
|
2213
|
+
class: "artifactuse-panel__action artifactuse-panel__action--save",
|
|
2214
|
+
title: "Save",
|
|
2215
|
+
onClick: dt
|
|
2216
|
+
}, [...t[29] || (t[29] = [
|
|
2217
|
+
e("svg", {
|
|
2218
|
+
viewBox: "0 0 24 24",
|
|
2219
|
+
fill: "none",
|
|
2220
|
+
stroke: "currentColor",
|
|
2221
|
+
"stroke-width": "2"
|
|
2222
|
+
}, [
|
|
2223
|
+
e("path", { d: "M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" }),
|
|
2224
|
+
e("polyline", { points: "17 21 17 13 7 13 7 21" }),
|
|
2225
|
+
e("polyline", { points: "7 3 7 8 15 8" })
|
|
2226
|
+
], -1)
|
|
2227
|
+
])])) : d("", !0),
|
|
2170
2228
|
e("button", {
|
|
2171
2229
|
class: "artifactuse-panel__action",
|
|
2172
|
-
title:
|
|
2173
|
-
onClick: t[
|
|
2230
|
+
title: y(k).isFullscreen ? "Exit fullscreen" : "Fullscreen",
|
|
2231
|
+
onClick: t[6] || (t[6] = (...w) => y(g) && y(g)(...w))
|
|
2174
2232
|
}, [
|
|
2175
|
-
|
|
2233
|
+
y(k).isFullscreen ? (a(), s("svg", Sl, [...t[31] || (t[31] = [
|
|
2176
2234
|
e("polyline", { points: "4 14 10 14 10 20" }, null, -1),
|
|
2177
2235
|
e("polyline", { points: "20 10 14 10 14 4" }, null, -1),
|
|
2178
2236
|
e("line", {
|
|
@@ -2187,7 +2245,7 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2187
2245
|
x2: "10",
|
|
2188
2246
|
y2: "14"
|
|
2189
2247
|
}, null, -1)
|
|
2190
|
-
])])) : (a(), s("svg",
|
|
2248
|
+
])])) : (a(), s("svg", El, [...t[30] || (t[30] = [
|
|
2191
2249
|
e("polyline", { points: "15 3 21 3 21 9" }, null, -1),
|
|
2192
2250
|
e("polyline", { points: "9 21 3 21 3 15" }, null, -1),
|
|
2193
2251
|
e("line", {
|
|
@@ -2203,12 +2261,12 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2203
2261
|
y2: "14"
|
|
2204
2262
|
}, null, -1)
|
|
2205
2263
|
])]))
|
|
2206
|
-
], 8,
|
|
2264
|
+
], 8, Bl),
|
|
2207
2265
|
e("button", {
|
|
2208
2266
|
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2209
2267
|
title: "Close panel",
|
|
2210
|
-
onClick: t[
|
|
2211
|
-
}, [...t[
|
|
2268
|
+
onClick: t[7] || (t[7] = (...w) => y(A) && y(A)(...w))
|
|
2269
|
+
}, [...t[32] || (t[32] = [
|
|
2212
2270
|
e("svg", {
|
|
2213
2271
|
viewBox: "0 0 24 24",
|
|
2214
2272
|
fill: "none",
|
|
@@ -2233,35 +2291,35 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2233
2291
|
]),
|
|
2234
2292
|
e("div", {
|
|
2235
2293
|
ref_key: "contentRef",
|
|
2236
|
-
ref:
|
|
2237
|
-
class:
|
|
2238
|
-
`artifactuse-panel__content--${
|
|
2239
|
-
{ "artifactuse-panel__content--transitioning":
|
|
2294
|
+
ref: J,
|
|
2295
|
+
class: N(["artifactuse-panel__content", [
|
|
2296
|
+
`artifactuse-panel__content--${y(k).viewMode}`,
|
|
2297
|
+
{ "artifactuse-panel__content--transitioning": oe.value }
|
|
2240
2298
|
]])
|
|
2241
2299
|
}, [
|
|
2242
|
-
|
|
2300
|
+
oe.value ? (a(), s("div", zl, [...t[33] || (t[33] = [
|
|
2243
2301
|
e("div", { class: "artifactuse-panel__spinner" }, null, -1)
|
|
2244
|
-
])])) :
|
|
2245
|
-
|
|
2302
|
+
])])) : d("", !0),
|
|
2303
|
+
y(k).viewMode === "preview" || y(k).viewMode === "split" ? (a(), s("div", {
|
|
2246
2304
|
key: 1,
|
|
2247
2305
|
class: "artifactuse-panel__preview",
|
|
2248
|
-
style:
|
|
2306
|
+
style: $e(y(k).viewMode === "split" ? { width: `${D.value}%` } : void 0)
|
|
2249
2307
|
}, [
|
|
2250
|
-
Z.value &&
|
|
2308
|
+
Z.value && G.value ? (a(), s("div", Il, [...t[34] || (t[34] = [
|
|
2251
2309
|
e("div", { class: "artifactuse-panel__spinner" }, null, -1)
|
|
2252
|
-
])])) :
|
|
2253
|
-
|
|
2310
|
+
])])) : d("", !0),
|
|
2311
|
+
G.value ? (a(), s("iframe", {
|
|
2254
2312
|
key: 1,
|
|
2255
2313
|
ref_key: "iframeRef",
|
|
2256
|
-
ref:
|
|
2257
|
-
src:
|
|
2258
|
-
class:
|
|
2314
|
+
ref: q,
|
|
2315
|
+
src: G.value,
|
|
2316
|
+
class: N(["artifactuse-panel__iframe", { "artifactuse-panel__iframe--loading": Z.value }]),
|
|
2259
2317
|
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation",
|
|
2260
2318
|
allow: "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write",
|
|
2261
|
-
onLoad:
|
|
2262
|
-
onError:
|
|
2263
|
-
}, null, 42,
|
|
2264
|
-
t[
|
|
2319
|
+
onLoad: vt,
|
|
2320
|
+
onError: ft
|
|
2321
|
+
}, null, 42, Fl)) : (a(), s("div", Vl, [
|
|
2322
|
+
t[35] || (t[35] = e("svg", {
|
|
2265
2323
|
viewBox: "0 0 24 24",
|
|
2266
2324
|
fill: "none",
|
|
2267
2325
|
stroke: "currentColor",
|
|
@@ -2276,49 +2334,58 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2276
2334
|
y2: "12"
|
|
2277
2335
|
})
|
|
2278
2336
|
], -1)),
|
|
2279
|
-
e("p", null, "Preview not available for " +
|
|
2337
|
+
e("p", null, "Preview not available for " + n(re.value), 1)
|
|
2280
2338
|
]))
|
|
2281
|
-
], 4)) :
|
|
2282
|
-
|
|
2339
|
+
], 4)) : d("", !0),
|
|
2340
|
+
Qe(e("div", {
|
|
2283
2341
|
class: "artifactuse-panel__code",
|
|
2284
|
-
style:
|
|
2342
|
+
style: $e(y(k).viewMode === "split" ? { width: `${100 - D.value}%` } : void 0)
|
|
2285
2343
|
}, [
|
|
2286
|
-
|
|
2344
|
+
y(k).viewMode === "split" ? (a(), s("div", {
|
|
2287
2345
|
key: 0,
|
|
2288
2346
|
class: "artifactuse-panel__split-handle",
|
|
2289
|
-
onMousedown:
|
|
2290
|
-
}, [...t[
|
|
2347
|
+
onMousedown: he(Ht, ["prevent"])
|
|
2348
|
+
}, [...t[36] || (t[36] = [
|
|
2291
2349
|
e("div", { class: "artifactuse-panel__split-handle-line" }, null, -1)
|
|
2292
|
-
])], 32)) :
|
|
2350
|
+
])], 32)) : d("", !0),
|
|
2293
2351
|
e("div", {
|
|
2294
2352
|
class: "artifactuse-panel__code-scroll",
|
|
2295
2353
|
ref_key: "codeScrollRef",
|
|
2296
2354
|
ref: ee,
|
|
2297
|
-
onScroll:
|
|
2355
|
+
onScroll: $t
|
|
2298
2356
|
}, [
|
|
2299
2357
|
e("div", {
|
|
2300
2358
|
class: "artifactuse-panel__line-numbers",
|
|
2301
2359
|
ref_key: "lineNumbersRef",
|
|
2302
|
-
ref:
|
|
2360
|
+
ref: F
|
|
2303
2361
|
}, null, 512),
|
|
2304
2362
|
e("pre", {
|
|
2305
|
-
class:
|
|
2363
|
+
class: N(["artifactuse-panel__code-block", `language-${v.value}`])
|
|
2306
2364
|
}, [
|
|
2307
2365
|
(a(), s("code", {
|
|
2308
2366
|
ref_key: "codeRef",
|
|
2309
|
-
ref:
|
|
2310
|
-
key:
|
|
2311
|
-
class:
|
|
2367
|
+
ref: O,
|
|
2368
|
+
key: y(l).id,
|
|
2369
|
+
class: N(`language-${v.value}`)
|
|
2312
2370
|
}, null, 2))
|
|
2313
2371
|
], 2)
|
|
2314
2372
|
], 544)
|
|
2315
2373
|
], 4), [
|
|
2316
|
-
[
|
|
2374
|
+
[Ge, y(k).viewMode === "code" || y(k).viewMode === "split"]
|
|
2375
|
+
]),
|
|
2376
|
+
Qe(e("div", Rl, [
|
|
2377
|
+
e("div", {
|
|
2378
|
+
ref_key: "editorContainerRef",
|
|
2379
|
+
ref: I,
|
|
2380
|
+
class: "artifactuse-panel__editor-container"
|
|
2381
|
+
}, null, 512)
|
|
2382
|
+
], 512), [
|
|
2383
|
+
[Ge, y(k).viewMode === "edit"]
|
|
2317
2384
|
])
|
|
2318
2385
|
], 2),
|
|
2319
|
-
e("footer",
|
|
2320
|
-
e("div",
|
|
2321
|
-
|
|
2386
|
+
e("footer", ql, [
|
|
2387
|
+
e("div", Ol, [
|
|
2388
|
+
se.value ? (a(), s("a", Ul, [...t[37] || (t[37] = [
|
|
2322
2389
|
e("svg", {
|
|
2323
2390
|
width: "16",
|
|
2324
2391
|
height: "16",
|
|
@@ -2336,18 +2403,18 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2336
2403
|
})
|
|
2337
2404
|
], -1),
|
|
2338
2405
|
e("span", null, "Artifactuse", -1)
|
|
2339
|
-
])])) :
|
|
2340
|
-
|
|
2406
|
+
])])) : d("", !0),
|
|
2407
|
+
y(l).size ? (a(), s("span", Dl, n(y(tt)(y(l).size)), 1)) : d("", !0)
|
|
2341
2408
|
]),
|
|
2342
|
-
e("div",
|
|
2409
|
+
e("div", jl, [
|
|
2343
2410
|
e("button", {
|
|
2344
|
-
class:
|
|
2345
|
-
title:
|
|
2346
|
-
onClick:
|
|
2411
|
+
class: N(["artifactuse-panel__footer-action", { "artifactuse-panel__footer-action--success": te.value }]),
|
|
2412
|
+
title: te.value ? "Copied!" : "Copy code",
|
|
2413
|
+
onClick: _t
|
|
2347
2414
|
}, [
|
|
2348
|
-
|
|
2415
|
+
te.value ? (a(), s("svg", Xl, [...t[39] || (t[39] = [
|
|
2349
2416
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
2350
|
-
])])) : (a(), s("svg",
|
|
2417
|
+
])])) : (a(), s("svg", Jl, [...t[38] || (t[38] = [
|
|
2351
2418
|
e("rect", {
|
|
2352
2419
|
x: "9",
|
|
2353
2420
|
y: "9",
|
|
@@ -2358,12 +2425,12 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2358
2425
|
}, null, -1),
|
|
2359
2426
|
e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
|
|
2360
2427
|
])]))
|
|
2361
|
-
], 10,
|
|
2428
|
+
], 10, Nl),
|
|
2362
2429
|
e("button", {
|
|
2363
2430
|
class: "artifactuse-panel__footer-action",
|
|
2364
2431
|
title: "Download file",
|
|
2365
|
-
onClick:
|
|
2366
|
-
}, [...t[
|
|
2432
|
+
onClick: ht
|
|
2433
|
+
}, [...t[40] || (t[40] = [
|
|
2367
2434
|
e("svg", {
|
|
2368
2435
|
viewBox: "0 0 24 24",
|
|
2369
2436
|
fill: "none",
|
|
@@ -2380,12 +2447,12 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2380
2447
|
})
|
|
2381
2448
|
], -1)
|
|
2382
2449
|
])]),
|
|
2383
|
-
|
|
2450
|
+
Ce.value ? (a(), s("div", Zl, [
|
|
2384
2451
|
e("button", {
|
|
2385
2452
|
class: "artifactuse-panel__footer-action",
|
|
2386
2453
|
title: "Share",
|
|
2387
|
-
onClick:
|
|
2388
|
-
}, [...t[
|
|
2454
|
+
onClick: yt
|
|
2455
|
+
}, [...t[41] || (t[41] = [
|
|
2389
2456
|
e("svg", {
|
|
2390
2457
|
viewBox: "0 0 24 24",
|
|
2391
2458
|
fill: "none",
|
|
@@ -2421,15 +2488,15 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2421
2488
|
})
|
|
2422
2489
|
], -1)
|
|
2423
2490
|
])]),
|
|
2424
|
-
Ae(
|
|
2425
|
-
default:
|
|
2426
|
-
|
|
2427
|
-
e("div",
|
|
2428
|
-
e("span",
|
|
2491
|
+
Ae(Me, { name: "artifactuse-popup" }, {
|
|
2492
|
+
default: Le(() => [
|
|
2493
|
+
ae.value ? (a(), s("div", Wl, [
|
|
2494
|
+
e("div", Kl, [
|
|
2495
|
+
e("span", Yl, n(L.value === "success" ? P.value ? "Artifact updated!" : "Link created!" : L.value === "update-list" ? "Update saved artifact" : "Share Artifact"), 1),
|
|
2429
2496
|
e("button", {
|
|
2430
2497
|
class: "artifactuse-share-popup__close",
|
|
2431
|
-
onClick:
|
|
2432
|
-
}, [...t[
|
|
2498
|
+
onClick: gt
|
|
2499
|
+
}, [...t[42] || (t[42] = [
|
|
2433
2500
|
e("svg", {
|
|
2434
2501
|
viewBox: "0 0 24 24",
|
|
2435
2502
|
fill: "none",
|
|
@@ -2451,29 +2518,29 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2451
2518
|
], -1)
|
|
2452
2519
|
])])
|
|
2453
2520
|
]),
|
|
2454
|
-
e("div",
|
|
2455
|
-
|
|
2521
|
+
e("div", Ql, [
|
|
2522
|
+
L.value === "loading" ? (a(), s("div", Gl, [...t[43] || (t[43] = [
|
|
2456
2523
|
e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
|
|
2457
2524
|
e("p", { class: "artifactuse-share-popup__loading-text" }, "Creating link...", -1)
|
|
2458
|
-
])])) :
|
|
2459
|
-
e("div",
|
|
2460
|
-
e("p",
|
|
2525
|
+
])])) : L.value === "error" ? (a(), s("div", en, [
|
|
2526
|
+
e("div", tn, [
|
|
2527
|
+
e("p", an, n(_.value), 1)
|
|
2461
2528
|
]),
|
|
2462
|
-
e("div",
|
|
2529
|
+
e("div", sn, [
|
|
2463
2530
|
e("button", {
|
|
2464
2531
|
class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--secondary",
|
|
2465
|
-
onClick: t[
|
|
2532
|
+
onClick: t[8] || (t[8] = (w) => L.value = "options")
|
|
2466
2533
|
}, " Back "),
|
|
2467
2534
|
e("button", {
|
|
2468
2535
|
class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--primary",
|
|
2469
|
-
onClick:
|
|
2536
|
+
onClick: kt
|
|
2470
2537
|
}, " Retry ")
|
|
2471
2538
|
])
|
|
2472
|
-
])) :
|
|
2539
|
+
])) : L.value === "options" ? (a(), s("div", ln, [
|
|
2473
2540
|
e("button", {
|
|
2474
2541
|
class: "artifactuse-share-popup__option",
|
|
2475
|
-
onClick:
|
|
2476
|
-
}, [...t[
|
|
2542
|
+
onClick: Je
|
|
2543
|
+
}, [...t[44] || (t[44] = [
|
|
2477
2544
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2478
2545
|
e("svg", {
|
|
2479
2546
|
viewBox: "0 0 24 24",
|
|
@@ -2492,8 +2559,8 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2492
2559
|
])]),
|
|
2493
2560
|
e("button", {
|
|
2494
2561
|
class: "artifactuse-share-popup__option",
|
|
2495
|
-
onClick:
|
|
2496
|
-
}, [...t[
|
|
2562
|
+
onClick: Xe
|
|
2563
|
+
}, [...t[45] || (t[45] = [
|
|
2497
2564
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2498
2565
|
e("svg", {
|
|
2499
2566
|
viewBox: "0 0 24 24",
|
|
@@ -2513,8 +2580,8 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2513
2580
|
])]),
|
|
2514
2581
|
e("button", {
|
|
2515
2582
|
class: "artifactuse-share-popup__option",
|
|
2516
|
-
onClick:
|
|
2517
|
-
}, [...t[
|
|
2583
|
+
onClick: wt
|
|
2584
|
+
}, [...t[46] || (t[46] = [
|
|
2518
2585
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2519
2586
|
e("svg", {
|
|
2520
2587
|
viewBox: "0 0 24 24",
|
|
@@ -2532,29 +2599,29 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2532
2599
|
e("p", { class: "artifactuse-share-popup__option-desc" }, "Replace an existing artifact")
|
|
2533
2600
|
], -1)
|
|
2534
2601
|
])])
|
|
2535
|
-
])) :
|
|
2536
|
-
|
|
2602
|
+
])) : L.value === "update-list" ? (a(), s("div", nn, [
|
|
2603
|
+
c.value ? (a(), s("div", on, [...t[47] || (t[47] = [
|
|
2537
2604
|
e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
|
|
2538
2605
|
e("p", { class: "artifactuse-share-popup__loading-text" }, "Loading artifacts...", -1)
|
|
2539
|
-
])])) :
|
|
2540
|
-
(a(!0), s(
|
|
2541
|
-
var
|
|
2606
|
+
])])) : E.value.length === 0 ? (a(), s("div", rn, " No saved artifacts of this type ")) : (a(), s("div", cn, [
|
|
2607
|
+
(a(!0), s(R, null, ue(E.value, (w) => {
|
|
2608
|
+
var j, ie, me;
|
|
2542
2609
|
return a(), s("button", {
|
|
2543
|
-
key: ((
|
|
2610
|
+
key: ((j = w.project) == null ? void 0 : j.uuid) || w.id,
|
|
2544
2611
|
class: "artifactuse-share-popup__artifact-item",
|
|
2545
|
-
onClick: (
|
|
2612
|
+
onClick: (pe) => Ct(w)
|
|
2546
2613
|
}, [
|
|
2547
|
-
e("span",
|
|
2548
|
-
e("span",
|
|
2549
|
-
], 8,
|
|
2614
|
+
e("span", dn, n(((ie = w.project) == null ? void 0 : ie.name) || "Untitled"), 1),
|
|
2615
|
+
e("span", vn, n(Ne((me = w.project) == null ? void 0 : me.created_at)), 1)
|
|
2616
|
+
], 8, un);
|
|
2550
2617
|
}), 128))
|
|
2551
2618
|
])),
|
|
2552
2619
|
e("button", {
|
|
2553
2620
|
class: "artifactuse-share-popup__back-btn",
|
|
2554
|
-
onClick: t[
|
|
2621
|
+
onClick: t[9] || (t[9] = (w) => L.value = "options")
|
|
2555
2622
|
}, "Back")
|
|
2556
|
-
])) :
|
|
2557
|
-
t[
|
|
2623
|
+
])) : L.value === "success" ? (a(), s("div", fn, [
|
|
2624
|
+
t[50] || (t[50] = e("div", { class: "artifactuse-share-popup__success-icon" }, [
|
|
2558
2625
|
e("svg", {
|
|
2559
2626
|
viewBox: "0 0 24 24",
|
|
2560
2627
|
fill: "none",
|
|
@@ -2564,21 +2631,21 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2564
2631
|
e("polyline", { points: "20 6 9 17 4 12" })
|
|
2565
2632
|
])
|
|
2566
2633
|
], -1)),
|
|
2567
|
-
e("div",
|
|
2634
|
+
e("div", pn, [
|
|
2568
2635
|
e("input", {
|
|
2569
2636
|
type: "text",
|
|
2570
2637
|
class: "artifactuse-share-popup__link",
|
|
2571
|
-
value:
|
|
2638
|
+
value: Y.value,
|
|
2572
2639
|
readonly: "",
|
|
2573
|
-
onClick: t[
|
|
2574
|
-
}, null, 8,
|
|
2640
|
+
onClick: t[10] || (t[10] = (w) => w.target.select())
|
|
2641
|
+
}, null, 8, _n),
|
|
2575
2642
|
e("button", {
|
|
2576
|
-
class:
|
|
2577
|
-
onClick:
|
|
2578
|
-
},
|
|
2643
|
+
class: N(["artifactuse-share-popup__copy-btn", { "artifactuse-share-popup__copy-btn--copied": T.value }]),
|
|
2644
|
+
onClick: bt
|
|
2645
|
+
}, n(T.value ? "Copied!" : "Copy"), 3)
|
|
2579
2646
|
]),
|
|
2580
|
-
|
|
2581
|
-
t[
|
|
2647
|
+
Q.value && !r.value ? (a(), s("div", hn, [
|
|
2648
|
+
t[48] || (t[48] = e("span", { class: "artifactuse-share-popup__expiry-icon" }, [
|
|
2582
2649
|
e("svg", {
|
|
2583
2650
|
viewBox: "0 0 24 24",
|
|
2584
2651
|
fill: "none",
|
|
@@ -2604,18 +2671,18 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2604
2671
|
})
|
|
2605
2672
|
])
|
|
2606
2673
|
], -1)),
|
|
2607
|
-
e("span",
|
|
2608
|
-
])) :
|
|
2609
|
-
|
|
2610
|
-
t[
|
|
2674
|
+
e("span", mn, " Expires " + n(Ne(Q.value)), 1)
|
|
2675
|
+
])) : d("", !0),
|
|
2676
|
+
r.value ? d("", !0) : (a(), s("div", yn, [
|
|
2677
|
+
t[49] || (t[49] = e("p", { class: "artifactuse-share-popup__save-prompt-text" }, "Keep it permanently?", -1)),
|
|
2611
2678
|
e("button", {
|
|
2612
2679
|
class: "artifactuse-share-popup__save-prompt-btn",
|
|
2613
|
-
onClick:
|
|
2680
|
+
onClick: Xe
|
|
2614
2681
|
}, " Save to account ")
|
|
2615
2682
|
]))
|
|
2616
|
-
])) :
|
|
2683
|
+
])) : d("", !0)
|
|
2617
2684
|
]),
|
|
2618
|
-
t[
|
|
2685
|
+
t[51] || (t[51] = e("div", { class: "artifactuse-share-popup__footer" }, [
|
|
2619
2686
|
e("a", {
|
|
2620
2687
|
href: "https://artifactuse.com",
|
|
2621
2688
|
target: "_blank",
|
|
@@ -2641,17 +2708,17 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2641
2708
|
e("span", null, "Powered by Artifactuse")
|
|
2642
2709
|
])
|
|
2643
2710
|
], -1))
|
|
2644
|
-
])) :
|
|
2711
|
+
])) : d("", !0)
|
|
2645
2712
|
]),
|
|
2646
2713
|
_: 1
|
|
2647
2714
|
})
|
|
2648
|
-
])) :
|
|
2649
|
-
|
|
2715
|
+
])) : d("", !0),
|
|
2716
|
+
G.value ? (a(), s("button", {
|
|
2650
2717
|
key: 1,
|
|
2651
2718
|
class: "artifactuse-panel__footer-action",
|
|
2652
2719
|
title: "Open in new tab",
|
|
2653
|
-
onClick:
|
|
2654
|
-
}, [...t[
|
|
2720
|
+
onClick: xt
|
|
2721
|
+
}, [...t[52] || (t[52] = [
|
|
2655
2722
|
e("svg", {
|
|
2656
2723
|
viewBox: "0 0 24 24",
|
|
2657
2724
|
fill: "none",
|
|
@@ -2667,14 +2734,14 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2667
2734
|
y2: "3"
|
|
2668
2735
|
})
|
|
2669
2736
|
], -1)
|
|
2670
|
-
])])) :
|
|
2671
|
-
|
|
2737
|
+
])])) : d("", !0),
|
|
2738
|
+
B.value.length > 1 ? (a(), s("div", gn, [
|
|
2672
2739
|
e("button", {
|
|
2673
2740
|
class: "artifactuse-panel__nav-btn",
|
|
2674
|
-
disabled:
|
|
2741
|
+
disabled: W.value <= 0,
|
|
2675
2742
|
title: "Previous artifact",
|
|
2676
|
-
onClick:
|
|
2677
|
-
}, [...t[
|
|
2743
|
+
onClick: Lt
|
|
2744
|
+
}, [...t[53] || (t[53] = [
|
|
2678
2745
|
e("svg", {
|
|
2679
2746
|
viewBox: "0 0 24 24",
|
|
2680
2747
|
fill: "none",
|
|
@@ -2683,14 +2750,14 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2683
2750
|
}, [
|
|
2684
2751
|
e("polyline", { points: "15 18 9 12 15 6" })
|
|
2685
2752
|
], -1)
|
|
2686
|
-
])], 8,
|
|
2753
|
+
])], 8, kn),
|
|
2687
2754
|
e("button", {
|
|
2688
2755
|
class: "artifactuse-panel__nav-trigger",
|
|
2689
2756
|
title: "View all artifacts",
|
|
2690
|
-
onClick:
|
|
2757
|
+
onClick: Mt
|
|
2691
2758
|
}, [
|
|
2692
|
-
e("span", null,
|
|
2693
|
-
t[
|
|
2759
|
+
e("span", null, n(W.value + 1) + " / " + n(B.value.length), 1),
|
|
2760
|
+
t[54] || (t[54] = e("svg", {
|
|
2694
2761
|
viewBox: "0 0 24 24",
|
|
2695
2762
|
fill: "none",
|
|
2696
2763
|
stroke: "currentColor",
|
|
@@ -2701,10 +2768,10 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2701
2768
|
]),
|
|
2702
2769
|
e("button", {
|
|
2703
2770
|
class: "artifactuse-panel__nav-btn",
|
|
2704
|
-
disabled:
|
|
2771
|
+
disabled: W.value >= B.value.length - 1,
|
|
2705
2772
|
title: "Next artifact",
|
|
2706
|
-
onClick:
|
|
2707
|
-
}, [...t[
|
|
2773
|
+
onClick: Tt
|
|
2774
|
+
}, [...t[55] || (t[55] = [
|
|
2708
2775
|
e("svg", {
|
|
2709
2776
|
viewBox: "0 0 24 24",
|
|
2710
2777
|
fill: "none",
|
|
@@ -2713,16 +2780,16 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2713
2780
|
}, [
|
|
2714
2781
|
e("polyline", { points: "9 18 15 12 9 6" })
|
|
2715
2782
|
], -1)
|
|
2716
|
-
])], 8,
|
|
2717
|
-
Ae(
|
|
2718
|
-
default:
|
|
2719
|
-
|
|
2720
|
-
e("div",
|
|
2721
|
-
t[
|
|
2783
|
+
])], 8, wn),
|
|
2784
|
+
Ae(Me, { name: "artifactuse-popup" }, {
|
|
2785
|
+
default: Le(() => [
|
|
2786
|
+
X.value ? (a(), s("div", Cn, [
|
|
2787
|
+
e("div", bn, [
|
|
2788
|
+
t[57] || (t[57] = e("span", null, "Artifacts", -1)),
|
|
2722
2789
|
e("button", {
|
|
2723
2790
|
class: "artifactuse-panel__artifact-list-close",
|
|
2724
|
-
onClick: t[
|
|
2725
|
-
}, [...t[
|
|
2791
|
+
onClick: t[11] || (t[11] = (w) => X.value = !1)
|
|
2792
|
+
}, [...t[56] || (t[56] = [
|
|
2726
2793
|
e("svg", {
|
|
2727
2794
|
viewBox: "0 0 24 24",
|
|
2728
2795
|
fill: "none",
|
|
@@ -2744,39 +2811,39 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2744
2811
|
], -1)
|
|
2745
2812
|
])])
|
|
2746
2813
|
]),
|
|
2747
|
-
e("div",
|
|
2748
|
-
(a(!0), s(
|
|
2749
|
-
key:
|
|
2750
|
-
class:
|
|
2751
|
-
onClick: (
|
|
2814
|
+
e("div", xn, [
|
|
2815
|
+
(a(!0), s(R, null, ue(B.value, (w, j) => (a(), s("button", {
|
|
2816
|
+
key: w.id,
|
|
2817
|
+
class: N(["artifactuse-panel__artifact-item", { "artifactuse-panel__artifact-item--active": w.id === y(l).id }]),
|
|
2818
|
+
onClick: (ie) => Ze(w)
|
|
2752
2819
|
}, [
|
|
2753
2820
|
e("span", {
|
|
2754
2821
|
class: "artifactuse-panel__artifact-item-icon",
|
|
2755
|
-
innerHTML:
|
|
2756
|
-
}, null, 8,
|
|
2757
|
-
e("div",
|
|
2758
|
-
e("span",
|
|
2759
|
-
e("span",
|
|
2760
|
-
K(
|
|
2761
|
-
|
|
2762
|
-
K(" • " +
|
|
2763
|
-
], 64)) :
|
|
2822
|
+
innerHTML: De(w.language)
|
|
2823
|
+
}, null, 8, Mn),
|
|
2824
|
+
e("div", Ln, [
|
|
2825
|
+
e("span", Tn, n(w.title || "Untitled"), 1),
|
|
2826
|
+
e("span", An, [
|
|
2827
|
+
K(n(y(Te)(w.language)) + " ", 1),
|
|
2828
|
+
w.lineCount ? (a(), s(R, { key: 0 }, [
|
|
2829
|
+
K(" • " + n(w.lineCount) + " lines ", 1)
|
|
2830
|
+
], 64)) : d("", !0)
|
|
2764
2831
|
])
|
|
2765
2832
|
]),
|
|
2766
|
-
e("span",
|
|
2767
|
-
], 10,
|
|
2833
|
+
e("span", Hn, n(j + 1), 1)
|
|
2834
|
+
], 10, $n))), 128))
|
|
2768
2835
|
])
|
|
2769
|
-
])) :
|
|
2836
|
+
])) : d("", !0)
|
|
2770
2837
|
]),
|
|
2771
2838
|
_: 1
|
|
2772
2839
|
})
|
|
2773
|
-
])) :
|
|
2840
|
+
])) : d("", !0)
|
|
2774
2841
|
])
|
|
2775
2842
|
])
|
|
2776
|
-
], 64)) : (a(), s(
|
|
2777
|
-
e("header",
|
|
2778
|
-
e("div",
|
|
2779
|
-
t[
|
|
2843
|
+
], 64)) : (a(), s(R, { key: 2 }, [
|
|
2844
|
+
e("header", ll, [
|
|
2845
|
+
e("div", nl, [
|
|
2846
|
+
t[18] || (t[18] = e("span", { class: "artifactuse-panel__icon" }, [
|
|
2780
2847
|
e("svg", {
|
|
2781
2848
|
viewBox: "0 0 24 24",
|
|
2782
2849
|
fill: "none",
|
|
@@ -2787,19 +2854,19 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2787
2854
|
e("polyline", { points: "8 6 2 12 8 18" })
|
|
2788
2855
|
])
|
|
2789
2856
|
], -1)),
|
|
2790
|
-
e("div",
|
|
2791
|
-
t[
|
|
2792
|
-
e("span",
|
|
2857
|
+
e("div", ol, [
|
|
2858
|
+
t[17] || (t[17] = e("span", { class: "artifactuse-panel__name" }, "Artifacts", -1)),
|
|
2859
|
+
e("span", rl, n(B.value.length) + " available", 1)
|
|
2793
2860
|
])
|
|
2794
2861
|
]),
|
|
2795
|
-
e("div",
|
|
2862
|
+
e("div", cl, [
|
|
2796
2863
|
e("button", {
|
|
2797
|
-
class:
|
|
2798
|
-
disabled:
|
|
2864
|
+
class: N(["artifactuse-panel__action", { "artifactuse-panel__action--loading": p.value }]),
|
|
2865
|
+
disabled: p.value,
|
|
2799
2866
|
title: "Download all as ZIP",
|
|
2800
|
-
onClick:
|
|
2867
|
+
onClick: mt
|
|
2801
2868
|
}, [
|
|
2802
|
-
|
|
2869
|
+
p.value ? (a(), s("svg", vl, [...t[20] || (t[20] = [
|
|
2803
2870
|
e("circle", {
|
|
2804
2871
|
cx: "12",
|
|
2805
2872
|
cy: "12",
|
|
@@ -2807,7 +2874,7 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2807
2874
|
"stroke-dasharray": "32",
|
|
2808
2875
|
"stroke-dashoffset": "32"
|
|
2809
2876
|
}, null, -1)
|
|
2810
|
-
])])) : (a(), s("svg",
|
|
2877
|
+
])])) : (a(), s("svg", dl, [...t[19] || (t[19] = [
|
|
2811
2878
|
e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }, null, -1),
|
|
2812
2879
|
e("polyline", { points: "7 10 12 15 17 10" }, null, -1),
|
|
2813
2880
|
e("line", {
|
|
@@ -2817,12 +2884,12 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2817
2884
|
y2: "3"
|
|
2818
2885
|
}, null, -1)
|
|
2819
2886
|
])]))
|
|
2820
|
-
], 10,
|
|
2887
|
+
], 10, ul),
|
|
2821
2888
|
e("button", {
|
|
2822
2889
|
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2823
2890
|
title: "Close panel",
|
|
2824
|
-
onClick: t[1] || (t[1] = (...
|
|
2825
|
-
}, [...t[
|
|
2891
|
+
onClick: t[1] || (t[1] = (...w) => y(A) && y(A)(...w))
|
|
2892
|
+
}, [...t[21] || (t[21] = [
|
|
2826
2893
|
e("svg", {
|
|
2827
2894
|
viewBox: "0 0 24 24",
|
|
2828
2895
|
fill: "none",
|
|
@@ -2845,27 +2912,27 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2845
2912
|
])])
|
|
2846
2913
|
])
|
|
2847
2914
|
]),
|
|
2848
|
-
e("div",
|
|
2849
|
-
e("div",
|
|
2850
|
-
(a(!0), s(
|
|
2851
|
-
key:
|
|
2915
|
+
e("div", fl, [
|
|
2916
|
+
e("div", pl, [
|
|
2917
|
+
(a(!0), s(R, null, ue(B.value, (w, j) => (a(), s("button", {
|
|
2918
|
+
key: w.id,
|
|
2852
2919
|
class: "artifactuse-panel__list-item",
|
|
2853
|
-
onClick: (
|
|
2920
|
+
onClick: (ie) => Ze(w)
|
|
2854
2921
|
}, [
|
|
2855
2922
|
e("span", {
|
|
2856
2923
|
class: "artifactuse-panel__list-item-icon",
|
|
2857
|
-
innerHTML:
|
|
2858
|
-
}, null, 8,
|
|
2859
|
-
e("div",
|
|
2860
|
-
e("span",
|
|
2861
|
-
e("span",
|
|
2862
|
-
K(
|
|
2863
|
-
|
|
2864
|
-
K(" • " +
|
|
2865
|
-
], 64)) :
|
|
2924
|
+
innerHTML: De(w.language)
|
|
2925
|
+
}, null, 8, hl),
|
|
2926
|
+
e("div", ml, [
|
|
2927
|
+
e("span", yl, n(w.title || "Untitled"), 1),
|
|
2928
|
+
e("span", gl, [
|
|
2929
|
+
K(n(y(Te)(w.language)) + " ", 1),
|
|
2930
|
+
w.lineCount ? (a(), s(R, { key: 0 }, [
|
|
2931
|
+
K(" • " + n(w.lineCount) + " lines ", 1)
|
|
2932
|
+
], 64)) : d("", !0)
|
|
2866
2933
|
])
|
|
2867
2934
|
]),
|
|
2868
|
-
t[
|
|
2935
|
+
t[22] || (t[22] = e("span", { class: "artifactuse-panel__list-item-arrow" }, [
|
|
2869
2936
|
e("svg", {
|
|
2870
2937
|
viewBox: "0 0 24 24",
|
|
2871
2938
|
fill: "none",
|
|
@@ -2875,11 +2942,11 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2875
2942
|
e("polyline", { points: "9 18 15 12 9 6" })
|
|
2876
2943
|
])
|
|
2877
2944
|
], -1))
|
|
2878
|
-
], 8,
|
|
2945
|
+
], 8, _l))), 128))
|
|
2879
2946
|
])
|
|
2880
2947
|
]),
|
|
2881
|
-
e("footer",
|
|
2882
|
-
|
|
2948
|
+
e("footer", kl, [
|
|
2949
|
+
se.value ? (a(), s("a", wl, [...t[23] || (t[23] = [
|
|
2883
2950
|
e("svg", {
|
|
2884
2951
|
width: "16",
|
|
2885
2952
|
height: "16",
|
|
@@ -2897,11 +2964,11 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2897
2964
|
})
|
|
2898
2965
|
], -1),
|
|
2899
2966
|
e("span", null, "Artifactuse", -1)
|
|
2900
|
-
])])) :
|
|
2967
|
+
])])) : d("", !0)
|
|
2901
2968
|
])
|
|
2902
|
-
], 64)) : (a(), s(
|
|
2903
|
-
e("header",
|
|
2904
|
-
t[
|
|
2969
|
+
], 64)) : (a(), s(R, { key: 1 }, [
|
|
2970
|
+
e("header", tl, [
|
|
2971
|
+
t[14] || (t[14] = e("div", { class: "artifactuse-panel__title" }, [
|
|
2905
2972
|
e("span", { class: "artifactuse-panel__icon" }, [
|
|
2906
2973
|
e("svg", {
|
|
2907
2974
|
viewBox: "0 0 24 24",
|
|
@@ -2917,12 +2984,12 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2917
2984
|
e("span", { class: "artifactuse-panel__name" }, "Artifacts")
|
|
2918
2985
|
])
|
|
2919
2986
|
], -1)),
|
|
2920
|
-
e("div",
|
|
2987
|
+
e("div", al, [
|
|
2921
2988
|
e("button", {
|
|
2922
2989
|
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2923
2990
|
title: "Close panel",
|
|
2924
|
-
onClick: t[0] || (t[0] = (...
|
|
2925
|
-
}, [...t[
|
|
2991
|
+
onClick: t[0] || (t[0] = (...w) => y(A) && y(A)(...w))
|
|
2992
|
+
}, [...t[13] || (t[13] = [
|
|
2926
2993
|
e("svg", {
|
|
2927
2994
|
viewBox: "0 0 24 24",
|
|
2928
2995
|
fill: "none",
|
|
@@ -2945,7 +3012,7 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2945
3012
|
])])
|
|
2946
3013
|
])
|
|
2947
3014
|
]),
|
|
2948
|
-
t[
|
|
3015
|
+
t[16] || (t[16] = e("div", { class: "artifactuse-panel__empty" }, [
|
|
2949
3016
|
e("div", { class: "artifactuse-panel__empty-icon" }, [
|
|
2950
3017
|
e("svg", {
|
|
2951
3018
|
viewBox: "0 0 24 24",
|
|
@@ -2960,8 +3027,8 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2960
3027
|
e("h3", { class: "artifactuse-panel__empty-title" }, "No artifacts yet"),
|
|
2961
3028
|
e("p", { class: "artifactuse-panel__empty-text" }, " Code blocks, forms, and other interactive content will appear here as the AI generates them. ")
|
|
2962
3029
|
], -1)),
|
|
2963
|
-
e("footer",
|
|
2964
|
-
|
|
3030
|
+
e("footer", sl, [
|
|
3031
|
+
se.value ? (a(), s("a", il, [...t[15] || (t[15] = [
|
|
2965
3032
|
e("svg", {
|
|
2966
3033
|
width: "16",
|
|
2967
3034
|
height: "16",
|
|
@@ -2979,30 +3046,30 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
2979
3046
|
})
|
|
2980
3047
|
], -1),
|
|
2981
3048
|
e("span", null, "Artifactuse", -1)
|
|
2982
|
-
])])) :
|
|
3049
|
+
])])) : d("", !0)
|
|
2983
3050
|
])
|
|
2984
3051
|
], 64))
|
|
2985
|
-
], 6)) :
|
|
3052
|
+
], 6)) : d("", !0)
|
|
2986
3053
|
]),
|
|
2987
3054
|
_: 1
|
|
2988
3055
|
}));
|
|
2989
3056
|
}
|
|
2990
|
-
},
|
|
3057
|
+
}, Pn = ["title"], Bn = {
|
|
2991
3058
|
key: 0,
|
|
2992
3059
|
class: "artifactuse-panel-toggle-badge"
|
|
2993
|
-
},
|
|
3060
|
+
}, Rn = {
|
|
2994
3061
|
__name: "ArtifactusePanelToggle",
|
|
2995
3062
|
setup(H) {
|
|
2996
|
-
const { state:
|
|
2997
|
-
return (
|
|
2998
|
-
class:
|
|
2999
|
-
"artifactuse-panel-toggle--active":
|
|
3000
|
-
"artifactuse-panel-toggle--has-artifacts":
|
|
3063
|
+
const { state: u, artifactCount: h, hasArtifacts: k, togglePanel: l } = He();
|
|
3064
|
+
return (U, S) => (a(), s("button", {
|
|
3065
|
+
class: N(["artifactuse-panel-toggle", {
|
|
3066
|
+
"artifactuse-panel-toggle--active": y(u).isPanelOpen,
|
|
3067
|
+
"artifactuse-panel-toggle--has-artifacts": y(k)
|
|
3001
3068
|
}]),
|
|
3002
|
-
onClick:
|
|
3003
|
-
title:
|
|
3069
|
+
onClick: S[0] || (S[0] = (...A) => y(l) && y(l)(...A)),
|
|
3070
|
+
title: y(u).isPanelOpen ? "Close artifacts panel" : "Open artifacts panel"
|
|
3004
3071
|
}, [
|
|
3005
|
-
|
|
3072
|
+
S[1] || (S[1] = e("svg", {
|
|
3006
3073
|
viewBox: "0 0 24 24",
|
|
3007
3074
|
fill: "none",
|
|
3008
3075
|
stroke: "currentColor",
|
|
@@ -3013,142 +3080,146 @@ const It = { class: "artifactuse-card__icon" }, Vt = ["innerHTML"], Ft = { class
|
|
|
3013
3080
|
e("polyline", { points: "16 18 22 12 16 6" }),
|
|
3014
3081
|
e("polyline", { points: "8 6 2 12 8 18" })
|
|
3015
3082
|
], -1)),
|
|
3016
|
-
|
|
3017
|
-
], 10,
|
|
3083
|
+
y(h) > 0 ? (a(), s("span", Bn, n(y(h) > 99 ? "99+" : y(h)), 1)) : d("", !0)
|
|
3084
|
+
], 10, Pn));
|
|
3018
3085
|
}
|
|
3019
|
-
},
|
|
3020
|
-
function
|
|
3021
|
-
var
|
|
3022
|
-
const
|
|
3086
|
+
}, st = Symbol("artifactuse");
|
|
3087
|
+
function it(H = {}) {
|
|
3088
|
+
var o;
|
|
3089
|
+
const u = at(H), h = et({
|
|
3023
3090
|
artifacts: [],
|
|
3024
3091
|
activeArtifactId: null,
|
|
3025
3092
|
isPanelOpen: !1,
|
|
3026
3093
|
viewMode: "preview",
|
|
3027
3094
|
isFullscreen: !1
|
|
3028
3095
|
});
|
|
3029
|
-
|
|
3030
|
-
|
|
3096
|
+
u.state.subscribe((m) => {
|
|
3097
|
+
h.artifacts = m.artifacts, h.activeArtifactId = m.activeArtifactId, h.isPanelOpen = m.isPanelOpen, h.viewMode = m.viewMode, h.isFullscreen = m.isFullscreen;
|
|
3031
3098
|
});
|
|
3032
|
-
const
|
|
3033
|
-
if (
|
|
3034
|
-
const
|
|
3035
|
-
|
|
3036
|
-
|
|
3099
|
+
const k = b(() => h.activeArtifactId && h.artifacts.find((m) => m.id === h.activeArtifactId) || null), l = b(() => h.artifacts.filter((m) => !m.isInline).length), U = b(() => h.artifacts.some((m) => !m.isInline)), S = b(() => u.getPanelTypes()), A = b(() => k.value ? u.getPanelUrl(k.value) : null);
|
|
3100
|
+
if (u.applyTheme(), H.theme === "auto" || !H.theme) {
|
|
3101
|
+
const m = ((o = u.bridge) == null ? void 0 : o.theme) || u.theme;
|
|
3102
|
+
m != null && m.watchSystemTheme && m.watchSystemTheme(() => {
|
|
3103
|
+
u.applyTheme();
|
|
3037
3104
|
});
|
|
3038
3105
|
}
|
|
3039
|
-
const
|
|
3040
|
-
instance:
|
|
3041
|
-
state:
|
|
3042
|
-
activeArtifact:
|
|
3043
|
-
artifactCount:
|
|
3044
|
-
hasArtifacts:
|
|
3106
|
+
const g = {
|
|
3107
|
+
instance: u,
|
|
3108
|
+
state: h,
|
|
3109
|
+
activeArtifact: k,
|
|
3110
|
+
artifactCount: l,
|
|
3111
|
+
hasArtifacts: U,
|
|
3045
3112
|
// Panel computed
|
|
3046
|
-
panelTypes:
|
|
3113
|
+
panelTypes: S,
|
|
3047
3114
|
activePanelUrl: A,
|
|
3048
3115
|
// Methods
|
|
3049
|
-
processMessage:
|
|
3050
|
-
initializeContent:
|
|
3051
|
-
openArtifact:
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3116
|
+
processMessage: u.processMessage,
|
|
3117
|
+
initializeContent: u.initializeContent,
|
|
3118
|
+
openArtifact: u.openArtifact,
|
|
3119
|
+
openFile: u.openFile,
|
|
3120
|
+
openCode: u.openCode,
|
|
3121
|
+
closePanel: u.closePanel,
|
|
3122
|
+
togglePanel: u.togglePanel,
|
|
3123
|
+
toggleFullscreen: u.toggleFullscreen,
|
|
3124
|
+
setViewMode: u.setViewMode,
|
|
3125
|
+
getPanelUrl: u.getPanelUrl,
|
|
3126
|
+
sendToPanel: u.sendToPanel,
|
|
3058
3127
|
// Panel management
|
|
3059
|
-
hasPanel:
|
|
3060
|
-
registerPanel:
|
|
3061
|
-
unregisterPanel:
|
|
3062
|
-
getPanelTypes:
|
|
3128
|
+
hasPanel: u.hasPanel,
|
|
3129
|
+
registerPanel: u.registerPanel,
|
|
3130
|
+
unregisterPanel: u.unregisterPanel,
|
|
3131
|
+
getPanelTypes: u.getPanelTypes,
|
|
3063
3132
|
// Events
|
|
3064
|
-
on:
|
|
3065
|
-
off:
|
|
3133
|
+
on: u.on,
|
|
3134
|
+
off: u.off,
|
|
3066
3135
|
// State management
|
|
3067
|
-
clearArtifacts: () =>
|
|
3136
|
+
clearArtifacts: () => u.state.clear(),
|
|
3068
3137
|
// Theme - wrap setTheme to also apply
|
|
3069
|
-
applyTheme:
|
|
3070
|
-
setTheme: (
|
|
3071
|
-
|
|
3138
|
+
applyTheme: u.applyTheme,
|
|
3139
|
+
setTheme: (m) => {
|
|
3140
|
+
u.setTheme(m), u.applyTheme();
|
|
3072
3141
|
},
|
|
3073
|
-
getTheme:
|
|
3142
|
+
getTheme: u.getTheme
|
|
3074
3143
|
};
|
|
3075
|
-
return
|
|
3144
|
+
return It(st, g), g;
|
|
3076
3145
|
}
|
|
3077
3146
|
function He() {
|
|
3078
|
-
const H =
|
|
3079
|
-
return H || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."),
|
|
3147
|
+
const H = Ft(st);
|
|
3148
|
+
return H || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."), it());
|
|
3080
3149
|
}
|
|
3081
|
-
function
|
|
3082
|
-
const
|
|
3150
|
+
function En(H = {}) {
|
|
3151
|
+
const u = at(H), h = et({
|
|
3083
3152
|
artifacts: [],
|
|
3084
3153
|
activeArtifactId: null,
|
|
3085
3154
|
isPanelOpen: !1,
|
|
3086
3155
|
viewMode: "preview",
|
|
3087
3156
|
isFullscreen: !1
|
|
3088
3157
|
});
|
|
3089
|
-
let
|
|
3158
|
+
let k;
|
|
3090
3159
|
we(() => {
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
}),
|
|
3094
|
-
}),
|
|
3095
|
-
|
|
3160
|
+
k = u.state.subscribe((o) => {
|
|
3161
|
+
h.artifacts = o.artifacts, h.activeArtifactId = o.activeArtifactId, h.isPanelOpen = o.isPanelOpen, h.viewMode = o.viewMode, h.isFullscreen = o.isFullscreen;
|
|
3162
|
+
}), u.applyTheme();
|
|
3163
|
+
}), Oe(() => {
|
|
3164
|
+
k && k(), u.destroy();
|
|
3096
3165
|
});
|
|
3097
|
-
const
|
|
3166
|
+
const l = b(() => h.activeArtifactId && h.artifacts.find((o) => o.id === h.activeArtifactId) || null), U = b(() => h.artifacts.filter((o) => !o.isInline).length), S = b(() => h.artifacts.some((o) => !o.isInline)), A = b(() => u.getPanelTypes()), g = b(() => l.value ? u.getPanelUrl(l.value) : null);
|
|
3098
3167
|
return {
|
|
3099
|
-
instance:
|
|
3100
|
-
state:
|
|
3101
|
-
activeArtifact:
|
|
3102
|
-
artifactCount:
|
|
3103
|
-
hasArtifacts:
|
|
3168
|
+
instance: u,
|
|
3169
|
+
state: h,
|
|
3170
|
+
activeArtifact: l,
|
|
3171
|
+
artifactCount: U,
|
|
3172
|
+
hasArtifacts: S,
|
|
3104
3173
|
// Panel computed
|
|
3105
3174
|
panelTypes: A,
|
|
3106
|
-
activePanelUrl:
|
|
3175
|
+
activePanelUrl: g,
|
|
3107
3176
|
// Methods
|
|
3108
|
-
processMessage:
|
|
3109
|
-
initializeContent:
|
|
3110
|
-
openArtifact:
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3177
|
+
processMessage: u.processMessage,
|
|
3178
|
+
initializeContent: u.initializeContent,
|
|
3179
|
+
openArtifact: u.openArtifact,
|
|
3180
|
+
openFile: u.openFile,
|
|
3181
|
+
openCode: u.openCode,
|
|
3182
|
+
closePanel: u.closePanel,
|
|
3183
|
+
togglePanel: u.togglePanel,
|
|
3184
|
+
toggleFullscreen: u.toggleFullscreen,
|
|
3185
|
+
setViewMode: u.setViewMode,
|
|
3186
|
+
getPanelUrl: u.getPanelUrl,
|
|
3187
|
+
sendToPanel: u.sendToPanel,
|
|
3117
3188
|
// Panel management
|
|
3118
|
-
hasPanel:
|
|
3119
|
-
registerPanel:
|
|
3120
|
-
unregisterPanel:
|
|
3121
|
-
getPanelTypes:
|
|
3189
|
+
hasPanel: u.hasPanel,
|
|
3190
|
+
registerPanel: u.registerPanel,
|
|
3191
|
+
unregisterPanel: u.unregisterPanel,
|
|
3192
|
+
getPanelTypes: u.getPanelTypes,
|
|
3122
3193
|
// Events
|
|
3123
|
-
on:
|
|
3124
|
-
off:
|
|
3194
|
+
on: u.on,
|
|
3195
|
+
off: u.off,
|
|
3125
3196
|
// State management
|
|
3126
|
-
clearArtifacts: () =>
|
|
3197
|
+
clearArtifacts: () => u.state.clear(),
|
|
3127
3198
|
// Theme - wrap setTheme to also apply
|
|
3128
|
-
applyTheme:
|
|
3129
|
-
setTheme: (
|
|
3130
|
-
|
|
3199
|
+
applyTheme: u.applyTheme,
|
|
3200
|
+
setTheme: (o) => {
|
|
3201
|
+
u.setTheme(o), u.applyTheme();
|
|
3131
3202
|
},
|
|
3132
|
-
getTheme:
|
|
3203
|
+
getTheme: u.getTheme
|
|
3133
3204
|
};
|
|
3134
3205
|
}
|
|
3135
|
-
const
|
|
3136
|
-
provideArtifactuse:
|
|
3206
|
+
const qn = {
|
|
3207
|
+
provideArtifactuse: it,
|
|
3137
3208
|
useArtifactuse: He,
|
|
3138
|
-
createArtifactuseComposable:
|
|
3139
|
-
DEFAULT_PANELS:
|
|
3209
|
+
createArtifactuseComposable: En,
|
|
3210
|
+
DEFAULT_PANELS: qt
|
|
3140
3211
|
};
|
|
3141
3212
|
export {
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3213
|
+
Fn as ArtifactuseAgentMessage,
|
|
3214
|
+
Gt as ArtifactuseCard,
|
|
3215
|
+
Ua as ArtifactuseInlineForm,
|
|
3216
|
+
Vn as ArtifactusePanel,
|
|
3217
|
+
Rn as ArtifactusePanelToggle,
|
|
3218
|
+
Ni as ArtifactuseSocialPreview,
|
|
3219
|
+
Gi as ArtifactuseViewer,
|
|
3220
|
+
qt as DEFAULT_PANELS,
|
|
3221
|
+
En as createArtifactuseComposable,
|
|
3222
|
+
qn as default,
|
|
3223
|
+
it as provideArtifactuse,
|
|
3153
3224
|
He as useArtifactuse
|
|
3154
3225
|
};
|