@commentkit/comment-kit 2.0.1 → 2.1.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/CHANGELOG.md +33 -0
- package/README.md +14 -6
- package/dist/node/cli/api.js +61 -15
- package/dist/node/cli/credentials.js +8 -0
- package/dist/node/cli/doctor.js +68 -5
- package/dist/node/cli/main.js +275 -52
- package/dist/node/cli/website.js +140 -0
- package/dist/node/types/next.d.ts +4 -4
- package/dist/npm/THIRD_PARTY_NOTICES.txt +47 -0
- package/dist/npm/chunks/{AgentSend-DOy3jhyF.js → AgentSend-pA7Ufvye.js} +3 -3
- package/dist/npm/chunks/Checklist-Cn9skOYK.js +269 -0
- package/dist/npm/chunks/Composer-D7H-pzGa.js +734 -0
- package/dist/npm/chunks/DatePicker-Nta5a1xD.js +161 -0
- package/dist/npm/chunks/{Guest-7hcN765o.js → Guest-Bi7hlzhs.js} +18 -17
- package/dist/npm/chunks/{MarkupEditor-6bJGpWGO.js → MarkupEditor-WU3USeTk.js} +2 -2
- package/dist/npm/chunks/{Panel-ChPUB68C.js → Panel-DhAzbUbC.js} +308 -309
- package/dist/npm/chunks/{Settings-CB5eEKnf.js → Settings-BmKqPX40.js} +34 -33
- package/dist/npm/chunks/{Shortcuts-eAyjJ89P.js → Shortcuts-Bl-c0Sez.js} +25 -23
- package/dist/npm/chunks/SignInFirst-CmGvSYkQ.js +35 -0
- package/dist/npm/chunks/{StyleEditor-CZTdAA5c.js → StyleEditor-D6fUnlwq.js} +4 -4
- package/dist/npm/chunks/{StylePanel-B4pHQUL9.js → StylePanel-C-Gikxt1.js} +3 -3
- package/dist/npm/chunks/TaskFields-CaKi523b.js +617 -0
- package/dist/npm/chunks/ThreadCard-d_3pUB5V.js +1142 -0
- package/dist/npm/chunks/{Viewer-DY6zb90M.js → Viewer-BULQsi9-.js} +9 -8
- package/dist/npm/chunks/{agent-MTQHr9ei.js → agent-DHdhIJ3s.js} +1 -1
- package/dist/npm/chunks/{ar-L5cQ-NPe.js → ar-B5UszrQp.js} +51 -12
- package/dist/npm/chunks/{card-bits-CTdrkYn8.js → card-bits-cV8GdFWX.js} +12 -10
- package/dist/npm/chunks/{client-7eVxvg5j.js → client-Cv8ddtuM.js} +13 -11
- package/dist/npm/chunks/{confetti-BIs5s14P.js → confetti-B9zlyILU.js} +1 -1
- package/dist/npm/chunks/{context-Cf6khm7A.js → context-CsHnabaA.js} +1 -1
- package/dist/npm/chunks/{de-D0C-v6tP.js → de-BE0Aaq8u.js} +51 -12
- package/dist/npm/chunks/{dpop-0A76OPa9.js → dpop-CwW9ifkq.js} +1 -1
- package/dist/npm/chunks/entrance-Bn_5M9uO.js +90 -0
- package/dist/npm/chunks/{es-Bw4Dj9tN.js → es-BQviao4d.js} +51 -12
- package/dist/npm/chunks/{extension-SmoH5AA4.js → extension-CnQTDC1j.js} +2 -2
- package/dist/npm/chunks/{extension-DFVOvciD.js → extension-DXhz81XD.js} +1 -1
- package/dist/npm/chunks/{files-4lV9YQIX.js → files-DLEr_wmh.js} +2 -2
- package/dist/npm/chunks/{fr-TkuQaIAa.js → fr-C5gu6A06.js} +51 -12
- package/dist/npm/chunks/{hi-DXSH2U8d.js → hi-DXfQ5EvY.js} +51 -12
- package/dist/npm/chunks/{i18n-aVSu9TcJ.js → i18n-Mgs9VOuk.js} +17 -21
- package/dist/npm/chunks/icons-_C6ZWmBY.js +141 -0
- package/dist/npm/chunks/{identify-BGYh2dVo.js → identify-BnQGJOa0.js} +1 -1
- package/dist/npm/chunks/{it-CiWA_bch.js → it-BPHt13FV.js} +51 -12
- package/dist/npm/chunks/{ja-C-QmR3yz.js → ja-BkCqyKR0.js} +50 -11
- package/dist/npm/chunks/late-words-D4Oo_yhJ.js +57 -0
- package/dist/npm/chunks/{live-BExWHzQ7.js → live-DXcxj_Af.js} +28 -22
- package/dist/npm/chunks/{nl-CEmZRqjX.js → nl-DZxdLLMU.js} +51 -12
- package/dist/npm/chunks/{page-key-HSY3Lze5.js → page-key-UqAozdZi.js} +1 -1
- package/dist/npm/chunks/{pick-B3sR7jtS.js → pick-C20RVUas.js} +1 -1
- package/dist/npm/chunks/{pkce-CfZhiNBi.js → pkce-BPvWoBrr.js} +1 -1
- package/dist/npm/chunks/{pt-BR-b-a8sxO8.js → pt-BR-lA9mJ05F.js} +51 -12
- package/dist/npm/chunks/{report-DaVuoRYS.js → report-BjUgUNnT.js} +1 -1
- package/dist/npm/chunks/{show-BoN8AC-F.js → show-BinoJyED.js} +7 -7
- package/dist/npm/chunks/signin-C2jjsxz9.js +101 -0
- package/dist/npm/chunks/{source-mk3rGBBQ.js → source-NuflODx3.js} +1 -1
- package/dist/npm/chunks/{src-C8rZFyL_.js → src-9o2Ocq8d.js} +21 -15
- package/dist/npm/chunks/start-Cbx6rMrr.js +1904 -0
- package/dist/npm/chunks/states-DLMCvwes.js +3 -0
- package/dist/npm/chunks/{upload-B2mkgMeJ.js → upload-C4NpM-jE.js} +1 -1
- package/dist/npm/chunks/uploads-CY4bDbaI.js +1236 -0
- package/dist/npm/chunks/{wrap-DW6EFbVQ.js → wrap-D-xTKIzj.js} +20 -20
- package/dist/npm/chunks/{zh-CN-JTscW8u8.js → zh-CN-yqaDHwBx.js} +51 -12
- package/dist/npm/element.js +7 -1
- package/dist/npm/headless.js +2 -2
- package/dist/npm/index.js +2 -2
- package/dist/npm/react.js +1 -1
- package/dist/npm/svelte.js +1 -1
- package/dist/npm/types/adapters/vue.d.ts +12 -0
- package/dist/npm/types/core/auth.d.ts +1 -0
- package/dist/npm/types/core/client.d.ts +5 -1
- package/dist/npm/types/core/types.d.ts +17 -2
- package/dist/npm/vue.js +5 -1
- package/package.json +2 -1
- package/dist/npm/chunks/Checklist-CW_SwMpS.js +0 -282
- package/dist/npm/chunks/Composer-Bveq5QrK.js +0 -727
- package/dist/npm/chunks/TaskFields-C8BX0Sgg.js +0 -289
- package/dist/npm/chunks/ThreadCard-B1EsX3PR.js +0 -1160
- package/dist/npm/chunks/late-words-80_VWt8S.js +0 -14
- package/dist/npm/chunks/signin-BOWr_WCo.js +0 -75
- package/dist/npm/chunks/start-CV4j78_q.js +0 -1894
- package/dist/npm/chunks/states-b9Bv3Ci7.js +0 -3
- package/dist/npm/chunks/uploads-8AxyRq7g.js +0 -1147
|
@@ -14,7 +14,7 @@ var e = {
|
|
|
14
14
|
modeBarTouch: "Toque em algo para comentar · Role a tela normalmente · Selecione um texto antes para citá-lo",
|
|
15
15
|
commentOnPage: "Comentar a página inteira",
|
|
16
16
|
commentFocused: "Comentar a parte selecionada",
|
|
17
|
-
attach: "Anexar
|
|
17
|
+
attach: "Anexar arquivos",
|
|
18
18
|
screenshot: "Captura de tela",
|
|
19
19
|
screenshotIncluded: "Uma captura do que você está vendo é incluída automaticamente.",
|
|
20
20
|
screenshotRemove: "Remover a captura",
|
|
@@ -36,8 +36,6 @@ var e = {
|
|
|
36
36
|
capturing: "Fazendo a captura…",
|
|
37
37
|
capturingFailed: "Não foi possível capturar esta página, mas seu comentário ainda marca o local.",
|
|
38
38
|
uploadFailed: "Não foi possível anexar o arquivo. Você ainda pode enviar seu comentário.",
|
|
39
|
-
signInToSend: "Último passo: diga quem você é",
|
|
40
|
-
signInExplain: "Vamos abrir uma janela pequena para você confirmar seu e-mail. Você só faz isso uma vez neste dispositivo.",
|
|
41
39
|
signIn: "Continuar",
|
|
42
40
|
signInMember: "Entrar",
|
|
43
41
|
signOut: "Sair",
|
|
@@ -67,9 +65,6 @@ var e = {
|
|
|
67
65
|
resolve: "Resolver",
|
|
68
66
|
resolveHint: "Marcar como corrigido",
|
|
69
67
|
reopen: "Reabrir",
|
|
70
|
-
markInProgress: "Começar a trabalhar",
|
|
71
|
-
markInReview: "Marcar como pronto para revisão",
|
|
72
|
-
closeThread: "Fechar sem corrigir",
|
|
73
68
|
reviewAsk: "A equipe acha que já está corrigido. Ficou certo para você?",
|
|
74
69
|
looksGood: "Ficou bom — resolver",
|
|
75
70
|
notYet: "Ainda não — responder",
|
|
@@ -110,7 +105,6 @@ var e = {
|
|
|
110
105
|
readOnlyReply: "Você pode ler esta conversa, mas as respostas estão desativadas no momento.",
|
|
111
106
|
noReplyAccess: "Você pode ler esta conversa, mas não tem permissão para responder.",
|
|
112
107
|
notOnPage: "Não encontrado nesta página",
|
|
113
|
-
more: "Mais",
|
|
114
108
|
allStatuses: "Todos",
|
|
115
109
|
markAllRead: "Marcar tudo como lido",
|
|
116
110
|
messageCount: "{n} mensagens",
|
|
@@ -233,7 +227,6 @@ var e = {
|
|
|
233
227
|
sentWithoutFiles: "Enviado, mas alguns arquivos não puderam ser anexados. Você pode adicioná-los em uma resposta.",
|
|
234
228
|
replyFailed: "Sua resposta ainda não foi enviada. Ela continua aqui, então você pode tentar de novo.",
|
|
235
229
|
taskDetails: "Detalhes da tarefa",
|
|
236
|
-
taskDetailsSet: "Detalhes da tarefa adicionados",
|
|
237
230
|
priority: "Prioridade",
|
|
238
231
|
priority_none: "Sem prioridade",
|
|
239
232
|
priority_low: "Baixa",
|
|
@@ -241,7 +234,6 @@ var e = {
|
|
|
241
234
|
priority_high: "Alta",
|
|
242
235
|
priority_urgent: "Urgente",
|
|
243
236
|
dueDate: "Prazo",
|
|
244
|
-
dueOn: "Prazo: {date}",
|
|
245
237
|
labels: "Etiquetas",
|
|
246
238
|
noLabels: "Sem etiquetas",
|
|
247
239
|
mentionList: "Pessoas que você pode mencionar",
|
|
@@ -259,7 +251,7 @@ var e = {
|
|
|
259
251
|
detailPage: "Página",
|
|
260
252
|
detailBrowser: "Navegador",
|
|
261
253
|
detailWindow: "Janela",
|
|
262
|
-
details: "
|
|
254
|
+
details: "Detalhes",
|
|
263
255
|
quotedText: "Texto selecionado",
|
|
264
256
|
replyTo: "Responder a {name}",
|
|
265
257
|
quoteReply: "Responder com uma citação",
|
|
@@ -293,7 +285,6 @@ var e = {
|
|
|
293
285
|
sortPriority: "Maior prioridade",
|
|
294
286
|
pinMoved: "{ref} foi movido para cá.",
|
|
295
287
|
pinMovable: "marcador, arraste para mover",
|
|
296
|
-
assign: "Atribuir",
|
|
297
288
|
modeBarNoText: "Clique em algo para comentar · Arraste para marcar uma área · Esc para sair",
|
|
298
289
|
modeBarTouchNoText: "Toque em algo para comentar · Role a tela normalmente",
|
|
299
290
|
verifyResendIn: "Novo código em {n} s",
|
|
@@ -405,6 +396,54 @@ var e = {
|
|
|
405
396
|
signOffNewCommit: "Esta página mudou desde que foi aprovada.",
|
|
406
397
|
signOffOpen: "{n} comentários desta página ainda estão abertos. Você pode aprovar mesmo assim.",
|
|
407
398
|
signOffOpen_one: "{n} comentário desta página ainda está aberto. Você pode aprovar mesmo assim.",
|
|
408
|
-
signOffWithdraw: "Retirar a aprovação"
|
|
399
|
+
signOffWithdraw: "Retirar a aprovação",
|
|
400
|
+
moreFeedback: "Mais opções de feedback",
|
|
401
|
+
messagesRegion: "Mensagens do CommentKit",
|
|
402
|
+
dismissMessage: "Dispensar mensagem",
|
|
403
|
+
moreThread: "Mais ações para este comentário",
|
|
404
|
+
closeCard: "Fechar comentário",
|
|
405
|
+
closeInbox: "Fechar caixa de entrada",
|
|
406
|
+
closeSettings: "Fechar configurações",
|
|
407
|
+
closeShortcuts: "Fechar atalhos de teclado",
|
|
408
|
+
closeVerify: "Fechar a digitação do código",
|
|
409
|
+
closeImage: "Fechar imagem",
|
|
410
|
+
shownAnnounce: "O CommentKit está ativado. Pressione C para comentar.",
|
|
411
|
+
shownAnnounceNoKeys: "O CommentKit está ativado.",
|
|
412
|
+
addReaction: "Adicionar uma reação",
|
|
413
|
+
fieldChange: "{field}: {value}, alterar",
|
|
414
|
+
assignee: "Responsável",
|
|
415
|
+
dueToday: "Hoje",
|
|
416
|
+
tomorrow: "Amanhã",
|
|
417
|
+
dueYesterday: "Ontem",
|
|
418
|
+
statusHelp_open: "Novo e ainda não iniciado.",
|
|
419
|
+
statusHelp_in_progress: "Alguém está trabalhando nisso.",
|
|
420
|
+
statusHelp_in_review: "Feito pela equipe; aguardando a verificação de quem pediu.",
|
|
421
|
+
statusHelp_resolved: "Corrigido e confirmado.",
|
|
422
|
+
statusHelp_closed: "Não será feito.",
|
|
423
|
+
findTeammate: "Encontrar alguém da equipe",
|
|
424
|
+
peopleNone: "Ninguém da equipe corresponde.",
|
|
425
|
+
peopleMore: "Mostrando {shown} de {n}. Digite para filtrar.",
|
|
426
|
+
peopleLoading: "Carregando a equipe…",
|
|
427
|
+
unassignAll: "Remover todos",
|
|
428
|
+
teamMembers: "Membros da equipe",
|
|
429
|
+
today: "Hoje",
|
|
430
|
+
nextWeek: "Próxima semana",
|
|
431
|
+
clear: "Limpar",
|
|
432
|
+
previousMonth: "Mês anterior",
|
|
433
|
+
nextMonth: "Próximo mês",
|
|
434
|
+
screenshotLabel: "Captura desta tela",
|
|
435
|
+
markupShort: "Desenhar nela",
|
|
436
|
+
screenshotRemoveShort: "Remover",
|
|
437
|
+
signingIn: "Entrando…",
|
|
438
|
+
signInWaiting: "Termine de entrar na janela que foi aberta. Seu comentário está salvo.",
|
|
439
|
+
signInCancel: "Cancelar login",
|
|
440
|
+
signedInPressSend: "Você entrou. Toque em Enviar para publicar seu comentário.",
|
|
441
|
+
stillSending: "Ainda enviando…",
|
|
442
|
+
signInToComment: "Entre para comentar",
|
|
443
|
+
signInToCommentBody: "Os comentários em {website} são para a equipe e os clientes que ela convida. Entre com sua conta CommentKit e depois clique no ponto que deve mudar.",
|
|
444
|
+
signInToCommentBodyTouch: "Os comentários em {website} são para a equipe e os clientes que ela convida. Entre com sua conta CommentKit e depois toque no ponto que deve mudar.",
|
|
445
|
+
signInToSend: "Entrar para enviar",
|
|
446
|
+
signInToSendTitle: "Entre para enviar isto",
|
|
447
|
+
signInToSendBody: "Os comentários neste site vêm da equipe e de clientes convidados. Seu texto fica aqui enquanto você entra."
|
|
409
448
|
};
|
|
410
449
|
export { e as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i } from "./src-
|
|
2
|
-
import { i as a, l as o, v as s } from "./client-
|
|
3
|
-
import { n as c } from "./page-key-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i } from "./src-9o2Ocq8d.js";
|
|
2
|
+
import { i as a, l as o, v as s } from "./client-Cv8ddtuM.js";
|
|
3
|
+
import { n as c } from "./page-key-UqAozdZi.js";
|
|
4
4
|
// src/core/show.ts
|
|
5
5
|
var l;
|
|
6
6
|
function u() {
|
|
@@ -23,10 +23,10 @@ async function m(i, a, o, s, m, v, y = () => void 0) {
|
|
|
23
23
|
if (x && !i.auth.hasSession() && !e()) return y(), null;
|
|
24
24
|
if (!a.enabled && !b && !x) return null;
|
|
25
25
|
c.ignore(a.pages?.ignored_query_params);
|
|
26
|
-
let S = n(() => import("./start-
|
|
27
|
-
if (S.catch(() => void 0), C.catch(() => void 0), await i.auth.completeRedirect().catch(() => !1), e() && await import("./extension-
|
|
26
|
+
let S = n(() => import("./start-Cbx6rMrr.js").then((e) => e.t)), C = S.then((e) => e.setLocale(i.options.locale));
|
|
27
|
+
if (S.catch(() => void 0), C.catch(() => void 0), await i.auth.completeRedirect().catch(() => !1), e() && await import("./extension-CnQTDC1j.js").then((e) => e.extensionHandoff(i.auth)).catch(() => !1), v && a.enabled && await import("./identify-BnQGJOa0.js").then((e) => e.identify(i, v, null, !0)).catch(() => !1), await i.loadSession().catch(() => null), i.state.get().session || h(i.options.project), x && !p(i)) return y(), null;
|
|
28
28
|
let w = await S, { installDiagnostics: T, mountWidget: E } = w;
|
|
29
|
-
if (x && Object.assign(w.en, (await import("./late-words-
|
|
29
|
+
if (x && Object.assign(w.en, (await import("./late-words-D4Oo_yhJ.js").then((e) => e.n)).LATE), await C, s()) return null;
|
|
30
30
|
let D = T({
|
|
31
31
|
console: a.features.console_capture,
|
|
32
32
|
network: a.features.network_capture,
|
|
@@ -82,7 +82,7 @@ function v(e, t) {
|
|
|
82
82
|
console.warn(r ? `[CommentKit] The widget could not start: ${t.message} (${t.code}). See https://commentkit.dev/docs/errors#${t.code}` : "[CommentKit] The widget could not start; your page is not affected. See https://commentkit.dev/docs/troubleshooting", t), r && e.emit("error", { error: t }), (!r || t.status >= 500) && e.reportCrash(t, "start");
|
|
83
83
|
}
|
|
84
84
|
function y(e, t) {
|
|
85
|
-
import("./report-
|
|
85
|
+
import("./report-BjUgUNnT.js").then((n) => n.reportStart(e, t)).catch(() => void 0);
|
|
86
86
|
}
|
|
87
87
|
var b = "See https://commentkit.dev/docs/";
|
|
88
88
|
function x(e, ...t) {
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { b as e } from "./client-Cv8ddtuM.js";
|
|
2
|
+
import { r as t } from "./page-key-UqAozdZi.js";
|
|
3
|
+
import { t as n } from "./pkce-BPvWoBrr.js";
|
|
4
|
+
import { t as r } from "./locale-D8Q4Q2Nt.js";
|
|
5
|
+
// src/core/signin.ts
|
|
6
|
+
function i(e = navigator.userAgent) {
|
|
7
|
+
return /FBAN|FBAV|Instagram|Line\/|WhatsApp|Snapchat|LinkedInApp|Slack|Twitter|MicroMessenger|; wv\)|GSA\//i.test(e);
|
|
8
|
+
}
|
|
9
|
+
var a = "popup=yes,width=460,height=680,left=120,top=80", o = 100, s = 500, c = 6e5, l = (e) => `commentkit:pkce:${e.projectKey}`;
|
|
10
|
+
function u() {
|
|
11
|
+
return (document.querySelector("[data-commentkit-host]")?.shadowRoot?.querySelector(".ck-root"))?.getAttribute("lang") || r();
|
|
12
|
+
}
|
|
13
|
+
var d = null, f = !1, p = !1;
|
|
14
|
+
function m() {
|
|
15
|
+
if (f || window.crossOriginIsolated) return Promise.resolve(!0);
|
|
16
|
+
let e = location.href.split("#")[0];
|
|
17
|
+
return d?.[0] !== e && (d = [e, fetch(e, {
|
|
18
|
+
method: "HEAD",
|
|
19
|
+
credentials: "same-origin",
|
|
20
|
+
cache: "no-store"
|
|
21
|
+
}).then((e) => /^same-origin(;|$)/i.test((e.headers.get("cross-origin-opener-policy") ?? "").replace(/\s/g, ""))).catch(() => !1)]), d[1];
|
|
22
|
+
}
|
|
23
|
+
function h() {
|
|
24
|
+
p || (p = !0, console.warn("[CommentKit] Sign-in cannot use a popup on this page: it is sent with \"Cross-Origin-Opener-Policy: same-origin\", which cuts the sign-in window off from it. Use auth: \"redirect\" (data-auth=\"redirect\"), leave auth unset (\"auto\" signs in on the same tab here), or send \"Cross-Origin-Opener-Policy: same-origin-allow-popups\"."));
|
|
25
|
+
}
|
|
26
|
+
async function g(t, r) {
|
|
27
|
+
let o = e(48), c = e(24), l = r.mode ?? "auto", d = l === "auto" && !i() ? Promise.race([m(), new Promise((e) => setTimeout(e, s, !1))]) : null, p = await n(o), g = l === "redirect" || l === "auto" && (i() || await d), _ = t.signInLink, S = u(), C = v(t, p, c, r.share ?? null, g ? location.href : null, _, S);
|
|
28
|
+
if (g) return t.signInLink = null, y(t, C, o, c);
|
|
29
|
+
let w = window.open(C.toString(), "commentkit-signin", a);
|
|
30
|
+
if (!w) return l === "auto" ? (t.signInLink = null, y(t, v(t, p, c, r.share ?? null, location.href, _, S), o, c)) : "popup_blocked";
|
|
31
|
+
t.signInLink = null;
|
|
32
|
+
let T = await x(t, w, c, r.signal);
|
|
33
|
+
return T === b ? (f = !0, l === "auto" ? y(t, v(t, p, c, r.share ?? null, location.href, _, S), o, c) : (h(), "cancelled")) : T ? await t.exchange(T, o) ? "signed_in" : "failed" : "cancelled";
|
|
34
|
+
}
|
|
35
|
+
async function _(e) {
|
|
36
|
+
let n = new URL(location.href), r = n.searchParams.get("ck_code"), i = n.searchParams.get("ck_state");
|
|
37
|
+
if (!r || !i) return !1;
|
|
38
|
+
history.replaceState(history.state, "", t(location.href, /^ck_(code|state)$/));
|
|
39
|
+
let a = null;
|
|
40
|
+
try {
|
|
41
|
+
a = JSON.parse(sessionStorage.getItem(l(e)) ?? "null"), sessionStorage.removeItem(l(e));
|
|
42
|
+
} catch {
|
|
43
|
+
return !1;
|
|
44
|
+
}
|
|
45
|
+
return !a?.verifier || a.state !== i ? !1 : e.exchange(r, a.verifier);
|
|
46
|
+
}
|
|
47
|
+
function v(e, t, n, r, i, a = null, o = u()) {
|
|
48
|
+
let s = new URL(e.authorize ?? "/widget/connect", e.endpoint), c = a ? new URL("guest", s) : s;
|
|
49
|
+
return c.search = new URLSearchParams({
|
|
50
|
+
key: e.projectKey,
|
|
51
|
+
origin: e.origin,
|
|
52
|
+
code_challenge: t,
|
|
53
|
+
code_challenge_method: "S256",
|
|
54
|
+
state: n,
|
|
55
|
+
locale: o,
|
|
56
|
+
...r ? { share: r } : {},
|
|
57
|
+
...i ? { return_to: i } : {}
|
|
58
|
+
}).toString(), a && (c.hash = `signin=${encodeURIComponent(a)}`), c;
|
|
59
|
+
}
|
|
60
|
+
function y(e, t, n, r) {
|
|
61
|
+
try {
|
|
62
|
+
sessionStorage.setItem(l(e), JSON.stringify({
|
|
63
|
+
verifier: n,
|
|
64
|
+
state: r
|
|
65
|
+
}));
|
|
66
|
+
} catch {
|
|
67
|
+
return "failed";
|
|
68
|
+
}
|
|
69
|
+
return location.assign(t.toString()), "redirecting";
|
|
70
|
+
}
|
|
71
|
+
var b = Symbol();
|
|
72
|
+
function x(e, t, n, r) {
|
|
73
|
+
let i = [new URL(e.endpoint).origin, new URL(e.authorize ?? e.endpoint).origin];
|
|
74
|
+
return new Promise((e) => {
|
|
75
|
+
let a = !1, s = Date.now(), l = (t) => {
|
|
76
|
+
a || (a = !0, window.removeEventListener("message", d), r?.removeEventListener("abort", u), clearInterval(m), e(t));
|
|
77
|
+
}, u = () => {
|
|
78
|
+
try {
|
|
79
|
+
t.close();
|
|
80
|
+
} catch {}
|
|
81
|
+
l(null);
|
|
82
|
+
}, d = (e) => {
|
|
83
|
+
if (e.source !== t || !i.includes(e.origin)) return;
|
|
84
|
+
let r = e.data;
|
|
85
|
+
r?.type === "commentkit:auth" && r.state === n && typeof r.code == "string" && l(r.code);
|
|
86
|
+
};
|
|
87
|
+
window.addEventListener("message", d);
|
|
88
|
+
let f = null, p = !1, m = setInterval(() => {
|
|
89
|
+
if (Date.now() - s > c) return l(null);
|
|
90
|
+
if (t.closed && !p) return l(b);
|
|
91
|
+
if (!p) try {
|
|
92
|
+
p = t.location.href !== "about:blank";
|
|
93
|
+
} catch {
|
|
94
|
+
p = !0;
|
|
95
|
+
}
|
|
96
|
+
t.closed && (f ?? (f = Date.now())), f !== null && Date.now() - f > 1e3 && l(null);
|
|
97
|
+
}, o);
|
|
98
|
+
r?.aborted ? u() : r?.addEventListener("abort", u);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
export { v as authorizeUrl, _ as completeRedirect, m as cutOff, g as signIn, u as widgetLocale };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, d as t, i as n, p as r, s as i, t as a } from "./client-
|
|
1
|
+
import { a as e, d as t, i as n, p as r, s as i, t as a } from "./client-Cv8ddtuM.js";
|
|
2
2
|
// src/activation.ts
|
|
3
3
|
var o = "commentkit:active", s = "data-commentkit-extension";
|
|
4
4
|
function c() {
|
|
@@ -30,10 +30,15 @@ function f(e, t) {
|
|
|
30
30
|
return n;
|
|
31
31
|
}
|
|
32
32
|
function p(e) {
|
|
33
|
-
let t = (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
let t, n = (n) => {
|
|
34
|
+
let r = /^k$/i.test(n.key);
|
|
35
|
+
(n.type == "keydown" ? t = (n.metaKey || n.ctrlKey) && n.shiftKey && r && e() : t && r) && (n.type == "keyup" && (t = 0), n.preventDefault(), n.stopImmediatePropagation());
|
|
36
|
+
}, r = [
|
|
37
|
+
"keydown",
|
|
38
|
+
"keypress",
|
|
39
|
+
"keyup"
|
|
40
|
+
];
|
|
41
|
+
return r.map((e) => addEventListener(e, n, !0)), () => r.map((e) => removeEventListener(e, n, !0));
|
|
37
42
|
}
|
|
38
43
|
var m = "commentkit:crashes";
|
|
39
44
|
function h() {
|
|
@@ -57,7 +62,7 @@ function S(e, t, ...n) {
|
|
|
57
62
|
b[e] || (b[e] = 1, console.warn(`[CommentKit] ${t}`, ...n));
|
|
58
63
|
}
|
|
59
64
|
function C(e, ...t) {
|
|
60
|
-
b[e] || (b[e] = 1, import("./show-
|
|
65
|
+
b[e] || (b[e] = 1, import("./show-BinoJyED.js").then((n) => n.explain(e, ...t)).catch(E));
|
|
61
66
|
}
|
|
62
67
|
function w() {
|
|
63
68
|
let e = (e) => typeof e == "string" && e.trim() ? e.trim().slice(0, 255) : null;
|
|
@@ -85,7 +90,7 @@ function T(e) {
|
|
|
85
90
|
let i = A(e);
|
|
86
91
|
return typeof i == "string" ? M(e, i) : (_ = i, k(i));
|
|
87
92
|
} catch (t) {
|
|
88
|
-
return console.warn("[CommentKit] The widget could not start because of an error inside CommentKit; your page is not affected. See https://commentkit.dev/docs/troubleshooting", t), import("./show-
|
|
93
|
+
return console.warn("[CommentKit] The widget could not start because of an error inside CommentKit; your page is not affected. See https://commentkit.dev/docs/troubleshooting", t), import("./show-BinoJyED.js").then((n) => n.reportStart(e, t)).catch(E), M(e);
|
|
89
94
|
}
|
|
90
95
|
}
|
|
91
96
|
var E = () => void 0, D = (e) => (t) => S(e, `${e}() failed.`, t), O = (e, t) => (...n) => t(...n).then(E, D(e));
|
|
@@ -113,10 +118,12 @@ function A(e) {
|
|
|
113
118
|
let s = w(), { _key: l, _signin: f, _finish: m, identity: b, ...S } = e, T = {
|
|
114
119
|
...S,
|
|
115
120
|
...r(e.branch || s.branch, e.commit || s.commit)
|
|
116
|
-
}, k = new a(T), A = null, j = null, M = !1, N = !1, P = !!l
|
|
121
|
+
}, k = new a(T), A = null, j = null, M = !1, N = !1, P = !!l;
|
|
122
|
+
l && (k.entrance = "key");
|
|
123
|
+
let F = k.auth.takeSignInLink(v) || !!(k.auth.finishLink = y);
|
|
117
124
|
v = y = null;
|
|
118
125
|
let I = 0, L, R = (e) => (e === !0 && (N = !0), N && A?.attach?.(), M || A ? Promise.resolve() : (j ?? (j = (async (e) => {
|
|
119
|
-
let t = () => e !== I, n = g(() => import("./show-
|
|
126
|
+
let t = () => e !== I, n = g(() => import("./show-BinoJyED.js"));
|
|
120
127
|
n.catch(E);
|
|
121
128
|
try {
|
|
122
129
|
let e = await k.loadConfig();
|
|
@@ -131,16 +138,15 @@ function A(e) {
|
|
|
131
138
|
clearTimeout(L), I++, N = !1, j = null, A?.(), A = null;
|
|
132
139
|
}, B = T.toggleShortcut === !1 ? E : p(() => {
|
|
133
140
|
try {
|
|
134
|
-
|
|
141
|
+
return A ? (k.state.set({ request: {
|
|
135
142
|
kind: "inbox",
|
|
136
143
|
at: Date.now()
|
|
137
|
-
} }), !0;
|
|
138
|
-
P = !0, R(!0);
|
|
144
|
+
} }), !0) : (P = !0, k.entrance = "key", R(!0), !0);
|
|
139
145
|
} catch (e) {
|
|
140
146
|
D("shortcut")(e);
|
|
141
147
|
}
|
|
142
148
|
});
|
|
143
|
-
c() && import("./extension-
|
|
149
|
+
c() && import("./extension-CnQTDC1j.js").then((e) => e.extensionHello()).catch(() => void 0);
|
|
144
150
|
let V = F || P || u(T.project, T.hideOnProduction ?? !0) || !!b;
|
|
145
151
|
V && !F && !P && h() >= 3 && (V = !1, C("cooling")), V && !k.auth.hasSession() && k.prefetchSignIn();
|
|
146
152
|
let H = V ? R().then(() => !!A) : Promise.resolve(!1), U = {
|
|
@@ -156,7 +162,7 @@ function A(e) {
|
|
|
156
162
|
} });
|
|
157
163
|
}),
|
|
158
164
|
signIn: async () => await k.signIn() === "signed_in",
|
|
159
|
-
identify: (e) => import("./identify-
|
|
165
|
+
identify: (e) => import("./identify-BnQGJOa0.js").then((t) => t.identify(k, e, R)).catch(() => !1),
|
|
160
166
|
signOut: O("signOut", () => k.signOut()),
|
|
161
167
|
session: () => i(k.state.get().session)
|
|
162
168
|
};
|
|
@@ -208,7 +214,7 @@ function M(t, n) {
|
|
|
208
214
|
destroy: E,
|
|
209
215
|
...n ? { _r() {
|
|
210
216
|
let e = n && /* @__PURE__ */ Error(`init() stayed off: ${n}`);
|
|
211
|
-
n = void 0, e && import("./show-
|
|
217
|
+
n = void 0, e && import("./show-BinoJyED.js").then((n) => n.reportStart(t, e)).catch(E);
|
|
212
218
|
} } : {}
|
|
213
219
|
};
|
|
214
220
|
}
|