@launchsecure/launch-kit 0.0.30 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/beacon/beacon.mjs +934 -865
- package/dist/beacon/beacon.mjs.map +1 -1
- package/dist/beacon/beacon.umd.js +9 -9
- package/dist/beacon/beacon.umd.js.map +1 -1
- package/dist/beacon/types/internal/screenshot.d.ts +19 -1
- package/dist/beacon/types/internal/screenshot.d.ts.map +1 -1
- package/dist/beacon/types/plugins/domEle.d.ts.map +1 -1
- package/dist/chart-client/assets/{index-CJ4mgRRF.css → index-CDIhdgWg.css} +1 -1
- package/dist/chart-client/index.html +2 -2
- package/dist/client/assets/{index-DI5qSR_w.css → index-CfW4n40I.css} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/council-client/assets/{index-C_-vAM9L.css → index-CZim6x1u.css} +1 -1
- package/dist/council-client/index.html +2 -2
- package/dist/deck-client/assets/{_baseUniq-DCt2IMRR.js → _baseUniq-DdHaBFYO.js} +1 -1
- package/dist/deck-client/assets/{arc-h-ifqmNR.js → arc-D98e_18X.js} +1 -1
- package/dist/deck-client/assets/{architectureDiagram-Q4EWVU46-C9dITSPv.js → architectureDiagram-Q4EWVU46-DNFZzh-4.js} +1 -1
- package/dist/deck-client/assets/{blockDiagram-DXYQGD6D-BHuJT34t.js → blockDiagram-DXYQGD6D-DeQvGUdX.js} +1 -1
- package/dist/deck-client/assets/{c4Diagram-AHTNJAMY-CpvMGtDG.js → c4Diagram-AHTNJAMY-B6ekZf1n.js} +1 -1
- package/dist/deck-client/assets/channel-DmR7Tyyt.js +1 -0
- package/dist/deck-client/assets/{chunk-4BX2VUAB-B6md1VIm.js → chunk-4BX2VUAB-9aDWymq2.js} +1 -1
- package/dist/deck-client/assets/{chunk-4TB4RGXK-BmEnX8ik.js → chunk-4TB4RGXK-DtKQqaI7.js} +1 -1
- package/dist/deck-client/assets/{chunk-55IACEB6-BZPUyZAZ.js → chunk-55IACEB6-COy9hEae.js} +1 -1
- package/dist/deck-client/assets/{chunk-EDXVE4YY-BWwNUK-l.js → chunk-EDXVE4YY-D_f861An.js} +1 -1
- package/dist/deck-client/assets/{chunk-FMBD7UC4-o7gSppGI.js → chunk-FMBD7UC4-CmuA5UKn.js} +1 -1
- package/dist/deck-client/assets/{chunk-OYMX7WX6-C4KoTL5p.js → chunk-OYMX7WX6-vT8z8D-0.js} +1 -1
- package/dist/deck-client/assets/{chunk-QZHKN3VN-jkf68sDs.js → chunk-QZHKN3VN-CTlwwg-R.js} +1 -1
- package/dist/deck-client/assets/{chunk-YZCP3GAM-Cd4yBE7o.js → chunk-YZCP3GAM-C44yr620.js} +1 -1
- package/dist/deck-client/assets/classDiagram-6PBFFD2Q-Bl4ozQWs.js +1 -0
- package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-Bl4ozQWs.js +1 -0
- package/dist/deck-client/assets/clone-BAy58j24.js +1 -0
- package/dist/deck-client/assets/{cose-bilkent-S5V4N54A-DeGFUgAV.js → cose-bilkent-S5V4N54A-DBB2J2nL.js} +1 -1
- package/dist/deck-client/assets/{dagre-KV5264BT-ekcYJuUV.js → dagre-KV5264BT-DxDTYbKl.js} +1 -1
- package/dist/deck-client/assets/{diagram-5BDNPKRD-YHPk4rV2.js → diagram-5BDNPKRD-DByWrWd1.js} +1 -1
- package/dist/deck-client/assets/{diagram-G4DWMVQ6-DM-JCd_B.js → diagram-G4DWMVQ6-B8B6ddMq.js} +1 -1
- package/dist/deck-client/assets/{diagram-MMDJMWI5-l5FK1ybk.js → diagram-MMDJMWI5-BMUZ2PWK.js} +1 -1
- package/dist/deck-client/assets/{diagram-TYMM5635-CIN4_1-j.js → diagram-TYMM5635-Bk9e8BB-.js} +1 -1
- package/dist/deck-client/assets/{erDiagram-SMLLAGMA-MyinSkEl.js → erDiagram-SMLLAGMA-DcOSwSol.js} +1 -1
- package/dist/deck-client/assets/{flowDiagram-DWJPFMVM-Dk8nn42x.js → flowDiagram-DWJPFMVM-DI-4BR0F.js} +1 -1
- package/dist/deck-client/assets/{ganttDiagram-T4ZO3ILL-BU1ihicu.js → ganttDiagram-T4ZO3ILL-BeZuXBoU.js} +1 -1
- package/dist/deck-client/assets/{gitGraphDiagram-UUTBAWPF-BjsTL13C.js → gitGraphDiagram-UUTBAWPF-Bcki__f-.js} +1 -1
- package/dist/deck-client/assets/{graph-DJmh-xi7.js → graph-CifKx6G1.js} +1 -1
- package/dist/deck-client/assets/index-6sdqbm2o.js +2 -0
- package/dist/deck-client/assets/{index-DsIZ3LqL.css → index-BlTlhxFW.css} +1 -1
- package/dist/deck-client/assets/index-CB-qlwRT.js +1195 -0
- package/dist/deck-client/assets/{infoDiagram-42DDH7IO-Dxvy_RB4.js → infoDiagram-42DDH7IO-CReN1nFN.js} +1 -1
- package/dist/deck-client/assets/{ishikawaDiagram-UXIWVN3A-DPOaNF1l.js → ishikawaDiagram-UXIWVN3A-CDF_VLN_.js} +1 -1
- package/dist/deck-client/assets/{journeyDiagram-VCZTEJTY-DMew3K5c.js → journeyDiagram-VCZTEJTY-DwgGrNVB.js} +1 -1
- package/dist/deck-client/assets/{kanban-definition-6JOO6SKY-csciJFuk.js → kanban-definition-6JOO6SKY-DB_zohh5.js} +1 -1
- package/dist/deck-client/assets/{layout-Dg4yyms2.js → layout-DFfX1O3z.js} +1 -1
- package/dist/deck-client/assets/{linear-BA3zU6gq.js → linear-CtKb4EXj.js} +1 -1
- package/dist/deck-client/assets/{min-lz-Ird-p.js → min-DCRRwUZv.js} +1 -1
- package/dist/deck-client/assets/{mindmap-definition-QFDTVHPH-CCEN8OQV.js → mindmap-definition-QFDTVHPH-D0QBOiFe.js} +1 -1
- package/dist/deck-client/assets/{pieDiagram-DEJITSTG-DM6n1HY7.js → pieDiagram-DEJITSTG-CD-EV5WB.js} +1 -1
- package/dist/deck-client/assets/{quadrantDiagram-34T5L4WZ-_ULoR66n.js → quadrantDiagram-34T5L4WZ-B-JXZ8xI.js} +1 -1
- package/dist/deck-client/assets/{requirementDiagram-MS252O5E-BuwJs7Tn.js → requirementDiagram-MS252O5E-D2_OK5Dp.js} +1 -1
- package/dist/deck-client/assets/{sankeyDiagram-XADWPNL6-BEsuzkW4.js → sankeyDiagram-XADWPNL6-BbBJqVSC.js} +1 -1
- package/dist/deck-client/assets/{sequenceDiagram-FGHM5R23-CP2H0YWf.js → sequenceDiagram-FGHM5R23-Db8A-Rkk.js} +1 -1
- package/dist/deck-client/assets/{stateDiagram-FHFEXIEX-B5Gw_NNL.js → stateDiagram-FHFEXIEX-DGJnanjS.js} +1 -1
- package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-CR7riiab.js +1 -0
- package/dist/deck-client/assets/{timeline-definition-GMOUNBTQ-DsoYydQa.js → timeline-definition-GMOUNBTQ-BRkr6T4w.js} +1 -1
- package/dist/deck-client/assets/{vennDiagram-DHZGUBPP-Dz8JT_ob.js → vennDiagram-DHZGUBPP-d0rsTqFo.js} +1 -1
- package/dist/deck-client/assets/wardley-RL74JXVD-2t7cMqdS.js +162 -0
- package/dist/deck-client/assets/{wardleyDiagram-NUSXRM2D-DN1LJMB1.js → wardleyDiagram-NUSXRM2D-DzboAsHh.js} +1 -1
- package/dist/deck-client/assets/{xychartDiagram-5P7HB3ND-nb0oSfrQ.js → xychartDiagram-5P7HB3ND-CgTP9u2V.js} +1 -1
- package/dist/deck-client/index.html +2 -2
- package/dist/server/cli.js +666 -12
- package/dist/server/council-entry.js +0 -0
- package/dist/server/deck-mcp-entry.js +141 -21
- package/dist/server/deck-serve.js +141 -21
- package/dist/server/fb-wizard.js +0 -0
- package/dist/server/graph-mcp-entry.js +666 -12
- package/dist/server/init-entry.js +15 -9
- package/package.json +23 -21
- package/scaffolds/ls-marketplace/plugins/kit/skills/analyse/SKILL.md +180 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/{blast-radius.md → blast-radius/SKILL.md} +28 -12
- package/scaffolds/ls-marketplace/plugins/kit/skills/{debug.md → debug/SKILL.md} +2 -9
- package/scaffolds/ls-marketplace/plugins/kit/skills/{diagram.md → diagram/SKILL.md} +27 -9
- package/scaffolds/ls-marketplace/plugins/kit/skills/{prototype.md → prototype/SKILL.md} +21 -1
- package/scaffolds/ls-marketplace/plugins/kit/skills/recovery/SKILL.md +95 -0
- package/scaffolds/ls-marketplace/plugins/kit/skills/{wireframe.md → wireframe/SKILL.md} +21 -1
- package/scaffolds/migrate-safety/scripts/migrate-with-backup.sh +0 -0
- package/scaffolds/recall-hook/scripts/ensure-recall.sh +0 -0
- package/dist/deck-client/assets/channel-2PZVMiXf.js +0 -1
- package/dist/deck-client/assets/classDiagram-6PBFFD2Q-Bt8xBAof.js +0 -1
- package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-Bt8xBAof.js +0 -1
- package/dist/deck-client/assets/clone-BHQryoDl.js +0 -1
- package/dist/deck-client/assets/index-KsShfCV-.js +0 -476
- package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-4T4wMDXr.js +0 -1
- package/dist/deck-client/assets/wardley-RL74JXVD-DGHQ_Ijv.js +0 -162
- package/scaffolds/ls-marketplace/plugins/kit/skills/recall.md +0 -83
- /package/dist/chart-client/assets/{index-Ccy-DpI-.js → index-B__ARB8k.js} +0 -0
- /package/dist/client/assets/{index-Dp0_okva.js → index-h8kMzVtG.js} +0 -0
- /package/dist/council-client/assets/{index-Dt4zWKSj.js → index-CWaDcsFR.js} +0 -0
- /package/scaffolds/ls-marketplace/plugins/kit/skills/{beacon-array.md → beacon-array/SKILL.md} +0 -0
- /package/scaffolds/ls-marketplace/plugins/kit/skills/{beacon-clear.md → beacon-clear/SKILL.md} +0 -0
- /package/scaffolds/ls-marketplace/plugins/kit/skills/{beacon-pulse.md → beacon-pulse/SKILL.md} +0 -0
- /package/scaffolds/ls-marketplace/plugins/kit/skills/{beacon-scan.md → beacon-scan/SKILL.md} +0 -0
- /package/scaffolds/ls-marketplace/plugins/kit/skills/{brief.md → brief/SKILL.md} +0 -0
- /package/scaffolds/ls-marketplace/plugins/kit/skills/{course.md → course/SKILL.md} +0 -0
- /package/scaffolds/ls-marketplace/plugins/kit/skills/{deploy-check.md → deploy-check/SKILL.md} +0 -0
- /package/scaffolds/ls-marketplace/plugins/kit/skills/{orbit.md → orbit/SKILL.md} +0 -0
- /package/scaffolds/ls-marketplace/plugins/kit/skills/{show-mcp-status.md → show-mcp-status/SKILL.md} +0 -0
package/dist/beacon/beacon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Me = String.raw`
|
|
2
2
|
:host {
|
|
3
3
|
--beacon-accent: #0ea5e9;
|
|
4
4
|
--beacon-bg: #ffffff;
|
|
@@ -694,10 +694,10 @@ dialog.beacon-dialog::backdrop {
|
|
|
694
694
|
max-width: 100%;
|
|
695
695
|
}
|
|
696
696
|
`, se = "launch-kit-beacon-portal-styles";
|
|
697
|
-
function
|
|
697
|
+
function Xe() {
|
|
698
698
|
if (typeof document > "u" || !document.head || document.getElementById(se)) return;
|
|
699
699
|
const e = document.createElement("style");
|
|
700
|
-
e.id = se, e.textContent =
|
|
700
|
+
e.id = se, e.textContent = Me, document.head.appendChild(e);
|
|
701
701
|
}
|
|
702
702
|
const V = "http://www.w3.org/2000/svg";
|
|
703
703
|
function Ke() {
|
|
@@ -708,9 +708,9 @@ function Ke() {
|
|
|
708
708
|
const n = document.createElementNS(V, "path");
|
|
709
709
|
return n.setAttribute("d", "M11.6 16.8a3 3 0 1 1-5.8-1.6"), e.appendChild(t), e.appendChild(n), e;
|
|
710
710
|
}
|
|
711
|
-
const
|
|
711
|
+
const z = "launch-kit-beacon", Ge = typeof HTMLElement < "u" ? HTMLElement : class {
|
|
712
712
|
};
|
|
713
|
-
class
|
|
713
|
+
class Je extends Ge {
|
|
714
714
|
constructor() {
|
|
715
715
|
super(...arguments), this.onTriggerClick = null;
|
|
716
716
|
}
|
|
@@ -718,7 +718,7 @@ class Ge extends Xe {
|
|
|
718
718
|
if (this.shadow) return;
|
|
719
719
|
this.shadow = this.attachShadow({ mode: "open" });
|
|
720
720
|
const t = document.createElement("style");
|
|
721
|
-
t.textContent =
|
|
721
|
+
t.textContent = Me, this.shadow.appendChild(t), this.triggerSlot = document.createElement("slot"), this.triggerSlot.name = "trigger", this.shadow.appendChild(this.triggerSlot), this.defaultTrigger = document.createElement("button"), this.defaultTrigger.type = "button", this.defaultTrigger.className = "beacon-default-trigger", this.defaultTrigger.appendChild(Ke());
|
|
722
722
|
const n = document.createElement("span");
|
|
723
723
|
n.textContent = "Feedback", this.defaultTrigger.appendChild(n), this.healthDot = document.createElement("span"), this.healthDot.className = "beacon-health-dot", this.defaultTrigger.appendChild(this.healthDot), this.shadow.appendChild(this.defaultTrigger), this.defaultTrigger.addEventListener("click", () => {
|
|
724
724
|
var o;
|
|
@@ -727,10 +727,10 @@ class Ge extends Xe {
|
|
|
727
727
|
const o = this.triggerSlot.assignedElements();
|
|
728
728
|
if (o.length > 0) {
|
|
729
729
|
this.defaultTrigger.style.display = "none";
|
|
730
|
-
for (const
|
|
731
|
-
|
|
732
|
-
var
|
|
733
|
-
return (
|
|
730
|
+
for (const a of o)
|
|
731
|
+
a.addEventListener("click", () => {
|
|
732
|
+
var r;
|
|
733
|
+
return (r = this.onTriggerClick) == null ? void 0 : r.call(this);
|
|
734
734
|
});
|
|
735
735
|
} else
|
|
736
736
|
this.defaultTrigger.style.display = "";
|
|
@@ -746,10 +746,10 @@ class Ge extends Xe {
|
|
|
746
746
|
(n = this.healthDot) == null || n.classList.toggle("visible", t);
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
|
-
function
|
|
750
|
-
typeof window > "u" || typeof customElements > "u" || customElements.get(
|
|
749
|
+
function Ie() {
|
|
750
|
+
typeof window > "u" || typeof customElements > "u" || customElements.get(z) || customElements.define(z, Je);
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function Ze(e, t) {
|
|
753
753
|
return {
|
|
754
754
|
pluginName: e,
|
|
755
755
|
captured: (n) => t.getCaptured(n),
|
|
@@ -765,15 +765,15 @@ function Je(e, t) {
|
|
|
765
765
|
captureSignal: () => t.getCaptureSignal()
|
|
766
766
|
};
|
|
767
767
|
}
|
|
768
|
-
class
|
|
768
|
+
class Qe extends Error {
|
|
769
769
|
constructor(t) {
|
|
770
770
|
super(`Duplicate plugin name: "${t}"`), this.name = "DuplicatePluginNameError";
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function et(e) {
|
|
774
774
|
const t = /* @__PURE__ */ new Set();
|
|
775
775
|
for (const o of e) {
|
|
776
|
-
if (t.has(o.name)) throw new
|
|
776
|
+
if (t.has(o.name)) throw new Qe(o.name);
|
|
777
777
|
t.add(o.name);
|
|
778
778
|
}
|
|
779
779
|
const n = e.map((o) => ({
|
|
@@ -784,154 +784,154 @@ function Qe(e) {
|
|
|
784
784
|
}));
|
|
785
785
|
return {
|
|
786
786
|
entries: n,
|
|
787
|
-
install(o,
|
|
788
|
-
for (const
|
|
789
|
-
if (
|
|
787
|
+
install(o, a) {
|
|
788
|
+
for (const r of n)
|
|
789
|
+
if (r.ctx = o(r.plugin.name), !!r.plugin.setupOnce)
|
|
790
790
|
try {
|
|
791
|
-
const i =
|
|
792
|
-
typeof i == "function" && (
|
|
791
|
+
const i = r.plugin.setupOnce(r.ctx);
|
|
792
|
+
typeof i == "function" && (r.teardown = i);
|
|
793
793
|
} catch (i) {
|
|
794
794
|
const s = i instanceof Error ? i : new Error(String(i));
|
|
795
|
-
|
|
795
|
+
r.status = {
|
|
796
796
|
state: "failed",
|
|
797
|
-
failures:
|
|
797
|
+
failures: r.status.failures + 1,
|
|
798
798
|
error: { message: s.message, ...s.stack ? { stack: s.stack } : {}, at: "setupOnce" }
|
|
799
|
-
},
|
|
799
|
+
}, a({ plugin: r.plugin.name, error: s, at: "setupOnce" });
|
|
800
800
|
}
|
|
801
801
|
},
|
|
802
802
|
destroy() {
|
|
803
803
|
var o;
|
|
804
|
-
for (const
|
|
804
|
+
for (const a of n) {
|
|
805
805
|
try {
|
|
806
|
-
(o =
|
|
806
|
+
(o = a.teardown) == null || o.call(a);
|
|
807
807
|
} catch {
|
|
808
808
|
}
|
|
809
|
-
|
|
809
|
+
a.teardown = void 0;
|
|
810
810
|
}
|
|
811
811
|
},
|
|
812
|
-
async capture(o,
|
|
813
|
-
const
|
|
812
|
+
async capture(o, a) {
|
|
813
|
+
const r = {};
|
|
814
814
|
for (const i of n)
|
|
815
815
|
if (i.plugin.capture)
|
|
816
816
|
try {
|
|
817
|
-
const s = await i.plugin.capture(i.ctx), c =
|
|
818
|
-
c !== null && (
|
|
817
|
+
const s = await i.plugin.capture(i.ctx), c = tt(s, i.plugin.version);
|
|
818
|
+
c !== null && (r[i.plugin.name] = c);
|
|
819
819
|
} catch (s) {
|
|
820
820
|
const c = s instanceof Error ? s : new Error(String(s));
|
|
821
|
-
|
|
821
|
+
r[i.plugin.name] = nt(c), i.status = {
|
|
822
822
|
state: "failed",
|
|
823
823
|
failures: i.status.failures + 1,
|
|
824
824
|
error: { message: c.message, ...c.stack ? { stack: c.stack } : {}, at: "capture" }
|
|
825
|
-
},
|
|
825
|
+
}, a({ plugin: i.plugin.name, error: c, at: "capture" });
|
|
826
826
|
}
|
|
827
|
-
return
|
|
827
|
+
return r;
|
|
828
828
|
},
|
|
829
829
|
status() {
|
|
830
830
|
const o = {};
|
|
831
|
-
for (const
|
|
832
|
-
o[
|
|
831
|
+
for (const a of n)
|
|
832
|
+
o[a.plugin.name] = a.status;
|
|
833
833
|
return o;
|
|
834
834
|
}
|
|
835
835
|
};
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function tt(e, t) {
|
|
838
838
|
if (e == null) return null;
|
|
839
839
|
const n = t ?? 1;
|
|
840
840
|
return Array.isArray(e) || typeof e != "object" ? { v: n, value: e } : { ...e, v: n };
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function nt(e) {
|
|
843
843
|
return {
|
|
844
844
|
error: e.message,
|
|
845
845
|
...e.stack ? { stack: e.stack } : {}
|
|
846
846
|
};
|
|
847
847
|
}
|
|
848
|
-
async function
|
|
849
|
-
const
|
|
848
|
+
async function ot(e, t, n, o, a = "omit") {
|
|
849
|
+
const r = await rt(n), i = await fetch(e, {
|
|
850
850
|
method: "POST",
|
|
851
|
-
credentials:
|
|
852
|
-
headers: { "Content-Type": "application/json", ...
|
|
851
|
+
credentials: a,
|
|
852
|
+
headers: { "Content-Type": "application/json", ...r },
|
|
853
853
|
body: JSON.stringify(t),
|
|
854
854
|
signal: o
|
|
855
855
|
}), c = (i.headers.get("content-type") ?? "").includes("application/json") ? await i.json().catch(() => null) : await i.text();
|
|
856
856
|
return { ok: i.ok, status: i.status, body: c };
|
|
857
857
|
}
|
|
858
|
-
async function
|
|
858
|
+
async function rt(e) {
|
|
859
859
|
return e ? typeof e == "function" ? await e() ?? {} : e : {};
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function at(e, t, n) {
|
|
862
862
|
for (const o of t) {
|
|
863
|
-
const
|
|
864
|
-
if (
|
|
863
|
+
const a = document.createElement("div");
|
|
864
|
+
if (a.className = "beacon-field", o.label) {
|
|
865
865
|
const i = document.createElement("label");
|
|
866
|
-
i.className = "beacon-label", i.textContent = o.label,
|
|
866
|
+
i.className = "beacon-label", i.textContent = o.label, a.appendChild(i);
|
|
867
867
|
}
|
|
868
868
|
if (o.description) {
|
|
869
869
|
const i = document.createElement("div");
|
|
870
|
-
i.className = "beacon-description", i.textContent = o.description,
|
|
870
|
+
i.className = "beacon-description", i.textContent = o.description, a.appendChild(i);
|
|
871
871
|
}
|
|
872
|
-
const
|
|
873
|
-
|
|
872
|
+
const r = it(o, n);
|
|
873
|
+
a.appendChild(r), e.appendChild(a);
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
|
-
function
|
|
877
|
-
var o,
|
|
876
|
+
function it(e, t) {
|
|
877
|
+
var o, a;
|
|
878
878
|
const n = t.get(e.name);
|
|
879
879
|
switch (e.type) {
|
|
880
880
|
case "toggle": {
|
|
881
|
-
const
|
|
882
|
-
|
|
881
|
+
const r = document.createElement("label");
|
|
882
|
+
r.className = "beacon-toggle";
|
|
883
883
|
const i = document.createElement("input");
|
|
884
|
-
return i.type = "checkbox", i.checked = n ?? e.defaultValue ?? !1, i.addEventListener("change", () => t.set(e.name, i.checked)),
|
|
884
|
+
return i.type = "checkbox", i.checked = n ?? e.defaultValue ?? !1, i.addEventListener("change", () => t.set(e.name, i.checked)), r.appendChild(i), t.set(e.name, i.checked), r;
|
|
885
885
|
}
|
|
886
886
|
case "text": {
|
|
887
|
-
const
|
|
888
|
-
|
|
887
|
+
const r = document.createElement("input");
|
|
888
|
+
r.type = "text", r.className = "beacon-input";
|
|
889
889
|
const i = n ?? e.defaultValue ?? "";
|
|
890
|
-
return
|
|
890
|
+
return r.value = i, e.placeholder && (r.placeholder = e.placeholder), r.addEventListener("input", () => t.set(e.name, r.value)), t.set(e.name, i), r;
|
|
891
891
|
}
|
|
892
892
|
case "textarea": {
|
|
893
|
-
const
|
|
894
|
-
|
|
893
|
+
const r = document.createElement("textarea");
|
|
894
|
+
r.className = "beacon-textarea";
|
|
895
895
|
const i = n ?? e.defaultValue ?? "";
|
|
896
|
-
return
|
|
896
|
+
return r.value = i, e.placeholder && (r.placeholder = e.placeholder), e.rows && (r.rows = e.rows), r.addEventListener("input", () => t.set(e.name, r.value)), t.set(e.name, i), r;
|
|
897
897
|
}
|
|
898
898
|
case "select": {
|
|
899
|
-
const
|
|
900
|
-
|
|
899
|
+
const r = document.createElement("select");
|
|
900
|
+
r.className = "beacon-select";
|
|
901
901
|
const i = n ?? e.defaultValue ?? ((o = e.options[0]) == null ? void 0 : o.value) ?? "";
|
|
902
902
|
for (const s of e.options) {
|
|
903
903
|
const c = document.createElement("option");
|
|
904
|
-
c.value = s.value, c.textContent = s.label ?? s.value, s.value === i && (c.selected = !0),
|
|
904
|
+
c.value = s.value, c.textContent = s.label ?? s.value, s.value === i && (c.selected = !0), r.appendChild(c);
|
|
905
905
|
}
|
|
906
|
-
return
|
|
906
|
+
return r.addEventListener("change", () => t.set(e.name, r.value)), t.set(e.name, i), r;
|
|
907
907
|
}
|
|
908
908
|
case "radio": {
|
|
909
|
-
const
|
|
910
|
-
|
|
911
|
-
const i = n ?? e.defaultValue ?? ((
|
|
909
|
+
const r = document.createElement("div");
|
|
910
|
+
r.className = "beacon-radio-group";
|
|
911
|
+
const i = n ?? e.defaultValue ?? ((a = e.options[0]) == null ? void 0 : a.value) ?? "";
|
|
912
912
|
for (const s of e.options) {
|
|
913
913
|
const c = document.createElement("label");
|
|
914
914
|
c.className = "beacon-radio-opt";
|
|
915
915
|
const d = document.createElement("input");
|
|
916
916
|
d.type = "radio", d.name = e.name, d.value = s.value, s.value === i && (d.checked = !0), d.addEventListener("change", () => t.set(e.name, s.value));
|
|
917
917
|
const l = document.createElement("span");
|
|
918
|
-
l.textContent = s.label ?? s.value, c.appendChild(d), c.appendChild(l),
|
|
918
|
+
l.textContent = s.label ?? s.value, c.appendChild(d), c.appendChild(l), r.appendChild(c);
|
|
919
919
|
}
|
|
920
|
-
return t.set(e.name, i),
|
|
920
|
+
return t.set(e.name, i), r;
|
|
921
921
|
}
|
|
922
922
|
case "number": {
|
|
923
|
-
const
|
|
924
|
-
|
|
923
|
+
const r = document.createElement("input");
|
|
924
|
+
r.type = "number", r.className = "beacon-input";
|
|
925
925
|
const i = n ?? e.defaultValue;
|
|
926
|
-
return i !== void 0 && (
|
|
927
|
-
const s =
|
|
926
|
+
return i !== void 0 && (r.value = String(i)), e.min !== void 0 && (r.min = String(e.min)), e.max !== void 0 && (r.max = String(e.max)), e.step !== void 0 && (r.step = String(e.step)), r.addEventListener("input", () => {
|
|
927
|
+
const s = r.value === "" ? void 0 : Number(r.value);
|
|
928
928
|
t.set(e.name, s);
|
|
929
|
-
}), i !== void 0 && t.set(e.name, i),
|
|
929
|
+
}), i !== void 0 && t.set(e.name, i), r;
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
932
|
}
|
|
933
933
|
const W = "http://www.w3.org/2000/svg";
|
|
934
|
-
function
|
|
934
|
+
function st() {
|
|
935
935
|
const e = document.createElementNS(W, "svg");
|
|
936
936
|
e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("fill", "none"), e.setAttribute("stroke", "currentColor"), e.setAttribute("stroke-width", "2"), e.setAttribute("stroke-linecap", "round"), e.setAttribute("stroke-linejoin", "round");
|
|
937
937
|
const t = document.createElementNS(W, "line");
|
|
@@ -939,16 +939,16 @@ function it() {
|
|
|
939
939
|
const n = document.createElementNS(W, "line");
|
|
940
940
|
return n.setAttribute("x1", "6"), n.setAttribute("y1", "6"), n.setAttribute("x2", "18"), n.setAttribute("y2", "18"), e.appendChild(t), e.appendChild(n), e;
|
|
941
941
|
}
|
|
942
|
-
class
|
|
942
|
+
class ct {
|
|
943
943
|
constructor(t, n, o) {
|
|
944
944
|
this.labels = t, this.severities = n, this.callbacks = o, this.severitySelected = "bug", this.modeCounts = { minimize: 0, hide: 0, pickElement: 0 }, this.pluginCleanups = [], this.lastActive = null, this.submitSucceeded = !1, this.expectedSuppressedCloses = 0, this.root = document.createElement("dialog"), this.root.className = "beacon-dialog", this.inner = document.createElement("div"), this.inner.className = "beacon-dialog-inner", this.root.appendChild(this.inner);
|
|
945
|
-
const r = document.createElement("div");
|
|
946
|
-
r.className = "beacon-drawer-header";
|
|
947
945
|
const a = document.createElement("div");
|
|
948
|
-
a.className = "beacon-drawer-
|
|
946
|
+
a.className = "beacon-drawer-header";
|
|
947
|
+
const r = document.createElement("div");
|
|
948
|
+
r.className = "beacon-drawer-title", r.textContent = t.drawerTitle, a.appendChild(r);
|
|
949
949
|
const i = document.createElement("button");
|
|
950
|
-
i.type = "button", i.className = "beacon-icon-btn", i.setAttribute("aria-label", t.closeButton), i.appendChild(
|
|
951
|
-
this.submitSucceeded || this.hasUnsavedInput() && (
|
|
950
|
+
i.type = "button", i.className = "beacon-icon-btn", i.setAttribute("aria-label", t.closeButton), i.appendChild(st()), i.addEventListener("click", () => this.userCloseAttempt()), a.appendChild(i), this.inner.appendChild(a), this.root.addEventListener("cancel", (g) => {
|
|
951
|
+
this.submitSucceeded || this.hasUnsavedInput() && (g.preventDefault(), window.confirm("You have unsaved feedback. Discard?") && this.root.close());
|
|
952
952
|
});
|
|
953
953
|
const s = document.createElement("div");
|
|
954
954
|
s.className = "beacon-drawer-body", this.inner.appendChild(s);
|
|
@@ -958,17 +958,17 @@ class st {
|
|
|
958
958
|
d.className = "beacon-label", d.textContent = t.descriptionLabel, this.descTextarea = document.createElement("textarea"), this.descTextarea.className = "beacon-textarea", this.descTextarea.placeholder = t.descriptionPlaceholder, this.descTextarea.rows = 4, c.appendChild(d), c.appendChild(this.descTextarea), s.appendChild(c);
|
|
959
959
|
const l = document.createElement("div");
|
|
960
960
|
l.className = "beacon-field";
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
for (const
|
|
964
|
-
const
|
|
965
|
-
|
|
966
|
-
const
|
|
967
|
-
|
|
968
|
-
}
|
|
969
|
-
l.appendChild(
|
|
970
|
-
const
|
|
971
|
-
|
|
961
|
+
const m = document.createElement("label");
|
|
962
|
+
m.className = "beacon-label", m.textContent = t.severityLabel, this.severitiesContainer = document.createElement("div"), this.severitiesContainer.className = "beacon-severity";
|
|
963
|
+
for (const g of n) {
|
|
964
|
+
const u = document.createElement("label");
|
|
965
|
+
u.className = "beacon-severity-opt", u.dataset.sev = g;
|
|
966
|
+
const v = document.createElement("input");
|
|
967
|
+
v.type = "radio", v.name = "beacon-severity", v.value = g, g === this.severitySelected && (v.checked = !0, u.classList.add("selected")), v.addEventListener("change", () => this.setSeverity(g)), u.appendChild(v), u.appendChild(document.createTextNode(this.severityLabel(g))), this.severitiesContainer.appendChild(u);
|
|
968
|
+
}
|
|
969
|
+
l.appendChild(m), l.appendChild(this.severitiesContainer), s.appendChild(l), this.pluginSlot = document.createElement("div"), this.pluginSlot.className = "beacon-plugin-panels", s.appendChild(this.pluginSlot), this.statusEl = document.createElement("div"), this.statusEl.className = "beacon-status", s.appendChild(this.statusEl);
|
|
970
|
+
const p = document.createElement("div");
|
|
971
|
+
p.className = "beacon-actions", this.submitBtn = document.createElement("button"), this.submitBtn.type = "button", this.submitBtn.className = "beacon-btn primary", this.submitBtn.textContent = t.send, this.submitBtn.addEventListener("click", () => this.callbacks.onSubmit()), p.appendChild(this.submitBtn), s.appendChild(p), this.root.addEventListener("close", () => {
|
|
972
972
|
if (this.expectedSuppressedCloses > 0) {
|
|
973
973
|
this.expectedSuppressedCloses -= 1;
|
|
974
974
|
return;
|
|
@@ -985,10 +985,10 @@ class st {
|
|
|
985
985
|
};
|
|
986
986
|
}
|
|
987
987
|
applyMode(t, n) {
|
|
988
|
-
var o,
|
|
988
|
+
var o, a;
|
|
989
989
|
switch (t) {
|
|
990
990
|
case "pickElement": {
|
|
991
|
-
n ? (this.lastActive = document.activeElement instanceof HTMLElement ? document.activeElement : null, this.root.open && (this.expectedSuppressedCloses += 1, this.root.close())) : (this.root.open || this.tryShowModal(), (
|
|
991
|
+
n ? (this.lastActive = document.activeElement instanceof HTMLElement ? document.activeElement : null, this.root.open && (this.expectedSuppressedCloses += 1, this.root.close())) : (this.root.open || this.tryShowModal(), (a = (o = this.lastActive) == null ? void 0 : o.focus) == null || a.call(o));
|
|
992
992
|
break;
|
|
993
993
|
}
|
|
994
994
|
case "hide": {
|
|
@@ -996,8 +996,8 @@ class st {
|
|
|
996
996
|
break;
|
|
997
997
|
}
|
|
998
998
|
case "minimize": {
|
|
999
|
-
const
|
|
1000
|
-
|
|
999
|
+
const r = this.inner.querySelector(".beacon-drawer-body");
|
|
1000
|
+
r && (r.style.display = n ? "none" : "");
|
|
1001
1001
|
break;
|
|
1002
1002
|
}
|
|
1003
1003
|
}
|
|
@@ -1049,21 +1049,21 @@ class st {
|
|
|
1049
1049
|
installPluginPanels(t, n) {
|
|
1050
1050
|
this.clearPluginPanels();
|
|
1051
1051
|
for (const o of t) {
|
|
1052
|
-
const
|
|
1053
|
-
if (
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1052
|
+
const a = document.createElement("div");
|
|
1053
|
+
if (a.className = "beacon-plugin-panel", o.form.title) {
|
|
1054
|
+
const r = document.createElement("div");
|
|
1055
|
+
r.className = "beacon-plugin-panel-title", r.textContent = o.form.title, a.appendChild(r);
|
|
1056
1056
|
}
|
|
1057
1057
|
if ("fields" in o.form)
|
|
1058
|
-
|
|
1059
|
-
get: (
|
|
1060
|
-
set: (
|
|
1058
|
+
at(a, o.form.fields, {
|
|
1059
|
+
get: (r) => n.get(o.name, r),
|
|
1060
|
+
set: (r, i) => n.set(o.name, r, i)
|
|
1061
1061
|
});
|
|
1062
1062
|
else {
|
|
1063
|
-
const
|
|
1064
|
-
typeof
|
|
1063
|
+
const r = o.form.render(a, o.ctx);
|
|
1064
|
+
typeof r == "function" && this.pluginCleanups.push(r);
|
|
1065
1065
|
}
|
|
1066
|
-
this.pluginSlot.appendChild(
|
|
1066
|
+
this.pluginSlot.appendChild(a);
|
|
1067
1067
|
}
|
|
1068
1068
|
}
|
|
1069
1069
|
clearPluginPanels() {
|
|
@@ -1094,7 +1094,7 @@ class st {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1097
|
+
function lt() {
|
|
1098
1098
|
return {
|
|
1099
1099
|
triggerButton: "Feedback",
|
|
1100
1100
|
drawerTitle: "Send feedback",
|
|
@@ -1111,18 +1111,18 @@ function ct() {
|
|
|
1111
1111
|
severityA11y: "a11y"
|
|
1112
1112
|
};
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1114
|
+
function dt(e) {
|
|
1115
1115
|
const t = document.createElement("div");
|
|
1116
1116
|
return t.className = "beacon-overlay-layer", e.appendChild(t), { layer: t };
|
|
1117
1117
|
}
|
|
1118
|
-
function
|
|
1118
|
+
function ut(e, t) {
|
|
1119
1119
|
const n = document.createElement("div");
|
|
1120
1120
|
e.layer.appendChild(n);
|
|
1121
1121
|
let o;
|
|
1122
1122
|
try {
|
|
1123
1123
|
o = t(n);
|
|
1124
|
-
} catch (
|
|
1125
|
-
throw n.remove(),
|
|
1124
|
+
} catch (a) {
|
|
1125
|
+
throw n.remove(), a;
|
|
1126
1126
|
}
|
|
1127
1127
|
return () => {
|
|
1128
1128
|
try {
|
|
@@ -1132,55 +1132,55 @@ function dt(e, t) {
|
|
|
1132
1132
|
n.parentNode && n.parentNode.removeChild(n);
|
|
1133
1133
|
};
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1135
|
+
function pt() {
|
|
1136
1136
|
var n, o;
|
|
1137
1137
|
const e = navigator;
|
|
1138
1138
|
return e.userAgentData ? {
|
|
1139
|
-
brand: ((n = e.userAgentData.brands.find((
|
|
1139
|
+
brand: ((n = e.userAgentData.brands.find((a) => !/Not[.\-]?A.?Brand/i.test(a.brand))) == null ? void 0 : n.brand) ?? ((o = e.userAgentData.brands[0]) == null ? void 0 : o.brand) ?? "unknown",
|
|
1140
1140
|
mobile: e.userAgentData.mobile,
|
|
1141
1141
|
platform: e.userAgentData.platform
|
|
1142
1142
|
} : void 0;
|
|
1143
1143
|
}
|
|
1144
|
-
function
|
|
1144
|
+
function ft() {
|
|
1145
1145
|
return {
|
|
1146
1146
|
name: "metadata",
|
|
1147
1147
|
capture() {
|
|
1148
|
-
const e =
|
|
1148
|
+
const e = pt();
|
|
1149
1149
|
return e ? { uaData: e } : null;
|
|
1150
1150
|
}
|
|
1151
1151
|
};
|
|
1152
1152
|
}
|
|
1153
|
-
const
|
|
1154
|
-
function
|
|
1153
|
+
const mt = 30, X = 500, ce = 2e3, ht = 500, bt = 5e3, gt = /launch-kit-beacon|beacon\.(?:es|umd|mjs)|\/beacon\//i;
|
|
1154
|
+
function _(e, t) {
|
|
1155
1155
|
if (e)
|
|
1156
1156
|
return e.length > t ? e.slice(0, t) : e;
|
|
1157
1157
|
}
|
|
1158
|
-
function
|
|
1158
|
+
function yt(e, t) {
|
|
1159
1159
|
const n = (t == null ? void 0 : t.split(`
|
|
1160
1160
|
`).slice(0, 3).join("|")) ?? "";
|
|
1161
1161
|
return `${e}::${n}`;
|
|
1162
1162
|
}
|
|
1163
|
-
function yt(e) {
|
|
1164
|
-
return !!e && bt.test(e);
|
|
1165
|
-
}
|
|
1166
1163
|
function vt(e) {
|
|
1164
|
+
return !!e && gt.test(e);
|
|
1165
|
+
}
|
|
1166
|
+
function xt(e) {
|
|
1167
1167
|
try {
|
|
1168
|
-
return JSON.stringify(e).slice(0,
|
|
1168
|
+
return JSON.stringify(e).slice(0, X);
|
|
1169
1169
|
} catch {
|
|
1170
1170
|
return String(e);
|
|
1171
1171
|
}
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1173
|
+
function Re() {
|
|
1174
1174
|
const e = [], t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set();
|
|
1175
|
-
let o = !1,
|
|
1175
|
+
let o = !1, a, r;
|
|
1176
1176
|
function i(s) {
|
|
1177
|
-
if (
|
|
1178
|
-
const c =
|
|
1179
|
-
if (d !== void 0 && s.ts - d <
|
|
1177
|
+
if (vt(s.stack) || s.kind === "unhandledrejection" && /AbortError/i.test(s.message)) return;
|
|
1178
|
+
const c = yt(s.message, s.stack), d = t.get(c);
|
|
1179
|
+
if (d !== void 0 && s.ts - d < bt) {
|
|
1180
1180
|
t.set(c, s.ts);
|
|
1181
1181
|
return;
|
|
1182
1182
|
}
|
|
1183
|
-
t.set(c, s.ts), e.push(s), e.length >
|
|
1183
|
+
t.set(c, s.ts), e.push(s), e.length > mt && e.shift();
|
|
1184
1184
|
for (const l of n)
|
|
1185
1185
|
try {
|
|
1186
1186
|
l();
|
|
@@ -1191,33 +1191,33 @@ function Ie() {
|
|
|
1191
1191
|
install() {
|
|
1192
1192
|
return o ? () => {
|
|
1193
1193
|
} : typeof window > "u" ? () => {
|
|
1194
|
-
} : (o = !0,
|
|
1194
|
+
} : (o = !0, a = (s) => {
|
|
1195
1195
|
try {
|
|
1196
1196
|
const c = s.error instanceof Error ? s.error.message : void 0, d = s.error instanceof Error ? s.error.stack : void 0;
|
|
1197
1197
|
i({
|
|
1198
1198
|
ts: Date.now(),
|
|
1199
1199
|
kind: "error",
|
|
1200
|
-
message:
|
|
1201
|
-
...d ? { stack:
|
|
1202
|
-
...s.filename ? { source:
|
|
1200
|
+
message: _(s.message || c || "Unknown error", X) ?? "Unknown error",
|
|
1201
|
+
...d ? { stack: _(d, ce) } : {},
|
|
1202
|
+
...s.filename ? { source: _(s.filename, ht) } : {},
|
|
1203
1203
|
...Number.isFinite(s.lineno) ? { line: s.lineno } : {},
|
|
1204
1204
|
...Number.isFinite(s.colno) ? { col: s.colno } : {}
|
|
1205
1205
|
});
|
|
1206
1206
|
} catch {
|
|
1207
1207
|
}
|
|
1208
|
-
},
|
|
1208
|
+
}, r = (s) => {
|
|
1209
1209
|
try {
|
|
1210
|
-
const c = s.reason, d = c instanceof Error ? c.message : typeof c == "string" ? c :
|
|
1210
|
+
const c = s.reason, d = c instanceof Error ? c.message : typeof c == "string" ? c : xt(c), l = c instanceof Error ? c.stack : void 0;
|
|
1211
1211
|
i({
|
|
1212
1212
|
ts: Date.now(),
|
|
1213
1213
|
kind: "unhandledrejection",
|
|
1214
|
-
message:
|
|
1215
|
-
...l ? { stack:
|
|
1214
|
+
message: _(d || "Unknown rejection", X) ?? "Unknown rejection",
|
|
1215
|
+
...l ? { stack: _(l, ce) } : {}
|
|
1216
1216
|
});
|
|
1217
1217
|
} catch {
|
|
1218
1218
|
}
|
|
1219
|
-
}, window.addEventListener("error",
|
|
1220
|
-
|
|
1219
|
+
}, window.addEventListener("error", a), window.addEventListener("unhandledrejection", r), () => {
|
|
1220
|
+
a && window.removeEventListener("error", a), r && window.removeEventListener("unhandledrejection", r), o = !1, n.clear();
|
|
1221
1221
|
});
|
|
1222
1222
|
},
|
|
1223
1223
|
snapshot() {
|
|
@@ -1230,12 +1230,12 @@ function Ie() {
|
|
|
1230
1230
|
}
|
|
1231
1231
|
};
|
|
1232
1232
|
}
|
|
1233
|
-
function
|
|
1233
|
+
function wt() {
|
|
1234
1234
|
let e = null;
|
|
1235
1235
|
return {
|
|
1236
1236
|
name: "errors",
|
|
1237
1237
|
setupOnce(t) {
|
|
1238
|
-
e =
|
|
1238
|
+
e = Re();
|
|
1239
1239
|
const n = e.install();
|
|
1240
1240
|
return t.signal.addEventListener("abort", n, { once: !0 }), n;
|
|
1241
1241
|
},
|
|
@@ -1246,10 +1246,10 @@ function xt() {
|
|
|
1246
1246
|
n.className = "beacon-events";
|
|
1247
1247
|
const o = document.createElement("summary");
|
|
1248
1248
|
o.className = "beacon-events-summary";
|
|
1249
|
-
const r = document.createElement("span");
|
|
1250
|
-
r.className = "beacon-events-dot", r.textContent = "●";
|
|
1251
1249
|
const a = document.createElement("span");
|
|
1252
|
-
a.className = "beacon-events-
|
|
1250
|
+
a.className = "beacon-events-dot", a.textContent = "●";
|
|
1251
|
+
const r = document.createElement("span");
|
|
1252
|
+
r.className = "beacon-events-label", o.appendChild(a), o.appendChild(r), n.appendChild(o);
|
|
1253
1253
|
const i = document.createElement("ul");
|
|
1254
1254
|
i.className = "beacon-events-list", n.appendChild(i), t.appendChild(n);
|
|
1255
1255
|
function s() {
|
|
@@ -1258,14 +1258,14 @@ function xt() {
|
|
|
1258
1258
|
t.style.display = "none";
|
|
1259
1259
|
return;
|
|
1260
1260
|
}
|
|
1261
|
-
t.style.display = "",
|
|
1262
|
-
for (const
|
|
1263
|
-
const
|
|
1264
|
-
|
|
1265
|
-
const
|
|
1266
|
-
|
|
1267
|
-
const
|
|
1268
|
-
|
|
1261
|
+
t.style.display = "", r.textContent = `${l} runtime error${l !== 1 ? "s" : ""} captured`, i.innerHTML = "";
|
|
1262
|
+
for (const m of d) {
|
|
1263
|
+
const p = document.createElement("li");
|
|
1264
|
+
p.className = "beacon-events-item";
|
|
1265
|
+
const g = document.createElement("span");
|
|
1266
|
+
g.className = `beacon-events-kind ${m.kind === "unhandledrejection" ? "rejection" : "error"}`, g.textContent = m.kind === "unhandledrejection" ? "REJ" : "ERR";
|
|
1267
|
+
const u = document.createElement("span");
|
|
1268
|
+
u.className = "beacon-events-msg", u.textContent = m.message, p.appendChild(g), p.appendChild(u), i.appendChild(p);
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|
|
1271
1271
|
s();
|
|
@@ -1282,7 +1282,7 @@ function xt() {
|
|
|
1282
1282
|
}
|
|
1283
1283
|
};
|
|
1284
1284
|
}
|
|
1285
|
-
const
|
|
1285
|
+
const Et = 8;
|
|
1286
1286
|
function le(e, t = document) {
|
|
1287
1287
|
if (!e) return !1;
|
|
1288
1288
|
try {
|
|
@@ -1291,70 +1291,70 @@ function le(e, t = document) {
|
|
|
1291
1291
|
return !1;
|
|
1292
1292
|
}
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function St(e) {
|
|
1295
1295
|
const t = e.tagName.toLowerCase(), n = Array.from(e.classList).filter((o) => o.length > 0 && o.length < 40).slice(0, 3).map((o) => `.${CSS.escape(o)}`).join("");
|
|
1296
1296
|
return t + n;
|
|
1297
1297
|
}
|
|
1298
|
-
function
|
|
1298
|
+
function Ct(e) {
|
|
1299
1299
|
const t = e.parentElement;
|
|
1300
1300
|
return t ? Array.from(t.children).filter((o) => o.tagName === e.tagName).indexOf(e) + 1 : 1;
|
|
1301
1301
|
}
|
|
1302
|
-
function
|
|
1302
|
+
function kt(e) {
|
|
1303
1303
|
if (!e || e.nodeType !== Node.ELEMENT_NODE) return "";
|
|
1304
1304
|
if (e.id && le(e.id))
|
|
1305
1305
|
return `#${CSS.escape(e.id)}`;
|
|
1306
1306
|
const t = [];
|
|
1307
1307
|
let n = e, o = 0;
|
|
1308
|
-
for (; n && n.tagName.toLowerCase() !== "body" && o <
|
|
1309
|
-
const
|
|
1310
|
-
if (
|
|
1311
|
-
t.unshift(`#${CSS.escape(
|
|
1308
|
+
for (; n && n.tagName.toLowerCase() !== "body" && o < Et; ) {
|
|
1309
|
+
const a = n;
|
|
1310
|
+
if (a.id && le(a.id)) {
|
|
1311
|
+
t.unshift(`#${CSS.escape(a.id)}`);
|
|
1312
1312
|
break;
|
|
1313
1313
|
}
|
|
1314
|
-
const
|
|
1315
|
-
let s =
|
|
1314
|
+
const r = St(a), i = a.parentElement;
|
|
1315
|
+
let s = r;
|
|
1316
1316
|
if (i)
|
|
1317
1317
|
try {
|
|
1318
|
-
const c = Array.from(
|
|
1318
|
+
const c = Array.from(a.classList).join(" ");
|
|
1319
1319
|
Array.from(i.children).filter(
|
|
1320
|
-
(l) => l.tagName ===
|
|
1321
|
-
).length > 1 && (s = `${
|
|
1320
|
+
(l) => l.tagName === a.tagName && Array.from(l.classList).join(" ") === c
|
|
1321
|
+
).length > 1 && (s = `${a.tagName.toLowerCase()}:nth-of-type(${Ct(a)})`);
|
|
1322
1322
|
} catch {
|
|
1323
1323
|
}
|
|
1324
1324
|
t.unshift(s), n = i, o++;
|
|
1325
1325
|
}
|
|
1326
1326
|
return t.join(" > ");
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1328
|
+
function At(e) {
|
|
1329
1329
|
const t = Object.keys(e).filter(
|
|
1330
1330
|
(o) => o.startsWith("__reactFiber$") || o.startsWith("__reactInternalInstance$")
|
|
1331
1331
|
);
|
|
1332
1332
|
if (t.length === 0) return null;
|
|
1333
1333
|
let n = e[t[0]];
|
|
1334
1334
|
for (let o = 0; o < 10 && n; o++) {
|
|
1335
|
-
const
|
|
1336
|
-
if (typeof
|
|
1337
|
-
const i =
|
|
1335
|
+
const a = n, r = a.type;
|
|
1336
|
+
if (typeof r == "function") {
|
|
1337
|
+
const i = r.displayName ?? r.name;
|
|
1338
1338
|
if (i && i !== "_default") return { lib: "react", name: i };
|
|
1339
1339
|
}
|
|
1340
|
-
if (typeof
|
|
1341
|
-
const i =
|
|
1340
|
+
if (typeof r == "object" && r !== null) {
|
|
1341
|
+
const i = r.displayName ?? r.name;
|
|
1342
1342
|
if (i) return { lib: "react", name: i };
|
|
1343
1343
|
}
|
|
1344
|
-
n =
|
|
1344
|
+
n = a.return;
|
|
1345
1345
|
}
|
|
1346
1346
|
return { lib: "react" };
|
|
1347
1347
|
}
|
|
1348
|
-
function
|
|
1349
|
-
var o,
|
|
1348
|
+
function Lt(e) {
|
|
1349
|
+
var o, a;
|
|
1350
1350
|
const t = e, n = t.__vueParentComponent;
|
|
1351
1351
|
if (n) {
|
|
1352
|
-
const
|
|
1353
|
-
return { lib: "vue", ...
|
|
1352
|
+
const r = ((o = n.type) == null ? void 0 : o.name) ?? ((a = n.type) == null ? void 0 : a.__name);
|
|
1353
|
+
return { lib: "vue", ...r ? { name: r } : {} };
|
|
1354
1354
|
}
|
|
1355
1355
|
return t.__vue__ ? { lib: "vue" } : null;
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1357
|
+
function Tt(e) {
|
|
1358
1358
|
const t = window.ng;
|
|
1359
1359
|
if (!(t != null && t.getComponent)) return null;
|
|
1360
1360
|
try {
|
|
@@ -1369,10 +1369,10 @@ function Lt(e) {
|
|
|
1369
1369
|
function Nt(e) {
|
|
1370
1370
|
return "__svelte_meta" in e ? { lib: "svelte" } : null;
|
|
1371
1371
|
}
|
|
1372
|
-
function
|
|
1373
|
-
return
|
|
1372
|
+
function Mt(e) {
|
|
1373
|
+
return At(e) ?? Lt(e) ?? Tt(e) ?? Nt(e) ?? void 0;
|
|
1374
1374
|
}
|
|
1375
|
-
const
|
|
1375
|
+
const It = 5e3, Rt = 1e3, de = 1e3, ue = 200, Pt = 50, pe = 200, _t = 500, Dt = [
|
|
1376
1376
|
"display",
|
|
1377
1377
|
"position",
|
|
1378
1378
|
"top",
|
|
@@ -1416,55 +1416,55 @@ function fe(e, t) {
|
|
|
1416
1416
|
|
|
1417
1417
|
/* … truncated, original was ${e.length} chars */`;
|
|
1418
1418
|
}
|
|
1419
|
-
function
|
|
1419
|
+
function $t(e) {
|
|
1420
1420
|
const t = getComputedStyle(e), n = {};
|
|
1421
|
-
for (const o of
|
|
1422
|
-
const
|
|
1423
|
-
|
|
1421
|
+
for (const o of Dt) {
|
|
1422
|
+
const a = t.getPropertyValue(o);
|
|
1423
|
+
a && a !== "normal" && a !== "none" && a !== "auto" && a !== "0px" && (n[o] = a.trim().slice(0, _t));
|
|
1424
1424
|
}
|
|
1425
1425
|
return n;
|
|
1426
1426
|
}
|
|
1427
|
-
function $t(e) {
|
|
1428
|
-
return Array.from(e.classList).slice(0, Rt).map((t) => t.length > pe ? t.slice(0, pe) : t);
|
|
1429
|
-
}
|
|
1430
1427
|
function Bt(e) {
|
|
1431
|
-
|
|
1428
|
+
return Array.from(e.classList).slice(0, Pt).map((t) => t.length > pe ? t.slice(0, pe) : t);
|
|
1429
|
+
}
|
|
1430
|
+
function zt(e) {
|
|
1431
|
+
const t = e.getBoundingClientRect(), n = kt(e), o = e.id || null, a = Mt(e);
|
|
1432
1432
|
return {
|
|
1433
1433
|
selector: n.length > de ? n.slice(0, de) : n,
|
|
1434
1434
|
tagName: e.tagName.toLowerCase(),
|
|
1435
1435
|
id: o && o.length > ue ? o.slice(0, ue) : o,
|
|
1436
|
-
classList:
|
|
1437
|
-
outerHTML: fe(e.outerHTML,
|
|
1438
|
-
...e.parentElement ? { parentOuterHTML: fe(e.parentElement.outerHTML,
|
|
1439
|
-
computedStyles:
|
|
1436
|
+
classList: Bt(e),
|
|
1437
|
+
outerHTML: fe(e.outerHTML, It),
|
|
1438
|
+
...e.parentElement ? { parentOuterHTML: fe(e.parentElement.outerHTML, Rt) } : {},
|
|
1439
|
+
computedStyles: $t(e),
|
|
1440
1440
|
boundingRect: {
|
|
1441
1441
|
x: Math.round(t.x),
|
|
1442
1442
|
y: Math.round(t.y),
|
|
1443
1443
|
w: Math.round(t.width),
|
|
1444
1444
|
h: Math.round(t.height)
|
|
1445
1445
|
},
|
|
1446
|
-
...
|
|
1446
|
+
...a ? { framework: a } : {}
|
|
1447
1447
|
};
|
|
1448
1448
|
}
|
|
1449
|
-
const
|
|
1450
|
-
async function
|
|
1451
|
-
const
|
|
1452
|
-
|
|
1453
|
-
const i =
|
|
1449
|
+
const Ot = 14, Ht = "#ffffff", Ut = "#ffffff", qt = 3, Ft = "#0ea5e9";
|
|
1450
|
+
async function Pe(e, t, n, o = Ft) {
|
|
1451
|
+
const a = await Vt(e), r = document.createElement("canvas");
|
|
1452
|
+
r.width = a.naturalWidth, r.height = a.naturalHeight;
|
|
1453
|
+
const i = r.getContext("2d");
|
|
1454
1454
|
if (!i) throw new Error("Could not get 2D canvas context");
|
|
1455
|
-
i.drawImage(
|
|
1456
|
-
const s =
|
|
1455
|
+
i.drawImage(a, 0, 0);
|
|
1456
|
+
const s = r.width / n.w, c = r.height / n.h;
|
|
1457
1457
|
for (const d of t) {
|
|
1458
|
-
const l =
|
|
1458
|
+
const l = jt(d);
|
|
1459
1459
|
if (!l) continue;
|
|
1460
|
-
const
|
|
1461
|
-
i.lineWidth = qt, i.strokeStyle = o, i.strokeRect(
|
|
1462
|
-
const
|
|
1463
|
-
i.beginPath(), i.fillStyle = o, i.arc(
|
|
1460
|
+
const m = l.x * s, p = l.y * c, g = l.w * s, u = l.h * c;
|
|
1461
|
+
i.lineWidth = qt, i.strokeStyle = o, i.strokeRect(m, p, g, u);
|
|
1462
|
+
const v = m + g, E = p;
|
|
1463
|
+
i.beginPath(), i.fillStyle = o, i.arc(v, E, Ot, 0, Math.PI * 2), i.fill(), i.lineWidth = 3, i.strokeStyle = Ht, i.stroke(), i.fillStyle = Ut, i.font = "bold 16px system-ui, -apple-system, sans-serif", i.textAlign = "center", i.textBaseline = "middle", i.fillText(String(d.number), v, E + 1);
|
|
1464
1464
|
}
|
|
1465
|
-
return
|
|
1465
|
+
return r.toDataURL("image/jpeg", 0.85);
|
|
1466
1466
|
}
|
|
1467
|
-
function
|
|
1467
|
+
function jt(e) {
|
|
1468
1468
|
if (e.liveElement && document.contains(e.liveElement)) {
|
|
1469
1469
|
const t = e.liveElement.getBoundingClientRect();
|
|
1470
1470
|
if (t.width > 0 || t.height > 0)
|
|
@@ -1482,21 +1482,21 @@ function Ft(e) {
|
|
|
1482
1482
|
}
|
|
1483
1483
|
return e.boundingRect;
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1485
|
+
function Vt(e) {
|
|
1486
1486
|
return new Promise((t, n) => {
|
|
1487
1487
|
const o = new Image();
|
|
1488
|
-
o.onload = () => t(o), o.onerror = (
|
|
1488
|
+
o.onload = () => t(o), o.onerror = (a) => n(a), o.src = e;
|
|
1489
1489
|
});
|
|
1490
1490
|
}
|
|
1491
|
-
const
|
|
1491
|
+
const D = "beacon-no-capture", Wt = "#0ea5e9", me = "Click any element to pin it · Press Esc to finish";
|
|
1492
1492
|
function he(e, t) {
|
|
1493
1493
|
return /^#[0-9a-fA-F]{6}$/.test(e) ? `${e}${t}` : e;
|
|
1494
1494
|
}
|
|
1495
|
-
function
|
|
1496
|
-
const t = e.accent ??
|
|
1497
|
-
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1495
|
+
function Yt(e = {}) {
|
|
1496
|
+
const t = e.accent ?? Wt, n = he(t, "b3"), o = he(t, "2e"), a = document.createElement("style");
|
|
1497
|
+
a.className = D, a.textContent = "@keyframes beacon-spin { to { transform: rotate(360deg); } }", document.head.appendChild(a);
|
|
1498
|
+
const r = document.createElement("div");
|
|
1499
|
+
r.className = D, r.setAttribute("aria-hidden", "true"), r.style.cssText = [
|
|
1500
1500
|
"position: fixed",
|
|
1501
1501
|
"inset: 0",
|
|
1502
1502
|
"pointer-events: none",
|
|
@@ -1507,7 +1507,7 @@ function Wt(e = {}) {
|
|
|
1507
1507
|
"box-sizing: border-box"
|
|
1508
1508
|
].join("; ");
|
|
1509
1509
|
const i = document.createElement("div");
|
|
1510
|
-
i.className =
|
|
1510
|
+
i.className = D, i.setAttribute("role", "status"), i.style.cssText = [
|
|
1511
1511
|
"position: fixed",
|
|
1512
1512
|
"top: 16px",
|
|
1513
1513
|
"left: 50%",
|
|
@@ -1534,14 +1534,14 @@ function Wt(e = {}) {
|
|
|
1534
1534
|
vertical-align: middle;
|
|
1535
1535
|
margin-right: 8px;
|
|
1536
1536
|
"></span>`;
|
|
1537
|
-
function c(
|
|
1538
|
-
return
|
|
1537
|
+
function c(b) {
|
|
1538
|
+
return b.replace(/[<>&]/g, (f) => ({ "<": "<", ">": ">", "&": "&" })[f]);
|
|
1539
1539
|
}
|
|
1540
|
-
document.body.appendChild(
|
|
1540
|
+
document.body.appendChild(r), document.body.appendChild(i);
|
|
1541
1541
|
const d = /* @__PURE__ */ new Map();
|
|
1542
|
-
function l(
|
|
1543
|
-
const
|
|
1544
|
-
return
|
|
1542
|
+
function l(b) {
|
|
1543
|
+
const f = document.createElement("div");
|
|
1544
|
+
return f.className = D, f.setAttribute("aria-hidden", "true"), f.style.cssText = [
|
|
1545
1545
|
"position: fixed",
|
|
1546
1546
|
"width: 24px",
|
|
1547
1547
|
"height: 24px",
|
|
@@ -1556,67 +1556,67 @@ function Wt(e = {}) {
|
|
|
1556
1556
|
"box-shadow: 0 2px 8px hsl(0 0% 0% / 0.4)",
|
|
1557
1557
|
"pointer-events: none",
|
|
1558
1558
|
"z-index: 2147483646"
|
|
1559
|
-
].join("; "),
|
|
1559
|
+
].join("; "), f.textContent = String(b), document.body.appendChild(f), f;
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1562
|
-
const
|
|
1563
|
-
return
|
|
1561
|
+
function m() {
|
|
1562
|
+
const b = document.createElement("div");
|
|
1563
|
+
return b.className = D, b.setAttribute("aria-hidden", "true"), b.style.cssText = [
|
|
1564
1564
|
"position: fixed",
|
|
1565
1565
|
"pointer-events: none",
|
|
1566
1566
|
`border: 2px solid ${t}`,
|
|
1567
1567
|
"border-radius: 2px",
|
|
1568
1568
|
"box-sizing: border-box",
|
|
1569
1569
|
"z-index: 2147483645"
|
|
1570
|
-
].join("; "), document.body.appendChild(
|
|
1571
|
-
}
|
|
1572
|
-
function
|
|
1573
|
-
const
|
|
1574
|
-
|
|
1575
|
-
}
|
|
1576
|
-
function b
|
|
1577
|
-
|
|
1578
|
-
}
|
|
1579
|
-
function
|
|
1580
|
-
d.forEach((
|
|
1581
|
-
let
|
|
1582
|
-
if (document.contains(
|
|
1583
|
-
const
|
|
1584
|
-
if (
|
|
1585
|
-
|
|
1570
|
+
].join("; "), document.body.appendChild(b), b;
|
|
1571
|
+
}
|
|
1572
|
+
function p(b, f, h) {
|
|
1573
|
+
const y = h ? "0.5" : "1";
|
|
1574
|
+
b.outline.style.display = "block", b.outline.style.opacity = y, b.outline.style.left = `${f.x}px`, b.outline.style.top = `${f.y}px`, b.outline.style.width = `${f.w}px`, b.outline.style.height = `${f.h}px`, b.marker.style.display = "flex", b.marker.style.opacity = y, b.marker.style.left = `${f.x + f.w - 12}px`, b.marker.style.top = `${Math.max(2, f.y - 12)}px`;
|
|
1575
|
+
}
|
|
1576
|
+
function g(b) {
|
|
1577
|
+
b.marker.style.display = "none", b.outline.style.display = "none";
|
|
1578
|
+
}
|
|
1579
|
+
function u() {
|
|
1580
|
+
d.forEach((b) => {
|
|
1581
|
+
let f = b.anchor.target;
|
|
1582
|
+
if (document.contains(f) || (f = null), !f && b.anchor.selector && (f = document.querySelector(b.anchor.selector), f && (b.anchor.target = f)), f) {
|
|
1583
|
+
const y = f.getBoundingClientRect();
|
|
1584
|
+
if (y.width > 0 || y.height > 0) {
|
|
1585
|
+
p(b, { x: y.left, y: y.top, w: y.width, h: y.height }, !1);
|
|
1586
1586
|
return;
|
|
1587
1587
|
}
|
|
1588
1588
|
}
|
|
1589
|
-
const h =
|
|
1589
|
+
const h = b.anchor.fallbackRect;
|
|
1590
1590
|
if (h && (h.w > 0 || h.h > 0)) {
|
|
1591
|
-
|
|
1591
|
+
p(b, h, !0);
|
|
1592
1592
|
return;
|
|
1593
1593
|
}
|
|
1594
|
-
b
|
|
1594
|
+
g(b);
|
|
1595
1595
|
});
|
|
1596
1596
|
}
|
|
1597
|
-
let
|
|
1598
|
-
function
|
|
1599
|
-
|
|
1600
|
-
|
|
1597
|
+
let v = null;
|
|
1598
|
+
function E() {
|
|
1599
|
+
v === null && (v = requestAnimationFrame(() => {
|
|
1600
|
+
v = null, u();
|
|
1601
1601
|
}));
|
|
1602
1602
|
}
|
|
1603
|
-
return window.addEventListener("scroll",
|
|
1604
|
-
addPin(
|
|
1605
|
-
const h = l(
|
|
1606
|
-
d.set(
|
|
1603
|
+
return window.addEventListener("scroll", E, !0), window.addEventListener("resize", E), {
|
|
1604
|
+
addPin(b, f) {
|
|
1605
|
+
const h = l(b), y = m();
|
|
1606
|
+
d.set(b, { anchor: f, marker: h, outline: y }), u();
|
|
1607
1607
|
},
|
|
1608
|
-
setLoading(
|
|
1609
|
-
|
|
1608
|
+
setLoading(b) {
|
|
1609
|
+
b ? i.innerHTML = s + c(b) : i.textContent = me;
|
|
1610
1610
|
},
|
|
1611
1611
|
destroy() {
|
|
1612
|
-
window.removeEventListener("scroll",
|
|
1613
|
-
|
|
1612
|
+
window.removeEventListener("scroll", E, !0), window.removeEventListener("resize", E), v !== null && cancelAnimationFrame(v), r.remove(), i.remove(), a.remove(), d.forEach(({ marker: b, outline: f }) => {
|
|
1613
|
+
b.remove(), f.remove();
|
|
1614
1614
|
}), d.clear();
|
|
1615
1615
|
}
|
|
1616
1616
|
};
|
|
1617
1617
|
}
|
|
1618
|
-
const
|
|
1619
|
-
function
|
|
1618
|
+
const Xt = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>', Kt = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>';
|
|
1619
|
+
function Gt(e) {
|
|
1620
1620
|
return new Promise((t) => {
|
|
1621
1621
|
const n = document.createElement("div");
|
|
1622
1622
|
n.className = "beacon-pin-popover open beacon-no-capture beacon-theme-auto", n.innerHTML = `
|
|
@@ -1625,15 +1625,15 @@ function Xt(e) {
|
|
|
1625
1625
|
<span class="beacon-pin-num">${e.pinNumber}</span>
|
|
1626
1626
|
<span>Note for this pin</span>
|
|
1627
1627
|
</div>
|
|
1628
|
-
<button type="button" class="beacon-icon-btn" data-action="cancel" aria-label="Discard this pin">${
|
|
1628
|
+
<button type="button" class="beacon-icon-btn" data-action="cancel" aria-label="Discard this pin">${Xt}</button>
|
|
1629
1629
|
</div>
|
|
1630
1630
|
<textarea class="beacon-textarea" rows="2" placeholder="Optional — describe what's wrong here…" style="min-height:48px;"></textarea>
|
|
1631
1631
|
<div class="beacon-pin-popover-actions">
|
|
1632
1632
|
<button type="button" class="beacon-btn primary" data-action="save">${Kt} Save</button>
|
|
1633
1633
|
</div>
|
|
1634
1634
|
`;
|
|
1635
|
-
const o = 240,
|
|
1636
|
-
n.style.left = `${
|
|
1635
|
+
const o = 240, a = 160, r = Math.min(Math.max(8, e.anchor.x), window.innerWidth - o - 8), i = Math.min(Math.max(8, e.anchor.y + 12), window.innerHeight - a - 8);
|
|
1636
|
+
n.style.left = `${r}px`, n.style.top = `${i}px`, document.body.appendChild(n);
|
|
1637
1637
|
const s = n.querySelector("textarea");
|
|
1638
1638
|
s.focus();
|
|
1639
1639
|
function c(l) {
|
|
@@ -1643,37 +1643,37 @@ function Xt(e) {
|
|
|
1643
1643
|
l.key === "Escape" && (l.preventDefault(), l.stopPropagation(), c({ cancelled: "all" }));
|
|
1644
1644
|
}
|
|
1645
1645
|
document.addEventListener("keydown", d, !0), n.addEventListener("click", (l) => {
|
|
1646
|
-
var
|
|
1647
|
-
const
|
|
1648
|
-
if (
|
|
1649
|
-
const
|
|
1650
|
-
c({ ...
|
|
1646
|
+
var g;
|
|
1647
|
+
const p = (g = l.target.closest("[data-action]")) == null ? void 0 : g.getAttribute("data-action");
|
|
1648
|
+
if (p === "cancel" && c({ cancelled: "pin" }), p === "save") {
|
|
1649
|
+
const u = s.value.trim();
|
|
1650
|
+
c({ ...u ? { note: u } : {}, cancelled: !1 });
|
|
1651
1651
|
}
|
|
1652
1652
|
}), s.addEventListener("keydown", (l) => {
|
|
1653
1653
|
if (l.key === "Enter" && (l.metaKey || l.ctrlKey)) {
|
|
1654
1654
|
l.preventDefault();
|
|
1655
|
-
const
|
|
1656
|
-
c({ ...
|
|
1655
|
+
const m = s.value.trim();
|
|
1656
|
+
c({ ...m ? { note: m } : {}, cancelled: !1 });
|
|
1657
1657
|
}
|
|
1658
1658
|
});
|
|
1659
1659
|
});
|
|
1660
1660
|
}
|
|
1661
|
-
const
|
|
1662
|
-
function
|
|
1661
|
+
const Jt = "#0ea5e9";
|
|
1662
|
+
function Zt(e, t) {
|
|
1663
1663
|
return /^#[0-9a-fA-F]{6}$/.test(e) ? `${e}${t}` : e;
|
|
1664
1664
|
}
|
|
1665
|
-
function
|
|
1666
|
-
const { shadowRoot: t, onHover: n } = e, o = e.accent ??
|
|
1667
|
-
|
|
1665
|
+
function Qt(e) {
|
|
1666
|
+
const { shadowRoot: t, onHover: n } = e, o = e.accent ?? Jt, a = Zt(o, "14"), r = document.createElement("div");
|
|
1667
|
+
r.style.cssText = [
|
|
1668
1668
|
"position: fixed",
|
|
1669
1669
|
"pointer-events: none",
|
|
1670
1670
|
"z-index: 2147483646",
|
|
1671
1671
|
`border: 2px solid ${o}`,
|
|
1672
|
-
`background: ${
|
|
1672
|
+
`background: ${a}`,
|
|
1673
1673
|
"transition: all 60ms ease-out",
|
|
1674
1674
|
"box-sizing: border-box",
|
|
1675
1675
|
"border-radius: 2px"
|
|
1676
|
-
].join("; "), document.body.appendChild(
|
|
1676
|
+
].join("; "), document.body.appendChild(r);
|
|
1677
1677
|
const i = document.createElement("div");
|
|
1678
1678
|
i.style.cssText = [
|
|
1679
1679
|
"position: fixed",
|
|
@@ -1696,60 +1696,60 @@ function Zt(e) {
|
|
|
1696
1696
|
const l = new Promise((h) => {
|
|
1697
1697
|
d = h;
|
|
1698
1698
|
});
|
|
1699
|
-
function
|
|
1699
|
+
function m(h) {
|
|
1700
1700
|
if (!h || !(h instanceof Node)) return !1;
|
|
1701
|
-
let
|
|
1702
|
-
for (;
|
|
1703
|
-
if (
|
|
1704
|
-
|
|
1701
|
+
let y = h;
|
|
1702
|
+
for (; y; ) {
|
|
1703
|
+
if (y === t || y === t.host) return !0;
|
|
1704
|
+
y = y.parentNode ?? y.host ?? null;
|
|
1705
1705
|
}
|
|
1706
1706
|
return !1;
|
|
1707
1707
|
}
|
|
1708
|
-
function
|
|
1709
|
-
|
|
1710
|
-
const C = document.elementsFromPoint(h,
|
|
1711
|
-
|
|
1712
|
-
for (const
|
|
1713
|
-
if (!
|
|
1708
|
+
function p(h, y) {
|
|
1709
|
+
r.style.display = "none", i.style.display = "none";
|
|
1710
|
+
const C = document.elementsFromPoint(h, y);
|
|
1711
|
+
r.style.display = "block", i.style.display = "block";
|
|
1712
|
+
for (const k of C)
|
|
1713
|
+
if (!m(k)) return k;
|
|
1714
1714
|
return null;
|
|
1715
1715
|
}
|
|
1716
|
-
function
|
|
1717
|
-
const
|
|
1718
|
-
|
|
1719
|
-
const C = h.tagName.toLowerCase(),
|
|
1720
|
-
i.textContent = C +
|
|
1721
|
-
const
|
|
1722
|
-
i.style.left = `${
|
|
1716
|
+
function g(h) {
|
|
1717
|
+
const y = h.getBoundingClientRect();
|
|
1718
|
+
r.style.left = `${y.left}px`, r.style.top = `${y.top}px`, r.style.width = `${y.width}px`, r.style.height = `${y.height}px`;
|
|
1719
|
+
const C = h.tagName.toLowerCase(), k = h.classList.length > 0 ? "." + Array.from(h.classList).slice(0, 2).join(".") : "";
|
|
1720
|
+
i.textContent = C + k;
|
|
1721
|
+
const S = y.top - 22;
|
|
1722
|
+
i.style.left = `${y.left}px`, i.style.top = `${S >= 0 ? S : y.bottom + 4}px`;
|
|
1723
1723
|
}
|
|
1724
|
-
function
|
|
1725
|
-
const
|
|
1726
|
-
|
|
1724
|
+
function u(h) {
|
|
1725
|
+
const y = p(h.clientX, h.clientY);
|
|
1726
|
+
y ? (g(y), n == null || n(y)) : (r.style.display = "none", i.style.display = "none", n == null || n(null));
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1728
|
+
function v(h) {
|
|
1729
1729
|
if (h.button !== 0) return;
|
|
1730
1730
|
h.preventDefault(), h.stopPropagation();
|
|
1731
|
-
const
|
|
1732
|
-
|
|
1731
|
+
const y = p(h.clientX, h.clientY);
|
|
1732
|
+
y && f(y);
|
|
1733
1733
|
}
|
|
1734
|
-
function
|
|
1734
|
+
function E(h) {
|
|
1735
1735
|
h.preventDefault(), h.stopPropagation();
|
|
1736
1736
|
}
|
|
1737
|
-
function
|
|
1738
|
-
h.key === "Escape" && (h.preventDefault(),
|
|
1737
|
+
function b(h) {
|
|
1738
|
+
h.key === "Escape" && (h.preventDefault(), f(null));
|
|
1739
1739
|
}
|
|
1740
|
-
function
|
|
1741
|
-
c || (c = !0, document.removeEventListener("mousemove",
|
|
1740
|
+
function f(h) {
|
|
1741
|
+
c || (c = !0, document.removeEventListener("mousemove", u, !0), document.removeEventListener("pointerdown", v, !0), document.removeEventListener("click", E, !0), document.removeEventListener("mouseup", E, !0), document.removeEventListener("keydown", b, !0), r.remove(), i.remove(), document.body.style.cursor = s, d(h));
|
|
1742
1742
|
}
|
|
1743
|
-
return document.addEventListener("mousemove",
|
|
1744
|
-
cancel: () =>
|
|
1743
|
+
return document.addEventListener("mousemove", u, !0), document.addEventListener("pointerdown", v, !0), document.addEventListener("click", E, !0), document.addEventListener("mouseup", E, !0), document.addEventListener("keydown", b, !0), {
|
|
1744
|
+
cancel: () => f(null),
|
|
1745
1745
|
promise: l
|
|
1746
1746
|
};
|
|
1747
1747
|
}
|
|
1748
1748
|
let Y = null;
|
|
1749
|
-
async function
|
|
1749
|
+
async function en() {
|
|
1750
1750
|
return Y || (Y = await import("./index-DAIDnjfR.mjs")), Y;
|
|
1751
1751
|
}
|
|
1752
|
-
const
|
|
1752
|
+
const U = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=";
|
|
1753
1753
|
function be(e, t) {
|
|
1754
1754
|
if (!e || e.startsWith("data:") || e.startsWith("blob:") || e.startsWith("/") || e.startsWith("#")) return !0;
|
|
1755
1755
|
try {
|
|
@@ -1759,61 +1759,119 @@ function be(e, t) {
|
|
|
1759
1759
|
}
|
|
1760
1760
|
return t === "anonymous" || t === "use-credentials";
|
|
1761
1761
|
}
|
|
1762
|
-
function
|
|
1762
|
+
function tn() {
|
|
1763
1763
|
const e = [], t = [];
|
|
1764
1764
|
return document.querySelectorAll("img").forEach((n) => {
|
|
1765
|
-
be(n.src, n.crossOrigin) || (e.push({ el: n, src: n.src }), n.src =
|
|
1765
|
+
be(n.src, n.crossOrigin) || (e.push({ el: n, src: n.src }), n.src = U);
|
|
1766
1766
|
}), document.querySelectorAll("image").forEach((n) => {
|
|
1767
|
-
const o = n,
|
|
1768
|
-
i && !be(i) && (t.push({ el: o, href:
|
|
1767
|
+
const o = n, a = o.getAttribute("href"), r = o.getAttributeNS("http://www.w3.org/1999/xlink", "href"), i = a || r || "";
|
|
1768
|
+
i && !be(i) && (t.push({ el: o, href: a, xlink: r }), a !== null && o.setAttribute("href", U), r !== null && o.setAttributeNS("http://www.w3.org/1999/xlink", "href", U));
|
|
1769
1769
|
}), () => {
|
|
1770
1770
|
for (const { el: n, src: o } of e) n.src = o;
|
|
1771
|
-
for (const { el: n, href: o, xlink:
|
|
1772
|
-
o !== null && n.setAttribute("href", o),
|
|
1771
|
+
for (const { el: n, href: o, xlink: a } of t)
|
|
1772
|
+
o !== null && n.setAttribute("href", o), a !== null && n.setAttributeNS("http://www.w3.org/1999/xlink", "href", a);
|
|
1773
|
+
};
|
|
1774
|
+
}
|
|
1775
|
+
function nn() {
|
|
1776
|
+
const e = [];
|
|
1777
|
+
document.querySelectorAll("*").forEach((r) => {
|
|
1778
|
+
const i = getComputedStyle(r), s = (i.overflowY === "auto" || i.overflowY === "scroll") && r.scrollHeight > r.clientHeight, c = (i.overflowX === "auto" || i.overflowX === "scroll") && r.scrollWidth > r.clientWidth;
|
|
1779
|
+
(s || c) && e.push(r);
|
|
1780
|
+
});
|
|
1781
|
+
const t = window.scrollX, n = window.scrollY, o = e.map((r) => ({
|
|
1782
|
+
el: r,
|
|
1783
|
+
scrollLeft: r.scrollLeft,
|
|
1784
|
+
scrollTop: r.scrollTop
|
|
1785
|
+
})), a = /* @__PURE__ */ new Map();
|
|
1786
|
+
for (const r of e) {
|
|
1787
|
+
let i = r;
|
|
1788
|
+
for (; i && i !== document.documentElement.parentElement; )
|
|
1789
|
+
a.has(i) || a.set(i, i.style.cssText), i = i.parentElement;
|
|
1790
|
+
}
|
|
1791
|
+
for (const r of a.keys())
|
|
1792
|
+
r.style.setProperty("overflow", "visible", "important"), r.style.setProperty("overflow-x", "visible", "important"), r.style.setProperty("overflow-y", "visible", "important"), r.style.setProperty("max-height", "none", "important"), r.style.setProperty("height", "auto", "important"), r.style.setProperty("min-height", "0", "important");
|
|
1793
|
+
return () => {
|
|
1794
|
+
for (const [r, i] of a)
|
|
1795
|
+
r.style.cssText = i;
|
|
1796
|
+
for (const { el: r, scrollLeft: i, scrollTop: s } of o)
|
|
1797
|
+
r.scrollLeft = i, r.scrollTop = s;
|
|
1798
|
+
window.scrollTo(t, n);
|
|
1773
1799
|
};
|
|
1774
1800
|
}
|
|
1801
|
+
let ge = Promise.resolve();
|
|
1775
1802
|
async function _e(e = {}) {
|
|
1803
|
+
const t = ge;
|
|
1804
|
+
let n;
|
|
1805
|
+
ge = new Promise((o) => {
|
|
1806
|
+
n = o;
|
|
1807
|
+
});
|
|
1808
|
+
try {
|
|
1809
|
+
return await t, await on(e, n);
|
|
1810
|
+
} catch (o) {
|
|
1811
|
+
throw n(), o;
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
async function on(e, t) {
|
|
1776
1815
|
const {
|
|
1777
|
-
quality:
|
|
1778
|
-
pixelRatio:
|
|
1779
|
-
excludeShadowRoot:
|
|
1780
|
-
excludeHosts: r
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1816
|
+
quality: n = 0.7,
|
|
1817
|
+
pixelRatio: o = Math.min(window.devicePixelRatio || 1, 2),
|
|
1818
|
+
excludeShadowRoot: a,
|
|
1819
|
+
excludeHosts: r,
|
|
1820
|
+
fullPage: i = !0
|
|
1821
|
+
} = e, s = await en(), c = a || r != null && r.length ? (g) => {
|
|
1822
|
+
let u = g;
|
|
1823
|
+
for (; u; ) {
|
|
1824
|
+
if (a && u === a.host || r && u instanceof Element && r.includes(u) || u instanceof Element && u.classList.contains("beacon-no-capture")) return !1;
|
|
1825
|
+
u = u.parentNode;
|
|
1786
1826
|
}
|
|
1787
1827
|
return !0;
|
|
1788
|
-
} : void 0,
|
|
1828
|
+
} : void 0, d = tn(), l = i ? nn() : () => {
|
|
1829
|
+
};
|
|
1830
|
+
let m = !1;
|
|
1831
|
+
const p = () => {
|
|
1832
|
+
if (!m) {
|
|
1833
|
+
m = !0;
|
|
1834
|
+
try {
|
|
1835
|
+
l();
|
|
1836
|
+
} finally {
|
|
1837
|
+
try {
|
|
1838
|
+
d();
|
|
1839
|
+
} finally {
|
|
1840
|
+
t();
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
};
|
|
1789
1845
|
try {
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1846
|
+
i && await new Promise((b) => requestAnimationFrame(() => b()));
|
|
1847
|
+
const g = document.documentElement, u = i ? Math.max(g.scrollWidth, window.innerWidth) : window.innerWidth, v = i ? Math.max(g.scrollHeight, window.innerHeight) : window.innerHeight;
|
|
1848
|
+
return { dataUrl: await s.toJpeg(g, {
|
|
1849
|
+
quality: n,
|
|
1850
|
+
pixelRatio: o,
|
|
1793
1851
|
cacheBust: !0,
|
|
1794
|
-
...
|
|
1795
|
-
imagePlaceholder:
|
|
1796
|
-
width:
|
|
1797
|
-
height:
|
|
1852
|
+
...c ? { filter: c } : {},
|
|
1853
|
+
imagePlaceholder: U,
|
|
1854
|
+
width: u,
|
|
1855
|
+
height: v,
|
|
1798
1856
|
style: { transform: "none" }
|
|
1799
|
-
});
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1857
|
+
}), width: u, height: v, pixelRatio: o, dispose: p };
|
|
1858
|
+
} catch (g) {
|
|
1859
|
+
throw p(), g;
|
|
1802
1860
|
}
|
|
1803
1861
|
}
|
|
1804
1862
|
let Q = null;
|
|
1805
|
-
function
|
|
1863
|
+
function rn(e) {
|
|
1806
1864
|
Q = e;
|
|
1807
1865
|
}
|
|
1808
|
-
function
|
|
1866
|
+
function an() {
|
|
1809
1867
|
return Q;
|
|
1810
1868
|
}
|
|
1811
|
-
function
|
|
1869
|
+
function R() {
|
|
1812
1870
|
Q = null;
|
|
1813
1871
|
}
|
|
1814
|
-
const
|
|
1815
|
-
function
|
|
1816
|
-
const e = document.createElementNS(
|
|
1872
|
+
const ye = "http://www.w3.org/2000/svg";
|
|
1873
|
+
function sn() {
|
|
1874
|
+
const e = document.createElementNS(ye, "svg");
|
|
1817
1875
|
e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("fill", "none"), e.setAttribute("stroke", "currentColor"), e.setAttribute("stroke-width", "2"), e.setAttribute("stroke-linecap", "round"), e.setAttribute("stroke-linejoin", "round"), e.setAttribute("aria-hidden", "true");
|
|
1818
1876
|
const t = [
|
|
1819
1877
|
"M3 6h18",
|
|
@@ -1821,129 +1879,139 @@ function on() {
|
|
|
1821
1879
|
"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"
|
|
1822
1880
|
];
|
|
1823
1881
|
for (const n of t) {
|
|
1824
|
-
const o = document.createElementNS(
|
|
1882
|
+
const o = document.createElementNS(ye, "path");
|
|
1825
1883
|
o.setAttribute("d", n), e.appendChild(o);
|
|
1826
1884
|
}
|
|
1827
1885
|
return e;
|
|
1828
1886
|
}
|
|
1829
|
-
function
|
|
1887
|
+
function cn(e = {}) {
|
|
1830
1888
|
const t = e.maxPins ?? 20;
|
|
1831
|
-
let n = [], o = /* @__PURE__ */ new WeakMap(),
|
|
1832
|
-
function d() {
|
|
1833
|
-
n = [], o = /* @__PURE__ */ new WeakMap(), r = null, D(), m(), x();
|
|
1834
|
-
}
|
|
1889
|
+
let n = [], o = /* @__PURE__ */ new WeakMap(), a = null, r = 0, i = null, s = null, c = null, d = null;
|
|
1835
1890
|
function l() {
|
|
1836
|
-
|
|
1837
|
-
|
|
1891
|
+
n = [], o = /* @__PURE__ */ new WeakMap(), a = null, r += 1, R(), E(), b();
|
|
1892
|
+
}
|
|
1893
|
+
function m() {
|
|
1894
|
+
const f = document.querySelector("launch-kit-beacon");
|
|
1895
|
+
return (f == null ? void 0 : f.shadowRoot) ?? null;
|
|
1838
1896
|
}
|
|
1839
1897
|
function p() {
|
|
1840
1898
|
if (typeof window > "u") return e.accent ?? "#0ea5e9";
|
|
1841
1899
|
if (e.accent) return e.accent;
|
|
1842
|
-
const
|
|
1843
|
-
return
|
|
1844
|
-
}
|
|
1845
|
-
async function f
|
|
1846
|
-
const
|
|
1847
|
-
if (!
|
|
1848
|
-
const y = p(),
|
|
1849
|
-
for (const
|
|
1850
|
-
const
|
|
1851
|
-
|
|
1852
|
-
target:
|
|
1853
|
-
selector:
|
|
1854
|
-
fallbackRect:
|
|
1900
|
+
const f = document.querySelector("launch-kit-beacon");
|
|
1901
|
+
return f && getComputedStyle(f).getPropertyValue("--beacon-accent").trim() || "#0ea5e9";
|
|
1902
|
+
}
|
|
1903
|
+
async function g(f) {
|
|
1904
|
+
const h = m();
|
|
1905
|
+
if (!h) return;
|
|
1906
|
+
const y = p(), C = await f.requestMode("pickElement"), k = Yt({ accent: y });
|
|
1907
|
+
for (const S of n) {
|
|
1908
|
+
const A = o.get(S);
|
|
1909
|
+
A && k.addPin(S.number, {
|
|
1910
|
+
target: A,
|
|
1911
|
+
selector: S.selector,
|
|
1912
|
+
fallbackRect: S.boundingRect
|
|
1855
1913
|
});
|
|
1856
1914
|
}
|
|
1857
1915
|
try {
|
|
1858
|
-
let
|
|
1859
|
-
for (;
|
|
1860
|
-
const
|
|
1861
|
-
if (!
|
|
1862
|
-
const
|
|
1863
|
-
anchor: { x:
|
|
1916
|
+
let S = !0;
|
|
1917
|
+
for (; S && !(n.length >= t); ) {
|
|
1918
|
+
const N = await Qt({ shadowRoot: h, accent: y }).promise;
|
|
1919
|
+
if (!N) break;
|
|
1920
|
+
const w = N.getBoundingClientRect(), L = await Gt({
|
|
1921
|
+
anchor: { x: w.left, y: w.bottom },
|
|
1864
1922
|
pinNumber: n.length + 1
|
|
1865
1923
|
});
|
|
1866
|
-
if (
|
|
1867
|
-
|
|
1924
|
+
if (L.cancelled === "all") {
|
|
1925
|
+
S = !1;
|
|
1868
1926
|
break;
|
|
1869
1927
|
}
|
|
1870
|
-
if (
|
|
1871
|
-
const
|
|
1928
|
+
if (L.cancelled === "pin") continue;
|
|
1929
|
+
const M = zt(N), I = {
|
|
1872
1930
|
number: n.length + 1,
|
|
1873
|
-
...
|
|
1874
|
-
...
|
|
1931
|
+
...M,
|
|
1932
|
+
...L.note ? { note: L.note } : {}
|
|
1875
1933
|
};
|
|
1876
|
-
n.push(
|
|
1877
|
-
target:
|
|
1878
|
-
selector:
|
|
1879
|
-
fallbackRect:
|
|
1934
|
+
n.push(I), o.set(I, N), k.addPin(I.number, {
|
|
1935
|
+
target: N,
|
|
1936
|
+
selector: M.selector,
|
|
1937
|
+
fallbackRect: M.boundingRect
|
|
1880
1938
|
});
|
|
1881
1939
|
}
|
|
1882
|
-
|
|
1883
|
-
v.setLoading("Capturing screenshot…"), await new Promise((S) => requestAnimationFrame(() => S()));
|
|
1884
|
-
try {
|
|
1885
|
-
const S = Array.from(document.querySelectorAll("launch-kit-beacon")), L = await _e({ excludeHosts: S }), T = n.map((k) => ({
|
|
1886
|
-
number: k.number,
|
|
1887
|
-
selector: k.selector,
|
|
1888
|
-
boundingRect: k.boundingRect,
|
|
1889
|
-
...o.get(k) ? { liveElement: o.get(k) } : {}
|
|
1890
|
-
})), N = {
|
|
1891
|
-
w: window.innerWidth,
|
|
1892
|
-
h: window.innerHeight,
|
|
1893
|
-
dpr: window.devicePixelRatio || 1
|
|
1894
|
-
}, w = await Re(L, T, N, y);
|
|
1895
|
-
r = w, tn({ dataUrl: w, mime: "image/jpeg" });
|
|
1896
|
-
} catch {
|
|
1897
|
-
r = null, D();
|
|
1898
|
-
}
|
|
1899
|
-
} else
|
|
1900
|
-
r = null, D();
|
|
1940
|
+
n.length > 0 ? (k.setLoading("Capturing screenshot…"), await new Promise((A) => requestAnimationFrame(() => A())), await u()) : (a = null, R());
|
|
1901
1941
|
} finally {
|
|
1902
|
-
|
|
1942
|
+
k.destroy(), C();
|
|
1903
1943
|
}
|
|
1904
|
-
|
|
1944
|
+
E(), b();
|
|
1905
1945
|
}
|
|
1906
|
-
function
|
|
1907
|
-
const
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1946
|
+
async function u() {
|
|
1947
|
+
const f = ++r;
|
|
1948
|
+
if (n.length === 0) {
|
|
1949
|
+
a = null, R(), b();
|
|
1950
|
+
return;
|
|
1951
|
+
}
|
|
1952
|
+
const h = p();
|
|
1953
|
+
try {
|
|
1954
|
+
const y = Array.from(document.querySelectorAll("launch-kit-beacon")), C = await _e({ excludeHosts: y });
|
|
1955
|
+
try {
|
|
1956
|
+
if (f !== r) return;
|
|
1957
|
+
const k = n.map((N) => ({
|
|
1958
|
+
number: N.number,
|
|
1959
|
+
selector: N.selector,
|
|
1960
|
+
boundingRect: N.boundingRect,
|
|
1961
|
+
...o.get(N) ? { liveElement: o.get(N) } : {}
|
|
1962
|
+
})), S = { w: C.width, h: C.height, dpr: C.pixelRatio }, A = await Pe(C.dataUrl, k, S, h);
|
|
1963
|
+
if (f !== r) return;
|
|
1964
|
+
a = A, rn({ dataUrl: A, mime: "image/jpeg" });
|
|
1965
|
+
} finally {
|
|
1966
|
+
C.dispose();
|
|
1967
|
+
}
|
|
1968
|
+
} catch {
|
|
1969
|
+
if (f !== r) return;
|
|
1970
|
+
a = null, R();
|
|
1971
|
+
}
|
|
1972
|
+
f === r && b();
|
|
1911
1973
|
}
|
|
1912
|
-
function
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1974
|
+
function v(f) {
|
|
1975
|
+
const h = n.findIndex((y) => y.number === f);
|
|
1976
|
+
h !== -1 && (n.splice(h, 1), n.forEach((y, C) => {
|
|
1977
|
+
y.number = C + 1;
|
|
1978
|
+
}), a = null, R(), E(), b(), u());
|
|
1979
|
+
}
|
|
1980
|
+
function E() {
|
|
1981
|
+
if (i && (i.textContent = `Pins (${n.length})`, i.style.display = n.length === 0 ? "none" : ""), d && (d.textContent = n.length === 0 ? "Annotate elements" : "Add another pin"), !!s) {
|
|
1982
|
+
s.innerHTML = "", s.style.display = n.length === 0 ? "none" : "";
|
|
1983
|
+
for (const f of n) {
|
|
1920
1984
|
const h = document.createElement("div");
|
|
1921
|
-
h.className = "beacon-pin-
|
|
1922
|
-
const
|
|
1923
|
-
|
|
1924
|
-
const C = document.createElement("
|
|
1925
|
-
C.
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
const S = document.createElement("
|
|
1929
|
-
S.type = "
|
|
1985
|
+
h.className = "beacon-pin-item", h.dataset.pin = String(f.number);
|
|
1986
|
+
const y = document.createElement("span");
|
|
1987
|
+
y.className = "beacon-pin-num", y.textContent = String(f.number);
|
|
1988
|
+
const C = document.createElement("div");
|
|
1989
|
+
C.className = "beacon-pin-meta";
|
|
1990
|
+
const k = document.createElement("div");
|
|
1991
|
+
k.className = "beacon-pin-selector", k.title = f.selector, k.textContent = f.selector || f.tagName;
|
|
1992
|
+
const S = document.createElement("input");
|
|
1993
|
+
S.type = "text", S.className = "beacon-pin-note-input", S.placeholder = "Add a note (optional)", S.value = f.note ?? "", S.addEventListener("input", () => {
|
|
1994
|
+
S.value.trim() ? f.note = S.value : delete f.note;
|
|
1995
|
+
}), C.appendChild(k), C.appendChild(S);
|
|
1996
|
+
const A = document.createElement("button");
|
|
1997
|
+
A.type = "button", A.className = "beacon-icon-btn", A.setAttribute("aria-label", `Remove pin ${f.number}`), A.appendChild(sn()), A.addEventListener("click", () => v(f.number)), h.appendChild(y), h.appendChild(C), h.appendChild(A), s.appendChild(h);
|
|
1930
1998
|
}
|
|
1931
1999
|
}
|
|
1932
2000
|
}
|
|
1933
|
-
function
|
|
1934
|
-
|
|
2001
|
+
function b() {
|
|
2002
|
+
c && (a ? (c.src = a, c.style.display = "block") : (c.removeAttribute("src"), c.style.display = "none"));
|
|
1935
2003
|
}
|
|
1936
2004
|
return {
|
|
1937
2005
|
name: "domEle",
|
|
1938
|
-
setupOnce(
|
|
1939
|
-
return
|
|
2006
|
+
setupOnce(f) {
|
|
2007
|
+
return f.on("close", () => l());
|
|
1940
2008
|
},
|
|
1941
|
-
form(
|
|
2009
|
+
form(f) {
|
|
1942
2010
|
return {
|
|
1943
|
-
render: (
|
|
1944
|
-
f
|
|
1945
|
-
}),
|
|
1946
|
-
|
|
2011
|
+
render: (h) => (i = document.createElement("div"), i.className = "beacon-pin-list-header", h.appendChild(i), s = document.createElement("div"), s.className = "beacon-pin-list", h.appendChild(s), d = document.createElement("button"), d.type = "button", d.className = "beacon-btn secondary beacon-pin-annotate", d.addEventListener("click", () => {
|
|
2012
|
+
g(f);
|
|
2013
|
+
}), h.appendChild(d), c = document.createElement("img"), c.className = "beacon-thumb", c.alt = "Annotated screenshot preview", c.style.display = "none", h.appendChild(c), E(), b(), () => {
|
|
2014
|
+
i = null, s = null, c = null, d = null;
|
|
1947
2015
|
})
|
|
1948
2016
|
};
|
|
1949
2017
|
},
|
|
@@ -1952,37 +2020,38 @@ function rn(e = {}) {
|
|
|
1952
2020
|
}
|
|
1953
2021
|
};
|
|
1954
2022
|
}
|
|
1955
|
-
function
|
|
2023
|
+
function ln(e) {
|
|
1956
2024
|
return !!e && typeof e == "object" && !("v" in e) && "error" in e;
|
|
1957
2025
|
}
|
|
1958
|
-
function
|
|
2026
|
+
function dn(e = {}) {
|
|
1959
2027
|
return {
|
|
1960
2028
|
name: "domSS",
|
|
1961
2029
|
async capture(t) {
|
|
1962
|
-
const n =
|
|
2030
|
+
const n = an();
|
|
1963
2031
|
if (n)
|
|
1964
2032
|
return { dataUrl: n.dataUrl, mime: n.mime };
|
|
1965
2033
|
const o = await t.requestMode("hide");
|
|
1966
2034
|
try {
|
|
1967
|
-
await new Promise((
|
|
1968
|
-
const
|
|
2035
|
+
await new Promise((i) => requestAnimationFrame(() => i()));
|
|
2036
|
+
const a = Array.from(document.querySelectorAll("launch-kit-beacon")), r = await _e({
|
|
1969
2037
|
quality: e.quality,
|
|
1970
2038
|
pixelRatio: e.pixelRatio,
|
|
1971
|
-
excludeHosts:
|
|
1972
|
-
})
|
|
1973
|
-
|
|
1974
|
-
h:
|
|
1975
|
-
|
|
1976
|
-
}
|
|
1977
|
-
|
|
2039
|
+
excludeHosts: a
|
|
2040
|
+
});
|
|
2041
|
+
try {
|
|
2042
|
+
const i = t.captured("domEle"), s = un(i), c = { w: r.width, h: r.height, dpr: r.pixelRatio }, d = e.accent ?? pn();
|
|
2043
|
+
return { dataUrl: s.length > 0 ? await Pe(r.dataUrl, s, c, d) : r.dataUrl, mime: "image/jpeg" };
|
|
2044
|
+
} finally {
|
|
2045
|
+
r.dispose();
|
|
2046
|
+
}
|
|
1978
2047
|
} finally {
|
|
1979
2048
|
o();
|
|
1980
2049
|
}
|
|
1981
2050
|
}
|
|
1982
2051
|
};
|
|
1983
2052
|
}
|
|
1984
|
-
function
|
|
1985
|
-
if (!e ||
|
|
2053
|
+
function un(e) {
|
|
2054
|
+
if (!e || ln(e)) return [];
|
|
1986
2055
|
const t = e.pins;
|
|
1987
2056
|
return Array.isArray(t) ? t.filter((n) => !!n && typeof n == "object").map((n) => ({
|
|
1988
2057
|
number: Number(n.number) || 0,
|
|
@@ -1990,19 +2059,19 @@ function cn(e) {
|
|
|
1990
2059
|
boundingRect: n.boundingRect ?? { x: 0, y: 0, w: 0, h: 0 }
|
|
1991
2060
|
})) : [];
|
|
1992
2061
|
}
|
|
1993
|
-
function
|
|
2062
|
+
function pn() {
|
|
1994
2063
|
if (typeof window > "u") return "#0ea5e9";
|
|
1995
2064
|
const e = document.querySelector("launch-kit-beacon");
|
|
1996
2065
|
return e && getComputedStyle(e).getPropertyValue("--beacon-accent").trim() || "#0ea5e9";
|
|
1997
2066
|
}
|
|
1998
|
-
const
|
|
1999
|
-
function
|
|
2000
|
-
const t = e.accent ??
|
|
2001
|
-
o.className = `${
|
|
2002
|
-
const r = document.createElement("div");
|
|
2003
|
-
r.className = `${ye} beacon-monitor-overlay-chip`, r.setAttribute("role", "status"), r.setAttribute("aria-label", "Recording — drag to move"), r.style.setProperty("--beacon-monitor-accent", t);
|
|
2067
|
+
const ve = "beacon-no-capture", xe = "__lsBeaconMonitorChipPos", fn = "#10b981";
|
|
2068
|
+
function mn(e) {
|
|
2069
|
+
const t = e.accent ?? fn, n = e.startedAt ?? Date.now(), o = document.createElement("div");
|
|
2070
|
+
o.className = `${ve} beacon-monitor-overlay-frame`, o.setAttribute("aria-hidden", "true"), o.style.setProperty("--beacon-monitor-accent", t), document.body.appendChild(o);
|
|
2004
2071
|
const a = document.createElement("div");
|
|
2005
|
-
a.className =
|
|
2072
|
+
a.className = `${ve} beacon-monitor-overlay-chip`, a.setAttribute("role", "status"), a.setAttribute("aria-label", "Recording — drag to move"), a.style.setProperty("--beacon-monitor-accent", t);
|
|
2073
|
+
const r = document.createElement("div");
|
|
2074
|
+
r.className = "beacon-monitor-overlay-chip-row";
|
|
2006
2075
|
const i = document.createElement("span");
|
|
2007
2076
|
i.className = "beacon-monitor-overlay-rec-dot", i.setAttribute("aria-hidden", "true");
|
|
2008
2077
|
const s = document.createElement("span");
|
|
@@ -2012,95 +2081,95 @@ function un(e) {
|
|
|
2012
2081
|
const d = document.createElement("span");
|
|
2013
2082
|
d.className = "beacon-monitor-overlay-timer", d.textContent = "00:00";
|
|
2014
2083
|
const l = document.createElement("button");
|
|
2015
|
-
l.type = "button", l.className = "beacon-monitor-overlay-stop", l.textContent = "Stop", l.setAttribute("aria-label", "Stop monitoring"),
|
|
2016
|
-
const
|
|
2017
|
-
|
|
2018
|
-
const
|
|
2019
|
-
|
|
2020
|
-
function
|
|
2084
|
+
l.type = "button", l.className = "beacon-monitor-overlay-stop", l.textContent = "Stop", l.setAttribute("aria-label", "Stop monitoring"), r.appendChild(i), r.appendChild(s), r.appendChild(c), r.appendChild(d), r.appendChild(l), a.appendChild(r);
|
|
2085
|
+
const m = document.createElement("div");
|
|
2086
|
+
m.className = "beacon-monitor-overlay-url", e.url ? (m.textContent = e.url, m.title = e.url) : m.style.display = "none", a.appendChild(m), document.body.appendChild(a);
|
|
2087
|
+
const p = g() ?? u();
|
|
2088
|
+
E(v(p));
|
|
2089
|
+
function g() {
|
|
2021
2090
|
try {
|
|
2022
|
-
const w = localStorage.getItem(
|
|
2091
|
+
const w = localStorage.getItem(xe);
|
|
2023
2092
|
if (!w) return null;
|
|
2024
|
-
const
|
|
2025
|
-
return !Number.isFinite(
|
|
2093
|
+
const L = JSON.parse(w), M = typeof L.x == "number" ? L.x : NaN, I = typeof L.y == "number" ? L.y : NaN;
|
|
2094
|
+
return !Number.isFinite(M) || !Number.isFinite(I) ? null : { x: M, y: I };
|
|
2026
2095
|
} catch {
|
|
2027
2096
|
return null;
|
|
2028
2097
|
}
|
|
2029
2098
|
}
|
|
2030
|
-
function
|
|
2031
|
-
const
|
|
2032
|
-
return { x: Math.max(8, Math.floor((window.innerWidth -
|
|
2099
|
+
function u() {
|
|
2100
|
+
const L = a.getBoundingClientRect().width || 200;
|
|
2101
|
+
return { x: Math.max(8, Math.floor((window.innerWidth - L) / 2)), y: 16 };
|
|
2033
2102
|
}
|
|
2034
|
-
function
|
|
2035
|
-
const
|
|
2103
|
+
function v(w) {
|
|
2104
|
+
const M = a.getBoundingClientRect(), I = M.width || 200, Ve = M.height || 40, We = Math.max(8, window.innerWidth - I - 8), Ye = Math.max(8, window.innerHeight - Ve - 8);
|
|
2036
2105
|
return {
|
|
2037
|
-
x: Math.min(Math.max(8, w.x),
|
|
2038
|
-
y: Math.min(Math.max(8, w.y),
|
|
2106
|
+
x: Math.min(Math.max(8, w.x), We),
|
|
2107
|
+
y: Math.min(Math.max(8, w.y), Ye)
|
|
2039
2108
|
};
|
|
2040
2109
|
}
|
|
2041
|
-
function
|
|
2042
|
-
|
|
2110
|
+
function E(w) {
|
|
2111
|
+
a.style.left = `${w.x}px`, a.style.top = `${w.y}px`;
|
|
2043
2112
|
}
|
|
2044
|
-
let
|
|
2045
|
-
function
|
|
2113
|
+
let b = !1, f = null, h = { x: 0, y: 0 };
|
|
2114
|
+
function y(w) {
|
|
2046
2115
|
if (w.target instanceof Element && w.target.closest(".beacon-monitor-overlay-stop")) return;
|
|
2047
|
-
w.preventDefault(),
|
|
2116
|
+
w.preventDefault(), b = !0, f = w.pointerId;
|
|
2048
2117
|
try {
|
|
2049
|
-
|
|
2118
|
+
a.setPointerCapture(w.pointerId);
|
|
2050
2119
|
} catch {
|
|
2051
2120
|
}
|
|
2052
|
-
|
|
2053
|
-
const
|
|
2054
|
-
h = { x: w.clientX -
|
|
2121
|
+
a.setAttribute("data-dragging", "true");
|
|
2122
|
+
const L = a.getBoundingClientRect();
|
|
2123
|
+
h = { x: w.clientX - L.left, y: w.clientY - L.top };
|
|
2055
2124
|
}
|
|
2056
2125
|
function C(w) {
|
|
2057
|
-
!
|
|
2126
|
+
!b || w.pointerId !== f || E(v({ x: w.clientX - h.x, y: w.clientY - h.y }));
|
|
2058
2127
|
}
|
|
2059
|
-
function
|
|
2060
|
-
if (!
|
|
2061
|
-
|
|
2128
|
+
function k(w) {
|
|
2129
|
+
if (!b || w.pointerId !== f) return;
|
|
2130
|
+
b = !1, f = null, a.removeAttribute("data-dragging");
|
|
2062
2131
|
try {
|
|
2063
|
-
|
|
2132
|
+
a.releasePointerCapture(w.pointerId);
|
|
2064
2133
|
} catch {
|
|
2065
2134
|
}
|
|
2066
|
-
const
|
|
2135
|
+
const L = a.getBoundingClientRect();
|
|
2067
2136
|
try {
|
|
2068
|
-
localStorage.setItem(
|
|
2137
|
+
localStorage.setItem(xe, JSON.stringify({ x: L.left, y: L.top }));
|
|
2069
2138
|
} catch {
|
|
2070
2139
|
}
|
|
2071
2140
|
}
|
|
2072
|
-
|
|
2141
|
+
a.addEventListener("pointerdown", y), a.addEventListener("pointermove", C), a.addEventListener("pointerup", k), a.addEventListener("pointercancel", k), l.addEventListener("click", (w) => {
|
|
2073
2142
|
w.stopPropagation(), e.onStop();
|
|
2074
2143
|
});
|
|
2075
|
-
function
|
|
2076
|
-
const w =
|
|
2077
|
-
|
|
2144
|
+
function S() {
|
|
2145
|
+
const w = a.getBoundingClientRect();
|
|
2146
|
+
E(v({ x: w.left, y: w.top }));
|
|
2078
2147
|
}
|
|
2079
|
-
window.addEventListener("resize",
|
|
2080
|
-
function
|
|
2148
|
+
window.addEventListener("resize", S);
|
|
2149
|
+
function A() {
|
|
2081
2150
|
const w = Math.max(0, Math.floor((Date.now() - n) / 1e3));
|
|
2082
|
-
d.textContent =
|
|
2151
|
+
d.textContent = hn(w);
|
|
2083
2152
|
}
|
|
2084
|
-
|
|
2085
|
-
const N = window.setInterval(
|
|
2153
|
+
A();
|
|
2154
|
+
const N = window.setInterval(A, 1e3);
|
|
2086
2155
|
return {
|
|
2087
2156
|
updateUrl(w) {
|
|
2088
|
-
w ? (
|
|
2157
|
+
w ? (m.textContent = w, m.title = w, m.style.display = "") : m.style.display = "none";
|
|
2089
2158
|
},
|
|
2090
2159
|
destroy() {
|
|
2091
|
-
window.clearInterval(N), window.removeEventListener("resize",
|
|
2160
|
+
window.clearInterval(N), window.removeEventListener("resize", S), a.removeEventListener("pointerdown", y), a.removeEventListener("pointermove", C), a.removeEventListener("pointerup", k), a.removeEventListener("pointercancel", k), o.remove(), a.remove();
|
|
2092
2161
|
}
|
|
2093
2162
|
};
|
|
2094
2163
|
}
|
|
2095
|
-
function
|
|
2164
|
+
function hn(e) {
|
|
2096
2165
|
const t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), o = e % 60;
|
|
2097
|
-
return t > 0 ? `${
|
|
2166
|
+
return t > 0 ? `${$(t)}:${$(n)}:${$(o)}` : `${$(n)}:${$(o)}`;
|
|
2098
2167
|
}
|
|
2099
|
-
function
|
|
2168
|
+
function $(e) {
|
|
2100
2169
|
return e < 10 ? `0${e}` : String(e);
|
|
2101
2170
|
}
|
|
2102
|
-
const O = 80,
|
|
2103
|
-
function
|
|
2171
|
+
const O = 80, bn = 'button, a, input[type="submit"], input[type="button"], [role="button"], [role="link"], [role="menuitem"], [role="tab"], [role="option"]', gn = 1024, yn = 5;
|
|
2172
|
+
function vn(e, t) {
|
|
2104
2173
|
return e.length > t ? e.slice(0, t) : e;
|
|
2105
2174
|
}
|
|
2106
2175
|
function ee(e) {
|
|
@@ -2108,8 +2177,8 @@ function ee(e) {
|
|
|
2108
2177
|
const t = [];
|
|
2109
2178
|
let n = e;
|
|
2110
2179
|
for (let o = 0; o < 5 && n; o++) {
|
|
2111
|
-
const
|
|
2112
|
-
if (t.unshift(`${
|
|
2180
|
+
const a = n.tagName.toLowerCase(), r = n.id ? `#${CSS.escape(n.id)}` : "", i = n.classList.length > 0 ? "." + Array.from(n.classList).slice(0, 3).map(CSS.escape).join(".") : "";
|
|
2181
|
+
if (t.unshift(`${a}${r}${i}`), r) break;
|
|
2113
2182
|
n = n.parentElement;
|
|
2114
2183
|
}
|
|
2115
2184
|
return t.join(" > ");
|
|
@@ -2120,12 +2189,12 @@ function H(e, t) {
|
|
|
2120
2189
|
if (n)
|
|
2121
2190
|
return n.length > t ? n.slice(0, t) : n;
|
|
2122
2191
|
}
|
|
2123
|
-
function
|
|
2124
|
-
const t = H(e.textContent, O), n = H(e.getAttribute("aria-label"), O), o = e.getAttribute("data-testid") || void 0,
|
|
2125
|
-
let
|
|
2126
|
-
if (!
|
|
2127
|
-
const i = e.closest(
|
|
2128
|
-
i && i !== e && (
|
|
2192
|
+
function we(e) {
|
|
2193
|
+
const t = H(e.textContent, O), n = H(e.getAttribute("aria-label"), O), o = e.getAttribute("data-testid") || void 0, a = e.getAttribute("name") || void 0;
|
|
2194
|
+
let r = n || t;
|
|
2195
|
+
if (!r) {
|
|
2196
|
+
const i = e.closest(bn);
|
|
2197
|
+
i && i !== e && (r = H(i.getAttribute("aria-label"), O) || H(i.textContent, O));
|
|
2129
2198
|
}
|
|
2130
2199
|
return {
|
|
2131
2200
|
tag: e.tagName.toLowerCase(),
|
|
@@ -2136,52 +2205,52 @@ function xe(e) {
|
|
|
2136
2205
|
...t ? { text: t } : {},
|
|
2137
2206
|
...n ? { ariaLabel: n } : {},
|
|
2138
2207
|
...o ? { testid: o } : {},
|
|
2139
|
-
...
|
|
2208
|
+
...a ? { name: a } : {},
|
|
2140
2209
|
// Only include label when it adds something beyond `text` (avoids dup).
|
|
2141
|
-
...
|
|
2210
|
+
...r && r !== t ? { label: r } : {}
|
|
2142
2211
|
};
|
|
2143
2212
|
}
|
|
2144
|
-
function
|
|
2213
|
+
function xn(e, t) {
|
|
2145
2214
|
const n = [], o = document.querySelectorAll("body *");
|
|
2146
|
-
for (const
|
|
2147
|
-
const
|
|
2148
|
-
if (
|
|
2149
|
-
const i =
|
|
2215
|
+
for (const a of Array.from(o)) {
|
|
2216
|
+
const r = getComputedStyle(a);
|
|
2217
|
+
if (r.position !== "fixed" && r.position !== "sticky") continue;
|
|
2218
|
+
const i = a.getBoundingClientRect();
|
|
2150
2219
|
if (e < i.left || e > i.right || t < i.top || t > i.bottom) continue;
|
|
2151
|
-
const s = parseInt(
|
|
2152
|
-
!Number.isFinite(s) &&
|
|
2153
|
-
tag:
|
|
2220
|
+
const s = parseInt(r.zIndex, 10);
|
|
2221
|
+
!Number.isFinite(s) && r.zIndex !== "auto" || n.push({
|
|
2222
|
+
tag: a.tagName.toLowerCase(),
|
|
2154
2223
|
zIndex: Number.isFinite(s) ? s : 0,
|
|
2155
|
-
pointerEvents:
|
|
2156
|
-
classes: Array.from(
|
|
2224
|
+
pointerEvents: r.pointerEvents,
|
|
2225
|
+
classes: Array.from(a.classList).slice(0, 5).join(" ")
|
|
2157
2226
|
});
|
|
2158
2227
|
}
|
|
2159
|
-
return n.sort((
|
|
2228
|
+
return n.sort((a, r) => r.zIndex - a.zIndex).slice(0, yn);
|
|
2160
2229
|
}
|
|
2161
|
-
function
|
|
2162
|
-
const t = (
|
|
2163
|
-
const i =
|
|
2230
|
+
function wn(e) {
|
|
2231
|
+
const t = (a) => (r) => {
|
|
2232
|
+
const i = r, s = i.target;
|
|
2164
2233
|
if (!(s instanceof Element)) return;
|
|
2165
|
-
const c = i.clientX, d = i.clientY, l = document.elementFromPoint(c, d),
|
|
2234
|
+
const c = i.clientX, d = i.clientY, l = document.elementFromPoint(c, d), m = l === s || (l ? s.contains(l) || l.contains(s) : !1), p = document.querySelectorAll('[role="dialog"][data-state="open"]').length, g = getComputedStyle(document.body).pointerEvents, u = m ? [] : xn(c, d);
|
|
2166
2235
|
e.emitClick({
|
|
2167
|
-
kind:
|
|
2168
|
-
target:
|
|
2169
|
-
hitMatchesTarget:
|
|
2170
|
-
...!
|
|
2236
|
+
kind: a,
|
|
2237
|
+
target: we(s),
|
|
2238
|
+
hitMatchesTarget: m,
|
|
2239
|
+
...!m && l instanceof Element ? { hitTarget: we(l) } : {},
|
|
2171
2240
|
coords: { x: c, y: d },
|
|
2172
|
-
openDialogs:
|
|
2173
|
-
bodyPointerEvents:
|
|
2174
|
-
...
|
|
2241
|
+
openDialogs: p,
|
|
2242
|
+
bodyPointerEvents: g,
|
|
2243
|
+
...u.length > 0 ? { overlaysAtPoint: u } : {}
|
|
2175
2244
|
});
|
|
2176
2245
|
}, n = t("click"), o = t("mousedown");
|
|
2177
2246
|
return document.addEventListener("click", n, { capture: !0, passive: !0 }), document.addEventListener("mousedown", o, { capture: !0, passive: !0 }), () => {
|
|
2178
2247
|
document.removeEventListener("click", n, { capture: !0 }), document.removeEventListener("mousedown", o, { capture: !0 });
|
|
2179
2248
|
};
|
|
2180
2249
|
}
|
|
2181
|
-
function
|
|
2250
|
+
function En(e) {
|
|
2182
2251
|
const t = history.pushState, n = history.replaceState;
|
|
2183
2252
|
let o = window.location.href;
|
|
2184
|
-
const
|
|
2253
|
+
const a = (s) => {
|
|
2185
2254
|
const c = window.location.href;
|
|
2186
2255
|
if (c === o) return;
|
|
2187
2256
|
const d = o;
|
|
@@ -2189,43 +2258,43 @@ function vn(e) {
|
|
|
2189
2258
|
};
|
|
2190
2259
|
history.pushState = function(...c) {
|
|
2191
2260
|
const d = t.apply(this, c);
|
|
2192
|
-
return
|
|
2261
|
+
return a("pushState"), d;
|
|
2193
2262
|
}, history.replaceState = function(...c) {
|
|
2194
2263
|
const d = n.apply(this, c);
|
|
2195
|
-
return
|
|
2264
|
+
return a("replaceState"), d;
|
|
2196
2265
|
};
|
|
2197
|
-
const
|
|
2198
|
-
return window.addEventListener("popstate",
|
|
2199
|
-
history.pushState = t, history.replaceState = n, window.removeEventListener("popstate",
|
|
2266
|
+
const r = () => a("popstate"), i = () => a("hashchange");
|
|
2267
|
+
return window.addEventListener("popstate", r), window.addEventListener("hashchange", i), () => {
|
|
2268
|
+
history.pushState = t, history.replaceState = n, window.removeEventListener("popstate", r), window.removeEventListener("hashchange", i);
|
|
2200
2269
|
};
|
|
2201
2270
|
}
|
|
2202
|
-
function
|
|
2203
|
-
const t = /* @__PURE__ */ new WeakSet(), n = (
|
|
2204
|
-
const i = ee(
|
|
2271
|
+
function Sn(e) {
|
|
2272
|
+
const t = /* @__PURE__ */ new WeakSet(), n = (a, r) => {
|
|
2273
|
+
const i = ee(a);
|
|
2205
2274
|
e.emitDialog({
|
|
2206
2275
|
kind: "dialog",
|
|
2207
|
-
action:
|
|
2276
|
+
action: r,
|
|
2208
2277
|
selector: i,
|
|
2209
|
-
state:
|
|
2210
|
-
...
|
|
2278
|
+
state: a.getAttribute("data-state"),
|
|
2279
|
+
...r === "mount" ? { outerHTML: vn(a.outerHTML, gn) } : {}
|
|
2211
2280
|
});
|
|
2212
2281
|
};
|
|
2213
|
-
for (const
|
|
2214
|
-
t.add(
|
|
2215
|
-
const o = new MutationObserver((
|
|
2216
|
-
var
|
|
2217
|
-
for (const d of
|
|
2282
|
+
for (const a of Array.from(document.querySelectorAll('[role="dialog"]')))
|
|
2283
|
+
t.add(a);
|
|
2284
|
+
const o = new MutationObserver((a) => {
|
|
2285
|
+
var r, i, s, c;
|
|
2286
|
+
for (const d of a) {
|
|
2218
2287
|
for (const l of Array.from(d.addedNodes)) {
|
|
2219
2288
|
if (!(l instanceof Element)) continue;
|
|
2220
|
-
const
|
|
2221
|
-
for (const
|
|
2222
|
-
t.has(
|
|
2289
|
+
const m = (r = l.matches) != null && r.call(l, '[role="dialog"]') ? [l] : Array.from(((i = l.querySelectorAll) == null ? void 0 : i.call(l, '[role="dialog"]')) ?? []);
|
|
2290
|
+
for (const p of m)
|
|
2291
|
+
t.has(p) || (t.add(p), n(p, "mount"));
|
|
2223
2292
|
}
|
|
2224
2293
|
for (const l of Array.from(d.removedNodes)) {
|
|
2225
2294
|
if (!(l instanceof Element)) continue;
|
|
2226
|
-
const
|
|
2227
|
-
for (const
|
|
2228
|
-
t.has(
|
|
2295
|
+
const m = (s = l.matches) != null && s.call(l, '[role="dialog"]') ? [l] : Array.from(((c = l.querySelectorAll) == null ? void 0 : c.call(l, '[role="dialog"]')) ?? []);
|
|
2296
|
+
for (const p of m)
|
|
2297
|
+
t.has(p) && (t.delete(p), n(p, "unmount"));
|
|
2229
2298
|
}
|
|
2230
2299
|
d.type === "attributes" && d.attributeName === "data-state" && d.target instanceof Element && d.target.getAttribute("role") === "dialog" && n(d.target, "state");
|
|
2231
2300
|
}
|
|
@@ -2237,16 +2306,16 @@ function xn(e) {
|
|
|
2237
2306
|
attributeFilter: ["data-state"]
|
|
2238
2307
|
}), () => o.disconnect();
|
|
2239
2308
|
}
|
|
2240
|
-
function
|
|
2309
|
+
function Cn(e) {
|
|
2241
2310
|
const t = (n) => {
|
|
2242
2311
|
const o = n.target;
|
|
2243
2312
|
if (!(o instanceof HTMLFormElement)) return;
|
|
2244
|
-
const
|
|
2245
|
-
for (const
|
|
2246
|
-
if (!(
|
|
2247
|
-
const i =
|
|
2313
|
+
const a = [];
|
|
2314
|
+
for (const r of Array.from(o.elements)) {
|
|
2315
|
+
if (!(r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement)) continue;
|
|
2316
|
+
const i = r.getAttribute("name") || "<unnamed>", s = r instanceof HTMLInputElement ? r.type : r.tagName.toLowerCase();
|
|
2248
2317
|
let c;
|
|
2249
|
-
|
|
2318
|
+
r instanceof HTMLInputElement && (r.type === "checkbox" || r.type === "radio") ? c = r.checked : c = !!r.value, a.push({ name: i, type: s, hasValue: c });
|
|
2250
2319
|
}
|
|
2251
2320
|
e.emitSubmit({
|
|
2252
2321
|
kind: "submit",
|
|
@@ -2255,128 +2324,128 @@ function wn(e) {
|
|
|
2255
2324
|
action: o.getAttribute("action") || null,
|
|
2256
2325
|
method: (o.getAttribute("method") || "GET").toUpperCase(),
|
|
2257
2326
|
selector: ee(o),
|
|
2258
|
-
fields:
|
|
2327
|
+
fields: a
|
|
2259
2328
|
}
|
|
2260
2329
|
});
|
|
2261
2330
|
};
|
|
2262
2331
|
return document.addEventListener("submit", t, { capture: !0 }), () => document.removeEventListener("submit", t, { capture: !0 });
|
|
2263
2332
|
}
|
|
2264
|
-
function
|
|
2265
|
-
const t =
|
|
2333
|
+
function kn(e) {
|
|
2334
|
+
const t = wn(e), n = En(e), o = Sn(e), a = Cn(e);
|
|
2266
2335
|
return {
|
|
2267
2336
|
uninstall() {
|
|
2268
|
-
t(), n(), o(),
|
|
2337
|
+
t(), n(), o(), a();
|
|
2269
2338
|
}
|
|
2270
2339
|
};
|
|
2271
2340
|
}
|
|
2272
|
-
const
|
|
2341
|
+
const K = 1e3, Ee = 10 * 1024, De = "[REDACTED]", $e = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]), An = [
|
|
2273
2342
|
/Bearer\s+[A-Za-z0-9._\-+/=]+/gi,
|
|
2274
2343
|
/\bls_pat_[A-Za-z0-9_]+/g,
|
|
2275
2344
|
// JWT: three dot-separated base64url segments starting with eyJ (the b64
|
|
2276
2345
|
// encoding of the JSON {"). Matches Auth0/Clerk/most providers' tokens.
|
|
2277
2346
|
/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g
|
|
2278
|
-
],
|
|
2347
|
+
], Ln = /^(password|passwd|secret|token|api[_-]?key|auth|access[_-]?token|refresh[_-]?token|client[_-]?secret|private[_-]?key)$/i;
|
|
2279
2348
|
function G(e, t) {
|
|
2280
2349
|
return e.length > t ? e.slice(0, t) : e;
|
|
2281
2350
|
}
|
|
2282
|
-
function
|
|
2351
|
+
function Be(e) {
|
|
2283
2352
|
let t = e;
|
|
2284
|
-
for (const n of
|
|
2285
|
-
t = t.replace(n,
|
|
2353
|
+
for (const n of An)
|
|
2354
|
+
t = t.replace(n, De);
|
|
2286
2355
|
return t;
|
|
2287
2356
|
}
|
|
2288
2357
|
function J(e) {
|
|
2289
2358
|
if (e === null || typeof e != "object")
|
|
2290
|
-
return typeof e == "string" ?
|
|
2359
|
+
return typeof e == "string" ? Be(e) : e;
|
|
2291
2360
|
if (Array.isArray(e)) return e.map(J);
|
|
2292
2361
|
const t = {};
|
|
2293
2362
|
for (const [n, o] of Object.entries(e))
|
|
2294
|
-
t[n] =
|
|
2363
|
+
t[n] = Ln.test(n) ? De : J(o);
|
|
2295
2364
|
return t;
|
|
2296
2365
|
}
|
|
2297
|
-
function
|
|
2366
|
+
function Se(e, t) {
|
|
2298
2367
|
if (t && t.includes("application/json"))
|
|
2299
2368
|
try {
|
|
2300
2369
|
const n = JSON.parse(e);
|
|
2301
2370
|
return JSON.stringify(J(n));
|
|
2302
2371
|
} catch {
|
|
2303
2372
|
}
|
|
2304
|
-
return
|
|
2373
|
+
return Be(e);
|
|
2305
2374
|
}
|
|
2306
|
-
function
|
|
2375
|
+
function q(e, t) {
|
|
2307
2376
|
const n = e.length, o = { bodySize: n };
|
|
2308
|
-
return n >
|
|
2377
|
+
return n > Ee ? (o.body = Se(e.slice(0, Ee), t), o.bodyTruncated = !0) : o.body = Se(e, t), t && (o.contentType = t), o;
|
|
2309
2378
|
}
|
|
2310
|
-
function
|
|
2379
|
+
function Tn(e, t) {
|
|
2311
2380
|
const n = t == null ? void 0 : t.body;
|
|
2312
2381
|
if (n != null) {
|
|
2313
2382
|
if (typeof n == "string") return n;
|
|
2314
2383
|
if (n instanceof URLSearchParams) return n.toString();
|
|
2315
2384
|
if (n instanceof FormData) {
|
|
2316
2385
|
const o = [];
|
|
2317
|
-
return n.forEach((
|
|
2318
|
-
o.push(`${
|
|
2386
|
+
return n.forEach((a, r) => {
|
|
2387
|
+
o.push(`${r}=${typeof a == "string" ? `[${a.length}b]` : "[file]"}`);
|
|
2319
2388
|
}), `[FormData] ${o.join("&")}`;
|
|
2320
2389
|
}
|
|
2321
2390
|
return n instanceof Blob ? `[Blob ${n.size}b ${n.type || "unknown"}]` : n instanceof ArrayBuffer ? `[binary ${n.byteLength}b]` : ArrayBuffer.isView(n) ? `[binary ${n.byteLength}b]` : null;
|
|
2322
2391
|
}
|
|
2323
2392
|
return e instanceof Request, null;
|
|
2324
2393
|
}
|
|
2325
|
-
function
|
|
2326
|
-
return !!(((o) => o ? o instanceof Headers ? o.has("authorization") : Array.isArray(o) ? o.some(([
|
|
2394
|
+
function Nn(e, t) {
|
|
2395
|
+
return !!(((o) => o ? o instanceof Headers ? o.has("authorization") : Array.isArray(o) ? o.some(([a]) => a.toLowerCase() === "authorization") : typeof o == "object" ? Object.keys(o).some((a) => a.toLowerCase() === "authorization") : !1 : !1)(t == null ? void 0 : t.headers) || e instanceof Request && e.headers.has("authorization"));
|
|
2327
2396
|
}
|
|
2328
|
-
function
|
|
2397
|
+
function Mn(e, t) {
|
|
2329
2398
|
return ((o) => {
|
|
2330
2399
|
if (o) {
|
|
2331
2400
|
if (o instanceof Headers) return o.get("content-type") || void 0;
|
|
2332
2401
|
if (Array.isArray(o)) {
|
|
2333
|
-
const
|
|
2334
|
-
return
|
|
2402
|
+
const a = o.find(([r]) => r.toLowerCase() === "content-type");
|
|
2403
|
+
return a ? a[1] : void 0;
|
|
2335
2404
|
}
|
|
2336
2405
|
if (typeof o == "object") {
|
|
2337
|
-
for (const [
|
|
2338
|
-
if (
|
|
2406
|
+
for (const [a, r] of Object.entries(o))
|
|
2407
|
+
if (a.toLowerCase() === "content-type") return r;
|
|
2339
2408
|
}
|
|
2340
2409
|
}
|
|
2341
2410
|
})(t == null ? void 0 : t.headers) ?? (e instanceof Request && e.headers.get("content-type") || void 0);
|
|
2342
2411
|
}
|
|
2343
|
-
function
|
|
2344
|
-
if (
|
|
2345
|
-
const o =
|
|
2346
|
-
if (
|
|
2347
|
-
const
|
|
2412
|
+
function In(e, t, n) {
|
|
2413
|
+
if (!$e.has(n)) return;
|
|
2414
|
+
const o = Nn(e, t), a = Tn(e, t);
|
|
2415
|
+
if (a == null && !o) return;
|
|
2416
|
+
const r = Mn(e, t), i = a != null ? q(a, r) : {};
|
|
2348
2417
|
return o && (i.hasAuth = !0), i;
|
|
2349
2418
|
}
|
|
2350
|
-
function
|
|
2419
|
+
function Rn(e) {
|
|
2351
2420
|
const t = window.fetch;
|
|
2352
2421
|
if (typeof t != "function") return () => {
|
|
2353
2422
|
};
|
|
2354
|
-
const n = async (o,
|
|
2355
|
-
const
|
|
2423
|
+
const n = async (o, a) => {
|
|
2424
|
+
const r = performance.now(), i = ((a == null ? void 0 : a.method) ?? (o instanceof Request ? o.method : "GET")).toUpperCase(), s = typeof o == "string" ? o : o instanceof URL ? o.toString() : o.url, c = In(o, a, i);
|
|
2356
2425
|
try {
|
|
2357
|
-
const d = await t.call(window, o,
|
|
2358
|
-
let
|
|
2359
|
-
if (
|
|
2426
|
+
const d = await t.call(window, o, a), l = Math.round(performance.now() - r), m = d.status >= 400;
|
|
2427
|
+
let p;
|
|
2428
|
+
if (m || e.verbose)
|
|
2360
2429
|
try {
|
|
2361
|
-
const
|
|
2362
|
-
|
|
2430
|
+
const g = await d.clone().text(), u = d.headers.get("content-type") || void 0;
|
|
2431
|
+
p = q(g, u);
|
|
2363
2432
|
} catch {
|
|
2364
2433
|
}
|
|
2365
|
-
return (
|
|
2434
|
+
return (m || e.verbose) && e.emit({
|
|
2366
2435
|
kind: "fetch",
|
|
2367
|
-
url: G(s,
|
|
2436
|
+
url: G(s, K),
|
|
2368
2437
|
method: i,
|
|
2369
2438
|
status: d.status,
|
|
2370
2439
|
durationMs: l,
|
|
2371
|
-
failed:
|
|
2440
|
+
failed: m,
|
|
2372
2441
|
...c ? { request: c } : {},
|
|
2373
|
-
...
|
|
2442
|
+
...p ? { response: p } : {}
|
|
2374
2443
|
}), d;
|
|
2375
2444
|
} catch (d) {
|
|
2376
|
-
const l = Math.round(performance.now() -
|
|
2445
|
+
const l = Math.round(performance.now() - r);
|
|
2377
2446
|
throw e.emit({
|
|
2378
2447
|
kind: "fetch",
|
|
2379
|
-
url: G(s,
|
|
2448
|
+
url: G(s, K),
|
|
2380
2449
|
method: i,
|
|
2381
2450
|
status: 0,
|
|
2382
2451
|
durationMs: l,
|
|
@@ -2390,7 +2459,7 @@ function Tn(e) {
|
|
|
2390
2459
|
window.fetch.__lsBeaconWrapped && (window.fetch = t);
|
|
2391
2460
|
};
|
|
2392
2461
|
}
|
|
2393
|
-
function
|
|
2462
|
+
function Pn(e) {
|
|
2394
2463
|
if (e == null) return null;
|
|
2395
2464
|
if (typeof e == "string") return e;
|
|
2396
2465
|
if (e instanceof URLSearchParams) return e.toString();
|
|
@@ -2402,88 +2471,88 @@ function Mn(e) {
|
|
|
2402
2471
|
}
|
|
2403
2472
|
return e instanceof Blob ? `[Blob ${e.size}b ${e.type || "unknown"}]` : e instanceof ArrayBuffer ? `[binary ${e.byteLength}b]` : ArrayBuffer.isView(e) ? `[binary ${e.byteLength}b]` : null;
|
|
2404
2473
|
}
|
|
2405
|
-
function
|
|
2406
|
-
const t = XMLHttpRequest.prototype, n = t.open, o = t.send,
|
|
2474
|
+
function _n(e) {
|
|
2475
|
+
const t = XMLHttpRequest.prototype, n = t.open, o = t.send, a = t.setRequestHeader, r = /* @__PURE__ */ new WeakMap();
|
|
2407
2476
|
return t.open = function(s, c, ...d) {
|
|
2408
|
-
return
|
|
2477
|
+
return r.set(this, {
|
|
2409
2478
|
method: s.toUpperCase(),
|
|
2410
2479
|
url: typeof c == "string" ? c : c.toString(),
|
|
2411
2480
|
start: 0,
|
|
2412
2481
|
hasAuth: !1
|
|
2413
2482
|
}), n.call(this, s, c, ...d);
|
|
2414
2483
|
}, t.setRequestHeader = function(s, c) {
|
|
2415
|
-
const d =
|
|
2484
|
+
const d = r.get(this);
|
|
2416
2485
|
if (d) {
|
|
2417
2486
|
const l = s.toLowerCase();
|
|
2418
2487
|
l === "authorization" ? d.hasAuth = !0 : l === "content-type" && (d.requestContentType = c);
|
|
2419
2488
|
}
|
|
2420
|
-
return
|
|
2489
|
+
return a.call(this, s, c);
|
|
2421
2490
|
}, t.send = function(s) {
|
|
2422
|
-
const c =
|
|
2491
|
+
const c = r.get(this);
|
|
2423
2492
|
if (c)
|
|
2424
|
-
if (c.start = performance.now(),
|
|
2425
|
-
const l =
|
|
2426
|
-
l != null ? c.request =
|
|
2493
|
+
if (c.start = performance.now(), $e.has(c.method)) {
|
|
2494
|
+
const l = Pn(s);
|
|
2495
|
+
l != null ? c.request = q(l, c.requestContentType) : c.request = {}, c.hasAuth && (c.request.hasAuth = !0);
|
|
2427
2496
|
} else c.hasAuth && (c.request = { hasAuth: !0 });
|
|
2428
2497
|
const d = () => {
|
|
2429
2498
|
this.removeEventListener("loadend", d);
|
|
2430
|
-
const l =
|
|
2499
|
+
const l = r.get(this);
|
|
2431
2500
|
if (!l) return;
|
|
2432
|
-
const
|
|
2433
|
-
let
|
|
2434
|
-
if ((
|
|
2501
|
+
const m = Math.round(performance.now() - l.start), p = this.status === 0 || this.status >= 400;
|
|
2502
|
+
let g;
|
|
2503
|
+
if ((p || e.verbose) && this.status > 0)
|
|
2435
2504
|
try {
|
|
2436
|
-
const
|
|
2437
|
-
if (
|
|
2438
|
-
const
|
|
2439
|
-
|
|
2505
|
+
const u = this.responseType === "" || this.responseType === "text" ? this.responseText : "";
|
|
2506
|
+
if (u) {
|
|
2507
|
+
const v = this.getResponseHeader("content-type") || void 0;
|
|
2508
|
+
g = q(u, v);
|
|
2440
2509
|
}
|
|
2441
2510
|
} catch {
|
|
2442
2511
|
}
|
|
2443
|
-
(
|
|
2512
|
+
(p || e.verbose) && e.emit({
|
|
2444
2513
|
kind: "xhr",
|
|
2445
|
-
url: G(l.url,
|
|
2514
|
+
url: G(l.url, K),
|
|
2446
2515
|
method: l.method,
|
|
2447
2516
|
status: this.status,
|
|
2448
|
-
durationMs:
|
|
2449
|
-
failed:
|
|
2517
|
+
durationMs: m,
|
|
2518
|
+
failed: p,
|
|
2450
2519
|
...l.request ? { request: l.request } : {},
|
|
2451
|
-
...
|
|
2452
|
-
}),
|
|
2520
|
+
...g ? { response: g } : {}
|
|
2521
|
+
}), r.delete(this);
|
|
2453
2522
|
};
|
|
2454
2523
|
return this.addEventListener("loadend", d), o.call(this, s);
|
|
2455
2524
|
}, () => {
|
|
2456
|
-
t.open = n, t.send = o, t.setRequestHeader =
|
|
2525
|
+
t.open = n, t.send = o, t.setRequestHeader = a;
|
|
2457
2526
|
};
|
|
2458
2527
|
}
|
|
2459
|
-
function
|
|
2460
|
-
const t =
|
|
2528
|
+
function Dn(e) {
|
|
2529
|
+
const t = Rn(e), n = _n(e);
|
|
2461
2530
|
return {
|
|
2462
2531
|
uninstall() {
|
|
2463
2532
|
t(), n();
|
|
2464
2533
|
}
|
|
2465
2534
|
};
|
|
2466
2535
|
}
|
|
2467
|
-
const
|
|
2468
|
-
class
|
|
2536
|
+
const $n = 1e3, Ce = 50, Bn = 500;
|
|
2537
|
+
class zn {
|
|
2469
2538
|
constructor(t) {
|
|
2470
2539
|
this.buffer = [], this.inflight = !1, this.timer = null, this.destroyed = !1, this.handleVisibilityChange = () => {
|
|
2471
2540
|
document.visibilityState === "hidden" && this.flushSync();
|
|
2472
2541
|
}, this.url = t.url, this.sessionId = t.sessionId, this.onError = t.onError, this.timer = setInterval(() => {
|
|
2473
2542
|
this.flush();
|
|
2474
|
-
},
|
|
2543
|
+
}, $n), this.pagehideHandler = () => this.flushSync(), window.addEventListener("pagehide", this.pagehideHandler), document.addEventListener("visibilitychange", this.handleVisibilityChange);
|
|
2475
2544
|
}
|
|
2476
2545
|
enqueue(t) {
|
|
2477
|
-
this.destroyed || (this.buffer.push(t), this.buffer.length >
|
|
2546
|
+
this.destroyed || (this.buffer.push(t), this.buffer.length > Bn && this.buffer.shift(), this.buffer.length >= Ce && this.flush());
|
|
2478
2547
|
}
|
|
2479
2548
|
/** Async flush via fetch. No-op when in-flight or empty. */
|
|
2480
2549
|
async flush() {
|
|
2481
|
-
var o,
|
|
2550
|
+
var o, a;
|
|
2482
2551
|
if (this.destroyed || this.inflight || this.buffer.length === 0) return;
|
|
2483
|
-
const t = this.buffer.splice(0,
|
|
2552
|
+
const t = this.buffer.splice(0, Ce), n = this.makeBatch(t);
|
|
2484
2553
|
this.inflight = !0;
|
|
2485
2554
|
try {
|
|
2486
|
-
const
|
|
2555
|
+
const r = await fetch(this.url, {
|
|
2487
2556
|
method: "POST",
|
|
2488
2557
|
// credentials:'omit' — going to the dev's local server, not the app
|
|
2489
2558
|
// backend; avoid leaking session cookies cross-origin.
|
|
@@ -2494,9 +2563,9 @@ class Dn {
|
|
|
2494
2563
|
// pagehide didn't fire (e.g. a window.location.assign from script).
|
|
2495
2564
|
keepalive: !0
|
|
2496
2565
|
});
|
|
2497
|
-
|
|
2498
|
-
} catch (
|
|
2499
|
-
(
|
|
2566
|
+
r.ok || (o = this.onError) == null || o.call(this, new Error(`monitor flush: HTTP ${r.status}`));
|
|
2567
|
+
} catch (r) {
|
|
2568
|
+
(a = this.onError) == null || a.call(this, r instanceof Error ? r : new Error(String(r)));
|
|
2500
2569
|
} finally {
|
|
2501
2570
|
this.inflight = !1;
|
|
2502
2571
|
}
|
|
@@ -2534,26 +2603,26 @@ class Dn {
|
|
|
2534
2603
|
};
|
|
2535
2604
|
}
|
|
2536
2605
|
}
|
|
2537
|
-
const te = "__lsBeaconMonitorUrl",
|
|
2538
|
-
let
|
|
2606
|
+
const te = "__lsBeaconMonitorUrl", ze = "__lsBeaconMonitorSession", ne = "__lsBeaconMonitorVerbose", oe = "__lsBeaconMonitorDeadline", Oe = 30 * 6e4, ke = 4096;
|
|
2607
|
+
let x = null;
|
|
2539
2608
|
const Z = /* @__PURE__ */ new Set();
|
|
2540
|
-
function
|
|
2609
|
+
function On() {
|
|
2541
2610
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID().slice(0, 8) : Math.random().toString(36).slice(2, 10);
|
|
2542
2611
|
}
|
|
2543
|
-
function
|
|
2612
|
+
function Hn(e) {
|
|
2544
2613
|
const t = /* @__PURE__ */ new WeakSet(), n = (o) => {
|
|
2545
2614
|
if (o === null || typeof o != "object")
|
|
2546
|
-
return typeof o == "string" && o.length >
|
|
2615
|
+
return typeof o == "string" && o.length > ke ? o.slice(0, ke) : o;
|
|
2547
2616
|
if (t.has(o)) return "[cyclic]";
|
|
2548
2617
|
if (t.add(o), Array.isArray(o)) return o.map(n);
|
|
2549
|
-
const
|
|
2550
|
-
for (const
|
|
2618
|
+
const a = {};
|
|
2619
|
+
for (const r of Object.keys(o).slice(0, 50))
|
|
2551
2620
|
try {
|
|
2552
|
-
r
|
|
2621
|
+
a[r] = n(o[r]);
|
|
2553
2622
|
} catch {
|
|
2554
|
-
r
|
|
2623
|
+
a[r] = "[unreadable]";
|
|
2555
2624
|
}
|
|
2556
|
-
return
|
|
2625
|
+
return a;
|
|
2557
2626
|
};
|
|
2558
2627
|
try {
|
|
2559
2628
|
return n(e);
|
|
@@ -2564,16 +2633,16 @@ function Bn(e) {
|
|
|
2564
2633
|
function re() {
|
|
2565
2634
|
for (const e of Z)
|
|
2566
2635
|
try {
|
|
2567
|
-
e(
|
|
2636
|
+
e(x !== null, (x == null ? void 0 : x.url) ?? null);
|
|
2568
2637
|
} catch {
|
|
2569
2638
|
}
|
|
2570
2639
|
}
|
|
2571
|
-
function
|
|
2572
|
-
return
|
|
2640
|
+
function Un(e) {
|
|
2641
|
+
return x ? (x.seq += 1, {
|
|
2573
2642
|
...e,
|
|
2574
2643
|
ts: Date.now(),
|
|
2575
|
-
sessionId:
|
|
2576
|
-
seq:
|
|
2644
|
+
sessionId: x.sessionId,
|
|
2645
|
+
seq: x.seq
|
|
2577
2646
|
}) : {
|
|
2578
2647
|
...e,
|
|
2579
2648
|
ts: Date.now(),
|
|
@@ -2581,40 +2650,40 @@ function zn(e) {
|
|
|
2581
2650
|
seq: 0
|
|
2582
2651
|
};
|
|
2583
2652
|
}
|
|
2584
|
-
function
|
|
2585
|
-
if (!
|
|
2586
|
-
const t =
|
|
2587
|
-
|
|
2653
|
+
function P(e) {
|
|
2654
|
+
if (!x) return;
|
|
2655
|
+
const t = Un(e);
|
|
2656
|
+
x.transport.enqueue(t);
|
|
2588
2657
|
}
|
|
2589
|
-
function
|
|
2590
|
-
if (
|
|
2658
|
+
function qn() {
|
|
2659
|
+
if (x)
|
|
2591
2660
|
try {
|
|
2592
|
-
sessionStorage.setItem(te,
|
|
2661
|
+
sessionStorage.setItem(te, x.url), sessionStorage.setItem(ze, x.sessionId), sessionStorage.setItem(ne, x.verbose ? "1" : "0"), sessionStorage.setItem(oe, String(x.deadlineMs));
|
|
2593
2662
|
} catch {
|
|
2594
2663
|
}
|
|
2595
2664
|
}
|
|
2596
|
-
function
|
|
2665
|
+
function He() {
|
|
2597
2666
|
try {
|
|
2598
|
-
sessionStorage.removeItem(te), sessionStorage.removeItem(
|
|
2667
|
+
sessionStorage.removeItem(te), sessionStorage.removeItem(ze), sessionStorage.removeItem(ne), sessionStorage.removeItem(oe);
|
|
2599
2668
|
} catch {
|
|
2600
2669
|
}
|
|
2601
2670
|
}
|
|
2602
|
-
function
|
|
2671
|
+
function Fn() {
|
|
2603
2672
|
try {
|
|
2604
2673
|
const e = sessionStorage.getItem(te);
|
|
2605
2674
|
if (!e) return null;
|
|
2606
|
-
const t = sessionStorage.getItem(ne) === "1", n = sessionStorage.getItem(oe), o = n ? Number(n) : Date.now() +
|
|
2607
|
-
return Number.isFinite(o) && o <= Date.now() ? (
|
|
2675
|
+
const t = sessionStorage.getItem(ne) === "1", n = sessionStorage.getItem(oe), o = n ? Number(n) : Date.now() + Oe;
|
|
2676
|
+
return Number.isFinite(o) && o <= Date.now() ? (He(), null) : { url: e, verbose: t, deadlineMs: o };
|
|
2608
2677
|
} catch {
|
|
2609
2678
|
return null;
|
|
2610
2679
|
}
|
|
2611
2680
|
}
|
|
2612
|
-
function
|
|
2613
|
-
|
|
2681
|
+
function Ae(e) {
|
|
2682
|
+
x && (x.seq += 1, x.transport.enqueue({
|
|
2614
2683
|
kind: e.kind,
|
|
2615
2684
|
ts: e.ts,
|
|
2616
|
-
sessionId:
|
|
2617
|
-
seq:
|
|
2685
|
+
sessionId: x.sessionId,
|
|
2686
|
+
seq: x.seq,
|
|
2618
2687
|
message: e.message,
|
|
2619
2688
|
...e.stack ? { stack: e.stack } : {},
|
|
2620
2689
|
...e.source ? { source: e.source } : {},
|
|
@@ -2622,102 +2691,102 @@ function ke(e) {
|
|
|
2622
2691
|
...typeof e.col == "number" ? { col: e.col } : {}
|
|
2623
2692
|
}));
|
|
2624
2693
|
}
|
|
2625
|
-
function
|
|
2626
|
-
if (
|
|
2627
|
-
const t = e.maxSessionMs ??
|
|
2694
|
+
function Ue(e) {
|
|
2695
|
+
if (x && F(), !e.url) return;
|
|
2696
|
+
const t = e.maxSessionMs ?? Oe, n = Date.now() + t, o = On(), a = !!e.verbose, r = new zn({
|
|
2628
2697
|
url: e.url,
|
|
2629
2698
|
sessionId: o,
|
|
2630
|
-
onError: (
|
|
2631
|
-
console.warn("[launch-kit-beacon] monitor transport error:",
|
|
2699
|
+
onError: (u) => {
|
|
2700
|
+
console.warn("[launch-kit-beacon] monitor transport error:", u.message);
|
|
2632
2701
|
}
|
|
2633
|
-
}), i =
|
|
2634
|
-
for (const
|
|
2702
|
+
}), i = Re(), s = i.install(), c = i.snapshot();
|
|
2703
|
+
for (const u of c) Ae(u);
|
|
2635
2704
|
let d = c.length;
|
|
2636
2705
|
const l = i.subscribe(() => {
|
|
2637
|
-
if (!
|
|
2638
|
-
const
|
|
2639
|
-
for (;
|
|
2640
|
-
const
|
|
2641
|
-
|
|
2642
|
-
}
|
|
2643
|
-
}),
|
|
2644
|
-
emit: (
|
|
2645
|
-
verbose:
|
|
2646
|
-
}),
|
|
2647
|
-
emitClick: (
|
|
2648
|
-
emitRoute: (
|
|
2649
|
-
emitDialog: (
|
|
2650
|
-
emitSubmit: (
|
|
2651
|
-
}),
|
|
2706
|
+
if (!x) return;
|
|
2707
|
+
const u = x.errorsBuffer.snapshot();
|
|
2708
|
+
for (; x.drainedThrough < u.length; ) {
|
|
2709
|
+
const v = u[x.drainedThrough];
|
|
2710
|
+
v && Ae(v), x.drainedThrough += 1;
|
|
2711
|
+
}
|
|
2712
|
+
}), m = Dn({
|
|
2713
|
+
emit: (u) => P(u),
|
|
2714
|
+
verbose: a
|
|
2715
|
+
}), p = kn({
|
|
2716
|
+
emitClick: (u) => P(u),
|
|
2717
|
+
emitRoute: (u) => P(u),
|
|
2718
|
+
emitDialog: (u) => P(u),
|
|
2719
|
+
emitSubmit: (u) => P(u)
|
|
2720
|
+
}), g = setTimeout(() => {
|
|
2652
2721
|
console.info("[launch-kit-beacon] monitor session expired (max duration reached)"), F();
|
|
2653
2722
|
}, Math.max(0, n - Date.now()));
|
|
2654
|
-
|
|
2723
|
+
x = {
|
|
2655
2724
|
url: e.url,
|
|
2656
2725
|
sessionId: o,
|
|
2657
|
-
verbose:
|
|
2726
|
+
verbose: a,
|
|
2658
2727
|
deadlineMs: n,
|
|
2659
2728
|
seq: 0,
|
|
2660
|
-
transport:
|
|
2729
|
+
transport: r,
|
|
2661
2730
|
errorsBuffer: i,
|
|
2662
|
-
uninstallNetwork:
|
|
2663
|
-
uninstallDom:
|
|
2731
|
+
uninstallNetwork: m.uninstall,
|
|
2732
|
+
uninstallDom: p.uninstall,
|
|
2664
2733
|
uninstallErrors: s,
|
|
2665
2734
|
errorsUnsub: l,
|
|
2666
|
-
deadlineTimer:
|
|
2735
|
+
deadlineTimer: g,
|
|
2667
2736
|
drainedThrough: d
|
|
2668
|
-
},
|
|
2737
|
+
}, qn(), re();
|
|
2669
2738
|
}
|
|
2670
2739
|
function F() {
|
|
2671
|
-
qe(),
|
|
2740
|
+
qe(), He(), re();
|
|
2672
2741
|
}
|
|
2673
|
-
function
|
|
2674
|
-
|
|
2742
|
+
function jn() {
|
|
2743
|
+
x && (qe(), re());
|
|
2675
2744
|
}
|
|
2676
2745
|
function qe() {
|
|
2677
|
-
|
|
2746
|
+
x && (clearTimeout(x.deadlineTimer), x.errorsUnsub(), x.uninstallErrors(), x.uninstallNetwork(), x.uninstallDom(), x.transport.destroy(), x = null);
|
|
2678
2747
|
}
|
|
2679
|
-
function
|
|
2680
|
-
|
|
2748
|
+
function no(e, t) {
|
|
2749
|
+
x && P({
|
|
2681
2750
|
kind: "probe",
|
|
2682
2751
|
label: e.slice(0, 200),
|
|
2683
|
-
data:
|
|
2752
|
+
data: Hn(t)
|
|
2684
2753
|
});
|
|
2685
2754
|
}
|
|
2686
|
-
function Ae() {
|
|
2687
|
-
return E !== null;
|
|
2688
|
-
}
|
|
2689
2755
|
function Le() {
|
|
2690
|
-
return
|
|
2756
|
+
return x !== null;
|
|
2757
|
+
}
|
|
2758
|
+
function Te() {
|
|
2759
|
+
return (x == null ? void 0 : x.url) ?? null;
|
|
2691
2760
|
}
|
|
2692
2761
|
function Ne(e) {
|
|
2693
2762
|
return Z.add(e), () => {
|
|
2694
2763
|
Z.delete(e);
|
|
2695
2764
|
};
|
|
2696
2765
|
}
|
|
2697
|
-
function
|
|
2698
|
-
if (
|
|
2699
|
-
const e =
|
|
2700
|
-
e &&
|
|
2766
|
+
function Vn() {
|
|
2767
|
+
if (x || typeof window > "u") return;
|
|
2768
|
+
const e = Fn();
|
|
2769
|
+
e && Ue({
|
|
2701
2770
|
url: e.url,
|
|
2702
2771
|
verbose: e.verbose,
|
|
2703
2772
|
maxSessionMs: Math.max(6e4, e.deadlineMs - Date.now())
|
|
2704
2773
|
});
|
|
2705
2774
|
}
|
|
2706
|
-
function
|
|
2707
|
-
let t = null, n = null, o = "",
|
|
2708
|
-
function
|
|
2709
|
-
|
|
2775
|
+
function oo(e = {}) {
|
|
2776
|
+
let t = null, n = null, o = "", a = null;
|
|
2777
|
+
function r() {
|
|
2778
|
+
a || (a = mn({
|
|
2710
2779
|
onStop: () => F(),
|
|
2711
|
-
url:
|
|
2780
|
+
url: Te()
|
|
2712
2781
|
}));
|
|
2713
2782
|
}
|
|
2714
2783
|
function i() {
|
|
2715
|
-
if (
|
|
2784
|
+
if (a) {
|
|
2716
2785
|
try {
|
|
2717
|
-
|
|
2786
|
+
a.destroy();
|
|
2718
2787
|
} catch {
|
|
2719
2788
|
}
|
|
2720
|
-
|
|
2789
|
+
a = null;
|
|
2721
2790
|
}
|
|
2722
2791
|
}
|
|
2723
2792
|
function s() {
|
|
@@ -2725,31 +2794,31 @@ function eo(e = {}) {
|
|
|
2725
2794
|
t.innerHTML = "";
|
|
2726
2795
|
const l = document.createElement("div");
|
|
2727
2796
|
l.className = "beacon-monitor-title", l.textContent = "Monitor — paste a stream URL", t.appendChild(l);
|
|
2728
|
-
const
|
|
2729
|
-
|
|
2730
|
-
const
|
|
2731
|
-
|
|
2732
|
-
const
|
|
2733
|
-
|
|
2734
|
-
const
|
|
2735
|
-
|
|
2736
|
-
const
|
|
2737
|
-
|
|
2738
|
-
const
|
|
2739
|
-
|
|
2740
|
-
o =
|
|
2741
|
-
}),
|
|
2742
|
-
const
|
|
2743
|
-
if (
|
|
2797
|
+
const m = document.createElement("div");
|
|
2798
|
+
m.className = "beacon-monitor-row";
|
|
2799
|
+
const p = document.createElement("input");
|
|
2800
|
+
p.type = "url", p.className = "beacon-monitor-input", p.placeholder = "http://localhost:9876/m/…", p.value = o, p.autocomplete = "off", p.spellcheck = !1, m.appendChild(p);
|
|
2801
|
+
const g = document.createElement("button");
|
|
2802
|
+
g.type = "button", g.className = "beacon-monitor-btn", g.textContent = "Start", g.disabled = !o.trim(), m.appendChild(g), t.appendChild(m);
|
|
2803
|
+
const u = document.createElement("label");
|
|
2804
|
+
u.className = "beacon-monitor-verbose";
|
|
2805
|
+
const v = document.createElement("input");
|
|
2806
|
+
v.type = "checkbox", v.dataset.role = "verbose", u.appendChild(v), u.appendChild(document.createTextNode(" verbose (capture successful network too)")), t.appendChild(u);
|
|
2807
|
+
const E = document.createElement("div");
|
|
2808
|
+
E.className = "beacon-monitor-help", E.textContent = "Streams clicks, failed network, errors, route + dialog changes.", t.appendChild(E), p.addEventListener("input", () => {
|
|
2809
|
+
o = p.value, g.disabled = !p.value.trim();
|
|
2810
|
+
}), g.addEventListener("click", () => {
|
|
2811
|
+
const b = p.value.trim();
|
|
2812
|
+
if (b) {
|
|
2744
2813
|
try {
|
|
2745
|
-
new URL(
|
|
2814
|
+
new URL(b);
|
|
2746
2815
|
} catch {
|
|
2747
|
-
|
|
2816
|
+
p.setCustomValidity("Enter a valid URL (e.g. http://localhost:9876/m/abc)"), p.reportValidity();
|
|
2748
2817
|
return;
|
|
2749
2818
|
}
|
|
2750
|
-
|
|
2751
|
-
url:
|
|
2752
|
-
verbose:
|
|
2819
|
+
p.setCustomValidity(""), Ue({
|
|
2820
|
+
url: b,
|
|
2821
|
+
verbose: v.checked,
|
|
2753
2822
|
...e.maxSessionMs !== void 0 ? { maxSessionMs: e.maxSessionMs } : {}
|
|
2754
2823
|
});
|
|
2755
2824
|
}
|
|
@@ -2758,36 +2827,36 @@ function eo(e = {}) {
|
|
|
2758
2827
|
function c() {
|
|
2759
2828
|
if (!t) return;
|
|
2760
2829
|
t.innerHTML = "";
|
|
2761
|
-
const l =
|
|
2762
|
-
|
|
2763
|
-
const
|
|
2764
|
-
|
|
2765
|
-
const b = document.createElement("div");
|
|
2766
|
-
b.className = "beacon-monitor-active-url", b.title = l, b.textContent = l, t.appendChild(b);
|
|
2767
|
-
const m = document.createElement("div");
|
|
2768
|
-
m.className = "beacon-monitor-row";
|
|
2769
|
-
const x = document.createElement("button");
|
|
2770
|
-
x.type = "button", x.className = "beacon-monitor-btn stop", x.textContent = "Stop monitoring", x.addEventListener("click", () => F()), m.appendChild(x), t.appendChild(m);
|
|
2830
|
+
const l = Te() ?? "", m = document.createElement("div");
|
|
2831
|
+
m.className = "beacon-monitor-title";
|
|
2832
|
+
const p = document.createElement("span");
|
|
2833
|
+
p.className = "beacon-monitor-rec", p.setAttribute("aria-hidden", "true"), m.appendChild(p), m.appendChild(document.createTextNode(" Monitor — recording")), t.appendChild(m);
|
|
2771
2834
|
const g = document.createElement("div");
|
|
2772
|
-
g.className = "beacon-monitor-
|
|
2835
|
+
g.className = "beacon-monitor-active-url", g.title = l, g.textContent = l, t.appendChild(g);
|
|
2836
|
+
const u = document.createElement("div");
|
|
2837
|
+
u.className = "beacon-monitor-row";
|
|
2838
|
+
const v = document.createElement("button");
|
|
2839
|
+
v.type = "button", v.className = "beacon-monitor-btn stop", v.textContent = "Stop monitoring", v.addEventListener("click", () => F()), u.appendChild(v), t.appendChild(u);
|
|
2840
|
+
const E = document.createElement("div");
|
|
2841
|
+
E.className = "beacon-monitor-help", E.textContent = "Events stream to the URL above. Auto-stops after 30 min.", t.appendChild(E);
|
|
2773
2842
|
}
|
|
2774
2843
|
function d() {
|
|
2775
|
-
|
|
2844
|
+
Le() ? c() : s();
|
|
2776
2845
|
}
|
|
2777
2846
|
return {
|
|
2778
2847
|
name: "liveMonitor",
|
|
2779
2848
|
setupOnce(l) {
|
|
2780
|
-
|
|
2781
|
-
const
|
|
2782
|
-
|
|
2783
|
-
}),
|
|
2784
|
-
i(),
|
|
2849
|
+
Vn(), Le() && r();
|
|
2850
|
+
const m = Ne((g, u) => {
|
|
2851
|
+
g ? (r(), a == null || a.updateUrl(u)) : i();
|
|
2852
|
+
}), p = () => {
|
|
2853
|
+
i(), m();
|
|
2785
2854
|
try {
|
|
2786
|
-
|
|
2855
|
+
jn();
|
|
2787
2856
|
} catch {
|
|
2788
2857
|
}
|
|
2789
2858
|
};
|
|
2790
|
-
l.signal.addEventListener("abort",
|
|
2859
|
+
l.signal.addEventListener("abort", p, { once: !0 });
|
|
2791
2860
|
},
|
|
2792
2861
|
form() {
|
|
2793
2862
|
return {
|
|
@@ -2799,38 +2868,38 @@ function eo(e = {}) {
|
|
|
2799
2868
|
// No capture(): liveMonitor is a side-channel, not a feedback payload contributor.
|
|
2800
2869
|
};
|
|
2801
2870
|
}
|
|
2802
|
-
let
|
|
2871
|
+
let T = null;
|
|
2803
2872
|
const ae = {
|
|
2804
2873
|
"plugin:error": /* @__PURE__ */ new Set(),
|
|
2805
2874
|
"submit:success": /* @__PURE__ */ new Set(),
|
|
2806
2875
|
"submit:error": /* @__PURE__ */ new Set(),
|
|
2807
2876
|
ready: /* @__PURE__ */ new Set()
|
|
2808
2877
|
};
|
|
2809
|
-
function
|
|
2878
|
+
function ro(e) {
|
|
2810
2879
|
if (typeof window > "u") return;
|
|
2811
2880
|
if (!e.endpoint) throw new Error("init: endpoint is required");
|
|
2812
|
-
|
|
2813
|
-
const t = { ...
|
|
2814
|
-
|
|
2815
|
-
const i = document.querySelector(
|
|
2881
|
+
Ie(), Yn();
|
|
2882
|
+
const t = { ...lt(), ...e.labels ?? {} }, n = new AbortController(), o = Gn(e), a = e.position ?? "bottom-right", r = e.theme ?? "auto";
|
|
2883
|
+
Xe(), Kn(e, a, r);
|
|
2884
|
+
const i = document.querySelector(z);
|
|
2816
2885
|
if (!i)
|
|
2817
2886
|
throw new Error("init: failed to acquire <launch-kit-beacon> host");
|
|
2818
2887
|
if (!i.shadow)
|
|
2819
2888
|
throw new Error("init: host element shadow root not initialized");
|
|
2820
|
-
const s =
|
|
2889
|
+
const s = dt(i.shadow), c = new ct(
|
|
2821
2890
|
t,
|
|
2822
2891
|
["bug", "idea", "ux", "a11y"],
|
|
2823
2892
|
{
|
|
2824
2893
|
onSubmit: () => {
|
|
2825
|
-
|
|
2894
|
+
Qn();
|
|
2826
2895
|
},
|
|
2827
|
-
onClose: (
|
|
2828
|
-
j("close", {}),
|
|
2896
|
+
onClose: (m) => {
|
|
2897
|
+
j("close", {}), m === "user" && je();
|
|
2829
2898
|
}
|
|
2830
2899
|
}
|
|
2831
2900
|
);
|
|
2832
2901
|
i.shadow.appendChild(c.root), i.classList.add("beacon-no-capture");
|
|
2833
|
-
const d =
|
|
2902
|
+
const d = et(o), l = {
|
|
2834
2903
|
endpoint: e.endpoint,
|
|
2835
2904
|
headers: e.headers,
|
|
2836
2905
|
context: e.context,
|
|
@@ -2842,10 +2911,10 @@ function to(e) {
|
|
|
2842
2911
|
hostElement: i,
|
|
2843
2912
|
initAbort: n,
|
|
2844
2913
|
labels: t,
|
|
2845
|
-
debug: !!e.debug ||
|
|
2914
|
+
debug: !!e.debug || Zn(),
|
|
2846
2915
|
healthIndicator: e.healthIndicator ?? "never",
|
|
2847
|
-
position:
|
|
2848
|
-
theme:
|
|
2916
|
+
position: a,
|
|
2917
|
+
theme: r,
|
|
2849
2918
|
currentSubmit: null,
|
|
2850
2919
|
capturedEntries: {},
|
|
2851
2920
|
formValues: {},
|
|
@@ -2857,23 +2926,23 @@ function to(e) {
|
|
|
2857
2926
|
},
|
|
2858
2927
|
panelSources: []
|
|
2859
2928
|
};
|
|
2860
|
-
|
|
2861
|
-
(
|
|
2862
|
-
(
|
|
2863
|
-
),
|
|
2929
|
+
T = l, i.onTriggerClick = () => Wn(), d.install(
|
|
2930
|
+
(m) => Fe(m),
|
|
2931
|
+
(m) => ie(m)
|
|
2932
|
+
), B("ready", { ready: !0 }), l.debug && console.info("[beacon] ready", l.endpoint);
|
|
2864
2933
|
}
|
|
2865
|
-
function
|
|
2866
|
-
const e =
|
|
2934
|
+
function Wn() {
|
|
2935
|
+
const e = T;
|
|
2867
2936
|
e && (e.currentSubmit || (e.panelSources = e.plugins.map((t) => {
|
|
2868
2937
|
if (!t.form) return null;
|
|
2869
|
-
const n =
|
|
2938
|
+
const n = Fe(t.name);
|
|
2870
2939
|
let o;
|
|
2871
2940
|
try {
|
|
2872
2941
|
o = t.form(n);
|
|
2873
|
-
} catch (
|
|
2942
|
+
} catch (a) {
|
|
2874
2943
|
return ie({
|
|
2875
2944
|
plugin: t.name,
|
|
2876
|
-
error:
|
|
2945
|
+
error: a instanceof Error ? a : new Error(String(a)),
|
|
2877
2946
|
at: "form"
|
|
2878
2947
|
}), null;
|
|
2879
2948
|
}
|
|
@@ -2884,57 +2953,57 @@ function Fn() {
|
|
|
2884
2953
|
return (o = e.formValues[t]) == null ? void 0 : o[n];
|
|
2885
2954
|
},
|
|
2886
2955
|
set: (t, n, o) => {
|
|
2887
|
-
var
|
|
2888
|
-
const
|
|
2889
|
-
|
|
2956
|
+
var r;
|
|
2957
|
+
const a = (r = e.formValues)[t] ?? (r[t] = {});
|
|
2958
|
+
a[n] = o;
|
|
2890
2959
|
}
|
|
2891
2960
|
}), e.dialog.open(), j("open", {})));
|
|
2892
2961
|
}
|
|
2893
|
-
function
|
|
2894
|
-
const e =
|
|
2962
|
+
function ao() {
|
|
2963
|
+
const e = T;
|
|
2895
2964
|
e && e.dialog.close("user");
|
|
2896
2965
|
}
|
|
2897
|
-
function
|
|
2966
|
+
function Yn() {
|
|
2898
2967
|
var t;
|
|
2899
|
-
const e =
|
|
2968
|
+
const e = T;
|
|
2900
2969
|
if (e) {
|
|
2901
|
-
e.initAbort.abort(), (t = e.currentSubmit) == null || t.abort(), e.registry.destroy(),
|
|
2970
|
+
e.initAbort.abort(), (t = e.currentSubmit) == null || t.abort(), e.registry.destroy(), R();
|
|
2902
2971
|
try {
|
|
2903
2972
|
e.dialog.root.remove(), e.overlayHost.layer.remove();
|
|
2904
2973
|
} catch {
|
|
2905
2974
|
}
|
|
2906
|
-
e.hostElement.onTriggerClick = null,
|
|
2975
|
+
e.hostElement.onTriggerClick = null, T = null;
|
|
2907
2976
|
}
|
|
2908
2977
|
}
|
|
2909
|
-
function
|
|
2910
|
-
const e =
|
|
2978
|
+
function io() {
|
|
2979
|
+
const e = T;
|
|
2911
2980
|
return e ? {
|
|
2912
2981
|
ready: !0,
|
|
2913
2982
|
transport: "idle",
|
|
2914
2983
|
plugins: e.registry.status()
|
|
2915
2984
|
} : { ready: !1, transport: "idle", plugins: {} };
|
|
2916
2985
|
}
|
|
2917
|
-
function
|
|
2918
|
-
return ae[e].add(t), () =>
|
|
2986
|
+
function so(e, t) {
|
|
2987
|
+
return ae[e].add(t), () => Xn(e, t);
|
|
2919
2988
|
}
|
|
2920
|
-
function
|
|
2989
|
+
function Xn(e, t) {
|
|
2921
2990
|
ae[e].delete(t);
|
|
2922
2991
|
}
|
|
2923
|
-
function
|
|
2924
|
-
let o = document.querySelector(
|
|
2992
|
+
function Kn(e, t, n) {
|
|
2993
|
+
let o = document.querySelector(z);
|
|
2925
2994
|
if (!o) {
|
|
2926
|
-
o = document.createElement(
|
|
2995
|
+
o = document.createElement(z), o.setAttribute("position", t), o.setAttribute("theme", n), t === "hidden" && (o.style.position = "absolute", o.style.left = "-9999px"), (document.body ?? document.documentElement).appendChild(o);
|
|
2927
2996
|
return;
|
|
2928
2997
|
}
|
|
2929
2998
|
e.position !== void 0 && o.setAttribute("position", t), e.theme !== void 0 && o.setAttribute("theme", n);
|
|
2930
2999
|
}
|
|
2931
|
-
function
|
|
2932
|
-
return e.plugins ? e.plugins : e.defaultPlugins === !1 ? [] :
|
|
3000
|
+
function Gn(e) {
|
|
3001
|
+
return e.plugins ? e.plugins : e.defaultPlugins === !1 ? [] : Jn();
|
|
2933
3002
|
}
|
|
2934
|
-
function
|
|
2935
|
-
return [
|
|
3003
|
+
function Jn() {
|
|
3004
|
+
return [ft(), wt(), cn(), dn()];
|
|
2936
3005
|
}
|
|
2937
|
-
function
|
|
3006
|
+
function Zn() {
|
|
2938
3007
|
if (typeof window > "u") return !1;
|
|
2939
3008
|
try {
|
|
2940
3009
|
return new URLSearchParams(window.location.search).has("lsbeacon-debug");
|
|
@@ -2942,13 +3011,13 @@ function Xn() {
|
|
|
2942
3011
|
return !1;
|
|
2943
3012
|
}
|
|
2944
3013
|
}
|
|
2945
|
-
function
|
|
2946
|
-
const t =
|
|
2947
|
-
return
|
|
3014
|
+
function Fe(e) {
|
|
3015
|
+
const t = T;
|
|
3016
|
+
return Ze(e, {
|
|
2948
3017
|
getCaptured: (o) => t == null ? void 0 : t.capturedEntries[o],
|
|
2949
3018
|
getFormValues: (o) => {
|
|
2950
|
-
var
|
|
2951
|
-
return t ? (
|
|
3019
|
+
var a;
|
|
3020
|
+
return t ? (a = t.formValues)[o] ?? (a[o] = {}) : {};
|
|
2952
3021
|
},
|
|
2953
3022
|
getCaptureSignal: () => {
|
|
2954
3023
|
var o;
|
|
@@ -2957,45 +3026,45 @@ function Ue(e) {
|
|
|
2957
3026
|
getInitSignal: () => t.initAbort.signal,
|
|
2958
3027
|
requestMode: async (o) => t ? t.dialog.requestMode(o) : () => {
|
|
2959
3028
|
},
|
|
2960
|
-
overlay: (o) => t ?
|
|
3029
|
+
overlay: (o) => t ? ut(t.overlayHost, o.render) : () => {
|
|
2961
3030
|
},
|
|
2962
|
-
onLifecycle: (o,
|
|
3031
|
+
onLifecycle: (o, a) => {
|
|
2963
3032
|
if (!t) return () => {
|
|
2964
3033
|
};
|
|
2965
|
-
const
|
|
2966
|
-
return
|
|
3034
|
+
const r = t.lifecycleHandlers[o];
|
|
3035
|
+
return r.add(a), () => r.delete(a);
|
|
2967
3036
|
}
|
|
2968
3037
|
});
|
|
2969
3038
|
}
|
|
2970
3039
|
function j(e, t) {
|
|
2971
|
-
const n =
|
|
3040
|
+
const n = T;
|
|
2972
3041
|
if (n)
|
|
2973
3042
|
for (const o of n.lifecycleHandlers[e])
|
|
2974
3043
|
try {
|
|
2975
3044
|
o(t);
|
|
2976
|
-
} catch (
|
|
2977
|
-
n.debug && console.error("[beacon] lifecycle handler threw:",
|
|
3045
|
+
} catch (a) {
|
|
3046
|
+
n.debug && console.error("[beacon] lifecycle handler threw:", a);
|
|
2978
3047
|
}
|
|
2979
3048
|
}
|
|
2980
|
-
function
|
|
3049
|
+
function B(e, t) {
|
|
2981
3050
|
for (const n of ae[e])
|
|
2982
3051
|
try {
|
|
2983
3052
|
n(t);
|
|
2984
3053
|
} catch (o) {
|
|
2985
|
-
|
|
3054
|
+
T != null && T.debug && console.error("[beacon] system handler threw:", o);
|
|
2986
3055
|
}
|
|
2987
3056
|
}
|
|
2988
3057
|
function ie(e) {
|
|
2989
|
-
|
|
2990
|
-
const t =
|
|
3058
|
+
B("plugin:error", { plugin: e.plugin, error: e.error, at: e.at });
|
|
3059
|
+
const t = T;
|
|
2991
3060
|
t && ((t.healthIndicator === "always" || t.healthIndicator === "dev" && t.debug) && t.hostElement.setHealthIndicator(!0), t.debug && console.warn(`[beacon] plugin "${e.plugin}" ${e.at} failed:`, e.error));
|
|
2992
3061
|
}
|
|
2993
|
-
function
|
|
2994
|
-
const e =
|
|
3062
|
+
function je() {
|
|
3063
|
+
const e = T;
|
|
2995
3064
|
e && (e.dialog.resetState(), e.dialog.clearPluginPanels(), e.formValues = {});
|
|
2996
3065
|
}
|
|
2997
|
-
async function
|
|
2998
|
-
const e =
|
|
3066
|
+
async function Qn() {
|
|
3067
|
+
const e = T;
|
|
2999
3068
|
if (!e || e.currentSubmit) return;
|
|
3000
3069
|
const t = e.dialog.getDescription().trim();
|
|
3001
3070
|
if (!t) {
|
|
@@ -3009,45 +3078,45 @@ async function Gn() {
|
|
|
3009
3078
|
(s) => e.capturedEntries[s],
|
|
3010
3079
|
(s) => ie(s)
|
|
3011
3080
|
);
|
|
3012
|
-
e.capturedEntries = o, n =
|
|
3013
|
-
let
|
|
3081
|
+
e.capturedEntries = o, n = eo(e, t, o);
|
|
3082
|
+
let a = null;
|
|
3014
3083
|
if (j("beforeSubmit", { payload: n, cancel: (s) => {
|
|
3015
|
-
|
|
3016
|
-
} }),
|
|
3017
|
-
e.dialog.setSubmitting(!1), e.dialog.setStatus(`Cancelled: ${
|
|
3084
|
+
a === null && (a = s);
|
|
3085
|
+
} }), a !== null) {
|
|
3086
|
+
e.dialog.setSubmitting(!1), e.dialog.setStatus(`Cancelled: ${a}`, "error");
|
|
3018
3087
|
return;
|
|
3019
3088
|
}
|
|
3020
3089
|
e.dialog.setStatus("Sending…");
|
|
3021
|
-
const i = await
|
|
3090
|
+
const i = await ot(
|
|
3022
3091
|
e.endpoint,
|
|
3023
3092
|
n,
|
|
3024
3093
|
e.headers,
|
|
3025
3094
|
e.currentSubmit.signal,
|
|
3026
3095
|
e.credentials
|
|
3027
3096
|
);
|
|
3028
|
-
j("afterSubmit", { payload: n, response: i }), e.dialog.setSubmitting(!1), i.ok ? (
|
|
3029
|
-
|
|
3030
|
-
}, 1500)) : (
|
|
3097
|
+
j("afterSubmit", { payload: n, response: i }), e.dialog.setSubmitting(!1), i.ok ? (B("submit:success", { payload: n, response: i }), e.dialog.setSubmitSucceeded(!0), e.dialog.setStatus(e.labels.sentSuccess, "success"), window.setTimeout(() => {
|
|
3098
|
+
T === e && e.dialog.close("submitted"), je();
|
|
3099
|
+
}, 1500)) : (B("submit:error", { payload: n, error: new Error(`HTTP ${i.status}`) }), e.dialog.setStatus(`Failed (${i.status})`, "error"));
|
|
3031
3100
|
} catch (o) {
|
|
3032
3101
|
e.dialog.setSubmitting(!1);
|
|
3033
|
-
const
|
|
3034
|
-
n &&
|
|
3102
|
+
const a = o instanceof Error ? o : new Error(String(o));
|
|
3103
|
+
n && B("submit:error", { payload: n, error: a }), e.dialog.setStatus(`Failed: ${a.message}`, "error");
|
|
3035
3104
|
} finally {
|
|
3036
3105
|
e.currentSubmit = null;
|
|
3037
3106
|
}
|
|
3038
3107
|
}
|
|
3039
|
-
function
|
|
3040
|
-
var
|
|
3041
|
-
const o =
|
|
3108
|
+
function eo(e, t, n) {
|
|
3109
|
+
var r;
|
|
3110
|
+
const o = to(), a = (r = e.context) == null ? void 0 : r.call(e);
|
|
3042
3111
|
return {
|
|
3043
3112
|
description: t,
|
|
3044
3113
|
severity: e.dialog.getSeverity(),
|
|
3045
3114
|
metadata: o,
|
|
3046
|
-
...
|
|
3115
|
+
...a ? { context: a } : {},
|
|
3047
3116
|
plugins: n
|
|
3048
3117
|
};
|
|
3049
3118
|
}
|
|
3050
|
-
function
|
|
3119
|
+
function to() {
|
|
3051
3120
|
const e = window.location.href, t = document.referrer, n = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
3052
3121
|
return {
|
|
3053
3122
|
url: e,
|
|
@@ -3068,25 +3137,25 @@ function Zn() {
|
|
|
3068
3137
|
capturedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3069
3138
|
};
|
|
3070
3139
|
}
|
|
3071
|
-
|
|
3140
|
+
Ie();
|
|
3072
3141
|
export {
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3142
|
+
Te as currentMonitorUrl,
|
|
3143
|
+
Yn as destroy,
|
|
3144
|
+
cn as domEle,
|
|
3145
|
+
dn as domSS,
|
|
3146
|
+
wt as errors,
|
|
3147
|
+
ao as hide,
|
|
3148
|
+
ro as init,
|
|
3149
|
+
Le as isMonitorActive,
|
|
3150
|
+
ln as isPluginFailure,
|
|
3151
|
+
oo as liveMonitor,
|
|
3152
|
+
ft as metadata,
|
|
3153
|
+
Xn as off,
|
|
3154
|
+
so as on,
|
|
3155
|
+
no as probe,
|
|
3156
|
+
Wn as show,
|
|
3157
|
+
Ue as startMonitor,
|
|
3158
|
+
io as status,
|
|
3090
3159
|
F as stopMonitor
|
|
3091
3160
|
};
|
|
3092
3161
|
//# sourceMappingURL=beacon.mjs.map
|