@webority/support-react 0.29.0 → 0.31.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.
@@ -1,14 +1,15 @@
1
1
  import { createContext as e, useCallback as t, useContext as n, useEffect as r, useId as i, useMemo as a, useRef as o, useState as s } from "react";
2
- import { AppAlert as c, AppAvatar as l, AppBadge as u, AppButton as d, AppCard as f, AppCopyButton as p, AppDataTable as m, AppFileAttachment as h, AppIcon as g, AppInfoList as _, AppInput as v, AppLink as y, AppModal as b, AppSearch as x, AppSelect as S, AppSkeleton as C, AppSpinner as w, AppStatusBadge as T, AppTableEmptyState as E, AppTabs as D, AppTextarea as O } from "@webority/ui-react";
3
- import { toBlob as k } from "html-to-image";
4
- import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
2
+ import { AppAlert as c, AppAvatar as l, AppBadge as u, AppButton as d, AppCard as f, AppCopyButton as p, AppDataTable as m, AppFileAttachment as h, AppIcon as g, AppInfoList as _, AppInput as v, AppLink as y, AppModal as b, AppSearch as x, AppSelect as S, AppSkeleton as C, AppSpinner as w, AppStatusBadge as T, AppTableEmptyState as E, AppTabs as D, AppTextarea as O, useFloatingStack as k } from "@webority/ui-react";
3
+ import { toBlob as A } from "html-to-image";
4
+ import { createPortal as j } from "react-dom";
5
+ import { Fragment as ee, jsx as M, jsxs as N } from "react/jsx-runtime";
5
6
  //#region src/client.js
