@lightworkai.official/debug-capture-vue 0.6.0 → 0.7.0
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 +12 -8
- package/dist/components/{ToolbarButton.vue.d.ts → SupportPortalButton.vue.d.ts} +12 -7
- package/dist/index.d.ts +2 -8
- package/dist/index.mjs +762 -2319
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/SupportPortalButton.vue +50 -0
- package/src/index.ts +11 -16
- package/dist/components/ImageAnnotatorDialog.vue.d.ts +0 -19
- package/dist/components/MyTicketsPanel.vue.d.ts +0 -17
- package/dist/components/ReopenPanel.vue.d.ts +0 -12
- package/dist/components/RichReplyEditor.vue.d.ts +0 -59
- package/dist/components/StatusHero.vue.d.ts +0 -10
- package/dist/components/StatusPill.vue.d.ts +0 -16
- package/dist/components/TicketBody.vue.d.ts +0 -6
- package/dist/components/TicketConversation.vue.d.ts +0 -22
- package/dist/components/TicketDetail.vue.d.ts +0 -28
- package/dist/components/TicketScreenshots.vue.d.ts +0 -8
- package/dist/components/TicketTable.vue.d.ts +0 -25
- package/dist/components/TicketTimeline.vue.d.ts +0 -11
- package/dist/components/icons.d.ts +0 -38
- package/src/components/ImageAnnotatorDialog.vue +0 -160
- package/src/components/MyTicketsPanel.vue +0 -312
- package/src/components/ReopenPanel.vue +0 -47
- package/src/components/RichReplyEditor.vue +0 -321
- package/src/components/StatusHero.vue +0 -85
- package/src/components/StatusPill.vue +0 -14
- package/src/components/TicketBody.vue +0 -50
- package/src/components/TicketConversation.vue +0 -227
- package/src/components/TicketDetail.vue +0 -130
- package/src/components/TicketScreenshots.vue +0 -47
- package/src/components/TicketTable.vue +0 -142
- package/src/components/TicketTimeline.vue +0 -86
- package/src/components/ToolbarButton.vue +0 -33
- package/src/components/icons.ts +0 -90
package/dist/index.mjs
CHANGED
|
@@ -1,38 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return
|
|
19
|
-
}
|
|
20
|
-
function
|
|
21
|
-
let e = X().app;
|
|
22
|
-
return { name: e.name, version: e.version ?? "0.0.0", environment: e.environment ?? _n() };
|
|
23
|
-
}
|
|
24
|
-
function _n() {
|
|
1
|
+
var Mt = Object.defineProperty;
|
|
2
|
+
var Ct = (e, t, r) => t in e ? Mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var U = (e, t, r) => Ct(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { defineComponent as me, onMounted as zt, openBlock as ge, createElementBlock as ye, h as F, renderSlot as nt, createVNode as Lt, unref as Tt, ref as At, createTextVNode as Rt, toDisplayString as Dt } from "vue";
|
|
5
|
+
var Ht = { maxRequests: 60, maxConsoleEntries: 120, maxActions: 80, maxBodyChars: 2e4 }, b = null;
|
|
6
|
+
function Ut(e) {
|
|
7
|
+
b = e;
|
|
8
|
+
}
|
|
9
|
+
function H() {
|
|
10
|
+
if (!b) throw Error("[debug-capture] configureDebugCapture() has not been called");
|
|
11
|
+
return b;
|
|
12
|
+
}
|
|
13
|
+
function ot() {
|
|
14
|
+
return b !== null;
|
|
15
|
+
}
|
|
16
|
+
function W() {
|
|
17
|
+
let e = H().app;
|
|
18
|
+
return { name: e.name, version: e.version ?? "0.0.0", environment: e.environment ?? Nt() };
|
|
19
|
+
}
|
|
20
|
+
function Nt() {
|
|
25
21
|
if (typeof window > "u") return "unknown";
|
|
26
22
|
let e = window.location.hostname;
|
|
27
23
|
return e === "localhost" || e === "127.0.0.1" || e.endsWith(".local") ? "development" : "production";
|
|
28
24
|
}
|
|
29
|
-
function
|
|
30
|
-
var
|
|
31
|
-
let t = (
|
|
32
|
-
return typeof t == "number" ? t :
|
|
25
|
+
function K(e) {
|
|
26
|
+
var r;
|
|
27
|
+
let t = (r = b == null ? void 0 : b.capture) == null ? void 0 : r[e];
|
|
28
|
+
return typeof t == "number" ? t : Ht[e];
|
|
33
29
|
}
|
|
34
|
-
function
|
|
35
|
-
let t =
|
|
30
|
+
function Bt(e) {
|
|
31
|
+
let t = b == null ? void 0 : b.module;
|
|
36
32
|
if (!t) return null;
|
|
37
33
|
try {
|
|
38
34
|
return t(e) ?? null;
|
|
@@ -40,16 +36,16 @@ function Rn(e) {
|
|
|
40
36
|
return null;
|
|
41
37
|
}
|
|
42
38
|
}
|
|
43
|
-
function
|
|
44
|
-
let e =
|
|
39
|
+
function be() {
|
|
40
|
+
let e = b == null ? void 0 : b.redact;
|
|
45
41
|
return { headers: (e == null ? void 0 : e.headers) ?? [], queryKeys: ((e == null ? void 0 : e.queryKeys) ?? []).map((t) => t.toLowerCase()), bodyKeys: ((e == null ? void 0 : e.bodyKeys) ?? []).map((t) => t.toLowerCase()) };
|
|
46
42
|
}
|
|
47
|
-
function
|
|
43
|
+
function Pt() {
|
|
48
44
|
var e;
|
|
49
|
-
return ((e =
|
|
45
|
+
return ((e = b == null ? void 0 : b.capture) == null ? void 0 : e.overlaySelectors) ?? [];
|
|
50
46
|
}
|
|
51
|
-
function
|
|
52
|
-
var
|
|
47
|
+
function Qt(e) {
|
|
48
|
+
var r;
|
|
53
49
|
if (typeof window > "u") return !1;
|
|
54
50
|
let t;
|
|
55
51
|
try {
|
|
@@ -57,7 +53,7 @@ function zn(e) {
|
|
|
57
53
|
} catch {
|
|
58
54
|
return !1;
|
|
59
55
|
}
|
|
60
|
-
return
|
|
56
|
+
return It(t) ? !1 : t.origin === window.location.origin ? !0 : (((r = b == null ? void 0 : b.capture) == null ? void 0 : r.bodyOrigins) ?? []).some((n) => {
|
|
61
57
|
try {
|
|
62
58
|
return new URL(n).origin === t.origin;
|
|
63
59
|
} catch {
|
|
@@ -65,550 +61,550 @@ function zn(e) {
|
|
|
65
61
|
}
|
|
66
62
|
});
|
|
67
63
|
}
|
|
68
|
-
function
|
|
69
|
-
if (!(
|
|
64
|
+
function It(e) {
|
|
65
|
+
if (!(b != null && b.host)) return !1;
|
|
70
66
|
try {
|
|
71
|
-
if (new URL(
|
|
67
|
+
if (new URL(b.host).origin !== e.origin) return !1;
|
|
72
68
|
} catch {
|
|
73
69
|
return !1;
|
|
74
70
|
}
|
|
75
71
|
return e.pathname.startsWith("/ingest/");
|
|
76
72
|
}
|
|
77
|
-
var
|
|
78
|
-
function
|
|
79
|
-
return e.replace(
|
|
73
|
+
var _ = "‹redacted›", Ot = /^(authorization|proxy-authorization|cookie|set-cookie|x-[a-z-]*token|x-csrf[a-z-]*|x-xsrf[a-z-]*)$/i, qt = /* @__PURE__ */ new Set(["access_token", "token", "id_token", "refresh_token", "code", "secret", "client_secret", "password", "apikey", "api_key", "signature", "x-amz-signature", "x-amz-credential"]), Wt = /(password|passwd|token|secret|authorization|refresh|client_secret|otp|pin)/i, Jt = /[\w.+-]+@[\w-]+\.[\w.-]+/g, _t = /\d(?:[\d\s-]{7,})\d/g;
|
|
74
|
+
function oe(e) {
|
|
75
|
+
return e.replace(Jt, _).replace(_t, _);
|
|
80
76
|
}
|
|
81
|
-
function
|
|
82
|
-
return
|
|
77
|
+
function Kt(e) {
|
|
78
|
+
return Ot.test(e) ? !0 : be().headers.some((t) => t.toLowerCase() === e.toLowerCase());
|
|
83
79
|
}
|
|
84
|
-
function
|
|
80
|
+
function fe(e) {
|
|
85
81
|
let t = {};
|
|
86
|
-
for (let [
|
|
82
|
+
for (let [r, n] of Object.entries(e)) t[r] = Kt(r) ? _ : n;
|
|
87
83
|
return t;
|
|
88
84
|
}
|
|
89
|
-
function
|
|
85
|
+
function xe(e) {
|
|
90
86
|
try {
|
|
91
|
-
let t = /^https?:\/\//i.test(e),
|
|
92
|
-
return
|
|
93
|
-
(
|
|
94
|
-
}), n ? t ?
|
|
87
|
+
let t = /^https?:\/\//i.test(e), r = new URL(e, t ? void 0 : "http://local.invalid"), n = !1;
|
|
88
|
+
return r.searchParams.forEach((o, a) => {
|
|
89
|
+
(qt.has(a.toLowerCase()) || be().queryKeys.includes(a.toLowerCase())) && (r.searchParams.set(a, _), n = !0);
|
|
90
|
+
}), n ? t ? r.toString() : `${r.pathname}${r.search}` : e;
|
|
95
91
|
} catch {
|
|
96
92
|
return e;
|
|
97
93
|
}
|
|
98
94
|
}
|
|
99
|
-
function
|
|
95
|
+
function pe(e, t) {
|
|
100
96
|
if (t > 6 || e === null || typeof e != "object") return e;
|
|
101
|
-
if (Array.isArray(e)) return e.map((n) =>
|
|
102
|
-
let
|
|
103
|
-
for (let [n,
|
|
104
|
-
let a =
|
|
105
|
-
|
|
97
|
+
if (Array.isArray(e)) return e.map((n) => pe(n, t + 1));
|
|
98
|
+
let r = {};
|
|
99
|
+
for (let [n, o] of Object.entries(e)) {
|
|
100
|
+
let a = Wt.test(n) || be().bodyKeys.some((l) => n.toLowerCase().includes(l));
|
|
101
|
+
r[n] = a ? _ : pe(o, t + 1);
|
|
106
102
|
}
|
|
107
|
-
return
|
|
103
|
+
return r;
|
|
108
104
|
}
|
|
109
|
-
function
|
|
105
|
+
function ee(e, t) {
|
|
110
106
|
if (e == null) return null;
|
|
111
|
-
let
|
|
107
|
+
let r = e, n = e.trim();
|
|
112
108
|
if (n.startsWith("{") || n.startsWith("[")) try {
|
|
113
|
-
let
|
|
114
|
-
|
|
109
|
+
let o = JSON.parse(n);
|
|
110
|
+
r = JSON.stringify(pe(o, 0));
|
|
115
111
|
} catch {
|
|
116
112
|
}
|
|
117
|
-
return
|
|
113
|
+
return r.length > t ? `${r.slice(0, t)}… [truncated ${r.length - t} chars]` : r;
|
|
118
114
|
}
|
|
119
|
-
var
|
|
115
|
+
var he = 120, we = 40, P = (e, t) => e.length > t ? `${e.slice(0, t)}…` : e, ve = (e) => {
|
|
120
116
|
try {
|
|
121
117
|
return decodeURIComponent(e);
|
|
122
118
|
} catch {
|
|
123
119
|
return e;
|
|
124
120
|
}
|
|
125
|
-
},
|
|
126
|
-
function
|
|
127
|
-
let
|
|
121
|
+
}, B = [], De = 0, He = !1;
|
|
122
|
+
function q(e, t, r, n) {
|
|
123
|
+
let o = P(t, he), a = B[B.length - 1];
|
|
128
124
|
if (e === "navigate" && (a == null ? void 0 : a.kind) === "click") {
|
|
129
|
-
let
|
|
130
|
-
if (a.detail.includes(`→ ${
|
|
131
|
-
let
|
|
132
|
-
if (
|
|
125
|
+
let f = o.replace(/^ไปที่\s*/, "");
|
|
126
|
+
if (a.detail.includes(`→ ${f}`)) return a.at = (/* @__PURE__ */ new Date()).toISOString(), a;
|
|
127
|
+
let p = f.split(/[?#]/)[0] ?? f, m = a.source ? ve(a.source.replace(/^→\s*/, "")).split(/[?#]/)[0] : null;
|
|
128
|
+
if (m && (p === m || p.startsWith(m))) return a.detail = P(`${a.detail} → ${f}`, he), a.source = void 0, a.at = (/* @__PURE__ */ new Date()).toISOString(), a;
|
|
133
129
|
}
|
|
134
|
-
if (a && a.kind === e && a.detail ===
|
|
130
|
+
if (a && a.kind === e && a.detail === o)
|
|
135
131
|
return a.at = (/* @__PURE__ */ new Date()).toISOString(), e !== "navigate" && (a.count = (a.count ?? 1) + 1), a;
|
|
136
|
-
|
|
137
|
-
let l = { id: `act_${
|
|
138
|
-
for (
|
|
132
|
+
De += 1;
|
|
133
|
+
let l = { id: `act_${De}`, at: (/* @__PURE__ */ new Date()).toISOString(), kind: e, detail: o, count: 1, source: r, html: te(n) };
|
|
134
|
+
for (B.push(l); B.length > K("maxActions"); ) Yt(B.shift());
|
|
139
135
|
return l;
|
|
140
136
|
}
|
|
141
|
-
var
|
|
142
|
-
function
|
|
143
|
-
if (e && !(
|
|
144
|
-
return
|
|
137
|
+
var Vt = 2e5, J = 0;
|
|
138
|
+
function te(e) {
|
|
139
|
+
if (e && !(J + e.length > Vt))
|
|
140
|
+
return J += e.length, e;
|
|
145
141
|
}
|
|
146
|
-
function
|
|
147
|
-
var t,
|
|
148
|
-
e && (
|
|
142
|
+
function Yt(e) {
|
|
143
|
+
var t, r;
|
|
144
|
+
e && (J -= (((t = e.html) == null ? void 0 : t.length) ?? 0) + (((r = e.afterHtml) == null ? void 0 : r.length) ?? 0), J < 0 && (J = 0));
|
|
149
145
|
}
|
|
150
|
-
function
|
|
146
|
+
function G(e) {
|
|
151
147
|
return e instanceof Element && !!e.closest("[data-debug-reporter]");
|
|
152
148
|
}
|
|
153
|
-
var
|
|
154
|
-
function
|
|
149
|
+
var Ft = 'button, a[href], [role="button"], [role="tab"], [role="menuitem"], [role="option"], [role="switch"], [role="checkbox"], [role="radio"], [role="link"], summary, input, select, textarea', jt = { button: "ปุ่ม", a: "ลิงก์", input: "ช่อง", textarea: "ช่อง", select: "ตัวเลือก", summary: "ส่วนขยาย" }, Ue = { button: "ปุ่ม", tab: "แท็บ", menuitem: "เมนู", option: "ตัวเลือก", switch: "สวิตช์", checkbox: "ช่องเลือก", radio: "ตัวเลือก", link: "ลิงก์" };
|
|
150
|
+
function Xt(e) {
|
|
155
151
|
let t = e.getAttribute("role");
|
|
156
|
-
return t &&
|
|
152
|
+
return t && Ue[t] ? Ue[t] : jt[e.tagName.toLowerCase()] ?? "ปุ่ม";
|
|
157
153
|
}
|
|
158
|
-
function
|
|
159
|
-
var
|
|
154
|
+
function Gt(e, t) {
|
|
155
|
+
var r;
|
|
160
156
|
try {
|
|
161
|
-
let n = e,
|
|
162
|
-
for (; n &&
|
|
163
|
-
let a =
|
|
164
|
-
if (a && typeof ((
|
|
165
|
-
n = n.parentElement,
|
|
157
|
+
let n = e, o = 0;
|
|
158
|
+
for (; n && o <= t; ) {
|
|
159
|
+
let a = at(n);
|
|
160
|
+
if (a && typeof ((r = a.memoizedProps) == null ? void 0 : r.onClick) == "function") return n;
|
|
161
|
+
n = n.parentElement, o += 1;
|
|
166
162
|
}
|
|
167
163
|
} catch {
|
|
168
164
|
}
|
|
169
165
|
return null;
|
|
170
166
|
}
|
|
171
|
-
function
|
|
172
|
-
var
|
|
173
|
-
let t = (
|
|
167
|
+
function $t(e) {
|
|
168
|
+
var o, a;
|
|
169
|
+
let t = (o = e.getAttribute("aria-label")) == null ? void 0 : o.trim();
|
|
174
170
|
if (t) return t;
|
|
175
|
-
let
|
|
176
|
-
if (
|
|
171
|
+
let r = (a = e.getAttribute("title")) == null ? void 0 : a.trim();
|
|
172
|
+
if (r) return r;
|
|
177
173
|
if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) return (e.getAttribute("placeholder") || e.getAttribute("name") || "").trim();
|
|
178
174
|
if (e instanceof HTMLImageElement) return (e.getAttribute("alt") || "").trim();
|
|
179
175
|
let n = (e.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
180
176
|
if (n) return n;
|
|
181
177
|
if (e instanceof HTMLAnchorElement) {
|
|
182
178
|
let l = e.getAttribute("href");
|
|
183
|
-
if (l != null && l.startsWith("/")) return
|
|
179
|
+
if (l != null && l.startsWith("/")) return ve(l);
|
|
184
180
|
}
|
|
185
181
|
return "";
|
|
186
182
|
}
|
|
187
|
-
function
|
|
183
|
+
function Zt(e) {
|
|
188
184
|
if (!(e instanceof Element)) return null;
|
|
189
|
-
let t = e.closest(
|
|
185
|
+
let t = e.closest(Ft) ?? Gt(e, 4);
|
|
190
186
|
if (!t) return null;
|
|
191
|
-
let
|
|
192
|
-
return
|
|
187
|
+
let r = t.tagName.toLowerCase();
|
|
188
|
+
return r === "html" || r === "body" ? null : t;
|
|
193
189
|
}
|
|
194
|
-
function
|
|
195
|
-
let t =
|
|
196
|
-
return t ? `${
|
|
190
|
+
function er(e) {
|
|
191
|
+
let t = oe($t(e));
|
|
192
|
+
return t ? `${Xt(e)} “${P(t, we)}”` : null;
|
|
197
193
|
}
|
|
198
|
-
var
|
|
199
|
-
function
|
|
200
|
-
e.querySelectorAll("script, style, link, iframe, object, embed, noscript, canvas, video, audio").forEach((
|
|
194
|
+
var it = 6e3, tr = 4e3, rr = /(?:^|\s)!?(?:fixed|absolute|sticky|inset-\S+|z-\S+|top-\S+|bottom-\S+|left-\S+|right-\S+|w-screen|h-screen|min-h-screen|max-h-screen|translate-\S+|scale-\S+)(?=\s|$)/g;
|
|
195
|
+
function nr(e) {
|
|
196
|
+
e.querySelectorAll("script, style, link, iframe, object, embed, noscript, canvas, video, audio").forEach((o) => o.remove());
|
|
201
197
|
let t = [e, ...Array.from(e.querySelectorAll("*"))];
|
|
202
|
-
for (let
|
|
203
|
-
for (let l of Array.from(
|
|
204
|
-
let
|
|
205
|
-
(
|
|
198
|
+
for (let o of t) {
|
|
199
|
+
for (let l of Array.from(o.attributes)) {
|
|
200
|
+
let f = l.name.toLowerCase();
|
|
201
|
+
(f.startsWith("on") || f === "srcdoc" || f === "value" || f.startsWith("data-")) && o.removeAttribute(l.name);
|
|
206
202
|
}
|
|
207
|
-
|
|
208
|
-
let a =
|
|
203
|
+
o instanceof HTMLAnchorElement && o.setAttribute("href", "#"), o instanceof HTMLImageElement && o.removeAttribute("src");
|
|
204
|
+
let a = o.getAttribute("class");
|
|
209
205
|
if (a) {
|
|
210
|
-
let l = a.replace(
|
|
211
|
-
l ?
|
|
206
|
+
let l = a.replace(rr, " ").replace(/\s+/g, " ").trim();
|
|
207
|
+
l ? o.setAttribute("class", l) : o.removeAttribute("class");
|
|
212
208
|
}
|
|
213
209
|
}
|
|
214
|
-
let
|
|
210
|
+
let r = document.createTreeWalker(e, NodeFilter.SHOW_TEXT), n = r.nextNode();
|
|
215
211
|
for (; n; )
|
|
216
|
-
n.nodeValue && (n.nodeValue =
|
|
212
|
+
n.nodeValue && (n.nodeValue = oe(n.nodeValue)), n = r.nextNode();
|
|
217
213
|
}
|
|
218
|
-
function
|
|
214
|
+
function ke(e, t, r) {
|
|
219
215
|
try {
|
|
220
216
|
let n = e.outerHTML;
|
|
221
217
|
if (!n || n.length > t) return;
|
|
222
|
-
let
|
|
223
|
-
|
|
224
|
-
let a =
|
|
225
|
-
return a && a.length <=
|
|
218
|
+
let o = e.cloneNode(!0);
|
|
219
|
+
nr(o);
|
|
220
|
+
let a = o.outerHTML;
|
|
221
|
+
return a && a.length <= r ? a : void 0;
|
|
226
222
|
} catch {
|
|
227
223
|
return;
|
|
228
224
|
}
|
|
229
225
|
}
|
|
230
|
-
var
|
|
231
|
-
function
|
|
226
|
+
var or = (e) => ke(e, it, tr), ir = 15e4, ar = 4e4, Ne = (e) => ke(e, ir, ar);
|
|
227
|
+
function lr(e) {
|
|
232
228
|
if (!(e instanceof HTMLInputElement) && !(e instanceof HTMLTextAreaElement) && !(e instanceof HTMLSelectElement)) return null;
|
|
233
229
|
let t = e.name || e.id || e.getAttribute("aria-label") || e.getAttribute("placeholder") || e.tagName.toLowerCase();
|
|
234
|
-
return `ช่อง “${
|
|
230
|
+
return `ช่อง “${oe(t)}”`;
|
|
235
231
|
}
|
|
236
|
-
var
|
|
237
|
-
function
|
|
238
|
-
let t = Object.keys(e).find((
|
|
232
|
+
var Be = 80;
|
|
233
|
+
function at(e) {
|
|
234
|
+
let t = Object.keys(e).find((r) => r.startsWith("__reactFiber$") || r.startsWith("__reactInternalInstance$"));
|
|
239
235
|
return t ? e[t] : null;
|
|
240
236
|
}
|
|
241
|
-
function
|
|
237
|
+
function sr(e) {
|
|
242
238
|
var t;
|
|
243
239
|
if (typeof e != "function") return null;
|
|
244
240
|
try {
|
|
245
|
-
let
|
|
246
|
-
return ((t =
|
|
241
|
+
let r = Function.prototype.toString.call(e);
|
|
242
|
+
return ((t = r.match(/\.(?:push|replace)\(\s*['"`]([^'"`]+)['"`]/) ?? r.match(/redirect\(\s*['"`]([^'"`]+)['"`]/)) == null ? void 0 : t[1]) ?? null;
|
|
247
243
|
} catch {
|
|
248
244
|
return null;
|
|
249
245
|
}
|
|
250
246
|
}
|
|
251
|
-
function
|
|
247
|
+
function Pe(e) {
|
|
252
248
|
if (e)
|
|
253
|
-
return `→ ${e.length >
|
|
249
|
+
return `→ ${e.length > Be ? `${e.slice(0, Be)}…` : e}`;
|
|
254
250
|
}
|
|
255
|
-
function
|
|
256
|
-
var t,
|
|
251
|
+
function ur(e) {
|
|
252
|
+
var t, r;
|
|
257
253
|
try {
|
|
258
254
|
let n = (t = e.closest("a[href]")) == null ? void 0 : t.getAttribute("href");
|
|
259
|
-
if (n && n.startsWith("/")) return
|
|
260
|
-
let
|
|
261
|
-
for (;
|
|
262
|
-
if (typeof ((
|
|
263
|
-
|
|
255
|
+
if (n && n.startsWith("/")) return Pe(n);
|
|
256
|
+
let o = at(e), a = 0;
|
|
257
|
+
for (; o && a < 30; ) {
|
|
258
|
+
if (typeof ((r = o.memoizedProps) == null ? void 0 : r.onClick) == "function") return Pe(sr(o.memoizedProps.onClick));
|
|
259
|
+
o = o.return, a += 1;
|
|
264
260
|
}
|
|
265
261
|
return;
|
|
266
262
|
} catch {
|
|
267
263
|
return;
|
|
268
264
|
}
|
|
269
265
|
}
|
|
270
|
-
var
|
|
271
|
-
function
|
|
272
|
-
let e =
|
|
273
|
-
return e.length ? e.join(", ") :
|
|
266
|
+
var cr = '[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"], [role="status"], [role="alert"]';
|
|
267
|
+
function dr() {
|
|
268
|
+
let e = Pt();
|
|
269
|
+
return e.length ? e.join(", ") : cr;
|
|
274
270
|
}
|
|
275
|
-
function
|
|
271
|
+
function fr(e) {
|
|
276
272
|
let t = e.getAttribute("role");
|
|
277
273
|
return t === "status" || t === "alert" ? "ข้อความแจ้งเตือน" : t === "menu" ? "เมนู" : t === "listbox" ? "รายการตัวเลือก" : t === "alertdialog" ? "กล่องยืนยัน" : "กล่องโต้ตอบ";
|
|
278
274
|
}
|
|
279
|
-
function
|
|
280
|
-
var
|
|
281
|
-
let t = (
|
|
275
|
+
function pr(e) {
|
|
276
|
+
var o, a, l;
|
|
277
|
+
let t = (o = e.getAttribute("aria-label")) == null ? void 0 : o.trim();
|
|
282
278
|
if (t) return t;
|
|
283
|
-
let
|
|
284
|
-
if (
|
|
285
|
-
let
|
|
286
|
-
var
|
|
287
|
-
return ((
|
|
279
|
+
let r = e.getAttribute("aria-labelledby");
|
|
280
|
+
if (r) {
|
|
281
|
+
let f = r.split(/\s+/).map((p) => {
|
|
282
|
+
var m, x;
|
|
283
|
+
return ((x = (m = document.getElementById(p)) == null ? void 0 : m.textContent) == null ? void 0 : x.trim()) ?? "";
|
|
288
284
|
}).filter(Boolean).join(" ");
|
|
289
|
-
if (
|
|
285
|
+
if (f) return f;
|
|
290
286
|
}
|
|
291
287
|
let n = (l = (a = e.querySelector('[data-slot="dialog-title"], h1, h2, h3, [role="heading"]')) == null ? void 0 : a.textContent) == null ? void 0 : l.replace(/\s+/g, " ").trim();
|
|
292
288
|
return n || (e.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
293
289
|
}
|
|
294
|
-
function
|
|
295
|
-
let t =
|
|
296
|
-
return t ? `เปิด ${
|
|
290
|
+
function lt(e) {
|
|
291
|
+
let t = oe(pr(e)), r = fr(e);
|
|
292
|
+
return t ? `เปิด ${r} “${P(t, we)}”` : `เปิด ${r}`;
|
|
297
293
|
}
|
|
298
|
-
var
|
|
299
|
-
function
|
|
300
|
-
return e.querySelector(
|
|
294
|
+
var hr = '[aria-busy="true"], [role="progressbar"], [data-loading="true"], .animate-pulse, .animate-spin', mr = /กำลังโหลด|กำลังค้นหา|กำลังดำเนินการ|\bloading\b/i;
|
|
295
|
+
function gr(e) {
|
|
296
|
+
return e.querySelector(hr) ? !0 : mr.test(e.textContent ?? "");
|
|
301
297
|
}
|
|
302
|
-
var
|
|
303
|
-
function
|
|
298
|
+
var yr = 400, br = 250, xr = 8e3;
|
|
299
|
+
function wr(e, t) {
|
|
304
300
|
if (typeof MutationObserver > "u") {
|
|
305
|
-
t.html =
|
|
301
|
+
t.html = te(Ne(e));
|
|
306
302
|
return;
|
|
307
303
|
}
|
|
308
|
-
let
|
|
309
|
-
n = !0, l.disconnect(), window.clearInterval(
|
|
304
|
+
let r = Date.now(), n = !1, o = () => {
|
|
305
|
+
n = !0, l.disconnect(), window.clearInterval(f), window.clearTimeout(p);
|
|
310
306
|
}, a = () => {
|
|
311
|
-
n || (
|
|
307
|
+
n || (o(), e.isConnected && (t.detail = P(lt(e), he), t.html = te(Ne(e))));
|
|
312
308
|
}, l = new MutationObserver(() => {
|
|
313
|
-
|
|
309
|
+
r = Date.now();
|
|
314
310
|
});
|
|
315
311
|
l.observe(e, { childList: !0, subtree: !0, attributes: !0, characterData: !0 });
|
|
316
|
-
let
|
|
312
|
+
let f = window.setInterval(() => {
|
|
317
313
|
if (!n) {
|
|
318
314
|
if (!e.isConnected) {
|
|
319
|
-
|
|
315
|
+
o();
|
|
320
316
|
return;
|
|
321
317
|
}
|
|
322
|
-
Date.now() -
|
|
318
|
+
Date.now() - r >= yr && !gr(e) && a();
|
|
323
319
|
}
|
|
324
|
-
},
|
|
320
|
+
}, br), p = window.setTimeout(a, xr);
|
|
325
321
|
}
|
|
326
|
-
function
|
|
327
|
-
if (
|
|
328
|
-
let t =
|
|
329
|
-
t &&
|
|
322
|
+
function vr(e) {
|
|
323
|
+
if (G(e)) return;
|
|
324
|
+
let t = q("ui", lt(e));
|
|
325
|
+
t && wr(e, t);
|
|
330
326
|
}
|
|
331
|
-
function
|
|
327
|
+
function kr() {
|
|
332
328
|
if (typeof MutationObserver > "u") return;
|
|
333
329
|
let e = /* @__PURE__ */ new WeakSet();
|
|
334
330
|
new MutationObserver((t) => {
|
|
335
|
-
for (let
|
|
331
|
+
for (let r of t) for (let n of Array.from(r.addedNodes)) {
|
|
336
332
|
if (!(n instanceof Element)) continue;
|
|
337
|
-
let
|
|
333
|
+
let o = dr(), a = n.matches(o) ? [n] : Array.from(n.querySelectorAll(o));
|
|
338
334
|
for (let l of a)
|
|
339
|
-
e.has(l) || (e.add(l),
|
|
335
|
+
e.has(l) || (e.add(l), vr(l));
|
|
340
336
|
}
|
|
341
337
|
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
342
338
|
}
|
|
343
|
-
var
|
|
344
|
-
function
|
|
345
|
-
return { disabled: e.hasAttribute("disabled") || e.getAttribute("aria-disabled") === "true", busy: e.getAttribute("aria-busy") === "true", text:
|
|
339
|
+
var Sr = 1600, Er = 2500;
|
|
340
|
+
function Qe(e) {
|
|
341
|
+
return { disabled: e.hasAttribute("disabled") || e.getAttribute("aria-disabled") === "true", busy: e.getAttribute("aria-busy") === "true", text: P((e.textContent ?? "").replace(/\s+/g, " ").trim(), we) };
|
|
346
342
|
}
|
|
347
|
-
function
|
|
343
|
+
function Mr(e, t) {
|
|
348
344
|
return !e.disabled && t.disabled ? "ปุ่มถูกปิดใช้งานหลังคลิก" : !e.busy && t.busy ? "ปุ่มเข้าสู่สถานะกำลังโหลด" : e.text !== t.text && t.text ? `ข้อความเปลี่ยนเป็น “${t.text}”` : null;
|
|
349
345
|
}
|
|
350
|
-
function
|
|
346
|
+
function Cr(e, t) {
|
|
351
347
|
if (typeof MutationObserver > "u") return;
|
|
352
|
-
let
|
|
353
|
-
n || (n = !0, a.disconnect(), window.clearTimeout(l), t.afterNote =
|
|
348
|
+
let r = Qe(e), n = !1, o = (f, p) => {
|
|
349
|
+
n || (n = !0, a.disconnect(), window.clearTimeout(l), t.afterNote = f, p && (t.afterHtml = te(ke(e, it, Er))));
|
|
354
350
|
}, a = new MutationObserver(() => {
|
|
355
351
|
if (!e.isConnected) {
|
|
356
|
-
|
|
352
|
+
o("องค์ประกอบหายไปจากหน้าจอ", !1);
|
|
357
353
|
return;
|
|
358
354
|
}
|
|
359
|
-
let
|
|
360
|
-
|
|
355
|
+
let f = Mr(r, Qe(e));
|
|
356
|
+
f && o(f, !0);
|
|
361
357
|
});
|
|
362
358
|
a.observe(e, { attributes: !0, attributeFilter: ["disabled", "aria-disabled", "aria-busy", "class"], childList: !0, subtree: !0, characterData: !0 });
|
|
363
359
|
let l = window.setTimeout(() => {
|
|
364
360
|
if (!n && !e.isConnected) {
|
|
365
|
-
|
|
361
|
+
o("องค์ประกอบหายไปจากหน้าจอ", !1);
|
|
366
362
|
return;
|
|
367
363
|
}
|
|
368
364
|
n = !0, a.disconnect();
|
|
369
|
-
},
|
|
370
|
-
}
|
|
371
|
-
function
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
if (
|
|
375
|
-
let
|
|
376
|
-
if (!
|
|
377
|
-
let a =
|
|
365
|
+
}, Sr);
|
|
366
|
+
}
|
|
367
|
+
function zr() {
|
|
368
|
+
if (He || typeof window > "u") return;
|
|
369
|
+
He = !0, document.addEventListener("click", (n) => {
|
|
370
|
+
if (G(n.target)) return;
|
|
371
|
+
let o = Zt(n.target);
|
|
372
|
+
if (!o) return;
|
|
373
|
+
let a = er(o);
|
|
378
374
|
if (!a) return;
|
|
379
|
-
let l =
|
|
380
|
-
l &&
|
|
375
|
+
let l = q("click", `คลิก ${a}`, ur(o), or(o));
|
|
376
|
+
l && Cr(o, l);
|
|
381
377
|
}, { capture: !0, passive: !0 }), document.addEventListener("change", (n) => {
|
|
382
|
-
if (
|
|
383
|
-
let
|
|
384
|
-
|
|
378
|
+
if (G(n.target)) return;
|
|
379
|
+
let o = lr(n.target);
|
|
380
|
+
o && q("input", `แก้ไข ${o}`);
|
|
385
381
|
}, { capture: !0, passive: !0 }), document.addEventListener("submit", (n) => {
|
|
386
|
-
|
|
382
|
+
G(n.target) || q("submit", "ส่งฟอร์ม");
|
|
387
383
|
}, { capture: !0, passive: !0 });
|
|
388
|
-
let e = () =>
|
|
384
|
+
let e = () => q("navigate", `ไปที่ ${ve(xe(location.pathname + location.search))}`), t = history.pushState.bind(history), r = history.replaceState.bind(history);
|
|
389
385
|
history.pushState = (...n) => {
|
|
390
|
-
let
|
|
391
|
-
return e(),
|
|
386
|
+
let o = t(...n);
|
|
387
|
+
return e(), o;
|
|
392
388
|
}, history.replaceState = (...n) => {
|
|
393
|
-
let
|
|
394
|
-
return e(),
|
|
395
|
-
}, window.addEventListener("popstate", e),
|
|
389
|
+
let o = r(...n);
|
|
390
|
+
return e(), o;
|
|
391
|
+
}, window.addEventListener("popstate", e), kr();
|
|
396
392
|
}
|
|
397
|
-
function
|
|
398
|
-
return
|
|
393
|
+
function Lr() {
|
|
394
|
+
return B.map((e) => ({ ...e }));
|
|
399
395
|
}
|
|
400
|
-
var
|
|
401
|
-
function
|
|
402
|
-
for (
|
|
396
|
+
var Ie = 2e3, $ = [], Oe = 0, qe = !1;
|
|
397
|
+
function le(e, t) {
|
|
398
|
+
for (Oe += 1, $.push({ id: `log_${Oe}`, at: (/* @__PURE__ */ new Date()).toISOString(), level: e, message: t.length > Ie ? `${t.slice(0, Ie)}…` : t }); $.length > K("maxConsoleEntries"); ) $.shift();
|
|
403
399
|
}
|
|
404
|
-
function
|
|
400
|
+
function Tr() {
|
|
405
401
|
let e = /* @__PURE__ */ new WeakSet();
|
|
406
|
-
return (t,
|
|
407
|
-
if (typeof
|
|
408
|
-
if (e.has(
|
|
409
|
-
e.add(
|
|
402
|
+
return (t, r) => {
|
|
403
|
+
if (typeof r == "object" && r !== null) {
|
|
404
|
+
if (e.has(r)) return "[Circular]";
|
|
405
|
+
e.add(r);
|
|
410
406
|
}
|
|
411
|
-
return typeof
|
|
407
|
+
return typeof r == "bigint" ? r.toString() : r;
|
|
412
408
|
};
|
|
413
409
|
}
|
|
414
|
-
function
|
|
410
|
+
function We(e) {
|
|
415
411
|
if (typeof e == "string") return e;
|
|
416
412
|
if (e instanceof Error) return `${e.name}: ${e.message}`;
|
|
417
413
|
try {
|
|
418
|
-
return JSON.stringify(e,
|
|
414
|
+
return JSON.stringify(e, Tr()) ?? String(e);
|
|
419
415
|
} catch {
|
|
420
416
|
return String(e);
|
|
421
417
|
}
|
|
422
418
|
}
|
|
423
|
-
function
|
|
424
|
-
if (
|
|
425
|
-
|
|
419
|
+
function Ar() {
|
|
420
|
+
if (qe || typeof window > "u") return;
|
|
421
|
+
qe = !0;
|
|
426
422
|
let e = ["log", "info", "warn", "error", "debug"];
|
|
427
423
|
for (let t of e) {
|
|
428
|
-
let
|
|
424
|
+
let r = console[t].bind(console);
|
|
429
425
|
console[t] = (...n) => {
|
|
430
|
-
|
|
426
|
+
le(t, n.map(We).join(" ")), r(...n);
|
|
431
427
|
};
|
|
432
428
|
}
|
|
433
429
|
window.addEventListener("error", (t) => {
|
|
434
|
-
let
|
|
435
|
-
|
|
430
|
+
let r = t.filename ? ` (${t.filename}:${t.lineno}:${t.colno})` : "";
|
|
431
|
+
le("exception", `${t.message}${r}`);
|
|
436
432
|
}), window.addEventListener("unhandledrejection", (t) => {
|
|
437
|
-
let
|
|
438
|
-
|
|
433
|
+
let r = t.reason instanceof Error ? `${t.reason.name}: ${t.reason.message}` : We(t.reason);
|
|
434
|
+
le("unhandledrejection", r);
|
|
439
435
|
});
|
|
440
436
|
}
|
|
441
|
-
function
|
|
442
|
-
return
|
|
437
|
+
function Rr() {
|
|
438
|
+
return $.map((e) => ({ ...e }));
|
|
443
439
|
}
|
|
444
|
-
var
|
|
445
|
-
function
|
|
440
|
+
var st = /* @__PURE__ */ new Set(), ut = /* @__PURE__ */ new Set();
|
|
441
|
+
function ct(e, t) {
|
|
446
442
|
return e.add(t), () => e.delete(t);
|
|
447
443
|
}
|
|
448
|
-
function
|
|
449
|
-
for (let
|
|
444
|
+
function dt(e, t) {
|
|
445
|
+
for (let r of [...e]) r(t);
|
|
450
446
|
}
|
|
451
|
-
function
|
|
452
|
-
return
|
|
447
|
+
function Dr(e) {
|
|
448
|
+
return ct(st, e);
|
|
453
449
|
}
|
|
454
|
-
function
|
|
455
|
-
|
|
450
|
+
function ft(e = { type: "manual" }) {
|
|
451
|
+
dt(st, e);
|
|
456
452
|
}
|
|
457
|
-
function
|
|
458
|
-
return
|
|
453
|
+
function Hr(e) {
|
|
454
|
+
return ct(ut, e);
|
|
459
455
|
}
|
|
460
|
-
function
|
|
461
|
-
|
|
456
|
+
function Ur(e) {
|
|
457
|
+
dt(ut, e);
|
|
462
458
|
}
|
|
463
|
-
var
|
|
464
|
-
function
|
|
465
|
-
return
|
|
459
|
+
var Nr = 15e3, Br = ["ResizeObserver loop", "Script error.", "Non-Error promise rejection captured"], Je = !1, _e = 0;
|
|
460
|
+
function Pr(e) {
|
|
461
|
+
return Br.some((t) => e.includes(t));
|
|
466
462
|
}
|
|
467
|
-
function
|
|
463
|
+
function Ke(e) {
|
|
468
464
|
let t = e.message ?? "";
|
|
469
|
-
if (!t ||
|
|
470
|
-
let
|
|
471
|
-
|
|
465
|
+
if (!t || Pr(t)) return;
|
|
466
|
+
let r = Date.now();
|
|
467
|
+
r - _e < Nr || (_e = r, Ur({ ...e, message: t }));
|
|
472
468
|
}
|
|
473
|
-
function
|
|
474
|
-
|
|
469
|
+
function Qr() {
|
|
470
|
+
Je || typeof window > "u" || (Je = !0, window.addEventListener("error", (e) => {
|
|
475
471
|
if (!e.message && !e.error) return;
|
|
476
472
|
let t = e.error instanceof Error ? e.error : null;
|
|
477
|
-
|
|
473
|
+
Ke({ type: "runtime-error", message: e.message || (t ? t.message : "Unknown error"), stack: t == null ? void 0 : t.stack });
|
|
478
474
|
}), window.addEventListener("unhandledrejection", (e) => {
|
|
479
475
|
let t = e.reason;
|
|
480
|
-
|
|
476
|
+
Ke({ type: "unhandledrejection", message: t instanceof Error ? t.message : String(t), stack: t instanceof Error ? t.stack : void 0 });
|
|
481
477
|
}));
|
|
482
478
|
}
|
|
483
|
-
var
|
|
484
|
-
function
|
|
485
|
-
for (
|
|
479
|
+
var pt = 4e3, Ir = 1e6, Or = 1e7, Z = [], Ve = 0, Ye = !1;
|
|
480
|
+
function ht(e) {
|
|
481
|
+
for (Z.push(e); Z.length > K("maxRequests"); ) Z.shift();
|
|
486
482
|
}
|
|
487
|
-
function
|
|
488
|
-
return
|
|
483
|
+
function mt() {
|
|
484
|
+
return Ve += 1, `req_${Ve}`;
|
|
489
485
|
}
|
|
490
|
-
function
|
|
486
|
+
function Fe(e) {
|
|
491
487
|
let t = {};
|
|
492
488
|
if (!e) return t;
|
|
493
|
-
if (e instanceof Headers) e.forEach((
|
|
494
|
-
t[n] =
|
|
489
|
+
if (e instanceof Headers) e.forEach((r, n) => {
|
|
490
|
+
t[n] = r;
|
|
495
491
|
});
|
|
496
|
-
else if (Array.isArray(e)) for (let [
|
|
492
|
+
else if (Array.isArray(e)) for (let [r, n] of e) t[r] = n;
|
|
497
493
|
else Object.assign(t, e);
|
|
498
494
|
return t;
|
|
499
495
|
}
|
|
500
|
-
function
|
|
496
|
+
function qr(e) {
|
|
501
497
|
let t = {};
|
|
502
|
-
return e.forEach((
|
|
503
|
-
t[n] =
|
|
498
|
+
return e.forEach((r, n) => {
|
|
499
|
+
t[n] = r;
|
|
504
500
|
}), t;
|
|
505
501
|
}
|
|
506
|
-
function
|
|
502
|
+
function Wr(e) {
|
|
507
503
|
return e == null ? null : typeof e == "string" ? e : e instanceof URLSearchParams ? e.toString() : typeof FormData < "u" && e instanceof FormData ? `[FormData: ${Array.from(e.keys()).join(", ")}]` : typeof Blob < "u" && e instanceof Blob ? `[Blob ${e.size} bytes]` : e instanceof ArrayBuffer ? `[ArrayBuffer ${e.byteLength} bytes]` : "[binary]";
|
|
508
504
|
}
|
|
509
|
-
function
|
|
510
|
-
let
|
|
511
|
-
return typeof e == "string" ?
|
|
505
|
+
function Jr(e, t) {
|
|
506
|
+
let r = "", n = "GET", o = {}, a = null;
|
|
507
|
+
return typeof e == "string" ? r = e : e instanceof URL ? r = e.toString() : (r = e.url, n = e.method || n, o = Fe(e.headers)), t && (t.method && (n = t.method), t.headers && (o = { ...o, ...Fe(t.headers) }), t.body !== void 0 && (a = Wr(t.body))), { method: n.toUpperCase(), url: r, headers: o, body: a };
|
|
512
508
|
}
|
|
513
|
-
function
|
|
514
|
-
return !
|
|
509
|
+
function gt(e) {
|
|
510
|
+
return !Qt(e);
|
|
515
511
|
}
|
|
516
|
-
function
|
|
517
|
-
if (
|
|
512
|
+
function _r(e, t) {
|
|
513
|
+
if (gt(t.url)) {
|
|
518
514
|
t.responseSnippet = "[body not captured for this origin]";
|
|
519
515
|
return;
|
|
520
516
|
}
|
|
521
|
-
let
|
|
522
|
-
if (!/json|text|xml|html|javascript|urlencoded/i.test(
|
|
523
|
-
t.responseSnippet = `[binary ${
|
|
517
|
+
let r = e.headers.get("content-type") ?? "", n = Number(e.headers.get("content-length") ?? "0"), o = n ? `, ~${n} bytes` : "";
|
|
518
|
+
if (!/json|text|xml|html|javascript|urlencoded/i.test(r)) {
|
|
519
|
+
t.responseSnippet = `[binary ${r || "unknown"}${o}]`;
|
|
524
520
|
return;
|
|
525
521
|
}
|
|
526
|
-
if (n >
|
|
527
|
-
t.responseSnippet = `[response ${
|
|
522
|
+
if (n > Ir) {
|
|
523
|
+
t.responseSnippet = `[response ${r || "text"}${o} — omitted]`;
|
|
528
524
|
return;
|
|
529
525
|
}
|
|
530
526
|
try {
|
|
531
527
|
e.clone().text().then((a) => {
|
|
532
|
-
t.responseSnippet =
|
|
528
|
+
t.responseSnippet = ee(a, K("maxBodyChars"));
|
|
533
529
|
}).catch(() => {
|
|
534
530
|
});
|
|
535
531
|
} catch {
|
|
536
532
|
}
|
|
537
533
|
}
|
|
538
|
-
function
|
|
534
|
+
function yt(e, t) {
|
|
539
535
|
if (/[?&]_rsc=/.test(e)) return !0;
|
|
540
|
-
for (let
|
|
541
|
-
let n =
|
|
536
|
+
for (let r of Object.keys(t)) {
|
|
537
|
+
let n = r.toLowerCase();
|
|
542
538
|
if (n === "rsc" || n === "next-router-prefetch" || n === "next-router-state-tree") return !0;
|
|
543
539
|
}
|
|
544
540
|
return !1;
|
|
545
541
|
}
|
|
546
|
-
function
|
|
542
|
+
function Kr() {
|
|
547
543
|
if (typeof window > "u" || typeof window.fetch != "function") return;
|
|
548
544
|
let e = window.fetch.bind(window);
|
|
549
|
-
window.fetch = Object.assign(async (t,
|
|
550
|
-
let n =
|
|
551
|
-
if (
|
|
552
|
-
let
|
|
553
|
-
|
|
545
|
+
window.fetch = Object.assign(async (t, r) => {
|
|
546
|
+
let n = Jr(t, r);
|
|
547
|
+
if (yt(n.url, n.headers)) return e(t, r);
|
|
548
|
+
let o = { id: mt(), startedAt: (/* @__PURE__ */ new Date()).toISOString(), method: n.method, url: xe(n.url), requestHeaders: fe(n.headers), requestBody: ee(n.body, pt), status: null, statusText: null, durationMs: null, via: "fetch" };
|
|
549
|
+
ht(o);
|
|
554
550
|
let a = performance.now();
|
|
555
551
|
try {
|
|
556
|
-
let l = await e(t,
|
|
557
|
-
return
|
|
552
|
+
let l = await e(t, r);
|
|
553
|
+
return o.status = l.status, o.statusText = l.statusText, o.durationMs = Math.round(performance.now() - a), o.responseHeaders = fe(qr(l.headers)), _r(l, o), l;
|
|
558
554
|
} catch (l) {
|
|
559
|
-
throw
|
|
555
|
+
throw o.durationMs = Math.round(performance.now() - a), o.error = l instanceof Error ? `${l.name}: ${l.message}` : String(l), l;
|
|
560
556
|
}
|
|
561
557
|
}, e);
|
|
562
558
|
}
|
|
563
|
-
function
|
|
559
|
+
function Vr() {
|
|
564
560
|
if (typeof window > "u" || typeof window.XMLHttpRequest != "function") return;
|
|
565
|
-
let e = XMLHttpRequest.prototype, t = e.open,
|
|
566
|
-
let
|
|
567
|
-
return this.__cibEntry =
|
|
568
|
-
},
|
|
561
|
+
let e = XMLHttpRequest.prototype, t = e.open, r = e.send, n = function(a, l) {
|
|
562
|
+
let f = typeof l == "string" ? l : l.toString();
|
|
563
|
+
return this.__cibEntry = yt(f, {}) ? void 0 : { id: mt(), startedAt: "", method: (a || "GET").toUpperCase(), url: xe(f), requestHeaders: {}, requestBody: null, status: null, statusText: null, durationMs: null, via: "xhr" }, t.apply(this, arguments);
|
|
564
|
+
}, o = function(a) {
|
|
569
565
|
let l = this.__cibEntry;
|
|
570
566
|
if (l) {
|
|
571
|
-
l.startedAt = (/* @__PURE__ */ new Date()).toISOString(), l.requestBody = typeof a == "string" ?
|
|
572
|
-
let
|
|
573
|
-
|
|
574
|
-
if (l.status = this.status || null, l.statusText = this.statusText || null, l.durationMs = Math.round(performance.now() -
|
|
567
|
+
l.startedAt = (/* @__PURE__ */ new Date()).toISOString(), l.requestBody = typeof a == "string" ? ee(a, pt) : a == null ? null : "[non-string body]";
|
|
568
|
+
let f = performance.now();
|
|
569
|
+
ht(l), this.addEventListener("loadend", () => {
|
|
570
|
+
if (l.status = this.status || null, l.statusText = this.statusText || null, l.durationMs = Math.round(performance.now() - f), gt(l.url)) l.responseSnippet = "[body not captured for this origin]";
|
|
575
571
|
else if (this.responseType === "" || this.responseType === "text") try {
|
|
576
|
-
l.responseSnippet =
|
|
572
|
+
l.responseSnippet = ee(this.responseText || "", K("maxBodyChars"));
|
|
577
573
|
} catch {
|
|
578
574
|
}
|
|
579
575
|
else {
|
|
580
|
-
let
|
|
581
|
-
l.responseSnippet = `[binary ${
|
|
576
|
+
let p = this.getResponseHeader("content-type") ?? this.responseType;
|
|
577
|
+
l.responseSnippet = `[binary ${p}]`;
|
|
582
578
|
}
|
|
583
579
|
});
|
|
584
580
|
}
|
|
585
|
-
return
|
|
581
|
+
return r.apply(this, arguments);
|
|
586
582
|
};
|
|
587
|
-
e.open = n, e.send =
|
|
583
|
+
e.open = n, e.send = o;
|
|
588
584
|
}
|
|
589
|
-
function
|
|
590
|
-
|
|
585
|
+
function Yr() {
|
|
586
|
+
Ye || (Ye = !0, Kr(), Vr());
|
|
591
587
|
}
|
|
592
|
-
function
|
|
593
|
-
let e =
|
|
594
|
-
for (let
|
|
595
|
-
let n = e[
|
|
596
|
-
!n || typeof
|
|
588
|
+
function Fr() {
|
|
589
|
+
let e = Z.map((r) => ({ ...r })), t = 0;
|
|
590
|
+
for (let r = e.length - 1; r >= 0; r -= 1) {
|
|
591
|
+
let n = e[r], o = n == null ? void 0 : n.responseSnippet;
|
|
592
|
+
!n || typeof o != "string" || o.length === 0 || (t + o.length > Or ? n.responseSnippet = `[response omitted — report size budget reached (${o.length.toLocaleString()} chars)]` : t += o.length);
|
|
597
593
|
}
|
|
598
594
|
return e;
|
|
599
595
|
}
|
|
600
|
-
var
|
|
601
|
-
function
|
|
602
|
-
return e === "en" ?
|
|
596
|
+
var jr = { title: "รายงานปัญหา", summaryLabel: "หัวข้อปัญหา", summaryRequired: "(ต้องกรอกก่อนแจ้งปัญหา)", summaryPlaceholder: "สรุปปัญหาสั้น ๆ เช่น กดบันทึกร่างแล้ว error", detailLabel: "อธิบายปัญหา (ไม่บังคับ)", detailPlaceholder: "เกิดอะไรขึ้น? กำลังทำอะไรอยู่ตอนที่พบปัญหา?", annotateTitle: "วาดบนรูป", annotateHint: "ทำเครื่องหมายจุดที่มีปัญหาก่อนแนบ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ", annotateApply: "ใช้รูปนี้", cancel: "ยกเลิก", toolRect: "กรอบ", toolArrow: "ลูกศร", toolHighlight: "ไฮไลต์", toolText: "ข้อความ", deleteSelected: "ลบที่เลือก", clearAll: "ล้างทั้งหมด", annotateHelp: "เลือกเครื่องมือแล้วลากบนรูป · ไม่ได้เลือกเครื่องมือ = ย้าย/ปรับขนาดสิ่งที่วาดไว้ · กดกากบาทมุมขวาบนของรูปทรงเพื่อลบ", capturing: "กำลังเก็บภาพหน้าจอ…", noScreenshot: "ไม่มีภาพหน้าจอ — ยังส่งรายงานได้", cancelled: "ยกเลิกการเก็บภาพหน้าจอแล้ว", close: "ปิด", submit: "แจ้งปัญหา", submitting: "กำลังส่ง…", submitted: "แจ้งปัญหาสำเร็จ", crashed: "เกิดข้อผิดพลาดในระบบ", crashAction: "แจ้งปัญหา", failed: "ส่งรายงานไม่สำเร็จ", captured: "เก็บข้อมูลแล้ว", reporter: "ผู้แจ้ง", page: "หน้า" }, Xr = { title: "Report a problem", summaryLabel: "Summary", summaryRequired: "(required)", summaryPlaceholder: "One line, e.g. saving a draft returns an error", detailLabel: "Details (optional)", detailPlaceholder: "What happened? What were you doing at the time?", annotateTitle: "Draw on the image", annotateHint: "Mark what went wrong before attaching — box it, point at it, highlight it, or type on it", annotateApply: "Use this image", cancel: "Cancel", toolRect: "Box", toolArrow: "Arrow", toolHighlight: "Highlight", toolText: "Text", deleteSelected: "Delete selected", clearAll: "Clear all", annotateHelp: "Pick a tool and drag on the image · no tool selected = move/resize what you drew · press the ✕ on a shape to delete it", capturing: "Capturing the screen…", noScreenshot: "No screenshot — you can still send the report", cancelled: "Screen capture cancelled", close: "Close", submit: "Send report", submitting: "Sending…", submitted: "Report sent", crashed: "Something went wrong", crashAction: "Report it", failed: "Could not send the report", captured: "Captured", reporter: "Reporter", page: "Page" };
|
|
597
|
+
function bt(e) {
|
|
598
|
+
return e === "en" ? Xr : jr;
|
|
603
599
|
}
|
|
604
|
-
var
|
|
605
|
-
function
|
|
600
|
+
var I = null;
|
|
601
|
+
function Gr() {
|
|
606
602
|
if (typeof document > "u") return null;
|
|
607
|
-
if (
|
|
603
|
+
if (I != null && I.isConnected) return I;
|
|
608
604
|
let e = document.createElement("lw-debug-toasts");
|
|
609
605
|
e.dataset.debugReporter = "true";
|
|
610
|
-
let t = e.attachShadow({ mode: "open" }),
|
|
611
|
-
|
|
606
|
+
let t = e.attachShadow({ mode: "open" }), r = document.createElement("style");
|
|
607
|
+
r.textContent = `
|
|
612
608
|
:host { all: initial; }
|
|
613
609
|
.stack {
|
|
614
610
|
position: fixed; top: 16px; right: 16px; z-index: 2147483001;
|
|
@@ -642,45 +638,45 @@ function Zo() {
|
|
|
642
638
|
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
|
|
643
639
|
`;
|
|
644
640
|
let n = document.createElement("div");
|
|
645
|
-
return n.className = "stack", n.setAttribute("role", "status"), n.setAttribute("aria-live", "polite"), t.append(
|
|
641
|
+
return n.className = "stack", n.setAttribute("role", "status"), n.setAttribute("aria-live", "polite"), t.append(r, n), document.body.append(e), I = n, n;
|
|
646
642
|
}
|
|
647
|
-
function
|
|
648
|
-
let n =
|
|
643
|
+
function re(e, t = "success", r) {
|
|
644
|
+
let n = Gr();
|
|
649
645
|
if (!n) return;
|
|
650
|
-
let
|
|
651
|
-
|
|
646
|
+
let o = document.createElement("div");
|
|
647
|
+
o.className = "toast", o.dataset.tone = t;
|
|
652
648
|
let a = document.createElement("span");
|
|
653
649
|
a.className = "dot";
|
|
654
650
|
let l = document.createElement("span");
|
|
655
651
|
l.textContent = e;
|
|
656
|
-
let
|
|
657
|
-
|
|
658
|
-
let
|
|
659
|
-
window.clearTimeout(
|
|
652
|
+
let f = document.createElement("button");
|
|
653
|
+
f.type = "button", f.className = "close", f.textContent = "✕", f.setAttribute("aria-label", "ปิด");
|
|
654
|
+
let p = () => {
|
|
655
|
+
window.clearTimeout(m), o.remove();
|
|
660
656
|
};
|
|
661
|
-
|
|
662
|
-
let
|
|
663
|
-
if (
|
|
664
|
-
let
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
}),
|
|
657
|
+
f.addEventListener("click", p);
|
|
658
|
+
let m = t === "error" || r ? 0 : window.setTimeout(p, 6e3);
|
|
659
|
+
if (o.append(a, l), r) {
|
|
660
|
+
let x = document.createElement("button");
|
|
661
|
+
x.type = "button", x.className = "action", x.textContent = r.label, x.addEventListener("click", () => {
|
|
662
|
+
p(), r.onClick();
|
|
663
|
+
}), o.append(x);
|
|
668
664
|
}
|
|
669
|
-
|
|
665
|
+
o.append(f), n.append(o);
|
|
670
666
|
}
|
|
671
|
-
function
|
|
672
|
-
let n = e.filter((a) => !!a.error || a.status != null && a.status >= 400).slice(-20).map((a) => ({ method: a.method, url: a.url, status: a.status, error: a.error, at: a.startedAt })),
|
|
673
|
-
return { failedRequests: n, errors:
|
|
667
|
+
function $r(e, t, r) {
|
|
668
|
+
let n = e.filter((a) => !!a.error || a.status != null && a.status >= 400).slice(-20).map((a) => ({ method: a.method, url: a.url, status: a.status, error: a.error, at: a.startedAt })), o = t.filter((a) => a.level === "error" || a.level === "exception" || a.level === "unhandledrejection").slice(-20).map((a) => a.message);
|
|
669
|
+
return { failedRequests: n, errors: o, erroredQueries: r.slice(0, 20) };
|
|
674
670
|
}
|
|
675
|
-
function
|
|
671
|
+
function Zr() {
|
|
676
672
|
let e = { memoryUsedMb: null, memoryLimitMb: null, domContentLoadedMs: null, loadEventMs: null };
|
|
677
673
|
if (typeof performance > "u") return e;
|
|
678
674
|
let t = performance.memory;
|
|
679
675
|
t && (e.memoryUsedMb = Math.round(t.usedJSHeapSize / 1024 / 1024), e.memoryLimitMb = Math.round(t.jsHeapSizeLimit / 1024 / 1024));
|
|
680
|
-
let [
|
|
681
|
-
return
|
|
676
|
+
let [r] = performance.getEntriesByType("navigation");
|
|
677
|
+
return r && (e.domContentLoadedMs = Math.round(r.domContentLoadedEventEnd), e.loadEventMs = Math.round(r.loadEventEnd)), e;
|
|
682
678
|
}
|
|
683
|
-
function
|
|
679
|
+
function se(e, t) {
|
|
684
680
|
if (!e) return t;
|
|
685
681
|
try {
|
|
686
682
|
return e();
|
|
@@ -688,405 +684,405 @@ function $e(e, t) {
|
|
|
688
684
|
return t;
|
|
689
685
|
}
|
|
690
686
|
}
|
|
691
|
-
function
|
|
692
|
-
let e =
|
|
693
|
-
return { capturedAt: (/* @__PURE__ */ new Date()).toISOString(), route: { href: n, pathname: t, search:
|
|
687
|
+
function en() {
|
|
688
|
+
let e = H(), { pathname: t, search: r, href: n } = window.location;
|
|
689
|
+
return { capturedAt: (/* @__PURE__ */ new Date()).toISOString(), route: { href: n, pathname: t, search: r }, module: Bt(t), user: se(e.user, {}), apiHeaders: fe(se(e.headers, {})), app: { name: W().name, version: W().version, environment: W().environment }, client: { userAgent: navigator.userAgent, language: navigator.language, platform: navigator.platform, online: navigator.onLine, viewport: { width: window.innerWidth, height: window.innerHeight, dpr: window.devicePixelRatio }, screen: { width: window.screen.width, height: window.screen.height } }, performance: Zr(), extra: se(e.extra, {}) };
|
|
694
690
|
}
|
|
695
|
-
var
|
|
696
|
-
function
|
|
697
|
-
let t =
|
|
698
|
-
return { context:
|
|
691
|
+
var tn = 2;
|
|
692
|
+
function rn(e) {
|
|
693
|
+
let t = Fr(), r = Rr();
|
|
694
|
+
return { context: en(), reason: e.reason, note: e.note, cause: $r(t, r, e.erroredQueries), actionTrail: Lr(), network: t, console: r, screenshotDataUrl: e.screenshotDataUrl, screenshotMethod: e.screenshotMethod, meta: { generatedBy: "lightwork-debug-capture", schemaVersion: tn } };
|
|
699
695
|
}
|
|
700
|
-
async function
|
|
696
|
+
async function nn() {
|
|
701
697
|
var t;
|
|
702
698
|
if (typeof navigator < "u" && ((t = navigator.mediaDevices) != null && t.getDisplayMedia)) {
|
|
703
|
-
let
|
|
704
|
-
if (
|
|
705
|
-
if (
|
|
699
|
+
let r = await on();
|
|
700
|
+
if (r.status === "ok") return { dataUrl: r.dataUrl, method: "display-media" };
|
|
701
|
+
if (r.status === "cancelled") return { dataUrl: null, method: "cancelled" };
|
|
706
702
|
}
|
|
707
|
-
let e = await
|
|
703
|
+
let e = await sn();
|
|
708
704
|
return e ? { dataUrl: e, method: "html-to-image" } : { dataUrl: null, method: "none" };
|
|
709
705
|
}
|
|
710
|
-
async function
|
|
706
|
+
async function on() {
|
|
711
707
|
let e = null;
|
|
712
708
|
try {
|
|
713
709
|
let t = { video: { frameRate: 30 }, audio: !1, preferCurrentTab: !0, selfBrowserSurface: "include", surfaceSwitching: "exclude" };
|
|
714
710
|
e = await navigator.mediaDevices.getDisplayMedia(t);
|
|
715
|
-
let
|
|
716
|
-
return
|
|
711
|
+
let r = await an(e);
|
|
712
|
+
return r ? { status: "ok", dataUrl: r } : { status: "error" };
|
|
717
713
|
} catch (t) {
|
|
718
714
|
return t instanceof DOMException && (t.name === "NotAllowedError" || t.name === "AbortError") ? { status: "cancelled" } : { status: "error" };
|
|
719
715
|
} finally {
|
|
720
716
|
e == null || e.getTracks().forEach((t) => t.stop());
|
|
721
717
|
}
|
|
722
718
|
}
|
|
723
|
-
async function
|
|
719
|
+
async function an(e) {
|
|
724
720
|
let t = document.createElement("video");
|
|
725
721
|
t.srcObject = e, t.muted = !0, t.playsInline = !0, await new Promise((l) => {
|
|
726
|
-
let
|
|
727
|
-
|
|
722
|
+
let f = !1, p = () => {
|
|
723
|
+
f || (f = !0, l());
|
|
728
724
|
};
|
|
729
725
|
t.onloadedmetadata = () => {
|
|
730
|
-
t.play().then(
|
|
731
|
-
}, window.setTimeout(
|
|
732
|
-
}), await
|
|
733
|
-
let { videoWidth:
|
|
734
|
-
if (!
|
|
735
|
-
let
|
|
736
|
-
|
|
737
|
-
let a =
|
|
726
|
+
t.play().then(p).catch(p);
|
|
727
|
+
}, window.setTimeout(p, 1500);
|
|
728
|
+
}), await ln(t);
|
|
729
|
+
let { videoWidth: r, videoHeight: n } = t;
|
|
730
|
+
if (!r || !n) return null;
|
|
731
|
+
let o = document.createElement("canvas");
|
|
732
|
+
o.width = r, o.height = n;
|
|
733
|
+
let a = o.getContext("2d");
|
|
738
734
|
if (!a) return null;
|
|
739
|
-
a.drawImage(t, 0, 0,
|
|
735
|
+
a.drawImage(t, 0, 0, r, n), t.pause(), t.srcObject = null;
|
|
740
736
|
try {
|
|
741
|
-
return
|
|
737
|
+
return o.toDataURL("image/png");
|
|
742
738
|
} catch {
|
|
743
739
|
return null;
|
|
744
740
|
}
|
|
745
741
|
}
|
|
746
|
-
function
|
|
742
|
+
function ln(e) {
|
|
747
743
|
return new Promise((t) => {
|
|
748
|
-
let
|
|
749
|
-
|
|
750
|
-
},
|
|
751
|
-
typeof
|
|
744
|
+
let r = !1, n = () => {
|
|
745
|
+
r || (r = !0, t());
|
|
746
|
+
}, o = e;
|
|
747
|
+
typeof o.requestVideoFrameCallback == "function" ? (o.requestVideoFrameCallback(() => n()), window.setTimeout(n, 1e3)) : window.setTimeout(n, 250);
|
|
752
748
|
});
|
|
753
749
|
}
|
|
754
|
-
async function
|
|
755
|
-
let e =
|
|
750
|
+
async function sn() {
|
|
751
|
+
let e = H().screenshotFallback;
|
|
756
752
|
if (!e) return null;
|
|
757
753
|
let t = await e().catch(() => null);
|
|
758
754
|
if (!t) return null;
|
|
759
755
|
try {
|
|
760
|
-
return await t(document.body, { cacheBust: !0, pixelRatio: Math.min(window.devicePixelRatio || 1, 2), filter: (
|
|
756
|
+
return await t(document.body, { cacheBust: !0, pixelRatio: Math.min(window.devicePixelRatio || 1, 2), filter: (r) => {
|
|
761
757
|
var n;
|
|
762
|
-
return !(
|
|
758
|
+
return !(r instanceof HTMLElement && ((n = r.dataset) == null ? void 0 : n.debugReporter) === "true");
|
|
763
759
|
} });
|
|
764
760
|
} catch {
|
|
765
761
|
return null;
|
|
766
762
|
}
|
|
767
763
|
}
|
|
768
|
-
var
|
|
769
|
-
function
|
|
770
|
-
return new Promise((t,
|
|
764
|
+
var un = 2e3, cn = 0.82, dn = 3e6;
|
|
765
|
+
function fn(e) {
|
|
766
|
+
return new Promise((t, r) => {
|
|
771
767
|
let n = new Image();
|
|
772
|
-
n.onload = () => t(n), n.onerror = () =>
|
|
768
|
+
n.onload = () => t(n), n.onerror = () => r(Error("could not read the screenshot")), n.src = e;
|
|
773
769
|
});
|
|
774
770
|
}
|
|
775
|
-
async function
|
|
771
|
+
async function pn(e) {
|
|
776
772
|
try {
|
|
777
|
-
let t = await
|
|
778
|
-
|
|
779
|
-
let a =
|
|
773
|
+
let t = await fn(e), r = Math.max(t.naturalWidth, t.naturalHeight), n = Math.min(1, un / r), o = document.createElement("canvas");
|
|
774
|
+
o.width = Math.max(1, Math.round(t.naturalWidth * n)), o.height = Math.max(1, Math.round(t.naturalHeight * n));
|
|
775
|
+
let a = o.getContext("2d");
|
|
780
776
|
if (!a) return e;
|
|
781
|
-
a.fillStyle = "#fff", a.fillRect(0, 0,
|
|
782
|
-
let l =
|
|
783
|
-
for (;
|
|
784
|
-
return
|
|
777
|
+
a.fillStyle = "#fff", a.fillRect(0, 0, o.width, o.height), a.drawImage(t, 0, 0, o.width, o.height);
|
|
778
|
+
let l = cn, f = o.toDataURL("image/jpeg", l);
|
|
779
|
+
for (; f.length > dn && l > 0.4; ) l -= 0.15, f = o.toDataURL("image/jpeg", l);
|
|
780
|
+
return f;
|
|
785
781
|
} catch {
|
|
786
782
|
return e;
|
|
787
783
|
}
|
|
788
784
|
}
|
|
789
|
-
var
|
|
790
|
-
function
|
|
785
|
+
var hn = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, mn = /^\d+$/, gn = /^[0-9a-f]{16,}$/i;
|
|
786
|
+
function yn(e) {
|
|
791
787
|
var a, l;
|
|
792
788
|
if (e.reason.type === "manual") return null;
|
|
793
789
|
let t = (l = (a = e.cause) == null ? void 0 : a.failedRequests) == null ? void 0 : l[0];
|
|
794
790
|
if (!(t != null && t.url)) return null;
|
|
795
|
-
let
|
|
791
|
+
let r;
|
|
796
792
|
try {
|
|
797
|
-
|
|
793
|
+
r = new URL(t.url, "http://x").pathname;
|
|
798
794
|
} catch {
|
|
799
|
-
|
|
795
|
+
r = t.url;
|
|
800
796
|
}
|
|
801
|
-
let n =
|
|
802
|
-
return `${t.method ?? "REQ"} ${n} ${
|
|
797
|
+
let n = r.split("/").map((f) => hn.test(f) || mn.test(f) || gn.test(f) ? ":id" : f).join("/"), o = t.status ?? (t.error ? "ERR" : "?");
|
|
798
|
+
return `${t.method ?? "REQ"} ${n} ${o}`;
|
|
803
799
|
}
|
|
804
|
-
var
|
|
805
|
-
function
|
|
806
|
-
let { screenshotDataUrl: t, ...
|
|
807
|
-
return JSON.stringify(
|
|
800
|
+
var bn = 2e6;
|
|
801
|
+
function j(e) {
|
|
802
|
+
let { screenshotDataUrl: t, ...r } = e;
|
|
803
|
+
return JSON.stringify(r).length;
|
|
808
804
|
}
|
|
809
|
-
function
|
|
810
|
-
if (
|
|
811
|
-
let
|
|
812
|
-
for (let
|
|
813
|
-
if (
|
|
814
|
-
typeof
|
|
805
|
+
function xn(e, t = 2e6) {
|
|
806
|
+
if (j(e) <= t) return e;
|
|
807
|
+
let r = e.network.map((o) => ({ ...o })), n = { ...e, network: r };
|
|
808
|
+
for (let o of r) {
|
|
809
|
+
if (j(n) <= t) return n;
|
|
810
|
+
typeof o.responseSnippet == "string" && o.responseSnippet.length > 35 && (o.responseSnippet = "[body dropped — report size budget]"), typeof o.requestBody == "string" && o.requestBody.length > 35 && (o.requestBody = "[body dropped — report size budget]");
|
|
815
811
|
}
|
|
816
|
-
for (; n.network.length > 1 &&
|
|
817
|
-
for (; n.console.length > 1 &&
|
|
812
|
+
for (; n.network.length > 1 && j(n) > t; ) n.network = n.network.slice(1);
|
|
813
|
+
for (; n.console.length > 1 && j(n) > t; ) n.console = n.console.slice(1);
|
|
818
814
|
return n;
|
|
819
815
|
}
|
|
820
|
-
var
|
|
821
|
-
function
|
|
816
|
+
var je = 32768;
|
|
817
|
+
function wn(e) {
|
|
822
818
|
let t = "";
|
|
823
|
-
for (let
|
|
819
|
+
for (let r = 0; r < e.length; r += je) t += String.fromCharCode(...e.subarray(r, r + je));
|
|
824
820
|
return btoa(t);
|
|
825
821
|
}
|
|
826
|
-
function
|
|
827
|
-
return { dataUri: `data:application/json;base64,${
|
|
822
|
+
function vn(e) {
|
|
823
|
+
return { dataUri: `data:application/json;base64,${wn(new TextEncoder().encode(JSON.stringify(e)))}`, filename: "debug-bundle.json" };
|
|
828
824
|
}
|
|
829
|
-
async function
|
|
830
|
-
var
|
|
831
|
-
let
|
|
825
|
+
async function kn(e, t) {
|
|
826
|
+
var x, w;
|
|
827
|
+
let r = H(), n = xn(t, bn), { context: o, note: a } = n, l = [];
|
|
832
828
|
if (n.screenshotDataUrl) {
|
|
833
|
-
let
|
|
834
|
-
l.push({ dataUri:
|
|
835
|
-
}
|
|
836
|
-
l.push(
|
|
837
|
-
let
|
|
838
|
-
if (!
|
|
839
|
-
let
|
|
840
|
-
throw Error(
|
|
841
|
-
}
|
|
842
|
-
return await
|
|
843
|
-
}
|
|
844
|
-
var
|
|
845
|
-
function
|
|
846
|
-
let n = t.x - e.x,
|
|
847
|
-
return a <=
|
|
848
|
-
}
|
|
849
|
-
var
|
|
850
|
-
function
|
|
851
|
-
let n = [],
|
|
852
|
-
function
|
|
829
|
+
let g = await pn(n.screenshotDataUrl);
|
|
830
|
+
l.push({ dataUri: g, filename: "screenshot.jpg" });
|
|
831
|
+
}
|
|
832
|
+
l.push(vn(n));
|
|
833
|
+
let f = yn(n), p = { title: e, description: a.trim() || void 0, category: ((x = o.module) == null ? void 0 : x.label) || W().name, routeUrl: o.route.href, priority: "MEDIUM", requesterEmail: o.user.email ?? void 0, requesterName: o.user.fullName ?? void 0, customFields: { unit: o.user.unit ?? "", appVersion: o.app.version, environment: o.app.environment, reasonType: n.reason.type, appName: W().name, module: ((w = o.module) == null ? void 0 : w.label) ?? "" }, context: { ...f ? { signature: f } : {}, capturedAt: o.capturedAt, reason: n.reason, cause: n.cause, actionTrail: n.actionTrail, client: o.client, performance: o.performance, apiHeaders: o.apiHeaders, extra: o.extra, counts: { network: n.network.length, console: n.console.length, actions: n.actionTrail.length }, screenshotMethod: n.screenshotMethod }, attachments: l }, m = await fetch(`${r.host.replace(/\/$/, "")}/ingest/tickets`, { method: "POST", headers: { "content-type": "application/json", "x-realm-key": r.realmKey }, body: JSON.stringify(p) });
|
|
834
|
+
if (!m.ok) {
|
|
835
|
+
let g = m.headers.get("retry-after"), M = await m.json().then((v) => v.error).catch(() => null);
|
|
836
|
+
throw Error(m.status === 429 ? `Too many reports — try again in ${g ?? "a moment"}s` : M ?? `Report failed (${m.status})`);
|
|
837
|
+
}
|
|
838
|
+
return await m.json();
|
|
839
|
+
}
|
|
840
|
+
var O = Math.PI / 6;
|
|
841
|
+
function Sn(e, t, r) {
|
|
842
|
+
let n = t.x - e.x, o = t.y - e.y, a = Math.hypot(n, o), l = Math.atan2(o, n), f = [{ x: t.x, y: t.y }, { x: t.x - r * Math.cos(l - O), y: t.y - r * Math.sin(l - O) }, { x: t.x - r * Math.cos(l + O), y: t.y - r * Math.sin(l + O) }], p = r * Math.cos(O) * 0.92;
|
|
843
|
+
return a <= p ? { shaft: null, head: f } : { shaft: { from: e, to: { x: t.x - p * Math.cos(l), y: t.y - p * Math.sin(l) } }, head: f };
|
|
844
|
+
}
|
|
845
|
+
var ue = "#f44336", En = "rgba(250, 204, 21, 0.4)", ce = 22, Xe = "#2563eb", Ge = 9, $e = 11, Ze = 18, et = 4, X = 8, Mn = [{ id: "nw", fx: 0, fy: 0, cursor: "nwse-resize" }, { id: "n", fx: 0.5, fy: 0, cursor: "ns-resize" }, { id: "ne", fx: 1, fy: 0, cursor: "nesw-resize" }, { id: "e", fx: 1, fy: 0.5, cursor: "ew-resize" }, { id: "se", fx: 1, fy: 1, cursor: "nwse-resize" }, { id: "s", fx: 0.5, fy: 1, cursor: "ns-resize" }, { id: "sw", fx: 0, fy: 1, cursor: "nesw-resize" }, { id: "w", fx: 0, fy: 0.5, cursor: "ew-resize" }];
|
|
846
|
+
function Cn(e, t, r) {
|
|
847
|
+
let n = [], o = null, a = -1, l = null, f = null, p = e.getContext("2d");
|
|
848
|
+
function m() {
|
|
853
849
|
let i = e.getBoundingClientRect().width;
|
|
854
850
|
return i > 0 ? e.width / i : 1;
|
|
855
851
|
}
|
|
856
|
-
function
|
|
857
|
-
let
|
|
858
|
-
return { x: (i.clientX -
|
|
852
|
+
function x(i) {
|
|
853
|
+
let s = e.getBoundingClientRect();
|
|
854
|
+
return { x: (i.clientX - s.left) / s.width * e.width, y: (i.clientY - s.top) / s.height * e.height };
|
|
859
855
|
}
|
|
860
856
|
function w(i) {
|
|
861
|
-
var
|
|
862
|
-
let
|
|
863
|
-
if (!
|
|
864
|
-
|
|
865
|
-
let
|
|
866
|
-
return
|
|
867
|
-
}
|
|
868
|
-
function
|
|
857
|
+
var u;
|
|
858
|
+
let s = i.size ?? ce;
|
|
859
|
+
if (!p) return (((u = i.text) == null ? void 0 : u.length) ?? 0) * s * 0.6;
|
|
860
|
+
p.save(), p.font = `600 ${s}px system-ui, sans-serif`;
|
|
861
|
+
let c = p.measureText(i.text ?? "").width;
|
|
862
|
+
return p.restore(), c;
|
|
863
|
+
}
|
|
864
|
+
function g(i) {
|
|
869
865
|
if (i.tool === "text") {
|
|
870
|
-
let
|
|
871
|
-
return { left: i.x1, top: i.y1, right: i.x1 + w(i), bottom: i.y1 +
|
|
866
|
+
let s = i.size ?? ce;
|
|
867
|
+
return { left: i.x1, top: i.y1, right: i.x1 + w(i), bottom: i.y1 + s * 1.25 };
|
|
872
868
|
}
|
|
873
869
|
return { left: Math.min(i.x1, i.x2), top: Math.min(i.y1, i.y2), right: Math.max(i.x1, i.x2), bottom: Math.max(i.y1, i.y2) };
|
|
874
870
|
}
|
|
875
|
-
function
|
|
871
|
+
function M(i) {
|
|
876
872
|
if (i.tool === "arrow") return [{ id: "tail", x: i.x1, y: i.y1, cursor: "move" }, { id: "head", x: i.x2, y: i.y2, cursor: "move" }];
|
|
877
|
-
let
|
|
878
|
-
return i.tool === "text" ? [{ id: "size", x:
|
|
879
|
-
}
|
|
880
|
-
function
|
|
881
|
-
let
|
|
882
|
-
return { x:
|
|
883
|
-
}
|
|
884
|
-
function
|
|
885
|
-
let { shaft:
|
|
886
|
-
|
|
887
|
-
}
|
|
888
|
-
function
|
|
889
|
-
i.save(), i.lineWidth = Math.max(2, 3 *
|
|
890
|
-
let
|
|
891
|
-
if (
|
|
892
|
-
else if (
|
|
893
|
-
else if (
|
|
894
|
-
else if (
|
|
895
|
-
let
|
|
896
|
-
i.font = `600 ${
|
|
897
|
-
let
|
|
898
|
-
i.fillStyle = "rgba(255,255,255,0.92)", i.fillRect(
|
|
873
|
+
let s = g(i);
|
|
874
|
+
return i.tool === "text" ? [{ id: "size", x: s.right, y: s.bottom, cursor: "nwse-resize" }] : Mn.map((c) => ({ id: c.id, x: s.left + (s.right - s.left) * c.fx, y: s.top + (s.bottom - s.top) * c.fy, cursor: c.cursor }));
|
|
875
|
+
}
|
|
876
|
+
function v(i) {
|
|
877
|
+
let s = g(i);
|
|
878
|
+
return { x: s.right + Ze * m(), y: s.top - Ze * m() };
|
|
879
|
+
}
|
|
880
|
+
function L(i, s, c) {
|
|
881
|
+
let { shaft: u, head: d } = Sn({ x: s.x1, y: s.y1 }, { x: s.x2, y: s.y2 }, Math.max(10, 16 * c));
|
|
882
|
+
u && (i.lineCap = "butt", i.beginPath(), i.moveTo(u.from.x, u.from.y), i.lineTo(u.to.x, u.to.y), i.stroke()), i.beginPath(), i.moveTo(d[0].x, d[0].y), i.lineTo(d[1].x, d[1].y), i.lineTo(d[2].x, d[2].y), i.closePath(), i.fill();
|
|
883
|
+
}
|
|
884
|
+
function k(i, s, c) {
|
|
885
|
+
i.save(), i.lineWidth = Math.max(2, 3 * c), i.strokeStyle = ue, i.fillStyle = ue;
|
|
886
|
+
let u = g(s);
|
|
887
|
+
if (s.tool === "rect") i.strokeRect(u.left, u.top, u.right - u.left, u.bottom - u.top);
|
|
888
|
+
else if (s.tool === "arrow") L(i, s, c);
|
|
889
|
+
else if (s.tool === "highlight") i.fillStyle = En, i.fillRect(u.left, u.top, u.right - u.left, u.bottom - u.top);
|
|
890
|
+
else if (s.tool === "text" && s.text) {
|
|
891
|
+
let d = s.size ?? ce;
|
|
892
|
+
i.font = `600 ${d}px system-ui, sans-serif`, i.textBaseline = "top";
|
|
893
|
+
let h = d * 0.22;
|
|
894
|
+
i.fillStyle = "rgba(255,255,255,0.92)", i.fillRect(u.left - h, u.top - h, u.right - u.left + h * 2, u.bottom - u.top + h * 2), i.fillStyle = ue, i.fillText(s.text, u.left, u.top);
|
|
899
895
|
}
|
|
900
896
|
i.restore();
|
|
901
897
|
}
|
|
902
|
-
function
|
|
903
|
-
let
|
|
904
|
-
i.save(), i.strokeStyle =
|
|
905
|
-
let
|
|
906
|
-
for (let
|
|
907
|
-
let
|
|
908
|
-
i.beginPath(), i.arc(
|
|
909
|
-
}
|
|
910
|
-
function
|
|
911
|
-
if (!
|
|
912
|
-
let i =
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
}), l &&
|
|
916
|
-
let
|
|
917
|
-
|
|
918
|
-
}
|
|
919
|
-
function
|
|
920
|
-
return Math.abs(i -
|
|
921
|
-
}
|
|
922
|
-
function
|
|
923
|
-
let
|
|
924
|
-
if (!
|
|
925
|
-
let
|
|
926
|
-
for (let
|
|
898
|
+
function T(i, s, c) {
|
|
899
|
+
let u = g(s);
|
|
900
|
+
i.save(), i.strokeStyle = Xe, i.lineWidth = Math.max(1, 1.5 * c), i.setLineDash([6 * c, 4 * c]), i.strokeRect(u.left, u.top, u.right - u.left, u.bottom - u.top), i.setLineDash([]);
|
|
901
|
+
let d = Ge * c;
|
|
902
|
+
for (let C of M(s)) i.fillStyle = "#fff", i.strokeStyle = Xe, i.lineWidth = Math.max(1, 1.5 * c), i.beginPath(), i.rect(C.x - d / 2, C.y - d / 2, d, d), i.fill(), i.stroke();
|
|
903
|
+
let h = v(s), y = $e * c;
|
|
904
|
+
i.beginPath(), i.arc(h.x, h.y, y, 0, Math.PI * 2), i.fillStyle = "#dc2626", i.fill(), i.strokeStyle = "#fff", i.lineWidth = Math.max(1.5, 2 * c), i.beginPath(), i.moveTo(h.x - y * 0.4, h.y - y * 0.4), i.lineTo(h.x + y * 0.4, h.y + y * 0.4), i.moveTo(h.x + y * 0.4, h.y - y * 0.4), i.lineTo(h.x - y * 0.4, h.y + y * 0.4), i.stroke(), i.restore();
|
|
905
|
+
}
|
|
906
|
+
function S() {
|
|
907
|
+
if (!p) return;
|
|
908
|
+
let i = m();
|
|
909
|
+
p.clearRect(0, 0, e.width, e.height), p.drawImage(t, 0, 0, e.width, e.height), n.forEach((c, u) => {
|
|
910
|
+
u !== V && k(p, c, i);
|
|
911
|
+
}), l && k(p, l, i);
|
|
912
|
+
let s = n[a];
|
|
913
|
+
s && !l && T(p, s, i);
|
|
914
|
+
}
|
|
915
|
+
function Se(i, s, c, u, d) {
|
|
916
|
+
return Math.abs(i - c) <= d && Math.abs(s - u) <= d;
|
|
917
|
+
}
|
|
918
|
+
function Ee(i, s) {
|
|
919
|
+
let c = n[a];
|
|
920
|
+
if (!c) return null;
|
|
921
|
+
let u = Ge * m() / 2 + 3 * m();
|
|
922
|
+
for (let d of M(c)) if (Se(i, s, d.x, d.y, u)) return d.id;
|
|
927
923
|
return null;
|
|
928
924
|
}
|
|
929
|
-
function
|
|
930
|
-
let
|
|
931
|
-
if (!
|
|
932
|
-
let
|
|
933
|
-
return
|
|
934
|
-
}
|
|
935
|
-
function
|
|
936
|
-
let
|
|
937
|
-
for (let
|
|
938
|
-
let
|
|
939
|
-
if (
|
|
940
|
-
let
|
|
941
|
-
if (Math.hypot(i - (
|
|
925
|
+
function Me(i, s) {
|
|
926
|
+
let c = n[a];
|
|
927
|
+
if (!c) return !1;
|
|
928
|
+
let u = v(c);
|
|
929
|
+
return Se(i, s, u.x, u.y, $e * m());
|
|
930
|
+
}
|
|
931
|
+
function ie(i, s) {
|
|
932
|
+
let c = 6 * m();
|
|
933
|
+
for (let u = n.length - 1; u >= 0; u -= 1) {
|
|
934
|
+
let d = n[u];
|
|
935
|
+
if (d.tool === "arrow") {
|
|
936
|
+
let y = d.x2 - d.x1, C = d.y2 - d.y1, R = Math.hypot(y, C) || 1, D = Math.max(0, Math.min(1, ((i - d.x1) * y + (s - d.y1) * C) / (R * R)));
|
|
937
|
+
if (Math.hypot(i - (d.x1 + D * y), s - (d.y1 + D * C)) <= c + 4 * m()) return u;
|
|
942
938
|
continue;
|
|
943
939
|
}
|
|
944
|
-
let
|
|
945
|
-
if (i >=
|
|
940
|
+
let h = g(d);
|
|
941
|
+
if (i >= h.left - c && i <= h.right + c && s >= h.top - c && s <= h.bottom + c) return u;
|
|
946
942
|
}
|
|
947
943
|
return -1;
|
|
948
944
|
}
|
|
949
|
-
function
|
|
950
|
-
if (
|
|
951
|
-
i.x1 =
|
|
945
|
+
function wt(i, s, c, u, d) {
|
|
946
|
+
if (s === "tail") {
|
|
947
|
+
i.x1 = c.x1 + u, i.y1 = c.y1 + d;
|
|
952
948
|
return;
|
|
953
949
|
}
|
|
954
|
-
if (
|
|
955
|
-
i.x2 =
|
|
950
|
+
if (s === "head") {
|
|
951
|
+
i.x2 = c.x2 + u, i.y2 = c.y2 + d;
|
|
956
952
|
return;
|
|
957
953
|
}
|
|
958
|
-
if (
|
|
959
|
-
let
|
|
960
|
-
i.size = Math.max(10,
|
|
954
|
+
if (s === "size") {
|
|
955
|
+
let Et = (c.size ?? 24) + d;
|
|
956
|
+
i.size = Math.max(10, Et);
|
|
961
957
|
return;
|
|
962
958
|
}
|
|
963
|
-
let
|
|
964
|
-
|
|
959
|
+
let h = g(c), { left: y, top: C, right: R, bottom: D } = h;
|
|
960
|
+
s.includes("w") && (y = Math.min(R - X, y + u)), s.includes("e") && (R = Math.max(y + X, R + u)), s.includes("n") && (C = Math.min(D - X, C + d)), s.includes("s") && (D = Math.max(C + X, D + d)), i.x1 = y, i.y1 = C, i.x2 = R, i.y2 = D;
|
|
965
961
|
}
|
|
966
|
-
function
|
|
967
|
-
i.x1 =
|
|
962
|
+
function vt(i, s, c, u) {
|
|
963
|
+
i.x1 = s.x1 + c, i.y1 = s.y1 + u, i.x2 = s.x2 + c, i.y2 = s.y2 + u;
|
|
968
964
|
}
|
|
969
|
-
let
|
|
970
|
-
function
|
|
965
|
+
let z = null, V = -1, A = { x: 0, y: 0, size: 24 };
|
|
966
|
+
function kt() {
|
|
971
967
|
let i = e.getBoundingClientRect().width;
|
|
972
968
|
return i > 0 ? i / e.width : 1;
|
|
973
969
|
}
|
|
974
|
-
function
|
|
975
|
-
if (!
|
|
976
|
-
|
|
977
|
-
let
|
|
978
|
-
return
|
|
970
|
+
function St(i, s) {
|
|
971
|
+
if (!p) return i.length * s * 0.6;
|
|
972
|
+
p.save(), p.font = `600 ${s}px system-ui, sans-serif`;
|
|
973
|
+
let c = p.measureText(i || " ").width;
|
|
974
|
+
return p.restore(), c;
|
|
979
975
|
}
|
|
980
|
-
function
|
|
981
|
-
if (!
|
|
976
|
+
function Ce() {
|
|
977
|
+
if (!z) return;
|
|
982
978
|
let i = e.parentElement;
|
|
983
979
|
if (!i) return;
|
|
984
|
-
let
|
|
985
|
-
|
|
986
|
-
}
|
|
987
|
-
function
|
|
988
|
-
let
|
|
980
|
+
let s = e.getBoundingClientRect(), c = i.getBoundingClientRect(), u = kt(), d = A.size * u;
|
|
981
|
+
z.style.left = `${s.left - c.left + A.x * u}px`, z.style.top = `${s.top - c.top + A.y * u}px`, z.style.fontSize = `${d}px`, z.style.width = `${Math.max(40, St(z.value, d) + d)}px`;
|
|
982
|
+
}
|
|
983
|
+
function Q(i) {
|
|
984
|
+
let s = z;
|
|
985
|
+
if (!s) return;
|
|
986
|
+
z = null;
|
|
987
|
+
let c = s.value.trim(), u = V;
|
|
988
|
+
V = -1, s.remove(), i && c ? (u >= 0 && n[u] ? (n[u].text = c, a = u) : (n.push({ tool: "text", x1: A.x, y1: A.y, x2: A.x, y2: A.y, text: c, size: A.size }), a = n.length - 1), r()) : u >= 0 && (a = u), e.focus(), S();
|
|
989
|
+
}
|
|
990
|
+
function ze(i, s, c = -1) {
|
|
991
|
+
Q(!0);
|
|
992
|
+
let u = e.parentElement;
|
|
989
993
|
if (!u) return;
|
|
990
|
-
|
|
991
|
-
let d =
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
let p = e.parentElement;
|
|
997
|
-
if (!p) return;
|
|
998
|
-
getComputedStyle(p).position === "static" && (p.style.position = "relative");
|
|
999
|
-
let b = d >= 0 ? n[d] : void 0;
|
|
1000
|
-
_ = d, L = { x: (b == null ? void 0 : b.x1) ?? i, y: (b == null ? void 0 : b.y1) ?? u, size: (b == null ? void 0 : b.size) ?? Math.round(24 * g()) };
|
|
1001
|
-
let C = document.createElement("input");
|
|
1002
|
-
C.type = "text", C.className = "text-edit", C.value = (b == null ? void 0 : b.text) ?? "", C.setAttribute("aria-label", "ข้อความบนภาพ"), C.placeholder = "ข้อความ", h = C, p.append(C), ee(), C.addEventListener("input", ee), C.addEventListener("keydown", (D) => {
|
|
1003
|
-
D.stopPropagation(), D.key === "Enter" ? te(!0) : D.key === "Escape" && te(!1);
|
|
994
|
+
getComputedStyle(u).position === "static" && (u.style.position = "relative");
|
|
995
|
+
let d = c >= 0 ? n[c] : void 0;
|
|
996
|
+
V = c, A = { x: (d == null ? void 0 : d.x1) ?? i, y: (d == null ? void 0 : d.y1) ?? s, size: (d == null ? void 0 : d.size) ?? Math.round(24 * m()) };
|
|
997
|
+
let h = document.createElement("input");
|
|
998
|
+
h.type = "text", h.className = "text-edit", h.value = (d == null ? void 0 : d.text) ?? "", h.setAttribute("aria-label", "ข้อความบนภาพ"), h.placeholder = "ข้อความ", z = h, u.append(h), Ce(), h.addEventListener("input", Ce), h.addEventListener("keydown", (y) => {
|
|
999
|
+
y.stopPropagation(), y.key === "Enter" ? Q(!0) : y.key === "Escape" && Q(!1);
|
|
1004
1000
|
}), requestAnimationFrame(() => {
|
|
1005
|
-
|
|
1006
|
-
}),
|
|
1001
|
+
z === h && (h.focus(), h.select(), h.addEventListener("blur", () => Q(!0)));
|
|
1002
|
+
}), S();
|
|
1007
1003
|
}
|
|
1008
|
-
function
|
|
1009
|
-
let { x:
|
|
1010
|
-
if (e.setPointerCapture(i.pointerId),
|
|
1011
|
-
|
|
1004
|
+
function Le(i) {
|
|
1005
|
+
let { x: s, y: c } = x(i);
|
|
1006
|
+
if (e.setPointerCapture(i.pointerId), Me(s, c)) {
|
|
1007
|
+
ae();
|
|
1012
1008
|
return;
|
|
1013
1009
|
}
|
|
1014
|
-
let
|
|
1015
|
-
if (
|
|
1016
|
-
|
|
1010
|
+
let u = Ee(s, c);
|
|
1011
|
+
if (u && n[a]) {
|
|
1012
|
+
f = { grip: u, x: s, y: c, start: { ...n[a] } };
|
|
1017
1013
|
return;
|
|
1018
1014
|
}
|
|
1019
|
-
if (
|
|
1020
|
-
i.preventDefault(), e.hasPointerCapture(i.pointerId) && e.releasePointerCapture(i.pointerId),
|
|
1015
|
+
if (o === "text") {
|
|
1016
|
+
i.preventDefault(), e.hasPointerCapture(i.pointerId) && e.releasePointerCapture(i.pointerId), o = null, r(), ze(s, c);
|
|
1021
1017
|
return;
|
|
1022
1018
|
}
|
|
1023
|
-
if (
|
|
1024
|
-
l = { tool:
|
|
1019
|
+
if (o) {
|
|
1020
|
+
l = { tool: o, x1: s, y1: c, x2: s, y2: c }, a = -1;
|
|
1025
1021
|
return;
|
|
1026
1022
|
}
|
|
1027
|
-
let
|
|
1028
|
-
a =
|
|
1023
|
+
let d = ie(s, c);
|
|
1024
|
+
a = d, f = d >= 0 ? { grip: "body", x: s, y: c, start: { ...n[d] } } : null, S();
|
|
1029
1025
|
}
|
|
1030
|
-
function
|
|
1031
|
-
let { x:
|
|
1026
|
+
function Te(i) {
|
|
1027
|
+
let { x: s, y: c } = x(i);
|
|
1032
1028
|
if (l) {
|
|
1033
|
-
l.x2 =
|
|
1029
|
+
l.x2 = s, l.y2 = c, S();
|
|
1034
1030
|
return;
|
|
1035
1031
|
}
|
|
1036
|
-
if (
|
|
1037
|
-
let
|
|
1038
|
-
if (!
|
|
1039
|
-
let
|
|
1040
|
-
|
|
1032
|
+
if (f) {
|
|
1033
|
+
let d = n[a];
|
|
1034
|
+
if (!d) return;
|
|
1035
|
+
let h = s - f.x, y = c - f.y;
|
|
1036
|
+
f.grip === "body" ? vt(d, f.start, h, y) : wt(d, f.grip, f.start, h, y), S();
|
|
1041
1037
|
return;
|
|
1042
1038
|
}
|
|
1043
|
-
if (
|
|
1039
|
+
if (o) {
|
|
1044
1040
|
e.style.cursor = "crosshair";
|
|
1045
1041
|
return;
|
|
1046
1042
|
}
|
|
1047
|
-
if (
|
|
1043
|
+
if (Me(s, c)) {
|
|
1048
1044
|
e.style.cursor = "pointer";
|
|
1049
1045
|
return;
|
|
1050
1046
|
}
|
|
1051
|
-
let
|
|
1052
|
-
if (
|
|
1053
|
-
let
|
|
1054
|
-
e.style.cursor = (
|
|
1047
|
+
let u = Ee(s, c);
|
|
1048
|
+
if (u) {
|
|
1049
|
+
let d = n[a] ? M(n[a]).find((h) => h.id === u) : null;
|
|
1050
|
+
e.style.cursor = (d == null ? void 0 : d.cursor) ?? "pointer";
|
|
1055
1051
|
return;
|
|
1056
1052
|
}
|
|
1057
|
-
e.style.cursor =
|
|
1053
|
+
e.style.cursor = ie(s, c) >= 0 ? "move" : "default";
|
|
1058
1054
|
}
|
|
1059
|
-
function
|
|
1060
|
-
l && (Math.abs(l.x2 - l.x1) <
|
|
1055
|
+
function Y() {
|
|
1056
|
+
l && (Math.abs(l.x2 - l.x1) < et && Math.abs(l.y2 - l.y1) < et || (n.push(l), a = n.length - 1, o = null, r()), l = null), f && (f = null, r()), S();
|
|
1061
1057
|
}
|
|
1062
|
-
function
|
|
1063
|
-
let
|
|
1064
|
-
!
|
|
1058
|
+
function Ae(i) {
|
|
1059
|
+
let s = e.getBoundingClientRect(), c = (i.clientX - s.left) / s.width * e.width, u = (i.clientY - s.top) / s.height * e.height, d = ie(c, u), h = n[d];
|
|
1060
|
+
!h || h.tool !== "text" || (i.preventDefault(), ze(h.x1, h.y1, d));
|
|
1065
1061
|
}
|
|
1066
|
-
function
|
|
1067
|
-
a < 0 || (i.key === "Delete" || i.key === "Backspace" ? (i.preventDefault(),
|
|
1062
|
+
function Re(i) {
|
|
1063
|
+
a < 0 || (i.key === "Delete" || i.key === "Backspace" ? (i.preventDefault(), ae()) : i.key === "Escape" && (a = -1, S()));
|
|
1068
1064
|
}
|
|
1069
|
-
function
|
|
1070
|
-
a < 0 || (n.splice(a, 1), a = -1,
|
|
1065
|
+
function ae() {
|
|
1066
|
+
a < 0 || (n.splice(a, 1), a = -1, r(), S());
|
|
1071
1067
|
}
|
|
1072
|
-
return e.addEventListener("pointerdown",
|
|
1073
|
-
|
|
1074
|
-
}, deleteSelected:
|
|
1075
|
-
n.length = 0, a = -1,
|
|
1068
|
+
return e.addEventListener("pointerdown", Le), e.addEventListener("pointermove", Te), e.addEventListener("pointerup", Y), e.addEventListener("pointercancel", Y), e.addEventListener("dblclick", Ae), e.tabIndex = 0, e.addEventListener("keydown", Re), S(), { setTool(i) {
|
|
1069
|
+
o = i, a = -1, e.style.cursor = i ? "crosshair" : "default", S();
|
|
1070
|
+
}, deleteSelected: ae, clear() {
|
|
1071
|
+
n.length = 0, a = -1, r(), S();
|
|
1076
1072
|
}, hasShapes: () => n.length > 0, hasSelection: () => a >= 0, toDataUrl() {
|
|
1077
1073
|
let i = document.createElement("canvas");
|
|
1078
1074
|
i.width = t.naturalWidth, i.height = t.naturalHeight;
|
|
1079
|
-
let
|
|
1080
|
-
if (!
|
|
1081
|
-
|
|
1082
|
-
let
|
|
1083
|
-
for (let
|
|
1075
|
+
let s = i.getContext("2d");
|
|
1076
|
+
if (!s) return e.toDataURL("image/png");
|
|
1077
|
+
s.drawImage(t, 0, 0);
|
|
1078
|
+
let c = m();
|
|
1079
|
+
for (let u of n) k(s, u, c);
|
|
1084
1080
|
return i.toDataURL("image/png");
|
|
1085
1081
|
}, destroy() {
|
|
1086
|
-
|
|
1082
|
+
Q(!1), e.removeEventListener("pointerdown", Le), e.removeEventListener("pointermove", Te), e.removeEventListener("pointerup", Y), e.removeEventListener("pointercancel", Y), e.removeEventListener("dblclick", Ae), e.removeEventListener("keydown", Re);
|
|
1087
1083
|
} };
|
|
1088
1084
|
}
|
|
1089
|
-
var
|
|
1085
|
+
var zn = `
|
|
1090
1086
|
:host { all: initial; }
|
|
1091
1087
|
* { box-sizing: border-box; }
|
|
1092
1088
|
|
|
@@ -1169,24 +1165,24 @@ canvas { width: 100%; height: auto; display: block; border: 1px solid #e2e8f0; b
|
|
|
1169
1165
|
border-radius: 0 0 16px 16px;
|
|
1170
1166
|
}
|
|
1171
1167
|
.foot .grow { flex: 1; }
|
|
1172
|
-
`,
|
|
1173
|
-
function
|
|
1174
|
-
|
|
1168
|
+
`, ne = "lw-debug-reporter", xt = () => [];
|
|
1169
|
+
function Ln(e) {
|
|
1170
|
+
xt = e;
|
|
1175
1171
|
}
|
|
1176
|
-
var
|
|
1177
|
-
function
|
|
1172
|
+
var Tn = [{ tool: "rect", key: "toolRect" }, { tool: "arrow", key: "toolArrow" }, { tool: "highlight", key: "toolHighlight" }, { tool: "text", key: "toolText" }];
|
|
1173
|
+
function An() {
|
|
1178
1174
|
return class extends HTMLElement {
|
|
1179
1175
|
constructor() {
|
|
1180
1176
|
super();
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1177
|
+
U(this, "root");
|
|
1178
|
+
U(this, "stop", null);
|
|
1179
|
+
U(this, "annotator", null);
|
|
1180
|
+
U(this, "bundle", null);
|
|
1181
|
+
U(this, "busy", !1);
|
|
1186
1182
|
this.root = this.attachShadow({ mode: "open" });
|
|
1187
1183
|
}
|
|
1188
1184
|
connectedCallback() {
|
|
1189
|
-
this.dataset.debugReporter = "true", this.stop =
|
|
1185
|
+
this.dataset.debugReporter = "true", this.stop = Dr((t) => void this.open(t));
|
|
1190
1186
|
}
|
|
1191
1187
|
disconnectedCallback() {
|
|
1192
1188
|
var t;
|
|
@@ -1195,377 +1191,159 @@ function Sr() {
|
|
|
1195
1191
|
async open(t) {
|
|
1196
1192
|
if (this.busy) return;
|
|
1197
1193
|
this.busy = !0;
|
|
1198
|
-
let
|
|
1194
|
+
let r = bt(H().locale), n = await nn();
|
|
1199
1195
|
if (n.method === "cancelled") {
|
|
1200
1196
|
this.close();
|
|
1201
1197
|
return;
|
|
1202
1198
|
}
|
|
1203
|
-
this.bundle =
|
|
1199
|
+
this.bundle = rn({ reason: t, note: "", screenshotDataUrl: n.dataUrl, screenshotMethod: n.method, erroredQueries: Rn() }), this.renderForm(r);
|
|
1204
1200
|
}
|
|
1205
1201
|
close() {
|
|
1206
1202
|
var t;
|
|
1207
1203
|
(t = this.annotator) == null || t.destroy(), this.annotator = null, this.bundle = null, this.busy = !1, this.root.replaceChildren();
|
|
1208
1204
|
}
|
|
1209
1205
|
shell(t) {
|
|
1210
|
-
let
|
|
1211
|
-
|
|
1206
|
+
let r = document.createElement("style");
|
|
1207
|
+
r.textContent = zn;
|
|
1212
1208
|
let n = document.createElement("div");
|
|
1213
1209
|
n.className = "backdrop";
|
|
1214
|
-
let
|
|
1215
|
-
return
|
|
1210
|
+
let o = document.createElement("div");
|
|
1211
|
+
return o.className = "panel", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", t.title), n.append(o), this.root.replaceChildren(r, n), o;
|
|
1216
1212
|
}
|
|
1217
|
-
renderShell(t,
|
|
1218
|
-
let n = this.shell(t),
|
|
1219
|
-
|
|
1213
|
+
renderShell(t, r) {
|
|
1214
|
+
let n = this.shell(t), o = E("div", "head");
|
|
1215
|
+
o.append(E("h2", "", t.title)), n.append(o, E("p", "status", r));
|
|
1220
1216
|
}
|
|
1221
1217
|
renderForm(t) {
|
|
1222
|
-
let
|
|
1223
|
-
if (!
|
|
1224
|
-
let n = this.shell(t),
|
|
1225
|
-
a.setAttribute("aria-label", t.close), a.addEventListener("click", () => this.close()),
|
|
1218
|
+
let r = this.bundle;
|
|
1219
|
+
if (!r) return;
|
|
1220
|
+
let n = this.shell(t), o = E("div", "head"), a = N("✕", "icon");
|
|
1221
|
+
a.setAttribute("aria-label", t.close), a.addEventListener("click", () => this.close()), o.append(E("h2", "", t.title), a);
|
|
1226
1222
|
let l = document.createElement("input");
|
|
1227
1223
|
l.type = "text", l.placeholder = t.summaryPlaceholder;
|
|
1228
|
-
let
|
|
1229
|
-
|
|
1230
|
-
let
|
|
1231
|
-
|
|
1232
|
-
let { context:
|
|
1233
|
-
for (let [
|
|
1234
|
-
let
|
|
1235
|
-
|
|
1224
|
+
let f = de(t.summaryLabel, t.summaryRequired, !0), p = document.createElement("textarea");
|
|
1225
|
+
p.placeholder = t.detailPlaceholder;
|
|
1226
|
+
let m = E("div", "meta");
|
|
1227
|
+
m.innerHTML = "";
|
|
1228
|
+
let { context: x } = r;
|
|
1229
|
+
for (let [L, k] of [[t.reporter, `${x.user.fullName ?? "—"} (${x.user.email ?? "—"})`], [t.page, x.route.href], [t.captured, `${r.network.length} network · ${r.console.length} console · ${r.actionTrail.length} actions`]]) {
|
|
1230
|
+
let T = document.createElement("div"), S = document.createElement("b");
|
|
1231
|
+
S.textContent = `${L}: `, T.append(S, document.createTextNode(k)), m.append(T);
|
|
1236
1232
|
}
|
|
1237
|
-
let w =
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
}), n.append(
|
|
1241
|
-
let
|
|
1242
|
-
|
|
1243
|
-
var
|
|
1244
|
-
|
|
1233
|
+
let w = E("p", "status", ""), g = N(t.submit, "primary");
|
|
1234
|
+
g.disabled = !0, l.addEventListener("input", () => {
|
|
1235
|
+
g.disabled = l.value.trim().length === 0;
|
|
1236
|
+
}), n.append(o, f, l, de(t.detailLabel), p, m), r.screenshotDataUrl ? n.append(...this.screenshotSection(t, r.screenshotDataUrl)) : n.append(E("p", "status", t.noScreenshot));
|
|
1237
|
+
let M = E("div", "foot"), v = N(t.close);
|
|
1238
|
+
v.addEventListener("click", () => this.close()), M.append(v, w, E("span", "grow"), g), n.append(M), g.addEventListener("click", async () => {
|
|
1239
|
+
var L;
|
|
1240
|
+
g.disabled = !0, w.dataset.tone = "", w.textContent = t.submitting;
|
|
1245
1241
|
try {
|
|
1246
|
-
let
|
|
1247
|
-
this.close(),
|
|
1248
|
-
} catch (
|
|
1249
|
-
let
|
|
1250
|
-
w.dataset.tone = "error", w.textContent =
|
|
1242
|
+
let k = await kn(l.value.trim(), { ...r, note: p.value, screenshotDataUrl: (L = this.annotator) != null && L.hasShapes() ? this.annotator.toDataUrl() : r.screenshotDataUrl }), T = this.dispatchEvent(new CustomEvent("lw-report-submitted", { detail: k, bubbles: !0, composed: !0, cancelable: !0 }));
|
|
1243
|
+
this.close(), T && re(`${t.submitted} — #${k.number}`, "success");
|
|
1244
|
+
} catch (k) {
|
|
1245
|
+
let T = k instanceof Error ? k.message : t.failed;
|
|
1246
|
+
w.dataset.tone = "error", w.textContent = T, re(`${t.failed} — ${T}`, "error"), g.disabled = !1;
|
|
1251
1247
|
}
|
|
1252
1248
|
}), l.focus();
|
|
1253
1249
|
}
|
|
1254
|
-
screenshotSection(t,
|
|
1255
|
-
let n =
|
|
1250
|
+
screenshotSection(t, r) {
|
|
1251
|
+
let n = de(t.annotateHint), o = E("div", "tools"), a = document.createElement("canvas"), l = E("div", "shot");
|
|
1256
1252
|
l.append(a);
|
|
1257
|
-
let
|
|
1258
|
-
for (let
|
|
1253
|
+
let f = [], p = (g) => {
|
|
1254
|
+
for (let M of f) M.setAttribute("aria-pressed", String(M === g));
|
|
1259
1255
|
};
|
|
1260
|
-
for (let { tool:
|
|
1261
|
-
let
|
|
1262
|
-
|
|
1263
|
-
var
|
|
1264
|
-
let
|
|
1265
|
-
|
|
1266
|
-
}),
|
|
1256
|
+
for (let { tool: g, key: M } of Tn) {
|
|
1257
|
+
let v = N(t[M]);
|
|
1258
|
+
v.setAttribute("aria-pressed", "false"), v.addEventListener("click", () => {
|
|
1259
|
+
var k;
|
|
1260
|
+
let L = v.getAttribute("aria-pressed") === "true";
|
|
1261
|
+
p(L ? null : v), (k = this.annotator) == null || k.setTool(L ? null : g);
|
|
1262
|
+
}), f.push(v), o.append(v);
|
|
1267
1263
|
}
|
|
1268
|
-
|
|
1269
|
-
let
|
|
1270
|
-
|
|
1271
|
-
var
|
|
1272
|
-
return (
|
|
1264
|
+
o.append(E("span", "sep"));
|
|
1265
|
+
let m = N(t.deleteSelected);
|
|
1266
|
+
m.addEventListener("click", () => {
|
|
1267
|
+
var g;
|
|
1268
|
+
return (g = this.annotator) == null ? void 0 : g.deleteSelected();
|
|
1273
1269
|
});
|
|
1274
|
-
let
|
|
1275
|
-
|
|
1276
|
-
var
|
|
1277
|
-
(
|
|
1278
|
-
}),
|
|
1270
|
+
let x = N(t.clearAll);
|
|
1271
|
+
x.addEventListener("click", () => {
|
|
1272
|
+
var g;
|
|
1273
|
+
(g = this.annotator) == null || g.clear(), p(null);
|
|
1274
|
+
}), o.append(m, x);
|
|
1279
1275
|
let w = new Image();
|
|
1280
1276
|
return w.onload = () => {
|
|
1281
|
-
a.width = w.naturalWidth, a.height = w.naturalHeight, this.annotator =
|
|
1282
|
-
var
|
|
1283
|
-
|
|
1277
|
+
a.width = w.naturalWidth, a.height = w.naturalHeight, this.annotator = Cn(a, w, () => {
|
|
1278
|
+
var g;
|
|
1279
|
+
p(null), m.disabled = !((g = this.annotator) != null && g.hasSelection());
|
|
1284
1280
|
});
|
|
1285
|
-
}, w.src =
|
|
1281
|
+
}, w.src = r, [n, o, E("p", "status", t.annotateHelp), l];
|
|
1286
1282
|
}
|
|
1287
1283
|
};
|
|
1288
1284
|
}
|
|
1289
|
-
function
|
|
1285
|
+
function Rn() {
|
|
1290
1286
|
try {
|
|
1291
|
-
return
|
|
1287
|
+
return xt();
|
|
1292
1288
|
} catch {
|
|
1293
1289
|
return [];
|
|
1294
1290
|
}
|
|
1295
1291
|
}
|
|
1296
|
-
function
|
|
1292
|
+
function E(e, t = "", r = "") {
|
|
1297
1293
|
let n = document.createElement(e);
|
|
1298
|
-
return t && (n.className = t),
|
|
1294
|
+
return t && (n.className = t), r && (n.textContent = r), n;
|
|
1299
1295
|
}
|
|
1300
|
-
function
|
|
1301
|
-
let
|
|
1302
|
-
return
|
|
1296
|
+
function N(e, t = "") {
|
|
1297
|
+
let r = document.createElement("button");
|
|
1298
|
+
return r.type = "button", r.textContent = e, t && (r.className = t), r;
|
|
1303
1299
|
}
|
|
1304
|
-
function
|
|
1300
|
+
function de(e, t = "", r = !1) {
|
|
1305
1301
|
let n = document.createElement("label");
|
|
1306
|
-
if (n.append(document.createTextNode(e)),
|
|
1307
|
-
let
|
|
1308
|
-
|
|
1302
|
+
if (n.append(document.createTextNode(e)), r) {
|
|
1303
|
+
let o = document.createElement("span");
|
|
1304
|
+
o.className = "req", o.textContent = " *", n.append(o);
|
|
1309
1305
|
}
|
|
1310
1306
|
if (t) {
|
|
1311
|
-
let
|
|
1312
|
-
|
|
1307
|
+
let o = document.createElement("span");
|
|
1308
|
+
o.className = "hint", o.textContent = ` ${t}`, n.append(o);
|
|
1313
1309
|
}
|
|
1314
1310
|
return n;
|
|
1315
1311
|
}
|
|
1316
|
-
function
|
|
1317
|
-
typeof window > "u" || customElements.get(
|
|
1312
|
+
function Dn() {
|
|
1313
|
+
typeof window > "u" || customElements.get(ne) || customElements.define(ne, An());
|
|
1318
1314
|
}
|
|
1319
|
-
var
|
|
1320
|
-
function
|
|
1321
|
-
if (
|
|
1322
|
-
if (!
|
|
1315
|
+
var tt = !1;
|
|
1316
|
+
function Hn(e = {}) {
|
|
1317
|
+
if (tt || typeof window > "u") return;
|
|
1318
|
+
if (!ot()) {
|
|
1323
1319
|
console.error("[debug-capture] configureDebugCapture() must be called before install");
|
|
1324
1320
|
return;
|
|
1325
1321
|
}
|
|
1326
|
-
if (
|
|
1327
|
-
let t =
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
}),
|
|
1331
|
-
}
|
|
1332
|
-
class un extends Error {
|
|
1333
|
-
constructor(o, n) {
|
|
1334
|
-
super(o);
|
|
1335
|
-
de(this, "status");
|
|
1336
|
-
this.status = n;
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
class Ke extends Error {
|
|
1340
|
-
constructor() {
|
|
1341
|
-
super("[debug-capture] no reporter identity — configure `identity` to use the tickets panel");
|
|
1342
|
-
}
|
|
1343
|
-
}
|
|
1344
|
-
function cn() {
|
|
1345
|
-
return X().host.replace(/\/$/, "");
|
|
1346
|
-
}
|
|
1347
|
-
async function Lr() {
|
|
1348
|
-
let e = X().identity;
|
|
1349
|
-
if (!e) throw new Ke();
|
|
1350
|
-
let t = await e();
|
|
1351
|
-
if (!t) throw new Ke();
|
|
1352
|
-
return t;
|
|
1353
|
-
}
|
|
1354
|
-
async function le(e, t = {}) {
|
|
1355
|
-
let o = await Lr(), n = await fetch(`${cn()}/ingest/me${e}`, { ...t, headers: { "x-realm-key": X().realmKey, authorization: `Bearer ${o}`, ...t.body ? { "content-type": "application/json" } : {}, ...t.headers } });
|
|
1356
|
-
if (!n.ok) {
|
|
1357
|
-
let r = await n.json().then((a) => a.error).catch(() => null);
|
|
1358
|
-
throw new un(r ?? `Request failed (${n.status})`, n.status);
|
|
1359
|
-
}
|
|
1360
|
-
return await n.json();
|
|
1361
|
-
}
|
|
1362
|
-
async function Tr() {
|
|
1363
|
-
let { items: e } = await le("/tickets");
|
|
1364
|
-
return e;
|
|
1365
|
-
}
|
|
1366
|
-
function _r(e) {
|
|
1367
|
-
return le(`/tickets/${encodeURIComponent(e)}`);
|
|
1368
|
-
}
|
|
1369
|
-
function Rr(e) {
|
|
1370
|
-
return le(`/attachments/${encodeURIComponent(e)}`);
|
|
1371
|
-
}
|
|
1372
|
-
function Ir(e) {
|
|
1373
|
-
return le(`/tickets/${encodeURIComponent(e)}/history`);
|
|
1374
|
-
}
|
|
1375
|
-
function zr(e, t) {
|
|
1376
|
-
return le(`/tickets/${encodeURIComponent(e)}/messages`, { method: "POST", body: JSON.stringify({ body: t }) });
|
|
1377
|
-
}
|
|
1378
|
-
function Nr(e, t, o) {
|
|
1379
|
-
return le(`/tickets/${encodeURIComponent(e)}/messages/${encodeURIComponent(t)}`, { method: "PUT", body: JSON.stringify({ body: o }) });
|
|
1380
|
-
}
|
|
1381
|
-
function Pr(e, t) {
|
|
1382
|
-
return le(`/tickets/${encodeURIComponent(e)}/reopen`, { method: "POST", body: JSON.stringify({ note: (t == null ? void 0 : t.trim()) || void 0 }) });
|
|
1383
|
-
}
|
|
1384
|
-
function Ur(e, t, o) {
|
|
1385
|
-
return le(`/tickets/${encodeURIComponent(e)}/inline-image`, { method: "POST", body: JSON.stringify({ dataUri: t, filename: o }) });
|
|
1386
|
-
}
|
|
1387
|
-
var Re = null;
|
|
1388
|
-
function Dr() {
|
|
1389
|
-
if (!Re) {
|
|
1390
|
-
let e = encodeURIComponent(X().realmKey);
|
|
1391
|
-
Re = fetch(`${cn()}/ingest/config?key=${e}`).then((t) => {
|
|
1392
|
-
if (!t.ok) throw new un(`Config failed (${t.status})`, t.status);
|
|
1393
|
-
return t.json();
|
|
1394
|
-
}).catch((t) => {
|
|
1395
|
-
throw Re = null, t;
|
|
1396
|
-
});
|
|
1397
|
-
}
|
|
1398
|
-
return Re;
|
|
1399
|
-
}
|
|
1400
|
-
function it(e, t) {
|
|
1401
|
-
let o = (e ?? "").trim().toUpperCase().replace(/[^A-Z0-9]+/g, "");
|
|
1402
|
-
return o ? `${o}-${t}` : `#${t}`;
|
|
1403
|
-
}
|
|
1404
|
-
function He(e, t, o) {
|
|
1405
|
-
if (!e) return "—";
|
|
1406
|
-
let n = new Date(e);
|
|
1407
|
-
if (Number.isNaN(n.getTime())) return "—";
|
|
1408
|
-
try {
|
|
1409
|
-
return new Intl.DateTimeFormat(o === "en" ? "en-GB" : "th-TH-u-ca-buddhist", { dateStyle: "medium", timeStyle: "short", timeZone: t }).format(n);
|
|
1410
|
-
} catch {
|
|
1411
|
-
return n.toISOString().slice(0, 16).replace("T", " ");
|
|
1412
|
-
}
|
|
1413
|
-
}
|
|
1414
|
-
function Or(e, t) {
|
|
1415
|
-
let o = new Map(e.map((r) => [r.key, r])), n = e.map((r) => r.key);
|
|
1416
|
-
return { labelOf: (r) => {
|
|
1417
|
-
var a;
|
|
1418
|
-
return ((a = o.get(r)) == null ? void 0 : a.label) ?? r;
|
|
1419
|
-
}, columnOf: (r) => o.get(r), isAwaitingReply: (r) => {
|
|
1420
|
-
var a;
|
|
1421
|
-
return ((a = o.get(r)) == null ? void 0 : a.awaitingReply) === !0;
|
|
1422
|
-
}, isClosed: (r) => {
|
|
1423
|
-
var a;
|
|
1424
|
-
return ((a = o.get(r)) == null ? void 0 : a.bucket) === "closed";
|
|
1425
|
-
}, rankOf: (r) => {
|
|
1426
|
-
let a = n.indexOf(r);
|
|
1427
|
-
return a === -1 ? n.length : a;
|
|
1428
|
-
}, options: [{ value: "", label: t }, ...e.map((r) => ({ value: r.key, label: r.label }))] };
|
|
1429
|
-
}
|
|
1430
|
-
function dn(e) {
|
|
1431
|
-
return !!(e.resolutionNote && e.resolutionNote.trim());
|
|
1432
|
-
}
|
|
1433
|
-
function fn(e) {
|
|
1434
|
-
return e.agentReplyCount > 0;
|
|
1435
|
-
}
|
|
1436
|
-
function Pt(e) {
|
|
1437
|
-
return dn(e) ? 2 : fn(e) ? 1 : 0;
|
|
1438
|
-
}
|
|
1439
|
-
function Br(e, t, o, n) {
|
|
1440
|
-
let r = t.trim().toLowerCase();
|
|
1441
|
-
return r ? [it(o, e.number), String(e.number), e.title, e.category ?? "", n(e.status)].join(" ").toLowerCase().includes(r) : !0;
|
|
1442
|
-
}
|
|
1443
|
-
function Hr(e, t, o) {
|
|
1444
|
-
let n = e.direction === "asc" ? 1 : -1;
|
|
1445
|
-
return (r, a) => {
|
|
1446
|
-
let l = 0;
|
|
1447
|
-
switch (e.key) {
|
|
1448
|
-
case "number":
|
|
1449
|
-
l = r.number - a.number;
|
|
1450
|
-
break;
|
|
1451
|
-
case "title":
|
|
1452
|
-
l = (r.title ?? "").localeCompare(a.title ?? "", "th");
|
|
1453
|
-
break;
|
|
1454
|
-
case "module":
|
|
1455
|
-
l = (r.category ?? "").localeCompare(a.category ?? "", "th");
|
|
1456
|
-
break;
|
|
1457
|
-
case "status":
|
|
1458
|
-
l = t.rankOf(r.status) - t.rankOf(a.status);
|
|
1459
|
-
break;
|
|
1460
|
-
case "response":
|
|
1461
|
-
l = Pt(r) - Pt(a);
|
|
1462
|
-
break;
|
|
1463
|
-
case "createdAt":
|
|
1464
|
-
l = Date.parse(r.createdAt) - Date.parse(a.createdAt);
|
|
1465
|
-
break;
|
|
1466
|
-
case "updatedAt":
|
|
1467
|
-
l = Date.parse(r.updatedAt) - Date.parse(a.updatedAt);
|
|
1468
|
-
break;
|
|
1469
|
-
}
|
|
1470
|
-
return l !== 0 ? l * n : (r.number - a.number) * n;
|
|
1471
|
-
};
|
|
1472
|
-
}
|
|
1473
|
-
var hn = 10;
|
|
1474
|
-
function Fr(e, t, o = hn) {
|
|
1475
|
-
return e.slice((t - 1) * o, t * o);
|
|
1476
|
-
}
|
|
1477
|
-
function $r(e, t = hn) {
|
|
1478
|
-
return Math.max(1, Math.ceil(e / t));
|
|
1479
|
-
}
|
|
1480
|
-
var Ut = { blue: { fg: "#1c5cab", bg: "#e8f1fd" }, amber: { fg: "#92400e", bg: "#fef3c7" }, violet: { fg: "#4a3aa7", bg: "#ece9fb" }, emerald: { fg: "#0f766e", bg: "#d9f2ec" }, gray: { fg: "#4b5563", bg: "#f1f2f4" }, red: { fg: "#b91c1c", bg: "#fde8e8" }, sky: { fg: "#0369a1", bg: "#e0f2fe" }, rose: { fg: "#be123c", bg: "#ffe4e9" }, teal: { fg: "#0f766e", bg: "#d7f2ef" }, orange: { fg: "#c2410c", bg: "#ffedd5" } };
|
|
1481
|
-
function Qr(e) {
|
|
1482
|
-
return Ut[e ?? ""] ?? Ut.gray;
|
|
1483
|
-
}
|
|
1484
|
-
var Vr = /* @__PURE__ */ new Set(["p", "br", "strong", "b", "em", "i", "u", "s", "code", "pre", "ul", "ol", "li", "blockquote", "h1", "h2", "h3", "a", "img", "span"]), qr = /* @__PURE__ */ new Set(["href", "target", "rel", "src", "alt", "title"]), Jr = /^\/api\/inline\/[a-f0-9]{64}$/i;
|
|
1485
|
-
function Zr(e) {
|
|
1486
|
-
return /^(?:https?:\/\/|mailto:|#|\/)/i.test(e.trim());
|
|
1487
|
-
}
|
|
1488
|
-
function Yr(e, t) {
|
|
1489
|
-
try {
|
|
1490
|
-
let o = new URL(e.trim(), t);
|
|
1491
|
-
return o.origin === new URL(t).origin && Jr.test(o.pathname);
|
|
1492
|
-
} catch {
|
|
1493
|
-
return !1;
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
function Xr(e) {
|
|
1497
|
-
return /<[a-z/][^>]*>/i.test(e);
|
|
1498
|
-
}
|
|
1499
|
-
function pn(e, t, o) {
|
|
1500
|
-
if (e.textContent = "", !Xr(t)) {
|
|
1501
|
-
for (let [r, a] of t.split(`
|
|
1502
|
-
`).entries())
|
|
1503
|
-
r && e.append(document.createElement("br")), e.append(document.createTextNode(a));
|
|
1504
|
-
return;
|
|
1505
|
-
}
|
|
1506
|
-
let n = new DOMParser().parseFromString(t, "text/html");
|
|
1507
|
-
for (let r of Array.from(n.body.childNodes)) {
|
|
1508
|
-
let a = mn(r, o);
|
|
1509
|
-
a && e.append(a);
|
|
1510
|
-
}
|
|
1322
|
+
if (tt = !0, Yr(), Ar(), zr(), Qr(), e.ui === !1) return;
|
|
1323
|
+
let t = bt(H().locale);
|
|
1324
|
+
Hr((r) => {
|
|
1325
|
+
re(r.message ?? t.crashed, "error", { label: t.crashAction, onClick: () => ft(r) });
|
|
1326
|
+
}), Dn(), !document.querySelector(ne) && document.body.append(document.createElement(ne));
|
|
1511
1327
|
}
|
|
1512
|
-
var
|
|
1513
|
-
function
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
let o = e, n = o.tagName.toLowerCase();
|
|
1517
|
-
if (Gr.has(n)) return null;
|
|
1518
|
-
let r = Vr.has(n), a = r ? document.createElement(n) : document.createDocumentFragment();
|
|
1519
|
-
if (r) {
|
|
1520
|
-
let l = a;
|
|
1521
|
-
for (let s of Array.from(o.attributes)) {
|
|
1522
|
-
let c = s.name.toLowerCase();
|
|
1523
|
-
if (qr.has(c) && !(c === "href" && !Zr(s.value))) {
|
|
1524
|
-
if (c === "src") {
|
|
1525
|
-
if (n !== "img" || !Yr(s.value, t)) continue;
|
|
1526
|
-
l.setAttribute("src", ea(s.value, t));
|
|
1527
|
-
continue;
|
|
1528
|
-
}
|
|
1529
|
-
l.setAttribute(c, s.value);
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
if (n === "a" && (l.setAttribute("target", "_blank"), l.setAttribute("rel", "noopener noreferrer nofollow")), n === "img" && !l.getAttribute("src")) return null;
|
|
1533
|
-
}
|
|
1534
|
-
for (let l of Array.from(o.childNodes)) {
|
|
1535
|
-
let s = mn(l, t);
|
|
1536
|
-
s && a.append(s);
|
|
1537
|
-
}
|
|
1538
|
-
return a;
|
|
1328
|
+
var Un = "/sso";
|
|
1329
|
+
function Nn(e, t, r) {
|
|
1330
|
+
let n = new URL(Un, e.endsWith("/") ? e : `${e}/`);
|
|
1331
|
+
return n.searchParams.set("realm", t), n.searchParams.set("token", r), n.toString();
|
|
1539
1332
|
}
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
let n = jr(t);
|
|
1544
|
-
if (n) for (let r of Array.from(o.querySelectorAll("img"))) {
|
|
1545
|
-
let a = r.getAttribute("src") ?? "";
|
|
1546
|
-
a.startsWith(`${n}/`) && r.setAttribute("src", a.slice(n.length));
|
|
1333
|
+
class rt extends Error {
|
|
1334
|
+
constructor(t = "No identity provider is configured, or nobody is signed in") {
|
|
1335
|
+
super(t), this.name = "NoIdentityError";
|
|
1547
1336
|
}
|
|
1548
|
-
return o.innerHTML;
|
|
1549
1337
|
}
|
|
1550
|
-
function
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1338
|
+
async function Bn(e = {}) {
|
|
1339
|
+
let t = H();
|
|
1340
|
+
if (!t.identity) throw new rt();
|
|
1341
|
+
let r = await t.identity();
|
|
1342
|
+
if (!r) throw new rt();
|
|
1343
|
+
let n = Nn(t.host, t.realmKey, r);
|
|
1344
|
+
e.target === "_blank" ? window.open(n, "_blank", "noopener,noreferrer") : window.location.assign(n);
|
|
1556
1345
|
}
|
|
1557
|
-
|
|
1558
|
-
return e ? /<img\b/i.test(e) ? !1 : e.replace(/<[^>]*>/g, "").replace(/ /g, " ").trim() === "" : !0;
|
|
1559
|
-
}
|
|
1560
|
-
function ea(e, t) {
|
|
1561
|
-
let o = e.trim();
|
|
1562
|
-
return o.startsWith("/") ? `${t.replace(/\/$/, "")}${o}` : o;
|
|
1563
|
-
}
|
|
1564
|
-
var ta = ["bold", "italic", "underline", "bulletList", "orderedList", "link", "image"], na = { title: "ปัญหาที่แจ้ง", intro: "ปัญหาที่คุณแจ้งไว้ พร้อมสถานะล่าสุด", searchPlaceholder: "ค้นหาเลขที่/หัวข้อ/โมดูล", searchLabel: "ค้นหาปัญหาที่แจ้ง", allStatuses: "ทุกสถานะ", count: (e) => `${e} รายการ`, colNumber: "เลขที่", colTitle: "หัวข้อ", colModule: "โมดูล", colStatus: "สถานะ", colResponse: "คำตอบจากทีม", colCreated: "แจ้งเมื่อ", colUpdated: "อัปเดตล่าสุด", awaitingReply: "รอคุณตอบกลับ", hasSolution: "มีวิธีแก้ไข", hasReply: "ตอบกลับแล้ว", noReply: "ยังไม่มีการตอบกลับ", empty: "คุณยังไม่ได้แจ้งปัญหา", emptyFiltered: "ไม่พบรายการที่ตรงกับการค้นหา", loading: "กำลังโหลด…", listFailed: "โหลดรายการไม่สำเร็จ", detailFailed: "โหลดรายงานไม่สำเร็จ", signedOut: "กรุณาเข้าสู่ระบบเพื่อดูปัญหาที่แจ้งไว้", back: "กลับไปรายการ", reportedBy: "แจ้งเมื่อ", conversation: "การสนทนา", resolution: "วิธีแก้ไข", noMessages: "ยังไม่มีข้อความ", you: "คุณ", team: "ทีมงาน", reporterRole: "ผู้แจ้ง", edited: "แก้ไขแล้ว", edit: "แก้ไข", saveEdit: "บันทึกการแก้ไข", cancel: "ยกเลิก", replyPlaceholder: "พิมพ์ข้อความถึงทีมงาน", bold: "ตัวหนา", italic: "ตัวเอียง", underline: "ขีดเส้นใต้", strike: "ขีดฆ่า", code: "โค้ด", blockquote: "ยกคำพูด", bulletList: "รายการหัวข้อ", orderedList: "รายการตัวเลข", link: "ลิงก์", linkPrompt: "ใส่ลิงก์", linkNeedsSelection: "เลือกข้อความที่ต้องการทำลิงก์ก่อน", linkInvalid: "ลิงก์ต้องขึ้นต้นด้วย http:// หรือ https://", attachImage: "แนบรูป", uploading: "กำลังอัปโหลดรูป…", send: "ส่งข้อความ", sending: "กำลังส่ง…", sent: "ส่งข้อความแล้ว", sendFailed: "ส่งไม่สำเร็จ ลองใหม่อีกครั้ง", reopen: "ยังมีปัญหา", reopenHint: "ถ้าปัญหายังไม่หาย แจ้งทีมงานอีกครั้งได้", reopening: "กำลังแจ้ง…", reopened: "แจ้งทีมงานอีกครั้งแล้ว — เรากำลังดูให้ครับ", reopenFailed: "เปิดเรื่องไม่สำเร็จ ลองใหม่อีกครั้ง", close: "ปิด", retry: "ลองใหม่", page: "หน้า", of: (e, t) => `หน้า ${e} จาก ${t}`, prev: "ก่อนหน้า", next: "ถัดไป" }, oa = { title: "My reports", intro: "The problems you have reported, with their latest status", searchPlaceholder: "Search number / title / module", searchLabel: "Search my reports", allStatuses: "All statuses", count: (e) => `${e} item${e === 1 ? "" : "s"}`, colNumber: "No.", colTitle: "Title", colModule: "Module", colStatus: "Status", colResponse: "Team response", colCreated: "Reported", colUpdated: "Last update", awaitingReply: "Awaiting your reply", hasSolution: "Solution provided", hasReply: "Replied", noReply: "No reply yet", empty: "You have not reported anything yet", emptyFiltered: "Nothing matches that search", loading: "Loading…", listFailed: "Could not load your reports", detailFailed: "Could not load this report", signedOut: "Sign in to see the problems you have reported", back: "Back to the list", reportedBy: "Reported", conversation: "Conversation", resolution: "Solution", noMessages: "No messages yet", you: "You", team: "Support", reporterRole: "Reporter", edited: "edited", edit: "Edit", saveEdit: "Save changes", cancel: "Cancel", replyPlaceholder: "Write a message to the team", bold: "Bold", italic: "Italic", underline: "Underline", strike: "Strikethrough", code: "Code", blockquote: "Quote", bulletList: "Bulleted list", orderedList: "Numbered list", link: "Link", linkPrompt: "Enter a link", linkNeedsSelection: "Select the text you want to link first", linkInvalid: "A link must start with http:// or https://", attachImage: "Add an image", uploading: "Uploading the image…", send: "Send", sending: "Sending…", sent: "Message sent", sendFailed: "Could not send — try again", reopen: "Still a problem", reopenHint: "If the problem is not fixed, tell the team again", reopening: "Sending…", reopened: "The team has been notified — we are looking at it", reopenFailed: "Could not reopen — try again", close: "Close", retry: "Try again", page: "Page", of: (e, t) => `Page ${e} of ${t}`, prev: "Previous", next: "Next" };
|
|
1565
|
-
function ra(e) {
|
|
1566
|
-
return e === "en" ? oa : na;
|
|
1567
|
-
}
|
|
1568
|
-
const aa = { style: { display: "none" } }, Bi = /* @__PURE__ */ J({
|
|
1346
|
+
const Pn = { style: { display: "none" } }, Jn = /* @__PURE__ */ me({
|
|
1569
1347
|
__name: "DebugCaptureInit",
|
|
1570
1348
|
props: {
|
|
1571
1349
|
ui: { type: Boolean, default: !0 },
|
|
@@ -1574,11 +1352,11 @@ const aa = { style: { display: "none" } }, Bi = /* @__PURE__ */ J({
|
|
|
1574
1352
|
},
|
|
1575
1353
|
setup(e) {
|
|
1576
1354
|
const t = e;
|
|
1577
|
-
return t.config && !
|
|
1578
|
-
t.errorQueries &&
|
|
1579
|
-
}), (
|
|
1355
|
+
return t.config && !ot() && Ut(t.config), zt(() => {
|
|
1356
|
+
t.errorQueries && Ln(t.errorQueries), Hn({ ui: t.ui });
|
|
1357
|
+
}), (r, n) => (ge(), ye("span", Pn));
|
|
1580
1358
|
}
|
|
1581
|
-
}),
|
|
1359
|
+
}), Qn = () => F(
|
|
1582
1360
|
"svg",
|
|
1583
1361
|
{
|
|
1584
1362
|
width: 20,
|
|
@@ -1592,1405 +1370,70 @@ const aa = { style: { display: "none" } }, Bi = /* @__PURE__ */ J({
|
|
|
1592
1370
|
"aria-hidden": "true"
|
|
1593
1371
|
},
|
|
1594
1372
|
[
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1373
|
+
F("path", { d: "M8 2l1.9 1.9M16 2l-1.9 1.9" }),
|
|
1374
|
+
F("rect", { x: 8, y: 6, width: 8, height: 14, rx: 4 }),
|
|
1375
|
+
F("path", { d: "M3 13h5M16 13h5M4 8l3 2M20 8l-3 2M4 18l3-2M20 18l-3-2" })
|
|
1598
1376
|
]
|
|
1599
|
-
),
|
|
1377
|
+
), In = ["aria-label", "title"], _n = /* @__PURE__ */ me({
|
|
1600
1378
|
__name: "ReportProblemButton",
|
|
1601
1379
|
props: {
|
|
1602
1380
|
label: { default: "รายงานปัญหา" }
|
|
1603
1381
|
},
|
|
1604
1382
|
setup(e) {
|
|
1605
|
-
function t(
|
|
1606
|
-
|
|
1383
|
+
function t(r) {
|
|
1384
|
+
r.defaultPrevented || ft({ type: "manual" });
|
|
1607
1385
|
}
|
|
1608
|
-
return (
|
|
1386
|
+
return (r, n) => (ge(), ye("button", {
|
|
1609
1387
|
type: "button",
|
|
1610
1388
|
"aria-label": e.label,
|
|
1611
1389
|
title: e.label,
|
|
1612
1390
|
onClick: t
|
|
1613
1391
|
}, [
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
])
|
|
1617
|
-
], 8, ia));
|
|
1618
|
-
}
|
|
1619
|
-
}), sa = /* @__PURE__ */ J({
|
|
1620
|
-
__name: "StatusPill",
|
|
1621
|
-
props: {
|
|
1622
|
-
label: {},
|
|
1623
|
-
tone: {}
|
|
1624
|
-
},
|
|
1625
|
-
setup(e) {
|
|
1626
|
-
return (t, o) => (m(), v("span", {
|
|
1627
|
-
class: "lw-status",
|
|
1628
|
-
style: xe({ background: e.tone.bg, color: e.tone.fg })
|
|
1629
|
-
}, y(e.label), 5));
|
|
1630
|
-
}
|
|
1631
|
-
});
|
|
1632
|
-
function U(e, t = {}) {
|
|
1633
|
-
return () => be(
|
|
1634
|
-
"svg",
|
|
1635
|
-
{
|
|
1636
|
-
width: 15,
|
|
1637
|
-
height: 15,
|
|
1638
|
-
viewBox: "0 0 24 24",
|
|
1639
|
-
fill: "none",
|
|
1640
|
-
stroke: "currentColor",
|
|
1641
|
-
"stroke-width": 2,
|
|
1642
|
-
"stroke-linecap": "round",
|
|
1643
|
-
"stroke-linejoin": "round",
|
|
1644
|
-
"aria-hidden": "true",
|
|
1645
|
-
...t
|
|
1646
|
-
},
|
|
1647
|
-
e.map((n) => be("path", { d: n }))
|
|
1648
|
-
);
|
|
1649
|
-
}
|
|
1650
|
-
const ua = U(["M6 4h8a4 4 0 0 1 0 8H6z", "M6 12h9a4 4 0 0 1 0 8H6z"]), ca = U(["M19 4h-9", "M14 20H5", "M15 4L9 20"]), da = U(["M6 4v6a6 6 0 0 0 12 0V4", "M4 20h16"]), fa = U([
|
|
1651
|
-
"M8 6h13",
|
|
1652
|
-
"M8 12h13",
|
|
1653
|
-
"M8 18h13",
|
|
1654
|
-
"M3 6h.01",
|
|
1655
|
-
"M3 12h.01",
|
|
1656
|
-
"M3 18h.01"
|
|
1657
|
-
]), ha = U([
|
|
1658
|
-
"M10 6h11",
|
|
1659
|
-
"M10 12h11",
|
|
1660
|
-
"M10 18h11",
|
|
1661
|
-
"M4 6h1v4",
|
|
1662
|
-
"M4 10h2",
|
|
1663
|
-
"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"
|
|
1664
|
-
]), pa = U([
|
|
1665
|
-
"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",
|
|
1666
|
-
"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
|
|
1667
|
-
]), Dt = U([
|
|
1668
|
-
"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2z",
|
|
1669
|
-
"M8.5 10a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z",
|
|
1670
|
-
"M21 15l-5-5L5 21"
|
|
1671
|
-
]), ma = U(["M22 2L11 13", "M22 2l-7 20-4-9-9-4 20-7z"]), ga = U(["M21 21l-4.34-4.34", "M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16z"]), ba = U(["M19 12H5", "M12 19l-7-7 7-7"]), ya = U(["M20 6L9 17l-5-5"]), je = U(["M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"]), We = U(["M3 12a9 9 0 1 0 3-6.7L3 8", "M3 3v5h5"]), va = U(["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z", "M12 8v4", "M12 16h.01"]), wa = U([
|
|
1672
|
-
"M22 12h-6l-2 3h-4l-2-3H2",
|
|
1673
|
-
"M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"
|
|
1674
|
-
]), ka = U(["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z", "M12 6v6l4 2"]), Ot = U(["M22 11.08V12a10 10 0 1 1-5.93-9.14", "M22 4L12 14.01l-3-3"]), xa = U(["M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z", "M4.93 4.93l14.14 14.14"]), Ma = U([
|
|
1675
|
-
"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"
|
|
1676
|
-
]), Sa = U(["M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2z"], { width: 14, height: 14 }), Ea = U(["M7 17L17 7", "M7 7h10v10"], { width: 14, height: 14 }), Ca = U([
|
|
1677
|
-
"M9 11l-6 6v3h9l3-3",
|
|
1678
|
-
"M22 12l-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"
|
|
1679
|
-
], { width: 14, height: 14 }), Aa = U(["M4 7V4h16v3", "M9 20h6", "M12 4v16"], { width: 14, height: 14 }), La = U([
|
|
1680
|
-
"M3 6h18",
|
|
1681
|
-
"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"
|
|
1682
|
-
], { width: 14, height: 14 }), Ta = U(["M16 4H9a3 3 0 0 0-2.83 4", "M14 12a4 4 0 0 1 0 8H6", "M4 12h16"]), _a = U(["M16 18l6-6-6-6", "M8 6l-6 6 6 6"]), Ra = U([
|
|
1683
|
-
"M3 21c3 0 7-1 7-8V5a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h3",
|
|
1684
|
-
"M14 21c3 0 7-1 7-8V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h3"
|
|
1685
|
-
]), Ia = U([
|
|
1686
|
-
"M12 20h9",
|
|
1687
|
-
"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z"
|
|
1688
|
-
], { width: 11, height: 11 }), za = U(["M20 6L9 17l-5-5"], { width: 12, height: 12 }), Na = U(["M18 6L6 18", "M6 6l12 12"], { width: 12, height: 12 }), Pa = { class: "lw-tablewrap" }, Ua = { class: "lw-table" }, Da = ["aria-sort", "onClick"], Oa = { class: "lw-arrow" }, Ba = { key: 0 }, Ha = ["colspan"], Fa = ["onClick", "onKeydown"], $a = { class: "lw-num" }, Qa = { class: "lw-title" }, Va = {
|
|
1689
|
-
key: 0,
|
|
1690
|
-
class: "lw-chip"
|
|
1691
|
-
}, qa = {
|
|
1692
|
-
key: 1,
|
|
1693
|
-
class: "lw-dash"
|
|
1694
|
-
}, Ja = {
|
|
1695
|
-
key: 0,
|
|
1696
|
-
class: "lw-pill lw-pill--awaiting"
|
|
1697
|
-
}, Za = {
|
|
1698
|
-
key: 0,
|
|
1699
|
-
class: "lw-pill lw-pill--solution"
|
|
1700
|
-
}, Ya = {
|
|
1701
|
-
key: 1,
|
|
1702
|
-
class: "lw-pill lw-pill--replied"
|
|
1703
|
-
}, Xa = {
|
|
1704
|
-
key: 2,
|
|
1705
|
-
class: "lw-muted"
|
|
1706
|
-
}, Ga = { class: "lw-dim" }, Ka = { class: "lw-dim" }, ja = {
|
|
1707
|
-
key: 0,
|
|
1708
|
-
class: "lw-pager"
|
|
1709
|
-
}, Wa = ["disabled"], el = ["disabled"], tl = /* @__PURE__ */ J({
|
|
1710
|
-
__name: "TicketTable",
|
|
1711
|
-
props: {
|
|
1712
|
-
items: {},
|
|
1713
|
-
maps: {},
|
|
1714
|
-
t: {},
|
|
1715
|
-
slug: {},
|
|
1716
|
-
timezone: {},
|
|
1717
|
-
locale: {},
|
|
1718
|
-
keyword: {},
|
|
1719
|
-
statusFilter: {},
|
|
1720
|
-
sort: {},
|
|
1721
|
-
page: {}
|
|
1722
|
-
},
|
|
1723
|
-
emits: ["open", "sort", "page"],
|
|
1724
|
-
setup(e, { expose: t, emit: o }) {
|
|
1725
|
-
const n = e, r = o, a = [
|
|
1726
|
-
{ key: "number", label: "colNumber", width: "120px" },
|
|
1727
|
-
{ key: "title", label: "colTitle" },
|
|
1728
|
-
{ key: "module", label: "colModule", width: "160px" },
|
|
1729
|
-
{ key: "status", label: "colStatus", width: "130px" },
|
|
1730
|
-
{ key: "response", label: "colResponse", width: "150px" },
|
|
1731
|
-
{ key: "createdAt", label: "colCreated", width: "170px" },
|
|
1732
|
-
{ key: "updatedAt", label: "colUpdated", width: "170px" }
|
|
1733
|
-
], l = F(
|
|
1734
|
-
() => n.items.filter((w) => n.statusFilter ? w.status === n.statusFilter : !0).filter((w) => Br(w, n.keyword, n.slug, n.maps.labelOf)).sort(Hr(n.sort, n.maps, n.slug))
|
|
1735
|
-
), s = F(() => $r(l.value.length)), c = F(() => Math.min(n.page, s.value)), g = F(() => Fr(l.value, c.value));
|
|
1736
|
-
t({ count: F(() => l.value.length) });
|
|
1737
|
-
function k(w) {
|
|
1738
|
-
return He(w, n.timezone, n.locale);
|
|
1739
|
-
}
|
|
1740
|
-
return (w, S) => (m(), v(q, null, [
|
|
1741
|
-
f("div", Pa, [
|
|
1742
|
-
f("table", Ua, [
|
|
1743
|
-
f("thead", null, [
|
|
1744
|
-
f("tr", null, [
|
|
1745
|
-
(m(), v(q, null, ae(a, (E) => f("th", {
|
|
1746
|
-
key: E.key,
|
|
1747
|
-
scope: "col",
|
|
1748
|
-
class: "lw-th",
|
|
1749
|
-
style: xe(E.width ? { width: E.width } : void 0),
|
|
1750
|
-
"aria-sort": e.sort.key === E.key ? e.sort.direction === "asc" ? "ascending" : "descending" : void 0,
|
|
1751
|
-
onClick: (T) => r("sort", E.key)
|
|
1752
|
-
}, [
|
|
1753
|
-
V(y(e.t[E.label]) + " ", 1),
|
|
1754
|
-
f("span", Oa, y(e.sort.key === E.key ? e.sort.direction === "asc" ? "▲" : "▼" : "⇅"), 1)
|
|
1755
|
-
], 12, Da)), 64))
|
|
1756
|
-
])
|
|
1757
|
-
]),
|
|
1758
|
-
f("tbody", null, [
|
|
1759
|
-
g.value.length ? B("", !0) : (m(), v("tr", Ba, [
|
|
1760
|
-
f("td", {
|
|
1761
|
-
colspan: a.length,
|
|
1762
|
-
class: "lw-empty"
|
|
1763
|
-
}, y(e.items.length === 0 ? e.t.empty : e.t.emptyFiltered), 9, Ha)
|
|
1764
|
-
])),
|
|
1765
|
-
(m(!0), v(q, null, ae(g.value, (E) => {
|
|
1766
|
-
var T;
|
|
1767
|
-
return m(), v("tr", {
|
|
1768
|
-
key: E.id,
|
|
1769
|
-
class: "lw-row",
|
|
1770
|
-
tabindex: "0",
|
|
1771
|
-
onClick: (R) => r("open", E.id),
|
|
1772
|
-
onKeydown: vn($t((R) => r("open", E.id), ["prevent"]), ["enter", "space"])
|
|
1773
|
-
}, [
|
|
1774
|
-
f("td", $a, y(P(it)(e.slug, E.number)), 1),
|
|
1775
|
-
f("td", Qa, y(E.title), 1),
|
|
1776
|
-
f("td", null, [
|
|
1777
|
-
E.category ? (m(), v("span", Va, y(E.category), 1)) : (m(), v("span", qa, "—"))
|
|
1778
|
-
]),
|
|
1779
|
-
f("td", null, [
|
|
1780
|
-
e.maps.isAwaitingReply(E.status) ? (m(), v("span", Ja, [
|
|
1781
|
-
O(P(je)),
|
|
1782
|
-
V(" " + y(e.t.awaitingReply), 1)
|
|
1783
|
-
])) : (m(), G(sa, {
|
|
1784
|
-
key: 1,
|
|
1785
|
-
label: e.maps.labelOf(E.status),
|
|
1786
|
-
tone: P(Qr)((T = e.maps.columnOf(E.status)) == null ? void 0 : T.color)
|
|
1787
|
-
}, null, 8, ["label", "tone"]))
|
|
1788
|
-
]),
|
|
1789
|
-
f("td", null, [
|
|
1790
|
-
P(dn)(E) ? (m(), v("span", Za, [
|
|
1791
|
-
O(P(ya)),
|
|
1792
|
-
V(" " + y(e.t.hasSolution), 1)
|
|
1793
|
-
])) : P(fn)(E) ? (m(), v("span", Ya, [
|
|
1794
|
-
O(P(je)),
|
|
1795
|
-
V(" " + y(e.t.hasReply), 1)
|
|
1796
|
-
])) : (m(), v("span", Xa, y(e.t.noReply), 1))
|
|
1797
|
-
]),
|
|
1798
|
-
f("td", Ga, y(k(E.createdAt)), 1),
|
|
1799
|
-
f("td", Ka, y(k(E.updatedAt)), 1)
|
|
1800
|
-
], 40, Fa);
|
|
1801
|
-
}), 128))
|
|
1802
|
-
])
|
|
1803
|
-
])
|
|
1804
|
-
]),
|
|
1805
|
-
l.value.length > g.value.length || c.value > 1 ? (m(), v("div", ja, [
|
|
1806
|
-
f("span", null, y(e.t.of(c.value, s.value)), 1),
|
|
1807
|
-
f("button", {
|
|
1808
|
-
type: "button",
|
|
1809
|
-
class: "lw-btn",
|
|
1810
|
-
disabled: c.value <= 1,
|
|
1811
|
-
onClick: S[0] || (S[0] = (E) => r("page", c.value - 1))
|
|
1812
|
-
}, y(e.t.prev), 9, Wa),
|
|
1813
|
-
f("button", {
|
|
1814
|
-
type: "button",
|
|
1815
|
-
class: "lw-btn",
|
|
1816
|
-
disabled: c.value >= s.value,
|
|
1817
|
-
onClick: S[1] || (S[1] = (E) => r("page", c.value + 1))
|
|
1818
|
-
}, y(e.t.next), 9, el)
|
|
1819
|
-
])) : B("", !0)
|
|
1820
|
-
], 64));
|
|
1821
|
-
}
|
|
1822
|
-
}), nl = ["src"], st = /* @__PURE__ */ J({
|
|
1823
|
-
__name: "TicketBody",
|
|
1824
|
-
props: {
|
|
1825
|
-
html: {},
|
|
1826
|
-
host: {}
|
|
1827
|
-
},
|
|
1828
|
-
setup(e) {
|
|
1829
|
-
const t = e, o = N(null), n = N(null);
|
|
1830
|
-
function r(l) {
|
|
1831
|
-
const s = l.target;
|
|
1832
|
-
if (!s || s.tagName !== "IMG") return;
|
|
1833
|
-
const c = s.getAttribute("src");
|
|
1834
|
-
c && (n.value = c);
|
|
1835
|
-
}
|
|
1836
|
-
function a() {
|
|
1837
|
-
o.value && pn(o.value, t.html, t.host);
|
|
1838
|
-
}
|
|
1839
|
-
return Oe(a), re(() => [t.html, t.host], a), (l, s) => (m(), v(q, null, [
|
|
1840
|
-
f("div", {
|
|
1841
|
-
ref_key: "target",
|
|
1842
|
-
ref: o,
|
|
1843
|
-
class: "lw-body",
|
|
1844
|
-
onClick: r
|
|
1845
|
-
}, null, 512),
|
|
1846
|
-
n.value ? (m(), v("div", {
|
|
1847
|
-
key: 0,
|
|
1848
|
-
class: "lw-zoom",
|
|
1849
|
-
role: "dialog",
|
|
1850
|
-
"aria-modal": "true",
|
|
1851
|
-
onClick: s[0] || (s[0] = (c) => n.value = null)
|
|
1852
|
-
}, [
|
|
1853
|
-
s[1] || (s[1] = f("button", {
|
|
1854
|
-
type: "button",
|
|
1855
|
-
class: "lw-zoom__close",
|
|
1856
|
-
"aria-label": "close"
|
|
1857
|
-
}, "✕", -1)),
|
|
1858
|
-
f("img", {
|
|
1859
|
-
src: n.value,
|
|
1860
|
-
alt: ""
|
|
1861
|
-
}, null, 8, nl)
|
|
1862
|
-
])) : B("", !0)
|
|
1863
|
-
], 64));
|
|
1864
|
-
}
|
|
1865
|
-
}), ol = { class: "lw-hero__body" }, rl = { class: "lw-hero__kicker" }, al = {
|
|
1866
|
-
key: 0,
|
|
1867
|
-
class: "lw-hero__nudge"
|
|
1868
|
-
}, ll = {
|
|
1869
|
-
key: 1,
|
|
1870
|
-
class: "lw-hero__note"
|
|
1871
|
-
}, il = /* @__PURE__ */ J({
|
|
1872
|
-
__name: "StatusHero",
|
|
1873
|
-
props: {
|
|
1874
|
-
ticket: {},
|
|
1875
|
-
maps: {},
|
|
1876
|
-
t: {},
|
|
1877
|
-
locale: {},
|
|
1878
|
-
host: {}
|
|
1879
|
-
},
|
|
1880
|
-
setup(e) {
|
|
1881
|
-
const t = e, o = {
|
|
1882
|
-
OPEN: { icon: wa, border: "#bfdbfe", bg: "#eff6ff", fg: "#1e3a8a", accent: "#3b82f6" },
|
|
1883
|
-
IN_PROGRESS: { icon: ka, border: "#fde68a", bg: "#fffbeb", fg: "#78350f", accent: "#f59e0b" },
|
|
1884
|
-
RESOLVED: { icon: Ot, border: "#a7f3d0", bg: "#ecfdf5", fg: "#064e3b", accent: "#10b981" },
|
|
1885
|
-
CLOSED: { icon: Ot, border: "#e5e7eb", bg: "#f9fafb", fg: "#1f2937", accent: "#9ca3af" },
|
|
1886
|
-
WONT_FIX: { icon: xa, border: "#e5e7eb", bg: "#f9fafb", fg: "#374151", accent: "#9ca3af" }
|
|
1887
|
-
}, n = { icon: je, border: "#fcd34d", bg: "#fffbeb", fg: "#78350f", accent: "#f59e0b" }, r = {
|
|
1888
|
-
OPEN: { th: "รับเรื่องแล้ว — รอทีมงานตรวจสอบ", en: "Received — waiting for the team to look" },
|
|
1889
|
-
IN_PROGRESS: { th: "ทีมงานกำลังดำเนินการแก้ไข", en: "The team is working on it" },
|
|
1890
|
-
RESOLVED: { th: "แก้ไขเรียบร้อยแล้ว", en: "Fixed" },
|
|
1891
|
-
CLOSED: { th: "ปิดเรื่องแล้ว", en: "Closed" },
|
|
1892
|
-
WONT_FIX: { th: "พิจารณาแล้ว — ยังไม่ได้ดำเนินการในขณะนี้", en: "Reviewed — not being worked on for now" }
|
|
1893
|
-
}, a = F(() => t.maps.isAwaitingReply(t.ticket.status)), l = F(() => a.value ? n : o[t.ticket.status] ?? o.OPEN), s = F(() => {
|
|
1894
|
-
var k, w, S;
|
|
1895
|
-
return a.value ? t.locale === "en" ? "The team needs more information from you" : "ทีมงานขอข้อมูลเพิ่มเติม — รอการตอบกลับจากคุณ" : ((w = (k = t.maps.columnOf(t.ticket.status)) == null ? void 0 : k.description) == null ? void 0 : w.trim()) || ((S = r[t.ticket.status]) == null ? void 0 : S[t.locale]) || t.maps.labelOf(t.ticket.status);
|
|
1896
|
-
}), c = F(
|
|
1897
|
-
() => {
|
|
1898
|
-
var g;
|
|
1899
|
-
return !a.value && !t.ticket.messages.some((k) => k.authorRole === "AGENT") && t.maps.isClosed(t.ticket.status) && !!((g = t.ticket.resolutionNote) != null && g.trim());
|
|
1900
|
-
}
|
|
1901
|
-
);
|
|
1902
|
-
return (g, k) => (m(), v("section", {
|
|
1903
|
-
class: "lw-hero",
|
|
1904
|
-
style: xe({ borderColor: l.value.border, background: l.value.bg })
|
|
1905
|
-
}, [
|
|
1906
|
-
(m(), G(et(l.value.icon), {
|
|
1907
|
-
class: "lw-hero__icon",
|
|
1908
|
-
style: xe({ color: l.value.accent })
|
|
1909
|
-
}, null, 8, ["style"])),
|
|
1910
|
-
f("div", ol, [
|
|
1911
|
-
f("p", rl, y(a.value ? e.locale === "en" ? "AWAITING YOUR REPLY" : "รอการตอบกลับจากคุณ" : e.locale === "en" ? "LATEST STATUS" : "สถานะล่าสุด"), 1),
|
|
1912
|
-
f("p", {
|
|
1913
|
-
class: "lw-hero__headline",
|
|
1914
|
-
style: xe({ color: l.value.fg })
|
|
1915
|
-
}, y(s.value), 5),
|
|
1916
|
-
a.value ? (m(), v("p", al, y(e.locale === "en" ? "Please reply to the team in the conversation below" : "กรุณาตอบกลับให้ทีมงานในช่องแชทด้านล่าง"), 1)) : B("", !0),
|
|
1917
|
-
c.value ? (m(), v("div", ll, [
|
|
1918
|
-
O(P(Ma), { class: "lw-hero__wrench" }),
|
|
1919
|
-
O(st, {
|
|
1920
|
-
html: e.ticket.resolutionNote ?? "",
|
|
1921
|
-
host: e.host
|
|
1922
|
-
}, null, 8, ["html", "host"])
|
|
1923
|
-
])) : B("", !0)
|
|
1392
|
+
nt(r.$slots, "default", {}, () => [
|
|
1393
|
+
Lt(Tt(Qn))
|
|
1924
1394
|
])
|
|
1925
|
-
],
|
|
1395
|
+
], 8, In));
|
|
1926
1396
|
}
|
|
1927
|
-
}),
|
|
1928
|
-
|
|
1929
|
-
class: "lw-reopen__row"
|
|
1930
|
-
}, cl = { class: "lw-reopen__hint" }, dl = { key: 1 }, fl = { class: "lw-reopen__title" }, hl = ["placeholder"], pl = { class: "lw-reopen__actions" }, ml = ["disabled"], gl = /* @__PURE__ */ J({
|
|
1931
|
-
__name: "ReopenPanel",
|
|
1397
|
+
}), On = ["aria-label", "title", "disabled"], Kn = /* @__PURE__ */ me({
|
|
1398
|
+
__name: "SupportPortalButton",
|
|
1932
1399
|
props: {
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
busy: { type: Boolean }
|
|
1400
|
+
label: { default: "ดูปัญหาที่แจ้ง" },
|
|
1401
|
+
newTab: { type: Boolean, default: !1 }
|
|
1936
1402
|
},
|
|
1937
|
-
emits: ["
|
|
1403
|
+
emits: ["error"],
|
|
1938
1404
|
setup(e, { emit: t }) {
|
|
1939
|
-
const
|
|
1940
|
-
function a() {
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
return (l, s) => (m(), v("section", sl, [
|
|
1944
|
-
n.value ? (m(), v("div", dl, [
|
|
1945
|
-
f("p", fl, y(e.t.reopen), 1),
|
|
1946
|
-
Je(f("textarea", {
|
|
1947
|
-
"onUpdate:modelValue": s[1] || (s[1] = (c) => r.value = c),
|
|
1948
|
-
rows: "2",
|
|
1949
|
-
class: "lw-reopen__note",
|
|
1950
|
-
placeholder: e.locale === "en" ? "Tell us what is still happening (optional)…" : "บอกเราหน่อยว่ายังพบปัญหาอะไร (ไม่ระบุก็ได้)…"
|
|
1951
|
-
}, null, 8, hl), [
|
|
1952
|
-
[Qt, r.value]
|
|
1953
|
-
]),
|
|
1954
|
-
f("div", pl, [
|
|
1955
|
-
f("button", {
|
|
1956
|
-
type: "button",
|
|
1957
|
-
class: "lw-reopen__cancel",
|
|
1958
|
-
onClick: s[2] || (s[2] = (c) => {
|
|
1959
|
-
n.value = !1, r.value = "";
|
|
1960
|
-
})
|
|
1961
|
-
}, y(e.locale === "en" ? "Cancel" : "ยกเลิก"), 1),
|
|
1962
|
-
f("button", {
|
|
1963
|
-
type: "button",
|
|
1964
|
-
class: "lw-reopen__confirm",
|
|
1965
|
-
disabled: e.busy,
|
|
1966
|
-
onClick: a
|
|
1967
|
-
}, [
|
|
1968
|
-
O(P(We)),
|
|
1969
|
-
V(" " + y(e.busy ? e.t.reopening : e.t.reopen), 1)
|
|
1970
|
-
], 8, ml)
|
|
1971
|
-
])
|
|
1972
|
-
])) : (m(), v("div", ul, [
|
|
1973
|
-
f("span", cl, y(e.locale === "en" ? "Problem not fixed?" : "ปัญหายังไม่หาย?"), 1),
|
|
1974
|
-
f("button", {
|
|
1975
|
-
type: "button",
|
|
1976
|
-
class: "lw-reopen__open",
|
|
1977
|
-
onClick: s[0] || (s[0] = (c) => n.value = !0)
|
|
1978
|
-
}, [
|
|
1979
|
-
O(P(We)),
|
|
1980
|
-
V(" " + y(e.t.reopen), 1)
|
|
1981
|
-
])
|
|
1982
|
-
]))
|
|
1983
|
-
]));
|
|
1984
|
-
}
|
|
1985
|
-
}), bl = { class: "lw-timeline" }, yl = { class: "lw-rail" }, vl = {
|
|
1986
|
-
key: 0,
|
|
1987
|
-
class: "lw-pip"
|
|
1988
|
-
}, wl = { class: "lw-node__time" }, kl = /* @__PURE__ */ J({
|
|
1989
|
-
__name: "TicketTimeline",
|
|
1990
|
-
props: {
|
|
1991
|
-
history: {},
|
|
1992
|
-
status: {},
|
|
1993
|
-
createdAt: {},
|
|
1994
|
-
maps: {},
|
|
1995
|
-
timezone: {},
|
|
1996
|
-
locale: {}
|
|
1997
|
-
},
|
|
1998
|
-
setup(e) {
|
|
1999
|
-
const t = e, o = ["OPEN", "IN_PROGRESS", "RESOLVED", "CLOSED"], n = F(() => {
|
|
2000
|
-
const r = t.history.length ? t.history.map((c) => ({ status: c.toStatus, at: c.createdAt })) : (
|
|
2001
|
-
// A row from before history was recorded still gets one node rather than
|
|
2002
|
-
// an empty section.
|
|
2003
|
-
[{ status: "OPEN", at: t.createdAt }]
|
|
2004
|
-
), a = r.map((c, g) => {
|
|
2005
|
-
const k = r[g - 1];
|
|
2006
|
-
return {
|
|
2007
|
-
label: g === 0 ? t.locale === "en" ? "Reported" : "รายงานปัญหา" : t.maps.labelOf(c.status),
|
|
2008
|
-
time: He(c.at, t.timezone, t.locale),
|
|
2009
|
-
state: g === r.length - 1 ? "current" : "done",
|
|
2010
|
-
reopened: !!(k && t.maps.isClosed(k.status) && !t.maps.isClosed(c.status))
|
|
2011
|
-
};
|
|
2012
|
-
}), l = o.indexOf(t.status), s = t.maps.isClosed(t.status) || l < 0 ? [] : o.slice(l + 1);
|
|
2013
|
-
for (const c of s)
|
|
2014
|
-
a.push({
|
|
2015
|
-
label: t.maps.labelOf(c),
|
|
2016
|
-
time: t.locale === "en" ? "Pending" : "รอดำเนินการ",
|
|
2017
|
-
state: "pending",
|
|
2018
|
-
reopened: !1
|
|
2019
|
-
});
|
|
2020
|
-
return a;
|
|
2021
|
-
});
|
|
2022
|
-
return (r, a) => (m(), v("ol", bl, [
|
|
2023
|
-
(m(!0), v(q, null, ae(n.value, (l, s) => (m(), v("li", {
|
|
2024
|
-
key: `${l.label}-${s}`,
|
|
2025
|
-
class: "lw-node"
|
|
2026
|
-
}, [
|
|
2027
|
-
f("div", yl, [
|
|
2028
|
-
s < n.value.length - 1 ? (m(), v("span", {
|
|
2029
|
-
key: 0,
|
|
2030
|
-
class: fe(["lw-line", { "lw-line--pending": l.state === "pending" }])
|
|
2031
|
-
}, null, 2)) : B("", !0),
|
|
2032
|
-
f("span", {
|
|
2033
|
-
class: fe(["lw-dot", [`lw-dot--${l.state}`, { "lw-dot--reopened": l.reopened }]])
|
|
2034
|
-
}, [
|
|
2035
|
-
l.state === "current" && !l.reopened ? (m(), v("span", vl)) : B("", !0)
|
|
2036
|
-
], 2)
|
|
2037
|
-
]),
|
|
2038
|
-
f("div", {
|
|
2039
|
-
class: fe(["lw-node__text", { "lw-node__text--last": s === n.value.length - 1 }])
|
|
2040
|
-
}, [
|
|
2041
|
-
f("div", {
|
|
2042
|
-
class: fe(["lw-node__label", [`lw-node__label--${l.state}`, { "lw-node__label--reopened": l.reopened }]])
|
|
2043
|
-
}, [
|
|
2044
|
-
l.reopened ? (m(), G(P(We), {
|
|
2045
|
-
key: 0,
|
|
2046
|
-
class: "lw-node__icon"
|
|
2047
|
-
})) : B("", !0),
|
|
2048
|
-
V(" " + y(l.reopened ? `${e.locale === "en" ? "Reopened" : "เปิดใหม่"} · ${l.label}` : l.label), 1)
|
|
2049
|
-
], 2),
|
|
2050
|
-
f("div", wl, y(l.time), 1)
|
|
2051
|
-
], 2)
|
|
2052
|
-
]))), 128))
|
|
2053
|
-
]));
|
|
2054
|
-
}
|
|
2055
|
-
}), xl = ["title", "aria-label", "aria-pressed", "disabled"], Bt = /* @__PURE__ */ J({
|
|
2056
|
-
__name: "ToolbarButton",
|
|
2057
|
-
props: {
|
|
2058
|
-
label: {},
|
|
2059
|
-
active: { type: Boolean },
|
|
2060
|
-
disabled: { type: Boolean }
|
|
2061
|
-
},
|
|
2062
|
-
emits: ["activate"],
|
|
2063
|
-
setup(e, { emit: t }) {
|
|
2064
|
-
const o = t;
|
|
2065
|
-
function n(r) {
|
|
2066
|
-
r.preventDefault(), o("activate");
|
|
2067
|
-
}
|
|
2068
|
-
return (r, a) => (m(), v("button", {
|
|
2069
|
-
type: "button",
|
|
2070
|
-
class: fe(["lw-tool", { "lw-tool--on": e.active }]),
|
|
2071
|
-
title: e.label,
|
|
2072
|
-
"aria-label": e.label,
|
|
2073
|
-
"aria-pressed": e.active ? "true" : "false",
|
|
2074
|
-
disabled: e.disabled,
|
|
2075
|
-
onMousedown: n
|
|
2076
|
-
}, [
|
|
2077
|
-
Ft(r.$slots, "default")
|
|
2078
|
-
], 42, xl));
|
|
2079
|
-
}
|
|
2080
|
-
}), Ml = { class: "lw-annotator__panel" }, Sl = { class: "lw-annotator__head" }, El = { class: "lw-grow" }, Cl = { class: "lw-annotator__title" }, Al = { class: "lw-annotator__desc" }, Ll = ["aria-label"], Tl = { class: "lw-annotator__tools" }, _l = ["aria-pressed", "disabled", "onClick"], Rl = ["disabled"], Il = { class: "lw-annotator__canvas" }, zl = { class: "lw-annotator__canvasbox" }, Nl = { class: "lw-annotator__hint" }, Pl = { class: "lw-annotator__actions" }, Ul = ["disabled"], Dl = /* @__PURE__ */ J({
|
|
2081
|
-
__name: "ImageAnnotatorDialog",
|
|
2082
|
-
props: {
|
|
2083
|
-
src: {},
|
|
2084
|
-
filename: {},
|
|
2085
|
-
locale: {}
|
|
2086
|
-
},
|
|
2087
|
-
emits: ["confirm", "cancel"],
|
|
2088
|
-
setup(e, { emit: t }) {
|
|
2089
|
-
const o = e, n = t, r = lt(o.locale ?? a());
|
|
2090
|
-
function a() {
|
|
2091
|
-
try {
|
|
2092
|
-
return X().locale;
|
|
2093
|
-
} catch {
|
|
2094
|
-
return;
|
|
2095
|
-
}
|
|
2096
|
-
}
|
|
2097
|
-
const l = [
|
|
2098
|
-
{ tool: "rect", key: "toolRect", icon: Sa },
|
|
2099
|
-
{ tool: "arrow", key: "toolArrow", icon: Ea },
|
|
2100
|
-
{ tool: "highlight", key: "toolHighlight", icon: Ca },
|
|
2101
|
-
{ tool: "text", key: "toolText", icon: Aa }
|
|
2102
|
-
], s = N(null), c = Vt(null), g = N(null), k = N(!0);
|
|
2103
|
-
re(
|
|
2104
|
-
() => [o.src, s.value],
|
|
2105
|
-
([T, R]) => {
|
|
2106
|
-
var M;
|
|
2107
|
-
if (!T || !R) return;
|
|
2108
|
-
(M = c.value) == null || M.destroy();
|
|
2109
|
-
const x = new Image();
|
|
2110
|
-
x.addEventListener("load", () => {
|
|
2111
|
-
R.width = x.naturalWidth, R.height = x.naturalHeight, c.value = ln(R, x, () => {
|
|
2112
|
-
g.value = null;
|
|
2113
|
-
}), k.value = !1;
|
|
2114
|
-
}), x.src = T;
|
|
2115
|
-
},
|
|
2116
|
-
{ immediate: !0 }
|
|
2117
|
-
), qt(() => {
|
|
2118
|
-
var T;
|
|
2119
|
-
return (T = c.value) == null ? void 0 : T.destroy();
|
|
2120
|
-
});
|
|
2121
|
-
function w(T) {
|
|
2122
|
-
var R;
|
|
2123
|
-
g.value = g.value === T ? null : T, (R = c.value) == null || R.setTool(g.value);
|
|
2124
|
-
}
|
|
2125
|
-
function S() {
|
|
2126
|
-
var T;
|
|
2127
|
-
(T = c.value) == null || T.clear(), g.value = null;
|
|
2128
|
-
}
|
|
2129
|
-
function E() {
|
|
2130
|
-
var T;
|
|
2131
|
-
n("confirm", ((T = c.value) == null ? void 0 : T.toDataUrl()) ?? o.src ?? "");
|
|
2132
|
-
}
|
|
2133
|
-
return (T, R) => e.src ? (m(), v("div", {
|
|
2134
|
-
key: 0,
|
|
2135
|
-
class: "lw-annotator",
|
|
2136
|
-
role: "dialog",
|
|
2137
|
-
"aria-modal": "true",
|
|
2138
|
-
onClick: R[2] || (R[2] = $t((x) => n("cancel"), ["self"]))
|
|
2139
|
-
}, [
|
|
2140
|
-
f("div", Ml, [
|
|
2141
|
-
f("div", Sl, [
|
|
2142
|
-
f("div", El, [
|
|
2143
|
-
f("h2", Cl, y(P(r).annotateTitle), 1),
|
|
2144
|
-
f("p", Al, [
|
|
2145
|
-
V(y(P(r).annotateHint), 1),
|
|
2146
|
-
e.filename ? (m(), v(q, { key: 0 }, [
|
|
2147
|
-
V(" · " + y(e.filename), 1)
|
|
2148
|
-
], 64)) : B("", !0)
|
|
2149
|
-
])
|
|
2150
|
-
]),
|
|
2151
|
-
f("button", {
|
|
2152
|
-
type: "button",
|
|
2153
|
-
class: "lw-annotator__close",
|
|
2154
|
-
"aria-label": P(r).cancel,
|
|
2155
|
-
onClick: R[0] || (R[0] = (x) => n("cancel"))
|
|
2156
|
-
}, "✕", 8, Ll)
|
|
2157
|
-
]),
|
|
2158
|
-
f("div", Tl, [
|
|
2159
|
-
(m(), v(q, null, ae(l, (x) => f("button", {
|
|
2160
|
-
key: x.tool,
|
|
2161
|
-
type: "button",
|
|
2162
|
-
class: "lw-atool",
|
|
2163
|
-
"aria-pressed": g.value === x.tool,
|
|
2164
|
-
disabled: k.value,
|
|
2165
|
-
onClick: (M) => w(x.tool)
|
|
2166
|
-
}, [
|
|
2167
|
-
(m(), G(et(x.icon))),
|
|
2168
|
-
V(" " + y(P(r)[x.key]), 1)
|
|
2169
|
-
], 8, _l)), 64)),
|
|
2170
|
-
R[3] || (R[3] = f("span", { class: "lw-grow" }, null, -1)),
|
|
2171
|
-
f("button", {
|
|
2172
|
-
type: "button",
|
|
2173
|
-
class: "lw-atool lw-atool--plain",
|
|
2174
|
-
disabled: k.value,
|
|
2175
|
-
onClick: S
|
|
2176
|
-
}, [
|
|
2177
|
-
O(P(La)),
|
|
2178
|
-
V(" " + y(P(r).clearAll), 1)
|
|
2179
|
-
], 8, Rl)
|
|
2180
|
-
]),
|
|
2181
|
-
f("div", Il, [
|
|
2182
|
-
f("div", zl, [
|
|
2183
|
-
f("canvas", {
|
|
2184
|
-
ref_key: "canvas",
|
|
2185
|
-
ref: s
|
|
2186
|
-
}, null, 512)
|
|
2187
|
-
])
|
|
2188
|
-
]),
|
|
2189
|
-
f("p", Nl, y(P(r).annotateHelp), 1),
|
|
2190
|
-
f("div", Pl, [
|
|
2191
|
-
R[4] || (R[4] = f("span", { class: "lw-grow" }, null, -1)),
|
|
2192
|
-
f("button", {
|
|
2193
|
-
type: "button",
|
|
2194
|
-
class: "lw-btn",
|
|
2195
|
-
onClick: R[1] || (R[1] = (x) => n("cancel"))
|
|
2196
|
-
}, y(P(r).cancel), 1),
|
|
2197
|
-
f("button", {
|
|
2198
|
-
type: "button",
|
|
2199
|
-
class: "lw-send",
|
|
2200
|
-
disabled: k.value,
|
|
2201
|
-
onClick: E
|
|
2202
|
-
}, y(P(r).annotateApply), 9, Ul)
|
|
2203
|
-
])
|
|
2204
|
-
])
|
|
2205
|
-
])) : B("", !0);
|
|
2206
|
-
}
|
|
2207
|
-
}), Ol = {
|
|
2208
|
-
key: 0,
|
|
2209
|
-
class: "lw-editor__tools"
|
|
2210
|
-
}, Bl = {
|
|
2211
|
-
key: 1,
|
|
2212
|
-
class: "lw-editor__uploading"
|
|
2213
|
-
}, Ht = /* @__PURE__ */ J({
|
|
2214
|
-
__name: "RichReplyEditor",
|
|
2215
|
-
props: /* @__PURE__ */ ct({
|
|
2216
|
-
placeholder: {},
|
|
2217
|
-
host: {},
|
|
2218
|
-
disabled: { type: Boolean },
|
|
2219
|
-
tools: { default: () => ta },
|
|
2220
|
-
compact: { type: Boolean, default: !1 },
|
|
2221
|
-
labels: {},
|
|
2222
|
-
uploadImage: {},
|
|
2223
|
-
locale: {},
|
|
2224
|
-
initial: {}
|
|
2225
|
-
}, {
|
|
2226
|
-
modelValue: { required: !1 },
|
|
2227
|
-
modelModifiers: {}
|
|
2228
|
-
}),
|
|
2229
|
-
emits: /* @__PURE__ */ ct(["error"], ["update:modelValue"]),
|
|
2230
|
-
setup(e, { expose: t, emit: o }) {
|
|
2231
|
-
const n = e, r = wn(e, "modelValue"), a = o, l = N(!1), s = N(!1), c = N(null), g = N(null), k = N("screenshot.png"), w = Mn({
|
|
2232
|
-
// StarterKit v3 already carries Underline and Link, so the toolbar the
|
|
2233
|
-
// original defines needs only two extensions beyond it.
|
|
2234
|
-
extensions: [
|
|
2235
|
-
En,
|
|
2236
|
-
Cn.configure({ inline: !1, allowBase64: !1 }),
|
|
2237
|
-
An.configure({ placeholder: () => n.placeholder })
|
|
2238
|
-
],
|
|
2239
|
-
content: n.initial ?? r.value ?? "",
|
|
2240
|
-
onUpdate: ({ editor: h }) => {
|
|
2241
|
-
(r.value !== void 0 || n.compact) && (r.value = h.isEmpty ? "" : h.getHTML());
|
|
2242
|
-
},
|
|
2243
|
-
onFocus: () => l.value = !0,
|
|
2244
|
-
onBlur: () => l.value = !1,
|
|
2245
|
-
editorProps: {
|
|
2246
|
-
attributes: { class: "lw-editor-body" },
|
|
2247
|
-
/**
|
|
2248
|
-
* A pasted screenshot is the normal case — Cmd+Shift+4, Cmd+V — and
|
|
2249
|
-
* without this the only route is save-to-disk, find-the-file, pick-it.
|
|
2250
|
-
*/
|
|
2251
|
-
handlePaste: (h, _) => {
|
|
2252
|
-
var H;
|
|
2253
|
-
const L = Array.from(((H = _.clipboardData) == null ? void 0 : H.files) ?? []).find((Z) => Z.type.startsWith("image/"));
|
|
2254
|
-
return L ? (_.preventDefault(), x(L), !0) : !1;
|
|
2255
|
-
},
|
|
2256
|
-
handleDrop: (h, _) => {
|
|
2257
|
-
var Z;
|
|
2258
|
-
const L = _, H = Array.from(((Z = L.dataTransfer) == null ? void 0 : Z.files) ?? []).find((ee) => ee.type.startsWith("image/"));
|
|
2259
|
-
return H ? (L.preventDefault(), x(H), !0) : !1;
|
|
2260
|
-
}
|
|
2261
|
-
}
|
|
2262
|
-
});
|
|
2263
|
-
re(
|
|
2264
|
-
() => n.disabled,
|
|
2265
|
-
(h) => {
|
|
2266
|
-
var _;
|
|
2267
|
-
return (_ = w.value) == null ? void 0 : _.setEditable(!h);
|
|
2268
|
-
}
|
|
2269
|
-
), re(r, (h) => {
|
|
2270
|
-
const _ = w.value;
|
|
2271
|
-
!_ || _.isDestroyed || h === "" && !_.isEmpty && _.commands.clearContent();
|
|
2272
|
-
});
|
|
2273
|
-
const S = F(() => {
|
|
2274
|
-
var h;
|
|
2275
|
-
return !n.compact || l.value || !((h = w.value) != null && h.isEmpty);
|
|
2276
|
-
}), E = {
|
|
2277
|
-
bold: () => ({ name: "bold", icon: ua, label: n.labels.bold, run: () => {
|
|
2278
|
-
var h;
|
|
2279
|
-
return (h = w.value) == null ? void 0 : h.chain().focus().toggleBold().run();
|
|
2280
|
-
} }),
|
|
2281
|
-
italic: () => ({ name: "italic", icon: ca, label: n.labels.italic, run: () => {
|
|
2282
|
-
var h;
|
|
2283
|
-
return (h = w.value) == null ? void 0 : h.chain().focus().toggleItalic().run();
|
|
2284
|
-
} }),
|
|
2285
|
-
underline: () => ({ name: "underline", icon: da, label: n.labels.underline, run: () => {
|
|
2286
|
-
var h;
|
|
2287
|
-
return (h = w.value) == null ? void 0 : h.chain().focus().toggleUnderline().run();
|
|
2288
|
-
} }),
|
|
2289
|
-
strike: () => ({ name: "strike", icon: Ta, label: n.labels.strike, run: () => {
|
|
2290
|
-
var h;
|
|
2291
|
-
return (h = w.value) == null ? void 0 : h.chain().focus().toggleStrike().run();
|
|
2292
|
-
} }),
|
|
2293
|
-
code: () => ({ name: "code", icon: _a, label: n.labels.code, run: () => {
|
|
2294
|
-
var h;
|
|
2295
|
-
return (h = w.value) == null ? void 0 : h.chain().focus().toggleCode().run();
|
|
2296
|
-
} }),
|
|
2297
|
-
bulletList: () => ({ name: "bulletList", icon: fa, label: n.labels.bulletList, run: () => {
|
|
2298
|
-
var h;
|
|
2299
|
-
return (h = w.value) == null ? void 0 : h.chain().focus().toggleBulletList().run();
|
|
2300
|
-
} }),
|
|
2301
|
-
orderedList: () => ({ name: "orderedList", icon: ha, label: n.labels.orderedList, run: () => {
|
|
2302
|
-
var h;
|
|
2303
|
-
return (h = w.value) == null ? void 0 : h.chain().focus().toggleOrderedList().run();
|
|
2304
|
-
} }),
|
|
2305
|
-
blockquote: () => ({ name: "blockquote", icon: Ra, label: n.labels.blockquote, run: () => {
|
|
2306
|
-
var h;
|
|
2307
|
-
return (h = w.value) == null ? void 0 : h.chain().focus().toggleBlockquote().run();
|
|
2308
|
-
} }),
|
|
2309
|
-
link: () => ({ name: "link", icon: pa, label: n.labels.link, run: W }),
|
|
2310
|
-
image: () => ({ name: "image", icon: Dt, label: n.labels.attachImage, run: j })
|
|
2311
|
-
}, T = F(() => n.tools.filter((h) => h !== "image").map((h) => E[h]())), R = F(() => n.tools.includes("image"));
|
|
2312
|
-
qt(() => {
|
|
2313
|
-
var h;
|
|
2314
|
-
return (h = w.value) == null ? void 0 : h.destroy();
|
|
2315
|
-
});
|
|
2316
|
-
async function x(h) {
|
|
2317
|
-
if (!(s.value || g.value))
|
|
2318
|
-
try {
|
|
2319
|
-
k.value = h.name || "screenshot.png", g.value = await A(h);
|
|
2320
|
-
} catch (_) {
|
|
2321
|
-
a("error", _ instanceof Error ? _.message : "unreadable file");
|
|
2322
|
-
}
|
|
2323
|
-
}
|
|
2324
|
-
async function M(h) {
|
|
2325
|
-
var _;
|
|
2326
|
-
g.value = null, s.value = !0;
|
|
2327
|
-
try {
|
|
2328
|
-
const L = n.uploadImage ? await n.uploadImage(Q(h, k.value)) : h;
|
|
2329
|
-
(_ = w.value) == null || _.chain().focus().setImage({ src: L, alt: k.value }).run();
|
|
2330
|
-
} catch (L) {
|
|
2331
|
-
a("error", L instanceof Error ? L.message : "upload failed");
|
|
2332
|
-
} finally {
|
|
2333
|
-
s.value = !1;
|
|
2334
|
-
}
|
|
2335
|
-
}
|
|
2336
|
-
function A(h) {
|
|
2337
|
-
return new Promise((_, L) => {
|
|
2338
|
-
const H = new FileReader();
|
|
2339
|
-
H.addEventListener(
|
|
2340
|
-
"load",
|
|
2341
|
-
() => typeof H.result == "string" ? _(H.result) : L(new Error("unreadable file"))
|
|
2342
|
-
), H.addEventListener("error", () => L(new Error("unreadable file"))), H.readAsDataURL(h);
|
|
2343
|
-
});
|
|
2344
|
-
}
|
|
2345
|
-
function Q(h, _) {
|
|
2346
|
-
var se;
|
|
2347
|
-
const [L, H] = h.split(","), Z = ((se = /data:([^;]+)/.exec(L ?? "")) == null ? void 0 : se[1]) ?? "image/png", ee = atob(H ?? ""), te = new Uint8Array(ee.length);
|
|
2348
|
-
for (let oe = 0; oe < ee.length; oe += 1) te[oe] = ee.charCodeAt(oe);
|
|
2349
|
-
return new File([te], _, { type: Z });
|
|
2350
|
-
}
|
|
2351
|
-
function j() {
|
|
2352
|
-
var h;
|
|
2353
|
-
(h = c.value) == null || h.click();
|
|
2354
|
-
}
|
|
2355
|
-
function ne(h) {
|
|
2356
|
-
var H;
|
|
2357
|
-
const _ = h.target, L = (H = _.files) == null ? void 0 : H[0];
|
|
2358
|
-
_.value = "", L && x(L);
|
|
2359
|
-
}
|
|
2360
|
-
function W() {
|
|
2361
|
-
const h = w.value;
|
|
2362
|
-
if (!h) return;
|
|
2363
|
-
if (h.getAttributes("link").href) {
|
|
2364
|
-
h.chain().focus().unsetLink().run();
|
|
2365
|
-
return;
|
|
2366
|
-
}
|
|
2367
|
-
const L = window.prompt(n.labels.linkPrompt, "https://");
|
|
2368
|
-
if (L) {
|
|
2369
|
-
if (!/^https?:\/\//i.test(L)) {
|
|
2370
|
-
a("error", `${n.labels.link}: http(s) only`);
|
|
2371
|
-
return;
|
|
2372
|
-
}
|
|
2373
|
-
h.chain().focus().extendMarkRange("link").setLink({ href: L }).run();
|
|
2374
|
-
}
|
|
2375
|
-
}
|
|
2376
|
-
function ie() {
|
|
2377
|
-
var _;
|
|
2378
|
-
const h = Kr(((_ = w.value) == null ? void 0 : _.getHTML()) ?? "", n.host);
|
|
2379
|
-
return Wr(h) ? "" : h;
|
|
2380
|
-
}
|
|
2381
|
-
function he() {
|
|
2382
|
-
var h;
|
|
2383
|
-
(h = w.value) == null || h.commands.clearContent(!0);
|
|
2384
|
-
}
|
|
2385
|
-
return t({ value: ie, clear: he, focus: () => {
|
|
2386
|
-
var h;
|
|
2387
|
-
return (h = w.value) == null ? void 0 : h.commands.focus();
|
|
2388
|
-
} }), (h, _) => (m(), v("div", {
|
|
2389
|
-
class: fe(["lw-editor", { "lw-editor--disabled": e.disabled }])
|
|
2390
|
-
}, [
|
|
2391
|
-
S.value ? (m(), v("div", Ol, [
|
|
2392
|
-
(m(!0), v(q, null, ae(T.value, (L) => {
|
|
2393
|
-
var H;
|
|
2394
|
-
return m(), G(Bt, {
|
|
2395
|
-
key: L.name,
|
|
2396
|
-
label: L.label,
|
|
2397
|
-
active: (H = P(w)) == null ? void 0 : H.isActive(L.name),
|
|
2398
|
-
disabled: e.disabled,
|
|
2399
|
-
onActivate: (Z) => L.run()
|
|
2400
|
-
}, {
|
|
2401
|
-
default: ut(() => [
|
|
2402
|
-
(m(), G(et(L.icon)))
|
|
2403
|
-
]),
|
|
2404
|
-
_: 2
|
|
2405
|
-
}, 1032, ["label", "active", "disabled", "onActivate"]);
|
|
2406
|
-
}), 128)),
|
|
2407
|
-
R.value ? (m(), v(q, { key: 0 }, [
|
|
2408
|
-
_[1] || (_[1] = f("span", { class: "lw-editor__sep" }, null, -1)),
|
|
2409
|
-
O(Bt, {
|
|
2410
|
-
label: e.labels.attachImage ?? "",
|
|
2411
|
-
disabled: e.disabled || s.value,
|
|
2412
|
-
onActivate: j
|
|
2413
|
-
}, {
|
|
2414
|
-
default: ut(() => [
|
|
2415
|
-
O(P(Dt))
|
|
2416
|
-
]),
|
|
2417
|
-
_: 1
|
|
2418
|
-
}, 8, ["label", "disabled"])
|
|
2419
|
-
], 64)) : B("", !0),
|
|
2420
|
-
s.value ? (m(), v("span", Bl, y(e.labels.uploading ?? ""), 1)) : B("", !0)
|
|
2421
|
-
])) : B("", !0),
|
|
2422
|
-
O(P(Sn), {
|
|
2423
|
-
editor: P(w),
|
|
2424
|
-
class: "lw-editor__content"
|
|
2425
|
-
}, null, 8, ["editor"]),
|
|
2426
|
-
f("input", {
|
|
2427
|
-
ref_key: "fileInput",
|
|
2428
|
-
ref: c,
|
|
2429
|
-
type: "file",
|
|
2430
|
-
accept: "image/*",
|
|
2431
|
-
hidden: "",
|
|
2432
|
-
onChange: ne
|
|
2433
|
-
}, null, 544),
|
|
2434
|
-
O(Dl, {
|
|
2435
|
-
src: g.value,
|
|
2436
|
-
filename: k.value,
|
|
2437
|
-
locale: e.locale,
|
|
2438
|
-
onConfirm: M,
|
|
2439
|
-
onCancel: _[0] || (_[0] = (L) => g.value = null)
|
|
2440
|
-
}, null, 8, ["src", "filename", "locale"])
|
|
2441
|
-
], 2));
|
|
2442
|
-
}
|
|
2443
|
-
}), Hl = { class: "lw-card" }, Fl = { class: "lw-card__title" }, $l = {
|
|
2444
|
-
key: 0,
|
|
2445
|
-
class: "lw-thread__empty"
|
|
2446
|
-
}, Ql = { class: "lw-msg__bubble" }, Vl = { class: "lw-msg__meta" }, ql = {
|
|
2447
|
-
key: 0,
|
|
2448
|
-
class: "lw-msg__who"
|
|
2449
|
-
}, Jl = { class: "lw-msg__who" }, Zl = { class: "lw-msg__role" }, Yl = {
|
|
2450
|
-
key: 2,
|
|
2451
|
-
class: "lw-msg__edited"
|
|
2452
|
-
}, Xl = ["onClick"], Gl = {
|
|
2453
|
-
key: 0,
|
|
2454
|
-
class: "lw-msg__editing"
|
|
2455
|
-
}, Kl = { class: "lw-msg__editActions" }, jl = ["disabled"], Wl = ["disabled", "onClick"], ei = { class: "lw-composer" }, ti = { class: "lw-composer__actions" }, ni = ["disabled"], oi = /* @__PURE__ */ J({
|
|
2456
|
-
__name: "TicketConversation",
|
|
2457
|
-
props: {
|
|
2458
|
-
ticket: {},
|
|
2459
|
-
t: {},
|
|
2460
|
-
host: {},
|
|
2461
|
-
timezone: {},
|
|
2462
|
-
locale: {},
|
|
2463
|
-
sending: { type: Boolean },
|
|
2464
|
-
uploadImage: { type: Function }
|
|
2465
|
-
},
|
|
2466
|
-
emits: ["send", "edited", "error"],
|
|
2467
|
-
setup(e, { expose: t, emit: o }) {
|
|
2468
|
-
const n = e, r = o, a = N(null), l = N(null), s = N(null), c = N(!1), g = Vt(null);
|
|
2469
|
-
function k(x) {
|
|
2470
|
-
g.value = x ?? null;
|
|
2471
|
-
}
|
|
2472
|
-
const w = F(() => ({
|
|
2473
|
-
bold: n.t.bold,
|
|
2474
|
-
italic: n.t.italic,
|
|
2475
|
-
underline: n.t.underline,
|
|
2476
|
-
bulletList: n.t.bulletList,
|
|
2477
|
-
orderedList: n.t.orderedList,
|
|
2478
|
-
link: n.t.link,
|
|
2479
|
-
linkPrompt: n.t.linkPrompt,
|
|
2480
|
-
attachImage: n.t.attachImage,
|
|
2481
|
-
uploading: n.t.uploading
|
|
2482
|
-
}));
|
|
2483
|
-
function S(x) {
|
|
2484
|
-
return x.authorRole === "REPORTER";
|
|
2485
|
-
}
|
|
2486
|
-
async function E(x) {
|
|
2487
|
-
var A;
|
|
2488
|
-
const M = ((A = g.value) == null ? void 0 : A.value()) ?? "";
|
|
2489
|
-
if (!(!M || c.value)) {
|
|
2490
|
-
c.value = !0;
|
|
1405
|
+
const r = e, n = t, o = At(!1);
|
|
1406
|
+
async function a(l) {
|
|
1407
|
+
if (!(l.defaultPrevented || o.value)) {
|
|
1408
|
+
o.value = !0;
|
|
2491
1409
|
try {
|
|
2492
|
-
await
|
|
2493
|
-
} catch (
|
|
2494
|
-
|
|
1410
|
+
await Bn(r.newTab ? { target: "_blank" } : {});
|
|
1411
|
+
} catch (f) {
|
|
1412
|
+
n && n("error", f), re("เปิดรายการปัญหาไม่สำเร็จ", "error");
|
|
2495
1413
|
} finally {
|
|
2496
|
-
|
|
1414
|
+
o.value = !1;
|
|
2497
1415
|
}
|
|
2498
1416
|
}
|
|
2499
1417
|
}
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
M && (M.scrollTop = M.scrollHeight), x === "smooth" && ((Q = (A = l.value) == null ? void 0 : A.lastElementChild) == null || Q.scrollIntoView({ block: "nearest", behavior: x }));
|
|
2510
|
-
}
|
|
2511
|
-
return re(() => n.ticket.id, () => void R("auto"), { immediate: !0 }), re(
|
|
2512
|
-
() => n.ticket.messages.length,
|
|
2513
|
-
(x, M) => {
|
|
2514
|
-
x <= (M ?? 0) || R("smooth");
|
|
2515
|
-
}
|
|
2516
|
-
), t({ clear: () => {
|
|
2517
|
-
var x;
|
|
2518
|
-
return (x = a.value) == null ? void 0 : x.clear();
|
|
2519
|
-
} }), (x, M) => (m(), v("section", Hl, [
|
|
2520
|
-
f("h3", Fl, y(e.t.conversation), 1),
|
|
2521
|
-
f("div", {
|
|
2522
|
-
ref_key: "thread",
|
|
2523
|
-
ref: l,
|
|
2524
|
-
class: "lw-thread"
|
|
2525
|
-
}, [
|
|
2526
|
-
e.ticket.messages.length ? B("", !0) : (m(), v("p", $l, y(e.t.noMessages), 1)),
|
|
2527
|
-
(m(!0), v(q, null, ae(e.ticket.messages, (A) => (m(), v("article", {
|
|
2528
|
-
key: A.id,
|
|
2529
|
-
class: fe(["lw-msg", { "lw-msg--mine": A.authorRole === "REPORTER" }])
|
|
2530
|
-
}, [
|
|
2531
|
-
f("div", Ql, [
|
|
2532
|
-
f("p", Vl, [
|
|
2533
|
-
A.authorRole === "AGENT" ? (m(), v("span", ql, y(e.t.team), 1)) : (m(), v(q, { key: 1 }, [
|
|
2534
|
-
f("span", Jl, y(A.authorName || e.t.you), 1),
|
|
2535
|
-
f("span", Zl, y(e.t.reporterRole), 1)
|
|
2536
|
-
], 64)),
|
|
2537
|
-
f("span", null, "· " + y(P(He)(A.createdAt, e.timezone, e.locale)), 1),
|
|
2538
|
-
A.editedAt ? (m(), v("span", Yl, "· " + y(e.t.edited), 1)) : B("", !0),
|
|
2539
|
-
S(A) && s.value !== A.id ? (m(), v("button", {
|
|
2540
|
-
key: 3,
|
|
2541
|
-
type: "button",
|
|
2542
|
-
class: "lw-msg__edit",
|
|
2543
|
-
onClick: (Q) => s.value = A.id
|
|
2544
|
-
}, [
|
|
2545
|
-
O(P(Ia)),
|
|
2546
|
-
V(" " + y(e.t.edit), 1)
|
|
2547
|
-
], 8, Xl)) : B("", !0)
|
|
2548
|
-
]),
|
|
2549
|
-
s.value === A.id ? (m(), v("div", Gl, [
|
|
2550
|
-
O(Ht, {
|
|
2551
|
-
ref_for: !0,
|
|
2552
|
-
ref: k,
|
|
2553
|
-
placeholder: e.t.replyPlaceholder,
|
|
2554
|
-
host: e.host,
|
|
2555
|
-
locale: e.locale,
|
|
2556
|
-
disabled: c.value,
|
|
2557
|
-
"upload-image": e.uploadImage,
|
|
2558
|
-
labels: w.value,
|
|
2559
|
-
initial: A.body,
|
|
2560
|
-
onError: M[0] || (M[0] = (Q) => r("error", Q))
|
|
2561
|
-
}, null, 8, ["placeholder", "host", "locale", "disabled", "upload-image", "labels", "initial"]),
|
|
2562
|
-
f("div", Kl, [
|
|
2563
|
-
f("button", {
|
|
2564
|
-
type: "button",
|
|
2565
|
-
class: "lw-btn",
|
|
2566
|
-
disabled: c.value,
|
|
2567
|
-
onClick: M[1] || (M[1] = (Q) => s.value = null)
|
|
2568
|
-
}, [
|
|
2569
|
-
O(P(Na)),
|
|
2570
|
-
V(" " + y(e.t.cancel), 1)
|
|
2571
|
-
], 8, jl),
|
|
2572
|
-
f("button", {
|
|
2573
|
-
type: "button",
|
|
2574
|
-
class: "lw-send",
|
|
2575
|
-
disabled: c.value,
|
|
2576
|
-
onClick: (Q) => E(A)
|
|
2577
|
-
}, [
|
|
2578
|
-
O(P(za)),
|
|
2579
|
-
V(" " + y(e.t.saveEdit), 1)
|
|
2580
|
-
], 8, Wl)
|
|
2581
|
-
])
|
|
2582
|
-
])) : (m(), G(st, {
|
|
2583
|
-
key: 1,
|
|
2584
|
-
html: A.body,
|
|
2585
|
-
host: e.host
|
|
2586
|
-
}, null, 8, ["html", "host"]))
|
|
2587
|
-
])
|
|
2588
|
-
], 2))), 128))
|
|
2589
|
-
], 512),
|
|
2590
|
-
f("div", ei, [
|
|
2591
|
-
O(Ht, {
|
|
2592
|
-
ref_key: "editor",
|
|
2593
|
-
ref: a,
|
|
2594
|
-
placeholder: e.t.replyPlaceholder,
|
|
2595
|
-
host: e.host,
|
|
2596
|
-
locale: e.locale,
|
|
2597
|
-
disabled: e.sending,
|
|
2598
|
-
"upload-image": e.uploadImage,
|
|
2599
|
-
labels: w.value,
|
|
2600
|
-
onError: M[2] || (M[2] = (A) => r("error", A))
|
|
2601
|
-
}, null, 8, ["placeholder", "host", "locale", "disabled", "upload-image", "labels"]),
|
|
2602
|
-
f("div", ti, [
|
|
2603
|
-
f("button", {
|
|
2604
|
-
type: "button",
|
|
2605
|
-
class: "lw-send",
|
|
2606
|
-
disabled: e.sending,
|
|
2607
|
-
onClick: T
|
|
2608
|
-
}, [
|
|
2609
|
-
O(P(ma)),
|
|
2610
|
-
V(" " + y(e.sending ? e.t.sending : e.t.send), 1)
|
|
2611
|
-
], 8, ni)
|
|
2612
|
-
])
|
|
1418
|
+
return (l, f) => (ge(), ye("button", {
|
|
1419
|
+
type: "button",
|
|
1420
|
+
"aria-label": e.label,
|
|
1421
|
+
title: e.label,
|
|
1422
|
+
disabled: o.value,
|
|
1423
|
+
onClick: a
|
|
1424
|
+
}, [
|
|
1425
|
+
nt(l.$slots, "default", { pending: o.value }, () => [
|
|
1426
|
+
Rt(Dt(e.label), 1)
|
|
2613
1427
|
])
|
|
2614
|
-
]));
|
|
2615
|
-
}
|
|
2616
|
-
}), ri = { class: "lw-card" }, ai = { class: "lw-card__title" }, li = ["src", "alt", "onError"], ii = /* @__PURE__ */ J({
|
|
2617
|
-
__name: "TicketScreenshots",
|
|
2618
|
-
props: {
|
|
2619
|
-
images: {},
|
|
2620
|
-
title: {},
|
|
2621
|
-
attachmentUrl: { type: Function }
|
|
2622
|
-
},
|
|
2623
|
-
setup(e) {
|
|
2624
|
-
const t = e, o = N({}), n = N({});
|
|
2625
|
-
return Oe(() => {
|
|
2626
|
-
for (const r of t.images)
|
|
2627
|
-
t.attachmentUrl(r.id).then(
|
|
2628
|
-
(a) => o.value = { ...o.value, [r.id]: a },
|
|
2629
|
-
// Drop the frame rather than leave a broken-image icon where a screenshot
|
|
2630
|
-
// should be.
|
|
2631
|
-
() => n.value = { ...n.value, [r.id]: !0 }
|
|
2632
|
-
);
|
|
2633
|
-
}), (r, a) => (m(), v("section", ri, [
|
|
2634
|
-
f("h3", ai, y(e.title), 1),
|
|
2635
|
-
(m(!0), v(q, null, ae(e.images, (l) => (m(), v(q, {
|
|
2636
|
-
key: l.id
|
|
2637
|
-
}, [
|
|
2638
|
-
o.value[l.id] && !n.value[l.id] ? (m(), v("img", {
|
|
2639
|
-
key: 0,
|
|
2640
|
-
class: "lw-shot",
|
|
2641
|
-
src: o.value[l.id],
|
|
2642
|
-
alt: l.filename ?? "",
|
|
2643
|
-
onError: (s) => n.value = { ...n.value, [l.id]: !0 }
|
|
2644
|
-
}, null, 40, li)) : B("", !0)
|
|
2645
|
-
], 64))), 128))
|
|
2646
|
-
]));
|
|
2647
|
-
}
|
|
2648
|
-
}), si = { class: "lw-detail" }, ui = { class: "lw-card" }, ci = { class: "lw-card__heading" }, di = { class: "lw-facts" }, fi = { class: "lw-key" }, hi = {
|
|
2649
|
-
key: 0,
|
|
2650
|
-
class: "lw-chip"
|
|
2651
|
-
}, pi = { key: 1 }, mi = {
|
|
2652
|
-
key: 1,
|
|
2653
|
-
class: "lw-route"
|
|
2654
|
-
}, gi = ["href"], bi = { class: "lw-card" }, yi = { class: "lw-card__title" }, vi = /* @__PURE__ */ J({
|
|
2655
|
-
__name: "TicketDetail",
|
|
2656
|
-
props: {
|
|
2657
|
-
ticket: {},
|
|
2658
|
-
history: {},
|
|
2659
|
-
config: {},
|
|
2660
|
-
maps: {},
|
|
2661
|
-
t: {},
|
|
2662
|
-
host: {},
|
|
2663
|
-
locale: {},
|
|
2664
|
-
sending: { type: Boolean },
|
|
2665
|
-
reopening: { type: Boolean },
|
|
2666
|
-
uploadImage: { type: Function },
|
|
2667
|
-
attachmentUrl: { type: Function }
|
|
2668
|
-
},
|
|
2669
|
-
emits: ["back", "edited", "send", "reopen", "error"],
|
|
2670
|
-
setup(e, { emit: t }) {
|
|
2671
|
-
const o = e, n = t, r = F(() => o.locale === "en" ? "en" : "th"), a = F(
|
|
2672
|
-
() => o.maps.isClosed(o.ticket.status) && o.config.featureFlags.selfServiceReopen === !0
|
|
2673
|
-
), l = F(() => o.ticket.updatedAt && o.ticket.updatedAt !== o.ticket.createdAt), s = F(
|
|
2674
|
-
() => o.ticket.attachments.filter((g) => (g.contentType ?? "").startsWith("image/"))
|
|
2675
|
-
);
|
|
2676
|
-
function c(g) {
|
|
2677
|
-
return He(g, o.config.timezone, o.locale);
|
|
2678
|
-
}
|
|
2679
|
-
return (g, k) => (m(), v("div", si, [
|
|
2680
|
-
f("button", {
|
|
2681
|
-
type: "button",
|
|
2682
|
-
class: "lw-back",
|
|
2683
|
-
onClick: k[0] || (k[0] = (w) => n("back"))
|
|
2684
|
-
}, [
|
|
2685
|
-
O(P(ba)),
|
|
2686
|
-
V(" " + y(e.t.back), 1)
|
|
2687
|
-
]),
|
|
2688
|
-
f("section", ui, [
|
|
2689
|
-
f("h3", ci, y(e.ticket.title), 1),
|
|
2690
|
-
f("div", di, [
|
|
2691
|
-
f("span", fi, y(P(it)(e.config.realm.slug, e.ticket.number)), 1),
|
|
2692
|
-
e.ticket.category ? (m(), v("span", hi, y(e.ticket.category), 1)) : B("", !0),
|
|
2693
|
-
f("span", null, y(e.t.colCreated) + " " + y(c(e.ticket.createdAt)), 1),
|
|
2694
|
-
l.value ? (m(), v("span", pi, y(e.t.colUpdated) + " " + y(c(e.ticket.updatedAt)), 1)) : B("", !0)
|
|
2695
|
-
]),
|
|
2696
|
-
e.ticket.description ? (m(), G(st, {
|
|
2697
|
-
key: 0,
|
|
2698
|
-
class: "lw-intro",
|
|
2699
|
-
html: e.ticket.description,
|
|
2700
|
-
host: e.host
|
|
2701
|
-
}, null, 8, ["html", "host"])) : B("", !0),
|
|
2702
|
-
e.ticket.routeUrl ? (m(), v("p", mi, [
|
|
2703
|
-
V(y(e.t.page) + ": ", 1),
|
|
2704
|
-
f("a", {
|
|
2705
|
-
href: e.ticket.routeUrl,
|
|
2706
|
-
target: "_blank",
|
|
2707
|
-
rel: "noopener noreferrer"
|
|
2708
|
-
}, y(e.ticket.routeUrl), 9, gi)
|
|
2709
|
-
])) : B("", !0)
|
|
2710
|
-
]),
|
|
2711
|
-
O(il, {
|
|
2712
|
-
ticket: e.ticket,
|
|
2713
|
-
maps: e.maps,
|
|
2714
|
-
t: e.t,
|
|
2715
|
-
locale: r.value,
|
|
2716
|
-
host: e.host
|
|
2717
|
-
}, null, 8, ["ticket", "maps", "t", "locale", "host"]),
|
|
2718
|
-
a.value ? (m(), G(gl, {
|
|
2719
|
-
key: 0,
|
|
2720
|
-
t: e.t,
|
|
2721
|
-
locale: r.value,
|
|
2722
|
-
busy: e.reopening,
|
|
2723
|
-
onReopen: k[1] || (k[1] = (w) => n("reopen", w))
|
|
2724
|
-
}, null, 8, ["t", "locale", "busy"])) : B("", !0),
|
|
2725
|
-
f("section", bi, [
|
|
2726
|
-
f("h3", yi, y(r.value === "en" ? "Progress" : "ความคืบหน้า"), 1),
|
|
2727
|
-
O(kl, {
|
|
2728
|
-
history: e.history,
|
|
2729
|
-
status: e.ticket.status,
|
|
2730
|
-
"created-at": e.ticket.createdAt,
|
|
2731
|
-
maps: e.maps,
|
|
2732
|
-
timezone: e.config.timezone,
|
|
2733
|
-
locale: r.value
|
|
2734
|
-
}, null, 8, ["history", "status", "created-at", "maps", "timezone", "locale"])
|
|
2735
|
-
]),
|
|
2736
|
-
O(oi, {
|
|
2737
|
-
ticket: e.ticket,
|
|
2738
|
-
t: e.t,
|
|
2739
|
-
host: e.host,
|
|
2740
|
-
timezone: e.config.timezone,
|
|
2741
|
-
locale: e.locale,
|
|
2742
|
-
sending: e.sending,
|
|
2743
|
-
"upload-image": e.uploadImage,
|
|
2744
|
-
onSend: k[2] || (k[2] = (w) => n("send", w)),
|
|
2745
|
-
onEdited: k[3] || (k[3] = (w) => n("edited")),
|
|
2746
|
-
onError: k[4] || (k[4] = (w) => n("error", w))
|
|
2747
|
-
}, null, 8, ["ticket", "t", "host", "timezone", "locale", "sending", "upload-image"]),
|
|
2748
|
-
s.value.length ? (m(), G(ii, {
|
|
2749
|
-
key: 1,
|
|
2750
|
-
images: s.value,
|
|
2751
|
-
title: r.value === "en" ? "Screenshots you sent" : "ภาพหน้าจอที่คุณแจ้ง",
|
|
2752
|
-
"attachment-url": e.attachmentUrl
|
|
2753
|
-
}, null, 8, ["images", "title", "attachment-url"])) : B("", !0)
|
|
2754
|
-
]));
|
|
2755
|
-
}
|
|
2756
|
-
}), wi = { class: "lw-panel" }, ki = {
|
|
2757
|
-
key: 0,
|
|
2758
|
-
class: "lw-panel__title"
|
|
2759
|
-
}, xi = { class: "lw-panel__intro" }, Mi = { class: "lw-controls" }, Si = { class: "lw-search" }, Ei = ["placeholder", "aria-label"], Ci = ["value"], Ai = { class: "lw-count" }, Li = {
|
|
2760
|
-
key: 1,
|
|
2761
|
-
class: "lw-state"
|
|
2762
|
-
}, Ti = {
|
|
2763
|
-
key: 2,
|
|
2764
|
-
class: "lw-skeletons"
|
|
2765
|
-
}, _i = {
|
|
2766
|
-
key: 3,
|
|
2767
|
-
class: "lw-state lw-state--error"
|
|
2768
|
-
}, Ri = {
|
|
2769
|
-
key: 1,
|
|
2770
|
-
class: "lw-skeletons"
|
|
2771
|
-
}, Ii = {
|
|
2772
|
-
key: 2,
|
|
2773
|
-
class: "lw-state lw-state--error"
|
|
2774
|
-
}, Fi = /* @__PURE__ */ J({
|
|
2775
|
-
__name: "MyTicketsPanel",
|
|
2776
|
-
props: {
|
|
2777
|
-
refreshKey: {},
|
|
2778
|
-
hideTitle: { type: Boolean }
|
|
2779
|
-
},
|
|
2780
|
-
emits: ["replied", "reopened", "error"],
|
|
2781
|
-
setup(e, { emit: t }) {
|
|
2782
|
-
const o = e, n = t, r = F(() => {
|
|
2783
|
-
try {
|
|
2784
|
-
return X().locale;
|
|
2785
|
-
} catch {
|
|
2786
|
-
return;
|
|
2787
|
-
}
|
|
2788
|
-
}), a = F(() => {
|
|
2789
|
-
try {
|
|
2790
|
-
return X().host;
|
|
2791
|
-
} catch {
|
|
2792
|
-
return "";
|
|
2793
|
-
}
|
|
2794
|
-
}), l = F(() => ra(r.value)), s = N([]), c = N(null), g = N(!0), k = N(null), w = N(!1), S = N(""), E = N(""), T = N(""), R = N({ key: "createdAt", direction: "desc" }), x = N(1), M = N(null), A = N([]), Q = N(null), j = N(!1), ne = N(!1), W = N(!1), ie = F(() => {
|
|
2795
|
-
var I;
|
|
2796
|
-
return Or(((I = c.value) == null ? void 0 : I.statusColumns) ?? [], l.value.allStatuses);
|
|
2797
|
-
}), he = N(null), h = F(() => {
|
|
2798
|
-
var I;
|
|
2799
|
-
return ((I = he.value) == null ? void 0 : I.count) ?? 0;
|
|
2800
|
-
});
|
|
2801
|
-
let _ = null;
|
|
2802
|
-
re(S, (I) => {
|
|
2803
|
-
_ && clearTimeout(_), _ = setTimeout(() => {
|
|
2804
|
-
E.value = I, x.value = 1;
|
|
2805
|
-
}, 300);
|
|
2806
|
-
}), re(T, () => x.value = 1), re(() => o.refreshKey, () => void L()), Oe(L);
|
|
2807
|
-
async function L() {
|
|
2808
|
-
g.value = !0, k.value = null, w.value = !1;
|
|
2809
|
-
try {
|
|
2810
|
-
const [I, z] = await Promise.all([Dr(), Tr()]);
|
|
2811
|
-
c.value = I, s.value = z;
|
|
2812
|
-
} catch (I) {
|
|
2813
|
-
I instanceof Ke ? w.value = !0 : k.value = I instanceof Error ? I.message : l.value.listFailed;
|
|
2814
|
-
} finally {
|
|
2815
|
-
g.value = !1;
|
|
2816
|
-
}
|
|
2817
|
-
}
|
|
2818
|
-
async function H(I) {
|
|
2819
|
-
M.value = null, A.value = [], Q.value = null, j.value = !0;
|
|
2820
|
-
try {
|
|
2821
|
-
await Z(I);
|
|
2822
|
-
} finally {
|
|
2823
|
-
j.value = !1;
|
|
2824
|
-
}
|
|
2825
|
-
}
|
|
2826
|
-
async function Z(I) {
|
|
2827
|
-
try {
|
|
2828
|
-
const [z, i] = await Promise.all([
|
|
2829
|
-
_r(I),
|
|
2830
|
-
// The timeline is a nicety, not the page: a ticket whose history fails to
|
|
2831
|
-
// load should still show its conversation.
|
|
2832
|
-
Ir(I).catch(() => [])
|
|
2833
|
-
]);
|
|
2834
|
-
M.value = z, A.value = i;
|
|
2835
|
-
} catch (z) {
|
|
2836
|
-
Q.value = z instanceof Error ? z.message : l.value.detailFailed;
|
|
2837
|
-
}
|
|
2838
|
-
}
|
|
2839
|
-
function ee() {
|
|
2840
|
-
M.value = null, L();
|
|
2841
|
-
}
|
|
2842
|
-
function te(I) {
|
|
2843
|
-
R.value = R.value.key === I ? { key: I, direction: R.value.direction === "asc" ? "desc" : "asc" } : (
|
|
2844
|
-
// Dates open newest-first, text A→Z: the useful first click differs by
|
|
2845
|
-
// what the column holds.
|
|
2846
|
-
{ key: I, direction: I === "createdAt" || I === "updatedAt" ? "desc" : "asc" }
|
|
2847
|
-
);
|
|
2848
|
-
}
|
|
2849
|
-
async function se(I) {
|
|
2850
|
-
const z = M.value;
|
|
2851
|
-
if (!(!z || ne.value)) {
|
|
2852
|
-
ne.value = !0;
|
|
2853
|
-
try {
|
|
2854
|
-
await zr(z.id, I), await Z(z.id), M.value && n("replied", M.value);
|
|
2855
|
-
} catch (i) {
|
|
2856
|
-
n("error", i instanceof Error ? i.message : l.value.sendFailed);
|
|
2857
|
-
} finally {
|
|
2858
|
-
ne.value = !1;
|
|
2859
|
-
}
|
|
2860
|
-
}
|
|
2861
|
-
}
|
|
2862
|
-
async function oe(I) {
|
|
2863
|
-
const z = M.value;
|
|
2864
|
-
if (!(!z || W.value)) {
|
|
2865
|
-
W.value = !0;
|
|
2866
|
-
try {
|
|
2867
|
-
await Pr(z.id, I), await Z(z.id), M.value && n("reopened", M.value);
|
|
2868
|
-
} catch (i) {
|
|
2869
|
-
n("error", i instanceof Error ? i.message : l.value.reopenFailed);
|
|
2870
|
-
} finally {
|
|
2871
|
-
W.value = !1;
|
|
2872
|
-
}
|
|
2873
|
-
}
|
|
2874
|
-
}
|
|
2875
|
-
function Ae(I) {
|
|
2876
|
-
const z = M.value;
|
|
2877
|
-
return z ? Le(I).then(
|
|
2878
|
-
(i) => Ur(z.id, i, I.name).then((u) => u.url)
|
|
2879
|
-
) : Promise.reject(new Error("no ticket"));
|
|
2880
|
-
}
|
|
2881
|
-
function pe(I) {
|
|
2882
|
-
return Rr(I).then((z) => z.url);
|
|
2883
|
-
}
|
|
2884
|
-
function Le(I) {
|
|
2885
|
-
return new Promise((z, i) => {
|
|
2886
|
-
const u = new FileReader();
|
|
2887
|
-
u.addEventListener(
|
|
2888
|
-
"load",
|
|
2889
|
-
() => typeof u.result == "string" ? z(u.result) : i(new Error("unreadable file"))
|
|
2890
|
-
), u.addEventListener("error", () => i(new Error("unreadable file"))), u.readAsDataURL(I);
|
|
2891
|
-
});
|
|
2892
|
-
}
|
|
2893
|
-
return (I, z) => {
|
|
2894
|
-
var i, u;
|
|
2895
|
-
return m(), v("div", wi, [
|
|
2896
|
-
!M.value && !j.value ? (m(), v(q, { key: 0 }, [
|
|
2897
|
-
e.hideTitle ? B("", !0) : (m(), v("h2", ki, y(l.value.title), 1)),
|
|
2898
|
-
f("p", xi, y(l.value.intro), 1),
|
|
2899
|
-
f("div", Mi, [
|
|
2900
|
-
f("div", Si, [
|
|
2901
|
-
O(P(ga), { class: "lw-search__icon" }),
|
|
2902
|
-
Je(f("input", {
|
|
2903
|
-
"onUpdate:modelValue": z[0] || (z[0] = (d) => S.value = d),
|
|
2904
|
-
type: "search",
|
|
2905
|
-
class: "lw-input lw-search__field",
|
|
2906
|
-
placeholder: l.value.searchPlaceholder,
|
|
2907
|
-
"aria-label": l.value.searchLabel
|
|
2908
|
-
}, null, 8, Ei), [
|
|
2909
|
-
[Qt, S.value]
|
|
2910
|
-
])
|
|
2911
|
-
]),
|
|
2912
|
-
Je(f("select", {
|
|
2913
|
-
"onUpdate:modelValue": z[1] || (z[1] = (d) => T.value = d),
|
|
2914
|
-
class: "lw-input"
|
|
2915
|
-
}, [
|
|
2916
|
-
(m(!0), v(q, null, ae(ie.value.options, (d) => (m(), v("option", {
|
|
2917
|
-
key: d.value,
|
|
2918
|
-
value: d.value
|
|
2919
|
-
}, y(d.label), 9, Ci))), 128))
|
|
2920
|
-
], 512), [
|
|
2921
|
-
[xn, T.value]
|
|
2922
|
-
]),
|
|
2923
|
-
f("span", Ai, y(l.value.count(h.value)), 1)
|
|
2924
|
-
]),
|
|
2925
|
-
w.value ? (m(), v("p", Li, y(l.value.signedOut), 1)) : g.value ? (m(), v("div", Ti, [
|
|
2926
|
-
(m(), v(q, null, ae(4, (d) => f("div", {
|
|
2927
|
-
key: d,
|
|
2928
|
-
class: "lw-skeleton"
|
|
2929
|
-
})), 64))
|
|
2930
|
-
])) : k.value ? (m(), v("p", _i, [
|
|
2931
|
-
O(P(va)),
|
|
2932
|
-
V(" " + y(k.value) + " ", 1),
|
|
2933
|
-
f("button", {
|
|
2934
|
-
type: "button",
|
|
2935
|
-
class: "lw-retry",
|
|
2936
|
-
onClick: L
|
|
2937
|
-
}, y(l.value.retry), 1)
|
|
2938
|
-
])) : (m(), G(tl, {
|
|
2939
|
-
key: 4,
|
|
2940
|
-
ref_key: "table",
|
|
2941
|
-
ref: he,
|
|
2942
|
-
items: s.value,
|
|
2943
|
-
maps: ie.value,
|
|
2944
|
-
t: l.value,
|
|
2945
|
-
slug: (i = c.value) == null ? void 0 : i.realm.slug,
|
|
2946
|
-
timezone: ((u = c.value) == null ? void 0 : u.timezone) ?? "Asia/Bangkok",
|
|
2947
|
-
locale: r.value,
|
|
2948
|
-
keyword: E.value,
|
|
2949
|
-
"status-filter": T.value,
|
|
2950
|
-
sort: R.value,
|
|
2951
|
-
page: x.value,
|
|
2952
|
-
onOpen: H,
|
|
2953
|
-
onSort: te,
|
|
2954
|
-
onPage: z[2] || (z[2] = (d) => x.value = d)
|
|
2955
|
-
}, null, 8, ["items", "maps", "t", "slug", "timezone", "locale", "keyword", "status-filter", "sort", "page"]))
|
|
2956
|
-
], 64)) : j.value ? (m(), v("div", Ri, [...z[5] || (z[5] = [
|
|
2957
|
-
f("div", { class: "lw-skeleton" }, null, -1),
|
|
2958
|
-
f("div", { class: "lw-skeleton" }, null, -1)
|
|
2959
|
-
])])) : Q.value ? (m(), v("p", Ii, y(Q.value), 1)) : M.value && c.value ? (m(), G(vi, {
|
|
2960
|
-
key: 3,
|
|
2961
|
-
ticket: M.value,
|
|
2962
|
-
history: A.value,
|
|
2963
|
-
config: c.value,
|
|
2964
|
-
maps: ie.value,
|
|
2965
|
-
t: l.value,
|
|
2966
|
-
host: a.value,
|
|
2967
|
-
locale: r.value,
|
|
2968
|
-
sending: ne.value,
|
|
2969
|
-
reopening: W.value,
|
|
2970
|
-
"upload-image": Ae,
|
|
2971
|
-
"attachment-url": pe,
|
|
2972
|
-
onBack: ee,
|
|
2973
|
-
onEdited: z[3] || (z[3] = (d) => M.value && Z(M.value.id)),
|
|
2974
|
-
onSend: se,
|
|
2975
|
-
onReopen: oe,
|
|
2976
|
-
onError: z[4] || (z[4] = (d) => n("error", d))
|
|
2977
|
-
}, null, 8, ["ticket", "history", "config", "maps", "t", "host", "locale", "sending", "reopening"])) : B("", !0)
|
|
2978
|
-
]);
|
|
2979
|
-
};
|
|
1428
|
+
], 8, On));
|
|
2980
1429
|
}
|
|
2981
1430
|
});
|
|
2982
1431
|
export {
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
oi as TicketConversation,
|
|
2990
|
-
vi as TicketDetail,
|
|
2991
|
-
tl as TicketTable,
|
|
2992
|
-
Tn as configureDebugCapture,
|
|
2993
|
-
en as launch,
|
|
2994
|
-
To as onCrash
|
|
1432
|
+
Jn as DebugCaptureInit,
|
|
1433
|
+
_n as ReportProblemButton,
|
|
1434
|
+
Kn as SupportPortalButton,
|
|
1435
|
+
Ut as configureDebugCapture,
|
|
1436
|
+
ft as launch,
|
|
1437
|
+
Hr as onCrash
|
|
2995
1438
|
};
|
|
2996
1439
|
//# sourceMappingURL=index.mjs.map
|