@launchsecure/launch-kit 0.0.30 → 0.0.32
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 +1027 -929
- 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/pick-mode-overlay.d.ts.map +1 -1
- package/dist/beacon/types/internal/picker.d.ts.map +1 -1
- package/dist/beacon/types/internal/pin-popover.d.ts.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/internal/selector.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-C7GsHvgg.js} +1 -1
- package/dist/deck-client/assets/{arc-h-ifqmNR.js → arc-CSrZRINY.js} +1 -1
- package/dist/deck-client/assets/{architectureDiagram-Q4EWVU46-C9dITSPv.js → architectureDiagram-Q4EWVU46-zoB-G17J.js} +1 -1
- package/dist/deck-client/assets/{blockDiagram-DXYQGD6D-BHuJT34t.js → blockDiagram-DXYQGD6D-BRjjtYH6.js} +1 -1
- package/dist/deck-client/assets/{c4Diagram-AHTNJAMY-CpvMGtDG.js → c4Diagram-AHTNJAMY-C3D3sd2U.js} +1 -1
- package/dist/deck-client/assets/channel-8ReQnQfH.js +1 -0
- package/dist/deck-client/assets/{chunk-4BX2VUAB-B6md1VIm.js → chunk-4BX2VUAB-DhpDMOPO.js} +1 -1
- package/dist/deck-client/assets/{chunk-4TB4RGXK-BmEnX8ik.js → chunk-4TB4RGXK-BIRgPXRl.js} +1 -1
- package/dist/deck-client/assets/{chunk-55IACEB6-BZPUyZAZ.js → chunk-55IACEB6-BF24dwDZ.js} +1 -1
- package/dist/deck-client/assets/{chunk-EDXVE4YY-BWwNUK-l.js → chunk-EDXVE4YY-CW75Y61B.js} +1 -1
- package/dist/deck-client/assets/{chunk-FMBD7UC4-o7gSppGI.js → chunk-FMBD7UC4-B5-oyL79.js} +1 -1
- package/dist/deck-client/assets/{chunk-OYMX7WX6-C4KoTL5p.js → chunk-OYMX7WX6-BB2bHe_Q.js} +1 -1
- package/dist/deck-client/assets/{chunk-QZHKN3VN-jkf68sDs.js → chunk-QZHKN3VN-D80eZO4B.js} +1 -1
- package/dist/deck-client/assets/{chunk-YZCP3GAM-Cd4yBE7o.js → chunk-YZCP3GAM-Dz9787p_.js} +1 -1
- package/dist/deck-client/assets/classDiagram-6PBFFD2Q-cRxTeGkK.js +1 -0
- package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-cRxTeGkK.js +1 -0
- package/dist/deck-client/assets/clone-LSHZ3K6R.js +1 -0
- package/dist/deck-client/assets/{cose-bilkent-S5V4N54A-DeGFUgAV.js → cose-bilkent-S5V4N54A-MQjiZLcL.js} +1 -1
- package/dist/deck-client/assets/{dagre-KV5264BT-ekcYJuUV.js → dagre-KV5264BT-DG4EcLpJ.js} +1 -1
- package/dist/deck-client/assets/{diagram-5BDNPKRD-YHPk4rV2.js → diagram-5BDNPKRD-1n7hM3Gc.js} +1 -1
- package/dist/deck-client/assets/{diagram-G4DWMVQ6-DM-JCd_B.js → diagram-G4DWMVQ6-CYMarncV.js} +1 -1
- package/dist/deck-client/assets/{diagram-MMDJMWI5-l5FK1ybk.js → diagram-MMDJMWI5-DSisoipe.js} +1 -1
- package/dist/deck-client/assets/{diagram-TYMM5635-CIN4_1-j.js → diagram-TYMM5635-Btnq49OJ.js} +1 -1
- package/dist/deck-client/assets/{erDiagram-SMLLAGMA-MyinSkEl.js → erDiagram-SMLLAGMA-Cu2Hb_Tz.js} +1 -1
- package/dist/deck-client/assets/{flowDiagram-DWJPFMVM-Dk8nn42x.js → flowDiagram-DWJPFMVM-CGJzUzsO.js} +1 -1
- package/dist/deck-client/assets/{ganttDiagram-T4ZO3ILL-BU1ihicu.js → ganttDiagram-T4ZO3ILL-D9sqGUBT.js} +1 -1
- package/dist/deck-client/assets/{gitGraphDiagram-UUTBAWPF-BjsTL13C.js → gitGraphDiagram-UUTBAWPF-C0QwX2od.js} +1 -1
- package/dist/deck-client/assets/{graph-DJmh-xi7.js → graph-CcBjOQCl.js} +1 -1
- package/dist/deck-client/assets/index-0arwoc0z.js +1195 -0
- 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/{infoDiagram-42DDH7IO-Dxvy_RB4.js → infoDiagram-42DDH7IO-DTimhhhS.js} +1 -1
- package/dist/deck-client/assets/{ishikawaDiagram-UXIWVN3A-DPOaNF1l.js → ishikawaDiagram-UXIWVN3A-DxOxg_B4.js} +1 -1
- package/dist/deck-client/assets/{journeyDiagram-VCZTEJTY-DMew3K5c.js → journeyDiagram-VCZTEJTY-Bpq0qa4j.js} +1 -1
- package/dist/deck-client/assets/{kanban-definition-6JOO6SKY-csciJFuk.js → kanban-definition-6JOO6SKY-aTIrpcVO.js} +1 -1
- package/dist/deck-client/assets/{layout-Dg4yyms2.js → layout-DqglLR2E.js} +1 -1
- package/dist/deck-client/assets/{linear-BA3zU6gq.js → linear-D5GxehPc.js} +1 -1
- package/dist/deck-client/assets/{min-lz-Ird-p.js → min-DXLfSREq.js} +1 -1
- package/dist/deck-client/assets/{mindmap-definition-QFDTVHPH-CCEN8OQV.js → mindmap-definition-QFDTVHPH-mO5Vys7I.js} +1 -1
- package/dist/deck-client/assets/{pieDiagram-DEJITSTG-DM6n1HY7.js → pieDiagram-DEJITSTG-Dm0gzdAr.js} +1 -1
- package/dist/deck-client/assets/{quadrantDiagram-34T5L4WZ-_ULoR66n.js → quadrantDiagram-34T5L4WZ-Daq7j3qD.js} +1 -1
- package/dist/deck-client/assets/{requirementDiagram-MS252O5E-BuwJs7Tn.js → requirementDiagram-MS252O5E-CmwV95um.js} +1 -1
- package/dist/deck-client/assets/{sankeyDiagram-XADWPNL6-BEsuzkW4.js → sankeyDiagram-XADWPNL6-BOYl3Nkf.js} +1 -1
- package/dist/deck-client/assets/{sequenceDiagram-FGHM5R23-CP2H0YWf.js → sequenceDiagram-FGHM5R23-BuUjhIcW.js} +1 -1
- package/dist/deck-client/assets/{stateDiagram-FHFEXIEX-B5Gw_NNL.js → stateDiagram-FHFEXIEX-LUZ_uwio.js} +1 -1
- package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-CnnRwE5D.js +1 -0
- package/dist/deck-client/assets/{timeline-definition-GMOUNBTQ-DsoYydQa.js → timeline-definition-GMOUNBTQ-CDUxCCAW.js} +1 -1
- package/dist/deck-client/assets/{vennDiagram-DHZGUBPP-Dz8JT_ob.js → vennDiagram-DHZGUBPP-BRb24Tf7.js} +1 -1
- package/dist/deck-client/assets/{wardley-RL74JXVD-DGHQ_Ijv.js → wardley-RL74JXVD-B0BYyVBY.js} +1 -1
- package/dist/deck-client/assets/{wardleyDiagram-NUSXRM2D-DN1LJMB1.js → wardleyDiagram-NUSXRM2D-BLGlYrQz.js} +1 -1
- package/dist/deck-client/assets/{xychartDiagram-5P7HB3ND-nb0oSfrQ.js → xychartDiagram-5P7HB3ND-De31MSnk.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 +224 -61
- package/dist/server/deck-serve.js +195 -41
- package/dist/server/fb-wizard.js +0 -0
- package/dist/server/graph-mcp-entry.js +666 -12
- package/dist/server/init-entry.js +231 -82
- 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/SKILL.md +174 -0
- 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/scaffolds/ls-marketplace/plugins/kit/skills/diagram.md +0 -134
- 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 Ie = String.raw`
|
|
2
2
|
:host {
|
|
3
3
|
--beacon-accent: #0ea5e9;
|
|
4
4
|
--beacon-bg: #ffffff;
|
|
@@ -693,24 +693,24 @@ dialog.beacon-dialog::backdrop {
|
|
|
693
693
|
text-overflow: ellipsis;
|
|
694
694
|
max-width: 100%;
|
|
695
695
|
}
|
|
696
|
-
`,
|
|
697
|
-
function
|
|
698
|
-
if (typeof document > "u" || !document.head || document.getElementById(
|
|
696
|
+
`, ce = "launch-kit-beacon-portal-styles";
|
|
697
|
+
function Xe() {
|
|
698
|
+
if (typeof document > "u" || !document.head || document.getElementById(ce)) return;
|
|
699
699
|
const e = document.createElement("style");
|
|
700
|
-
e.id =
|
|
700
|
+
e.id = ce, e.textContent = Ie, document.head.appendChild(e);
|
|
701
701
|
}
|
|
702
|
-
const
|
|
702
|
+
const W = "http://www.w3.org/2000/svg";
|
|
703
703
|
function Ke() {
|
|
704
|
-
const e = document.createElementNS(
|
|
704
|
+
const e = document.createElementNS(W, "svg");
|
|
705
705
|
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");
|
|
706
|
-
const t = document.createElementNS(
|
|
706
|
+
const t = document.createElementNS(W, "path");
|
|
707
707
|
t.setAttribute("d", "M3 11l18-5v12L3 14v-3z");
|
|
708
|
-
const n = document.createElementNS(
|
|
708
|
+
const n = document.createElementNS(W, "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 = Ie, 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 Re() {
|
|
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,171 +784,171 @@ 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
|
-
const
|
|
934
|
-
function
|
|
935
|
-
const e = document.createElementNS(
|
|
933
|
+
const Y = "http://www.w3.org/2000/svg";
|
|
934
|
+
function st() {
|
|
935
|
+
const e = document.createElementNS(Y, "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
|
-
const t = document.createElementNS(
|
|
937
|
+
const t = document.createElementNS(Y, "line");
|
|
938
938
|
t.setAttribute("x1", "18"), t.setAttribute("y1", "6"), t.setAttribute("x2", "6"), t.setAttribute("y2", "18");
|
|
939
|
-
const n = document.createElementNS(
|
|
939
|
+
const n = document.createElementNS(Y, "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, K = 500, le = 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
1168
|
return JSON.stringify(e).slice(0, K);
|
|
1169
1169
|
} catch {
|
|
1170
1170
|
return String(e);
|
|
1171
1171
|
}
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1173
|
+
function Pe() {
|
|
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", K) ?? "Unknown error",
|
|
1201
|
+
...d ? { stack: _(d, le) } : {},
|
|
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", K) ?? "Unknown rejection",
|
|
1215
|
+
...l ? { stack: _(l, le) } : {}
|
|
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 = Pe();
|
|
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,8 +1282,8 @@ function xt() {
|
|
|
1282
1282
|
}
|
|
1283
1283
|
};
|
|
1284
1284
|
}
|
|
1285
|
-
const
|
|
1286
|
-
function
|
|
1285
|
+
const Et = 8, St = " >> ";
|
|
1286
|
+
function de(e, t = document) {
|
|
1287
1287
|
if (!e) return !1;
|
|
1288
1288
|
try {
|
|
1289
1289
|
return t.querySelectorAll(`#${CSS.escape(e)}`).length === 1;
|
|
@@ -1291,70 +1291,79 @@ function le(e, t = document) {
|
|
|
1291
1291
|
return !1;
|
|
1292
1292
|
}
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function Ct(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 kt(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 At(e) {
|
|
1303
1303
|
if (!e || e.nodeType !== Node.ELEMENT_NODE) return "";
|
|
1304
|
-
if (e.id &&
|
|
1304
|
+
if (e.id && de(e.id))
|
|
1305
1305
|
return `#${CSS.escape(e.id)}`;
|
|
1306
|
-
const t = [];
|
|
1307
|
-
let
|
|
1308
|
-
for (;
|
|
1309
|
-
const
|
|
1310
|
-
if (
|
|
1311
|
-
t.unshift(`#${CSS.escape(
|
|
1306
|
+
const t = [], n = [];
|
|
1307
|
+
let o = e, a = 0;
|
|
1308
|
+
for (; o && o.tagName.toLowerCase() !== "body" && a < Et; ) {
|
|
1309
|
+
const i = o;
|
|
1310
|
+
if (i.id && de(i.id)) {
|
|
1311
|
+
t.unshift(`#${CSS.escape(i.id)}`);
|
|
1312
1312
|
break;
|
|
1313
1313
|
}
|
|
1314
|
-
const
|
|
1315
|
-
let
|
|
1316
|
-
if (
|
|
1314
|
+
const s = Ct(i), c = i.parentElement;
|
|
1315
|
+
let d = s;
|
|
1316
|
+
if (c)
|
|
1317
1317
|
try {
|
|
1318
|
-
const
|
|
1319
|
-
Array.from(
|
|
1320
|
-
(
|
|
1321
|
-
).length > 1 && (
|
|
1318
|
+
const l = Array.from(i.classList).join(" ");
|
|
1319
|
+
Array.from(c.children).filter(
|
|
1320
|
+
(p) => p.tagName === i.tagName && Array.from(p.classList).join(" ") === l
|
|
1321
|
+
).length > 1 && (d = `${i.tagName.toLowerCase()}:nth-of-type(${kt(i)})`);
|
|
1322
1322
|
} catch {
|
|
1323
1323
|
}
|
|
1324
|
-
t.unshift(
|
|
1324
|
+
if (t.unshift(d), t.length > 1 && n.unshift(" > "), c)
|
|
1325
|
+
o = c;
|
|
1326
|
+
else {
|
|
1327
|
+
const l = i.getRootNode();
|
|
1328
|
+
l instanceof ShadowRoot ? (o = l.host, t.length > 0 && (n[0] = St)) : o = null;
|
|
1329
|
+
}
|
|
1330
|
+
a++;
|
|
1325
1331
|
}
|
|
1326
|
-
|
|
1332
|
+
let r = t[0] ?? "";
|
|
1333
|
+
for (let i = 1; i < t.length; i++)
|
|
1334
|
+
r += (n[i - 1] ?? " > ") + t[i];
|
|
1335
|
+
return r;
|
|
1327
1336
|
}
|
|
1328
|
-
function
|
|
1337
|
+
function Lt(e) {
|
|
1329
1338
|
const t = Object.keys(e).filter(
|
|
1330
1339
|
(o) => o.startsWith("__reactFiber$") || o.startsWith("__reactInternalInstance$")
|
|
1331
1340
|
);
|
|
1332
1341
|
if (t.length === 0) return null;
|
|
1333
1342
|
let n = e[t[0]];
|
|
1334
1343
|
for (let o = 0; o < 10 && n; o++) {
|
|
1335
|
-
const
|
|
1336
|
-
if (typeof
|
|
1337
|
-
const i =
|
|
1344
|
+
const a = n, r = a.type;
|
|
1345
|
+
if (typeof r == "function") {
|
|
1346
|
+
const i = r.displayName ?? r.name;
|
|
1338
1347
|
if (i && i !== "_default") return { lib: "react", name: i };
|
|
1339
1348
|
}
|
|
1340
|
-
if (typeof
|
|
1341
|
-
const i =
|
|
1349
|
+
if (typeof r == "object" && r !== null) {
|
|
1350
|
+
const i = r.displayName ?? r.name;
|
|
1342
1351
|
if (i) return { lib: "react", name: i };
|
|
1343
1352
|
}
|
|
1344
|
-
n =
|
|
1353
|
+
n = a.return;
|
|
1345
1354
|
}
|
|
1346
1355
|
return { lib: "react" };
|
|
1347
1356
|
}
|
|
1348
|
-
function
|
|
1349
|
-
var o,
|
|
1357
|
+
function Tt(e) {
|
|
1358
|
+
var o, a;
|
|
1350
1359
|
const t = e, n = t.__vueParentComponent;
|
|
1351
1360
|
if (n) {
|
|
1352
|
-
const
|
|
1353
|
-
return { lib: "vue", ...
|
|
1361
|
+
const r = ((o = n.type) == null ? void 0 : o.name) ?? ((a = n.type) == null ? void 0 : a.__name);
|
|
1362
|
+
return { lib: "vue", ...r ? { name: r } : {} };
|
|
1354
1363
|
}
|
|
1355
1364
|
return t.__vue__ ? { lib: "vue" } : null;
|
|
1356
1365
|
}
|
|
1357
|
-
function
|
|
1366
|
+
function Nt(e) {
|
|
1358
1367
|
const t = window.ng;
|
|
1359
1368
|
if (!(t != null && t.getComponent)) return null;
|
|
1360
1369
|
try {
|
|
@@ -1366,13 +1375,13 @@ function Lt(e) {
|
|
|
1366
1375
|
return null;
|
|
1367
1376
|
}
|
|
1368
1377
|
}
|
|
1369
|
-
function
|
|
1378
|
+
function Mt(e) {
|
|
1370
1379
|
return "__svelte_meta" in e ? { lib: "svelte" } : null;
|
|
1371
1380
|
}
|
|
1372
|
-
function
|
|
1373
|
-
return
|
|
1381
|
+
function It(e) {
|
|
1382
|
+
return Lt(e) ?? Tt(e) ?? Nt(e) ?? Mt(e) ?? void 0;
|
|
1374
1383
|
}
|
|
1375
|
-
const
|
|
1384
|
+
const Rt = 5e3, Pt = 1e3, ue = 1e3, pe = 200, _t = 50, fe = 200, Dt = 500, $t = [
|
|
1376
1385
|
"display",
|
|
1377
1386
|
"position",
|
|
1378
1387
|
"top",
|
|
@@ -1411,60 +1420,60 @@ const Mt = 5e3, It = 1e3, de = 1e3, ue = 200, Rt = 50, pe = 200, _t = 500, Pt =
|
|
|
1411
1420
|
"grid-template-columns",
|
|
1412
1421
|
"grid-template-rows"
|
|
1413
1422
|
];
|
|
1414
|
-
function
|
|
1423
|
+
function me(e, t) {
|
|
1415
1424
|
return e.length <= t ? e : e.slice(0, t) + `
|
|
1416
1425
|
|
|
1417
1426
|
/* … truncated, original was ${e.length} chars */`;
|
|
1418
1427
|
}
|
|
1419
|
-
function
|
|
1428
|
+
function Bt(e) {
|
|
1420
1429
|
const t = getComputedStyle(e), n = {};
|
|
1421
|
-
for (const o of
|
|
1422
|
-
const
|
|
1423
|
-
|
|
1430
|
+
for (const o of $t) {
|
|
1431
|
+
const a = t.getPropertyValue(o);
|
|
1432
|
+
a && a !== "normal" && a !== "none" && a !== "auto" && a !== "0px" && (n[o] = a.trim().slice(0, Dt));
|
|
1424
1433
|
}
|
|
1425
1434
|
return n;
|
|
1426
1435
|
}
|
|
1427
|
-
function
|
|
1428
|
-
return Array.from(e.classList).slice(0,
|
|
1436
|
+
function zt(e) {
|
|
1437
|
+
return Array.from(e.classList).slice(0, _t).map((t) => t.length > fe ? t.slice(0, fe) : t);
|
|
1429
1438
|
}
|
|
1430
|
-
function
|
|
1431
|
-
const t = e.getBoundingClientRect(), n =
|
|
1439
|
+
function Ot(e) {
|
|
1440
|
+
const t = e.getBoundingClientRect(), n = At(e), o = e.id || null, a = It(e);
|
|
1432
1441
|
return {
|
|
1433
|
-
selector: n.length >
|
|
1442
|
+
selector: n.length > ue ? n.slice(0, ue) : n,
|
|
1434
1443
|
tagName: e.tagName.toLowerCase(),
|
|
1435
|
-
id: o && o.length >
|
|
1436
|
-
classList:
|
|
1437
|
-
outerHTML:
|
|
1438
|
-
...e.parentElement ? { parentOuterHTML:
|
|
1439
|
-
computedStyles:
|
|
1444
|
+
id: o && o.length > pe ? o.slice(0, pe) : o,
|
|
1445
|
+
classList: zt(e),
|
|
1446
|
+
outerHTML: me(e.outerHTML, Rt),
|
|
1447
|
+
...e.parentElement ? { parentOuterHTML: me(e.parentElement.outerHTML, Pt) } : {},
|
|
1448
|
+
computedStyles: Bt(e),
|
|
1440
1449
|
boundingRect: {
|
|
1441
1450
|
x: Math.round(t.x),
|
|
1442
1451
|
y: Math.round(t.y),
|
|
1443
1452
|
w: Math.round(t.width),
|
|
1444
1453
|
h: Math.round(t.height)
|
|
1445
1454
|
},
|
|
1446
|
-
...
|
|
1455
|
+
...a ? { framework: a } : {}
|
|
1447
1456
|
};
|
|
1448
1457
|
}
|
|
1449
|
-
const
|
|
1450
|
-
async function
|
|
1451
|
-
const
|
|
1452
|
-
|
|
1453
|
-
const i =
|
|
1458
|
+
const Ht = 14, Ut = "#ffffff", qt = "#ffffff", Ft = 3, jt = "#0ea5e9";
|
|
1459
|
+
async function _e(e, t, n, o = jt) {
|
|
1460
|
+
const a = await Wt(e), r = document.createElement("canvas");
|
|
1461
|
+
r.width = a.naturalWidth, r.height = a.naturalHeight;
|
|
1462
|
+
const i = r.getContext("2d");
|
|
1454
1463
|
if (!i) throw new Error("Could not get 2D canvas context");
|
|
1455
|
-
i.drawImage(
|
|
1456
|
-
const s =
|
|
1464
|
+
i.drawImage(a, 0, 0);
|
|
1465
|
+
const s = r.width / n.w, c = r.height / n.h;
|
|
1457
1466
|
for (const d of t) {
|
|
1458
|
-
const l =
|
|
1467
|
+
const l = Vt(d);
|
|
1459
1468
|
if (!l) continue;
|
|
1460
|
-
const
|
|
1461
|
-
i.lineWidth =
|
|
1462
|
-
const
|
|
1463
|
-
i.beginPath(), i.fillStyle = o, i.arc(
|
|
1469
|
+
const m = l.x * s, p = l.y * c, g = l.w * s, u = l.h * c;
|
|
1470
|
+
i.lineWidth = Ft, i.strokeStyle = o, i.strokeRect(m, p, g, u);
|
|
1471
|
+
const v = m + g, S = p;
|
|
1472
|
+
i.beginPath(), i.fillStyle = o, i.arc(v, S, Ht, 0, Math.PI * 2), i.fill(), i.lineWidth = 3, i.strokeStyle = Ut, i.stroke(), i.fillStyle = qt, i.font = "bold 16px system-ui, -apple-system, sans-serif", i.textAlign = "center", i.textBaseline = "middle", i.fillText(String(d.number), v, S + 1);
|
|
1464
1473
|
}
|
|
1465
|
-
return
|
|
1474
|
+
return r.toDataURL("image/jpeg", 0.85);
|
|
1466
1475
|
}
|
|
1467
|
-
function
|
|
1476
|
+
function Vt(e) {
|
|
1468
1477
|
if (e.liveElement && document.contains(e.liveElement)) {
|
|
1469
1478
|
const t = e.liveElement.getBoundingClientRect();
|
|
1470
1479
|
if (t.width > 0 || t.height > 0)
|
|
@@ -1482,21 +1491,21 @@ function Ft(e) {
|
|
|
1482
1491
|
}
|
|
1483
1492
|
return e.boundingRect;
|
|
1484
1493
|
}
|
|
1485
|
-
function
|
|
1494
|
+
function Wt(e) {
|
|
1486
1495
|
return new Promise((t, n) => {
|
|
1487
1496
|
const o = new Image();
|
|
1488
|
-
o.onload = () => t(o), o.onerror = (
|
|
1497
|
+
o.onload = () => t(o), o.onerror = (a) => n(a), o.src = e;
|
|
1489
1498
|
});
|
|
1490
1499
|
}
|
|
1491
|
-
const
|
|
1492
|
-
function
|
|
1500
|
+
const D = "beacon-no-capture", Yt = "#0ea5e9", he = "Click any element to pin it · Press Esc to finish";
|
|
1501
|
+
function be(e, t) {
|
|
1493
1502
|
return /^#[0-9a-fA-F]{6}$/.test(e) ? `${e}${t}` : e;
|
|
1494
1503
|
}
|
|
1495
|
-
function
|
|
1496
|
-
const t = e.accent ??
|
|
1497
|
-
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1504
|
+
function Xt(e = {}) {
|
|
1505
|
+
const t = e.accent ?? Yt, n = be(t, "b3"), o = be(t, "2e"), a = document.createElement("style");
|
|
1506
|
+
a.className = D, a.textContent = "@keyframes beacon-spin { to { transform: rotate(360deg); } }", document.head.appendChild(a);
|
|
1507
|
+
const r = document.createElement("div");
|
|
1508
|
+
r.className = D, r.setAttribute("aria-hidden", "true"), r.style.cssText = [
|
|
1500
1509
|
"position: fixed",
|
|
1501
1510
|
"inset: 0",
|
|
1502
1511
|
"pointer-events: none",
|
|
@@ -1507,7 +1516,7 @@ function Wt(e = {}) {
|
|
|
1507
1516
|
"box-sizing: border-box"
|
|
1508
1517
|
].join("; ");
|
|
1509
1518
|
const i = document.createElement("div");
|
|
1510
|
-
i.className =
|
|
1519
|
+
i.className = D, i.setAttribute("role", "status"), i.style.cssText = [
|
|
1511
1520
|
"position: fixed",
|
|
1512
1521
|
"top: 16px",
|
|
1513
1522
|
"left: 50%",
|
|
@@ -1522,7 +1531,7 @@ function Wt(e = {}) {
|
|
|
1522
1531
|
"pointer-events: none",
|
|
1523
1532
|
"white-space: nowrap",
|
|
1524
1533
|
"z-index: 2147483646"
|
|
1525
|
-
].join("; "), i.textContent =
|
|
1534
|
+
].join("; "), i.textContent = he;
|
|
1526
1535
|
const s = `<span style="
|
|
1527
1536
|
display: inline-block;
|
|
1528
1537
|
width: 12px;
|
|
@@ -1534,14 +1543,14 @@ function Wt(e = {}) {
|
|
|
1534
1543
|
vertical-align: middle;
|
|
1535
1544
|
margin-right: 8px;
|
|
1536
1545
|
"></span>`;
|
|
1537
|
-
function c(
|
|
1538
|
-
return
|
|
1546
|
+
function c(h) {
|
|
1547
|
+
return h.replace(/[<>&]/g, (f) => ({ "<": "<", ">": ">", "&": "&" })[f]);
|
|
1539
1548
|
}
|
|
1540
|
-
document.body.appendChild(
|
|
1549
|
+
document.body.appendChild(r), document.body.appendChild(i);
|
|
1541
1550
|
const d = /* @__PURE__ */ new Map();
|
|
1542
|
-
function l(
|
|
1543
|
-
const
|
|
1544
|
-
return
|
|
1551
|
+
function l(h) {
|
|
1552
|
+
const f = document.createElement("div");
|
|
1553
|
+
return f.className = D, f.setAttribute("aria-hidden", "true"), f.style.cssText = [
|
|
1545
1554
|
"position: fixed",
|
|
1546
1555
|
"width: 24px",
|
|
1547
1556
|
"height: 24px",
|
|
@@ -1556,67 +1565,75 @@ function Wt(e = {}) {
|
|
|
1556
1565
|
"box-shadow: 0 2px 8px hsl(0 0% 0% / 0.4)",
|
|
1557
1566
|
"pointer-events: none",
|
|
1558
1567
|
"z-index: 2147483646"
|
|
1559
|
-
].join("; "),
|
|
1568
|
+
].join("; "), f.textContent = String(h), document.body.appendChild(f), f;
|
|
1560
1569
|
}
|
|
1561
|
-
function
|
|
1562
|
-
const
|
|
1563
|
-
return
|
|
1570
|
+
function m() {
|
|
1571
|
+
const h = document.createElement("div");
|
|
1572
|
+
return h.className = D, h.setAttribute("aria-hidden", "true"), h.style.cssText = [
|
|
1564
1573
|
"position: fixed",
|
|
1565
1574
|
"pointer-events: none",
|
|
1566
1575
|
`border: 2px solid ${t}`,
|
|
1567
1576
|
"border-radius: 2px",
|
|
1568
1577
|
"box-sizing: border-box",
|
|
1569
1578
|
"z-index: 2147483645"
|
|
1570
|
-
].join("; "), document.body.appendChild(
|
|
1579
|
+
].join("; "), document.body.appendChild(h), h;
|
|
1571
1580
|
}
|
|
1572
|
-
function
|
|
1573
|
-
const
|
|
1574
|
-
|
|
1581
|
+
function p(h, f, E) {
|
|
1582
|
+
const b = E ? "0.5" : "1";
|
|
1583
|
+
h.outline.style.display = "block", h.outline.style.opacity = b, h.outline.style.left = `${f.x}px`, h.outline.style.top = `${f.y}px`, h.outline.style.width = `${f.w}px`, h.outline.style.height = `${f.h}px`, h.marker.style.display = "flex", h.marker.style.opacity = b, h.marker.style.left = `${f.x + f.w - 12}px`, h.marker.style.top = `${Math.max(2, f.y - 12)}px`;
|
|
1575
1584
|
}
|
|
1576
|
-
function
|
|
1577
|
-
|
|
1585
|
+
function g(h) {
|
|
1586
|
+
h.marker.style.display = "none", h.outline.style.display = "none";
|
|
1578
1587
|
}
|
|
1579
|
-
function
|
|
1580
|
-
d.forEach((
|
|
1581
|
-
let
|
|
1582
|
-
if (
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1588
|
+
function u() {
|
|
1589
|
+
d.forEach((h) => {
|
|
1590
|
+
let f = h.anchor.target;
|
|
1591
|
+
if (f && !f.isConnected && (f = null), !f && h.anchor.selector) {
|
|
1592
|
+
try {
|
|
1593
|
+
f = document.querySelector(h.anchor.selector);
|
|
1594
|
+
} catch {
|
|
1595
|
+
f = null;
|
|
1596
|
+
}
|
|
1597
|
+
f && (h.anchor.target = f);
|
|
1598
|
+
}
|
|
1599
|
+
if (f) {
|
|
1600
|
+
const b = f.getBoundingClientRect();
|
|
1601
|
+
if (b.width > 0 || b.height > 0) {
|
|
1602
|
+
p(h, { x: b.left, y: b.top, w: b.width, h: b.height }, !1);
|
|
1586
1603
|
return;
|
|
1587
1604
|
}
|
|
1588
1605
|
}
|
|
1589
|
-
const
|
|
1590
|
-
if (
|
|
1591
|
-
|
|
1606
|
+
const E = h.anchor.fallbackRect;
|
|
1607
|
+
if (E && (E.w > 0 || E.h > 0)) {
|
|
1608
|
+
p(h, E, !0);
|
|
1592
1609
|
return;
|
|
1593
1610
|
}
|
|
1594
|
-
|
|
1611
|
+
g(h);
|
|
1595
1612
|
});
|
|
1596
1613
|
}
|
|
1597
|
-
let
|
|
1598
|
-
function
|
|
1599
|
-
|
|
1600
|
-
|
|
1614
|
+
let v = null;
|
|
1615
|
+
function S() {
|
|
1616
|
+
v === null && (v = requestAnimationFrame(() => {
|
|
1617
|
+
v = null, u();
|
|
1601
1618
|
}));
|
|
1602
1619
|
}
|
|
1603
|
-
return window.addEventListener("scroll",
|
|
1604
|
-
addPin(
|
|
1605
|
-
const
|
|
1606
|
-
d.set(
|
|
1620
|
+
return window.addEventListener("scroll", S, !0), window.addEventListener("resize", S), {
|
|
1621
|
+
addPin(h, f) {
|
|
1622
|
+
const E = l(h), b = m();
|
|
1623
|
+
d.set(h, { anchor: f, marker: E, outline: b }), u();
|
|
1607
1624
|
},
|
|
1608
|
-
setLoading(
|
|
1609
|
-
|
|
1625
|
+
setLoading(h) {
|
|
1626
|
+
h ? i.innerHTML = s + c(h) : i.textContent = he;
|
|
1610
1627
|
},
|
|
1611
1628
|
destroy() {
|
|
1612
|
-
window.removeEventListener("scroll",
|
|
1613
|
-
|
|
1629
|
+
window.removeEventListener("scroll", S, !0), window.removeEventListener("resize", S), v !== null && cancelAnimationFrame(v), r.remove(), i.remove(), a.remove(), d.forEach(({ marker: h, outline: f }) => {
|
|
1630
|
+
h.remove(), f.remove();
|
|
1614
1631
|
}), d.clear();
|
|
1615
1632
|
}
|
|
1616
1633
|
};
|
|
1617
1634
|
}
|
|
1618
|
-
const
|
|
1619
|
-
function
|
|
1635
|
+
const Kt = '<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>', Gt = '<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>';
|
|
1636
|
+
function Jt(e) {
|
|
1620
1637
|
return new Promise((t) => {
|
|
1621
1638
|
const n = document.createElement("div");
|
|
1622
1639
|
n.className = "beacon-pin-popover open beacon-no-capture beacon-theme-auto", n.innerHTML = `
|
|
@@ -1625,15 +1642,15 @@ function Xt(e) {
|
|
|
1625
1642
|
<span class="beacon-pin-num">${e.pinNumber}</span>
|
|
1626
1643
|
<span>Note for this pin</span>
|
|
1627
1644
|
</div>
|
|
1628
|
-
<button type="button" class="beacon-icon-btn" data-action="cancel" aria-label="Discard this pin">${
|
|
1645
|
+
<button type="button" class="beacon-icon-btn" data-action="cancel" aria-label="Discard this pin">${Kt}</button>
|
|
1629
1646
|
</div>
|
|
1630
1647
|
<textarea class="beacon-textarea" rows="2" placeholder="Optional — describe what's wrong here…" style="min-height:48px;"></textarea>
|
|
1631
1648
|
<div class="beacon-pin-popover-actions">
|
|
1632
|
-
<button type="button" class="beacon-btn primary" data-action="save">${
|
|
1649
|
+
<button type="button" class="beacon-btn primary" data-action="save">${Gt} Save</button>
|
|
1633
1650
|
</div>
|
|
1634
1651
|
`;
|
|
1635
|
-
const o = 240,
|
|
1636
|
-
n.style.left = `${
|
|
1652
|
+
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);
|
|
1653
|
+
n.style.left = `${r}px`, n.style.top = `${i}px`, document.body.appendChild(n);
|
|
1637
1654
|
const s = n.querySelector("textarea");
|
|
1638
1655
|
s.focus();
|
|
1639
1656
|
function c(l) {
|
|
@@ -1643,37 +1660,37 @@ function Xt(e) {
|
|
|
1643
1660
|
l.key === "Escape" && (l.preventDefault(), l.stopPropagation(), c({ cancelled: "all" }));
|
|
1644
1661
|
}
|
|
1645
1662
|
document.addEventListener("keydown", d, !0), n.addEventListener("click", (l) => {
|
|
1646
|
-
var
|
|
1647
|
-
const
|
|
1648
|
-
if (
|
|
1649
|
-
const
|
|
1650
|
-
c({ ...
|
|
1663
|
+
var g;
|
|
1664
|
+
const p = (g = l.target.closest("[data-action]")) == null ? void 0 : g.getAttribute("data-action");
|
|
1665
|
+
if (p && (l.stopPropagation(), p === "cancel" && c({ cancelled: "pin" }), p === "save")) {
|
|
1666
|
+
const u = s.value.trim();
|
|
1667
|
+
c({ ...u ? { note: u } : {}, cancelled: !1 });
|
|
1651
1668
|
}
|
|
1652
1669
|
}), s.addEventListener("keydown", (l) => {
|
|
1653
1670
|
if (l.key === "Enter" && (l.metaKey || l.ctrlKey)) {
|
|
1654
1671
|
l.preventDefault();
|
|
1655
|
-
const
|
|
1656
|
-
c({ ...
|
|
1672
|
+
const m = s.value.trim();
|
|
1673
|
+
c({ ...m ? { note: m } : {}, cancelled: !1 });
|
|
1657
1674
|
}
|
|
1658
1675
|
});
|
|
1659
1676
|
});
|
|
1660
1677
|
}
|
|
1661
|
-
const
|
|
1662
|
-
function
|
|
1678
|
+
const Zt = "#0ea5e9";
|
|
1679
|
+
function Qt(e, t) {
|
|
1663
1680
|
return /^#[0-9a-fA-F]{6}$/.test(e) ? `${e}${t}` : e;
|
|
1664
1681
|
}
|
|
1665
|
-
function
|
|
1666
|
-
const { shadowRoot: t, onHover: n } = e, o = e.accent ??
|
|
1667
|
-
|
|
1682
|
+
function en(e) {
|
|
1683
|
+
const { shadowRoot: t, onHover: n } = e, o = e.accent ?? Zt, a = Qt(o, "14"), r = document.createElement("div");
|
|
1684
|
+
r.style.cssText = [
|
|
1668
1685
|
"position: fixed",
|
|
1669
1686
|
"pointer-events: none",
|
|
1670
1687
|
"z-index: 2147483646",
|
|
1671
1688
|
`border: 2px solid ${o}`,
|
|
1672
|
-
`background: ${
|
|
1689
|
+
`background: ${a}`,
|
|
1673
1690
|
"transition: all 60ms ease-out",
|
|
1674
1691
|
"box-sizing: border-box",
|
|
1675
1692
|
"border-radius: 2px"
|
|
1676
|
-
].join("; "), document.body.appendChild(
|
|
1693
|
+
].join("; "), document.body.appendChild(r);
|
|
1677
1694
|
const i = document.createElement("div");
|
|
1678
1695
|
i.style.cssText = [
|
|
1679
1696
|
"position: fixed",
|
|
@@ -1693,64 +1710,76 @@ function Zt(e) {
|
|
|
1693
1710
|
document.body.style.cursor = "crosshair";
|
|
1694
1711
|
let c = !1, d = () => {
|
|
1695
1712
|
};
|
|
1696
|
-
const l = new Promise((
|
|
1697
|
-
d =
|
|
1713
|
+
const l = new Promise((b) => {
|
|
1714
|
+
d = b;
|
|
1698
1715
|
});
|
|
1699
|
-
function
|
|
1700
|
-
if (!
|
|
1701
|
-
let
|
|
1702
|
-
for (;
|
|
1703
|
-
if (
|
|
1704
|
-
|
|
1716
|
+
function m(b) {
|
|
1717
|
+
if (!b || !(b instanceof Node)) return !1;
|
|
1718
|
+
let x = b;
|
|
1719
|
+
for (; x; ) {
|
|
1720
|
+
if (x === t || x === t.host) return !0;
|
|
1721
|
+
x = x.parentNode ?? x.host ?? null;
|
|
1705
1722
|
}
|
|
1706
1723
|
return !1;
|
|
1707
1724
|
}
|
|
1708
|
-
function
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1725
|
+
function p(b) {
|
|
1726
|
+
return b.tagName.includes("-");
|
|
1727
|
+
}
|
|
1728
|
+
function g(b, x) {
|
|
1729
|
+
var C, k;
|
|
1730
|
+
r.style.display = "none", i.style.display = "none";
|
|
1731
|
+
const A = document.elementsFromPoint(b, x);
|
|
1732
|
+
r.style.display = "block", i.style.display = "block";
|
|
1733
|
+
for (const T of A) {
|
|
1734
|
+
if (m(T)) continue;
|
|
1735
|
+
let y = T, L = 16;
|
|
1736
|
+
for (; y.shadowRoot && !p(y) && L-- > 0; ) {
|
|
1737
|
+
const M = (((k = (C = y.shadowRoot).elementsFromPoint) == null ? void 0 : k.call(C, b, x)) ?? []).find((O) => !m(O) && O !== y);
|
|
1738
|
+
if (!M) break;
|
|
1739
|
+
y = M;
|
|
1740
|
+
}
|
|
1741
|
+
return y;
|
|
1742
|
+
}
|
|
1714
1743
|
return null;
|
|
1715
1744
|
}
|
|
1716
|
-
function b
|
|
1717
|
-
const
|
|
1718
|
-
|
|
1719
|
-
const
|
|
1720
|
-
i.textContent =
|
|
1721
|
-
const
|
|
1722
|
-
i.style.left = `${
|
|
1745
|
+
function u(b) {
|
|
1746
|
+
const x = b.getBoundingClientRect();
|
|
1747
|
+
r.style.left = `${x.left}px`, r.style.top = `${x.top}px`, r.style.width = `${x.width}px`, r.style.height = `${x.height}px`;
|
|
1748
|
+
const A = b.tagName.toLowerCase(), C = b.classList.length > 0 ? "." + Array.from(b.classList).slice(0, 2).join(".") : "";
|
|
1749
|
+
i.textContent = A + C;
|
|
1750
|
+
const k = x.top - 22;
|
|
1751
|
+
i.style.left = `${x.left}px`, i.style.top = `${k >= 0 ? k : x.bottom + 4}px`;
|
|
1723
1752
|
}
|
|
1724
|
-
function
|
|
1725
|
-
const
|
|
1726
|
-
|
|
1753
|
+
function v(b) {
|
|
1754
|
+
const x = g(b.clientX, b.clientY);
|
|
1755
|
+
x ? (u(x), n == null || n(x)) : (r.style.display = "none", i.style.display = "none", n == null || n(null));
|
|
1727
1756
|
}
|
|
1728
|
-
function
|
|
1729
|
-
if (
|
|
1730
|
-
|
|
1731
|
-
const
|
|
1732
|
-
|
|
1757
|
+
function S(b) {
|
|
1758
|
+
if (b.button !== 0) return;
|
|
1759
|
+
b.preventDefault(), b.stopPropagation();
|
|
1760
|
+
const x = g(b.clientX, b.clientY);
|
|
1761
|
+
x && E(x);
|
|
1733
1762
|
}
|
|
1734
|
-
function
|
|
1735
|
-
|
|
1763
|
+
function h(b) {
|
|
1764
|
+
b.preventDefault(), b.stopPropagation();
|
|
1736
1765
|
}
|
|
1737
|
-
function
|
|
1738
|
-
|
|
1766
|
+
function f(b) {
|
|
1767
|
+
b.key === "Escape" && (b.preventDefault(), E(null));
|
|
1739
1768
|
}
|
|
1740
|
-
function
|
|
1741
|
-
c || (c = !0, document.removeEventListener("mousemove",
|
|
1769
|
+
function E(b) {
|
|
1770
|
+
c || (c = !0, document.removeEventListener("mousemove", v, !0), document.removeEventListener("pointerdown", S, !0), document.removeEventListener("click", h, !0), document.removeEventListener("mouseup", h, !0), document.removeEventListener("keydown", f, !0), r.remove(), i.remove(), document.body.style.cursor = s, d(b));
|
|
1742
1771
|
}
|
|
1743
|
-
return document.addEventListener("mousemove",
|
|
1744
|
-
cancel: () =>
|
|
1772
|
+
return document.addEventListener("mousemove", v, !0), document.addEventListener("pointerdown", S, !0), document.addEventListener("click", h, !0), document.addEventListener("mouseup", h, !0), document.addEventListener("keydown", f, !0), {
|
|
1773
|
+
cancel: () => E(null),
|
|
1745
1774
|
promise: l
|
|
1746
1775
|
};
|
|
1747
1776
|
}
|
|
1748
|
-
let
|
|
1749
|
-
async function
|
|
1750
|
-
return
|
|
1777
|
+
let X = null;
|
|
1778
|
+
async function tn() {
|
|
1779
|
+
return X || (X = await import("./index-DAIDnjfR.mjs")), X;
|
|
1751
1780
|
}
|
|
1752
1781
|
const q = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=";
|
|
1753
|
-
function
|
|
1782
|
+
function ge(e, t) {
|
|
1754
1783
|
if (!e || e.startsWith("data:") || e.startsWith("blob:") || e.startsWith("/") || e.startsWith("#")) return !0;
|
|
1755
1784
|
try {
|
|
1756
1785
|
if (new URL(e, window.location.href).origin === window.location.origin) return !0;
|
|
@@ -1759,61 +1788,119 @@ function be(e, t) {
|
|
|
1759
1788
|
}
|
|
1760
1789
|
return t === "anonymous" || t === "use-credentials";
|
|
1761
1790
|
}
|
|
1762
|
-
function
|
|
1791
|
+
function nn() {
|
|
1763
1792
|
const e = [], t = [];
|
|
1764
1793
|
return document.querySelectorAll("img").forEach((n) => {
|
|
1765
|
-
|
|
1794
|
+
ge(n.src, n.crossOrigin) || (e.push({ el: n, src: n.src }), n.src = q);
|
|
1766
1795
|
}), document.querySelectorAll("image").forEach((n) => {
|
|
1767
|
-
const o = n,
|
|
1768
|
-
i && !
|
|
1796
|
+
const o = n, a = o.getAttribute("href"), r = o.getAttributeNS("http://www.w3.org/1999/xlink", "href"), i = a || r || "";
|
|
1797
|
+
i && !ge(i) && (t.push({ el: o, href: a, xlink: r }), a !== null && o.setAttribute("href", q), r !== null && o.setAttributeNS("http://www.w3.org/1999/xlink", "href", q));
|
|
1769
1798
|
}), () => {
|
|
1770
1799
|
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),
|
|
1800
|
+
for (const { el: n, href: o, xlink: a } of t)
|
|
1801
|
+
o !== null && n.setAttribute("href", o), a !== null && n.setAttributeNS("http://www.w3.org/1999/xlink", "href", a);
|
|
1802
|
+
};
|
|
1803
|
+
}
|
|
1804
|
+
function on() {
|
|
1805
|
+
const e = [];
|
|
1806
|
+
document.querySelectorAll("*").forEach((r) => {
|
|
1807
|
+
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;
|
|
1808
|
+
(s || c) && e.push(r);
|
|
1809
|
+
});
|
|
1810
|
+
const t = window.scrollX, n = window.scrollY, o = e.map((r) => ({
|
|
1811
|
+
el: r,
|
|
1812
|
+
scrollLeft: r.scrollLeft,
|
|
1813
|
+
scrollTop: r.scrollTop
|
|
1814
|
+
})), a = /* @__PURE__ */ new Map();
|
|
1815
|
+
for (const r of e) {
|
|
1816
|
+
let i = r;
|
|
1817
|
+
for (; i && i !== document.documentElement.parentElement; )
|
|
1818
|
+
a.has(i) || a.set(i, i.style.cssText), i = i.parentElement;
|
|
1819
|
+
}
|
|
1820
|
+
for (const r of a.keys())
|
|
1821
|
+
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");
|
|
1822
|
+
return () => {
|
|
1823
|
+
for (const [r, i] of a)
|
|
1824
|
+
r.style.cssText = i;
|
|
1825
|
+
for (const { el: r, scrollLeft: i, scrollTop: s } of o)
|
|
1826
|
+
r.scrollLeft = i, r.scrollTop = s;
|
|
1827
|
+
window.scrollTo(t, n);
|
|
1773
1828
|
};
|
|
1774
1829
|
}
|
|
1775
|
-
|
|
1830
|
+
let ye = Promise.resolve();
|
|
1831
|
+
async function De(e = {}) {
|
|
1832
|
+
const t = ye;
|
|
1833
|
+
let n;
|
|
1834
|
+
ye = new Promise((o) => {
|
|
1835
|
+
n = o;
|
|
1836
|
+
});
|
|
1837
|
+
try {
|
|
1838
|
+
return await t, await rn(e, n);
|
|
1839
|
+
} catch (o) {
|
|
1840
|
+
throw n(), o;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
async function rn(e, t) {
|
|
1776
1844
|
const {
|
|
1777
|
-
quality:
|
|
1778
|
-
pixelRatio:
|
|
1779
|
-
excludeShadowRoot:
|
|
1780
|
-
excludeHosts: r
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1845
|
+
quality: n = 0.7,
|
|
1846
|
+
pixelRatio: o = Math.min(window.devicePixelRatio || 1, 2),
|
|
1847
|
+
excludeShadowRoot: a,
|
|
1848
|
+
excludeHosts: r,
|
|
1849
|
+
fullPage: i = !0
|
|
1850
|
+
} = e, s = await tn(), c = a || r != null && r.length ? (g) => {
|
|
1851
|
+
let u = g;
|
|
1852
|
+
for (; u; ) {
|
|
1853
|
+
if (a && u === a.host || r && u instanceof Element && r.includes(u) || u instanceof Element && u.classList.contains("beacon-no-capture")) return !1;
|
|
1854
|
+
u = u.parentNode;
|
|
1786
1855
|
}
|
|
1787
1856
|
return !0;
|
|
1788
|
-
} : void 0,
|
|
1857
|
+
} : void 0, d = nn(), l = i ? on() : () => {
|
|
1858
|
+
};
|
|
1859
|
+
let m = !1;
|
|
1860
|
+
const p = () => {
|
|
1861
|
+
if (!m) {
|
|
1862
|
+
m = !0;
|
|
1863
|
+
try {
|
|
1864
|
+
l();
|
|
1865
|
+
} finally {
|
|
1866
|
+
try {
|
|
1867
|
+
d();
|
|
1868
|
+
} finally {
|
|
1869
|
+
t();
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
};
|
|
1789
1874
|
try {
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1875
|
+
i && await new Promise((h) => requestAnimationFrame(() => h()));
|
|
1876
|
+
const g = document.documentElement, u = i ? Math.max(g.scrollWidth, window.innerWidth) : window.innerWidth, v = i ? Math.max(g.scrollHeight, window.innerHeight) : window.innerHeight;
|
|
1877
|
+
return { dataUrl: await s.toJpeg(g, {
|
|
1878
|
+
quality: n,
|
|
1879
|
+
pixelRatio: o,
|
|
1793
1880
|
cacheBust: !0,
|
|
1794
|
-
...
|
|
1881
|
+
...c ? { filter: c } : {},
|
|
1795
1882
|
imagePlaceholder: q,
|
|
1796
|
-
width:
|
|
1797
|
-
height:
|
|
1883
|
+
width: u,
|
|
1884
|
+
height: v,
|
|
1798
1885
|
style: { transform: "none" }
|
|
1799
|
-
});
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1886
|
+
}), width: u, height: v, pixelRatio: o, dispose: p };
|
|
1887
|
+
} catch (g) {
|
|
1888
|
+
throw p(), g;
|
|
1802
1889
|
}
|
|
1803
1890
|
}
|
|
1804
|
-
let
|
|
1805
|
-
function
|
|
1806
|
-
|
|
1891
|
+
let ee = null;
|
|
1892
|
+
function an(e) {
|
|
1893
|
+
ee = e;
|
|
1807
1894
|
}
|
|
1808
|
-
function
|
|
1809
|
-
return
|
|
1895
|
+
function sn() {
|
|
1896
|
+
return ee;
|
|
1810
1897
|
}
|
|
1811
|
-
function
|
|
1812
|
-
|
|
1898
|
+
function R() {
|
|
1899
|
+
ee = null;
|
|
1813
1900
|
}
|
|
1814
|
-
const
|
|
1815
|
-
function
|
|
1816
|
-
const e = document.createElementNS(
|
|
1901
|
+
const ve = "http://www.w3.org/2000/svg";
|
|
1902
|
+
function cn() {
|
|
1903
|
+
const e = document.createElementNS(ve, "svg");
|
|
1817
1904
|
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
1905
|
const t = [
|
|
1819
1906
|
"M3 6h18",
|
|
@@ -1821,35 +1908,35 @@ function on() {
|
|
|
1821
1908
|
"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"
|
|
1822
1909
|
];
|
|
1823
1910
|
for (const n of t) {
|
|
1824
|
-
const o = document.createElementNS(
|
|
1911
|
+
const o = document.createElementNS(ve, "path");
|
|
1825
1912
|
o.setAttribute("d", n), e.appendChild(o);
|
|
1826
1913
|
}
|
|
1827
1914
|
return e;
|
|
1828
1915
|
}
|
|
1829
|
-
function
|
|
1916
|
+
function ln(e = {}) {
|
|
1830
1917
|
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
|
-
}
|
|
1918
|
+
let n = [], o = /* @__PURE__ */ new WeakMap(), a = null, r = 0, i = null, s = null, c = null, d = null;
|
|
1835
1919
|
function l() {
|
|
1836
|
-
|
|
1837
|
-
|
|
1920
|
+
n = [], o = /* @__PURE__ */ new WeakMap(), a = null, r += 1, R(), S(), h();
|
|
1921
|
+
}
|
|
1922
|
+
function m() {
|
|
1923
|
+
const f = document.querySelector("launch-kit-beacon");
|
|
1924
|
+
return (f == null ? void 0 : f.shadowRoot) ?? null;
|
|
1838
1925
|
}
|
|
1839
1926
|
function p() {
|
|
1840
1927
|
if (typeof window > "u") return e.accent ?? "#0ea5e9";
|
|
1841
1928
|
if (e.accent) return e.accent;
|
|
1842
|
-
const
|
|
1843
|
-
return
|
|
1929
|
+
const f = document.querySelector("launch-kit-beacon");
|
|
1930
|
+
return f && getComputedStyle(f).getPropertyValue("--beacon-accent").trim() || "#0ea5e9";
|
|
1844
1931
|
}
|
|
1845
|
-
async function f
|
|
1846
|
-
const
|
|
1847
|
-
if (!
|
|
1848
|
-
const
|
|
1932
|
+
async function g(f) {
|
|
1933
|
+
const E = m();
|
|
1934
|
+
if (!E) return;
|
|
1935
|
+
const b = p(), x = await f.requestMode("pickElement"), A = Xt({ accent: b });
|
|
1849
1936
|
for (const C of n) {
|
|
1850
|
-
const
|
|
1851
|
-
|
|
1852
|
-
target:
|
|
1937
|
+
const k = o.get(C);
|
|
1938
|
+
k && A.addPin(C.number, {
|
|
1939
|
+
target: k,
|
|
1853
1940
|
selector: C.selector,
|
|
1854
1941
|
fallbackRect: C.boundingRect
|
|
1855
1942
|
});
|
|
@@ -1857,93 +1944,103 @@ function rn(e = {}) {
|
|
|
1857
1944
|
try {
|
|
1858
1945
|
let C = !0;
|
|
1859
1946
|
for (; C && !(n.length >= t); ) {
|
|
1860
|
-
const
|
|
1861
|
-
if (!
|
|
1862
|
-
const
|
|
1863
|
-
anchor: { x:
|
|
1947
|
+
const T = await en({ shadowRoot: E, accent: b }).promise;
|
|
1948
|
+
if (!T) break;
|
|
1949
|
+
const y = T.getBoundingClientRect(), L = await Jt({
|
|
1950
|
+
anchor: { x: y.left, y: y.bottom },
|
|
1864
1951
|
pinNumber: n.length + 1
|
|
1865
1952
|
});
|
|
1866
|
-
if (
|
|
1953
|
+
if (L.cancelled === "all") {
|
|
1867
1954
|
C = !1;
|
|
1868
1955
|
break;
|
|
1869
1956
|
}
|
|
1870
|
-
if (
|
|
1871
|
-
const
|
|
1957
|
+
if (L.cancelled === "pin") continue;
|
|
1958
|
+
const I = Ot(T), M = {
|
|
1872
1959
|
number: n.length + 1,
|
|
1873
|
-
...
|
|
1874
|
-
...
|
|
1960
|
+
...I,
|
|
1961
|
+
...L.note ? { note: L.note } : {}
|
|
1875
1962
|
};
|
|
1876
|
-
n.push(
|
|
1877
|
-
target:
|
|
1878
|
-
selector:
|
|
1879
|
-
fallbackRect:
|
|
1963
|
+
n.push(M), o.set(M, T), A.addPin(M.number, {
|
|
1964
|
+
target: T,
|
|
1965
|
+
selector: I.selector,
|
|
1966
|
+
fallbackRect: I.boundingRect
|
|
1880
1967
|
});
|
|
1881
1968
|
}
|
|
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();
|
|
1969
|
+
n.length > 0 ? (A.setLoading("Capturing screenshot…"), await new Promise((k) => requestAnimationFrame(() => k())), await u()) : (a = null, R());
|
|
1901
1970
|
} finally {
|
|
1902
|
-
|
|
1971
|
+
A.destroy(), x();
|
|
1903
1972
|
}
|
|
1904
|
-
|
|
1905
|
-
}
|
|
1906
|
-
function b(g) {
|
|
1907
|
-
const u = n.findIndex((y) => y.number === g);
|
|
1908
|
-
u !== -1 && (n.splice(u, 1), n.forEach((y, h) => {
|
|
1909
|
-
y.number = h + 1;
|
|
1910
|
-
}), r = null, D(), m(), x());
|
|
1973
|
+
S(), h();
|
|
1911
1974
|
}
|
|
1912
|
-
function
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1975
|
+
async function u() {
|
|
1976
|
+
const f = ++r;
|
|
1977
|
+
if (n.length === 0) {
|
|
1978
|
+
a = null, R(), h();
|
|
1979
|
+
return;
|
|
1980
|
+
}
|
|
1981
|
+
const E = p();
|
|
1982
|
+
try {
|
|
1983
|
+
const b = Array.from(document.querySelectorAll("launch-kit-beacon")), x = await De({ excludeHosts: b });
|
|
1984
|
+
try {
|
|
1985
|
+
if (f !== r) return;
|
|
1986
|
+
const A = n.map((T) => ({
|
|
1987
|
+
number: T.number,
|
|
1988
|
+
selector: T.selector,
|
|
1989
|
+
boundingRect: T.boundingRect,
|
|
1990
|
+
...o.get(T) ? { liveElement: o.get(T) } : {}
|
|
1991
|
+
})), C = { w: x.width, h: x.height, dpr: x.pixelRatio }, k = await _e(x.dataUrl, A, C, E);
|
|
1992
|
+
if (f !== r) return;
|
|
1993
|
+
a = k, an({ dataUrl: k, mime: "image/jpeg" });
|
|
1994
|
+
} finally {
|
|
1995
|
+
x.dispose();
|
|
1996
|
+
}
|
|
1997
|
+
} catch {
|
|
1998
|
+
if (f !== r) return;
|
|
1999
|
+
a = null, R();
|
|
2000
|
+
}
|
|
2001
|
+
f === r && h();
|
|
2002
|
+
}
|
|
2003
|
+
function v(f) {
|
|
2004
|
+
const E = n.findIndex((b) => b.number === f);
|
|
2005
|
+
E !== -1 && (n.splice(E, 1), n.forEach((b, x) => {
|
|
2006
|
+
b.number = x + 1;
|
|
2007
|
+
}), a = null, R(), S(), h(), u());
|
|
2008
|
+
}
|
|
2009
|
+
function S() {
|
|
2010
|
+
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) {
|
|
2011
|
+
s.innerHTML = "", s.style.display = n.length === 0 ? "none" : "";
|
|
2012
|
+
for (const f of n) {
|
|
2013
|
+
const E = document.createElement("div");
|
|
2014
|
+
E.className = "beacon-pin-item", E.dataset.pin = String(f.number);
|
|
2015
|
+
const b = document.createElement("span");
|
|
2016
|
+
b.className = "beacon-pin-num", b.textContent = String(f.number);
|
|
2017
|
+
const x = document.createElement("div");
|
|
2018
|
+
x.className = "beacon-pin-meta";
|
|
2019
|
+
const A = document.createElement("div");
|
|
2020
|
+
A.className = "beacon-pin-selector", A.title = f.selector, A.textContent = f.selector || f.tagName;
|
|
1924
2021
|
const C = document.createElement("input");
|
|
1925
|
-
C.type = "text", C.className = "beacon-pin-note-input", C.placeholder = "Add a note (optional)", C.value =
|
|
1926
|
-
C.value.trim() ?
|
|
1927
|
-
}),
|
|
1928
|
-
const
|
|
1929
|
-
|
|
2022
|
+
C.type = "text", C.className = "beacon-pin-note-input", C.placeholder = "Add a note (optional)", C.value = f.note ?? "", C.addEventListener("input", () => {
|
|
2023
|
+
C.value.trim() ? f.note = C.value : delete f.note;
|
|
2024
|
+
}), x.appendChild(A), x.appendChild(C);
|
|
2025
|
+
const k = document.createElement("button");
|
|
2026
|
+
k.type = "button", k.className = "beacon-icon-btn", k.setAttribute("aria-label", `Remove pin ${f.number}`), k.appendChild(cn()), k.addEventListener("click", () => v(f.number)), E.appendChild(b), E.appendChild(x), E.appendChild(k), s.appendChild(E);
|
|
1930
2027
|
}
|
|
1931
2028
|
}
|
|
1932
2029
|
}
|
|
1933
|
-
function
|
|
1934
|
-
|
|
2030
|
+
function h() {
|
|
2031
|
+
c && (a ? (c.src = a, c.style.display = "block") : (c.removeAttribute("src"), c.style.display = "none"));
|
|
1935
2032
|
}
|
|
1936
2033
|
return {
|
|
1937
2034
|
name: "domEle",
|
|
1938
|
-
setupOnce(
|
|
1939
|
-
return
|
|
2035
|
+
setupOnce(f) {
|
|
2036
|
+
return f.on("close", () => l());
|
|
1940
2037
|
},
|
|
1941
|
-
form(
|
|
2038
|
+
form(f) {
|
|
1942
2039
|
return {
|
|
1943
|
-
render: (
|
|
1944
|
-
f
|
|
1945
|
-
}),
|
|
1946
|
-
|
|
2040
|
+
render: (E) => (i = document.createElement("div"), i.className = "beacon-pin-list-header", E.appendChild(i), s = document.createElement("div"), s.className = "beacon-pin-list", E.appendChild(s), d = document.createElement("button"), d.type = "button", d.className = "beacon-btn secondary beacon-pin-annotate", d.addEventListener("click", () => {
|
|
2041
|
+
g(f);
|
|
2042
|
+
}), E.appendChild(d), c = document.createElement("img"), c.className = "beacon-thumb", c.alt = "Annotated screenshot preview", c.style.display = "none", E.appendChild(c), S(), h(), () => {
|
|
2043
|
+
i = null, s = null, c = null, d = null;
|
|
1947
2044
|
})
|
|
1948
2045
|
};
|
|
1949
2046
|
},
|
|
@@ -1952,37 +2049,38 @@ function rn(e = {}) {
|
|
|
1952
2049
|
}
|
|
1953
2050
|
};
|
|
1954
2051
|
}
|
|
1955
|
-
function
|
|
2052
|
+
function dn(e) {
|
|
1956
2053
|
return !!e && typeof e == "object" && !("v" in e) && "error" in e;
|
|
1957
2054
|
}
|
|
1958
|
-
function
|
|
2055
|
+
function un(e = {}) {
|
|
1959
2056
|
return {
|
|
1960
2057
|
name: "domSS",
|
|
1961
2058
|
async capture(t) {
|
|
1962
|
-
const n =
|
|
2059
|
+
const n = sn();
|
|
1963
2060
|
if (n)
|
|
1964
2061
|
return { dataUrl: n.dataUrl, mime: n.mime };
|
|
1965
2062
|
const o = await t.requestMode("hide");
|
|
1966
2063
|
try {
|
|
1967
|
-
await new Promise((
|
|
1968
|
-
const
|
|
2064
|
+
await new Promise((i) => requestAnimationFrame(() => i()));
|
|
2065
|
+
const a = Array.from(document.querySelectorAll("launch-kit-beacon")), r = await De({
|
|
1969
2066
|
quality: e.quality,
|
|
1970
2067
|
pixelRatio: e.pixelRatio,
|
|
1971
|
-
excludeHosts:
|
|
1972
|
-
})
|
|
1973
|
-
|
|
1974
|
-
h:
|
|
1975
|
-
|
|
1976
|
-
}
|
|
1977
|
-
|
|
2068
|
+
excludeHosts: a
|
|
2069
|
+
});
|
|
2070
|
+
try {
|
|
2071
|
+
const i = t.captured("domEle"), s = pn(i), c = { w: r.width, h: r.height, dpr: r.pixelRatio }, d = e.accent ?? fn();
|
|
2072
|
+
return { dataUrl: s.length > 0 ? await _e(r.dataUrl, s, c, d) : r.dataUrl, mime: "image/jpeg" };
|
|
2073
|
+
} finally {
|
|
2074
|
+
r.dispose();
|
|
2075
|
+
}
|
|
1978
2076
|
} finally {
|
|
1979
2077
|
o();
|
|
1980
2078
|
}
|
|
1981
2079
|
}
|
|
1982
2080
|
};
|
|
1983
2081
|
}
|
|
1984
|
-
function
|
|
1985
|
-
if (!e ||
|
|
2082
|
+
function pn(e) {
|
|
2083
|
+
if (!e || dn(e)) return [];
|
|
1986
2084
|
const t = e.pins;
|
|
1987
2085
|
return Array.isArray(t) ? t.filter((n) => !!n && typeof n == "object").map((n) => ({
|
|
1988
2086
|
number: Number(n.number) || 0,
|
|
@@ -1990,19 +2088,19 @@ function cn(e) {
|
|
|
1990
2088
|
boundingRect: n.boundingRect ?? { x: 0, y: 0, w: 0, h: 0 }
|
|
1991
2089
|
})) : [];
|
|
1992
2090
|
}
|
|
1993
|
-
function
|
|
2091
|
+
function fn() {
|
|
1994
2092
|
if (typeof window > "u") return "#0ea5e9";
|
|
1995
2093
|
const e = document.querySelector("launch-kit-beacon");
|
|
1996
2094
|
return e && getComputedStyle(e).getPropertyValue("--beacon-accent").trim() || "#0ea5e9";
|
|
1997
2095
|
}
|
|
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);
|
|
2096
|
+
const xe = "beacon-no-capture", we = "__lsBeaconMonitorChipPos", mn = "#10b981";
|
|
2097
|
+
function hn(e) {
|
|
2098
|
+
const t = e.accent ?? mn, n = e.startedAt ?? Date.now(), o = document.createElement("div");
|
|
2099
|
+
o.className = `${xe} beacon-monitor-overlay-frame`, o.setAttribute("aria-hidden", "true"), o.style.setProperty("--beacon-monitor-accent", t), document.body.appendChild(o);
|
|
2004
2100
|
const a = document.createElement("div");
|
|
2005
|
-
a.className =
|
|
2101
|
+
a.className = `${xe} beacon-monitor-overlay-chip`, a.setAttribute("role", "status"), a.setAttribute("aria-label", "Recording — drag to move"), a.style.setProperty("--beacon-monitor-accent", t);
|
|
2102
|
+
const r = document.createElement("div");
|
|
2103
|
+
r.className = "beacon-monitor-overlay-chip-row";
|
|
2006
2104
|
const i = document.createElement("span");
|
|
2007
2105
|
i.className = "beacon-monitor-overlay-rec-dot", i.setAttribute("aria-hidden", "true");
|
|
2008
2106
|
const s = document.createElement("span");
|
|
@@ -2012,176 +2110,176 @@ function un(e) {
|
|
|
2012
2110
|
const d = document.createElement("span");
|
|
2013
2111
|
d.className = "beacon-monitor-overlay-timer", d.textContent = "00:00";
|
|
2014
2112
|
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
|
|
2113
|
+
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);
|
|
2114
|
+
const m = document.createElement("div");
|
|
2115
|
+
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);
|
|
2116
|
+
const p = g() ?? u();
|
|
2117
|
+
S(v(p));
|
|
2118
|
+
function g() {
|
|
2021
2119
|
try {
|
|
2022
|
-
const
|
|
2023
|
-
if (!
|
|
2024
|
-
const
|
|
2025
|
-
return !Number.isFinite(I) || !Number.isFinite(
|
|
2120
|
+
const y = localStorage.getItem(we);
|
|
2121
|
+
if (!y) return null;
|
|
2122
|
+
const L = JSON.parse(y), I = typeof L.x == "number" ? L.x : NaN, M = typeof L.y == "number" ? L.y : NaN;
|
|
2123
|
+
return !Number.isFinite(I) || !Number.isFinite(M) ? null : { x: I, y: M };
|
|
2026
2124
|
} catch {
|
|
2027
2125
|
return null;
|
|
2028
2126
|
}
|
|
2029
2127
|
}
|
|
2030
|
-
function
|
|
2031
|
-
const
|
|
2032
|
-
return { x: Math.max(8, Math.floor((window.innerWidth -
|
|
2128
|
+
function u() {
|
|
2129
|
+
const L = a.getBoundingClientRect().width || 200;
|
|
2130
|
+
return { x: Math.max(8, Math.floor((window.innerWidth - L) / 2)), y: 16 };
|
|
2033
2131
|
}
|
|
2034
|
-
function
|
|
2035
|
-
const I =
|
|
2132
|
+
function v(y) {
|
|
2133
|
+
const I = a.getBoundingClientRect(), M = I.width || 200, O = I.height || 40, We = Math.max(8, window.innerWidth - M - 8), Ye = Math.max(8, window.innerHeight - O - 8);
|
|
2036
2134
|
return {
|
|
2037
|
-
x: Math.min(Math.max(8,
|
|
2038
|
-
y: Math.min(Math.max(8,
|
|
2135
|
+
x: Math.min(Math.max(8, y.x), We),
|
|
2136
|
+
y: Math.min(Math.max(8, y.y), Ye)
|
|
2039
2137
|
};
|
|
2040
2138
|
}
|
|
2041
|
-
function
|
|
2042
|
-
|
|
2139
|
+
function S(y) {
|
|
2140
|
+
a.style.left = `${y.x}px`, a.style.top = `${y.y}px`;
|
|
2043
2141
|
}
|
|
2044
|
-
let
|
|
2045
|
-
function
|
|
2046
|
-
if (
|
|
2047
|
-
|
|
2142
|
+
let h = !1, f = null, E = { x: 0, y: 0 };
|
|
2143
|
+
function b(y) {
|
|
2144
|
+
if (y.target instanceof Element && y.target.closest(".beacon-monitor-overlay-stop")) return;
|
|
2145
|
+
y.preventDefault(), h = !0, f = y.pointerId;
|
|
2048
2146
|
try {
|
|
2049
|
-
|
|
2147
|
+
a.setPointerCapture(y.pointerId);
|
|
2050
2148
|
} catch {
|
|
2051
2149
|
}
|
|
2052
|
-
|
|
2053
|
-
const
|
|
2054
|
-
|
|
2150
|
+
a.setAttribute("data-dragging", "true");
|
|
2151
|
+
const L = a.getBoundingClientRect();
|
|
2152
|
+
E = { x: y.clientX - L.left, y: y.clientY - L.top };
|
|
2055
2153
|
}
|
|
2056
|
-
function
|
|
2057
|
-
!
|
|
2154
|
+
function x(y) {
|
|
2155
|
+
!h || y.pointerId !== f || S(v({ x: y.clientX - E.x, y: y.clientY - E.y }));
|
|
2058
2156
|
}
|
|
2059
|
-
function
|
|
2060
|
-
if (!
|
|
2061
|
-
|
|
2157
|
+
function A(y) {
|
|
2158
|
+
if (!h || y.pointerId !== f) return;
|
|
2159
|
+
h = !1, f = null, a.removeAttribute("data-dragging");
|
|
2062
2160
|
try {
|
|
2063
|
-
|
|
2161
|
+
a.releasePointerCapture(y.pointerId);
|
|
2064
2162
|
} catch {
|
|
2065
2163
|
}
|
|
2066
|
-
const
|
|
2164
|
+
const L = a.getBoundingClientRect();
|
|
2067
2165
|
try {
|
|
2068
|
-
localStorage.setItem(
|
|
2166
|
+
localStorage.setItem(we, JSON.stringify({ x: L.left, y: L.top }));
|
|
2069
2167
|
} catch {
|
|
2070
2168
|
}
|
|
2071
2169
|
}
|
|
2072
|
-
|
|
2073
|
-
|
|
2170
|
+
a.addEventListener("pointerdown", b), a.addEventListener("pointermove", x), a.addEventListener("pointerup", A), a.addEventListener("pointercancel", A), l.addEventListener("click", (y) => {
|
|
2171
|
+
y.stopPropagation(), e.onStop();
|
|
2074
2172
|
});
|
|
2075
|
-
function
|
|
2076
|
-
const
|
|
2077
|
-
|
|
2173
|
+
function C() {
|
|
2174
|
+
const y = a.getBoundingClientRect();
|
|
2175
|
+
S(v({ x: y.left, y: y.top }));
|
|
2078
2176
|
}
|
|
2079
|
-
window.addEventListener("resize",
|
|
2080
|
-
function
|
|
2081
|
-
const
|
|
2082
|
-
d.textContent =
|
|
2177
|
+
window.addEventListener("resize", C);
|
|
2178
|
+
function k() {
|
|
2179
|
+
const y = Math.max(0, Math.floor((Date.now() - n) / 1e3));
|
|
2180
|
+
d.textContent = bn(y);
|
|
2083
2181
|
}
|
|
2084
|
-
|
|
2085
|
-
const
|
|
2182
|
+
k();
|
|
2183
|
+
const T = window.setInterval(k, 1e3);
|
|
2086
2184
|
return {
|
|
2087
|
-
updateUrl(
|
|
2088
|
-
|
|
2185
|
+
updateUrl(y) {
|
|
2186
|
+
y ? (m.textContent = y, m.title = y, m.style.display = "") : m.style.display = "none";
|
|
2089
2187
|
},
|
|
2090
2188
|
destroy() {
|
|
2091
|
-
window.clearInterval(
|
|
2189
|
+
window.clearInterval(T), window.removeEventListener("resize", C), a.removeEventListener("pointerdown", b), a.removeEventListener("pointermove", x), a.removeEventListener("pointerup", A), a.removeEventListener("pointercancel", A), o.remove(), a.remove();
|
|
2092
2190
|
}
|
|
2093
2191
|
};
|
|
2094
2192
|
}
|
|
2095
|
-
function
|
|
2193
|
+
function bn(e) {
|
|
2096
2194
|
const t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), o = e % 60;
|
|
2097
|
-
return t > 0 ? `${
|
|
2195
|
+
return t > 0 ? `${$(t)}:${$(n)}:${$(o)}` : `${$(n)}:${$(o)}`;
|
|
2098
2196
|
}
|
|
2099
|
-
function
|
|
2197
|
+
function $(e) {
|
|
2100
2198
|
return e < 10 ? `0${e}` : String(e);
|
|
2101
2199
|
}
|
|
2102
|
-
const
|
|
2103
|
-
function
|
|
2200
|
+
const H = 80, gn = 'button, a, input[type="submit"], input[type="button"], [role="button"], [role="link"], [role="menuitem"], [role="tab"], [role="option"]', yn = 1024, vn = 5;
|
|
2201
|
+
function xn(e, t) {
|
|
2104
2202
|
return e.length > t ? e.slice(0, t) : e;
|
|
2105
2203
|
}
|
|
2106
|
-
function
|
|
2204
|
+
function te(e) {
|
|
2107
2205
|
if (e.id) return `#${CSS.escape(e.id)}`;
|
|
2108
2206
|
const t = [];
|
|
2109
2207
|
let n = e;
|
|
2110
2208
|
for (let o = 0; o < 5 && n; o++) {
|
|
2111
|
-
const
|
|
2112
|
-
if (t.unshift(`${
|
|
2209
|
+
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(".") : "";
|
|
2210
|
+
if (t.unshift(`${a}${r}${i}`), r) break;
|
|
2113
2211
|
n = n.parentElement;
|
|
2114
2212
|
}
|
|
2115
2213
|
return t.join(" > ");
|
|
2116
2214
|
}
|
|
2117
|
-
function
|
|
2215
|
+
function U(e, t) {
|
|
2118
2216
|
if (!e) return;
|
|
2119
2217
|
const n = e.replace(/\s+/g, " ").trim();
|
|
2120
2218
|
if (n)
|
|
2121
2219
|
return n.length > t ? n.slice(0, t) : n;
|
|
2122
2220
|
}
|
|
2123
|
-
function
|
|
2124
|
-
const t =
|
|
2125
|
-
let
|
|
2126
|
-
if (!
|
|
2127
|
-
const i = e.closest(
|
|
2128
|
-
i && i !== e && (
|
|
2221
|
+
function Ee(e) {
|
|
2222
|
+
const t = U(e.textContent, H), n = U(e.getAttribute("aria-label"), H), o = e.getAttribute("data-testid") || void 0, a = e.getAttribute("name") || void 0;
|
|
2223
|
+
let r = n || t;
|
|
2224
|
+
if (!r) {
|
|
2225
|
+
const i = e.closest(gn);
|
|
2226
|
+
i && i !== e && (r = U(i.getAttribute("aria-label"), H) || U(i.textContent, H));
|
|
2129
2227
|
}
|
|
2130
2228
|
return {
|
|
2131
2229
|
tag: e.tagName.toLowerCase(),
|
|
2132
2230
|
id: e.id || null,
|
|
2133
2231
|
classes: Array.from(e.classList).slice(0, 10),
|
|
2134
2232
|
role: e.getAttribute("role"),
|
|
2135
|
-
selector:
|
|
2233
|
+
selector: te(e),
|
|
2136
2234
|
...t ? { text: t } : {},
|
|
2137
2235
|
...n ? { ariaLabel: n } : {},
|
|
2138
2236
|
...o ? { testid: o } : {},
|
|
2139
|
-
...
|
|
2237
|
+
...a ? { name: a } : {},
|
|
2140
2238
|
// Only include label when it adds something beyond `text` (avoids dup).
|
|
2141
|
-
...
|
|
2239
|
+
...r && r !== t ? { label: r } : {}
|
|
2142
2240
|
};
|
|
2143
2241
|
}
|
|
2144
|
-
function
|
|
2242
|
+
function wn(e, t) {
|
|
2145
2243
|
const n = [], o = document.querySelectorAll("body *");
|
|
2146
|
-
for (const
|
|
2147
|
-
const
|
|
2148
|
-
if (
|
|
2149
|
-
const i =
|
|
2244
|
+
for (const a of Array.from(o)) {
|
|
2245
|
+
const r = getComputedStyle(a);
|
|
2246
|
+
if (r.position !== "fixed" && r.position !== "sticky") continue;
|
|
2247
|
+
const i = a.getBoundingClientRect();
|
|
2150
2248
|
if (e < i.left || e > i.right || t < i.top || t > i.bottom) continue;
|
|
2151
|
-
const s = parseInt(
|
|
2152
|
-
!Number.isFinite(s) &&
|
|
2153
|
-
tag:
|
|
2249
|
+
const s = parseInt(r.zIndex, 10);
|
|
2250
|
+
!Number.isFinite(s) && r.zIndex !== "auto" || n.push({
|
|
2251
|
+
tag: a.tagName.toLowerCase(),
|
|
2154
2252
|
zIndex: Number.isFinite(s) ? s : 0,
|
|
2155
|
-
pointerEvents:
|
|
2156
|
-
classes: Array.from(
|
|
2253
|
+
pointerEvents: r.pointerEvents,
|
|
2254
|
+
classes: Array.from(a.classList).slice(0, 5).join(" ")
|
|
2157
2255
|
});
|
|
2158
2256
|
}
|
|
2159
|
-
return n.sort((
|
|
2257
|
+
return n.sort((a, r) => r.zIndex - a.zIndex).slice(0, vn);
|
|
2160
2258
|
}
|
|
2161
|
-
function
|
|
2162
|
-
const t = (
|
|
2163
|
-
const i =
|
|
2259
|
+
function En(e) {
|
|
2260
|
+
const t = (a) => (r) => {
|
|
2261
|
+
const i = r, s = i.target;
|
|
2164
2262
|
if (!(s instanceof Element)) return;
|
|
2165
|
-
const c = i.clientX, d = i.clientY, l = document.elementFromPoint(c, d),
|
|
2263
|
+
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 ? [] : wn(c, d);
|
|
2166
2264
|
e.emitClick({
|
|
2167
|
-
kind:
|
|
2168
|
-
target:
|
|
2169
|
-
hitMatchesTarget:
|
|
2170
|
-
...!
|
|
2265
|
+
kind: a,
|
|
2266
|
+
target: Ee(s),
|
|
2267
|
+
hitMatchesTarget: m,
|
|
2268
|
+
...!m && l instanceof Element ? { hitTarget: Ee(l) } : {},
|
|
2171
2269
|
coords: { x: c, y: d },
|
|
2172
|
-
openDialogs:
|
|
2173
|
-
bodyPointerEvents:
|
|
2174
|
-
...
|
|
2270
|
+
openDialogs: p,
|
|
2271
|
+
bodyPointerEvents: g,
|
|
2272
|
+
...u.length > 0 ? { overlaysAtPoint: u } : {}
|
|
2175
2273
|
});
|
|
2176
2274
|
}, n = t("click"), o = t("mousedown");
|
|
2177
2275
|
return document.addEventListener("click", n, { capture: !0, passive: !0 }), document.addEventListener("mousedown", o, { capture: !0, passive: !0 }), () => {
|
|
2178
2276
|
document.removeEventListener("click", n, { capture: !0 }), document.removeEventListener("mousedown", o, { capture: !0 });
|
|
2179
2277
|
};
|
|
2180
2278
|
}
|
|
2181
|
-
function
|
|
2279
|
+
function Sn(e) {
|
|
2182
2280
|
const t = history.pushState, n = history.replaceState;
|
|
2183
2281
|
let o = window.location.href;
|
|
2184
|
-
const
|
|
2282
|
+
const a = (s) => {
|
|
2185
2283
|
const c = window.location.href;
|
|
2186
2284
|
if (c === o) return;
|
|
2187
2285
|
const d = o;
|
|
@@ -2189,43 +2287,43 @@ function vn(e) {
|
|
|
2189
2287
|
};
|
|
2190
2288
|
history.pushState = function(...c) {
|
|
2191
2289
|
const d = t.apply(this, c);
|
|
2192
|
-
return
|
|
2290
|
+
return a("pushState"), d;
|
|
2193
2291
|
}, history.replaceState = function(...c) {
|
|
2194
2292
|
const d = n.apply(this, c);
|
|
2195
|
-
return
|
|
2293
|
+
return a("replaceState"), d;
|
|
2196
2294
|
};
|
|
2197
|
-
const
|
|
2198
|
-
return window.addEventListener("popstate",
|
|
2199
|
-
history.pushState = t, history.replaceState = n, window.removeEventListener("popstate",
|
|
2295
|
+
const r = () => a("popstate"), i = () => a("hashchange");
|
|
2296
|
+
return window.addEventListener("popstate", r), window.addEventListener("hashchange", i), () => {
|
|
2297
|
+
history.pushState = t, history.replaceState = n, window.removeEventListener("popstate", r), window.removeEventListener("hashchange", i);
|
|
2200
2298
|
};
|
|
2201
2299
|
}
|
|
2202
|
-
function
|
|
2203
|
-
const t = /* @__PURE__ */ new WeakSet(), n = (
|
|
2204
|
-
const i =
|
|
2300
|
+
function Cn(e) {
|
|
2301
|
+
const t = /* @__PURE__ */ new WeakSet(), n = (a, r) => {
|
|
2302
|
+
const i = te(a);
|
|
2205
2303
|
e.emitDialog({
|
|
2206
2304
|
kind: "dialog",
|
|
2207
|
-
action:
|
|
2305
|
+
action: r,
|
|
2208
2306
|
selector: i,
|
|
2209
|
-
state:
|
|
2210
|
-
...
|
|
2307
|
+
state: a.getAttribute("data-state"),
|
|
2308
|
+
...r === "mount" ? { outerHTML: xn(a.outerHTML, yn) } : {}
|
|
2211
2309
|
});
|
|
2212
2310
|
};
|
|
2213
|
-
for (const
|
|
2214
|
-
t.add(
|
|
2215
|
-
const o = new MutationObserver((
|
|
2216
|
-
var
|
|
2217
|
-
for (const d of
|
|
2311
|
+
for (const a of Array.from(document.querySelectorAll('[role="dialog"]')))
|
|
2312
|
+
t.add(a);
|
|
2313
|
+
const o = new MutationObserver((a) => {
|
|
2314
|
+
var r, i, s, c;
|
|
2315
|
+
for (const d of a) {
|
|
2218
2316
|
for (const l of Array.from(d.addedNodes)) {
|
|
2219
2317
|
if (!(l instanceof Element)) continue;
|
|
2220
|
-
const
|
|
2221
|
-
for (const
|
|
2222
|
-
t.has(
|
|
2318
|
+
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"]')) ?? []);
|
|
2319
|
+
for (const p of m)
|
|
2320
|
+
t.has(p) || (t.add(p), n(p, "mount"));
|
|
2223
2321
|
}
|
|
2224
2322
|
for (const l of Array.from(d.removedNodes)) {
|
|
2225
2323
|
if (!(l instanceof Element)) continue;
|
|
2226
|
-
const
|
|
2227
|
-
for (const
|
|
2228
|
-
t.has(
|
|
2324
|
+
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"]')) ?? []);
|
|
2325
|
+
for (const p of m)
|
|
2326
|
+
t.has(p) && (t.delete(p), n(p, "unmount"));
|
|
2229
2327
|
}
|
|
2230
2328
|
d.type === "attributes" && d.attributeName === "data-state" && d.target instanceof Element && d.target.getAttribute("role") === "dialog" && n(d.target, "state");
|
|
2231
2329
|
}
|
|
@@ -2237,16 +2335,16 @@ function xn(e) {
|
|
|
2237
2335
|
attributeFilter: ["data-state"]
|
|
2238
2336
|
}), () => o.disconnect();
|
|
2239
2337
|
}
|
|
2240
|
-
function
|
|
2338
|
+
function kn(e) {
|
|
2241
2339
|
const t = (n) => {
|
|
2242
2340
|
const o = n.target;
|
|
2243
2341
|
if (!(o instanceof HTMLFormElement)) return;
|
|
2244
|
-
const
|
|
2245
|
-
for (const
|
|
2246
|
-
if (!(
|
|
2247
|
-
const i =
|
|
2342
|
+
const a = [];
|
|
2343
|
+
for (const r of Array.from(o.elements)) {
|
|
2344
|
+
if (!(r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement)) continue;
|
|
2345
|
+
const i = r.getAttribute("name") || "<unnamed>", s = r instanceof HTMLInputElement ? r.type : r.tagName.toLowerCase();
|
|
2248
2346
|
let c;
|
|
2249
|
-
|
|
2347
|
+
r instanceof HTMLInputElement && (r.type === "checkbox" || r.type === "radio") ? c = r.checked : c = !!r.value, a.push({ name: i, type: s, hasValue: c });
|
|
2250
2348
|
}
|
|
2251
2349
|
e.emitSubmit({
|
|
2252
2350
|
kind: "submit",
|
|
@@ -2254,129 +2352,129 @@ function wn(e) {
|
|
|
2254
2352
|
id: o.id || null,
|
|
2255
2353
|
action: o.getAttribute("action") || null,
|
|
2256
2354
|
method: (o.getAttribute("method") || "GET").toUpperCase(),
|
|
2257
|
-
selector:
|
|
2258
|
-
fields:
|
|
2355
|
+
selector: te(o),
|
|
2356
|
+
fields: a
|
|
2259
2357
|
}
|
|
2260
2358
|
});
|
|
2261
2359
|
};
|
|
2262
2360
|
return document.addEventListener("submit", t, { capture: !0 }), () => document.removeEventListener("submit", t, { capture: !0 });
|
|
2263
2361
|
}
|
|
2264
|
-
function
|
|
2265
|
-
const t =
|
|
2362
|
+
function An(e) {
|
|
2363
|
+
const t = En(e), n = Sn(e), o = Cn(e), a = kn(e);
|
|
2266
2364
|
return {
|
|
2267
2365
|
uninstall() {
|
|
2268
|
-
t(), n(), o(),
|
|
2366
|
+
t(), n(), o(), a();
|
|
2269
2367
|
}
|
|
2270
2368
|
};
|
|
2271
2369
|
}
|
|
2272
|
-
const
|
|
2370
|
+
const G = 1e3, Se = 10 * 1024, $e = "[REDACTED]", Be = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]), Ln = [
|
|
2273
2371
|
/Bearer\s+[A-Za-z0-9._\-+/=]+/gi,
|
|
2274
2372
|
/\bls_pat_[A-Za-z0-9_]+/g,
|
|
2275
2373
|
// JWT: three dot-separated base64url segments starting with eyJ (the b64
|
|
2276
2374
|
// encoding of the JSON {"). Matches Auth0/Clerk/most providers' tokens.
|
|
2277
2375
|
/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g
|
|
2278
|
-
],
|
|
2279
|
-
function
|
|
2376
|
+
], Tn = /^(password|passwd|secret|token|api[_-]?key|auth|access[_-]?token|refresh[_-]?token|client[_-]?secret|private[_-]?key)$/i;
|
|
2377
|
+
function J(e, t) {
|
|
2280
2378
|
return e.length > t ? e.slice(0, t) : e;
|
|
2281
2379
|
}
|
|
2282
|
-
function
|
|
2380
|
+
function ze(e) {
|
|
2283
2381
|
let t = e;
|
|
2284
|
-
for (const n of
|
|
2285
|
-
t = t.replace(n,
|
|
2382
|
+
for (const n of Ln)
|
|
2383
|
+
t = t.replace(n, $e);
|
|
2286
2384
|
return t;
|
|
2287
2385
|
}
|
|
2288
|
-
function
|
|
2386
|
+
function Z(e) {
|
|
2289
2387
|
if (e === null || typeof e != "object")
|
|
2290
|
-
return typeof e == "string" ?
|
|
2291
|
-
if (Array.isArray(e)) return e.map(
|
|
2388
|
+
return typeof e == "string" ? ze(e) : e;
|
|
2389
|
+
if (Array.isArray(e)) return e.map(Z);
|
|
2292
2390
|
const t = {};
|
|
2293
2391
|
for (const [n, o] of Object.entries(e))
|
|
2294
|
-
t[n] =
|
|
2392
|
+
t[n] = Tn.test(n) ? $e : Z(o);
|
|
2295
2393
|
return t;
|
|
2296
2394
|
}
|
|
2297
|
-
function
|
|
2395
|
+
function Ce(e, t) {
|
|
2298
2396
|
if (t && t.includes("application/json"))
|
|
2299
2397
|
try {
|
|
2300
2398
|
const n = JSON.parse(e);
|
|
2301
|
-
return JSON.stringify(
|
|
2399
|
+
return JSON.stringify(Z(n));
|
|
2302
2400
|
} catch {
|
|
2303
2401
|
}
|
|
2304
|
-
return
|
|
2402
|
+
return ze(e);
|
|
2305
2403
|
}
|
|
2306
|
-
function
|
|
2404
|
+
function F(e, t) {
|
|
2307
2405
|
const n = e.length, o = { bodySize: n };
|
|
2308
|
-
return n >
|
|
2406
|
+
return n > Se ? (o.body = Ce(e.slice(0, Se), t), o.bodyTruncated = !0) : o.body = Ce(e, t), t && (o.contentType = t), o;
|
|
2309
2407
|
}
|
|
2310
|
-
function
|
|
2408
|
+
function Nn(e, t) {
|
|
2311
2409
|
const n = t == null ? void 0 : t.body;
|
|
2312
2410
|
if (n != null) {
|
|
2313
2411
|
if (typeof n == "string") return n;
|
|
2314
2412
|
if (n instanceof URLSearchParams) return n.toString();
|
|
2315
2413
|
if (n instanceof FormData) {
|
|
2316
2414
|
const o = [];
|
|
2317
|
-
return n.forEach((
|
|
2318
|
-
o.push(`${
|
|
2415
|
+
return n.forEach((a, r) => {
|
|
2416
|
+
o.push(`${r}=${typeof a == "string" ? `[${a.length}b]` : "[file]"}`);
|
|
2319
2417
|
}), `[FormData] ${o.join("&")}`;
|
|
2320
2418
|
}
|
|
2321
2419
|
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
2420
|
}
|
|
2323
2421
|
return e instanceof Request, null;
|
|
2324
2422
|
}
|
|
2325
|
-
function
|
|
2326
|
-
return !!(((o) => o ? o instanceof Headers ? o.has("authorization") : Array.isArray(o) ? o.some(([
|
|
2423
|
+
function Mn(e, t) {
|
|
2424
|
+
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
2425
|
}
|
|
2328
|
-
function
|
|
2426
|
+
function In(e, t) {
|
|
2329
2427
|
return ((o) => {
|
|
2330
2428
|
if (o) {
|
|
2331
2429
|
if (o instanceof Headers) return o.get("content-type") || void 0;
|
|
2332
2430
|
if (Array.isArray(o)) {
|
|
2333
|
-
const
|
|
2334
|
-
return
|
|
2431
|
+
const a = o.find(([r]) => r.toLowerCase() === "content-type");
|
|
2432
|
+
return a ? a[1] : void 0;
|
|
2335
2433
|
}
|
|
2336
2434
|
if (typeof o == "object") {
|
|
2337
|
-
for (const [
|
|
2338
|
-
if (
|
|
2435
|
+
for (const [a, r] of Object.entries(o))
|
|
2436
|
+
if (a.toLowerCase() === "content-type") return r;
|
|
2339
2437
|
}
|
|
2340
2438
|
}
|
|
2341
2439
|
})(t == null ? void 0 : t.headers) ?? (e instanceof Request && e.headers.get("content-type") || void 0);
|
|
2342
2440
|
}
|
|
2343
|
-
function
|
|
2344
|
-
if (!
|
|
2345
|
-
const o =
|
|
2346
|
-
if (
|
|
2347
|
-
const
|
|
2441
|
+
function Rn(e, t, n) {
|
|
2442
|
+
if (!Be.has(n)) return;
|
|
2443
|
+
const o = Mn(e, t), a = Nn(e, t);
|
|
2444
|
+
if (a == null && !o) return;
|
|
2445
|
+
const r = In(e, t), i = a != null ? F(a, r) : {};
|
|
2348
2446
|
return o && (i.hasAuth = !0), i;
|
|
2349
2447
|
}
|
|
2350
|
-
function
|
|
2448
|
+
function Pn(e) {
|
|
2351
2449
|
const t = window.fetch;
|
|
2352
2450
|
if (typeof t != "function") return () => {
|
|
2353
2451
|
};
|
|
2354
|
-
const n = async (o,
|
|
2355
|
-
const
|
|
2452
|
+
const n = async (o, a) => {
|
|
2453
|
+
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 = Rn(o, a, i);
|
|
2356
2454
|
try {
|
|
2357
|
-
const d = await t.call(window, o,
|
|
2358
|
-
let
|
|
2359
|
-
if (
|
|
2455
|
+
const d = await t.call(window, o, a), l = Math.round(performance.now() - r), m = d.status >= 400;
|
|
2456
|
+
let p;
|
|
2457
|
+
if (m || e.verbose)
|
|
2360
2458
|
try {
|
|
2361
|
-
const
|
|
2362
|
-
|
|
2459
|
+
const g = await d.clone().text(), u = d.headers.get("content-type") || void 0;
|
|
2460
|
+
p = F(g, u);
|
|
2363
2461
|
} catch {
|
|
2364
2462
|
}
|
|
2365
|
-
return (
|
|
2463
|
+
return (m || e.verbose) && e.emit({
|
|
2366
2464
|
kind: "fetch",
|
|
2367
|
-
url:
|
|
2465
|
+
url: J(s, G),
|
|
2368
2466
|
method: i,
|
|
2369
2467
|
status: d.status,
|
|
2370
2468
|
durationMs: l,
|
|
2371
|
-
failed:
|
|
2469
|
+
failed: m,
|
|
2372
2470
|
...c ? { request: c } : {},
|
|
2373
|
-
...
|
|
2471
|
+
...p ? { response: p } : {}
|
|
2374
2472
|
}), d;
|
|
2375
2473
|
} catch (d) {
|
|
2376
|
-
const l = Math.round(performance.now() -
|
|
2474
|
+
const l = Math.round(performance.now() - r);
|
|
2377
2475
|
throw e.emit({
|
|
2378
2476
|
kind: "fetch",
|
|
2379
|
-
url:
|
|
2477
|
+
url: J(s, G),
|
|
2380
2478
|
method: i,
|
|
2381
2479
|
status: 0,
|
|
2382
2480
|
durationMs: l,
|
|
@@ -2390,7 +2488,7 @@ function Tn(e) {
|
|
|
2390
2488
|
window.fetch.__lsBeaconWrapped && (window.fetch = t);
|
|
2391
2489
|
};
|
|
2392
2490
|
}
|
|
2393
|
-
function
|
|
2491
|
+
function _n(e) {
|
|
2394
2492
|
if (e == null) return null;
|
|
2395
2493
|
if (typeof e == "string") return e;
|
|
2396
2494
|
if (e instanceof URLSearchParams) return e.toString();
|
|
@@ -2402,88 +2500,88 @@ function Mn(e) {
|
|
|
2402
2500
|
}
|
|
2403
2501
|
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
2502
|
}
|
|
2405
|
-
function
|
|
2406
|
-
const t = XMLHttpRequest.prototype, n = t.open, o = t.send,
|
|
2503
|
+
function Dn(e) {
|
|
2504
|
+
const t = XMLHttpRequest.prototype, n = t.open, o = t.send, a = t.setRequestHeader, r = /* @__PURE__ */ new WeakMap();
|
|
2407
2505
|
return t.open = function(s, c, ...d) {
|
|
2408
|
-
return
|
|
2506
|
+
return r.set(this, {
|
|
2409
2507
|
method: s.toUpperCase(),
|
|
2410
2508
|
url: typeof c == "string" ? c : c.toString(),
|
|
2411
2509
|
start: 0,
|
|
2412
2510
|
hasAuth: !1
|
|
2413
2511
|
}), n.call(this, s, c, ...d);
|
|
2414
2512
|
}, t.setRequestHeader = function(s, c) {
|
|
2415
|
-
const d =
|
|
2513
|
+
const d = r.get(this);
|
|
2416
2514
|
if (d) {
|
|
2417
2515
|
const l = s.toLowerCase();
|
|
2418
2516
|
l === "authorization" ? d.hasAuth = !0 : l === "content-type" && (d.requestContentType = c);
|
|
2419
2517
|
}
|
|
2420
|
-
return
|
|
2518
|
+
return a.call(this, s, c);
|
|
2421
2519
|
}, t.send = function(s) {
|
|
2422
|
-
const c =
|
|
2520
|
+
const c = r.get(this);
|
|
2423
2521
|
if (c)
|
|
2424
|
-
if (c.start = performance.now(),
|
|
2425
|
-
const l =
|
|
2426
|
-
l != null ? c.request =
|
|
2522
|
+
if (c.start = performance.now(), Be.has(c.method)) {
|
|
2523
|
+
const l = _n(s);
|
|
2524
|
+
l != null ? c.request = F(l, c.requestContentType) : c.request = {}, c.hasAuth && (c.request.hasAuth = !0);
|
|
2427
2525
|
} else c.hasAuth && (c.request = { hasAuth: !0 });
|
|
2428
2526
|
const d = () => {
|
|
2429
2527
|
this.removeEventListener("loadend", d);
|
|
2430
|
-
const l =
|
|
2528
|
+
const l = r.get(this);
|
|
2431
2529
|
if (!l) return;
|
|
2432
|
-
const
|
|
2433
|
-
let
|
|
2434
|
-
if ((
|
|
2530
|
+
const m = Math.round(performance.now() - l.start), p = this.status === 0 || this.status >= 400;
|
|
2531
|
+
let g;
|
|
2532
|
+
if ((p || e.verbose) && this.status > 0)
|
|
2435
2533
|
try {
|
|
2436
|
-
const
|
|
2437
|
-
if (
|
|
2438
|
-
const
|
|
2439
|
-
|
|
2534
|
+
const u = this.responseType === "" || this.responseType === "text" ? this.responseText : "";
|
|
2535
|
+
if (u) {
|
|
2536
|
+
const v = this.getResponseHeader("content-type") || void 0;
|
|
2537
|
+
g = F(u, v);
|
|
2440
2538
|
}
|
|
2441
2539
|
} catch {
|
|
2442
2540
|
}
|
|
2443
|
-
(
|
|
2541
|
+
(p || e.verbose) && e.emit({
|
|
2444
2542
|
kind: "xhr",
|
|
2445
|
-
url:
|
|
2543
|
+
url: J(l.url, G),
|
|
2446
2544
|
method: l.method,
|
|
2447
2545
|
status: this.status,
|
|
2448
|
-
durationMs:
|
|
2449
|
-
failed:
|
|
2546
|
+
durationMs: m,
|
|
2547
|
+
failed: p,
|
|
2450
2548
|
...l.request ? { request: l.request } : {},
|
|
2451
|
-
...
|
|
2452
|
-
}),
|
|
2549
|
+
...g ? { response: g } : {}
|
|
2550
|
+
}), r.delete(this);
|
|
2453
2551
|
};
|
|
2454
2552
|
return this.addEventListener("loadend", d), o.call(this, s);
|
|
2455
2553
|
}, () => {
|
|
2456
|
-
t.open = n, t.send = o, t.setRequestHeader =
|
|
2554
|
+
t.open = n, t.send = o, t.setRequestHeader = a;
|
|
2457
2555
|
};
|
|
2458
2556
|
}
|
|
2459
|
-
function
|
|
2460
|
-
const t =
|
|
2557
|
+
function $n(e) {
|
|
2558
|
+
const t = Pn(e), n = Dn(e);
|
|
2461
2559
|
return {
|
|
2462
2560
|
uninstall() {
|
|
2463
2561
|
t(), n();
|
|
2464
2562
|
}
|
|
2465
2563
|
};
|
|
2466
2564
|
}
|
|
2467
|
-
const
|
|
2468
|
-
class
|
|
2565
|
+
const Bn = 1e3, ke = 50, zn = 500;
|
|
2566
|
+
class On {
|
|
2469
2567
|
constructor(t) {
|
|
2470
2568
|
this.buffer = [], this.inflight = !1, this.timer = null, this.destroyed = !1, this.handleVisibilityChange = () => {
|
|
2471
2569
|
document.visibilityState === "hidden" && this.flushSync();
|
|
2472
2570
|
}, this.url = t.url, this.sessionId = t.sessionId, this.onError = t.onError, this.timer = setInterval(() => {
|
|
2473
2571
|
this.flush();
|
|
2474
|
-
},
|
|
2572
|
+
}, Bn), this.pagehideHandler = () => this.flushSync(), window.addEventListener("pagehide", this.pagehideHandler), document.addEventListener("visibilitychange", this.handleVisibilityChange);
|
|
2475
2573
|
}
|
|
2476
2574
|
enqueue(t) {
|
|
2477
|
-
this.destroyed || (this.buffer.push(t), this.buffer.length >
|
|
2575
|
+
this.destroyed || (this.buffer.push(t), this.buffer.length > zn && this.buffer.shift(), this.buffer.length >= ke && this.flush());
|
|
2478
2576
|
}
|
|
2479
2577
|
/** Async flush via fetch. No-op when in-flight or empty. */
|
|
2480
2578
|
async flush() {
|
|
2481
|
-
var o,
|
|
2579
|
+
var o, a;
|
|
2482
2580
|
if (this.destroyed || this.inflight || this.buffer.length === 0) return;
|
|
2483
|
-
const t = this.buffer.splice(0,
|
|
2581
|
+
const t = this.buffer.splice(0, ke), n = this.makeBatch(t);
|
|
2484
2582
|
this.inflight = !0;
|
|
2485
2583
|
try {
|
|
2486
|
-
const
|
|
2584
|
+
const r = await fetch(this.url, {
|
|
2487
2585
|
method: "POST",
|
|
2488
2586
|
// credentials:'omit' — going to the dev's local server, not the app
|
|
2489
2587
|
// backend; avoid leaking session cookies cross-origin.
|
|
@@ -2494,9 +2592,9 @@ class Dn {
|
|
|
2494
2592
|
// pagehide didn't fire (e.g. a window.location.assign from script).
|
|
2495
2593
|
keepalive: !0
|
|
2496
2594
|
});
|
|
2497
|
-
|
|
2498
|
-
} catch (
|
|
2499
|
-
(
|
|
2595
|
+
r.ok || (o = this.onError) == null || o.call(this, new Error(`monitor flush: HTTP ${r.status}`));
|
|
2596
|
+
} catch (r) {
|
|
2597
|
+
(a = this.onError) == null || a.call(this, r instanceof Error ? r : new Error(String(r)));
|
|
2500
2598
|
} finally {
|
|
2501
2599
|
this.inflight = !1;
|
|
2502
2600
|
}
|
|
@@ -2534,26 +2632,26 @@ class Dn {
|
|
|
2534
2632
|
};
|
|
2535
2633
|
}
|
|
2536
2634
|
}
|
|
2537
|
-
const
|
|
2538
|
-
let
|
|
2539
|
-
const
|
|
2540
|
-
function
|
|
2635
|
+
const ne = "__lsBeaconMonitorUrl", Oe = "__lsBeaconMonitorSession", oe = "__lsBeaconMonitorVerbose", re = "__lsBeaconMonitorDeadline", He = 30 * 6e4, Ae = 4096;
|
|
2636
|
+
let w = null;
|
|
2637
|
+
const Q = /* @__PURE__ */ new Set();
|
|
2638
|
+
function Hn() {
|
|
2541
2639
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID().slice(0, 8) : Math.random().toString(36).slice(2, 10);
|
|
2542
2640
|
}
|
|
2543
|
-
function
|
|
2641
|
+
function Un(e) {
|
|
2544
2642
|
const t = /* @__PURE__ */ new WeakSet(), n = (o) => {
|
|
2545
2643
|
if (o === null || typeof o != "object")
|
|
2546
|
-
return typeof o == "string" && o.length >
|
|
2644
|
+
return typeof o == "string" && o.length > Ae ? o.slice(0, Ae) : o;
|
|
2547
2645
|
if (t.has(o)) return "[cyclic]";
|
|
2548
2646
|
if (t.add(o), Array.isArray(o)) return o.map(n);
|
|
2549
|
-
const
|
|
2550
|
-
for (const
|
|
2647
|
+
const a = {};
|
|
2648
|
+
for (const r of Object.keys(o).slice(0, 50))
|
|
2551
2649
|
try {
|
|
2552
|
-
r
|
|
2650
|
+
a[r] = n(o[r]);
|
|
2553
2651
|
} catch {
|
|
2554
|
-
r
|
|
2652
|
+
a[r] = "[unreadable]";
|
|
2555
2653
|
}
|
|
2556
|
-
return
|
|
2654
|
+
return a;
|
|
2557
2655
|
};
|
|
2558
2656
|
try {
|
|
2559
2657
|
return n(e);
|
|
@@ -2561,19 +2659,19 @@ function Bn(e) {
|
|
|
2561
2659
|
return "[unserialisable]";
|
|
2562
2660
|
}
|
|
2563
2661
|
}
|
|
2564
|
-
function
|
|
2565
|
-
for (const e of
|
|
2662
|
+
function ae() {
|
|
2663
|
+
for (const e of Q)
|
|
2566
2664
|
try {
|
|
2567
|
-
e(
|
|
2665
|
+
e(w !== null, (w == null ? void 0 : w.url) ?? null);
|
|
2568
2666
|
} catch {
|
|
2569
2667
|
}
|
|
2570
2668
|
}
|
|
2571
|
-
function
|
|
2572
|
-
return
|
|
2669
|
+
function qn(e) {
|
|
2670
|
+
return w ? (w.seq += 1, {
|
|
2573
2671
|
...e,
|
|
2574
2672
|
ts: Date.now(),
|
|
2575
|
-
sessionId:
|
|
2576
|
-
seq:
|
|
2673
|
+
sessionId: w.sessionId,
|
|
2674
|
+
seq: w.seq
|
|
2577
2675
|
}) : {
|
|
2578
2676
|
...e,
|
|
2579
2677
|
ts: Date.now(),
|
|
@@ -2581,40 +2679,40 @@ function zn(e) {
|
|
|
2581
2679
|
seq: 0
|
|
2582
2680
|
};
|
|
2583
2681
|
}
|
|
2584
|
-
function
|
|
2585
|
-
if (!
|
|
2586
|
-
const t =
|
|
2587
|
-
|
|
2682
|
+
function P(e) {
|
|
2683
|
+
if (!w) return;
|
|
2684
|
+
const t = qn(e);
|
|
2685
|
+
w.transport.enqueue(t);
|
|
2588
2686
|
}
|
|
2589
|
-
function
|
|
2590
|
-
if (
|
|
2687
|
+
function Fn() {
|
|
2688
|
+
if (w)
|
|
2591
2689
|
try {
|
|
2592
|
-
sessionStorage.setItem(
|
|
2690
|
+
sessionStorage.setItem(ne, w.url), sessionStorage.setItem(Oe, w.sessionId), sessionStorage.setItem(oe, w.verbose ? "1" : "0"), sessionStorage.setItem(re, String(w.deadlineMs));
|
|
2593
2691
|
} catch {
|
|
2594
2692
|
}
|
|
2595
2693
|
}
|
|
2596
|
-
function
|
|
2694
|
+
function Ue() {
|
|
2597
2695
|
try {
|
|
2598
|
-
sessionStorage.removeItem(
|
|
2696
|
+
sessionStorage.removeItem(ne), sessionStorage.removeItem(Oe), sessionStorage.removeItem(oe), sessionStorage.removeItem(re);
|
|
2599
2697
|
} catch {
|
|
2600
2698
|
}
|
|
2601
2699
|
}
|
|
2602
|
-
function
|
|
2700
|
+
function jn() {
|
|
2603
2701
|
try {
|
|
2604
|
-
const e = sessionStorage.getItem(
|
|
2702
|
+
const e = sessionStorage.getItem(ne);
|
|
2605
2703
|
if (!e) return null;
|
|
2606
|
-
const t = sessionStorage.getItem(
|
|
2607
|
-
return Number.isFinite(o) && o <= Date.now() ? (
|
|
2704
|
+
const t = sessionStorage.getItem(oe) === "1", n = sessionStorage.getItem(re), o = n ? Number(n) : Date.now() + He;
|
|
2705
|
+
return Number.isFinite(o) && o <= Date.now() ? (Ue(), null) : { url: e, verbose: t, deadlineMs: o };
|
|
2608
2706
|
} catch {
|
|
2609
2707
|
return null;
|
|
2610
2708
|
}
|
|
2611
2709
|
}
|
|
2612
|
-
function
|
|
2613
|
-
|
|
2710
|
+
function Le(e) {
|
|
2711
|
+
w && (w.seq += 1, w.transport.enqueue({
|
|
2614
2712
|
kind: e.kind,
|
|
2615
2713
|
ts: e.ts,
|
|
2616
|
-
sessionId:
|
|
2617
|
-
seq:
|
|
2714
|
+
sessionId: w.sessionId,
|
|
2715
|
+
seq: w.seq,
|
|
2618
2716
|
message: e.message,
|
|
2619
2717
|
...e.stack ? { stack: e.stack } : {},
|
|
2620
2718
|
...e.source ? { source: e.source } : {},
|
|
@@ -2622,102 +2720,102 @@ function ke(e) {
|
|
|
2622
2720
|
...typeof e.col == "number" ? { col: e.col } : {}
|
|
2623
2721
|
}));
|
|
2624
2722
|
}
|
|
2625
|
-
function
|
|
2626
|
-
if (
|
|
2627
|
-
const t = e.maxSessionMs ??
|
|
2723
|
+
function qe(e) {
|
|
2724
|
+
if (w && j(), !e.url) return;
|
|
2725
|
+
const t = e.maxSessionMs ?? He, n = Date.now() + t, o = Hn(), a = !!e.verbose, r = new On({
|
|
2628
2726
|
url: e.url,
|
|
2629
2727
|
sessionId: o,
|
|
2630
|
-
onError: (
|
|
2631
|
-
console.warn("[launch-kit-beacon] monitor transport error:",
|
|
2728
|
+
onError: (u) => {
|
|
2729
|
+
console.warn("[launch-kit-beacon] monitor transport error:", u.message);
|
|
2632
2730
|
}
|
|
2633
|
-
}), i =
|
|
2634
|
-
for (const
|
|
2731
|
+
}), i = Pe(), s = i.install(), c = i.snapshot();
|
|
2732
|
+
for (const u of c) Le(u);
|
|
2635
2733
|
let d = c.length;
|
|
2636
2734
|
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
|
-
}),
|
|
2652
|
-
console.info("[launch-kit-beacon] monitor session expired (max duration reached)"),
|
|
2735
|
+
if (!w) return;
|
|
2736
|
+
const u = w.errorsBuffer.snapshot();
|
|
2737
|
+
for (; w.drainedThrough < u.length; ) {
|
|
2738
|
+
const v = u[w.drainedThrough];
|
|
2739
|
+
v && Le(v), w.drainedThrough += 1;
|
|
2740
|
+
}
|
|
2741
|
+
}), m = $n({
|
|
2742
|
+
emit: (u) => P(u),
|
|
2743
|
+
verbose: a
|
|
2744
|
+
}), p = An({
|
|
2745
|
+
emitClick: (u) => P(u),
|
|
2746
|
+
emitRoute: (u) => P(u),
|
|
2747
|
+
emitDialog: (u) => P(u),
|
|
2748
|
+
emitSubmit: (u) => P(u)
|
|
2749
|
+
}), g = setTimeout(() => {
|
|
2750
|
+
console.info("[launch-kit-beacon] monitor session expired (max duration reached)"), j();
|
|
2653
2751
|
}, Math.max(0, n - Date.now()));
|
|
2654
|
-
|
|
2752
|
+
w = {
|
|
2655
2753
|
url: e.url,
|
|
2656
2754
|
sessionId: o,
|
|
2657
|
-
verbose:
|
|
2755
|
+
verbose: a,
|
|
2658
2756
|
deadlineMs: n,
|
|
2659
2757
|
seq: 0,
|
|
2660
|
-
transport:
|
|
2758
|
+
transport: r,
|
|
2661
2759
|
errorsBuffer: i,
|
|
2662
|
-
uninstallNetwork:
|
|
2663
|
-
uninstallDom:
|
|
2760
|
+
uninstallNetwork: m.uninstall,
|
|
2761
|
+
uninstallDom: p.uninstall,
|
|
2664
2762
|
uninstallErrors: s,
|
|
2665
2763
|
errorsUnsub: l,
|
|
2666
|
-
deadlineTimer:
|
|
2764
|
+
deadlineTimer: g,
|
|
2667
2765
|
drainedThrough: d
|
|
2668
|
-
},
|
|
2766
|
+
}, Fn(), ae();
|
|
2669
2767
|
}
|
|
2670
|
-
function
|
|
2671
|
-
|
|
2768
|
+
function j() {
|
|
2769
|
+
Fe(), Ue(), ae();
|
|
2672
2770
|
}
|
|
2673
|
-
function
|
|
2674
|
-
|
|
2771
|
+
function Vn() {
|
|
2772
|
+
w && (Fe(), ae());
|
|
2675
2773
|
}
|
|
2676
|
-
function
|
|
2677
|
-
|
|
2774
|
+
function Fe() {
|
|
2775
|
+
w && (clearTimeout(w.deadlineTimer), w.errorsUnsub(), w.uninstallErrors(), w.uninstallNetwork(), w.uninstallDom(), w.transport.destroy(), w = null);
|
|
2678
2776
|
}
|
|
2679
|
-
function
|
|
2680
|
-
|
|
2777
|
+
function oo(e, t) {
|
|
2778
|
+
w && P({
|
|
2681
2779
|
kind: "probe",
|
|
2682
2780
|
label: e.slice(0, 200),
|
|
2683
|
-
data:
|
|
2781
|
+
data: Un(t)
|
|
2684
2782
|
});
|
|
2685
2783
|
}
|
|
2686
|
-
function
|
|
2687
|
-
return
|
|
2784
|
+
function Te() {
|
|
2785
|
+
return w !== null;
|
|
2688
2786
|
}
|
|
2689
|
-
function
|
|
2690
|
-
return (
|
|
2787
|
+
function Ne() {
|
|
2788
|
+
return (w == null ? void 0 : w.url) ?? null;
|
|
2691
2789
|
}
|
|
2692
|
-
function
|
|
2693
|
-
return
|
|
2694
|
-
|
|
2790
|
+
function Me(e) {
|
|
2791
|
+
return Q.add(e), () => {
|
|
2792
|
+
Q.delete(e);
|
|
2695
2793
|
};
|
|
2696
2794
|
}
|
|
2697
|
-
function
|
|
2698
|
-
if (
|
|
2699
|
-
const e =
|
|
2700
|
-
e &&
|
|
2795
|
+
function Wn() {
|
|
2796
|
+
if (w || typeof window > "u") return;
|
|
2797
|
+
const e = jn();
|
|
2798
|
+
e && qe({
|
|
2701
2799
|
url: e.url,
|
|
2702
2800
|
verbose: e.verbose,
|
|
2703
2801
|
maxSessionMs: Math.max(6e4, e.deadlineMs - Date.now())
|
|
2704
2802
|
});
|
|
2705
2803
|
}
|
|
2706
|
-
function
|
|
2707
|
-
let t = null, n = null, o = "",
|
|
2708
|
-
function
|
|
2709
|
-
|
|
2710
|
-
onStop: () =>
|
|
2711
|
-
url:
|
|
2804
|
+
function ro(e = {}) {
|
|
2805
|
+
let t = null, n = null, o = "", a = null;
|
|
2806
|
+
function r() {
|
|
2807
|
+
a || (a = hn({
|
|
2808
|
+
onStop: () => j(),
|
|
2809
|
+
url: Ne()
|
|
2712
2810
|
}));
|
|
2713
2811
|
}
|
|
2714
2812
|
function i() {
|
|
2715
|
-
if (
|
|
2813
|
+
if (a) {
|
|
2716
2814
|
try {
|
|
2717
|
-
|
|
2815
|
+
a.destroy();
|
|
2718
2816
|
} catch {
|
|
2719
2817
|
}
|
|
2720
|
-
|
|
2818
|
+
a = null;
|
|
2721
2819
|
}
|
|
2722
2820
|
}
|
|
2723
2821
|
function s() {
|
|
@@ -2725,31 +2823,31 @@ function eo(e = {}) {
|
|
|
2725
2823
|
t.innerHTML = "";
|
|
2726
2824
|
const l = document.createElement("div");
|
|
2727
2825
|
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 (
|
|
2826
|
+
const m = document.createElement("div");
|
|
2827
|
+
m.className = "beacon-monitor-row";
|
|
2828
|
+
const p = document.createElement("input");
|
|
2829
|
+
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);
|
|
2830
|
+
const g = document.createElement("button");
|
|
2831
|
+
g.type = "button", g.className = "beacon-monitor-btn", g.textContent = "Start", g.disabled = !o.trim(), m.appendChild(g), t.appendChild(m);
|
|
2832
|
+
const u = document.createElement("label");
|
|
2833
|
+
u.className = "beacon-monitor-verbose";
|
|
2834
|
+
const v = document.createElement("input");
|
|
2835
|
+
v.type = "checkbox", v.dataset.role = "verbose", u.appendChild(v), u.appendChild(document.createTextNode(" verbose (capture successful network too)")), t.appendChild(u);
|
|
2836
|
+
const S = document.createElement("div");
|
|
2837
|
+
S.className = "beacon-monitor-help", S.textContent = "Streams clicks, failed network, errors, route + dialog changes.", t.appendChild(S), p.addEventListener("input", () => {
|
|
2838
|
+
o = p.value, g.disabled = !p.value.trim();
|
|
2839
|
+
}), g.addEventListener("click", () => {
|
|
2840
|
+
const h = p.value.trim();
|
|
2841
|
+
if (h) {
|
|
2744
2842
|
try {
|
|
2745
|
-
new URL(
|
|
2843
|
+
new URL(h);
|
|
2746
2844
|
} catch {
|
|
2747
|
-
|
|
2845
|
+
p.setCustomValidity("Enter a valid URL (e.g. http://localhost:9876/m/abc)"), p.reportValidity();
|
|
2748
2846
|
return;
|
|
2749
2847
|
}
|
|
2750
|
-
|
|
2751
|
-
url:
|
|
2752
|
-
verbose:
|
|
2848
|
+
p.setCustomValidity(""), qe({
|
|
2849
|
+
url: h,
|
|
2850
|
+
verbose: v.checked,
|
|
2753
2851
|
...e.maxSessionMs !== void 0 ? { maxSessionMs: e.maxSessionMs } : {}
|
|
2754
2852
|
});
|
|
2755
2853
|
}
|
|
@@ -2758,40 +2856,40 @@ function eo(e = {}) {
|
|
|
2758
2856
|
function c() {
|
|
2759
2857
|
if (!t) return;
|
|
2760
2858
|
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);
|
|
2859
|
+
const l = Ne() ?? "", m = document.createElement("div");
|
|
2860
|
+
m.className = "beacon-monitor-title";
|
|
2861
|
+
const p = document.createElement("span");
|
|
2862
|
+
p.className = "beacon-monitor-rec", p.setAttribute("aria-hidden", "true"), m.appendChild(p), m.appendChild(document.createTextNode(" Monitor — recording")), t.appendChild(m);
|
|
2771
2863
|
const g = document.createElement("div");
|
|
2772
|
-
g.className = "beacon-monitor-
|
|
2864
|
+
g.className = "beacon-monitor-active-url", g.title = l, g.textContent = l, t.appendChild(g);
|
|
2865
|
+
const u = document.createElement("div");
|
|
2866
|
+
u.className = "beacon-monitor-row";
|
|
2867
|
+
const v = document.createElement("button");
|
|
2868
|
+
v.type = "button", v.className = "beacon-monitor-btn stop", v.textContent = "Stop monitoring", v.addEventListener("click", () => j()), u.appendChild(v), t.appendChild(u);
|
|
2869
|
+
const S = document.createElement("div");
|
|
2870
|
+
S.className = "beacon-monitor-help", S.textContent = "Events stream to the URL above. Auto-stops after 30 min.", t.appendChild(S);
|
|
2773
2871
|
}
|
|
2774
2872
|
function d() {
|
|
2775
|
-
|
|
2873
|
+
Te() ? c() : s();
|
|
2776
2874
|
}
|
|
2777
2875
|
return {
|
|
2778
2876
|
name: "liveMonitor",
|
|
2779
2877
|
setupOnce(l) {
|
|
2780
|
-
|
|
2781
|
-
const
|
|
2782
|
-
|
|
2783
|
-
}),
|
|
2784
|
-
i(),
|
|
2878
|
+
Wn(), Te() && r();
|
|
2879
|
+
const m = Me((g, u) => {
|
|
2880
|
+
g ? (r(), a == null || a.updateUrl(u)) : i();
|
|
2881
|
+
}), p = () => {
|
|
2882
|
+
i(), m();
|
|
2785
2883
|
try {
|
|
2786
|
-
|
|
2884
|
+
Vn();
|
|
2787
2885
|
} catch {
|
|
2788
2886
|
}
|
|
2789
2887
|
};
|
|
2790
|
-
l.signal.addEventListener("abort",
|
|
2888
|
+
l.signal.addEventListener("abort", p, { once: !0 });
|
|
2791
2889
|
},
|
|
2792
2890
|
form() {
|
|
2793
2891
|
return {
|
|
2794
|
-
render: (l) => (t = document.createElement("div"), t.className = "beacon-monitor", l.appendChild(t), d(), n =
|
|
2892
|
+
render: (l) => (t = document.createElement("div"), t.className = "beacon-monitor", l.appendChild(t), d(), n = Me(() => d()), () => {
|
|
2795
2893
|
n == null || n(), n = null, t = null;
|
|
2796
2894
|
})
|
|
2797
2895
|
};
|
|
@@ -2799,38 +2897,38 @@ function eo(e = {}) {
|
|
|
2799
2897
|
// No capture(): liveMonitor is a side-channel, not a feedback payload contributor.
|
|
2800
2898
|
};
|
|
2801
2899
|
}
|
|
2802
|
-
let
|
|
2803
|
-
const
|
|
2900
|
+
let N = null;
|
|
2901
|
+
const ie = {
|
|
2804
2902
|
"plugin:error": /* @__PURE__ */ new Set(),
|
|
2805
2903
|
"submit:success": /* @__PURE__ */ new Set(),
|
|
2806
2904
|
"submit:error": /* @__PURE__ */ new Set(),
|
|
2807
2905
|
ready: /* @__PURE__ */ new Set()
|
|
2808
2906
|
};
|
|
2809
|
-
function
|
|
2907
|
+
function ao(e) {
|
|
2810
2908
|
if (typeof window > "u") return;
|
|
2811
2909
|
if (!e.endpoint) throw new Error("init: endpoint is required");
|
|
2812
|
-
|
|
2813
|
-
const t = { ...
|
|
2814
|
-
|
|
2815
|
-
const i = document.querySelector(
|
|
2910
|
+
Re(), Xn();
|
|
2911
|
+
const t = { ...lt(), ...e.labels ?? {} }, n = new AbortController(), o = Jn(e), a = e.position ?? "bottom-right", r = e.theme ?? "auto";
|
|
2912
|
+
Xe(), Gn(e, a, r);
|
|
2913
|
+
const i = document.querySelector(z);
|
|
2816
2914
|
if (!i)
|
|
2817
2915
|
throw new Error("init: failed to acquire <launch-kit-beacon> host");
|
|
2818
2916
|
if (!i.shadow)
|
|
2819
2917
|
throw new Error("init: host element shadow root not initialized");
|
|
2820
|
-
const s =
|
|
2918
|
+
const s = dt(i.shadow), c = new ct(
|
|
2821
2919
|
t,
|
|
2822
2920
|
["bug", "idea", "ux", "a11y"],
|
|
2823
2921
|
{
|
|
2824
2922
|
onSubmit: () => {
|
|
2825
|
-
|
|
2923
|
+
eo();
|
|
2826
2924
|
},
|
|
2827
|
-
onClose: (
|
|
2828
|
-
|
|
2925
|
+
onClose: (m) => {
|
|
2926
|
+
V("close", {}), m === "user" && Ve();
|
|
2829
2927
|
}
|
|
2830
2928
|
}
|
|
2831
2929
|
);
|
|
2832
2930
|
i.shadow.appendChild(c.root), i.classList.add("beacon-no-capture");
|
|
2833
|
-
const d =
|
|
2931
|
+
const d = et(o), l = {
|
|
2834
2932
|
endpoint: e.endpoint,
|
|
2835
2933
|
headers: e.headers,
|
|
2836
2934
|
context: e.context,
|
|
@@ -2842,10 +2940,10 @@ function to(e) {
|
|
|
2842
2940
|
hostElement: i,
|
|
2843
2941
|
initAbort: n,
|
|
2844
2942
|
labels: t,
|
|
2845
|
-
debug: !!e.debug ||
|
|
2943
|
+
debug: !!e.debug || Qn(),
|
|
2846
2944
|
healthIndicator: e.healthIndicator ?? "never",
|
|
2847
|
-
position:
|
|
2848
|
-
theme:
|
|
2945
|
+
position: a,
|
|
2946
|
+
theme: r,
|
|
2849
2947
|
currentSubmit: null,
|
|
2850
2948
|
capturedEntries: {},
|
|
2851
2949
|
formValues: {},
|
|
@@ -2857,23 +2955,23 @@ function to(e) {
|
|
|
2857
2955
|
},
|
|
2858
2956
|
panelSources: []
|
|
2859
2957
|
};
|
|
2860
|
-
|
|
2861
|
-
(
|
|
2862
|
-
(
|
|
2863
|
-
),
|
|
2958
|
+
N = l, i.onTriggerClick = () => Yn(), d.install(
|
|
2959
|
+
(m) => je(m),
|
|
2960
|
+
(m) => se(m)
|
|
2961
|
+
), B("ready", { ready: !0 }), l.debug && console.info("[beacon] ready", l.endpoint);
|
|
2864
2962
|
}
|
|
2865
|
-
function
|
|
2866
|
-
const e =
|
|
2963
|
+
function Yn() {
|
|
2964
|
+
const e = N;
|
|
2867
2965
|
e && (e.currentSubmit || (e.panelSources = e.plugins.map((t) => {
|
|
2868
2966
|
if (!t.form) return null;
|
|
2869
|
-
const n =
|
|
2967
|
+
const n = je(t.name);
|
|
2870
2968
|
let o;
|
|
2871
2969
|
try {
|
|
2872
2970
|
o = t.form(n);
|
|
2873
|
-
} catch (
|
|
2874
|
-
return
|
|
2971
|
+
} catch (a) {
|
|
2972
|
+
return se({
|
|
2875
2973
|
plugin: t.name,
|
|
2876
|
-
error:
|
|
2974
|
+
error: a instanceof Error ? a : new Error(String(a)),
|
|
2877
2975
|
at: "form"
|
|
2878
2976
|
}), null;
|
|
2879
2977
|
}
|
|
@@ -2884,57 +2982,57 @@ function Fn() {
|
|
|
2884
2982
|
return (o = e.formValues[t]) == null ? void 0 : o[n];
|
|
2885
2983
|
},
|
|
2886
2984
|
set: (t, n, o) => {
|
|
2887
|
-
var
|
|
2888
|
-
const
|
|
2889
|
-
|
|
2985
|
+
var r;
|
|
2986
|
+
const a = (r = e.formValues)[t] ?? (r[t] = {});
|
|
2987
|
+
a[n] = o;
|
|
2890
2988
|
}
|
|
2891
|
-
}), e.dialog.open(),
|
|
2989
|
+
}), e.dialog.open(), V("open", {})));
|
|
2892
2990
|
}
|
|
2893
|
-
function
|
|
2894
|
-
const e =
|
|
2991
|
+
function io() {
|
|
2992
|
+
const e = N;
|
|
2895
2993
|
e && e.dialog.close("user");
|
|
2896
2994
|
}
|
|
2897
|
-
function
|
|
2995
|
+
function Xn() {
|
|
2898
2996
|
var t;
|
|
2899
|
-
const e =
|
|
2997
|
+
const e = N;
|
|
2900
2998
|
if (e) {
|
|
2901
|
-
e.initAbort.abort(), (t = e.currentSubmit) == null || t.abort(), e.registry.destroy(),
|
|
2999
|
+
e.initAbort.abort(), (t = e.currentSubmit) == null || t.abort(), e.registry.destroy(), R();
|
|
2902
3000
|
try {
|
|
2903
3001
|
e.dialog.root.remove(), e.overlayHost.layer.remove();
|
|
2904
3002
|
} catch {
|
|
2905
3003
|
}
|
|
2906
|
-
e.hostElement.onTriggerClick = null,
|
|
3004
|
+
e.hostElement.onTriggerClick = null, N = null;
|
|
2907
3005
|
}
|
|
2908
3006
|
}
|
|
2909
|
-
function
|
|
2910
|
-
const e =
|
|
3007
|
+
function so() {
|
|
3008
|
+
const e = N;
|
|
2911
3009
|
return e ? {
|
|
2912
3010
|
ready: !0,
|
|
2913
3011
|
transport: "idle",
|
|
2914
3012
|
plugins: e.registry.status()
|
|
2915
3013
|
} : { ready: !1, transport: "idle", plugins: {} };
|
|
2916
3014
|
}
|
|
2917
|
-
function
|
|
2918
|
-
return
|
|
3015
|
+
function co(e, t) {
|
|
3016
|
+
return ie[e].add(t), () => Kn(e, t);
|
|
2919
3017
|
}
|
|
2920
|
-
function
|
|
2921
|
-
|
|
3018
|
+
function Kn(e, t) {
|
|
3019
|
+
ie[e].delete(t);
|
|
2922
3020
|
}
|
|
2923
|
-
function
|
|
2924
|
-
let o = document.querySelector(
|
|
3021
|
+
function Gn(e, t, n) {
|
|
3022
|
+
let o = document.querySelector(z);
|
|
2925
3023
|
if (!o) {
|
|
2926
|
-
o = document.createElement(
|
|
3024
|
+
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
3025
|
return;
|
|
2928
3026
|
}
|
|
2929
3027
|
e.position !== void 0 && o.setAttribute("position", t), e.theme !== void 0 && o.setAttribute("theme", n);
|
|
2930
3028
|
}
|
|
2931
|
-
function
|
|
2932
|
-
return e.plugins ? e.plugins : e.defaultPlugins === !1 ? [] :
|
|
3029
|
+
function Jn(e) {
|
|
3030
|
+
return e.plugins ? e.plugins : e.defaultPlugins === !1 ? [] : Zn();
|
|
2933
3031
|
}
|
|
2934
|
-
function
|
|
2935
|
-
return [
|
|
3032
|
+
function Zn() {
|
|
3033
|
+
return [ft(), wt(), ln(), un()];
|
|
2936
3034
|
}
|
|
2937
|
-
function
|
|
3035
|
+
function Qn() {
|
|
2938
3036
|
if (typeof window > "u") return !1;
|
|
2939
3037
|
try {
|
|
2940
3038
|
return new URLSearchParams(window.location.search).has("lsbeacon-debug");
|
|
@@ -2942,13 +3040,13 @@ function Xn() {
|
|
|
2942
3040
|
return !1;
|
|
2943
3041
|
}
|
|
2944
3042
|
}
|
|
2945
|
-
function
|
|
2946
|
-
const t =
|
|
2947
|
-
return
|
|
3043
|
+
function je(e) {
|
|
3044
|
+
const t = N;
|
|
3045
|
+
return Ze(e, {
|
|
2948
3046
|
getCaptured: (o) => t == null ? void 0 : t.capturedEntries[o],
|
|
2949
3047
|
getFormValues: (o) => {
|
|
2950
|
-
var
|
|
2951
|
-
return t ? (
|
|
3048
|
+
var a;
|
|
3049
|
+
return t ? (a = t.formValues)[o] ?? (a[o] = {}) : {};
|
|
2952
3050
|
},
|
|
2953
3051
|
getCaptureSignal: () => {
|
|
2954
3052
|
var o;
|
|
@@ -2957,45 +3055,45 @@ function Ue(e) {
|
|
|
2957
3055
|
getInitSignal: () => t.initAbort.signal,
|
|
2958
3056
|
requestMode: async (o) => t ? t.dialog.requestMode(o) : () => {
|
|
2959
3057
|
},
|
|
2960
|
-
overlay: (o) => t ?
|
|
3058
|
+
overlay: (o) => t ? ut(t.overlayHost, o.render) : () => {
|
|
2961
3059
|
},
|
|
2962
|
-
onLifecycle: (o,
|
|
3060
|
+
onLifecycle: (o, a) => {
|
|
2963
3061
|
if (!t) return () => {
|
|
2964
3062
|
};
|
|
2965
|
-
const
|
|
2966
|
-
return
|
|
3063
|
+
const r = t.lifecycleHandlers[o];
|
|
3064
|
+
return r.add(a), () => r.delete(a);
|
|
2967
3065
|
}
|
|
2968
3066
|
});
|
|
2969
3067
|
}
|
|
2970
|
-
function
|
|
2971
|
-
const n =
|
|
3068
|
+
function V(e, t) {
|
|
3069
|
+
const n = N;
|
|
2972
3070
|
if (n)
|
|
2973
3071
|
for (const o of n.lifecycleHandlers[e])
|
|
2974
3072
|
try {
|
|
2975
3073
|
o(t);
|
|
2976
|
-
} catch (
|
|
2977
|
-
n.debug && console.error("[beacon] lifecycle handler threw:",
|
|
3074
|
+
} catch (a) {
|
|
3075
|
+
n.debug && console.error("[beacon] lifecycle handler threw:", a);
|
|
2978
3076
|
}
|
|
2979
3077
|
}
|
|
2980
|
-
function
|
|
2981
|
-
for (const n of
|
|
3078
|
+
function B(e, t) {
|
|
3079
|
+
for (const n of ie[e])
|
|
2982
3080
|
try {
|
|
2983
3081
|
n(t);
|
|
2984
3082
|
} catch (o) {
|
|
2985
|
-
|
|
3083
|
+
N != null && N.debug && console.error("[beacon] system handler threw:", o);
|
|
2986
3084
|
}
|
|
2987
3085
|
}
|
|
2988
|
-
function
|
|
2989
|
-
|
|
2990
|
-
const t =
|
|
3086
|
+
function se(e) {
|
|
3087
|
+
B("plugin:error", { plugin: e.plugin, error: e.error, at: e.at });
|
|
3088
|
+
const t = N;
|
|
2991
3089
|
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
3090
|
}
|
|
2993
|
-
function
|
|
2994
|
-
const e =
|
|
3091
|
+
function Ve() {
|
|
3092
|
+
const e = N;
|
|
2995
3093
|
e && (e.dialog.resetState(), e.dialog.clearPluginPanels(), e.formValues = {});
|
|
2996
3094
|
}
|
|
2997
|
-
async function
|
|
2998
|
-
const e =
|
|
3095
|
+
async function eo() {
|
|
3096
|
+
const e = N;
|
|
2999
3097
|
if (!e || e.currentSubmit) return;
|
|
3000
3098
|
const t = e.dialog.getDescription().trim();
|
|
3001
3099
|
if (!t) {
|
|
@@ -3007,47 +3105,47 @@ async function Gn() {
|
|
|
3007
3105
|
try {
|
|
3008
3106
|
const o = await e.registry.capture(
|
|
3009
3107
|
(s) => e.capturedEntries[s],
|
|
3010
|
-
(s) =>
|
|
3108
|
+
(s) => se(s)
|
|
3011
3109
|
);
|
|
3012
|
-
e.capturedEntries = o, n =
|
|
3013
|
-
let
|
|
3014
|
-
if (
|
|
3015
|
-
|
|
3016
|
-
} }),
|
|
3017
|
-
e.dialog.setSubmitting(!1), e.dialog.setStatus(`Cancelled: ${
|
|
3110
|
+
e.capturedEntries = o, n = to(e, t, o);
|
|
3111
|
+
let a = null;
|
|
3112
|
+
if (V("beforeSubmit", { payload: n, cancel: (s) => {
|
|
3113
|
+
a === null && (a = s);
|
|
3114
|
+
} }), a !== null) {
|
|
3115
|
+
e.dialog.setSubmitting(!1), e.dialog.setStatus(`Cancelled: ${a}`, "error");
|
|
3018
3116
|
return;
|
|
3019
3117
|
}
|
|
3020
3118
|
e.dialog.setStatus("Sending…");
|
|
3021
|
-
const i = await
|
|
3119
|
+
const i = await ot(
|
|
3022
3120
|
e.endpoint,
|
|
3023
3121
|
n,
|
|
3024
3122
|
e.headers,
|
|
3025
3123
|
e.currentSubmit.signal,
|
|
3026
3124
|
e.credentials
|
|
3027
3125
|
);
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
}, 1500)) : (
|
|
3126
|
+
V("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(() => {
|
|
3127
|
+
N === e && e.dialog.close("submitted"), Ve();
|
|
3128
|
+
}, 1500)) : (B("submit:error", { payload: n, error: new Error(`HTTP ${i.status}`) }), e.dialog.setStatus(`Failed (${i.status})`, "error"));
|
|
3031
3129
|
} catch (o) {
|
|
3032
3130
|
e.dialog.setSubmitting(!1);
|
|
3033
|
-
const
|
|
3034
|
-
n &&
|
|
3131
|
+
const a = o instanceof Error ? o : new Error(String(o));
|
|
3132
|
+
n && B("submit:error", { payload: n, error: a }), e.dialog.setStatus(`Failed: ${a.message}`, "error");
|
|
3035
3133
|
} finally {
|
|
3036
3134
|
e.currentSubmit = null;
|
|
3037
3135
|
}
|
|
3038
3136
|
}
|
|
3039
|
-
function
|
|
3040
|
-
var
|
|
3041
|
-
const o =
|
|
3137
|
+
function to(e, t, n) {
|
|
3138
|
+
var r;
|
|
3139
|
+
const o = no(), a = (r = e.context) == null ? void 0 : r.call(e);
|
|
3042
3140
|
return {
|
|
3043
3141
|
description: t,
|
|
3044
3142
|
severity: e.dialog.getSeverity(),
|
|
3045
3143
|
metadata: o,
|
|
3046
|
-
...
|
|
3144
|
+
...a ? { context: a } : {},
|
|
3047
3145
|
plugins: n
|
|
3048
3146
|
};
|
|
3049
3147
|
}
|
|
3050
|
-
function
|
|
3148
|
+
function no() {
|
|
3051
3149
|
const e = window.location.href, t = document.referrer, n = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
3052
3150
|
return {
|
|
3053
3151
|
url: e,
|
|
@@ -3068,25 +3166,25 @@ function Zn() {
|
|
|
3068
3166
|
capturedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3069
3167
|
};
|
|
3070
3168
|
}
|
|
3071
|
-
|
|
3169
|
+
Re();
|
|
3072
3170
|
export {
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3171
|
+
Ne as currentMonitorUrl,
|
|
3172
|
+
Xn as destroy,
|
|
3173
|
+
ln as domEle,
|
|
3174
|
+
un as domSS,
|
|
3175
|
+
wt as errors,
|
|
3176
|
+
io as hide,
|
|
3177
|
+
ao as init,
|
|
3178
|
+
Te as isMonitorActive,
|
|
3179
|
+
dn as isPluginFailure,
|
|
3180
|
+
ro as liveMonitor,
|
|
3181
|
+
ft as metadata,
|
|
3182
|
+
Kn as off,
|
|
3183
|
+
co as on,
|
|
3184
|
+
oo as probe,
|
|
3185
|
+
Yn as show,
|
|
3186
|
+
qe as startMonitor,
|
|
3187
|
+
so as status,
|
|
3188
|
+
j as stopMonitor
|
|
3091
3189
|
};
|
|
3092
3190
|
//# sourceMappingURL=beacon.mjs.map
|