6
- var N = "Something went wrong. Please try again.", P = class extends Error {
7
+ var P = "Something went wrong. Please try again.", F = class extends Error {
7
8
  constructor(e, t, n) {
8
9
  super(t), this.name = "SupportApiError", this.code = e, this.status = n;
9
10
  }
10
11
  };
11
- async function F(e) {
12
+ async function I(e) {
12
13
  if (e && typeof Blob < "u" && e instanceof Blob) try {
13
14
  return JSON.parse(await e.text());
14
15
  } catch {
@@ -21,70 +22,70 @@ async function F(e) {
21
22
  }
22
23
  return e ?? null;
23
24
  }
24
- async function I(e) {
25
- if (e instanceof P) return e;
25
+ async function L(e) {
26
+ if (e instanceof F) return e;
26
27
  let t = e?.response;
27
- if (!t) return new P("network", N);
28
- let n = await F(t.data);
29
- return new P(typeof n?.code == "string" && n.code ? n.code : "unknown", typeof n?.message == "string" && n.message ? n.message : N, t.status);
28
+ if (!t) return new F("network", P);
29
+ let n = await I(t.data);
30
+ return new F(typeof n?.code == "string" && n.code ? n.code : "unknown", typeof n?.message == "string" && n.message ? n.message : P, t.status);
30
31
  }
31
- async function L(e) {
32
+ async function R(e) {
32
33
  try {
33
34
  return (await e()).data;
34
35
  } catch (e) {
35
- throw await I(e);
36
+ throw await L(e);
36
37
  }
37
38
  }
38
- function R(e, t, n) {
39
+ function z(e, t, n) {
39
40
  n != null && String(n).trim() !== "" && e.append(t, String(n));
40
41
  }
41
- function z(e, t, n, r) {
42
+ function B(e, t, n, r) {
42
43
  (n ?? []).forEach((n, i) => {
43
44
  let a = n?.name || `${r}-${i + 1}.png`;
44
45
  e.append(t, n, a);
45
46
  });
46
47
  }
47
- function ee(e, t = "/api/support") {
48
+ function V(e, t = "/api/support") {
48
49
  let n = (typeof t == "string" ? t : t?.base ?? "/api/support").replace(/\/+$/, ""), r = (e) => `${n}/tickets/${encodeURIComponent(e)}`;
49
50
  return {
50
- getConfig: () => L(() => e.get(`${n}/settings`)),
51
+ getConfig: () => R(() => e.get(`${n}/settings`)),
51
52
  listTickets: ({ status: t, search: r, page: i, pageSize: a } = {}) => {
52
53
  let o = new URLSearchParams();
53
- R(o, "status", t), R(o, "search", r?.trim()), R(o, "page", i), R(o, "pageSize", a);
54
+ z(o, "status", t), z(o, "search", r?.trim()), z(o, "page", i), z(o, "pageSize", a);
54
55
  let s = o.toString();
55
- return L(() => e.get(`${n}/tickets${s ? `?${s}` : ""}`));
56
+ return R(() => e.get(`${n}/tickets${s ? `?${s}` : ""}`));
56
57
  },
57
- getTicketCounts: () => L(() => e.get(`${n}/tickets/counts`)),
58
- getTicket: (t) => L(() => e.get(r(t))),
58
+ getTicketCounts: () => R(() => e.get(`${n}/tickets/counts`)),
59
+ getTicket: (t) => R(() => e.get(r(t))),
59
60
  createTicket: ({ category: t, subject: r, body: i, pageUrl: a, userAgent: o, appVersion: s, files: c, screenshots: l }) => {
60
61
  let u = new FormData();
61
- return u.append("category", t ?? ""), u.append("subject", r ?? ""), u.append("body", i ?? ""), R(u, "pageUrl", a), R(u, "userAgent", o), R(u, "appVersion", s), z(u, "files", c, "file"), z(u, "screenshots", l, "screenshot"), L(() => e.post(`${n}/tickets`, u));
62
+ return u.append("category", t ?? ""), u.append("subject", r ?? ""), u.append("body", i ?? ""), z(u, "pageUrl", a), z(u, "userAgent", o), z(u, "appVersion", s), B(u, "files", c, "file"), B(u, "screenshots", l, "screenshot"), R(() => e.post(`${n}/tickets`, u));
62
63
  },
63
64
  reply: (t, { body: n, files: i, screenshots: a }) => {
64
65
  let o = new FormData();
65
- return o.append("body", n ?? ""), z(o, "files", i, "file"), z(o, "screenshots", a, "screenshot"), L(() => e.post(`${r(t)}/replies`, o));
66
+ return o.append("body", n ?? ""), B(o, "files", i, "file"), B(o, "screenshots", a, "screenshot"), R(() => e.post(`${r(t)}/replies`, o));
66
67
  },
67
- reopen: (t) => L(() => e.post(`${r(t)}/reopen`)),
68
+ reopen: (t) => R(() => e.post(`${r(t)}/reopen`)),
68
69
  rate: (t, { satisfaction: n, comment: i }) => {
69
70
  let a = { satisfaction: n };
70
- return i != null && i.trim() !== "" && (a.comment = i.trim()), L(() => e.post(`${r(t)}/rating`, a));
71
+ return i != null && i.trim() !== "" && (a.comment = i.trim()), R(() => e.post(`${r(t)}/rating`, a));
71
72
  },
72
- fetchAttachment: (t) => L(() => e.get(`${n}/attachments/${encodeURIComponent(t)}`, { responseType: "blob" })),
73
- confirmAction: (t) => L(() => e.post(`${n}/actions/confirm`, { token: t }))
73
+ fetchAttachment: (t) => R(() => e.get(`${n}/attachments/${encodeURIComponent(t)}`, { responseType: "blob" })),
74
+ confirmAction: (t) => R(() => e.post(`${n}/actions/confirm`, { token: t }))
74
75
  };
75
76
  }
76
77
  //#endregion
77
78
  //#region src/context.js
78
- var B = e(null);
79
- function V() {
80
- let e = n(B);
79
+ var H = e(null);
80
+ function U() {
81
+ let e = n(H);
81
82
  if (!e) throw Error("Support components and hooks must be used inside <SupportProvider>.");
82
83
  return e;
83
84
  }
84
- function H() {
85
- return V().client;
85
+ function W() {
86
+ return U().client;
86
87
  }
87
- function U(e, n, i = !0) {
88
+ function G(e, n, i = !0) {
88
89
  let [a, c] = s({
89
90
  data: null,
90
91
  loading: i,
@@ -133,8 +134,8 @@ function U(e, n, i = !0) {
133
134
  setData: m
134
135
  };
135
136
  }
136
- function W() {
137
- let { loadConfig: e } = V(), { data: t, loading: n, error: r, reload: i } = U(e, "config");
137
+ function K() {
138
+ let { loadConfig: e } = U(), { data: t, loading: n, error: r, reload: i } = G(e, "config");
138
139
  return {
139
140
  config: t,
140
141
  loading: n,
@@ -142,8 +143,8 @@ function W() {
142
143
  reload: i
143
144
  };
144
145
  }
145
- function G(e = {}) {
146
- let t = H(), { status: n, search: r, page: i, pageSize: a } = e, { data: o, loading: s, error: c, reload: l } = U(() => t.listTickets({
146
+ function te(e = {}) {
147
+ let t = W(), { status: n, search: r, page: i, pageSize: a } = e, { data: o, loading: s, error: c, reload: l } = G(() => t.listTickets({
147
148
  status: n,
148
149
  search: r,
149
150
  page: i,
@@ -164,8 +165,8 @@ function G(e = {}) {
164
165
  reload: l
165
166
  };
166
167
  }
167
- function K() {
168
- let e = H(), { data: t, loading: n, error: r, reload: i } = U(() => e.getTicketCounts(), "ticket-counts");
168
+ function ne() {
169
+ let e = W(), { data: t, loading: n, error: r, reload: i } = G(() => e.getTicketCounts(), "ticket-counts");
169
170
  return {
170
171
  counts: t,
171
172
  loading: n,
@@ -174,7 +175,7 @@ function K() {
174
175
  };
175
176
  }
176
177
  function q(e) {
177
- let n = H(), { data: r, loading: i, error: a, reload: o, setData: s } = U(() => n.getTicket(e), e ?? "", !!e), c = t(async (e) => {
178
+ let n = W(), { data: r, loading: i, error: a, reload: o, setData: s } = G(() => n.getTicket(e), e ?? "", !!e), c = t(async (e) => {
178
179
  let t = await e();
179
180
  return s(t), t;
180
181
  }, [s]);
@@ -202,7 +203,7 @@ function q(e) {
202
203
  }
203
204
  //#endregion
204
205
  //#region src/lib/format.js
205
- var te = new Intl.DateTimeFormat("en-IN", {
206
+ var re = new Intl.DateTimeFormat("en-IN", {
206
207
  day: "2-digit",
207
208
  month: "numeric",
208
209
  year: "numeric",
@@ -210,7 +211,7 @@ var te = new Intl.DateTimeFormat("en-IN", {
210
211
  minute: "2-digit",
211
212
  hour12: !0,
212
213
  timeZoneName: "short"
213
- }), ne = [
214
+ }), ie = [
214
215
  "Jan",
215
216
  "Feb",
216
217
  "Mar",
@@ -228,8 +229,8 @@ function J(e) {
228
229
  if (!e) return "-";
229
230
  let t = new Date(e);
230
231
  if (Number.isNaN(t.getTime())) return "-";
231
- let n = Object.fromEntries(te.formatToParts(t).map((e) => [e.type, e.value]));
232
- return `${n.day} ${ne[Number(n.month) - 1]} ${n.year}, ${n.hour}:${n.minute} ${n.dayPeriod.toLowerCase()} ${n.timeZoneName}`;
232
+ let n = Object.fromEntries(re.formatToParts(t).map((e) => [e.type, e.value]));
233
+ return `${n.day} ${ie[Number(n.month) - 1]} ${n.year}, ${n.hour}:${n.minute} ${n.dayPeriod.toLowerCase()} ${n.timeZoneName}`;
233
234
  }
234
235
  function Y(e) {
235
236
  if (!Number.isFinite(e) || e < 0) return "-";
@@ -240,10 +241,10 @@ function Y(e) {
240
241
  }
241
242
  //#endregion
242
243
  //#region src/lib/files.js
243
- function re(e) {
244
+ function ae(e) {
244
245
  return (e?.allowedContentTypes ?? []).join(",");
245
246
  }
246
- function ie(e, t) {
247
+ function oe(e, t) {
247
248
  if (t.length === 0) return !0;
248
249
  let n = (e || "").toLowerCase();
249
250
  return t.some((e) => {
@@ -256,12 +257,12 @@ function X(e, t) {
256
257
  if (r > 0 && n.length > r) return r === 1 ? "You can attach one file." : `You can attach up to ${r} files.`;
257
258
  for (let e of n) {
258
259
  let t = e.name || "This file";
259
- if (!ie(e.type, a)) return `${t} is a file type we cannot accept.`;
260
+ if (!oe(e.type, a)) return `${t} is a file type we cannot accept.`;
260
261
  if (i > 0 && e.size > i) return `${t} is larger than ${Y(i)}.`;
261
262
  }
262
263
  return null;
263
264
  }
264
- function ae(e) {
265
+ function se(e) {
265
266
  let t = Array.from(e.clipboardData?.items ?? []), n = Date.now();
266
267
  return t.filter((e) => e.kind === "file" && e.type.startsWith("image/")).map((e) => e.getAsFile()).filter(Boolean).map((e, t) => {
267
268
  let r = (e.type.split("/")[1] || "png").replace("jpeg", "jpg");
@@ -270,16 +271,16 @@ function ae(e) {
270
271
  }
271
272
  //#endregion
272
273
  //#region src/components/AttachmentField.jsx
273
- function oe({ id: e, label: t = "Attachments", files: n, onChange: r, config: i, error: a }) {
274
+ function ce({ id: e, label: t = "Attachments", files: n, onChange: r, config: i, error: a }) {
274
275
  let o = i?.maxAttachmentBytes ?? 0, s = o > 0 ? Math.max(.1, Math.round(o / (1024 * 1024) * 10) / 10) : 0;
275
- return /* @__PURE__ */ j(h, {
276
+ return /* @__PURE__ */ M(h, {
276
277
  id: e,
277
278
  label: t,
278
279
  optional: !0,
279
280
  multiple: !0,
280
281
  value: n,
281
282
  onChange: r,
282
- accept: re(i),
283
+ accept: ae(i),
283
284
  maxSizeMb: s,
284
285
  validate: !1,
285
286
  error: a || void 0
@@ -287,17 +288,17 @@ function oe({ id: e, label: t = "Attachments", files: n, onChange: r, config: i,
287
288
  }
288
289
  //#endregion
289
290
  //#region src/components/TicketForm.jsx
290
- function se(e, t) {
291
+ function le(e, t) {
291
292
  return t && e.includes(t) ? t : e[0] ?? "";
292
293
  }
293
- function ce({ id: e, config: t, defaultCategory: n, extraFiles: r = [], onSubmit: i, onBusyChange: a, children: o }) {
294
- let l = t?.categories ?? [], [u, d] = s(() => se(l, n)), [f, p] = s(""), [m, h] = s(""), [g, _] = s([]), [y, b] = s({}), [x, C] = s(""), w = (e) => {
294
+ function ue({ id: e, config: t, defaultCategory: n, extraFiles: r = [], onSubmit: i, onBusyChange: a, children: o }) {
295
+ let l = t?.categories ?? [], [u, d] = s(() => le(l, n)), [f, p] = s(""), [m, h] = s(""), [g, _] = s([]), [y, b] = s({}), [x, C] = s(""), w = (e) => {
295
296
  _(e), b((n) => ({
296
297
  ...n,
297
298
  files: X([...r, ...e], t) ?? void 0
298
299
  }));
299
300
  }, T = (e) => {
300
- let t = ae(e);
301
+ let t = se(e);
301
302
  t.length > 0 && w([...g, ...t]);
302
303
  };
303
304
  function E() {
@@ -323,17 +324,17 @@ function ce({ id: e, config: t, defaultCategory: n, extraFiles: r = [], onSubmit
323
324
  }
324
325
  }
325
326
  }
326
- return /* @__PURE__ */ M("form", {
327
+ return /* @__PURE__ */ N("form", {
327
328
  id: e,
328
329
  onSubmit: D,
329
330
  noValidate: !0,
330
331
  className: "d-flex flex-column gap-3",
331
332
  children: [
332
- x && /* @__PURE__ */ j(c, {
333
+ x && /* @__PURE__ */ M(c, {
333
334
  variant: "danger",
334
335
  children: x
335
336
  }),
336
- /* @__PURE__ */ j(S, {
337
+ /* @__PURE__ */ M(S, {
337
338
  id: `${e}-category`,
338
339
  label: "Category",
339
340
  required: !0,
@@ -346,7 +347,7 @@ function ce({ id: e, config: t, defaultCategory: n, extraFiles: r = [], onSubmit
346
347
  placeholder: "Choose a category",
347
348
  error: y.category
348
349
  }),
349
- /* @__PURE__ */ j(v, {
350
+ /* @__PURE__ */ M(v, {
350
351
  id: `${e}-subject`,
351
352
  label: "Subject",
352
353
  required: !0,
@@ -356,7 +357,7 @@ function ce({ id: e, config: t, defaultCategory: n, extraFiles: r = [], onSubmit
356
357
  onChange: (e) => p(e.target.value),
357
358
  error: y.subject
358
359
  }),
359
- /* @__PURE__ */ j(O, {
360
+ /* @__PURE__ */ M(O, {
360
361
  id: `${e}-body`,
361
362
  label: "Message",
362
363
  required: !0,
@@ -370,7 +371,7 @@ function ce({ id: e, config: t, defaultCategory: n, extraFiles: r = [], onSubmit
370
371
  error: y.body
371
372
  }),
372
373
  o,
373
- /* @__PURE__ */ j(oe, {
374
+ /* @__PURE__ */ M(ce, {
374
375
  id: `${e}-files`,
375
376
  files: g,
376
377
  onChange: w,
@@ -382,37 +383,37 @@ function ce({ id: e, config: t, defaultCategory: n, extraFiles: r = [], onSubmit
382
383
  }
383
384
  //#endregion
384
385
  //#region src/ReportIssue.jsx
385
- var le = "supportCapture", ue = {
386
+ var de = "supportCapture", fe = {
386
387
  zIndex: "var(--wui-z-fixed)",
387
388
  bottom: 0,
388
389
  insetInlineEnd: 0
389
- }, de = (e) => e?.dataset?.[le] !== "exclude";
390
- async function fe() {
391
- let e = await k(document.body, {
392
- filter: de,
390
+ }, pe = (e) => e?.dataset?.[de] !== "exclude";
391
+ async function me() {
392
+ let e = await A(document.body, {
393
+ filter: pe,
393
394
  pixelRatio: Math.min(window.devicePixelRatio || 1, 2)
394
395
  });
395
396
  if (!e) throw Error("The page capture came back empty.");
396
397
  return new File([e], "screenshot.png", { type: "image/png" });
397
398
  }
398
- function pe({ file: e, onRemove: t }) {
399
+ function he({ file: e, onRemove: t }) {
399
400
  let [n, i] = s(null);
400
401
  return r(() => {
401
402
  let t = URL.createObjectURL(e);
402
403
  return i(t), () => URL.revokeObjectURL(t);
403
- }, [e]), /* @__PURE__ */ M("figure", {
404
+ }, [e]), /* @__PURE__ */ N("figure", {
404
405
  className: "mb-0 d-flex flex-column gap-2",
405
406
  children: [
406
- /* @__PURE__ */ j("figcaption", {
407
+ /* @__PURE__ */ M("figcaption", {
407
408
  className: "wui-text-sm fw-semibold",
408
409
  children: "Screenshot of this page"
409
410
  }),
410
- n && /* @__PURE__ */ j("img", {
411
+ n && /* @__PURE__ */ M("img", {
411
412
  src: n,
412
413
  alt: "Screenshot of the page you were on",
413
414
  className: "d-block w-100 border rounded"
414
415
  }),
415
- /* @__PURE__ */ j(d, {
416
+ /* @__PURE__ */ M(d, {
416
417
  variant: "ghost",
417
418
  size: "sm",
418
419
  leftIcon: "x",
@@ -423,112 +424,129 @@ function pe({ file: e, onRemove: t }) {
423
424
  ]
424
425
  });
425
426
  }
426
- function me({ label: e = "Report an issue", floating: t = !1, defaultCategory: n = "Bug report", appVersion: r, getTicketHref: a, onOpenTicket: o, onCreated: l, className: u, style: f }) {
427
- let p = H(), { config: m, error: h } = W(), g = `support-report-${i().replace(/[^a-zA-Z0-9-]/g, "")}`, [_, v] = s(!1), [y, x] = s(!1), [S, C] = s(null), [w, T] = s(!1), [E, D] = s(!1), [O, k] = s(null);
428
- async function N() {
429
- x(!0), k(null);
427
+ function ge({ label: e = "Report an issue", floating: t = !1, compact: n = !1, defaultCategory: r = "Bug report", appVersion: a, getTicketHref: o, onOpenTicket: l, onCreated: u, className: f, style: p }) {
428
+ let m = W(), { config: h, error: _ } = K(), v = `support-report-${i().replace(/[^a-zA-Z0-9-]/g, "")}`, [y, x] = s(!1), [S, C] = s(!1), [w, T] = s(null), [E, D] = s(!1), [O, A] = s(!1), [P, F] = s(null), I = k("end", t && n);
429
+ async function L() {
430
+ C(!0), F(null);
430
431
  try {
431
- C(await fe()), T(!1);
432
+ T(await me()), D(!1);
432
433
  } catch {
433
- C(null), T(!0);
434
+ T(null), D(!0);
434
435
  } finally {
435
- x(!1), v(!0);
436
+ C(!1), x(!0);
436
437
  }
437
438
  }
438
- let P = () => {
439
- E || (v(!1), C(null), k(null));
439
+ let R = () => {
440
+ O || (x(!1), T(null), F(null));
440
441
  };
441
- async function F(e) {
442
- let t = await p.createTicket({
442
+ async function z(e) {
443
+ let t = await m.createTicket({
443
444
  ...e,
444
445
  pageUrl: window.location.href,
445
446
  userAgent: navigator.userAgent,
446
- appVersion: r,
447
- screenshots: S ? [S] : []
447
+ appVersion: a,
448
+ screenshots: w ? [w] : []
448
449
  });
449
- k(t), C(null), l?.(t);
450
+ F(t), T(null), u?.(t);
450
451
  }
451
- let I = O && a ? a(O.id) : void 0, L = O ? /* @__PURE__ */ M("div", {
452
+ let B = P && o ? o(P.id) : void 0, V = P ? /* @__PURE__ */ N("div", {
452
453
  className: "d-flex justify-content-end gap-2 w-100",
453
- children: [/* @__PURE__ */ j(d, {
454
+ children: [/* @__PURE__ */ M(d, {
454
455
  variant: "secondary",
455
- onClick: P,
456
+ onClick: R,
456
457
  children: "Close"
457
- }), O && (I || o) ? /* @__PURE__ */ j(d, {
458
- href: I,
459
- onClick: I ? void 0 : () => {
460
- v(!1), k(null), o(O);
458
+ }), P && (B || l) ? /* @__PURE__ */ M(d, {
459
+ href: B,
460
+ onClick: B ? void 0 : () => {
461
+ x(!1), F(null), l(P);
461
462
  },
462
463
  children: "View ticket"
463
464
  }) : null]
464
- }) : /* @__PURE__ */ M("div", {
465
+ }) : /* @__PURE__ */ N("div", {
465
466
  className: "d-flex justify-content-end gap-2 w-100",
466
- children: [/* @__PURE__ */ j(d, {
467
+ children: [/* @__PURE__ */ M(d, {
467
468
  variant: "secondary",
468
- onClick: P,
469
- disabled: E,
469
+ onClick: R,
470
+ disabled: O,
470
471
  children: "Cancel"
471
- }), /* @__PURE__ */ j(d, {
472
+ }), /* @__PURE__ */ M(d, {
472
473
  type: "submit",
473
- form: g,
474
- loading: E,
475
- disabled: !m,
474
+ form: v,
475
+ loading: O,
476
+ disabled: !h,
476
477
  children: "Send report"
477
478
  })]
479
+ }), H = n ? /* @__PURE__ */ M(d, {
480
+ variant: "secondary",
481
+ className: "wui-floating-btn wui-floating-btn--secondary",
482
+ loading: S,
483
+ onClick: L,
484
+ "aria-haspopup": "dialog",
485
+ "aria-label": e,
486
+ tooltip: e,
487
+ tooltipPlacement: "start",
488
+ children: /* @__PURE__ */ M(g, {
489
+ name: "bug",
490
+ size: 22
491
+ })
492
+ }) : /* @__PURE__ */ M(d, {
493
+ leftIcon: "bug",
494
+ variant: t ? "primary" : "outline",
495
+ loading: S,
496
+ onClick: L,
497
+ "aria-haspopup": "dialog",
498
+ children: e
478
499
  });
479
- return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j("span", {
500
+ return /* @__PURE__ */ N(ee, { children: [t && n ? I && j(/* @__PURE__ */ M("span", {
501
+ className: ["wui-floating-stack-item wui-floating-stack-item--secondary", f].filter(Boolean).join(" "),
502
+ style: p,
503
+ children: H
504
+ }), I) : /* @__PURE__ */ M("span", {
480
505
  "data-support-capture": "exclude",
481
- className: [t ? "position-fixed m-3" : "d-inline-block", u].filter(Boolean).join(" "),
506
+ className: [t ? "position-fixed m-3" : "d-inline-block", f].filter(Boolean).join(" "),
482
507
  style: t ? {
483
- ...ue,
484
- ...f
485
- } : f,
486
- children: /* @__PURE__ */ j(d, {
487
- leftIcon: "bug",
488
- variant: t ? "primary" : "outline",
489
- loading: y,
490
- onClick: N,
491
- "aria-haspopup": "dialog",
492
- children: e
493
- })
494
- }), /* @__PURE__ */ j(b, {
495
- open: _,
508
+ ...fe,
509
+ ...p
510
+ } : p,
511
+ children: H
512
+ }), /* @__PURE__ */ M(b, {
513
+ open: y,
496
514
  size: "lg",
497
515
  title: "Report an issue",
498
516
  subtitle: "Tell us what went wrong. We attach a screenshot of this page to help us see it.",
499
517
  headerIcon: "bug",
500
518
  staticBackdrop: !0,
501
- onClose: P,
502
- footer: L,
503
- children: O ? /* @__PURE__ */ j(c, {
519
+ onClose: R,
520
+ footer: V,
521
+ children: P ? /* @__PURE__ */ M(c, {
504
522
  variant: "success",
505
523
  role: "status",
506
- title: `Ticket ${O.number} is with the support team`,
524
+ title: `Ticket ${P.number} is with the support team`,
507
525
  children: "We reply by email. You can follow the ticket on your support page."
508
- }) : m ? /* @__PURE__ */ j(ce, {
509
- id: g,
510
- config: m,
511
- defaultCategory: n,
512
- extraFiles: S ? [S] : [],
513
- onSubmit: F,
514
- onBusyChange: D,
515
- children: S ? /* @__PURE__ */ j(pe, {
516
- file: S,
517
- onRemove: () => C(null)
518
- }) : w ? /* @__PURE__ */ j(c, {
526
+ }) : h ? /* @__PURE__ */ M(ue, {
527
+ id: v,
528
+ config: h,
529
+ defaultCategory: r,
530
+ extraFiles: w ? [w] : [],
531
+ onSubmit: z,
532
+ onBusyChange: A,
533
+ children: w ? /* @__PURE__ */ M(he, {
534
+ file: w,
535
+ onRemove: () => T(null)
536
+ }) : E ? /* @__PURE__ */ M(c, {
519
537
  variant: "info",
520
538
  children: "We could not take a screenshot of this page. You can attach an image instead."
521
539
  }) : null
522
- }) : /* @__PURE__ */ j(c, {
523
- variant: h ? "danger" : "info",
524
- children: h ? h.message || "We could not load the support settings." : "Loading the form."
540
+ }) : /* @__PURE__ */ M(c, {
541
+ variant: _ ? "danger" : "info",
542
+ children: _ ? _.message || "We could not load the support settings." : "Loading the form."
525
543
  })
526
544
  })] });
527
545
  }
528
546
  //#endregion
529
547
  //#region src/components/NewTicketModal.jsx
530
- function he({ open: e, onClose: t, onCreated: n, config: r, defaultCategory: a, appVersion: o }) {
531
- let c = H(), l = `support-new-${i().replace(/[^a-zA-Z0-9-]/g, "")}`, [u, f] = s(!1);
548
+ function _e({ open: e, onClose: t, onCreated: n, config: r, defaultCategory: a, appVersion: o }) {
549
+ let c = W(), l = `support-new-${i().replace(/[^a-zA-Z0-9-]/g, "")}`, [u, f] = s(!1);
532
550
  async function p(e) {
533
551
  n(await c.createTicket({
534
552
  ...e,
@@ -536,7 +554,7 @@ function he({ open: e, onClose: t, onCreated: n, config: r, defaultCategory: a,
536
554
  appVersion: o
537
555
  }));
538
556
  }
539
- return /* @__PURE__ */ j(b, {
557
+ return /* @__PURE__ */ M(b, {
540
558
  open: e,
541
559
  size: "lg",
542
560
  title: "New ticket",
@@ -546,21 +564,21 @@ function he({ open: e, onClose: t, onCreated: n, config: r, defaultCategory: a,
546
564
  onClose: () => {
547
565
  u || t();
548
566
  },
549
- footer: /* @__PURE__ */ M("div", {
567
+ footer: /* @__PURE__ */ N("div", {
550
568
  className: "d-flex justify-content-end gap-2 w-100",
551
- children: [/* @__PURE__ */ j(d, {
569
+ children: [/* @__PURE__ */ M(d, {
552
570
  variant: "secondary",
553
571
  onClick: t,
554
572
  disabled: u,
555
573
  children: "Cancel"
556
- }), /* @__PURE__ */ j(d, {
574
+ }), /* @__PURE__ */ M(d, {
557
575
  type: "submit",
558
576
  form: l,
559
577
  loading: u,
560
578
  children: "Send ticket"
561
579
  })]
562
580
  }),
563
- children: e && /* @__PURE__ */ j(ce, {
581
+ children: e && /* @__PURE__ */ M(ue, {
564
582
  id: l,
565
583
  config: r,
566
584
  defaultCategory: a,
@@ -571,23 +589,23 @@ function he({ open: e, onClose: t, onCreated: n, config: r, defaultCategory: a,
571
589
  }
572
590
  //#endregion
573
591
  //#region src/lib/status.js
574
- var ge = {
592
+ var ve = {
575
593
  Open: "warning",
576
594
  InProgress: "info",
577
595
  Resolved: "success",
578
596
  Closed: "neutral"
579
597
  };
580
- function _e(e) {
581
- return ge[e] ?? "neutral";
598
+ function ye(e) {
599
+ return ve[e] ?? "neutral";
582
600
  }
583
601
  //#endregion
584
602
  //#region src/components/AttachmentThumb.jsx
585
- var ve = {
603
+ var be = {
586
604
  width: 140,
587
605
  maxWidth: "100%"
588
- }, ye = { height: 84 };
589
- function be({ attachment: e }) {
590
- let t = H(), n = (e.contentType || "").startsWith("image/"), [i, a] = s(null), [o, c] = s(!1);
606
+ }, xe = { height: 84 };
607
+ function Se({ attachment: e }) {
608
+ let t = W(), n = (e.contentType || "").startsWith("image/"), [i, a] = s(null), [o, c] = s(!1);
591
609
  r(() => {
592
610
  let n = !0, r = null;
593
611
  return a(null), c(!1), t.fetchAttachment(e.id).then((e) => {
@@ -596,7 +614,7 @@ function be({ attachment: e }) {
596
614
  n = !1, r && URL.revokeObjectURL(r);
597
615
  };
598
616
  }, [t, e.id]);
599
- let l = `Open ${e.fileName}`, u = /* @__PURE__ */ M("span", {
617
+ let l = `Open ${e.fileName}`, u = /* @__PURE__ */ N("span", {
600
618
  className: "d-block text-truncate px-2 py-1 wui-text-xs text-body-secondary",
601
619
  children: [
602
620
  e.fileName,
@@ -604,35 +622,35 @@ function be({ attachment: e }) {
604
622
  Y(e.sizeBytes)
605
623
  ]
606
624
  });
607
- return o ? /* @__PURE__ */ M("span", {
625
+ return o ? /* @__PURE__ */ N("span", {
608
626
  className: "d-inline-flex flex-column border rounded overflow-hidden",
609
- style: ve,
610
- children: [/* @__PURE__ */ M("span", {
627
+ style: be,
628
+ children: [/* @__PURE__ */ N("span", {
611
629
  className: "d-flex align-items-center justify-content-center gap-1 p-2 wui-text-xs text-body-secondary",
612
- children: [/* @__PURE__ */ j(g, {
630
+ children: [/* @__PURE__ */ M(g, {
613
631
  name: "x-circle",
614
632
  size: 14
615
633
  }), "Could not load this file."]
616
634
  }), u]
617
- }) : /* @__PURE__ */ M("a", {
635
+ }) : /* @__PURE__ */ N("a", {
618
636
  className: "d-inline-flex flex-column border rounded overflow-hidden text-decoration-none",
619
- style: ve,
637
+ style: be,
620
638
  href: i ?? void 0,
621
639
  target: "_blank",
622
640
  rel: "noopener noreferrer",
623
641
  "aria-label": l,
624
642
  "aria-busy": !i || void 0,
625
- children: [/* @__PURE__ */ j("span", {
643
+ children: [/* @__PURE__ */ M("span", {
626
644
  className: "d-flex align-items-center justify-content-center bg-body-tertiary",
627
- style: ye,
628
- children: i ? n ? /* @__PURE__ */ j("img", {
645
+ style: xe,
646
+ children: i ? n ? /* @__PURE__ */ M("img", {
629
647
  src: i,
630
648
  alt: e.fileName,
631
649
  className: "d-block w-100 h-100 object-fit-cover"
632
- }) : /* @__PURE__ */ j(g, {
650
+ }) : /* @__PURE__ */ M(g, {
633
651
  name: "file-text",
634
652
  size: 28
635
- }) : /* @__PURE__ */ j(w, {
653
+ }) : /* @__PURE__ */ M(w, {
636
654
  size: "sm",
637
655
  label: `Loading ${e.fileName}`
638
656
  })
@@ -641,60 +659,60 @@ function be({ attachment: e }) {
641
659
  }
642
660
  //#endregion
643
661
  //#region src/components/MessageThread.jsx
644
- var xe = {
662
+ var Ce = {
645
663
  whiteSpace: "pre-wrap",
646
664
  overflowWrap: "anywhere"
647
665
  };
648
- function Se({ messages: e }) {
649
- return /* @__PURE__ */ j("ol", {
666
+ function we({ messages: e }) {
667
+ return /* @__PURE__ */ M("ol", {
650
668
  className: "list-unstyled d-flex flex-column gap-3 mb-0",
651
669
  "aria-label": "Conversation",
652
670
  children: e.map((e) => {
653
- let t = /* @__PURE__ */ j("time", {
671
+ let t = /* @__PURE__ */ M("time", {
654
672
  dateTime: e.createdDateTimeUtc,
655
673
  className: "wui-text-xs text-body-secondary text-nowrap",
656
674
  children: J(e.createdDateTimeUtc)
657
675
  });
658
- if (e.authorKind === "System") return /* @__PURE__ */ M("li", {
676
+ if (e.authorKind === "System") return /* @__PURE__ */ N("li", {
659
677
  className: "text-center wui-text-xs text-body-secondary",
660
678
  "data-author": "system",
661
- children: [/* @__PURE__ */ j("span", {
679
+ children: [/* @__PURE__ */ M("span", {
662
680
  className: "d-block",
663
681
  children: e.body
664
682
  }), t]
665
683
  }, e.id);
666
684
  let n = e.authorKind === "Customer", r = e.authorName || (n ? "You" : "Support team");
667
- return /* @__PURE__ */ M("li", {
685
+ return /* @__PURE__ */ N("li", {
668
686
  className: `d-flex align-items-start gap-2${n ? " flex-row-reverse" : ""}`,
669
687
  "data-author": n ? "customer" : "agent",
670
- children: [/* @__PURE__ */ j(l, {
688
+ children: [/* @__PURE__ */ M(l, {
671
689
  name: r,
672
690
  size: 32,
673
691
  tone: n ? "neutral" : "primary"
674
- }), /* @__PURE__ */ M(f, {
692
+ }), /* @__PURE__ */ N(f, {
675
693
  className: "flex-grow-1 border",
676
694
  padding: "sm",
677
695
  variant: n ? "default" : "accent",
678
696
  style: { minWidth: 0 },
679
697
  children: [
680
- /* @__PURE__ */ M("div", {
698
+ /* @__PURE__ */ N("div", {
681
699
  className: "d-flex flex-wrap align-items-center justify-content-between gap-2 mb-2",
682
- children: [/* @__PURE__ */ M("span", {
700
+ children: [/* @__PURE__ */ N("span", {
683
701
  className: "d-inline-flex flex-wrap align-items-center gap-2 fw-semibold wui-text-sm text-break",
684
- children: [r, !n && /* @__PURE__ */ j(u, {
702
+ children: [r, !n && /* @__PURE__ */ M(u, {
685
703
  tone: "primary",
686
704
  children: "Support"
687
705
  })]
688
706
  }), t]
689
707
  }),
690
- /* @__PURE__ */ j("div", {
708
+ /* @__PURE__ */ M("div", {
691
709
  className: "wui-text-sm",
692
- style: xe,
710
+ style: Ce,
693
711
  children: e.body
694
712
  }),
695
- e.attachments?.length > 0 && /* @__PURE__ */ j("div", {
713
+ e.attachments?.length > 0 && /* @__PURE__ */ M("div", {
696
714
  className: "d-flex flex-wrap gap-2 mt-2",
697
- children: e.attachments.map((e) => /* @__PURE__ */ j(be, { attachment: e }, e.id))
715
+ children: e.attachments.map((e) => /* @__PURE__ */ M(Se, { attachment: e }, e.id))
698
716
  })
699
717
  ]
700
718
  })]
@@ -704,12 +722,12 @@ function Se({ messages: e }) {
704
722
  }
705
723
  //#endregion
706
724
  //#region src/components/RatingPanel.jsx
707
- function Ce({ satisfaction: e, comment: t, canRate: n = !1, commentMaxLength: r, onRate: a }) {
725
+ function Te({ satisfaction: e, comment: t, canRate: n = !1, commentMaxLength: r, onRate: a }) {
708
726
  let o = i(), [l, u] = s(""), [p, m] = s(null), [h, g] = s("");
709
- if (e) return /* @__PURE__ */ M(c, {
727
+ if (e) return /* @__PURE__ */ N(c, {
710
728
  variant: e === "Satisfied" ? "success" : "info",
711
729
  role: "status",
712
- children: [e === "Satisfied" ? "You told us this solved your problem." : "You told us this did not solve your problem.", t ? /* @__PURE__ */ M("span", {
730
+ children: [e === "Satisfied" ? "You told us this solved your problem." : "You told us this did not solve your problem.", t ? /* @__PURE__ */ N("span", {
713
731
  className: "d-block mt-1",
714
732
  children: ["Your comment: ", t]
715
733
  }) : null]
@@ -728,18 +746,18 @@ function Ce({ satisfaction: e, comment: t, canRate: n = !1, commentMaxLength: r,
728
746
  m(null);
729
747
  }
730
748
  }
731
- return /* @__PURE__ */ j(f, {
749
+ return /* @__PURE__ */ M(f, {
732
750
  padding: "sm",
733
751
  className: "border",
734
752
  title: "Did this solve your problem?",
735
- children: /* @__PURE__ */ M("div", {
753
+ children: /* @__PURE__ */ N("div", {
736
754
  className: "d-flex flex-column gap-2",
737
755
  children: [
738
- h && /* @__PURE__ */ j(c, {
756
+ h && /* @__PURE__ */ M(c, {
739
757
  variant: "danger",
740
758
  children: h
741
759
  }),
742
- /* @__PURE__ */ j(O, {
760
+ /* @__PURE__ */ M(O, {
743
761
  id: `${o}-comment`,
744
762
  label: "Anything to add?",
745
763
  rows: 2,
@@ -748,16 +766,16 @@ function Ce({ satisfaction: e, comment: t, canRate: n = !1, commentMaxLength: r,
748
766
  onChange: (e) => u(e.target.value),
749
767
  hint: "Optional. Your comment goes to the support team."
750
768
  }),
751
- /* @__PURE__ */ M("div", {
769
+ /* @__PURE__ */ N("div", {
752
770
  className: "d-flex flex-wrap gap-2",
753
- children: [/* @__PURE__ */ j(d, {
771
+ children: [/* @__PURE__ */ M(d, {
754
772
  variant: "outline",
755
773
  leftIcon: "check-circle",
756
774
  loading: p === "Satisfied",
757
775
  disabled: p !== null,
758
776
  onClick: () => _("Satisfied"),
759
777
  children: "Yes, it is solved"
760
- }), /* @__PURE__ */ j(d, {
778
+ }), /* @__PURE__ */ M(d, {
761
779
  variant: "outline",
762
780
  leftIcon: "x-circle",
763
781
  loading: p === "Unsatisfied",
@@ -772,11 +790,11 @@ function Ce({ satisfaction: e, comment: t, canRate: n = !1, commentMaxLength: r,
772
790
  }
773
791
  //#endregion
774
792
  //#region src/components/ReplyBox.jsx
775
- function we({ onSend: e, config: t, reopens: n = !1 }) {
793
+ function Ee({ onSend: e, config: t, reopens: n = !1 }) {
776
794
  let r = i(), [a, o] = s(""), [l, u] = s([]), [f, p] = s(""), [m, h] = s(""), [g, _] = s(!1), v = (e) => {
777
795
  u(e), p(X(e, t) ?? "");
778
796
  }, y = (e) => {
779
- let t = ae(e);
797
+ let t = se(e);
780
798
  t.length > 0 && v([...l, ...t]);
781
799
  };
782
800
  async function b(n) {
@@ -803,17 +821,17 @@ function we({ onSend: e, config: t, reopens: n = !1 }) {
803
821
  _(!1);
804
822
  }
805
823
  }
806
- return /* @__PURE__ */ M("form", {
824
+ return /* @__PURE__ */ N("form", {
807
825
  onSubmit: b,
808
826
  noValidate: !0,
809
827
  className: "d-flex flex-column gap-2",
810
828
  "aria-label": "Reply to this ticket",
811
829
  children: [
812
- m && /* @__PURE__ */ j(c, {
830
+ m && /* @__PURE__ */ M(c, {
813
831
  variant: "danger",
814
832
  children: m
815
833
  }),
816
- /* @__PURE__ */ j(O, {
834
+ /* @__PURE__ */ M(O, {
817
835
  id: `${r}-body`,
818
836
  label: "Your reply",
819
837
  rows: 4,
@@ -825,16 +843,16 @@ function we({ onSend: e, config: t, reopens: n = !1 }) {
825
843
  hint: n ? "Sending a reply reopens this ticket. You can paste an image into the message." : "You can paste an image into the message.",
826
844
  required: !0
827
845
  }),
828
- /* @__PURE__ */ j(oe, {
846
+ /* @__PURE__ */ M(ce, {
829
847
  id: `${r}-files`,
830
848
  files: l,
831
849
  onChange: v,
832
850
  config: t,
833
851
  error: f
834
852
  }),
835
- /* @__PURE__ */ j("div", {
853
+ /* @__PURE__ */ M("div", {
836
854
  className: "d-flex justify-content-end",
837
- children: /* @__PURE__ */ j(d, {
855
+ children: /* @__PURE__ */ M(d, {
838
856
  type: "submit",
839
857
  leftIcon: "send",
840
858
  loading: g,
@@ -847,19 +865,19 @@ function we({ onSend: e, config: t, reopens: n = !1 }) {
847
865
  //#endregion
848
866
  //#region src/components/TicketDetail.jsx
849
867
  function Z({ label: e, children: t }) {
850
- return /* @__PURE__ */ M("div", {
868
+ return /* @__PURE__ */ N("div", {
851
869
  className: "d-flex flex-column",
852
- children: [/* @__PURE__ */ j("span", {
870
+ children: [/* @__PURE__ */ M("span", {
853
871
  className: "wui-text-xs fw-semibold text-body-secondary",
854
872
  children: e
855
- }), /* @__PURE__ */ j("span", {
873
+ }), /* @__PURE__ */ M("span", {
856
874
  className: "wui-text-sm",
857
875
  children: t
858
876
  })]
859
877
  });
860
878
  }
861
- function Te({ ticketId: e, onBack: t, onChanged: n }) {
862
- let { config: r } = W(), { ticket: i, loading: a, error: o, reload: l, reply: u, reopen: f, rate: p } = q(e), [m, h] = s(!1), [g, _] = s(""), v = async (e) => {
879
+ function De({ ticketId: e, onBack: t, onChanged: n }) {
880
+ let { config: r } = K(), { ticket: i, loading: a, error: o, reload: l, reply: u, reopen: f, rate: p } = q(e), [m, h] = s(!1), [g, _] = s(""), v = async (e) => {
863
881
  let t = await e();
864
882
  return n?.(), t;
865
883
  };
@@ -873,7 +891,7 @@ function Te({ ticketId: e, onBack: t, onChanged: n }) {
873
891
  h(!1);
874
892
  }
875
893
  }
876
- let b = /* @__PURE__ */ j(d, {
894
+ let b = /* @__PURE__ */ M(d, {
877
895
  variant: "ghost",
878
896
  size: "sm",
879
897
  leftIcon: "arrow-left",
@@ -881,86 +899,86 @@ function Te({ ticketId: e, onBack: t, onChanged: n }) {
881
899
  className: "align-self-start",
882
900
  children: "Back to tickets"
883
901
  });
884
- if (!i) return /* @__PURE__ */ M("section", {
902
+ if (!i) return /* @__PURE__ */ N("section", {
885
903
  className: "d-flex flex-column gap-3",
886
904
  "aria-busy": a || void 0,
887
- children: [b, o ? /* @__PURE__ */ M(c, {
905
+ children: [b, o ? /* @__PURE__ */ N(c, {
888
906
  variant: "danger",
889
907
  children: [
890
908
  o.message || "We could not load this ticket.",
891
909
  " ",
892
- /* @__PURE__ */ j(d, {
910
+ /* @__PURE__ */ M(d, {
893
911
  variant: "ghost",
894
912
  size: "sm",
895
913
  onClick: l,
896
914
  children: "Try again"
897
915
  })
898
916
  ]
899
- }) : /* @__PURE__ */ j(C, { height: 160 })]
917
+ }) : /* @__PURE__ */ M(C, { height: 160 })]
900
918
  });
901
919
  let x = i.status === "Resolved" || i.status === "Closed";
902
- return /* @__PURE__ */ M("section", {
920
+ return /* @__PURE__ */ N("section", {
903
921
  className: "d-flex flex-column gap-3",
904
922
  "aria-labelledby": `support-ticket-${i.id}`,
905
923
  children: [
906
924
  b,
907
- /* @__PURE__ */ M("header", {
925
+ /* @__PURE__ */ N("header", {
908
926
  className: "d-flex flex-column gap-2",
909
927
  children: [
910
- /* @__PURE__ */ M("div", {
928
+ /* @__PURE__ */ N("div", {
911
929
  className: "d-flex flex-wrap align-items-center gap-2",
912
- children: [/* @__PURE__ */ j("h2", {
930
+ children: [/* @__PURE__ */ M("h2", {
913
931
  id: `support-ticket-${i.id}`,
914
932
  className: "h5 mb-0 text-break",
915
933
  children: i.subject
916
- }), i.statusLabel && /* @__PURE__ */ j(T, {
934
+ }), i.statusLabel && /* @__PURE__ */ M(T, {
917
935
  label: i.statusLabel,
918
- tone: _e(i.status)
936
+ tone: ye(i.status)
919
937
  })]
920
938
  }),
921
- /* @__PURE__ */ M("div", {
939
+ /* @__PURE__ */ N("div", {
922
940
  className: "row row-cols-2 row-cols-md-4 g-3",
923
941
  children: [
924
- /* @__PURE__ */ j(Z, {
942
+ /* @__PURE__ */ M(Z, {
925
943
  label: "Ticket",
926
944
  children: i.number
927
945
  }),
928
- /* @__PURE__ */ j(Z, {
946
+ /* @__PURE__ */ M(Z, {
929
947
  label: "Category",
930
948
  children: i.category || "-"
931
949
  }),
932
- /* @__PURE__ */ j(Z, {
950
+ /* @__PURE__ */ M(Z, {
933
951
  label: "Opened",
934
- children: /* @__PURE__ */ j("time", {
952
+ children: /* @__PURE__ */ M("time", {
935
953
  dateTime: i.createdDateTimeUtc,
936
954
  children: J(i.createdDateTimeUtc)
937
955
  })
938
956
  }),
939
- /* @__PURE__ */ j(Z, {
957
+ /* @__PURE__ */ M(Z, {
940
958
  label: "Last update",
941
- children: /* @__PURE__ */ j("time", {
959
+ children: /* @__PURE__ */ M("time", {
942
960
  dateTime: i.updatedDateTimeUtc,
943
961
  children: J(i.updatedDateTimeUtc)
944
962
  })
945
963
  })
946
964
  ]
947
965
  }),
948
- /* @__PURE__ */ j("p", {
966
+ /* @__PURE__ */ M("p", {
949
967
  className: "wui-text-xs text-body-secondary mb-0",
950
968
  children: "Times are shown in your time zone."
951
969
  })
952
970
  ]
953
971
  }),
954
- g && /* @__PURE__ */ j(c, {
972
+ g && /* @__PURE__ */ M(c, {
955
973
  variant: "danger",
956
974
  children: g
957
975
  }),
958
- x && /* @__PURE__ */ j(c, {
976
+ x && /* @__PURE__ */ M(c, {
959
977
  variant: "success",
960
978
  role: "status",
961
979
  children: "If you still need help, reopen the ticket or send a reply."
962
980
  }),
963
- i.canReopen && /* @__PURE__ */ j(d, {
981
+ i.canReopen && /* @__PURE__ */ M(d, {
964
982
  variant: "secondary",
965
983
  leftIcon: "history",
966
984
  loading: m,
@@ -968,15 +986,15 @@ function Te({ ticketId: e, onBack: t, onChanged: n }) {
968
986
  className: "align-self-start",
969
987
  children: "Reopen ticket"
970
988
  }),
971
- /* @__PURE__ */ j(Ce, {
989
+ /* @__PURE__ */ M(Te, {
972
990
  satisfaction: i.satisfaction,
973
991
  comment: i.satisfactionComment,
974
992
  canRate: i.canRate,
975
993
  commentMaxLength: r?.satisfactionCommentMaxLength,
976
994
  onRate: (e) => v(() => p(e))
977
995
  }),
978
- /* @__PURE__ */ j(Se, { messages: i.messages ?? [] }),
979
- /* @__PURE__ */ j(we, {
996
+ /* @__PURE__ */ M(we, { messages: i.messages ?? [] }),
997
+ /* @__PURE__ */ M(Ee, {
980
998
  config: r,
981
999
  reopens: x,
982
1000
  onSend: (e) => v(() => u(e))
@@ -987,22 +1005,22 @@ function Te({ ticketId: e, onBack: t, onChanged: n }) {
987
1005
  //#endregion
988
1006
  //#region src/lib/url.js
989
1007
  var Q = "ticket";
990
- function Ee() {
1008
+ function Oe() {
991
1009
  return typeof window > "u" ? null : new URLSearchParams(window.location.search).get(Q);
992
1010
  }
993
- function De(e) {
1011
+ function ke(e) {
994
1012
  if (typeof window > "u") return e ? `?${Q}=${encodeURIComponent(e)}` : "?";
995
1013
  let t = new URL(window.location.href);
996
1014
  return e ? t.searchParams.set(Q, e) : t.searchParams.delete(Q), `${t.pathname}${t.search}${t.hash}`;
997
1015
  }
998
- function Oe(e) {
1016
+ function Ae(e) {
999
1017
  if (typeof window > "u") return;
1000
- let t = De(e);
1018
+ let t = ke(e);
1001
1019
  t !== `${window.location.pathname}${window.location.search}${window.location.hash}` && window.history.replaceState(window.history.state, "", t);
1002
1020
  }
1003
1021
  //#endregion
1004
1022
  //#region src/components/TicketList.jsx
1005
- var ke = [
1023
+ var je = [
1006
1024
  {
1007
1025
  key: "all",
1008
1026
  label: "All",
@@ -1029,16 +1047,16 @@ var ke = [
1029
1047
  countKey: "closed"
1030
1048
  }
1031
1049
  ];
1032
- function Ae({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a, onStatusChange: o, counts: s, search: l, onSearchChange: u, pagination: f }) {
1033
- return /* @__PURE__ */ M("div", {
1050
+ function Me({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a, onStatusChange: o, counts: s, search: l, onSearchChange: u, pagination: f }) {
1051
+ return /* @__PURE__ */ N("div", {
1034
1052
  className: "d-flex flex-column gap-3",
1035
1053
  children: [
1036
- n && /* @__PURE__ */ M(c, {
1054
+ n && /* @__PURE__ */ N(c, {
1037
1055
  variant: "danger",
1038
1056
  children: [
1039
1057
  n.message || "We could not load your tickets.",
1040
1058
  " ",
1041
- /* @__PURE__ */ j(d, {
1059
+ /* @__PURE__ */ M(d, {
1042
1060
  variant: "ghost",
1043
1061
  size: "sm",
1044
1062
  onClick: r,
@@ -1046,10 +1064,10 @@ function Ae({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a
1046
1064
  })
1047
1065
  ]
1048
1066
  }),
1049
- /* @__PURE__ */ M("div", {
1067
+ /* @__PURE__ */ N("div", {
1050
1068
  className: "d-flex flex-column flex-md-row gap-2 align-items-md-center justify-content-between",
1051
- children: [/* @__PURE__ */ j(D, {
1052
- tabs: ke.map(({ key: e, label: t, countKey: n }) => ({
1069
+ children: [/* @__PURE__ */ M(D, {
1070
+ tabs: je.map(({ key: e, label: t, countKey: n }) => ({
1053
1071
  key: e,
1054
1072
  label: t,
1055
1073
  count: s?.[n]
@@ -1058,30 +1076,30 @@ function Ae({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a
1058
1076
  onChange: o,
1059
1077
  ariaLabel: "Filter tickets by status",
1060
1078
  className: "flex-grow-1"
1061
- }), /* @__PURE__ */ j(x, {
1079
+ }), /* @__PURE__ */ M(x, {
1062
1080
  value: l,
1063
1081
  onChange: u,
1064
1082
  placeholder: "Search tickets",
1065
1083
  ariaLabel: "Search tickets"
1066
1084
  })]
1067
1085
  }),
1068
- /* @__PURE__ */ j(m, {
1086
+ /* @__PURE__ */ M(m, {
1069
1087
  columns: [
1070
1088
  {
1071
1089
  key: "subject",
1072
1090
  label: "Subject",
1073
- render: (e) => /* @__PURE__ */ M("div", {
1091
+ render: (e) => /* @__PURE__ */ N("div", {
1074
1092
  className: "d-flex flex-column",
1075
1093
  style: { minWidth: 0 },
1076
- children: [/* @__PURE__ */ j(y, {
1077
- href: De(e.id),
1094
+ children: [/* @__PURE__ */ M(y, {
1095
+ href: ke(e.id),
1078
1096
  animation: "none",
1079
1097
  className: "fw-semibold text-break",
1080
1098
  onClick: (t) => {
1081
1099
  t.metaKey || t.ctrlKey || t.shiftKey || t.altKey || (t.preventDefault(), i(e.id));
1082
1100
  },
1083
1101
  children: e.subject
1084
- }), /* @__PURE__ */ M("span", {
1102
+ }), /* @__PURE__ */ N("span", {
1085
1103
  className: "wui-text-xs text-body-secondary",
1086
1104
  children: [
1087
1105
  e.number,
@@ -1095,9 +1113,9 @@ function Ae({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a
1095
1113
  {
1096
1114
  key: "status",
1097
1115
  label: "Status",
1098
- render: (e) => e.statusLabel ? /* @__PURE__ */ j(T, {
1116
+ render: (e) => e.statusLabel ? /* @__PURE__ */ M(T, {
1099
1117
  label: e.statusLabel,
1100
- tone: _e(e.status)
1118
+ tone: ye(e.status)
1101
1119
  }) : "-"
1102
1120
  },
1103
1121
  {
@@ -1110,7 +1128,7 @@ function Ae({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a
1110
1128
  key: "updatedDateTimeUtc",
1111
1129
  label: "Last update",
1112
1130
  cellClassName: "wui-text-sm text-body-secondary text-nowrap",
1113
- render: (e) => /* @__PURE__ */ j("time", {
1131
+ render: (e) => /* @__PURE__ */ M("time", {
1114
1132
  dateTime: e.updatedDateTimeUtc,
1115
1133
  children: J(e.updatedDateTimeUtc)
1116
1134
  })
@@ -1122,12 +1140,12 @@ function Ae({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a
1122
1140
  ariaLabel: "Support tickets",
1123
1141
  sourceCount: s?.total ?? 0,
1124
1142
  pagination: f,
1125
- empty: /* @__PURE__ */ j(E, {
1143
+ empty: /* @__PURE__ */ M(E, {
1126
1144
  icon: "message-square",
1127
1145
  title: "No tickets yet",
1128
1146
  text: "When you raise a ticket, it shows here with its status."
1129
1147
  }),
1130
- emptyFiltered: /* @__PURE__ */ j(E, {
1148
+ emptyFiltered: /* @__PURE__ */ M(E, {
1131
1149
  icon: "search",
1132
1150
  title: "No tickets match",
1133
1151
  text: "Try another search or status."
@@ -1138,7 +1156,7 @@ function Ae({ tickets: e, loading: t, error: n, onRetry: r, onOpen: i, status: a
1138
1156
  }
1139
1157
  //#endregion
1140
1158
  //#region src/lib/useDebouncedValue.js
1141
- function je(e, t) {
1159
+ function Ne(e, t) {
1142
1160
  let [n, i] = s(e);
1143
1161
  return r(() => {
1144
1162
  let n = setTimeout(() => i(e), t);
@@ -1147,20 +1165,20 @@ function je(e, t) {
1147
1165
  }
1148
1166
  //#endregion
1149
1167
  //#region src/SupportCenter.jsx
1150
- var Me = 300, Ne = 10;
1151
- function Pe({ initialTicketId: e, defaultCategory: t, appVersion: n }) {
1152
- let { config: i, error: a, reload: o } = W(), [l, u] = s("all"), [f, p] = s(""), m = je(f.trim(), Me), [h, g] = s(Ne), _ = `${l}|${m}|${h}`, [v, y] = s({
1168
+ var Pe = 300, Fe = 10;
1169
+ function Ie({ initialTicketId: e, defaultCategory: t, appVersion: n }) {
1170
+ let { config: i, error: a, reload: o } = K(), [l, u] = s("all"), [f, p] = s(""), m = Ne(f.trim(), Pe), [h, g] = s(Fe), _ = `${l}|${m}|${h}`, [v, y] = s({
1153
1171
  key: _,
1154
1172
  page: 1
1155
1173
  }), b = v.key === _ ? v.page : 1, x = (e) => y({
1156
1174
  key: _,
1157
1175
  page: e
1158
- }), S = G({
1176
+ }), S = te({
1159
1177
  status: l === "all" ? void 0 : l,
1160
1178
  search: m || void 0,
1161
1179
  page: b,
1162
1180
  pageSize: h
1163
- }), { counts: C, reload: w } = K(), [T, E] = s(() => e || Ee()), [D, O] = s(!1), k = S.totalPages;
1181
+ }), { counts: C, reload: w } = ne(), [T, E] = s(() => e || Oe()), [D, O] = s(!1), k = S.totalPages;
1164
1182
  r(() => {
1165
1183
  k > 0 && b > k && y({
1166
1184
  key: _,
@@ -1173,15 +1191,15 @@ function Pe({ initialTicketId: e, defaultCategory: t, appVersion: n }) {
1173
1191
  ]);
1174
1192
  let A = () => {
1175
1193
  S.reload(), w();
1176
- }, N = (e) => {
1177
- E(e), Oe(e);
1194
+ }, j = (e) => {
1195
+ E(e), Ae(e);
1178
1196
  };
1179
- if (T) return /* @__PURE__ */ j(Te, {
1197
+ if (T) return /* @__PURE__ */ M(De, {
1180
1198
  ticketId: T,
1181
- onBack: () => N(null),
1199
+ onBack: () => j(null),
1182
1200
  onChanged: A
1183
1201
  }, T);
1184
- let P = {
1202
+ let ee = {
1185
1203
  page: b,
1186
1204
  totalPages: Math.max(1, S.totalPages),
1187
1205
  pageSize: h,
@@ -1189,29 +1207,29 @@ function Pe({ initialTicketId: e, defaultCategory: t, appVersion: n }) {
1189
1207
  setPage: x,
1190
1208
  setPageSize: g
1191
1209
  };
1192
- return /* @__PURE__ */ M("section", {
1210
+ return /* @__PURE__ */ N("section", {
1193
1211
  className: "d-flex flex-column gap-3",
1194
1212
  "aria-labelledby": "support-center-title",
1195
1213
  children: [
1196
- /* @__PURE__ */ M("div", {
1214
+ /* @__PURE__ */ N("div", {
1197
1215
  className: "d-flex flex-wrap align-items-center justify-content-between gap-2",
1198
- children: [/* @__PURE__ */ j("h2", {
1216
+ children: [/* @__PURE__ */ M("h2", {
1199
1217
  id: "support-center-title",
1200
1218
  className: "h5 mb-0",
1201
1219
  children: "Your tickets"
1202
- }), /* @__PURE__ */ j(d, {
1220
+ }), /* @__PURE__ */ M(d, {
1203
1221
  leftIcon: "plus",
1204
1222
  onClick: () => O(!0),
1205
1223
  disabled: !i,
1206
1224
  children: "New ticket"
1207
1225
  })]
1208
1226
  }),
1209
- a && /* @__PURE__ */ M(c, {
1227
+ a && /* @__PURE__ */ N(c, {
1210
1228
  variant: "warning",
1211
1229
  children: [
1212
1230
  a.message || "We could not load the support settings.",
1213
1231
  " ",
1214
- /* @__PURE__ */ j(d, {
1232
+ /* @__PURE__ */ M(d, {
1215
1233
  variant: "ghost",
1216
1234
  size: "sm",
1217
1235
  onClick: o,
@@ -1219,27 +1237,27 @@ function Pe({ initialTicketId: e, defaultCategory: t, appVersion: n }) {
1219
1237
  })
1220
1238
  ]
1221
1239
  }),
1222
- /* @__PURE__ */ j(Ae, {
1240
+ /* @__PURE__ */ M(Me, {
1223
1241
  tickets: S.tickets,
1224
1242
  loading: S.loading,
1225
1243
  error: S.error,
1226
1244
  onRetry: A,
1227
- onOpen: N,
1245
+ onOpen: j,
1228
1246
  status: l,
1229
1247
  onStatusChange: u,
1230
1248
  counts: C,
1231
1249
  search: f,
1232
1250
  onSearchChange: p,
1233
- pagination: P
1251
+ pagination: ee
1234
1252
  }),
1235
- i && /* @__PURE__ */ j(he, {
1253
+ i && /* @__PURE__ */ M(_e, {
1236
1254
  open: D,
1237
1255
  onClose: () => O(!1),
1238
1256
  config: i,
1239
1257
  defaultCategory: t,
1240
1258
  appVersion: n,
1241
1259
  onCreated: (e) => {
1242
- O(!1), A(), N(e.id);
1260
+ O(!1), A(), j(e.id);
1243
1261
  }
1244
1262
  })
1245
1263
  ]
@@ -1248,21 +1266,21 @@ function Pe({ initialTicketId: e, defaultCategory: t, appVersion: n }) {
1248
1266
  //#endregion
1249
1267
  //#region src/SupportContact.jsx
1250
1268
  var $ = (e) => typeof e == "string" && e.trim() !== "";
1251
- function Fe({ className: e }) {
1252
- let { config: t } = W();
1269
+ function Le({ className: e }) {
1270
+ let { config: t } = K();
1253
1271
  if (!t) return null;
1254
1272
  let n = [];
1255
1273
  return $(t.supportEmail) && n.push({
1256
1274
  key: "email",
1257
1275
  icon: "mail",
1258
1276
  label: "Email",
1259
- value: /* @__PURE__ */ M("span", {
1277
+ value: /* @__PURE__ */ N("span", {
1260
1278
  className: "d-inline-flex flex-wrap align-items-center gap-2",
1261
- children: [/* @__PURE__ */ j("a", {
1279
+ children: [/* @__PURE__ */ M("a", {
1262
1280
  href: `mailto:${t.supportEmail}`,
1263
1281
  className: "text-break",
1264
1282
  children: t.supportEmail
1265
- }), /* @__PURE__ */ j(p, {
1283
+ }), /* @__PURE__ */ M(p, {
1266
1284
  text: t.supportEmail,
1267
1285
  size: "sm",
1268
1286
  label: "Copy email",
@@ -1280,18 +1298,18 @@ function Fe({ className: e }) {
1280
1298
  icon: "clock",
1281
1299
  label: "Hours",
1282
1300
  value: t.supportHours
1283
- }), n.length === 0 ? null : /* @__PURE__ */ M("section", {
1301
+ }), n.length === 0 ? null : /* @__PURE__ */ N("section", {
1284
1302
  className: e,
1285
1303
  "aria-label": $(t.supportName) ? `Contact ${t.supportName}` : "Contact support",
1286
- children: [$(t.supportName) && /* @__PURE__ */ j("p", {
1304
+ children: [$(t.supportName) && /* @__PURE__ */ M("p", {
1287
1305
  className: "fw-semibold mb-2",
1288
1306
  children: t.supportName
1289
- }), /* @__PURE__ */ j(_, { items: n })]
1307
+ }), /* @__PURE__ */ M(_, { items: n })]
1290
1308
  });
1291
1309
  }
1292
1310
  //#endregion
1293
1311
  //#region src/SupportProvider.jsx
1294
- function Ie({ client: e, children: n }) {
1312
+ function Re({ client: e, children: n }) {
1295
1313
  let r = o(null), i = t((t = !1) => {
1296
1314
  let n = r.current;
1297
1315
  if (t || !n || n.client !== e) {
@@ -1308,10 +1326,10 @@ function Ie({ client: e, children: n }) {
1308
1326
  client: e,
1309
1327
  loadConfig: i
1310
1328
  }), [e, i]);
1311
- return /* @__PURE__ */ j(B.Provider, {
1329
+ return /* @__PURE__ */ M(H.Provider, {
1312
1330
  value: s,
1313
1331
  children: n
1314
1332
  });
1315
1333
  }
1316
1334
  //#endregion
1317
- export { me as ReportIssue, P as SupportApiError, Pe as SupportCenter, Fe as SupportContact, Ie as SupportProvider, ee as createSupportClient, H as useSupportClient, W as useSupportConfig, q as useSupportTicket, K as useSupportTicketCounts, G as useSupportTickets };
1335
+ export { ge as ReportIssue, F as SupportApiError, Ie as SupportCenter, Le as SupportContact, Re as SupportProvider, V as createSupportClient, W as useSupportClient, K as useSupportConfig, q as useSupportTicket, ne as useSupportTicketCounts, te as useSupportTickets };