@launchsecure/launch-kit 0.0.38 → 0.0.39

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.
Files changed (93) hide show
  1. package/dist/beacon/beacon.mjs +308 -298
  2. package/dist/beacon/beacon.mjs.map +1 -1
  3. package/dist/beacon/beacon.umd.js +6 -6
  4. package/dist/beacon/beacon.umd.js.map +1 -1
  5. package/dist/beacon/types/internal/screenshot.d.ts.map +1 -1
  6. package/dist/chart-client/assets/index-ysGpLeOW.css +1 -0
  7. package/dist/chart-client/index.html +2 -2
  8. package/dist/client/assets/index-CMN3tlGP.css +32 -0
  9. package/dist/client/index.html +2 -2
  10. package/dist/council-client/assets/index-ChmNX6bZ.css +1 -0
  11. package/dist/council-client/index.html +2 -2
  12. package/dist/deck-client/assets/{_baseUniq-CgW32Gdk.js → _baseUniq-DOrnEQMI.js} +1 -1
  13. package/dist/deck-client/assets/{arc-D-Mg9gvM.js → arc-DOWK7V3m.js} +1 -1
  14. package/dist/deck-client/assets/{architectureDiagram-Q4EWVU46-CdTsXsgl.js → architectureDiagram-Q4EWVU46-DPhzvk7q.js} +1 -1
  15. package/dist/deck-client/assets/{blockDiagram-DXYQGD6D-mwTneYyB.js → blockDiagram-DXYQGD6D-CwAGy9lU.js} +1 -1
  16. package/dist/deck-client/assets/{c4Diagram-AHTNJAMY-C4R8IbjO.js → c4Diagram-AHTNJAMY-L_g_SS21.js} +1 -1
  17. package/dist/deck-client/assets/channel-DqiACUUq.js +1 -0
  18. package/dist/deck-client/assets/{chunk-4BX2VUAB-ZWuRIUwb.js → chunk-4BX2VUAB-RKm0LXpu.js} +1 -1
  19. package/dist/deck-client/assets/{chunk-4TB4RGXK-PNHX10sF.js → chunk-4TB4RGXK-Bk0FUbxU.js} +1 -1
  20. package/dist/deck-client/assets/{chunk-55IACEB6-CD9MUgPr.js → chunk-55IACEB6-Cl3hja-M.js} +1 -1
  21. package/dist/deck-client/assets/{chunk-EDXVE4YY-C_CpORb3.js → chunk-EDXVE4YY-CNIMQCV2.js} +1 -1
  22. package/dist/deck-client/assets/{chunk-FMBD7UC4-Bg5RoVC-.js → chunk-FMBD7UC4-DqOvWr1k.js} +1 -1
  23. package/dist/deck-client/assets/{chunk-OYMX7WX6-DhTwgQwd.js → chunk-OYMX7WX6-1Kd7yK5u.js} +1 -1
  24. package/dist/deck-client/assets/{chunk-QZHKN3VN-C5VLMaFa.js → chunk-QZHKN3VN-6_kraYpP.js} +1 -1
  25. package/dist/deck-client/assets/{chunk-YZCP3GAM-NAGHy4Sr.js → chunk-YZCP3GAM-FgAwIWlo.js} +1 -1
  26. package/dist/deck-client/assets/classDiagram-6PBFFD2Q-D23cq2C3.js +1 -0
  27. package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-D23cq2C3.js +1 -0
  28. package/dist/deck-client/assets/clone-C7jSigGq.js +1 -0
  29. package/dist/deck-client/assets/{cose-bilkent-S5V4N54A-CpUczjZk.js → cose-bilkent-S5V4N54A-CigVnnPr.js} +1 -1
  30. package/dist/deck-client/assets/{dagre-KV5264BT-BOvb07MG.js → dagre-KV5264BT-DHZXTktX.js} +1 -1
  31. package/dist/deck-client/assets/{diagram-5BDNPKRD-BPxwTiC-.js → diagram-5BDNPKRD-H5k0eauU.js} +1 -1
  32. package/dist/deck-client/assets/{diagram-G4DWMVQ6-Dz_gsHgx.js → diagram-G4DWMVQ6-Bg3dFhSY.js} +1 -1
  33. package/dist/deck-client/assets/{diagram-MMDJMWI5-B7z-oVTW.js → diagram-MMDJMWI5-CQLC410N.js} +1 -1
  34. package/dist/deck-client/assets/{diagram-TYMM5635-CAIAglLQ.js → diagram-TYMM5635-DFTCHVkP.js} +1 -1
  35. package/dist/deck-client/assets/{erDiagram-SMLLAGMA-BiViTWF3.js → erDiagram-SMLLAGMA-aiv9GZnL.js} +1 -1
  36. package/dist/deck-client/assets/{flowDiagram-DWJPFMVM-DYVemp0H.js → flowDiagram-DWJPFMVM-C6Fhvtsy.js} +1 -1
  37. package/dist/deck-client/assets/{ganttDiagram-T4ZO3ILL-Chc1Iyu1.js → ganttDiagram-T4ZO3ILL-DSaGMPM4.js} +1 -1
  38. package/dist/deck-client/assets/{gitGraphDiagram-UUTBAWPF-B7eFgaj5.js → gitGraphDiagram-UUTBAWPF-DMjL2Vix.js} +1 -1
  39. package/dist/deck-client/assets/{graph-CKaIoNwb.js → graph-B7Vn5lkK.js} +1 -1
  40. package/dist/deck-client/assets/{index-BRawc7RA.js → index-BD36e-tD.js} +68 -68
  41. package/dist/deck-client/assets/index-CGbNOpk9.css +1 -0
  42. package/dist/deck-client/assets/{infoDiagram-42DDH7IO-BxsVq7vO.js → infoDiagram-42DDH7IO-mNi4iygG.js} +1 -1
  43. package/dist/deck-client/assets/{ishikawaDiagram-UXIWVN3A-DAM7vPwa.js → ishikawaDiagram-UXIWVN3A-BwCUmUVt.js} +1 -1
  44. package/dist/deck-client/assets/{journeyDiagram-VCZTEJTY-Xe20Nf7R.js → journeyDiagram-VCZTEJTY-C6qoqJmJ.js} +1 -1
  45. package/dist/deck-client/assets/{kanban-definition-6JOO6SKY-DS8YguzB.js → kanban-definition-6JOO6SKY-Dz1Tt3sA.js} +1 -1
  46. package/dist/deck-client/assets/{layout-DKMBpzR-.js → layout-CZTyRhOG.js} +1 -1
  47. package/dist/deck-client/assets/{linear-DTNtBg5h.js → linear--7n7iEvd.js} +1 -1
  48. package/dist/deck-client/assets/{min-C4DrxCcA.js → min-Bh130DN8.js} +1 -1
  49. package/dist/deck-client/assets/{mindmap-definition-QFDTVHPH-B4nEtsw5.js → mindmap-definition-QFDTVHPH-CfXcK1qH.js} +1 -1
  50. package/dist/deck-client/assets/{pieDiagram-DEJITSTG-BzHdGNu5.js → pieDiagram-DEJITSTG-DjVHLAVw.js} +1 -1
  51. package/dist/deck-client/assets/{quadrantDiagram-34T5L4WZ-CaX0SD4-.js → quadrantDiagram-34T5L4WZ-CXwvZ1i1.js} +1 -1
  52. package/dist/deck-client/assets/{requirementDiagram-MS252O5E-QeG4p2ni.js → requirementDiagram-MS252O5E-Cl6xm0fR.js} +1 -1
  53. package/dist/deck-client/assets/{sankeyDiagram-XADWPNL6-BoAwgAj-.js → sankeyDiagram-XADWPNL6-BOH9sLyh.js} +1 -1
  54. package/dist/deck-client/assets/{sequenceDiagram-FGHM5R23-Dn4pYYgu.js → sequenceDiagram-FGHM5R23-BC1MYBn6.js} +1 -1
  55. package/dist/deck-client/assets/{stateDiagram-FHFEXIEX-Is6KRmQV.js → stateDiagram-FHFEXIEX-kNp9bv8K.js} +1 -1
  56. package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-hRsAFc2t.js +1 -0
  57. package/dist/deck-client/assets/{timeline-definition-GMOUNBTQ-v64IZGuY.js → timeline-definition-GMOUNBTQ-DKnITsD4.js} +1 -1
  58. package/dist/deck-client/assets/{vennDiagram-DHZGUBPP-noh9eouF.js → vennDiagram-DHZGUBPP-BdajXRrh.js} +1 -1
  59. package/dist/deck-client/assets/wardley-RL74JXVD-BL802-su.js +162 -0
  60. package/dist/deck-client/assets/{wardleyDiagram-NUSXRM2D-DxR4j737.js → wardleyDiagram-NUSXRM2D-B2hDCDl2.js} +1 -1
  61. package/dist/deck-client/assets/{xychartDiagram-5P7HB3ND-B26vodaL.js → xychartDiagram-5P7HB3ND-CvnYFs51.js} +1 -1
  62. package/dist/deck-client/index.html +2 -2
  63. package/dist/server/council-entry.js +0 -0
  64. package/dist/server/deck-mcp-entry.js +3 -1
  65. package/dist/server/deck-serve.js +3 -1
  66. package/dist/server/fb-wizard.js +0 -0
  67. package/dist/server/init-entry.js +152 -25
  68. package/dist/server/radar-docker-init-entry.js +0 -0
  69. package/dist/server/radar-entrypoint-entry.js +0 -0
  70. package/dist/server/radar-teardown-entry.js +0 -0
  71. package/dist/server/rover-entry.js +44 -1
  72. package/package.json +23 -22
  73. package/scaffolds/ls-marketplace/plugins/kit/commands/activate-statusline.md +8 -7
  74. package/scaffolds/ls-marketplace/plugins/kit/commands/deactivate-statusline.md +2 -2
  75. package/scaffolds/ls-marketplace/plugins/kit/skills/comms/SKILL.md +88 -0
  76. package/scaffolds/ls-marketplace/plugins/kit/skills/project-info/SKILL.md +88 -0
  77. package/scaffolds/ls-marketplace/plugins/kit/skills/slides/SKILL.md +118 -0
  78. package/scaffolds/migrate-safety/scripts/migrate-with-backup.sh +0 -0
  79. package/scaffolds/recall-hook/scripts/ensure-recall.sh +0 -0
  80. package/scaffolds/statusline/statusline-base.sh +20 -0
  81. package/dist/chart-client/assets/index-B6rR0CWx.css +0 -1
  82. package/dist/client/assets/index-D6uX1lQe.css +0 -32
  83. package/dist/council-client/assets/index-CleYLarJ.css +0 -1
  84. package/dist/deck-client/assets/channel-CuSee7GO.js +0 -1
  85. package/dist/deck-client/assets/classDiagram-6PBFFD2Q-_kTisqzs.js +0 -1
  86. package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-_kTisqzs.js +0 -1
  87. package/dist/deck-client/assets/clone-kb3zkY60.js +0 -1
  88. package/dist/deck-client/assets/index-55P73aS_.css +0 -1
  89. package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-Cy45Ttqq.js +0 -1
  90. package/dist/deck-client/assets/wardley-RL74JXVD-cJ_1is2S.js +0 -162
  91. /package/dist/chart-client/assets/{index-C_xCi3gW.js → index-BlsuXuQ1.js} +0 -0
  92. /package/dist/client/assets/{index-CRecYFUA.js → index-BA7BHBWT.js} +0 -0
  93. /package/dist/council-client/assets/{index-DO-Vn15O.js → index-jjBWyhry.js} +0 -0
@@ -693,10 +693,10 @@ dialog.beacon-dialog::backdrop {
693
693
  text-overflow: ellipsis;
694
694
  max-width: 100%;
695
695
  }
696
- `,Le="launch-kit-beacon-portal-styles";function It(){if(typeof document>"u"||!document.head||document.getElementById(Le))return;const e=document.createElement("style");e.id=Le,e.textContent=D,document.head.appendChild(e)}const oe="http://www.w3.org/2000/svg";function Nt(){const e=document.createElementNS(oe,"svg");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");const t=document.createElementNS(oe,"path");t.setAttribute("d","M3 11l18-5v12L3 14v-3z");const n=document.createElementNS(oe,"path");return n.setAttribute("d","M11.6 16.8a3 3 0 1 1-5.8-1.6"),e.appendChild(t),e.appendChild(n),e}const U="launch-kit-beacon",_t=typeof HTMLElement<"u"?HTMLElement:class{};class $t extends _t{constructor(){super(...arguments),this.onTriggerClick=null}connectedCallback(){if(this.shadow)return;this.shadow=this.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=D,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(Nt());const n=document.createElement("span");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",()=>{var o;return(o=this.onTriggerClick)==null?void 0:o.call(this)}),this.triggerSlot.addEventListener("slotchange",()=>{const o=this.triggerSlot.assignedElements();if(o.length>0){this.defaultTrigger.style.display="none";for(const a of o)a.addEventListener("click",()=>{var r;return(r=this.onTriggerClick)==null?void 0:r.call(this)})}else this.defaultTrigger.style.display=""}),this.hasAttribute("position")||this.setAttribute("position","bottom-right"),this.hasAttribute("theme")||this.setAttribute("theme","auto")}setTriggerLabel(t){if(!this.defaultTrigger)return;const n=this.defaultTrigger.querySelector("span");n&&(n.textContent=t)}setHealthIndicator(t){var n;(n=this.healthDot)==null||n.classList.toggle("visible",t)}}function Te(){typeof window>"u"||typeof customElements>"u"||customElements.get(U)||customElements.define(U,$t)}function Dt(e,t){return{pluginName:e,captured:n=>t.getCaptured(n),get formValues(){return t.getFormValues(e)},requestMode:n=>t.requestMode(n),overlay:n=>t.overlay(n),on:(n,o)=>t.onLifecycle(n,o),get signal(){return t.getInitSignal()},captureSignal:()=>t.getCaptureSignal()}}class Ft extends Error{constructor(t){super(`Duplicate plugin name: "${t}"`),this.name="DuplicatePluginNameError"}}function Ot(e){const t=new Set;for(const o of e){if(t.has(o.name))throw new Ft(o.name);t.add(o.name)}const n=e.map(o=>({plugin:o,ctx:null,status:{state:"active",failures:0}}));return{entries:n,install(o,a){for(const r of n)if(r.ctx=o(r.plugin.name),!!r.plugin.setupOnce)try{const i=r.plugin.setupOnce(r.ctx);typeof i=="function"&&(r.teardown=i)}catch(i){const s=i instanceof Error?i:new Error(String(i));r.status={state:"failed",failures:r.status.failures+1,error:{message:s.message,...s.stack?{stack:s.stack}:{},at:"setupOnce"}},a({plugin:r.plugin.name,error:s,at:"setupOnce"})}},destroy(){var o;for(const a of n){try{(o=a.teardown)==null||o.call(a)}catch{}a.teardown=void 0}},async capture(o,a){const r={};for(const i of n)if(i.plugin.capture)try{const s=await i.plugin.capture(i.ctx),c=Ht(s,i.plugin.version);c!==null&&(r[i.plugin.name]=c)}catch(s){const c=s instanceof Error?s:new Error(String(s));r[i.plugin.name]=Bt(c),i.status={state:"failed",failures:i.status.failures+1,error:{message:c.message,...c.stack?{stack:c.stack}:{},at:"capture"}},a({plugin:i.plugin.name,error:c,at:"capture"})}return r},status(){const o={};for(const a of n)o[a.plugin.name]=a.status;return o}}}function Ht(e,t){if(e==null)return null;const n=t??1;return Array.isArray(e)||typeof e!="object"?{v:n,value:e}:{...e,v:n}}function Bt(e){return{error:e.message,...e.stack?{stack:e.stack}:{}}}async function Ut(e,t,n,o,a="omit"){const r=await zt(n),i=await fetch(e,{method:"POST",credentials:a,headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t),signal:o}),c=(i.headers.get("content-type")??"").includes("application/json")?await i.json().catch(()=>null):await i.text();return{ok:i.ok,status:i.status,body:c}}async function zt(e){return e?typeof e=="function"?await e()??{}:e:{}}function qt(e,t,n){for(const o of t){const a=document.createElement("div");if(a.className="beacon-field",o.label){const i=document.createElement("label");i.className="beacon-label",i.textContent=o.label,a.appendChild(i)}if(o.description){const i=document.createElement("div");i.className="beacon-description",i.textContent=o.description,a.appendChild(i)}const r=jt(o,n);a.appendChild(r),e.appendChild(a)}}function jt(e,t){var o,a;const n=t.get(e.name);switch(e.type){case"toggle":{const r=document.createElement("label");r.className="beacon-toggle";const i=document.createElement("input");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}case"text":{const r=document.createElement("input");r.type="text",r.className="beacon-input";const i=n??e.defaultValue??"";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}case"textarea":{const r=document.createElement("textarea");r.className="beacon-textarea";const i=n??e.defaultValue??"";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}case"select":{const r=document.createElement("select");r.className="beacon-select";const i=n??e.defaultValue??((o=e.options[0])==null?void 0:o.value)??"";for(const s of e.options){const c=document.createElement("option");c.value=s.value,c.textContent=s.label??s.value,s.value===i&&(c.selected=!0),r.appendChild(c)}return r.addEventListener("change",()=>t.set(e.name,r.value)),t.set(e.name,i),r}case"radio":{const r=document.createElement("div");r.className="beacon-radio-group";const i=n??e.defaultValue??((a=e.options[0])==null?void 0:a.value)??"";for(const s of e.options){const c=document.createElement("label");c.className="beacon-radio-opt";const u=document.createElement("input");u.type="radio",u.name=e.name,u.value=s.value,s.value===i&&(u.checked=!0),u.addEventListener("change",()=>t.set(e.name,s.value));const l=document.createElement("span");l.textContent=s.label??s.value,c.appendChild(u),c.appendChild(l),r.appendChild(c)}return t.set(e.name,i),r}case"number":{const r=document.createElement("input");r.type="number",r.className="beacon-input";const i=n??e.defaultValue;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",()=>{const s=r.value===""?void 0:Number(r.value);t.set(e.name,s)}),i!==void 0&&t.set(e.name,i),r}}}const re="http://www.w3.org/2000/svg";function Vt(){const e=document.createElementNS(re,"svg");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");const t=document.createElementNS(re,"line");t.setAttribute("x1","18"),t.setAttribute("y1","6"),t.setAttribute("x2","6"),t.setAttribute("y2","18");const n=document.createElementNS(re,"line");return n.setAttribute("x1","6"),n.setAttribute("y1","6"),n.setAttribute("x2","18"),n.setAttribute("y2","18"),e.appendChild(t),e.appendChild(n),e}class Wt{constructor(t,n,o){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);const a=document.createElement("div");a.className="beacon-drawer-header";const r=document.createElement("div");r.className="beacon-drawer-title",r.textContent=t.drawerTitle,a.appendChild(r);const i=document.createElement("button");i.type="button",i.className="beacon-icon-btn",i.setAttribute("aria-label",t.closeButton),i.appendChild(Vt()),i.addEventListener("click",()=>this.userCloseAttempt()),a.appendChild(i),this.inner.appendChild(a),this.root.addEventListener("cancel",g=>{this.submitSucceeded||this.hasUnsavedInput()&&(g.preventDefault(),window.confirm("You have unsaved feedback. Discard?")&&this.root.close())});const s=document.createElement("div");s.className="beacon-drawer-body",this.inner.appendChild(s);const c=document.createElement("div");c.className="beacon-field";const u=document.createElement("label");u.className="beacon-label",u.textContent=t.descriptionLabel,this.descTextarea=document.createElement("textarea"),this.descTextarea.className="beacon-textarea",this.descTextarea.placeholder=t.descriptionPlaceholder,this.descTextarea.rows=4,c.appendChild(u),c.appendChild(this.descTextarea),s.appendChild(c);const l=document.createElement("div");l.className="beacon-field";const p=document.createElement("label");p.className="beacon-label",p.textContent=t.severityLabel,this.severitiesContainer=document.createElement("div"),this.severitiesContainer.className="beacon-severity";for(const g of n){const f=document.createElement("label");f.className="beacon-severity-opt",f.dataset.sev=g;const w=document.createElement("input");w.type="radio",w.name="beacon-severity",w.value=g,g===this.severitySelected&&(w.checked=!0,f.classList.add("selected")),w.addEventListener("change",()=>this.setSeverity(g)),f.appendChild(w),f.appendChild(document.createTextNode(this.severityLabel(g))),this.severitiesContainer.appendChild(f)}l.appendChild(p),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);const d=document.createElement("div");d.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()),d.appendChild(this.submitBtn),s.appendChild(d),this.root.addEventListener("close",()=>{if(this.expectedSuppressedCloses>0){this.expectedSuppressedCloses-=1;return}this.callbacks.onClose("user")})}async requestMode(t){this.modeCounts[t]+=1,this.modeCounts[t]===1&&this.applyMode(t,!0);let n=!1;return()=>{n||(n=!0,this.modeCounts[t]-=1,this.modeCounts[t]===0&&this.applyMode(t,!1))}}applyMode(t,n){var o,a;switch(t){case"pickElement":{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));break}case"hide":{this.inner.style.visibility=n?"hidden":"",this.root.style.opacity=n?"0":"";break}case"minimize":{const r=this.inner.querySelector(".beacon-drawer-body");r&&(r.style.display=n?"none":"");break}}}open(){this.root.open||this.tryShowModal()}close(t="user"){this.root.open&&this.root.close(),t==="submitted"&&(this.statusEl.textContent="")}userCloseAttempt(){!this.submitSucceeded&&this.hasUnsavedInput()&&!window.confirm("You have unsaved feedback. Discard?")||this.root.open&&this.root.close()}hasUnsavedInput(){return this.descTextarea.value.trim().length>0}setSubmitSucceeded(t){this.submitSucceeded=t}getDescription(){return this.descTextarea.value}setDescription(t){this.descTextarea.value=t}getSeverity(){return this.severitySelected}setSeverity(t){this.severitySelected=t;for(const n of Array.from(this.severitiesContainer.children)){n.classList.toggle("selected",n.dataset.sev===t);const o=n.querySelector("input");o&&(o.checked=n.dataset.sev===t)}}setStatus(t,n="idle"){this.statusEl.textContent=t,this.statusEl.classList.remove("error","success"),n!=="idle"&&this.statusEl.classList.add(n)}setSubmitting(t){this.submitBtn.disabled=t,this.submitBtn.textContent=t?this.labels.sending:this.labels.send}resetState(){this.descTextarea.value="",this.setStatus("","idle"),this.setSubmitting(!1),this.submitSucceeded=!1,this.severities[0]&&this.setSeverity(this.severities[0])}installPluginPanels(t,n){this.clearPluginPanels();for(const o of t){const a=document.createElement("div");if(a.className="beacon-plugin-panel",o.form.title){const r=document.createElement("div");r.className="beacon-plugin-panel-title",r.textContent=o.form.title,a.appendChild(r)}if("fields"in o.form)qt(a,o.form.fields,{get:r=>n.get(o.name,r),set:(r,i)=>n.set(o.name,r,i)});else{const r=o.form.render(a,o.ctx);typeof r=="function"&&this.pluginCleanups.push(r)}this.pluginSlot.appendChild(a)}}clearPluginPanels(){for(const t of this.pluginCleanups)try{t()}catch{}this.pluginCleanups=[],this.pluginSlot.innerHTML=""}severityLabel(t){switch(t){case"bug":return this.labels.severityBug;case"idea":return this.labels.severityIdea;case"ux":return this.labels.severityUx;case"a11y":return this.labels.severityA11y}}tryShowModal(){try{this.root.showModal()}catch{this.root.show()}}}function Xt(){return{triggerButton:"Feedback",drawerTitle:"Send feedback",closeButton:"Close",send:"Send",sending:"Sending…",sentSuccess:"Sent — thanks!",descriptionLabel:"Description",descriptionPlaceholder:"What happened?",severityLabel:"Severity",severityBug:"bug",severityIdea:"idea",severityUx:"ux",severityA11y:"a11y"}}function Yt(e){const t=document.createElement("div");return t.className="beacon-overlay-layer",e.appendChild(t),{layer:t}}function Gt(e,t){const n=document.createElement("div");e.layer.appendChild(n);let o;try{o=t(n)}catch(a){throw n.remove(),a}return()=>{try{o==null||o()}catch{}n.parentNode&&n.parentNode.removeChild(n)}}function Kt(){var n,o;const e=navigator;return e.userAgentData?{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",mobile:e.userAgentData.mobile,platform:e.userAgentData.platform}:void 0}function Re(){return{name:"metadata",capture(){const e=Kt();return e?{uaData:e}:null}}}const Jt=30,ae=500,Me=2e3,Zt=500,Qt=5e3,en=/launch-kit-beacon|beacon\.(?:es|umd|mjs)|\/beacon\//i;function z(e,t){if(e)return e.length>t?e.slice(0,t):e}function tn(e,t){const n=(t==null?void 0:t.split(`
697
- `).slice(0,3).join("|"))??"";return`${e}::${n}`}function nn(e){return!!e&&en.test(e)}function on(e){try{return JSON.stringify(e).slice(0,ae)}catch{return String(e)}}function Pe(){const e=[],t=new Map,n=new Set;let o=!1,a,r;function i(s){if(nn(s.stack)||s.kind==="unhandledrejection"&&/AbortError/i.test(s.message))return;const c=tn(s.message,s.stack),u=t.get(c);if(u!==void 0&&s.ts-u<Qt){t.set(c,s.ts);return}t.set(c,s.ts),e.push(s),e.length>Jt&&e.shift();for(const l of n)try{l()}catch{}}return{install(){return o?()=>{}:typeof window>"u"?()=>{}:(o=!0,a=s=>{try{const c=s.error instanceof Error?s.error.message:void 0,u=s.error instanceof Error?s.error.stack:void 0;i({ts:Date.now(),kind:"error",message:z(s.message||c||"Unknown error",ae)??"Unknown error",...u?{stack:z(u,Me)}:{},...s.filename?{source:z(s.filename,Zt)}:{},...Number.isFinite(s.lineno)?{line:s.lineno}:{},...Number.isFinite(s.colno)?{col:s.colno}:{}})}catch{}},r=s=>{try{const c=s.reason,u=c instanceof Error?c.message:typeof c=="string"?c:on(c),l=c instanceof Error?c.stack:void 0;i({ts:Date.now(),kind:"unhandledrejection",message:z(u||"Unknown rejection",ae)??"Unknown rejection",...l?{stack:z(l,Me)}:{}})}catch{}},window.addEventListener("error",a),window.addEventListener("unhandledrejection",r),()=>{a&&window.removeEventListener("error",a),r&&window.removeEventListener("unhandledrejection",r),o=!1,n.clear()})},snapshot(){return e.slice()},subscribe(s){return n.add(s),()=>{n.delete(s)}}}}function Ie(){let e=null;return{name:"errors",setupOnce(t){e=Pe();const n=e.install();return t.signal.addEventListener("abort",n,{once:!0}),n},form(){return{render:t=>{const n=document.createElement("details");n.className="beacon-events";const o=document.createElement("summary");o.className="beacon-events-summary";const a=document.createElement("span");a.className="beacon-events-dot",a.textContent="●";const r=document.createElement("span");r.className="beacon-events-label",o.appendChild(a),o.appendChild(r),n.appendChild(o);const i=document.createElement("ul");i.className="beacon-events-list",n.appendChild(i),t.appendChild(n);function s(){const u=(e==null?void 0:e.snapshot())??[],l=u.length;if(l===0){t.style.display="none";return}t.style.display="",r.textContent=`${l} runtime error${l!==1?"s":""} captured`,i.innerHTML="";for(const p of u){const d=document.createElement("li");d.className="beacon-events-item";const g=document.createElement("span");g.className=`beacon-events-kind ${p.kind==="unhandledrejection"?"rejection":"error"}`,g.textContent=p.kind==="unhandledrejection"?"REJ":"ERR";const f=document.createElement("span");f.className="beacon-events-msg",f.textContent=p.message,d.appendChild(g),d.appendChild(f),i.appendChild(d)}}s();const c=e==null?void 0:e.subscribe(s);return()=>{c==null||c()}}}},capture(){const t=(e==null?void 0:e.snapshot())??[];return t.length===0?null:{events:t}}}}const rn=8,an=" >> ";function Ne(e,t=document){if(!e)return!1;try{return t.querySelectorAll(`#${CSS.escape(e)}`).length===1}catch{return!1}}function sn(e){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("");return t+n}function cn(e){const t=e.parentElement;return t?Array.from(t.children).filter(o=>o.tagName===e.tagName).indexOf(e)+1:1}function ln(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return"";if(e.id&&Ne(e.id))return`#${CSS.escape(e.id)}`;const t=[],n=[];let o=e,a=0;for(;o&&o.tagName.toLowerCase()!=="body"&&a<rn;){const i=o;if(i.id&&Ne(i.id)){t.unshift(`#${CSS.escape(i.id)}`);break}const s=sn(i),c=i.parentElement;let u=s;if(c)try{const l=Array.from(i.classList).join(" ");Array.from(c.children).filter(d=>d.tagName===i.tagName&&Array.from(d.classList).join(" ")===l).length>1&&(u=`${i.tagName.toLowerCase()}:nth-of-type(${cn(i)})`)}catch{}if(t.unshift(u),t.length>1&&n.unshift(" > "),c)o=c;else{const l=i.getRootNode();l instanceof ShadowRoot?(o=l.host,t.length>0&&(n[0]=an)):o=null}a++}let r=t[0]??"";for(let i=1;i<t.length;i++)r+=(n[i-1]??" > ")+t[i];return r}function un(e){const t=Object.keys(e).filter(o=>o.startsWith("__reactFiber$")||o.startsWith("__reactInternalInstance$"));if(t.length===0)return null;let n=e[t[0]];for(let o=0;o<10&&n;o++){const a=n,r=a.type;if(typeof r=="function"){const i=r.displayName??r.name;if(i&&i!=="_default")return{lib:"react",name:i}}if(typeof r=="object"&&r!==null){const i=r.displayName??r.name;if(i)return{lib:"react",name:i}}n=a.return}return{lib:"react"}}function dn(e){var o,a;const t=e,n=t.__vueParentComponent;if(n){const r=((o=n.type)==null?void 0:o.name)??((a=n.type)==null?void 0:a.__name);return{lib:"vue",...r?{name:r}:{}}}return t.__vue__?{lib:"vue"}:null}function pn(e){const t=window.ng;if(!(t!=null&&t.getComponent))return null;try{const n=t.getComponent(e);if(!n)return null;const o=n.constructor;return{lib:"angular",...o!=null&&o.name?{name:o.name}:{}}}catch{return null}}function fn(e){return"__svelte_meta"in e?{lib:"svelte"}:null}function mn(e){return un(e)??dn(e)??pn(e)??fn(e)??void 0}const hn=5e3,bn=1e3,_e=1e3,$e=200,gn=50,De=200,yn=500,wn=["display","position","top","right","bottom","left","width","height","min-width","min-height","max-width","max-height","margin","padding","font-family","font-size","font-weight","line-height","text-align","color","background-color","background-image","border","border-radius","opacity","visibility","overflow","z-index","transform","transition","flex","flex-direction","justify-content","align-items","gap","grid-template-columns","grid-template-rows"];function Fe(e,t){return e.length<=t?e:e.slice(0,t)+`
696
+ `,Le="launch-kit-beacon-portal-styles";function It(){if(typeof document>"u"||!document.head||document.getElementById(Le))return;const e=document.createElement("style");e.id=Le,e.textContent=D,document.head.appendChild(e)}const oe="http://www.w3.org/2000/svg";function Nt(){const e=document.createElementNS(oe,"svg");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");const t=document.createElementNS(oe,"path");t.setAttribute("d","M3 11l18-5v12L3 14v-3z");const n=document.createElementNS(oe,"path");return n.setAttribute("d","M11.6 16.8a3 3 0 1 1-5.8-1.6"),e.appendChild(t),e.appendChild(n),e}const U="launch-kit-beacon",_t=typeof HTMLElement<"u"?HTMLElement:class{};class $t extends _t{constructor(){super(...arguments),this.onTriggerClick=null}connectedCallback(){if(this.shadow)return;this.shadow=this.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=D,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(Nt());const n=document.createElement("span");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",()=>{var o;return(o=this.onTriggerClick)==null?void 0:o.call(this)}),this.triggerSlot.addEventListener("slotchange",()=>{const o=this.triggerSlot.assignedElements();if(o.length>0){this.defaultTrigger.style.display="none";for(const a of o)a.addEventListener("click",()=>{var r;return(r=this.onTriggerClick)==null?void 0:r.call(this)})}else this.defaultTrigger.style.display=""}),this.hasAttribute("position")||this.setAttribute("position","bottom-right"),this.hasAttribute("theme")||this.setAttribute("theme","auto")}setTriggerLabel(t){if(!this.defaultTrigger)return;const n=this.defaultTrigger.querySelector("span");n&&(n.textContent=t)}setHealthIndicator(t){var n;(n=this.healthDot)==null||n.classList.toggle("visible",t)}}function Te(){typeof window>"u"||typeof customElements>"u"||customElements.get(U)||customElements.define(U,$t)}function Dt(e,t){return{pluginName:e,captured:n=>t.getCaptured(n),get formValues(){return t.getFormValues(e)},requestMode:n=>t.requestMode(n),overlay:n=>t.overlay(n),on:(n,o)=>t.onLifecycle(n,o),get signal(){return t.getInitSignal()},captureSignal:()=>t.getCaptureSignal()}}class Ft extends Error{constructor(t){super(`Duplicate plugin name: "${t}"`),this.name="DuplicatePluginNameError"}}function Ot(e){const t=new Set;for(const o of e){if(t.has(o.name))throw new Ft(o.name);t.add(o.name)}const n=e.map(o=>({plugin:o,ctx:null,status:{state:"active",failures:0}}));return{entries:n,install(o,a){for(const r of n)if(r.ctx=o(r.plugin.name),!!r.plugin.setupOnce)try{const i=r.plugin.setupOnce(r.ctx);typeof i=="function"&&(r.teardown=i)}catch(i){const s=i instanceof Error?i:new Error(String(i));r.status={state:"failed",failures:r.status.failures+1,error:{message:s.message,...s.stack?{stack:s.stack}:{},at:"setupOnce"}},a({plugin:r.plugin.name,error:s,at:"setupOnce"})}},destroy(){var o;for(const a of n){try{(o=a.teardown)==null||o.call(a)}catch{}a.teardown=void 0}},async capture(o,a){const r={};for(const i of n)if(i.plugin.capture)try{const s=await i.plugin.capture(i.ctx),c=Ht(s,i.plugin.version);c!==null&&(r[i.plugin.name]=c)}catch(s){const c=s instanceof Error?s:new Error(String(s));r[i.plugin.name]=Bt(c),i.status={state:"failed",failures:i.status.failures+1,error:{message:c.message,...c.stack?{stack:c.stack}:{},at:"capture"}},a({plugin:i.plugin.name,error:c,at:"capture"})}return r},status(){const o={};for(const a of n)o[a.plugin.name]=a.status;return o}}}function Ht(e,t){if(e==null)return null;const n=t??1;return Array.isArray(e)||typeof e!="object"?{v:n,value:e}:{...e,v:n}}function Bt(e){return{error:e.message,...e.stack?{stack:e.stack}:{}}}async function Ut(e,t,n,o,a="omit"){const r=await zt(n),i=await fetch(e,{method:"POST",credentials:a,headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t),signal:o}),c=(i.headers.get("content-type")??"").includes("application/json")?await i.json().catch(()=>null):await i.text();return{ok:i.ok,status:i.status,body:c}}async function zt(e){return e?typeof e=="function"?await e()??{}:e:{}}function qt(e,t,n){for(const o of t){const a=document.createElement("div");if(a.className="beacon-field",o.label){const i=document.createElement("label");i.className="beacon-label",i.textContent=o.label,a.appendChild(i)}if(o.description){const i=document.createElement("div");i.className="beacon-description",i.textContent=o.description,a.appendChild(i)}const r=jt(o,n);a.appendChild(r),e.appendChild(a)}}function jt(e,t){var o,a;const n=t.get(e.name);switch(e.type){case"toggle":{const r=document.createElement("label");r.className="beacon-toggle";const i=document.createElement("input");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}case"text":{const r=document.createElement("input");r.type="text",r.className="beacon-input";const i=n??e.defaultValue??"";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}case"textarea":{const r=document.createElement("textarea");r.className="beacon-textarea";const i=n??e.defaultValue??"";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}case"select":{const r=document.createElement("select");r.className="beacon-select";const i=n??e.defaultValue??((o=e.options[0])==null?void 0:o.value)??"";for(const s of e.options){const c=document.createElement("option");c.value=s.value,c.textContent=s.label??s.value,s.value===i&&(c.selected=!0),r.appendChild(c)}return r.addEventListener("change",()=>t.set(e.name,r.value)),t.set(e.name,i),r}case"radio":{const r=document.createElement("div");r.className="beacon-radio-group";const i=n??e.defaultValue??((a=e.options[0])==null?void 0:a.value)??"";for(const s of e.options){const c=document.createElement("label");c.className="beacon-radio-opt";const u=document.createElement("input");u.type="radio",u.name=e.name,u.value=s.value,s.value===i&&(u.checked=!0),u.addEventListener("change",()=>t.set(e.name,s.value));const l=document.createElement("span");l.textContent=s.label??s.value,c.appendChild(u),c.appendChild(l),r.appendChild(c)}return t.set(e.name,i),r}case"number":{const r=document.createElement("input");r.type="number",r.className="beacon-input";const i=n??e.defaultValue;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",()=>{const s=r.value===""?void 0:Number(r.value);t.set(e.name,s)}),i!==void 0&&t.set(e.name,i),r}}}const re="http://www.w3.org/2000/svg";function Vt(){const e=document.createElementNS(re,"svg");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");const t=document.createElementNS(re,"line");t.setAttribute("x1","18"),t.setAttribute("y1","6"),t.setAttribute("x2","6"),t.setAttribute("y2","18");const n=document.createElementNS(re,"line");return n.setAttribute("x1","6"),n.setAttribute("y1","6"),n.setAttribute("x2","18"),n.setAttribute("y2","18"),e.appendChild(t),e.appendChild(n),e}class Wt{constructor(t,n,o){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);const a=document.createElement("div");a.className="beacon-drawer-header";const r=document.createElement("div");r.className="beacon-drawer-title",r.textContent=t.drawerTitle,a.appendChild(r);const i=document.createElement("button");i.type="button",i.className="beacon-icon-btn",i.setAttribute("aria-label",t.closeButton),i.appendChild(Vt()),i.addEventListener("click",()=>this.userCloseAttempt()),a.appendChild(i),this.inner.appendChild(a),this.root.addEventListener("cancel",g=>{this.submitSucceeded||this.hasUnsavedInput()&&(g.preventDefault(),window.confirm("You have unsaved feedback. Discard?")&&this.root.close())});const s=document.createElement("div");s.className="beacon-drawer-body",this.inner.appendChild(s);const c=document.createElement("div");c.className="beacon-field";const u=document.createElement("label");u.className="beacon-label",u.textContent=t.descriptionLabel,this.descTextarea=document.createElement("textarea"),this.descTextarea.className="beacon-textarea",this.descTextarea.placeholder=t.descriptionPlaceholder,this.descTextarea.rows=4,c.appendChild(u),c.appendChild(this.descTextarea),s.appendChild(c);const l=document.createElement("div");l.className="beacon-field";const p=document.createElement("label");p.className="beacon-label",p.textContent=t.severityLabel,this.severitiesContainer=document.createElement("div"),this.severitiesContainer.className="beacon-severity";for(const g of n){const m=document.createElement("label");m.className="beacon-severity-opt",m.dataset.sev=g;const y=document.createElement("input");y.type="radio",y.name="beacon-severity",y.value=g,g===this.severitySelected&&(y.checked=!0,m.classList.add("selected")),y.addEventListener("change",()=>this.setSeverity(g)),m.appendChild(y),m.appendChild(document.createTextNode(this.severityLabel(g))),this.severitiesContainer.appendChild(m)}l.appendChild(p),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);const d=document.createElement("div");d.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()),d.appendChild(this.submitBtn),s.appendChild(d),this.root.addEventListener("close",()=>{if(this.expectedSuppressedCloses>0){this.expectedSuppressedCloses-=1;return}this.callbacks.onClose("user")})}async requestMode(t){this.modeCounts[t]+=1,this.modeCounts[t]===1&&this.applyMode(t,!0);let n=!1;return()=>{n||(n=!0,this.modeCounts[t]-=1,this.modeCounts[t]===0&&this.applyMode(t,!1))}}applyMode(t,n){var o,a;switch(t){case"pickElement":{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));break}case"hide":{this.inner.style.visibility=n?"hidden":"",this.root.style.opacity=n?"0":"";break}case"minimize":{const r=this.inner.querySelector(".beacon-drawer-body");r&&(r.style.display=n?"none":"");break}}}open(){this.root.open||this.tryShowModal()}close(t="user"){this.root.open&&this.root.close(),t==="submitted"&&(this.statusEl.textContent="")}userCloseAttempt(){!this.submitSucceeded&&this.hasUnsavedInput()&&!window.confirm("You have unsaved feedback. Discard?")||this.root.open&&this.root.close()}hasUnsavedInput(){return this.descTextarea.value.trim().length>0}setSubmitSucceeded(t){this.submitSucceeded=t}getDescription(){return this.descTextarea.value}setDescription(t){this.descTextarea.value=t}getSeverity(){return this.severitySelected}setSeverity(t){this.severitySelected=t;for(const n of Array.from(this.severitiesContainer.children)){n.classList.toggle("selected",n.dataset.sev===t);const o=n.querySelector("input");o&&(o.checked=n.dataset.sev===t)}}setStatus(t,n="idle"){this.statusEl.textContent=t,this.statusEl.classList.remove("error","success"),n!=="idle"&&this.statusEl.classList.add(n)}setSubmitting(t){this.submitBtn.disabled=t,this.submitBtn.textContent=t?this.labels.sending:this.labels.send}resetState(){this.descTextarea.value="",this.setStatus("","idle"),this.setSubmitting(!1),this.submitSucceeded=!1,this.severities[0]&&this.setSeverity(this.severities[0])}installPluginPanels(t,n){this.clearPluginPanels();for(const o of t){const a=document.createElement("div");if(a.className="beacon-plugin-panel",o.form.title){const r=document.createElement("div");r.className="beacon-plugin-panel-title",r.textContent=o.form.title,a.appendChild(r)}if("fields"in o.form)qt(a,o.form.fields,{get:r=>n.get(o.name,r),set:(r,i)=>n.set(o.name,r,i)});else{const r=o.form.render(a,o.ctx);typeof r=="function"&&this.pluginCleanups.push(r)}this.pluginSlot.appendChild(a)}}clearPluginPanels(){for(const t of this.pluginCleanups)try{t()}catch{}this.pluginCleanups=[],this.pluginSlot.innerHTML=""}severityLabel(t){switch(t){case"bug":return this.labels.severityBug;case"idea":return this.labels.severityIdea;case"ux":return this.labels.severityUx;case"a11y":return this.labels.severityA11y}}tryShowModal(){try{this.root.showModal()}catch{this.root.show()}}}function Xt(){return{triggerButton:"Feedback",drawerTitle:"Send feedback",closeButton:"Close",send:"Send",sending:"Sending…",sentSuccess:"Sent — thanks!",descriptionLabel:"Description",descriptionPlaceholder:"What happened?",severityLabel:"Severity",severityBug:"bug",severityIdea:"idea",severityUx:"ux",severityA11y:"a11y"}}function Yt(e){const t=document.createElement("div");return t.className="beacon-overlay-layer",e.appendChild(t),{layer:t}}function Gt(e,t){const n=document.createElement("div");e.layer.appendChild(n);let o;try{o=t(n)}catch(a){throw n.remove(),a}return()=>{try{o==null||o()}catch{}n.parentNode&&n.parentNode.removeChild(n)}}function Kt(){var n,o;const e=navigator;return e.userAgentData?{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",mobile:e.userAgentData.mobile,platform:e.userAgentData.platform}:void 0}function Re(){return{name:"metadata",capture(){const e=Kt();return e?{uaData:e}:null}}}const Jt=30,ae=500,Me=2e3,Zt=500,Qt=5e3,en=/launch-kit-beacon|beacon\.(?:es|umd|mjs)|\/beacon\//i;function z(e,t){if(e)return e.length>t?e.slice(0,t):e}function tn(e,t){const n=(t==null?void 0:t.split(`
697
+ `).slice(0,3).join("|"))??"";return`${e}::${n}`}function nn(e){return!!e&&en.test(e)}function on(e){try{return JSON.stringify(e).slice(0,ae)}catch{return String(e)}}function Pe(){const e=[],t=new Map,n=new Set;let o=!1,a,r;function i(s){if(nn(s.stack)||s.kind==="unhandledrejection"&&/AbortError/i.test(s.message))return;const c=tn(s.message,s.stack),u=t.get(c);if(u!==void 0&&s.ts-u<Qt){t.set(c,s.ts);return}t.set(c,s.ts),e.push(s),e.length>Jt&&e.shift();for(const l of n)try{l()}catch{}}return{install(){return o?()=>{}:typeof window>"u"?()=>{}:(o=!0,a=s=>{try{const c=s.error instanceof Error?s.error.message:void 0,u=s.error instanceof Error?s.error.stack:void 0;i({ts:Date.now(),kind:"error",message:z(s.message||c||"Unknown error",ae)??"Unknown error",...u?{stack:z(u,Me)}:{},...s.filename?{source:z(s.filename,Zt)}:{},...Number.isFinite(s.lineno)?{line:s.lineno}:{},...Number.isFinite(s.colno)?{col:s.colno}:{}})}catch{}},r=s=>{try{const c=s.reason,u=c instanceof Error?c.message:typeof c=="string"?c:on(c),l=c instanceof Error?c.stack:void 0;i({ts:Date.now(),kind:"unhandledrejection",message:z(u||"Unknown rejection",ae)??"Unknown rejection",...l?{stack:z(l,Me)}:{}})}catch{}},window.addEventListener("error",a),window.addEventListener("unhandledrejection",r),()=>{a&&window.removeEventListener("error",a),r&&window.removeEventListener("unhandledrejection",r),o=!1,n.clear()})},snapshot(){return e.slice()},subscribe(s){return n.add(s),()=>{n.delete(s)}}}}function Ie(){let e=null;return{name:"errors",setupOnce(t){e=Pe();const n=e.install();return t.signal.addEventListener("abort",n,{once:!0}),n},form(){return{render:t=>{const n=document.createElement("details");n.className="beacon-events";const o=document.createElement("summary");o.className="beacon-events-summary";const a=document.createElement("span");a.className="beacon-events-dot",a.textContent="●";const r=document.createElement("span");r.className="beacon-events-label",o.appendChild(a),o.appendChild(r),n.appendChild(o);const i=document.createElement("ul");i.className="beacon-events-list",n.appendChild(i),t.appendChild(n);function s(){const u=(e==null?void 0:e.snapshot())??[],l=u.length;if(l===0){t.style.display="none";return}t.style.display="",r.textContent=`${l} runtime error${l!==1?"s":""} captured`,i.innerHTML="";for(const p of u){const d=document.createElement("li");d.className="beacon-events-item";const g=document.createElement("span");g.className=`beacon-events-kind ${p.kind==="unhandledrejection"?"rejection":"error"}`,g.textContent=p.kind==="unhandledrejection"?"REJ":"ERR";const m=document.createElement("span");m.className="beacon-events-msg",m.textContent=p.message,d.appendChild(g),d.appendChild(m),i.appendChild(d)}}s();const c=e==null?void 0:e.subscribe(s);return()=>{c==null||c()}}}},capture(){const t=(e==null?void 0:e.snapshot())??[];return t.length===0?null:{events:t}}}}const rn=8,an=" >> ";function Ne(e,t=document){if(!e)return!1;try{return t.querySelectorAll(`#${CSS.escape(e)}`).length===1}catch{return!1}}function sn(e){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("");return t+n}function cn(e){const t=e.parentElement;return t?Array.from(t.children).filter(o=>o.tagName===e.tagName).indexOf(e)+1:1}function ln(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return"";if(e.id&&Ne(e.id))return`#${CSS.escape(e.id)}`;const t=[],n=[];let o=e,a=0;for(;o&&o.tagName.toLowerCase()!=="body"&&a<rn;){const i=o;if(i.id&&Ne(i.id)){t.unshift(`#${CSS.escape(i.id)}`);break}const s=sn(i),c=i.parentElement;let u=s;if(c)try{const l=Array.from(i.classList).join(" ");Array.from(c.children).filter(d=>d.tagName===i.tagName&&Array.from(d.classList).join(" ")===l).length>1&&(u=`${i.tagName.toLowerCase()}:nth-of-type(${cn(i)})`)}catch{}if(t.unshift(u),t.length>1&&n.unshift(" > "),c)o=c;else{const l=i.getRootNode();l instanceof ShadowRoot?(o=l.host,t.length>0&&(n[0]=an)):o=null}a++}let r=t[0]??"";for(let i=1;i<t.length;i++)r+=(n[i-1]??" > ")+t[i];return r}function un(e){const t=Object.keys(e).filter(o=>o.startsWith("__reactFiber$")||o.startsWith("__reactInternalInstance$"));if(t.length===0)return null;let n=e[t[0]];for(let o=0;o<10&&n;o++){const a=n,r=a.type;if(typeof r=="function"){const i=r.displayName??r.name;if(i&&i!=="_default")return{lib:"react",name:i}}if(typeof r=="object"&&r!==null){const i=r.displayName??r.name;if(i)return{lib:"react",name:i}}n=a.return}return{lib:"react"}}function dn(e){var o,a;const t=e,n=t.__vueParentComponent;if(n){const r=((o=n.type)==null?void 0:o.name)??((a=n.type)==null?void 0:a.__name);return{lib:"vue",...r?{name:r}:{}}}return t.__vue__?{lib:"vue"}:null}function pn(e){const t=window.ng;if(!(t!=null&&t.getComponent))return null;try{const n=t.getComponent(e);if(!n)return null;const o=n.constructor;return{lib:"angular",...o!=null&&o.name?{name:o.name}:{}}}catch{return null}}function fn(e){return"__svelte_meta"in e?{lib:"svelte"}:null}function mn(e){return un(e)??dn(e)??pn(e)??fn(e)??void 0}const hn=5e3,bn=1e3,_e=1e3,$e=200,gn=50,De=200,yn=500,wn=["display","position","top","right","bottom","left","width","height","min-width","min-height","max-width","max-height","margin","padding","font-family","font-size","font-weight","line-height","text-align","color","background-color","background-image","border","border-radius","opacity","visibility","overflow","z-index","transform","transition","flex","flex-direction","justify-content","align-items","gap","grid-template-columns","grid-template-rows"];function Fe(e,t){return e.length<=t?e:e.slice(0,t)+`
698
698
 
699
- /* … truncated, original was ${e.length} chars */`}function vn(e){const t=getComputedStyle(e),n={};for(const o of wn){const a=t.getPropertyValue(o);a&&a!=="normal"&&a!=="none"&&a!=="auto"&&a!=="0px"&&(n[o]=a.trim().slice(0,yn))}return n}function xn(e){return Array.from(e.classList).slice(0,gn).map(t=>t.length>De?t.slice(0,De):t)}function En(e){const t=e.getBoundingClientRect(),n=ln(e),o=e.id||null,a=mn(e);return{selector:n.length>_e?n.slice(0,_e):n,tagName:e.tagName.toLowerCase(),id:o&&o.length>$e?o.slice(0,$e):o,classList:xn(e),outerHTML:Fe(e.outerHTML,hn),...e.parentElement?{parentOuterHTML:Fe(e.parentElement.outerHTML,bn)}:{},computedStyles:vn(e),boundingRect:{x:Math.round(t.x),y:Math.round(t.y),w:Math.round(t.width),h:Math.round(t.height)},...a?{framework:a}:{}}}const Sn=14,Cn="#ffffff",An="#ffffff",kn=3,Ln="#0ea5e9";async function Oe(e,t,n,o=Ln){const a=await Rn(e),r=document.createElement("canvas");r.width=a.naturalWidth,r.height=a.naturalHeight;const i=r.getContext("2d");if(!i)throw new Error("Could not get 2D canvas context");i.drawImage(a,0,0);const s=r.width/n.w,c=r.height/n.h;for(const u of t){const l=Tn(u);if(!l)continue;const p=l.x*s,d=l.y*c,g=l.w*s,f=l.h*c;i.lineWidth=kn,i.strokeStyle=o,i.strokeRect(p,d,g,f);const w=p+g,S=d;i.beginPath(),i.fillStyle=o,i.arc(w,S,Sn,0,Math.PI*2),i.fill(),i.lineWidth=3,i.strokeStyle=Cn,i.stroke(),i.fillStyle=An,i.font="bold 16px system-ui, -apple-system, sans-serif",i.textAlign="center",i.textBaseline="middle",i.fillText(String(u.number),w,S+1)}return r.toDataURL("image/jpeg",.85)}function Tn(e){if(e.liveElement&&document.contains(e.liveElement)){const t=e.liveElement.getBoundingClientRect();if(t.width>0||t.height>0)return{x:t.left,y:t.top,w:t.width,h:t.height}}if(e.selector)try{const t=document.querySelector(e.selector);if(t){const n=t.getBoundingClientRect();if(n.width>0||n.height>0)return{x:n.left,y:n.top,w:n.width,h:n.height}}}catch{}return e.boundingRect}function Rn(e){return new Promise((t,n)=>{const o=new Image;o.onload=()=>t(o),o.onerror=a=>n(a),o.src=e})}const q="beacon-no-capture",Mn="#0ea5e9",He="Click any element to pin it · Press Esc to finish";function Be(e,t){return/^#[0-9a-fA-F]{6}$/.test(e)?`${e}${t}`:e}function Pn(e={}){const t=e.accent??Mn,n=Be(t,"b3"),o=Be(t,"2e"),a=document.createElement("style");a.className=q,a.textContent="@keyframes beacon-spin { to { transform: rotate(360deg); } }",document.head.appendChild(a);const r=document.createElement("div");r.className=q,r.setAttribute("aria-hidden","true"),r.style.cssText=["position: fixed","inset: 0","pointer-events: none","z-index: 2147483646",`border: 2px dashed ${n}`,"border-radius: 4px",`box-shadow: inset 0 0 56px ${o}`,"box-sizing: border-box"].join("; ");const i=document.createElement("div");i.className=q,i.setAttribute("role","status"),i.style.cssText=["position: fixed","top: 16px","left: 50%","transform: translateX(-50%)",`background: ${t}`,"color: #fff","padding: 6px 14px","border-radius: 999px","font: 500 12px/1.4 system-ui, -apple-system, sans-serif","letter-spacing: 0.01em","box-shadow: 0 4px 12px hsl(0 0% 0% / 0.3)","pointer-events: none","white-space: nowrap","z-index: 2147483646"].join("; "),i.textContent=He;const s=`<span style="
699
+ /* … truncated, original was ${e.length} chars */`}function vn(e){const t=getComputedStyle(e),n={};for(const o of wn){const a=t.getPropertyValue(o);a&&a!=="normal"&&a!=="none"&&a!=="auto"&&a!=="0px"&&(n[o]=a.trim().slice(0,yn))}return n}function xn(e){return Array.from(e.classList).slice(0,gn).map(t=>t.length>De?t.slice(0,De):t)}function En(e){const t=e.getBoundingClientRect(),n=ln(e),o=e.id||null,a=mn(e);return{selector:n.length>_e?n.slice(0,_e):n,tagName:e.tagName.toLowerCase(),id:o&&o.length>$e?o.slice(0,$e):o,classList:xn(e),outerHTML:Fe(e.outerHTML,hn),...e.parentElement?{parentOuterHTML:Fe(e.parentElement.outerHTML,bn)}:{},computedStyles:vn(e),boundingRect:{x:Math.round(t.x),y:Math.round(t.y),w:Math.round(t.width),h:Math.round(t.height)},...a?{framework:a}:{}}}const Sn=14,Cn="#ffffff",An="#ffffff",kn=3,Ln="#0ea5e9";async function Oe(e,t,n,o=Ln){const a=await Rn(e),r=document.createElement("canvas");r.width=a.naturalWidth,r.height=a.naturalHeight;const i=r.getContext("2d");if(!i)throw new Error("Could not get 2D canvas context");i.drawImage(a,0,0);const s=r.width/n.w,c=r.height/n.h;for(const u of t){const l=Tn(u);if(!l)continue;const p=l.x*s,d=l.y*c,g=l.w*s,m=l.h*c;i.lineWidth=kn,i.strokeStyle=o,i.strokeRect(p,d,g,m);const y=p+g,S=d;i.beginPath(),i.fillStyle=o,i.arc(y,S,Sn,0,Math.PI*2),i.fill(),i.lineWidth=3,i.strokeStyle=Cn,i.stroke(),i.fillStyle=An,i.font="bold 16px system-ui, -apple-system, sans-serif",i.textAlign="center",i.textBaseline="middle",i.fillText(String(u.number),y,S+1)}return r.toDataURL("image/jpeg",.85)}function Tn(e){if(e.liveElement&&document.contains(e.liveElement)){const t=e.liveElement.getBoundingClientRect();if(t.width>0||t.height>0)return{x:t.left,y:t.top,w:t.width,h:t.height}}if(e.selector)try{const t=document.querySelector(e.selector);if(t){const n=t.getBoundingClientRect();if(n.width>0||n.height>0)return{x:n.left,y:n.top,w:n.width,h:n.height}}}catch{}return e.boundingRect}function Rn(e){return new Promise((t,n)=>{const o=new Image;o.onload=()=>t(o),o.onerror=a=>n(a),o.src=e})}const q="beacon-no-capture",Mn="#0ea5e9",He="Click any element to pin it · Press Esc to finish";function Be(e,t){return/^#[0-9a-fA-F]{6}$/.test(e)?`${e}${t}`:e}function Pn(e={}){const t=e.accent??Mn,n=Be(t,"b3"),o=Be(t,"2e"),a=document.createElement("style");a.className=q,a.textContent="@keyframes beacon-spin { to { transform: rotate(360deg); } }",document.head.appendChild(a);const r=document.createElement("div");r.className=q,r.setAttribute("aria-hidden","true"),r.style.cssText=["position: fixed","inset: 0","pointer-events: none","z-index: 2147483646",`border: 2px dashed ${n}`,"border-radius: 4px",`box-shadow: inset 0 0 56px ${o}`,"box-sizing: border-box"].join("; ");const i=document.createElement("div");i.className=q,i.setAttribute("role","status"),i.style.cssText=["position: fixed","top: 16px","left: 50%","transform: translateX(-50%)",`background: ${t}`,"color: #fff","padding: 6px 14px","border-radius: 999px","font: 500 12px/1.4 system-ui, -apple-system, sans-serif","letter-spacing: 0.01em","box-shadow: 0 4px 12px hsl(0 0% 0% / 0.3)","pointer-events: none","white-space: nowrap","z-index: 2147483646"].join("; "),i.textContent=He;const s=`<span style="
700
700
  display: inline-block;
701
701
  width: 12px;
702
702
  height: 12px;
@@ -706,7 +706,7 @@ dialog.beacon-dialog::backdrop {
706
706
  animation: beacon-spin 800ms linear infinite;
707
707
  vertical-align: middle;
708
708
  margin-right: 8px;
709
- "></span>`;function c(h){return h.replace(/[<>&]/g,m=>({"<":"&lt;",">":"&gt;","&":"&amp;"})[m])}document.body.appendChild(r),document.body.appendChild(i);const u=new Map;function l(h){const m=document.createElement("div");return m.className=q,m.setAttribute("aria-hidden","true"),m.style.cssText=["position: fixed","width: 24px","height: 24px","border-radius: 999px",`background: ${t}`,"color: #fff","display: flex","align-items: center","justify-content: center","font: 700 12px/1 system-ui, -apple-system, sans-serif","border: 2px solid #fff","box-shadow: 0 2px 8px hsl(0 0% 0% / 0.4)","pointer-events: none","z-index: 2147483646"].join("; "),m.textContent=String(h),document.body.appendChild(m),m}function p(){const h=document.createElement("div");return h.className=q,h.setAttribute("aria-hidden","true"),h.style.cssText=["position: fixed","pointer-events: none",`border: 2px solid ${t}`,"border-radius: 2px","box-sizing: border-box","z-index: 2147483645"].join("; "),document.body.appendChild(h),h}function d(h,m,E){const b=E?"0.5":"1";h.outline.style.display="block",h.outline.style.opacity=b,h.outline.style.left=`${m.x}px`,h.outline.style.top=`${m.y}px`,h.outline.style.width=`${m.w}px`,h.outline.style.height=`${m.h}px`,h.marker.style.display="flex",h.marker.style.opacity=b,h.marker.style.left=`${m.x+m.w-12}px`,h.marker.style.top=`${Math.max(2,m.y-12)}px`}function g(h){h.marker.style.display="none",h.outline.style.display="none"}function f(){u.forEach(h=>{let m=h.anchor.target;if(m&&!m.isConnected&&(m=null),!m&&h.anchor.selector){try{m=document.querySelector(h.anchor.selector)}catch{m=null}m&&(h.anchor.target=m)}if(m){const b=m.getBoundingClientRect();if(b.width>0||b.height>0){d(h,{x:b.left,y:b.top,w:b.width,h:b.height},!1);return}}const E=h.anchor.fallbackRect;if(E&&(E.w>0||E.h>0)){d(h,E,!0);return}g(h)})}let w=null;function S(){w===null&&(w=requestAnimationFrame(()=>{w=null,f()}))}return window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),{addPin(h,m){const E=l(h),b=p();u.set(h,{anchor:m,marker:E,outline:b}),f()},setLoading(h){h?i.innerHTML=s+c(h):i.textContent=He},destroy(){window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S),w!==null&&cancelAnimationFrame(w),r.remove(),i.remove(),a.remove(),u.forEach(({marker:h,outline:m})=>{h.remove(),m.remove()}),u.clear()}}}const In='<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>',Nn='<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>';function _n(e){return new Promise(t=>{const n=document.createElement("div");n.className="beacon-pin-popover open beacon-no-capture beacon-theme-auto",n.innerHTML=`
709
+ "></span>`;function c(h){return h.replace(/[<>&]/g,f=>({"<":"&lt;",">":"&gt;","&":"&amp;"})[f])}document.body.appendChild(r),document.body.appendChild(i);const u=new Map;function l(h){const f=document.createElement("div");return f.className=q,f.setAttribute("aria-hidden","true"),f.style.cssText=["position: fixed","width: 24px","height: 24px","border-radius: 999px",`background: ${t}`,"color: #fff","display: flex","align-items: center","justify-content: center","font: 700 12px/1 system-ui, -apple-system, sans-serif","border: 2px solid #fff","box-shadow: 0 2px 8px hsl(0 0% 0% / 0.4)","pointer-events: none","z-index: 2147483646"].join("; "),f.textContent=String(h),document.body.appendChild(f),f}function p(){const h=document.createElement("div");return h.className=q,h.setAttribute("aria-hidden","true"),h.style.cssText=["position: fixed","pointer-events: none",`border: 2px solid ${t}`,"border-radius: 2px","box-sizing: border-box","z-index: 2147483645"].join("; "),document.body.appendChild(h),h}function d(h,f,E){const b=E?"0.5":"1";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`}function g(h){h.marker.style.display="none",h.outline.style.display="none"}function m(){u.forEach(h=>{let f=h.anchor.target;if(f&&!f.isConnected&&(f=null),!f&&h.anchor.selector){try{f=document.querySelector(h.anchor.selector)}catch{f=null}f&&(h.anchor.target=f)}if(f){const b=f.getBoundingClientRect();if(b.width>0||b.height>0){d(h,{x:b.left,y:b.top,w:b.width,h:b.height},!1);return}}const E=h.anchor.fallbackRect;if(E&&(E.w>0||E.h>0)){d(h,E,!0);return}g(h)})}let y=null;function S(){y===null&&(y=requestAnimationFrame(()=>{y=null,m()}))}return window.addEventListener("scroll",S,!0),window.addEventListener("resize",S),{addPin(h,f){const E=l(h),b=p();u.set(h,{anchor:f,marker:E,outline:b}),m()},setLoading(h){h?i.innerHTML=s+c(h):i.textContent=He},destroy(){window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",S),y!==null&&cancelAnimationFrame(y),r.remove(),i.remove(),a.remove(),u.forEach(({marker:h,outline:f})=>{h.remove(),f.remove()}),u.clear()}}}const In='<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>',Nn='<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>';function _n(e){return new Promise(t=>{const n=document.createElement("div");n.className="beacon-pin-popover open beacon-no-capture beacon-theme-auto",n.innerHTML=`
710
710
  <div class="beacon-pin-popover-header">
711
711
  <div style="display:flex;align-items:center;gap:6px;font-weight:600;font-size:13px;">
712
712
  <span class="beacon-pin-num">${e.pinNumber}</span>
@@ -718,6 +718,6 @@ dialog.beacon-dialog::backdrop {
718
718
  <div class="beacon-pin-popover-actions">
719
719
  <button type="button" class="beacon-btn primary" data-action="save">${Nn} Save</button>
720
720
  </div>
721
- `;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);n.style.left=`${r}px`,n.style.top=`${i}px`,document.body.appendChild(n);const s=n.querySelector("textarea");s.focus();function c(l){document.removeEventListener("keydown",u,!0),n.remove(),t(l)}function u(l){l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),c({cancelled:"all"}))}document.addEventListener("keydown",u,!0),n.addEventListener("click",l=>{var g;const d=(g=l.target.closest("[data-action]"))==null?void 0:g.getAttribute("data-action");if(d&&(l.stopPropagation(),d==="cancel"&&c({cancelled:"pin"}),d==="save")){const f=s.value.trim();c({...f?{note:f}:{},cancelled:!1})}}),s.addEventListener("keydown",l=>{if(l.key==="Enter"&&(l.metaKey||l.ctrlKey)){l.preventDefault();const p=s.value.trim();c({...p?{note:p}:{},cancelled:!1})}})})}const $n="#0ea5e9";function Dn(e,t){return/^#[0-9a-fA-F]{6}$/.test(e)?`${e}${t}`:e}function Fn(e){const{shadowRoot:t,onHover:n}=e,o=e.accent??$n,a=Dn(o,"14"),r=document.createElement("div");r.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483646",`border: 2px solid ${o}`,`background: ${a}`,"transition: all 60ms ease-out","box-sizing: border-box","border-radius: 2px"].join("; "),document.body.appendChild(r);const i=document.createElement("div");i.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483647","background: #0f172a","color: #fff","font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace","padding: 3px 6px","border-radius: 3px","max-width: 280px","overflow: hidden","text-overflow: ellipsis","white-space: nowrap"].join("; "),document.body.appendChild(i);const s=document.body.style.cursor;document.body.style.cursor="crosshair";let c=!1,u=()=>{};const l=new Promise(b=>{u=b});function p(b){if(!b||!(b instanceof Node))return!1;let x=b;for(;x;){if(x===t||x===t.host)return!0;x=x.parentNode??x.host??null}return!1}function d(b){return b.tagName.includes("-")}function g(b,x){var C,A;r.style.display="none",i.style.display="none";const L=document.elementsFromPoint(b,x);r.style.display="block",i.style.display="block";for(const R of L){if(p(R))continue;let y=R,T=16;for(;y.shadowRoot&&!d(y)&&T-- >0;){const N=(((A=(C=y.shadowRoot).elementsFromPoint)==null?void 0:A.call(C,b,x))??[]).find(ne=>!p(ne)&&ne!==y);if(!N)break;y=N}return y}return null}function f(b){const x=b.getBoundingClientRect();r.style.left=`${x.left}px`,r.style.top=`${x.top}px`,r.style.width=`${x.width}px`,r.style.height=`${x.height}px`;const L=b.tagName.toLowerCase(),C=b.classList.length>0?"."+Array.from(b.classList).slice(0,2).join("."):"";i.textContent=L+C;const A=x.top-22;i.style.left=`${x.left}px`,i.style.top=`${A>=0?A:x.bottom+4}px`}function w(b){const x=g(b.clientX,b.clientY);x?(f(x),n==null||n(x)):(r.style.display="none",i.style.display="none",n==null||n(null))}function S(b){if(b.button!==0)return;b.preventDefault(),b.stopPropagation();const x=g(b.clientX,b.clientY);x&&E(x)}function h(b){b.preventDefault(),b.stopPropagation()}function m(b){b.key==="Escape"&&(b.preventDefault(),E(null))}function E(b){c||(c=!0,document.removeEventListener("mousemove",w,!0),document.removeEventListener("pointerdown",S,!0),document.removeEventListener("click",h,!0),document.removeEventListener("mouseup",h,!0),document.removeEventListener("keydown",m,!0),r.remove(),i.remove(),document.body.style.cursor=s,u(b))}return document.addEventListener("mousemove",w,!0),document.addEventListener("pointerdown",S,!0),document.addEventListener("click",h,!0),document.addEventListener("mouseup",h,!0),document.addEventListener("keydown",m,!0),{cancel:()=>E(null),promise:l}}let ie=null;async function On(){return ie||(ie=await Promise.resolve().then(()=>$r)),ie}const Y="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=";function Ue(e,t){if(!e||e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("/")||e.startsWith("#"))return!0;try{if(new URL(e,window.location.href).origin===window.location.origin)return!0}catch{return!1}return t==="anonymous"||t==="use-credentials"}function Hn(){const e=[],t=[];return document.querySelectorAll("img").forEach(n=>{Ue(n.src,n.crossOrigin)||(e.push({el:n,src:n.src}),n.src=Y)}),document.querySelectorAll("image").forEach(n=>{const o=n,a=o.getAttribute("href"),r=o.getAttributeNS("http://www.w3.org/1999/xlink","href"),i=a||r||"";i&&!Ue(i)&&(t.push({el:o,href:a,xlink:r}),a!==null&&o.setAttribute("href",Y),r!==null&&o.setAttributeNS("http://www.w3.org/1999/xlink","href",Y))}),()=>{for(const{el:n,src:o}of e)n.src=o;for(const{el:n,href:o,xlink:a}of t)o!==null&&n.setAttribute("href",o),a!==null&&n.setAttributeNS("http://www.w3.org/1999/xlink","href",a)}}function Bn(){const e=[];document.querySelectorAll("*").forEach(r=>{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;(s||c)&&e.push(r)});const t=window.scrollX,n=window.scrollY,o=e.map(r=>({el:r,scrollLeft:r.scrollLeft,scrollTop:r.scrollTop})),a=new Map;for(const r of e){let i=r;for(;i&&i!==document.documentElement.parentElement;)a.has(i)||a.set(i,i.style.cssText),i=i.parentElement}for(const r of a.keys())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");return()=>{for(const[r,i]of a)r.style.cssText=i;for(const{el:r,scrollLeft:i,scrollTop:s}of o)r.scrollLeft=i,r.scrollTop=s;window.scrollTo(t,n)}}let ze=Promise.resolve();async function qe(e={}){const t=ze;let n;ze=new Promise(o=>{n=o});try{return await t,await Un(e,n)}catch(o){throw n(),o}}async function Un(e,t){const{quality:n=.7,pixelRatio:o=Math.min(window.devicePixelRatio||1,2),excludeShadowRoot:a,excludeHosts:r,fullPage:i=!0}=e,s=await On(),c=a||r!=null&&r.length?g=>{let f=g;for(;f;){if(a&&f===a.host||r&&f instanceof Element&&r.includes(f)||f instanceof Element&&f.classList.contains("beacon-no-capture"))return!1;f=f.parentNode}return!0}:void 0,u=Hn(),l=i?Bn():()=>{};let p=!1;const d=()=>{if(!p){p=!0;try{l()}finally{try{u()}finally{t()}}}};try{i&&await new Promise(h=>requestAnimationFrame(()=>h()));const g=document.documentElement,f=i?Math.max(g.scrollWidth,window.innerWidth):window.innerWidth,w=i?Math.max(g.scrollHeight,window.innerHeight):window.innerHeight;return{dataUrl:await s.toJpeg(g,{quality:n,pixelRatio:o,cacheBust:!0,...c?{filter:c}:{},imagePlaceholder:Y,width:f,height:w,style:{transform:"none"}}),width:f,height:w,pixelRatio:o,dispose:d}}catch(g){throw d(),g}}let se=null;function zn(e){se=e}function qn(){return se}function F(){se=null}const je="http://www.w3.org/2000/svg";function jn(){const e=document.createElementNS(je,"svg");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");const t=["M3 6h18","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6","M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"];for(const n of t){const o=document.createElementNS(je,"path");o.setAttribute("d",n),e.appendChild(o)}return e}function Ve(e={}){const t=e.maxPins??20;let n=[],o=new WeakMap,a=null,r=0,i=null,s=null,c=null,u=null;function l(){n=[],o=new WeakMap,a=null,r+=1,F(),S(),h()}function p(){const m=document.querySelector("launch-kit-beacon");return(m==null?void 0:m.shadowRoot)??null}function d(){if(typeof window>"u")return e.accent??"#0ea5e9";if(e.accent)return e.accent;const m=document.querySelector("launch-kit-beacon");return m&&getComputedStyle(m).getPropertyValue("--beacon-accent").trim()||"#0ea5e9"}async function g(m){const E=p();if(!E)return;const b=d(),x=await m.requestMode("pickElement"),L=Pn({accent:b});for(const C of n){const A=o.get(C);A&&L.addPin(C.number,{target:A,selector:C.selector,fallbackRect:C.boundingRect})}try{let C=!0;for(;C&&!(n.length>=t);){const R=await Fn({shadowRoot:E,accent:b}).promise;if(!R)break;const y=R.getBoundingClientRect(),T=await _n({anchor:{x:y.left,y:y.bottom},pinNumber:n.length+1});if(T.cancelled==="all"){C=!1;break}if(T.cancelled==="pin")continue;const _=En(R),N={number:n.length+1,..._,...T.note?{note:T.note}:{}};n.push(N),o.set(N,R),L.addPin(N.number,{target:R,selector:_.selector,fallbackRect:_.boundingRect})}n.length>0?(L.setLoading("Capturing screenshot…"),await new Promise(A=>requestAnimationFrame(()=>A())),await f()):(a=null,F())}finally{L.destroy(),x()}S(),h()}async function f(){const m=++r;if(n.length===0){a=null,F(),h();return}const E=d();try{const b=Array.from(document.querySelectorAll("launch-kit-beacon")),x=await qe({excludeHosts:b});try{if(m!==r)return;const L=n.map(R=>({number:R.number,selector:R.selector,boundingRect:R.boundingRect,...o.get(R)?{liveElement:o.get(R)}:{}})),C={w:x.width,h:x.height,dpr:x.pixelRatio},A=await Oe(x.dataUrl,L,C,E);if(m!==r)return;a=A,zn({dataUrl:A,mime:"image/jpeg"})}finally{x.dispose()}}catch{if(m!==r)return;a=null,F()}m===r&&h()}function w(m){const E=n.findIndex(b=>b.number===m);E!==-1&&(n.splice(E,1),n.forEach((b,x)=>{b.number=x+1}),a=null,F(),S(),h(),f())}function S(){if(i&&(i.textContent=`Pins (${n.length})`,i.style.display=n.length===0?"none":""),u&&(u.textContent=n.length===0?"Annotate elements":"Add another pin"),!!s){s.innerHTML="",s.style.display=n.length===0?"none":"";for(const m of n){const E=document.createElement("div");E.className="beacon-pin-item",E.dataset.pin=String(m.number);const b=document.createElement("span");b.className="beacon-pin-num",b.textContent=String(m.number);const x=document.createElement("div");x.className="beacon-pin-meta";const L=document.createElement("div");L.className="beacon-pin-selector",L.title=m.selector,L.textContent=m.selector||m.tagName;const C=document.createElement("input");C.type="text",C.className="beacon-pin-note-input",C.placeholder="Add a note (optional)",C.value=m.note??"",C.addEventListener("input",()=>{C.value.trim()?m.note=C.value:delete m.note}),x.appendChild(L),x.appendChild(C);const A=document.createElement("button");A.type="button",A.className="beacon-icon-btn",A.setAttribute("aria-label",`Remove pin ${m.number}`),A.appendChild(jn()),A.addEventListener("click",()=>w(m.number)),E.appendChild(b),E.appendChild(x),E.appendChild(A),s.appendChild(E)}}}function h(){c&&(a?(c.src=a,c.style.display="block"):(c.removeAttribute("src"),c.style.display="none"))}return{name:"domEle",setupOnce(m){return m.on("close",()=>l())},form(m){return{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),u=document.createElement("button"),u.type="button",u.className="beacon-btn secondary beacon-pin-annotate",u.addEventListener("click",()=>{g(m)}),E.appendChild(u),c=document.createElement("img"),c.className="beacon-thumb",c.alt="Annotated screenshot preview",c.style.display="none",E.appendChild(c),S(),h(),()=>{i=null,s=null,c=null,u=null})}},capture(){return n.length===0?null:{pins:n}}}}function We(e){return!!e&&typeof e=="object"&&!("v"in e)&&"error"in e}function Xe(e={}){return{name:"domSS",async capture(t){const n=qn();if(n)return{dataUrl:n.dataUrl,mime:n.mime};const o=await t.requestMode("hide");try{await new Promise(i=>requestAnimationFrame(()=>i()));const a=Array.from(document.querySelectorAll("launch-kit-beacon")),r=await qe({quality:e.quality,pixelRatio:e.pixelRatio,excludeHosts:a});try{const i=t.captured("domEle"),s=Vn(i),c={w:r.width,h:r.height,dpr:r.pixelRatio},u=e.accent??Wn();return{dataUrl:s.length>0?await Oe(r.dataUrl,s,c,u):r.dataUrl,mime:"image/jpeg"}}finally{r.dispose()}}finally{o()}}}}function Vn(e){if(!e||We(e))return[];const t=e.pins;return Array.isArray(t)?t.filter(n=>!!n&&typeof n=="object").map(n=>({number:Number(n.number)||0,selector:typeof n.selector=="string"?n.selector:void 0,boundingRect:n.boundingRect??{x:0,y:0,w:0,h:0}})):[]}function Wn(){if(typeof window>"u")return"#0ea5e9";const e=document.querySelector("launch-kit-beacon");return e&&getComputedStyle(e).getPropertyValue("--beacon-accent").trim()||"#0ea5e9"}const Ye="beacon-no-capture",Ge="__lsBeaconMonitorChipPos",Xn="#10b981";function Yn(e){const t=e.accent??Xn,n=e.startedAt??Date.now(),o=document.createElement("div");o.className=`${Ye} beacon-monitor-overlay-frame`,o.setAttribute("aria-hidden","true"),o.style.setProperty("--beacon-monitor-accent",t),document.body.appendChild(o);const a=document.createElement("div");a.className=`${Ye} beacon-monitor-overlay-chip`,a.setAttribute("role","status"),a.setAttribute("aria-label","Recording — drag to move"),a.style.setProperty("--beacon-monitor-accent",t);const r=document.createElement("div");r.className="beacon-monitor-overlay-chip-row";const i=document.createElement("span");i.className="beacon-monitor-overlay-rec-dot",i.setAttribute("aria-hidden","true");const s=document.createElement("span");s.className="beacon-monitor-overlay-rec-label",s.textContent="REC";const c=document.createElement("span");c.className="beacon-monitor-overlay-sep",c.setAttribute("aria-hidden","true"),c.textContent="·";const u=document.createElement("span");u.className="beacon-monitor-overlay-timer",u.textContent="00:00";const l=document.createElement("button");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(u),r.appendChild(l),a.appendChild(r);const p=document.createElement("div");p.className="beacon-monitor-overlay-url",e.url?(p.textContent=e.url,p.title=e.url):p.style.display="none",a.appendChild(p),document.body.appendChild(a);const d=g()??f();S(w(d));function g(){try{const y=localStorage.getItem(Ge);if(!y)return null;const T=JSON.parse(y),_=typeof T.x=="number"?T.x:NaN,N=typeof T.y=="number"?T.y:NaN;return!Number.isFinite(_)||!Number.isFinite(N)?null:{x:_,y:N}}catch{return null}}function f(){const T=a.getBoundingClientRect().width||200;return{x:Math.max(8,Math.floor((window.innerWidth-T)/2)),y:16}}function w(y){const _=a.getBoundingClientRect(),N=_.width||200,ne=_.height||40,Dr=Math.max(8,window.innerWidth-N-8),Fr=Math.max(8,window.innerHeight-ne-8);return{x:Math.min(Math.max(8,y.x),Dr),y:Math.min(Math.max(8,y.y),Fr)}}function S(y){a.style.left=`${y.x}px`,a.style.top=`${y.y}px`}let h=!1,m=null,E={x:0,y:0};function b(y){if(y.target instanceof Element&&y.target.closest(".beacon-monitor-overlay-stop"))return;y.preventDefault(),h=!0,m=y.pointerId;try{a.setPointerCapture(y.pointerId)}catch{}a.setAttribute("data-dragging","true");const T=a.getBoundingClientRect();E={x:y.clientX-T.left,y:y.clientY-T.top}}function x(y){!h||y.pointerId!==m||S(w({x:y.clientX-E.x,y:y.clientY-E.y}))}function L(y){if(!h||y.pointerId!==m)return;h=!1,m=null,a.removeAttribute("data-dragging");try{a.releasePointerCapture(y.pointerId)}catch{}const T=a.getBoundingClientRect();try{localStorage.setItem(Ge,JSON.stringify({x:T.left,y:T.top}))}catch{}}a.addEventListener("pointerdown",b),a.addEventListener("pointermove",x),a.addEventListener("pointerup",L),a.addEventListener("pointercancel",L),l.addEventListener("click",y=>{y.stopPropagation(),e.onStop()});function C(){const y=a.getBoundingClientRect();S(w({x:y.left,y:y.top}))}window.addEventListener("resize",C);function A(){const y=Math.max(0,Math.floor((Date.now()-n)/1e3));u.textContent=Gn(y)}A();const R=window.setInterval(A,1e3);return{updateUrl(y){y?(p.textContent=y,p.title=y,p.style.display=""):p.style.display="none"},destroy(){window.clearInterval(R),window.removeEventListener("resize",C),a.removeEventListener("pointerdown",b),a.removeEventListener("pointermove",x),a.removeEventListener("pointerup",L),a.removeEventListener("pointercancel",L),o.remove(),a.remove()}}}function Gn(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=e%60;return t>0?`${j(t)}:${j(n)}:${j(o)}`:`${j(n)}:${j(o)}`}function j(e){return e<10?`0${e}`:String(e)}const G=80,Kn='button, a, input[type="submit"], input[type="button"], [role="button"], [role="link"], [role="menuitem"], [role="tab"], [role="option"]',Jn=1024,Zn=5;function Qn(e,t){return e.length>t?e.slice(0,t):e}function ce(e){if(e.id)return`#${CSS.escape(e.id)}`;const t=[];let n=e;for(let o=0;o<5&&n;o++){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("."):"";if(t.unshift(`${a}${r}${i}`),r)break;n=n.parentElement}return t.join(" > ")}function K(e,t){if(!e)return;const n=e.replace(/\s+/g," ").trim();if(n)return n.length>t?n.slice(0,t):n}function Ke(e){const t=K(e.textContent,G),n=K(e.getAttribute("aria-label"),G),o=e.getAttribute("data-testid")||void 0,a=e.getAttribute("name")||void 0;let r=n||t;if(!r){const i=e.closest(Kn);i&&i!==e&&(r=K(i.getAttribute("aria-label"),G)||K(i.textContent,G))}return{tag:e.tagName.toLowerCase(),id:e.id||null,classes:Array.from(e.classList).slice(0,10),role:e.getAttribute("role"),selector:ce(e),...t?{text:t}:{},...n?{ariaLabel:n}:{},...o?{testid:o}:{},...a?{name:a}:{},...r&&r!==t?{label:r}:{}}}function eo(e,t){const n=[],o=document.querySelectorAll("body *");for(const a of Array.from(o)){const r=getComputedStyle(a);if(r.position!=="fixed"&&r.position!=="sticky")continue;const i=a.getBoundingClientRect();if(e<i.left||e>i.right||t<i.top||t>i.bottom)continue;const s=parseInt(r.zIndex,10);!Number.isFinite(s)&&r.zIndex!=="auto"||n.push({tag:a.tagName.toLowerCase(),zIndex:Number.isFinite(s)?s:0,pointerEvents:r.pointerEvents,classes:Array.from(a.classList).slice(0,5).join(" ")})}return n.sort((a,r)=>r.zIndex-a.zIndex).slice(0,Zn)}function to(e){const t=a=>r=>{const i=r,s=i.target;if(!(s instanceof Element))return;const c=i.clientX,u=i.clientY,l=document.elementFromPoint(c,u),p=l===s||(l?s.contains(l)||l.contains(s):!1),d=document.querySelectorAll('[role="dialog"][data-state="open"]').length,g=getComputedStyle(document.body).pointerEvents,f=p?[]:eo(c,u);e.emitClick({kind:a,target:Ke(s),hitMatchesTarget:p,...!p&&l instanceof Element?{hitTarget:Ke(l)}:{},coords:{x:c,y:u},openDialogs:d,bodyPointerEvents:g,...f.length>0?{overlaysAtPoint:f}:{}})},n=t("click"),o=t("mousedown");return document.addEventListener("click",n,{capture:!0,passive:!0}),document.addEventListener("mousedown",o,{capture:!0,passive:!0}),()=>{document.removeEventListener("click",n,{capture:!0}),document.removeEventListener("mousedown",o,{capture:!0})}}function no(e){const t=history.pushState,n=history.replaceState;let o=window.location.href;const a=s=>{const c=window.location.href;if(c===o)return;const u=o;o=c,e.emitRoute({kind:"route",from:u,to:c,via:s})};history.pushState=function(...c){const u=t.apply(this,c);return a("pushState"),u},history.replaceState=function(...c){const u=n.apply(this,c);return a("replaceState"),u};const r=()=>a("popstate"),i=()=>a("hashchange");return window.addEventListener("popstate",r),window.addEventListener("hashchange",i),()=>{history.pushState=t,history.replaceState=n,window.removeEventListener("popstate",r),window.removeEventListener("hashchange",i)}}function oo(e){const t=new WeakSet,n=(a,r)=>{const i=ce(a);e.emitDialog({kind:"dialog",action:r,selector:i,state:a.getAttribute("data-state"),...r==="mount"?{outerHTML:Qn(a.outerHTML,Jn)}:{}})};for(const a of Array.from(document.querySelectorAll('[role="dialog"]')))t.add(a);const o=new MutationObserver(a=>{var r,i,s,c;for(const u of a){for(const l of Array.from(u.addedNodes)){if(!(l instanceof Element))continue;const p=(r=l.matches)!=null&&r.call(l,'[role="dialog"]')?[l]:Array.from(((i=l.querySelectorAll)==null?void 0:i.call(l,'[role="dialog"]'))??[]);for(const d of p)t.has(d)||(t.add(d),n(d,"mount"))}for(const l of Array.from(u.removedNodes)){if(!(l instanceof Element))continue;const p=(s=l.matches)!=null&&s.call(l,'[role="dialog"]')?[l]:Array.from(((c=l.querySelectorAll)==null?void 0:c.call(l,'[role="dialog"]'))??[]);for(const d of p)t.has(d)&&(t.delete(d),n(d,"unmount"))}u.type==="attributes"&&u.attributeName==="data-state"&&u.target instanceof Element&&u.target.getAttribute("role")==="dialog"&&n(u.target,"state")}});return o.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-state"]}),()=>o.disconnect()}function ro(e){const t=n=>{const o=n.target;if(!(o instanceof HTMLFormElement))return;const a=[];for(const r of Array.from(o.elements)){if(!(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement))continue;const i=r.getAttribute("name")||"<unnamed>",s=r instanceof HTMLInputElement?r.type:r.tagName.toLowerCase();let c;r instanceof HTMLInputElement&&(r.type==="checkbox"||r.type==="radio")?c=r.checked:c=!!r.value,a.push({name:i,type:s,hasValue:c})}e.emitSubmit({kind:"submit",form:{id:o.id||null,action:o.getAttribute("action")||null,method:(o.getAttribute("method")||"GET").toUpperCase(),selector:ce(o),fields:a}})};return document.addEventListener("submit",t,{capture:!0}),()=>document.removeEventListener("submit",t,{capture:!0})}function ao(e){const t=to(e),n=no(e),o=oo(e),a=ro(e);return{uninstall(){t(),n(),o(),a()}}}const le=1e3,Je=10*1024,Ze="[REDACTED]",Qe=new Set(["POST","PUT","PATCH","DELETE"]),io=[/Bearer\s+[A-Za-z0-9._\-+/=]+/gi,/\bls_pat_[A-Za-z0-9_]+/g,/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g],so=/^(password|passwd|secret|token|api[_-]?key|auth|access[_-]?token|refresh[_-]?token|client[_-]?secret|private[_-]?key)$/i;function ue(e,t){return e.length>t?e.slice(0,t):e}function et(e){let t=e;for(const n of io)t=t.replace(n,Ze);return t}function de(e){if(e===null||typeof e!="object")return typeof e=="string"?et(e):e;if(Array.isArray(e))return e.map(de);const t={};for(const[n,o]of Object.entries(e))t[n]=so.test(n)?Ze:de(o);return t}function tt(e,t){if(t&&t.includes("application/json"))try{const n=JSON.parse(e);return JSON.stringify(de(n))}catch{}return et(e)}function J(e,t){const n=e.length,o={bodySize:n};return n>Je?(o.body=tt(e.slice(0,Je),t),o.bodyTruncated=!0):o.body=tt(e,t),t&&(o.contentType=t),o}function co(e,t){const n=t==null?void 0:t.body;if(n!=null){if(typeof n=="string")return n;if(n instanceof URLSearchParams)return n.toString();if(n instanceof FormData){const o=[];return n.forEach((a,r)=>{o.push(`${r}=${typeof a=="string"?`[${a.length}b]`:"[file]"}`)}),`[FormData] ${o.join("&")}`}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}return e instanceof Request,null}function lo(e,t){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"))}function uo(e,t){return(o=>{if(o){if(o instanceof Headers)return o.get("content-type")||void 0;if(Array.isArray(o)){const a=o.find(([r])=>r.toLowerCase()==="content-type");return a?a[1]:void 0}if(typeof o=="object"){for(const[a,r]of Object.entries(o))if(a.toLowerCase()==="content-type")return r}}})(t==null?void 0:t.headers)??(e instanceof Request&&e.headers.get("content-type")||void 0)}function po(e,t,n){if(!Qe.has(n))return;const o=lo(e,t),a=co(e,t);if(a==null&&!o)return;const r=uo(e,t),i=a!=null?J(a,r):{};return o&&(i.hasAuth=!0),i}function fo(e){const t=window.fetch;if(typeof t!="function")return()=>{};const n=async(o,a)=>{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=po(o,a,i);try{const u=await t.call(window,o,a),l=Math.round(performance.now()-r),p=u.status>=400;let d;if(p||e.verbose)try{const g=await u.clone().text(),f=u.headers.get("content-type")||void 0;d=J(g,f)}catch{}return(p||e.verbose)&&e.emit({kind:"fetch",url:ue(s,le),method:i,status:u.status,durationMs:l,failed:p,...c?{request:c}:{},...d?{response:d}:{}}),u}catch(u){const l=Math.round(performance.now()-r);throw e.emit({kind:"fetch",url:ue(s,le),method:i,status:0,durationMs:l,failed:!0,error:u instanceof Error?u.message:String(u),...c?{request:c}:{}}),u}};return n.__lsBeaconWrapped=!0,window.fetch=n,()=>{window.fetch.__lsBeaconWrapped&&(window.fetch=t)}}function mo(e){if(e==null)return null;if(typeof e=="string")return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){const t=[];return e.forEach((n,o)=>{t.push(`${o}=${typeof n=="string"?`[${n.length}b]`:"[file]"}`)}),`[FormData] ${t.join("&")}`}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}function ho(e){const t=XMLHttpRequest.prototype,n=t.open,o=t.send,a=t.setRequestHeader,r=new WeakMap;return t.open=function(s,c,...u){return r.set(this,{method:s.toUpperCase(),url:typeof c=="string"?c:c.toString(),start:0,hasAuth:!1}),n.call(this,s,c,...u)},t.setRequestHeader=function(s,c){const u=r.get(this);if(u){const l=s.toLowerCase();l==="authorization"?u.hasAuth=!0:l==="content-type"&&(u.requestContentType=c)}return a.call(this,s,c)},t.send=function(s){const c=r.get(this);if(c)if(c.start=performance.now(),Qe.has(c.method)){const l=mo(s);l!=null?c.request=J(l,c.requestContentType):c.request={},c.hasAuth&&(c.request.hasAuth=!0)}else c.hasAuth&&(c.request={hasAuth:!0});const u=()=>{this.removeEventListener("loadend",u);const l=r.get(this);if(!l)return;const p=Math.round(performance.now()-l.start),d=this.status===0||this.status>=400;let g;if((d||e.verbose)&&this.status>0)try{const f=this.responseType===""||this.responseType==="text"?this.responseText:"";if(f){const w=this.getResponseHeader("content-type")||void 0;g=J(f,w)}}catch{}(d||e.verbose)&&e.emit({kind:"xhr",url:ue(l.url,le),method:l.method,status:this.status,durationMs:p,failed:d,...l.request?{request:l.request}:{},...g?{response:g}:{}}),r.delete(this)};return this.addEventListener("loadend",u),o.call(this,s)},()=>{t.open=n,t.send=o,t.setRequestHeader=a}}function bo(e){const t=fo(e),n=ho(e);return{uninstall(){t(),n()}}}const go=1e3,nt=50,yo=500;class wo{constructor(t){this.buffer=[],this.inflight=!1,this.timer=null,this.destroyed=!1,this.handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this.flushSync()},this.url=t.url,this.sessionId=t.sessionId,this.onError=t.onError,this.timer=setInterval(()=>{this.flush()},go),this.pagehideHandler=()=>this.flushSync(),window.addEventListener("pagehide",this.pagehideHandler),document.addEventListener("visibilitychange",this.handleVisibilityChange)}enqueue(t){this.destroyed||(this.buffer.push(t),this.buffer.length>yo&&this.buffer.shift(),this.buffer.length>=nt&&this.flush())}async flush(){var o,a;if(this.destroyed||this.inflight||this.buffer.length===0)return;const t=this.buffer.splice(0,nt),n=this.makeBatch(t);this.inflight=!0;try{const r=await fetch(this.url,{method:"POST",credentials:"omit",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),keepalive:!0});r.ok||(o=this.onError)==null||o.call(this,new Error(`monitor flush: HTTP ${r.status}`))}catch(r){(a=this.onError)==null||a.call(this,r instanceof Error?r:new Error(String(r)))}finally{this.inflight=!1}}flushSync(){if(this.destroyed||this.buffer.length===0)return;if(!navigator.sendBeacon){this.flush();return}const t=this.buffer.splice(0),n=this.makeBatch(t),o=new Blob([JSON.stringify(n)],{type:"application/json"});try{navigator.sendBeacon(this.url,o)}catch{}}destroy(){this.destroyed||(this.destroyed=!0,this.timer&&clearInterval(this.timer),this.pagehideHandler&&window.removeEventListener("pagehide",this.pagehideHandler),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.flushSync())}makeBatch(t){return{sessionId:this.sessionId,events:t,meta:{url:window.location.href,userAgent:navigator.userAgent,viewport:{w:window.innerWidth,h:window.innerHeight,dpr:window.devicePixelRatio||1},v:1}}}}const pe="__lsBeaconMonitorUrl",ot="__lsBeaconMonitorSession",fe="__lsBeaconMonitorVerbose",me="__lsBeaconMonitorDeadline",rt=30*6e4,at=4096;let v=null;const he=new Set;function vo(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10)}function xo(e){const t=new WeakSet,n=o=>{if(o===null||typeof o!="object")return typeof o=="string"&&o.length>at?o.slice(0,at):o;if(t.has(o))return"[cyclic]";if(t.add(o),Array.isArray(o))return o.map(n);const a={};for(const r of Object.keys(o).slice(0,50))try{a[r]=n(o[r])}catch{a[r]="[unreadable]"}return a};try{return n(e)}catch{return"[unserialisable]"}}function be(){for(const e of he)try{e(v!==null,(v==null?void 0:v.url)??null)}catch{}}function Eo(e){return v?(v.seq+=1,{...e,ts:Date.now(),sessionId:v.sessionId,seq:v.seq}):{...e,ts:Date.now(),sessionId:"",seq:0}}function O(e){if(!v)return;const t=Eo(e);v.transport.enqueue(t)}function So(){if(v)try{sessionStorage.setItem(pe,v.url),sessionStorage.setItem(ot,v.sessionId),sessionStorage.setItem(fe,v.verbose?"1":"0"),sessionStorage.setItem(me,String(v.deadlineMs))}catch{}}function it(){try{sessionStorage.removeItem(pe),sessionStorage.removeItem(ot),sessionStorage.removeItem(fe),sessionStorage.removeItem(me)}catch{}}function Co(){try{const e=sessionStorage.getItem(pe);if(!e)return null;const t=sessionStorage.getItem(fe)==="1",n=sessionStorage.getItem(me),o=n?Number(n):Date.now()+rt;return Number.isFinite(o)&&o<=Date.now()?(it(),null):{url:e,verbose:t,deadlineMs:o}}catch{return null}}function st(e){v&&(v.seq+=1,v.transport.enqueue({kind:e.kind,ts:e.ts,sessionId:v.sessionId,seq:v.seq,message:e.message,...e.stack?{stack:e.stack}:{},...e.source?{source:e.source}:{},...typeof e.line=="number"?{line:e.line}:{},...typeof e.col=="number"?{col:e.col}:{}}))}function ge(e){if(v&&V(),!e.url)return;const t=e.maxSessionMs??rt,n=Date.now()+t,o=vo(),a=!!e.verbose,r=new wo({url:e.url,sessionId:o,onError:f=>{console.warn("[launch-kit-beacon] monitor transport error:",f.message)}}),i=Pe(),s=i.install(),c=i.snapshot();for(const f of c)st(f);let u=c.length;const l=i.subscribe(()=>{if(!v)return;const f=v.errorsBuffer.snapshot();for(;v.drainedThrough<f.length;){const w=f[v.drainedThrough];w&&st(w),v.drainedThrough+=1}}),p=bo({emit:f=>O(f),verbose:a}),d=ao({emitClick:f=>O(f),emitRoute:f=>O(f),emitDialog:f=>O(f),emitSubmit:f=>O(f)}),g=setTimeout(()=>{console.info("[launch-kit-beacon] monitor session expired (max duration reached)"),V()},Math.max(0,n-Date.now()));v={url:e.url,sessionId:o,verbose:a,deadlineMs:n,seq:0,transport:r,errorsBuffer:i,uninstallNetwork:p.uninstall,uninstallDom:d.uninstall,uninstallErrors:s,errorsUnsub:l,deadlineTimer:g,drainedThrough:u},So(),be()}function V(){ct(),it(),be()}function Ao(){v&&(ct(),be())}function ct(){v&&(clearTimeout(v.deadlineTimer),v.errorsUnsub(),v.uninstallErrors(),v.uninstallNetwork(),v.uninstallDom(),v.transport.destroy(),v=null)}function ko(e,t){v&&O({kind:"probe",label:e.slice(0,200),data:xo(t)})}function ye(){return v!==null}function we(){return(v==null?void 0:v.url)??null}function lt(e){return he.add(e),()=>{he.delete(e)}}function Lo(){if(v||typeof window>"u")return;const e=Co();e&&ge({url:e.url,verbose:e.verbose,maxSessionMs:Math.max(6e4,e.deadlineMs-Date.now())})}function To(e={}){let t=null,n=null,o="",a=null;function r(){a||(a=Yn({onStop:()=>V(),url:we()}))}function i(){if(a){try{a.destroy()}catch{}a=null}}function s(){if(!t)return;t.innerHTML="";const l=document.createElement("div");l.className="beacon-monitor-title",l.textContent="Monitor — paste a stream URL",t.appendChild(l);const p=document.createElement("div");p.className="beacon-monitor-row";const d=document.createElement("input");d.type="url",d.className="beacon-monitor-input",d.placeholder="http://localhost:9876/m/…",d.value=o,d.autocomplete="off",d.spellcheck=!1,p.appendChild(d);const g=document.createElement("button");g.type="button",g.className="beacon-monitor-btn",g.textContent="Start",g.disabled=!o.trim(),p.appendChild(g),t.appendChild(p);const f=document.createElement("label");f.className="beacon-monitor-verbose";const w=document.createElement("input");w.type="checkbox",w.dataset.role="verbose",f.appendChild(w),f.appendChild(document.createTextNode(" verbose (capture successful network too)")),t.appendChild(f);const S=document.createElement("div");S.className="beacon-monitor-help",S.textContent="Streams clicks, failed network, errors, route + dialog changes.",t.appendChild(S),d.addEventListener("input",()=>{o=d.value,g.disabled=!d.value.trim()}),g.addEventListener("click",()=>{const h=d.value.trim();if(h){try{new URL(h)}catch{d.setCustomValidity("Enter a valid URL (e.g. http://localhost:9876/m/abc)"),d.reportValidity();return}d.setCustomValidity(""),ge({url:h,verbose:w.checked,...e.maxSessionMs!==void 0?{maxSessionMs:e.maxSessionMs}:{}})}})}function c(){if(!t)return;t.innerHTML="";const l=we()??"",p=document.createElement("div");p.className="beacon-monitor-title";const d=document.createElement("span");d.className="beacon-monitor-rec",d.setAttribute("aria-hidden","true"),p.appendChild(d),p.appendChild(document.createTextNode(" Monitor — recording")),t.appendChild(p);const g=document.createElement("div");g.className="beacon-monitor-active-url",g.title=l,g.textContent=l,t.appendChild(g);const f=document.createElement("div");f.className="beacon-monitor-row";const w=document.createElement("button");w.type="button",w.className="beacon-monitor-btn stop",w.textContent="Stop monitoring",w.addEventListener("click",()=>V()),f.appendChild(w),t.appendChild(f);const S=document.createElement("div");S.className="beacon-monitor-help",S.textContent="Events stream to the URL above. Auto-stops after 30 min.",t.appendChild(S)}function u(){ye()?c():s()}return{name:"liveMonitor",setupOnce(l){Lo(),ye()&&r();const p=lt((g,f)=>{g?(r(),a==null||a.updateUrl(f)):i()}),d=()=>{i(),p();try{Ao()}catch{}};l.signal.addEventListener("abort",d,{once:!0})},form(){return{render:l=>(t=document.createElement("div"),t.className="beacon-monitor",l.appendChild(t),u(),n=lt(()=>u()),()=>{n==null||n(),n=null,t=null})}}}}let M=null;const ve={"plugin:error":new Set,"submit:success":new Set,"submit:error":new Set,ready:new Set};function Ro(e){if(typeof window>"u")return;if(!e.endpoint)throw new Error("init: endpoint is required");Te(),dt();const t={...Xt(),...e.labels??{}},n=new AbortController,o=_o(e),a=e.position??"bottom-right",r=e.theme??"auto";It(),No(e,a,r);const i=document.querySelector(U);if(!i)throw new Error("init: failed to acquire <launch-kit-beacon> host");if(!i.shadow)throw new Error("init: host element shadow root not initialized");const s=Yt(i.shadow),c=new Wt(t,["bug","idea","ux","a11y"],{onSubmit:()=>{Fo()},onClose:p=>{Z("close",{}),p==="user"&&mt()}});i.shadow.appendChild(c.root),i.classList.add("beacon-no-capture");const u=Ot(o),l={endpoint:e.endpoint,headers:e.headers,context:e.context,credentials:e.credentials??"omit",plugins:o,registry:u,dialog:c,overlayHost:s,hostElement:i,initAbort:n,labels:t,debug:!!e.debug||Do(),healthIndicator:e.healthIndicator??"never",position:a,theme:r,currentSubmit:null,capturedEntries:{},formValues:{},lifecycleHandlers:{open:new Set,close:new Set,beforeSubmit:new Set,afterSubmit:new Set},panelSources:[]};M=l,i.onTriggerClick=()=>ut(),u.install(p=>ft(p),p=>xe(p)),W("ready",{ready:!0}),l.debug&&console.info("[beacon] ready",l.endpoint)}function ut(){const e=M;e&&(e.currentSubmit||(e.panelSources=e.plugins.map(t=>{if(!t.form)return null;const n=ft(t.name);let o;try{o=t.form(n)}catch(a){return xe({plugin:t.name,error:a instanceof Error?a:new Error(String(a)),at:"form"}),null}return{name:t.name,form:o,ctx:n}}).filter(t=>t!==null),e.dialog.installPluginPanels(e.panelSources,{get:(t,n)=>{var o;return(o=e.formValues[t])==null?void 0:o[n]},set:(t,n,o)=>{var r;const a=(r=e.formValues)[t]??(r[t]={});a[n]=o}}),e.dialog.open(),Z("open",{})))}function Mo(){const e=M;e&&e.dialog.close("user")}function dt(){var t;const e=M;if(e){e.initAbort.abort(),(t=e.currentSubmit)==null||t.abort(),e.registry.destroy(),F();try{e.dialog.root.remove(),e.overlayHost.layer.remove()}catch{}e.hostElement.onTriggerClick=null,M=null}}function Po(){const e=M;return e?{ready:!0,transport:"idle",plugins:e.registry.status()}:{ready:!1,transport:"idle",plugins:{}}}function Io(e,t){return ve[e].add(t),()=>pt(e,t)}function pt(e,t){ve[e].delete(t)}function No(e,t,n){let o=document.querySelector(U);if(!o){o=document.createElement(U),o.setAttribute("position",t),o.setAttribute("theme",n),t==="hidden"&&(o.style.position="absolute",o.style.left="-9999px"),(document.body??document.documentElement).appendChild(o);return}e.position!==void 0&&o.setAttribute("position",t),e.theme!==void 0&&o.setAttribute("theme",n)}function _o(e){return e.plugins?e.plugins:e.defaultPlugins===!1?[]:$o()}function $o(){return[Re(),Ie(),Ve(),Xe()]}function Do(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).has("lsbeacon-debug")}catch{return!1}}function ft(e){const t=M;return Dt(e,{getCaptured:o=>t==null?void 0:t.capturedEntries[o],getFormValues:o=>{var a;return t?(a=t.formValues)[o]??(a[o]={}):{}},getCaptureSignal:()=>{var o;return(o=t==null?void 0:t.currentSubmit)==null?void 0:o.signal},getInitSignal:()=>t.initAbort.signal,requestMode:async o=>t?t.dialog.requestMode(o):()=>{},overlay:o=>t?Gt(t.overlayHost,o.render):()=>{},onLifecycle:(o,a)=>{if(!t)return()=>{};const r=t.lifecycleHandlers[o];return r.add(a),()=>r.delete(a)}})}function Z(e,t){const n=M;if(n)for(const o of n.lifecycleHandlers[e])try{o(t)}catch(a){n.debug&&console.error("[beacon] lifecycle handler threw:",a)}}function W(e,t){for(const n of ve[e])try{n(t)}catch(o){M!=null&&M.debug&&console.error("[beacon] system handler threw:",o)}}function xe(e){W("plugin:error",{plugin:e.plugin,error:e.error,at:e.at});const t=M;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))}function mt(){const e=M;e&&(e.dialog.resetState(),e.dialog.clearPluginPanels(),e.formValues={})}async function Fo(){const e=M;if(!e||e.currentSubmit)return;const t=e.dialog.getDescription().trim();if(!t){e.dialog.setStatus("Description is required","error");return}e.currentSubmit=new AbortController,e.capturedEntries={},e.dialog.setSubmitting(!0),e.dialog.setStatus("Capturing…");let n=null;try{const o=await e.registry.capture(s=>e.capturedEntries[s],s=>xe(s));e.capturedEntries=o,n=Oo(e,t,o);let a=null;if(Z("beforeSubmit",{payload:n,cancel:s=>{a===null&&(a=s)}}),a!==null){e.dialog.setSubmitting(!1),e.dialog.setStatus(`Cancelled: ${a}`,"error");return}e.dialog.setStatus("Sending…");const i=await Ut(e.endpoint,n,e.headers,e.currentSubmit.signal,e.credentials);Z("afterSubmit",{payload:n,response:i}),e.dialog.setSubmitting(!1),i.ok?(W("submit:success",{payload:n,response:i}),e.dialog.setSubmitSucceeded(!0),e.dialog.setStatus(e.labels.sentSuccess,"success"),window.setTimeout(()=>{M===e&&e.dialog.close("submitted"),mt()},1500)):(W("submit:error",{payload:n,error:new Error(`HTTP ${i.status}`)}),e.dialog.setStatus(`Failed (${i.status})`,"error"))}catch(o){e.dialog.setSubmitting(!1);const a=o instanceof Error?o:new Error(String(o));n&&W("submit:error",{payload:n,error:a}),e.dialog.setStatus(`Failed: ${a.message}`,"error")}finally{e.currentSubmit=null}}function Oo(e,t,n){var r;const o=Ho(),a=(r=e.context)==null?void 0:r.call(e);return{description:t,severity:e.dialog.getSeverity(),metadata:o,...a?{context:a}:{},plugins:n}}function Ho(){const e=window.location.href,t=document.referrer,n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return{url:e,...t?{referrer:t}:{},userAgent:navigator.userAgent,viewport:{w:window.innerWidth,h:window.innerHeight,dpr:window.devicePixelRatio||1},screen:{w:window.screen.width,h:window.screen.height},timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,locale:navigator.language,theme:n,capturedAt:new Date().toISOString()}}Te();function Bo(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),o=n.createElement("base"),a=n.createElement("a");return n.head.appendChild(o),n.body.appendChild(a),t&&(o.href=t),a.href=e,a.href}const Uo=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function $(e){const t=[];for(let n=0,o=e.length;n<o;n++)t.push(e[n]);return t}let H=null;function ht(e={}){return H||(e.includeStyleProperties?(H=e.includeStyleProperties,H):(H=$(window.getComputedStyle(document.documentElement)),H))}function Q(e,t){const o=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return o?parseFloat(o.replace("px","")):0}function zo(e){const t=Q(e,"border-left-width"),n=Q(e,"border-right-width");return e.clientWidth+t+n}function qo(e){const t=Q(e,"border-top-width"),n=Q(e,"border-bottom-width");return e.clientHeight+t+n}function Ee(e,t={}){const n=t.width||zo(e),o=t.height||qo(e);return{width:n,height:o}}function jo(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const I=16384;function Vo(e){(e.width>I||e.height>I)&&(e.width>I&&e.height>I?e.width>e.height?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I):e.width>I?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I))}function Wo(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(n=>{const o=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=o.length,r=new Uint8Array(a);for(let i=0;i<a;i+=1)r[i]=o.charCodeAt(i);n(new Blob([r],{type:t.type?t.type:"image/png"}))})}function ee(e){return new Promise((t,n)=>{const o=new Image;o.onload=()=>{o.decode().then(()=>{requestAnimationFrame(()=>t(o))})},o.onerror=n,o.crossOrigin="anonymous",o.decoding="async",o.src=e})}async function Xo(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Yo(e,t,n){const o="http://www.w3.org/2000/svg",a=document.createElementNS(o,"svg"),r=document.createElementNS(o,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${n}`),a.setAttribute("viewBox",`0 0 ${t} ${n}`),r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("x","0"),r.setAttribute("y","0"),r.setAttribute("externalResourcesRequired","true"),a.appendChild(r),r.appendChild(e),Xo(a)}const P=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||P(n,t)};function Go(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ko(e,t){return ht(t).map(n=>{const o=e.getPropertyValue(n),a=e.getPropertyPriority(n);return`${n}: ${o}${a?" !important":""};`}).join(" ")}function Jo(e,t,n,o){const a=`.${e}:${t}`,r=n.cssText?Go(n):Ko(n,o);return document.createTextNode(`${a}{${r}}`)}function bt(e,t,n,o){const a=window.getComputedStyle(e,n),r=a.getPropertyValue("content");if(r===""||r==="none")return;const i=Uo();try{t.className=`${t.className} ${i}`}catch{return}const s=document.createElement("style");s.appendChild(Jo(i,n,a,o)),t.appendChild(s)}function Zo(e,t,n){bt(e,t,":before",n),bt(e,t,":after",n)}const gt="application/font-woff",yt="image/jpeg",Qo={woff:gt,woff2:gt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:yt,jpeg:yt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function er(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Se(e){const t=er(e).toLowerCase();return Qo[t]||""}function tr(e){return e.split(/,/)[1]}function Ce(e){return e.search(/^(data:)/)!==-1}function nr(e,t){return`data:${t};base64,${e}`}async function wt(e,t,n){const o=await fetch(e,t);if(o.status===404)throw new Error(`Resource "${o.url}" not found`);const a=await o.blob();return new Promise((r,i)=>{const s=new FileReader;s.onerror=i,s.onloadend=()=>{try{r(n({res:o,result:s.result}))}catch(c){i(c)}},s.readAsDataURL(a)})}const Ae={};function or(e,t,n){let o=e.replace(/\?.*/,"");return n&&(o=e),/ttf|otf|eot|woff2?/i.test(o)&&(o=o.replace(/.*\//,"")),t?`[${t}]${o}`:o}async function ke(e,t,n){const o=or(e,t,n.includeQueryParams);if(Ae[o]!=null)return Ae[o];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const r=await wt(e,n.fetchRequestInit,({res:i,result:s})=>(t||(t=i.headers.get("Content-Type")||""),tr(s)));a=nr(r,t)}catch(r){a=n.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;r&&(i=typeof r=="string"?r:r.message),i&&console.warn(i)}return Ae[o]=a,a}async function rr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ee(t)}async function ar(e,t){if(e.currentSrc){const r=document.createElement("canvas"),i=r.getContext("2d");r.width=e.clientWidth,r.height=e.clientHeight,i==null||i.drawImage(e,0,0,r.width,r.height);const s=r.toDataURL();return ee(s)}const n=e.poster,o=Se(n),a=await ke(n,o,t);return ee(a)}async function ir(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await te(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function sr(e,t){return P(e,HTMLCanvasElement)?rr(e):P(e,HTMLVideoElement)?ar(e,t):P(e,HTMLIFrameElement)?ir(e,t):e.cloneNode(vt(e))}const cr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",vt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function lr(e,t,n){var o,a;if(vt(t))return t;let r=[];return cr(e)&&e.assignedNodes?r=$(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((o=e.contentDocument)===null||o===void 0)&&o.body)?r=$(e.contentDocument.body.childNodes):r=$(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),r.length===0||P(e,HTMLVideoElement)||await r.reduce((i,s)=>i.then(()=>te(s,n)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function ur(e,t,n){const o=t.style;if(!o)return;const a=window.getComputedStyle(e);a.cssText?(o.cssText=a.cssText,o.transformOrigin=a.transformOrigin):ht(n).forEach(r=>{let i=a.getPropertyValue(r);r==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&r==="display"&&i==="inline"&&(i="block"),r==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),o.setProperty(r,i,a.getPropertyPriority(r))})}function dr(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function pr(e,t){if(P(e,HTMLSelectElement)){const n=t,o=Array.from(n.children).find(a=>e.value===a.getAttribute("value"));o&&o.setAttribute("selected","")}}function fr(e,t,n){return P(t,Element)&&(ur(e,t,n),Zo(e,t,n),dr(e,t),pr(e,t)),t}async function mr(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const o={};for(let r=0;r<n.length;r++){const s=n[r].getAttribute("xlink:href");if(s){const c=e.querySelector(s),u=document.querySelector(s);!c&&u&&!o[s]&&(o[s]=await te(u,t,!0))}}const a=Object.values(o);if(a.length){const r="http://www.w3.org/1999/xhtml",i=document.createElementNS(r,"svg");i.setAttribute("xmlns",r),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const s=document.createElementNS(r,"defs");i.appendChild(s);for(let c=0;c<a.length;c++)s.appendChild(a[c]);e.appendChild(i)}return e}async function te(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(o=>sr(o,t)).then(o=>lr(e,o,t)).then(o=>fr(e,o,t)).then(o=>mr(o,t))}const xt=/url\((['"]?)([^'"]+?)\1\)/g,hr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,br=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function gr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function yr(e){const t=[];return e.replace(xt,(n,o,a)=>(t.push(a),n)),t.filter(n=>!Ce(n))}async function wr(e,t,n,o,a){try{const r=n?Bo(t,n):t,i=Se(t);let s;return a||(s=await ke(r,i,o)),e.replace(gr(t),`$1${s}$3`)}catch{}return e}function vr(e,{preferredFontFormat:t}){return t?e.replace(br,n=>{for(;;){const[o,,a]=hr.exec(n)||[];if(!a)return"";if(a===t)return`src: ${o};`}}):e}function Et(e){return e.search(xt)!==-1}async function St(e,t,n){if(!Et(e))return e;const o=vr(e,n);return yr(o).reduce((r,i)=>r.then(s=>wr(s,i,t,n)),Promise.resolve(o))}async function B(e,t,n){var o;const a=(o=t.style)===null||o===void 0?void 0:o.getPropertyValue(e);if(a){const r=await St(a,null,n);return t.style.setProperty(e,r,t.style.getPropertyPriority(e)),!0}return!1}async function xr(e,t){await B("background",e,t)||await B("background-image",e,t),await B("mask",e,t)||await B("-webkit-mask",e,t)||await B("mask-image",e,t)||await B("-webkit-mask-image",e,t)}async function Er(e,t){const n=P(e,HTMLImageElement);if(!(n&&!Ce(e.src))&&!(P(e,SVGImageElement)&&!Ce(e.href.baseVal)))return;const o=n?e.src:e.href.baseVal,a=await ke(o,Se(o),t);await new Promise((r,i)=>{e.onload=r,e.onerror=t.onImageErrorHandler?(...c)=>{try{r(t.onImageErrorHandler(...c))}catch(u){i(u)}}:i;const s=e;s.decode&&(s.decode=r),s.loading==="lazy"&&(s.loading="eager"),n?(e.srcset="",e.src=a):e.href.baseVal=a})}async function Sr(e,t){const o=$(e.childNodes).map(a=>Ct(a,t));await Promise.all(o).then(()=>e)}async function Ct(e,t){P(e,Element)&&(await xr(e,t),await Er(e,t),await Sr(e,t))}function Cr(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const o=t.style;return o!=null&&Object.keys(o).forEach(a=>{n[a]=o[a]}),e}const At={};async function kt(e){let t=At[e];if(t!=null)return t;const o=await(await fetch(e)).text();return t={url:e,cssText:o},At[e]=t,t}async function Lt(e,t){let n=e.cssText;const o=/url\(["']?([^"')]+)["']?\)/g,r=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let s=i.replace(o,"$1");return s.startsWith("https://")||(s=new URL(s,e.url).href),wt(s,t.fetchRequestInit,({result:c})=>(n=n.replace(i,`url(${c})`),[i,c]))});return Promise.all(r).then(()=>n)}function Tt(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let o=e.replace(n,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=a.exec(o);if(c===null)break;t.push(c[0])}o=o.replace(a,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",s=new RegExp(i,"gi");for(;;){let c=r.exec(o);if(c===null){if(c=s.exec(o),c===null)break;r.lastIndex=s.lastIndex}else s.lastIndex=r.lastIndex;t.push(c[0])}return t}async function Ar(e,t){const n=[],o=[];return e.forEach(a=>{if("cssRules"in a)try{$(a.cssRules||[]).forEach((r,i)=>{if(r.type===CSSRule.IMPORT_RULE){let s=i+1;const c=r.href,u=kt(c).then(l=>Lt(l,t)).then(l=>Tt(l).forEach(p=>{try{a.insertRule(p,p.startsWith("@import")?s+=1:a.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:p,error:d})}})).catch(l=>{console.error("Error loading remote css",l.toString())});o.push(u)}})}catch(r){const i=e.find(s=>s.href==null)||document.styleSheets[0];a.href!=null&&o.push(kt(a.href).then(s=>Lt(s,t)).then(s=>Tt(s).forEach(c=>{i.insertRule(c,i.cssRules.length)})).catch(s=>{console.error("Error loading remote stylesheet",s)})),console.error("Error inlining remote css file",r)}}),Promise.all(o).then(()=>(e.forEach(a=>{if("cssRules"in a)try{$(a.cssRules||[]).forEach(r=>{n.push(r)})}catch(r){console.error(`Error while reading CSS rules from ${a.href}`,r)}}),n))}function kr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Et(t.style.getPropertyValue("src")))}async function Lr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=$(e.ownerDocument.styleSheets),o=await Ar(n,t);return kr(o)}function Rt(e){return e.trim().replace(/["']/g,"")}function Tr(e){const t=new Set;function n(o){(o.style.fontFamily||getComputedStyle(o).fontFamily).split(",").forEach(r=>{t.add(Rt(r))}),Array.from(o.children).forEach(r=>{r instanceof HTMLElement&&n(r)})}return n(e),t}async function Mt(e,t){const n=await Lr(e,t),o=Tr(e);return(await Promise.all(n.filter(r=>o.has(Rt(r.style.fontFamily))).map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return St(r.cssText,i,t)}))).join(`
722
- `)}async function Rr(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Mt(e,t);if(n){const o=document.createElement("style"),a=document.createTextNode(n);o.appendChild(a),e.firstChild?e.insertBefore(o,e.firstChild):e.appendChild(o)}}async function Pt(e,t={}){const{width:n,height:o}=Ee(e,t),a=await te(e,t,!0);return await Rr(a,t),await Ct(a,t),Cr(a,t),await Yo(a,n,o)}async function X(e,t={}){const{width:n,height:o}=Ee(e,t),a=await Pt(e,t),r=await ee(a),i=document.createElement("canvas"),s=i.getContext("2d"),c=t.pixelRatio||jo(),u=t.canvasWidth||n,l=t.canvasHeight||o;return i.width=u*c,i.height=l*c,t.skipAutoScale||Vo(i),i.style.width=`${u}`,i.style.height=`${l}`,t.backgroundColor&&(s.fillStyle=t.backgroundColor,s.fillRect(0,0,i.width,i.height)),s.drawImage(r,0,0,i.width,i.height),i}async function Mr(e,t={}){const{width:n,height:o}=Ee(e,t);return(await X(e,t)).getContext("2d").getImageData(0,0,n,o).data}async function Pr(e,t={}){return(await X(e,t)).toDataURL()}async function Ir(e,t={}){return(await X(e,t)).toDataURL("image/jpeg",t.quality||1)}async function Nr(e,t={}){const n=await X(e,t);return await Wo(n)}async function _r(e,t={}){return Mt(e,t)}const $r=Object.freeze(Object.defineProperty({__proto__:null,getFontEmbedCSS:_r,toBlob:Nr,toCanvas:X,toJpeg:Ir,toPixelData:Mr,toPng:Pr,toSvg:Pt},Symbol.toStringTag,{value:"Module"}));k.currentMonitorUrl=we,k.destroy=dt,k.domEle=Ve,k.domSS=Xe,k.errors=Ie,k.hide=Mo,k.init=Ro,k.isMonitorActive=ye,k.isPluginFailure=We,k.liveMonitor=To,k.metadata=Re,k.off=pt,k.on=Io,k.probe=ko,k.show=ut,k.startMonitor=ge,k.status=Po,k.stopMonitor=V,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
721
+ `;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);n.style.left=`${r}px`,n.style.top=`${i}px`,document.body.appendChild(n);const s=n.querySelector("textarea");s.focus();function c(l){document.removeEventListener("keydown",u,!0),n.remove(),t(l)}function u(l){l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),c({cancelled:"all"}))}document.addEventListener("keydown",u,!0),n.addEventListener("click",l=>{var g;const d=(g=l.target.closest("[data-action]"))==null?void 0:g.getAttribute("data-action");if(d&&(l.stopPropagation(),d==="cancel"&&c({cancelled:"pin"}),d==="save")){const m=s.value.trim();c({...m?{note:m}:{},cancelled:!1})}}),s.addEventListener("keydown",l=>{if(l.key==="Enter"&&(l.metaKey||l.ctrlKey)){l.preventDefault();const p=s.value.trim();c({...p?{note:p}:{},cancelled:!1})}})})}const $n="#0ea5e9";function Dn(e,t){return/^#[0-9a-fA-F]{6}$/.test(e)?`${e}${t}`:e}function Fn(e){const{shadowRoot:t,onHover:n}=e,o=e.accent??$n,a=Dn(o,"14"),r=document.createElement("div");r.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483646",`border: 2px solid ${o}`,`background: ${a}`,"transition: all 60ms ease-out","box-sizing: border-box","border-radius: 2px"].join("; "),document.body.appendChild(r);const i=document.createElement("div");i.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483647","background: #0f172a","color: #fff","font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace","padding: 3px 6px","border-radius: 3px","max-width: 280px","overflow: hidden","text-overflow: ellipsis","white-space: nowrap"].join("; "),document.body.appendChild(i);const s=document.body.style.cursor;document.body.style.cursor="crosshair";let c=!1,u=()=>{};const l=new Promise(b=>{u=b});function p(b){if(!b||!(b instanceof Node))return!1;let x=b;for(;x;){if(x===t||x===t.host)return!0;x=x.parentNode??x.host??null}return!1}function d(b){return b.tagName.includes("-")}function g(b,x){var C,A;r.style.display="none",i.style.display="none";const L=document.elementsFromPoint(b,x);r.style.display="block",i.style.display="block";for(const R of L){if(p(R))continue;let w=R,T=16;for(;w.shadowRoot&&!d(w)&&T-- >0;){const N=(((A=(C=w.shadowRoot).elementsFromPoint)==null?void 0:A.call(C,b,x))??[]).find(ne=>!p(ne)&&ne!==w);if(!N)break;w=N}return w}return null}function m(b){const x=b.getBoundingClientRect();r.style.left=`${x.left}px`,r.style.top=`${x.top}px`,r.style.width=`${x.width}px`,r.style.height=`${x.height}px`;const L=b.tagName.toLowerCase(),C=b.classList.length>0?"."+Array.from(b.classList).slice(0,2).join("."):"";i.textContent=L+C;const A=x.top-22;i.style.left=`${x.left}px`,i.style.top=`${A>=0?A:x.bottom+4}px`}function y(b){const x=g(b.clientX,b.clientY);x?(m(x),n==null||n(x)):(r.style.display="none",i.style.display="none",n==null||n(null))}function S(b){if(b.button!==0)return;b.preventDefault(),b.stopPropagation();const x=g(b.clientX,b.clientY);x&&E(x)}function h(b){b.preventDefault(),b.stopPropagation()}function f(b){b.key==="Escape"&&(b.preventDefault(),E(null))}function E(b){c||(c=!0,document.removeEventListener("mousemove",y,!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,u(b))}return document.addEventListener("mousemove",y,!0),document.addEventListener("pointerdown",S,!0),document.addEventListener("click",h,!0),document.addEventListener("mouseup",h,!0),document.addEventListener("keydown",f,!0),{cancel:()=>E(null),promise:l}}let ie=null;async function On(){return ie||(ie=await Promise.resolve().then(()=>Dr)),ie}const Y="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=";function Ue(e,t){if(!e||e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("/")||e.startsWith("#"))return!0;try{if(new URL(e,window.location.href).origin===window.location.origin)return!0}catch{return!1}return t==="anonymous"||t==="use-credentials"}function Hn(){const e=[],t=[];return document.querySelectorAll("img").forEach(n=>{Ue(n.src,n.crossOrigin)||(e.push({el:n,src:n.src}),n.src=Y)}),document.querySelectorAll("image").forEach(n=>{const o=n,a=o.getAttribute("href"),r=o.getAttributeNS("http://www.w3.org/1999/xlink","href"),i=a||r||"";i&&!Ue(i)&&(t.push({el:o,href:a,xlink:r}),a!==null&&o.setAttribute("href",Y),r!==null&&o.setAttributeNS("http://www.w3.org/1999/xlink","href",Y))}),()=>{for(const{el:n,src:o}of e)n.src=o;for(const{el:n,href:o,xlink:a}of t)o!==null&&n.setAttribute("href",o),a!==null&&n.setAttributeNS("http://www.w3.org/1999/xlink","href",a)}}function Bn(){const e=[];document.querySelectorAll("*").forEach(r=>{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;(s||c)&&e.push(r)});const t=window.scrollX,n=window.scrollY,o=e.map(r=>({el:r,scrollLeft:r.scrollLeft,scrollTop:r.scrollTop})),a=new Map;for(const r of e){let i=r;for(;i&&i!==document.documentElement.parentElement;)a.has(i)||a.set(i,i.style.cssText),i=i.parentElement}for(const r of a.keys())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");return()=>{for(const[r,i]of a)r.style.cssText=i;for(const{el:r,scrollLeft:i,scrollTop:s}of o)r.scrollLeft=i,r.scrollTop=s;window.scrollTo(t,n)}}function Un(){const e=document.createElement("style");return e.setAttribute("data-beacon-capture",""),e.textContent="*,*::before,*::after{animation:none !important;transition:none !important;}",(document.head??document.documentElement).appendChild(e),()=>{e.remove()}}let ze=Promise.resolve();async function qe(e={}){const t=ze;let n;ze=new Promise(o=>{n=o});try{return await t,await zn(e,n)}catch(o){throw n(),o}}async function zn(e,t){const{quality:n=.7,pixelRatio:o=Math.min(window.devicePixelRatio||1,2),excludeShadowRoot:a,excludeHosts:r,fullPage:i=!0}=e,s=await On(),c=a||r!=null&&r.length?m=>{let y=m;for(;y;){if(a&&y===a.host||r&&y instanceof Element&&r.includes(y)||y instanceof Element&&y.classList.contains("beacon-no-capture"))return!1;y=y.parentNode}return!0}:void 0,u=Hn(),l=i?Bn():()=>{},p=Un();let d=!1;const g=()=>{if(!d){d=!0;try{p()}finally{try{l()}finally{try{u()}finally{t()}}}}};try{i&&await new Promise(f=>requestAnimationFrame(()=>f()));const m=document.documentElement,y=i?Math.max(m.scrollWidth,window.innerWidth):window.innerWidth,S=i?Math.max(m.scrollHeight,window.innerHeight):window.innerHeight;return{dataUrl:await s.toJpeg(m,{quality:n,pixelRatio:o,cacheBust:!0,...c?{filter:c}:{},imagePlaceholder:Y,width:y,height:S,style:{transform:"none"}}),width:y,height:S,pixelRatio:o,dispose:g}}catch(m){throw g(),m}}let se=null;function qn(e){se=e}function jn(){return se}function F(){se=null}const je="http://www.w3.org/2000/svg";function Vn(){const e=document.createElementNS(je,"svg");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");const t=["M3 6h18","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6","M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"];for(const n of t){const o=document.createElementNS(je,"path");o.setAttribute("d",n),e.appendChild(o)}return e}function Ve(e={}){const t=e.maxPins??20;let n=[],o=new WeakMap,a=null,r=0,i=null,s=null,c=null,u=null;function l(){n=[],o=new WeakMap,a=null,r+=1,F(),S(),h()}function p(){const f=document.querySelector("launch-kit-beacon");return(f==null?void 0:f.shadowRoot)??null}function d(){if(typeof window>"u")return e.accent??"#0ea5e9";if(e.accent)return e.accent;const f=document.querySelector("launch-kit-beacon");return f&&getComputedStyle(f).getPropertyValue("--beacon-accent").trim()||"#0ea5e9"}async function g(f){const E=p();if(!E)return;const b=d(),x=await f.requestMode("pickElement"),L=Pn({accent:b});for(const C of n){const A=o.get(C);A&&L.addPin(C.number,{target:A,selector:C.selector,fallbackRect:C.boundingRect})}try{let C=!0;for(;C&&!(n.length>=t);){const R=await Fn({shadowRoot:E,accent:b}).promise;if(!R)break;const w=R.getBoundingClientRect(),T=await _n({anchor:{x:w.left,y:w.bottom},pinNumber:n.length+1});if(T.cancelled==="all"){C=!1;break}if(T.cancelled==="pin")continue;const _=En(R),N={number:n.length+1,..._,...T.note?{note:T.note}:{}};n.push(N),o.set(N,R),L.addPin(N.number,{target:R,selector:_.selector,fallbackRect:_.boundingRect})}n.length>0?(L.setLoading("Capturing screenshot…"),await new Promise(A=>requestAnimationFrame(()=>A())),await m()):(a=null,F())}finally{L.destroy(),x()}S(),h()}async function m(){const f=++r;if(n.length===0){a=null,F(),h();return}const E=d();try{const b=Array.from(document.querySelectorAll("launch-kit-beacon")),x=await qe({excludeHosts:b});try{if(f!==r)return;const L=n.map(R=>({number:R.number,selector:R.selector,boundingRect:R.boundingRect,...o.get(R)?{liveElement:o.get(R)}:{}})),C={w:x.width,h:x.height,dpr:x.pixelRatio},A=await Oe(x.dataUrl,L,C,E);if(f!==r)return;a=A,qn({dataUrl:A,mime:"image/jpeg"})}finally{x.dispose()}}catch{if(f!==r)return;a=null,F()}f===r&&h()}function y(f){const E=n.findIndex(b=>b.number===f);E!==-1&&(n.splice(E,1),n.forEach((b,x)=>{b.number=x+1}),a=null,F(),S(),h(),m())}function S(){if(i&&(i.textContent=`Pins (${n.length})`,i.style.display=n.length===0?"none":""),u&&(u.textContent=n.length===0?"Annotate elements":"Add another pin"),!!s){s.innerHTML="",s.style.display=n.length===0?"none":"";for(const f of n){const E=document.createElement("div");E.className="beacon-pin-item",E.dataset.pin=String(f.number);const b=document.createElement("span");b.className="beacon-pin-num",b.textContent=String(f.number);const x=document.createElement("div");x.className="beacon-pin-meta";const L=document.createElement("div");L.className="beacon-pin-selector",L.title=f.selector,L.textContent=f.selector||f.tagName;const C=document.createElement("input");C.type="text",C.className="beacon-pin-note-input",C.placeholder="Add a note (optional)",C.value=f.note??"",C.addEventListener("input",()=>{C.value.trim()?f.note=C.value:delete f.note}),x.appendChild(L),x.appendChild(C);const A=document.createElement("button");A.type="button",A.className="beacon-icon-btn",A.setAttribute("aria-label",`Remove pin ${f.number}`),A.appendChild(Vn()),A.addEventListener("click",()=>y(f.number)),E.appendChild(b),E.appendChild(x),E.appendChild(A),s.appendChild(E)}}}function h(){c&&(a?(c.src=a,c.style.display="block"):(c.removeAttribute("src"),c.style.display="none"))}return{name:"domEle",setupOnce(f){return f.on("close",()=>l())},form(f){return{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),u=document.createElement("button"),u.type="button",u.className="beacon-btn secondary beacon-pin-annotate",u.addEventListener("click",()=>{g(f)}),E.appendChild(u),c=document.createElement("img"),c.className="beacon-thumb",c.alt="Annotated screenshot preview",c.style.display="none",E.appendChild(c),S(),h(),()=>{i=null,s=null,c=null,u=null})}},capture(){return n.length===0?null:{pins:n}}}}function We(e){return!!e&&typeof e=="object"&&!("v"in e)&&"error"in e}function Xe(e={}){return{name:"domSS",async capture(t){const n=jn();if(n)return{dataUrl:n.dataUrl,mime:n.mime};const o=await t.requestMode("hide");try{await new Promise(i=>requestAnimationFrame(()=>i()));const a=Array.from(document.querySelectorAll("launch-kit-beacon")),r=await qe({quality:e.quality,pixelRatio:e.pixelRatio,excludeHosts:a});try{const i=t.captured("domEle"),s=Wn(i),c={w:r.width,h:r.height,dpr:r.pixelRatio},u=e.accent??Xn();return{dataUrl:s.length>0?await Oe(r.dataUrl,s,c,u):r.dataUrl,mime:"image/jpeg"}}finally{r.dispose()}}finally{o()}}}}function Wn(e){if(!e||We(e))return[];const t=e.pins;return Array.isArray(t)?t.filter(n=>!!n&&typeof n=="object").map(n=>({number:Number(n.number)||0,selector:typeof n.selector=="string"?n.selector:void 0,boundingRect:n.boundingRect??{x:0,y:0,w:0,h:0}})):[]}function Xn(){if(typeof window>"u")return"#0ea5e9";const e=document.querySelector("launch-kit-beacon");return e&&getComputedStyle(e).getPropertyValue("--beacon-accent").trim()||"#0ea5e9"}const Ye="beacon-no-capture",Ge="__lsBeaconMonitorChipPos",Yn="#10b981";function Gn(e){const t=e.accent??Yn,n=e.startedAt??Date.now(),o=document.createElement("div");o.className=`${Ye} beacon-monitor-overlay-frame`,o.setAttribute("aria-hidden","true"),o.style.setProperty("--beacon-monitor-accent",t),document.body.appendChild(o);const a=document.createElement("div");a.className=`${Ye} beacon-monitor-overlay-chip`,a.setAttribute("role","status"),a.setAttribute("aria-label","Recording — drag to move"),a.style.setProperty("--beacon-monitor-accent",t);const r=document.createElement("div");r.className="beacon-monitor-overlay-chip-row";const i=document.createElement("span");i.className="beacon-monitor-overlay-rec-dot",i.setAttribute("aria-hidden","true");const s=document.createElement("span");s.className="beacon-monitor-overlay-rec-label",s.textContent="REC";const c=document.createElement("span");c.className="beacon-monitor-overlay-sep",c.setAttribute("aria-hidden","true"),c.textContent="·";const u=document.createElement("span");u.className="beacon-monitor-overlay-timer",u.textContent="00:00";const l=document.createElement("button");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(u),r.appendChild(l),a.appendChild(r);const p=document.createElement("div");p.className="beacon-monitor-overlay-url",e.url?(p.textContent=e.url,p.title=e.url):p.style.display="none",a.appendChild(p),document.body.appendChild(a);const d=g()??m();S(y(d));function g(){try{const w=localStorage.getItem(Ge);if(!w)return null;const T=JSON.parse(w),_=typeof T.x=="number"?T.x:NaN,N=typeof T.y=="number"?T.y:NaN;return!Number.isFinite(_)||!Number.isFinite(N)?null:{x:_,y:N}}catch{return null}}function m(){const T=a.getBoundingClientRect().width||200;return{x:Math.max(8,Math.floor((window.innerWidth-T)/2)),y:16}}function y(w){const _=a.getBoundingClientRect(),N=_.width||200,ne=_.height||40,Fr=Math.max(8,window.innerWidth-N-8),Or=Math.max(8,window.innerHeight-ne-8);return{x:Math.min(Math.max(8,w.x),Fr),y:Math.min(Math.max(8,w.y),Or)}}function S(w){a.style.left=`${w.x}px`,a.style.top=`${w.y}px`}let h=!1,f=null,E={x:0,y:0};function b(w){if(w.target instanceof Element&&w.target.closest(".beacon-monitor-overlay-stop"))return;w.preventDefault(),h=!0,f=w.pointerId;try{a.setPointerCapture(w.pointerId)}catch{}a.setAttribute("data-dragging","true");const T=a.getBoundingClientRect();E={x:w.clientX-T.left,y:w.clientY-T.top}}function x(w){!h||w.pointerId!==f||S(y({x:w.clientX-E.x,y:w.clientY-E.y}))}function L(w){if(!h||w.pointerId!==f)return;h=!1,f=null,a.removeAttribute("data-dragging");try{a.releasePointerCapture(w.pointerId)}catch{}const T=a.getBoundingClientRect();try{localStorage.setItem(Ge,JSON.stringify({x:T.left,y:T.top}))}catch{}}a.addEventListener("pointerdown",b),a.addEventListener("pointermove",x),a.addEventListener("pointerup",L),a.addEventListener("pointercancel",L),l.addEventListener("click",w=>{w.stopPropagation(),e.onStop()});function C(){const w=a.getBoundingClientRect();S(y({x:w.left,y:w.top}))}window.addEventListener("resize",C);function A(){const w=Math.max(0,Math.floor((Date.now()-n)/1e3));u.textContent=Kn(w)}A();const R=window.setInterval(A,1e3);return{updateUrl(w){w?(p.textContent=w,p.title=w,p.style.display=""):p.style.display="none"},destroy(){window.clearInterval(R),window.removeEventListener("resize",C),a.removeEventListener("pointerdown",b),a.removeEventListener("pointermove",x),a.removeEventListener("pointerup",L),a.removeEventListener("pointercancel",L),o.remove(),a.remove()}}}function Kn(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=e%60;return t>0?`${j(t)}:${j(n)}:${j(o)}`:`${j(n)}:${j(o)}`}function j(e){return e<10?`0${e}`:String(e)}const G=80,Jn='button, a, input[type="submit"], input[type="button"], [role="button"], [role="link"], [role="menuitem"], [role="tab"], [role="option"]',Zn=1024,Qn=5;function eo(e,t){return e.length>t?e.slice(0,t):e}function ce(e){if(e.id)return`#${CSS.escape(e.id)}`;const t=[];let n=e;for(let o=0;o<5&&n;o++){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("."):"";if(t.unshift(`${a}${r}${i}`),r)break;n=n.parentElement}return t.join(" > ")}function K(e,t){if(!e)return;const n=e.replace(/\s+/g," ").trim();if(n)return n.length>t?n.slice(0,t):n}function Ke(e){const t=K(e.textContent,G),n=K(e.getAttribute("aria-label"),G),o=e.getAttribute("data-testid")||void 0,a=e.getAttribute("name")||void 0;let r=n||t;if(!r){const i=e.closest(Jn);i&&i!==e&&(r=K(i.getAttribute("aria-label"),G)||K(i.textContent,G))}return{tag:e.tagName.toLowerCase(),id:e.id||null,classes:Array.from(e.classList).slice(0,10),role:e.getAttribute("role"),selector:ce(e),...t?{text:t}:{},...n?{ariaLabel:n}:{},...o?{testid:o}:{},...a?{name:a}:{},...r&&r!==t?{label:r}:{}}}function to(e,t){const n=[],o=document.querySelectorAll("body *");for(const a of Array.from(o)){const r=getComputedStyle(a);if(r.position!=="fixed"&&r.position!=="sticky")continue;const i=a.getBoundingClientRect();if(e<i.left||e>i.right||t<i.top||t>i.bottom)continue;const s=parseInt(r.zIndex,10);!Number.isFinite(s)&&r.zIndex!=="auto"||n.push({tag:a.tagName.toLowerCase(),zIndex:Number.isFinite(s)?s:0,pointerEvents:r.pointerEvents,classes:Array.from(a.classList).slice(0,5).join(" ")})}return n.sort((a,r)=>r.zIndex-a.zIndex).slice(0,Qn)}function no(e){const t=a=>r=>{const i=r,s=i.target;if(!(s instanceof Element))return;const c=i.clientX,u=i.clientY,l=document.elementFromPoint(c,u),p=l===s||(l?s.contains(l)||l.contains(s):!1),d=document.querySelectorAll('[role="dialog"][data-state="open"]').length,g=getComputedStyle(document.body).pointerEvents,m=p?[]:to(c,u);e.emitClick({kind:a,target:Ke(s),hitMatchesTarget:p,...!p&&l instanceof Element?{hitTarget:Ke(l)}:{},coords:{x:c,y:u},openDialogs:d,bodyPointerEvents:g,...m.length>0?{overlaysAtPoint:m}:{}})},n=t("click"),o=t("mousedown");return document.addEventListener("click",n,{capture:!0,passive:!0}),document.addEventListener("mousedown",o,{capture:!0,passive:!0}),()=>{document.removeEventListener("click",n,{capture:!0}),document.removeEventListener("mousedown",o,{capture:!0})}}function oo(e){const t=history.pushState,n=history.replaceState;let o=window.location.href;const a=s=>{const c=window.location.href;if(c===o)return;const u=o;o=c,e.emitRoute({kind:"route",from:u,to:c,via:s})};history.pushState=function(...c){const u=t.apply(this,c);return a("pushState"),u},history.replaceState=function(...c){const u=n.apply(this,c);return a("replaceState"),u};const r=()=>a("popstate"),i=()=>a("hashchange");return window.addEventListener("popstate",r),window.addEventListener("hashchange",i),()=>{history.pushState=t,history.replaceState=n,window.removeEventListener("popstate",r),window.removeEventListener("hashchange",i)}}function ro(e){const t=new WeakSet,n=(a,r)=>{const i=ce(a);e.emitDialog({kind:"dialog",action:r,selector:i,state:a.getAttribute("data-state"),...r==="mount"?{outerHTML:eo(a.outerHTML,Zn)}:{}})};for(const a of Array.from(document.querySelectorAll('[role="dialog"]')))t.add(a);const o=new MutationObserver(a=>{var r,i,s,c;for(const u of a){for(const l of Array.from(u.addedNodes)){if(!(l instanceof Element))continue;const p=(r=l.matches)!=null&&r.call(l,'[role="dialog"]')?[l]:Array.from(((i=l.querySelectorAll)==null?void 0:i.call(l,'[role="dialog"]'))??[]);for(const d of p)t.has(d)||(t.add(d),n(d,"mount"))}for(const l of Array.from(u.removedNodes)){if(!(l instanceof Element))continue;const p=(s=l.matches)!=null&&s.call(l,'[role="dialog"]')?[l]:Array.from(((c=l.querySelectorAll)==null?void 0:c.call(l,'[role="dialog"]'))??[]);for(const d of p)t.has(d)&&(t.delete(d),n(d,"unmount"))}u.type==="attributes"&&u.attributeName==="data-state"&&u.target instanceof Element&&u.target.getAttribute("role")==="dialog"&&n(u.target,"state")}});return o.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-state"]}),()=>o.disconnect()}function ao(e){const t=n=>{const o=n.target;if(!(o instanceof HTMLFormElement))return;const a=[];for(const r of Array.from(o.elements)){if(!(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement))continue;const i=r.getAttribute("name")||"<unnamed>",s=r instanceof HTMLInputElement?r.type:r.tagName.toLowerCase();let c;r instanceof HTMLInputElement&&(r.type==="checkbox"||r.type==="radio")?c=r.checked:c=!!r.value,a.push({name:i,type:s,hasValue:c})}e.emitSubmit({kind:"submit",form:{id:o.id||null,action:o.getAttribute("action")||null,method:(o.getAttribute("method")||"GET").toUpperCase(),selector:ce(o),fields:a}})};return document.addEventListener("submit",t,{capture:!0}),()=>document.removeEventListener("submit",t,{capture:!0})}function io(e){const t=no(e),n=oo(e),o=ro(e),a=ao(e);return{uninstall(){t(),n(),o(),a()}}}const le=1e3,Je=10*1024,Ze="[REDACTED]",Qe=new Set(["POST","PUT","PATCH","DELETE"]),so=[/Bearer\s+[A-Za-z0-9._\-+/=]+/gi,/\bls_pat_[A-Za-z0-9_]+/g,/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g],co=/^(password|passwd|secret|token|api[_-]?key|auth|access[_-]?token|refresh[_-]?token|client[_-]?secret|private[_-]?key)$/i;function ue(e,t){return e.length>t?e.slice(0,t):e}function et(e){let t=e;for(const n of so)t=t.replace(n,Ze);return t}function de(e){if(e===null||typeof e!="object")return typeof e=="string"?et(e):e;if(Array.isArray(e))return e.map(de);const t={};for(const[n,o]of Object.entries(e))t[n]=co.test(n)?Ze:de(o);return t}function tt(e,t){if(t&&t.includes("application/json"))try{const n=JSON.parse(e);return JSON.stringify(de(n))}catch{}return et(e)}function J(e,t){const n=e.length,o={bodySize:n};return n>Je?(o.body=tt(e.slice(0,Je),t),o.bodyTruncated=!0):o.body=tt(e,t),t&&(o.contentType=t),o}function lo(e,t){const n=t==null?void 0:t.body;if(n!=null){if(typeof n=="string")return n;if(n instanceof URLSearchParams)return n.toString();if(n instanceof FormData){const o=[];return n.forEach((a,r)=>{o.push(`${r}=${typeof a=="string"?`[${a.length}b]`:"[file]"}`)}),`[FormData] ${o.join("&")}`}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}return e instanceof Request,null}function uo(e,t){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"))}function po(e,t){return(o=>{if(o){if(o instanceof Headers)return o.get("content-type")||void 0;if(Array.isArray(o)){const a=o.find(([r])=>r.toLowerCase()==="content-type");return a?a[1]:void 0}if(typeof o=="object"){for(const[a,r]of Object.entries(o))if(a.toLowerCase()==="content-type")return r}}})(t==null?void 0:t.headers)??(e instanceof Request&&e.headers.get("content-type")||void 0)}function fo(e,t,n){if(!Qe.has(n))return;const o=uo(e,t),a=lo(e,t);if(a==null&&!o)return;const r=po(e,t),i=a!=null?J(a,r):{};return o&&(i.hasAuth=!0),i}function mo(e){const t=window.fetch;if(typeof t!="function")return()=>{};const n=async(o,a)=>{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=fo(o,a,i);try{const u=await t.call(window,o,a),l=Math.round(performance.now()-r),p=u.status>=400;let d;if(p||e.verbose)try{const g=await u.clone().text(),m=u.headers.get("content-type")||void 0;d=J(g,m)}catch{}return(p||e.verbose)&&e.emit({kind:"fetch",url:ue(s,le),method:i,status:u.status,durationMs:l,failed:p,...c?{request:c}:{},...d?{response:d}:{}}),u}catch(u){const l=Math.round(performance.now()-r);throw e.emit({kind:"fetch",url:ue(s,le),method:i,status:0,durationMs:l,failed:!0,error:u instanceof Error?u.message:String(u),...c?{request:c}:{}}),u}};return n.__lsBeaconWrapped=!0,window.fetch=n,()=>{window.fetch.__lsBeaconWrapped&&(window.fetch=t)}}function ho(e){if(e==null)return null;if(typeof e=="string")return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){const t=[];return e.forEach((n,o)=>{t.push(`${o}=${typeof n=="string"?`[${n.length}b]`:"[file]"}`)}),`[FormData] ${t.join("&")}`}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}function bo(e){const t=XMLHttpRequest.prototype,n=t.open,o=t.send,a=t.setRequestHeader,r=new WeakMap;return t.open=function(s,c,...u){return r.set(this,{method:s.toUpperCase(),url:typeof c=="string"?c:c.toString(),start:0,hasAuth:!1}),n.call(this,s,c,...u)},t.setRequestHeader=function(s,c){const u=r.get(this);if(u){const l=s.toLowerCase();l==="authorization"?u.hasAuth=!0:l==="content-type"&&(u.requestContentType=c)}return a.call(this,s,c)},t.send=function(s){const c=r.get(this);if(c)if(c.start=performance.now(),Qe.has(c.method)){const l=ho(s);l!=null?c.request=J(l,c.requestContentType):c.request={},c.hasAuth&&(c.request.hasAuth=!0)}else c.hasAuth&&(c.request={hasAuth:!0});const u=()=>{this.removeEventListener("loadend",u);const l=r.get(this);if(!l)return;const p=Math.round(performance.now()-l.start),d=this.status===0||this.status>=400;let g;if((d||e.verbose)&&this.status>0)try{const m=this.responseType===""||this.responseType==="text"?this.responseText:"";if(m){const y=this.getResponseHeader("content-type")||void 0;g=J(m,y)}}catch{}(d||e.verbose)&&e.emit({kind:"xhr",url:ue(l.url,le),method:l.method,status:this.status,durationMs:p,failed:d,...l.request?{request:l.request}:{},...g?{response:g}:{}}),r.delete(this)};return this.addEventListener("loadend",u),o.call(this,s)},()=>{t.open=n,t.send=o,t.setRequestHeader=a}}function go(e){const t=mo(e),n=bo(e);return{uninstall(){t(),n()}}}const yo=1e3,nt=50,wo=500;class vo{constructor(t){this.buffer=[],this.inflight=!1,this.timer=null,this.destroyed=!1,this.handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this.flushSync()},this.url=t.url,this.sessionId=t.sessionId,this.onError=t.onError,this.timer=setInterval(()=>{this.flush()},yo),this.pagehideHandler=()=>this.flushSync(),window.addEventListener("pagehide",this.pagehideHandler),document.addEventListener("visibilitychange",this.handleVisibilityChange)}enqueue(t){this.destroyed||(this.buffer.push(t),this.buffer.length>wo&&this.buffer.shift(),this.buffer.length>=nt&&this.flush())}async flush(){var o,a;if(this.destroyed||this.inflight||this.buffer.length===0)return;const t=this.buffer.splice(0,nt),n=this.makeBatch(t);this.inflight=!0;try{const r=await fetch(this.url,{method:"POST",credentials:"omit",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),keepalive:!0});r.ok||(o=this.onError)==null||o.call(this,new Error(`monitor flush: HTTP ${r.status}`))}catch(r){(a=this.onError)==null||a.call(this,r instanceof Error?r:new Error(String(r)))}finally{this.inflight=!1}}flushSync(){if(this.destroyed||this.buffer.length===0)return;if(!navigator.sendBeacon){this.flush();return}const t=this.buffer.splice(0),n=this.makeBatch(t),o=new Blob([JSON.stringify(n)],{type:"application/json"});try{navigator.sendBeacon(this.url,o)}catch{}}destroy(){this.destroyed||(this.destroyed=!0,this.timer&&clearInterval(this.timer),this.pagehideHandler&&window.removeEventListener("pagehide",this.pagehideHandler),document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.flushSync())}makeBatch(t){return{sessionId:this.sessionId,events:t,meta:{url:window.location.href,userAgent:navigator.userAgent,viewport:{w:window.innerWidth,h:window.innerHeight,dpr:window.devicePixelRatio||1},v:1}}}}const pe="__lsBeaconMonitorUrl",ot="__lsBeaconMonitorSession",fe="__lsBeaconMonitorVerbose",me="__lsBeaconMonitorDeadline",rt=30*6e4,at=4096;let v=null;const he=new Set;function xo(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10)}function Eo(e){const t=new WeakSet,n=o=>{if(o===null||typeof o!="object")return typeof o=="string"&&o.length>at?o.slice(0,at):o;if(t.has(o))return"[cyclic]";if(t.add(o),Array.isArray(o))return o.map(n);const a={};for(const r of Object.keys(o).slice(0,50))try{a[r]=n(o[r])}catch{a[r]="[unreadable]"}return a};try{return n(e)}catch{return"[unserialisable]"}}function be(){for(const e of he)try{e(v!==null,(v==null?void 0:v.url)??null)}catch{}}function So(e){return v?(v.seq+=1,{...e,ts:Date.now(),sessionId:v.sessionId,seq:v.seq}):{...e,ts:Date.now(),sessionId:"",seq:0}}function O(e){if(!v)return;const t=So(e);v.transport.enqueue(t)}function Co(){if(v)try{sessionStorage.setItem(pe,v.url),sessionStorage.setItem(ot,v.sessionId),sessionStorage.setItem(fe,v.verbose?"1":"0"),sessionStorage.setItem(me,String(v.deadlineMs))}catch{}}function it(){try{sessionStorage.removeItem(pe),sessionStorage.removeItem(ot),sessionStorage.removeItem(fe),sessionStorage.removeItem(me)}catch{}}function Ao(){try{const e=sessionStorage.getItem(pe);if(!e)return null;const t=sessionStorage.getItem(fe)==="1",n=sessionStorage.getItem(me),o=n?Number(n):Date.now()+rt;return Number.isFinite(o)&&o<=Date.now()?(it(),null):{url:e,verbose:t,deadlineMs:o}}catch{return null}}function st(e){v&&(v.seq+=1,v.transport.enqueue({kind:e.kind,ts:e.ts,sessionId:v.sessionId,seq:v.seq,message:e.message,...e.stack?{stack:e.stack}:{},...e.source?{source:e.source}:{},...typeof e.line=="number"?{line:e.line}:{},...typeof e.col=="number"?{col:e.col}:{}}))}function ge(e){if(v&&V(),!e.url)return;const t=e.maxSessionMs??rt,n=Date.now()+t,o=xo(),a=!!e.verbose,r=new vo({url:e.url,sessionId:o,onError:m=>{console.warn("[launch-kit-beacon] monitor transport error:",m.message)}}),i=Pe(),s=i.install(),c=i.snapshot();for(const m of c)st(m);let u=c.length;const l=i.subscribe(()=>{if(!v)return;const m=v.errorsBuffer.snapshot();for(;v.drainedThrough<m.length;){const y=m[v.drainedThrough];y&&st(y),v.drainedThrough+=1}}),p=go({emit:m=>O(m),verbose:a}),d=io({emitClick:m=>O(m),emitRoute:m=>O(m),emitDialog:m=>O(m),emitSubmit:m=>O(m)}),g=setTimeout(()=>{console.info("[launch-kit-beacon] monitor session expired (max duration reached)"),V()},Math.max(0,n-Date.now()));v={url:e.url,sessionId:o,verbose:a,deadlineMs:n,seq:0,transport:r,errorsBuffer:i,uninstallNetwork:p.uninstall,uninstallDom:d.uninstall,uninstallErrors:s,errorsUnsub:l,deadlineTimer:g,drainedThrough:u},Co(),be()}function V(){ct(),it(),be()}function ko(){v&&(ct(),be())}function ct(){v&&(clearTimeout(v.deadlineTimer),v.errorsUnsub(),v.uninstallErrors(),v.uninstallNetwork(),v.uninstallDom(),v.transport.destroy(),v=null)}function Lo(e,t){v&&O({kind:"probe",label:e.slice(0,200),data:Eo(t)})}function ye(){return v!==null}function we(){return(v==null?void 0:v.url)??null}function lt(e){return he.add(e),()=>{he.delete(e)}}function To(){if(v||typeof window>"u")return;const e=Ao();e&&ge({url:e.url,verbose:e.verbose,maxSessionMs:Math.max(6e4,e.deadlineMs-Date.now())})}function Ro(e={}){let t=null,n=null,o="",a=null;function r(){a||(a=Gn({onStop:()=>V(),url:we()}))}function i(){if(a){try{a.destroy()}catch{}a=null}}function s(){if(!t)return;t.innerHTML="";const l=document.createElement("div");l.className="beacon-monitor-title",l.textContent="Monitor — paste a stream URL",t.appendChild(l);const p=document.createElement("div");p.className="beacon-monitor-row";const d=document.createElement("input");d.type="url",d.className="beacon-monitor-input",d.placeholder="http://localhost:9876/m/…",d.value=o,d.autocomplete="off",d.spellcheck=!1,p.appendChild(d);const g=document.createElement("button");g.type="button",g.className="beacon-monitor-btn",g.textContent="Start",g.disabled=!o.trim(),p.appendChild(g),t.appendChild(p);const m=document.createElement("label");m.className="beacon-monitor-verbose";const y=document.createElement("input");y.type="checkbox",y.dataset.role="verbose",m.appendChild(y),m.appendChild(document.createTextNode(" verbose (capture successful network too)")),t.appendChild(m);const S=document.createElement("div");S.className="beacon-monitor-help",S.textContent="Streams clicks, failed network, errors, route + dialog changes.",t.appendChild(S),d.addEventListener("input",()=>{o=d.value,g.disabled=!d.value.trim()}),g.addEventListener("click",()=>{const h=d.value.trim();if(h){try{new URL(h)}catch{d.setCustomValidity("Enter a valid URL (e.g. http://localhost:9876/m/abc)"),d.reportValidity();return}d.setCustomValidity(""),ge({url:h,verbose:y.checked,...e.maxSessionMs!==void 0?{maxSessionMs:e.maxSessionMs}:{}})}})}function c(){if(!t)return;t.innerHTML="";const l=we()??"",p=document.createElement("div");p.className="beacon-monitor-title";const d=document.createElement("span");d.className="beacon-monitor-rec",d.setAttribute("aria-hidden","true"),p.appendChild(d),p.appendChild(document.createTextNode(" Monitor — recording")),t.appendChild(p);const g=document.createElement("div");g.className="beacon-monitor-active-url",g.title=l,g.textContent=l,t.appendChild(g);const m=document.createElement("div");m.className="beacon-monitor-row";const y=document.createElement("button");y.type="button",y.className="beacon-monitor-btn stop",y.textContent="Stop monitoring",y.addEventListener("click",()=>V()),m.appendChild(y),t.appendChild(m);const S=document.createElement("div");S.className="beacon-monitor-help",S.textContent="Events stream to the URL above. Auto-stops after 30 min.",t.appendChild(S)}function u(){ye()?c():s()}return{name:"liveMonitor",setupOnce(l){To(),ye()&&r();const p=lt((g,m)=>{g?(r(),a==null||a.updateUrl(m)):i()}),d=()=>{i(),p();try{ko()}catch{}};l.signal.addEventListener("abort",d,{once:!0})},form(){return{render:l=>(t=document.createElement("div"),t.className="beacon-monitor",l.appendChild(t),u(),n=lt(()=>u()),()=>{n==null||n(),n=null,t=null})}}}}let M=null;const ve={"plugin:error":new Set,"submit:success":new Set,"submit:error":new Set,ready:new Set};function Mo(e){if(typeof window>"u")return;if(!e.endpoint)throw new Error("init: endpoint is required");Te(),dt();const t={...Xt(),...e.labels??{}},n=new AbortController,o=$o(e),a=e.position??"bottom-right",r=e.theme??"auto";It(),_o(e,a,r);const i=document.querySelector(U);if(!i)throw new Error("init: failed to acquire <launch-kit-beacon> host");if(!i.shadow)throw new Error("init: host element shadow root not initialized");const s=Yt(i.shadow),c=new Wt(t,["bug","idea","ux","a11y"],{onSubmit:()=>{Oo()},onClose:p=>{Z("close",{}),p==="user"&&mt()}});i.shadow.appendChild(c.root),i.classList.add("beacon-no-capture");const u=Ot(o),l={endpoint:e.endpoint,headers:e.headers,context:e.context,credentials:e.credentials??"omit",plugins:o,registry:u,dialog:c,overlayHost:s,hostElement:i,initAbort:n,labels:t,debug:!!e.debug||Fo(),healthIndicator:e.healthIndicator??"never",position:a,theme:r,currentSubmit:null,capturedEntries:{},formValues:{},lifecycleHandlers:{open:new Set,close:new Set,beforeSubmit:new Set,afterSubmit:new Set},panelSources:[]};M=l,i.onTriggerClick=()=>ut(),u.install(p=>ft(p),p=>xe(p)),W("ready",{ready:!0}),l.debug&&console.info("[beacon] ready",l.endpoint)}function ut(){const e=M;e&&(e.currentSubmit||(e.panelSources=e.plugins.map(t=>{if(!t.form)return null;const n=ft(t.name);let o;try{o=t.form(n)}catch(a){return xe({plugin:t.name,error:a instanceof Error?a:new Error(String(a)),at:"form"}),null}return{name:t.name,form:o,ctx:n}}).filter(t=>t!==null),e.dialog.installPluginPanels(e.panelSources,{get:(t,n)=>{var o;return(o=e.formValues[t])==null?void 0:o[n]},set:(t,n,o)=>{var r;const a=(r=e.formValues)[t]??(r[t]={});a[n]=o}}),e.dialog.open(),Z("open",{})))}function Po(){const e=M;e&&e.dialog.close("user")}function dt(){var t;const e=M;if(e){e.initAbort.abort(),(t=e.currentSubmit)==null||t.abort(),e.registry.destroy(),F();try{e.dialog.root.remove(),e.overlayHost.layer.remove()}catch{}e.hostElement.onTriggerClick=null,M=null}}function Io(){const e=M;return e?{ready:!0,transport:"idle",plugins:e.registry.status()}:{ready:!1,transport:"idle",plugins:{}}}function No(e,t){return ve[e].add(t),()=>pt(e,t)}function pt(e,t){ve[e].delete(t)}function _o(e,t,n){let o=document.querySelector(U);if(!o){o=document.createElement(U),o.setAttribute("position",t),o.setAttribute("theme",n),t==="hidden"&&(o.style.position="absolute",o.style.left="-9999px"),(document.body??document.documentElement).appendChild(o);return}e.position!==void 0&&o.setAttribute("position",t),e.theme!==void 0&&o.setAttribute("theme",n)}function $o(e){return e.plugins?e.plugins:e.defaultPlugins===!1?[]:Do()}function Do(){return[Re(),Ie(),Ve(),Xe()]}function Fo(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).has("lsbeacon-debug")}catch{return!1}}function ft(e){const t=M;return Dt(e,{getCaptured:o=>t==null?void 0:t.capturedEntries[o],getFormValues:o=>{var a;return t?(a=t.formValues)[o]??(a[o]={}):{}},getCaptureSignal:()=>{var o;return(o=t==null?void 0:t.currentSubmit)==null?void 0:o.signal},getInitSignal:()=>t.initAbort.signal,requestMode:async o=>t?t.dialog.requestMode(o):()=>{},overlay:o=>t?Gt(t.overlayHost,o.render):()=>{},onLifecycle:(o,a)=>{if(!t)return()=>{};const r=t.lifecycleHandlers[o];return r.add(a),()=>r.delete(a)}})}function Z(e,t){const n=M;if(n)for(const o of n.lifecycleHandlers[e])try{o(t)}catch(a){n.debug&&console.error("[beacon] lifecycle handler threw:",a)}}function W(e,t){for(const n of ve[e])try{n(t)}catch(o){M!=null&&M.debug&&console.error("[beacon] system handler threw:",o)}}function xe(e){W("plugin:error",{plugin:e.plugin,error:e.error,at:e.at});const t=M;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))}function mt(){const e=M;e&&(e.dialog.resetState(),e.dialog.clearPluginPanels(),e.formValues={})}async function Oo(){const e=M;if(!e||e.currentSubmit)return;const t=e.dialog.getDescription().trim();if(!t){e.dialog.setStatus("Description is required","error");return}e.currentSubmit=new AbortController,e.capturedEntries={},e.dialog.setSubmitting(!0),e.dialog.setStatus("Capturing…");let n=null;try{const o=await e.registry.capture(s=>e.capturedEntries[s],s=>xe(s));e.capturedEntries=o,n=Ho(e,t,o);let a=null;if(Z("beforeSubmit",{payload:n,cancel:s=>{a===null&&(a=s)}}),a!==null){e.dialog.setSubmitting(!1),e.dialog.setStatus(`Cancelled: ${a}`,"error");return}e.dialog.setStatus("Sending…");const i=await Ut(e.endpoint,n,e.headers,e.currentSubmit.signal,e.credentials);Z("afterSubmit",{payload:n,response:i}),e.dialog.setSubmitting(!1),i.ok?(W("submit:success",{payload:n,response:i}),e.dialog.setSubmitSucceeded(!0),e.dialog.setStatus(e.labels.sentSuccess,"success"),window.setTimeout(()=>{M===e&&e.dialog.close("submitted"),mt()},1500)):(W("submit:error",{payload:n,error:new Error(`HTTP ${i.status}`)}),e.dialog.setStatus(`Failed (${i.status})`,"error"))}catch(o){e.dialog.setSubmitting(!1);const a=o instanceof Error?o:new Error(String(o));n&&W("submit:error",{payload:n,error:a}),e.dialog.setStatus(`Failed: ${a.message}`,"error")}finally{e.currentSubmit=null}}function Ho(e,t,n){var r;const o=Bo(),a=(r=e.context)==null?void 0:r.call(e);return{description:t,severity:e.dialog.getSeverity(),metadata:o,...a?{context:a}:{},plugins:n}}function Bo(){const e=window.location.href,t=document.referrer,n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return{url:e,...t?{referrer:t}:{},userAgent:navigator.userAgent,viewport:{w:window.innerWidth,h:window.innerHeight,dpr:window.devicePixelRatio||1},screen:{w:window.screen.width,h:window.screen.height},timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,locale:navigator.language,theme:n,capturedAt:new Date().toISOString()}}Te();function Uo(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),o=n.createElement("base"),a=n.createElement("a");return n.head.appendChild(o),n.body.appendChild(a),t&&(o.href=t),a.href=e,a.href}const zo=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function $(e){const t=[];for(let n=0,o=e.length;n<o;n++)t.push(e[n]);return t}let H=null;function ht(e={}){return H||(e.includeStyleProperties?(H=e.includeStyleProperties,H):(H=$(window.getComputedStyle(document.documentElement)),H))}function Q(e,t){const o=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return o?parseFloat(o.replace("px","")):0}function qo(e){const t=Q(e,"border-left-width"),n=Q(e,"border-right-width");return e.clientWidth+t+n}function jo(e){const t=Q(e,"border-top-width"),n=Q(e,"border-bottom-width");return e.clientHeight+t+n}function Ee(e,t={}){const n=t.width||qo(e),o=t.height||jo(e);return{width:n,height:o}}function Vo(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const I=16384;function Wo(e){(e.width>I||e.height>I)&&(e.width>I&&e.height>I?e.width>e.height?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I):e.width>I?(e.height*=I/e.width,e.width=I):(e.width*=I/e.height,e.height=I))}function Xo(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(n=>{const o=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),a=o.length,r=new Uint8Array(a);for(let i=0;i<a;i+=1)r[i]=o.charCodeAt(i);n(new Blob([r],{type:t.type?t.type:"image/png"}))})}function ee(e){return new Promise((t,n)=>{const o=new Image;o.onload=()=>{o.decode().then(()=>{requestAnimationFrame(()=>t(o))})},o.onerror=n,o.crossOrigin="anonymous",o.decoding="async",o.src=e})}async function Yo(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Go(e,t,n){const o="http://www.w3.org/2000/svg",a=document.createElementNS(o,"svg"),r=document.createElementNS(o,"foreignObject");return a.setAttribute("width",`${t}`),a.setAttribute("height",`${n}`),a.setAttribute("viewBox",`0 0 ${t} ${n}`),r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("x","0"),r.setAttribute("y","0"),r.setAttribute("externalResourcesRequired","true"),a.appendChild(r),r.appendChild(e),Yo(a)}const P=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||P(n,t)};function Ko(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Jo(e,t){return ht(t).map(n=>{const o=e.getPropertyValue(n),a=e.getPropertyPriority(n);return`${n}: ${o}${a?" !important":""};`}).join(" ")}function Zo(e,t,n,o){const a=`.${e}:${t}`,r=n.cssText?Ko(n):Jo(n,o);return document.createTextNode(`${a}{${r}}`)}function bt(e,t,n,o){const a=window.getComputedStyle(e,n),r=a.getPropertyValue("content");if(r===""||r==="none")return;const i=zo();try{t.className=`${t.className} ${i}`}catch{return}const s=document.createElement("style");s.appendChild(Zo(i,n,a,o)),t.appendChild(s)}function Qo(e,t,n){bt(e,t,":before",n),bt(e,t,":after",n)}const gt="application/font-woff",yt="image/jpeg",er={woff:gt,woff2:gt,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:yt,jpeg:yt,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function tr(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Se(e){const t=tr(e).toLowerCase();return er[t]||""}function nr(e){return e.split(/,/)[1]}function Ce(e){return e.search(/^(data:)/)!==-1}function or(e,t){return`data:${t};base64,${e}`}async function wt(e,t,n){const o=await fetch(e,t);if(o.status===404)throw new Error(`Resource "${o.url}" not found`);const a=await o.blob();return new Promise((r,i)=>{const s=new FileReader;s.onerror=i,s.onloadend=()=>{try{r(n({res:o,result:s.result}))}catch(c){i(c)}},s.readAsDataURL(a)})}const Ae={};function rr(e,t,n){let o=e.replace(/\?.*/,"");return n&&(o=e),/ttf|otf|eot|woff2?/i.test(o)&&(o=o.replace(/.*\//,"")),t?`[${t}]${o}`:o}async function ke(e,t,n){const o=rr(e,t,n.includeQueryParams);if(Ae[o]!=null)return Ae[o];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const r=await wt(e,n.fetchRequestInit,({res:i,result:s})=>(t||(t=i.headers.get("Content-Type")||""),nr(s)));a=or(r,t)}catch(r){a=n.imagePlaceholder||"";let i=`Failed to fetch resource: ${e}`;r&&(i=typeof r=="string"?r:r.message),i&&console.warn(i)}return Ae[o]=a,a}async function ar(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ee(t)}async function ir(e,t){if(e.currentSrc){const r=document.createElement("canvas"),i=r.getContext("2d");r.width=e.clientWidth,r.height=e.clientHeight,i==null||i.drawImage(e,0,0,r.width,r.height);const s=r.toDataURL();return ee(s)}const n=e.poster,o=Se(n),a=await ke(n,o,t);return ee(a)}async function sr(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await te(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function cr(e,t){return P(e,HTMLCanvasElement)?ar(e):P(e,HTMLVideoElement)?ir(e,t):P(e,HTMLIFrameElement)?sr(e,t):e.cloneNode(vt(e))}const lr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",vt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function ur(e,t,n){var o,a;if(vt(t))return t;let r=[];return lr(e)&&e.assignedNodes?r=$(e.assignedNodes()):P(e,HTMLIFrameElement)&&(!((o=e.contentDocument)===null||o===void 0)&&o.body)?r=$(e.contentDocument.body.childNodes):r=$(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),r.length===0||P(e,HTMLVideoElement)||await r.reduce((i,s)=>i.then(()=>te(s,n)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function dr(e,t,n){const o=t.style;if(!o)return;const a=window.getComputedStyle(e);a.cssText?(o.cssText=a.cssText,o.transformOrigin=a.transformOrigin):ht(n).forEach(r=>{let i=a.getPropertyValue(r);r==="font-size"&&i.endsWith("px")&&(i=`${Math.floor(parseFloat(i.substring(0,i.length-2)))-.1}px`),P(e,HTMLIFrameElement)&&r==="display"&&i==="inline"&&(i="block"),r==="d"&&t.getAttribute("d")&&(i=`path(${t.getAttribute("d")})`),o.setProperty(r,i,a.getPropertyPriority(r))})}function pr(e,t){P(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),P(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function fr(e,t){if(P(e,HTMLSelectElement)){const n=t,o=Array.from(n.children).find(a=>e.value===a.getAttribute("value"));o&&o.setAttribute("selected","")}}function mr(e,t,n){return P(t,Element)&&(dr(e,t,n),Qo(e,t,n),pr(e,t),fr(e,t)),t}async function hr(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const o={};for(let r=0;r<n.length;r++){const s=n[r].getAttribute("xlink:href");if(s){const c=e.querySelector(s),u=document.querySelector(s);!c&&u&&!o[s]&&(o[s]=await te(u,t,!0))}}const a=Object.values(o);if(a.length){const r="http://www.w3.org/1999/xhtml",i=document.createElementNS(r,"svg");i.setAttribute("xmlns",r),i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.overflow="hidden",i.style.display="none";const s=document.createElementNS(r,"defs");i.appendChild(s);for(let c=0;c<a.length;c++)s.appendChild(a[c]);e.appendChild(i)}return e}async function te(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(o=>cr(o,t)).then(o=>ur(e,o,t)).then(o=>mr(e,o,t)).then(o=>hr(o,t))}const xt=/url\((['"]?)([^'"]+?)\1\)/g,br=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,gr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function yr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function wr(e){const t=[];return e.replace(xt,(n,o,a)=>(t.push(a),n)),t.filter(n=>!Ce(n))}async function vr(e,t,n,o,a){try{const r=n?Uo(t,n):t,i=Se(t);let s;return a||(s=await ke(r,i,o)),e.replace(yr(t),`$1${s}$3`)}catch{}return e}function xr(e,{preferredFontFormat:t}){return t?e.replace(gr,n=>{for(;;){const[o,,a]=br.exec(n)||[];if(!a)return"";if(a===t)return`src: ${o};`}}):e}function Et(e){return e.search(xt)!==-1}async function St(e,t,n){if(!Et(e))return e;const o=xr(e,n);return wr(o).reduce((r,i)=>r.then(s=>vr(s,i,t,n)),Promise.resolve(o))}async function B(e,t,n){var o;const a=(o=t.style)===null||o===void 0?void 0:o.getPropertyValue(e);if(a){const r=await St(a,null,n);return t.style.setProperty(e,r,t.style.getPropertyPriority(e)),!0}return!1}async function Er(e,t){await B("background",e,t)||await B("background-image",e,t),await B("mask",e,t)||await B("-webkit-mask",e,t)||await B("mask-image",e,t)||await B("-webkit-mask-image",e,t)}async function Sr(e,t){const n=P(e,HTMLImageElement);if(!(n&&!Ce(e.src))&&!(P(e,SVGImageElement)&&!Ce(e.href.baseVal)))return;const o=n?e.src:e.href.baseVal,a=await ke(o,Se(o),t);await new Promise((r,i)=>{e.onload=r,e.onerror=t.onImageErrorHandler?(...c)=>{try{r(t.onImageErrorHandler(...c))}catch(u){i(u)}}:i;const s=e;s.decode&&(s.decode=r),s.loading==="lazy"&&(s.loading="eager"),n?(e.srcset="",e.src=a):e.href.baseVal=a})}async function Cr(e,t){const o=$(e.childNodes).map(a=>Ct(a,t));await Promise.all(o).then(()=>e)}async function Ct(e,t){P(e,Element)&&(await Er(e,t),await Sr(e,t),await Cr(e,t))}function Ar(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const o=t.style;return o!=null&&Object.keys(o).forEach(a=>{n[a]=o[a]}),e}const At={};async function kt(e){let t=At[e];if(t!=null)return t;const o=await(await fetch(e)).text();return t={url:e,cssText:o},At[e]=t,t}async function Lt(e,t){let n=e.cssText;const o=/url\(["']?([^"')]+)["']?\)/g,r=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let s=i.replace(o,"$1");return s.startsWith("https://")||(s=new URL(s,e.url).href),wt(s,t.fetchRequestInit,({result:c})=>(n=n.replace(i,`url(${c})`),[i,c]))});return Promise.all(r).then(()=>n)}function Tt(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let o=e.replace(n,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=a.exec(o);if(c===null)break;t.push(c[0])}o=o.replace(a,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",s=new RegExp(i,"gi");for(;;){let c=r.exec(o);if(c===null){if(c=s.exec(o),c===null)break;r.lastIndex=s.lastIndex}else s.lastIndex=r.lastIndex;t.push(c[0])}return t}async function kr(e,t){const n=[],o=[];return e.forEach(a=>{if("cssRules"in a)try{$(a.cssRules||[]).forEach((r,i)=>{if(r.type===CSSRule.IMPORT_RULE){let s=i+1;const c=r.href,u=kt(c).then(l=>Lt(l,t)).then(l=>Tt(l).forEach(p=>{try{a.insertRule(p,p.startsWith("@import")?s+=1:a.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:p,error:d})}})).catch(l=>{console.error("Error loading remote css",l.toString())});o.push(u)}})}catch(r){const i=e.find(s=>s.href==null)||document.styleSheets[0];a.href!=null&&o.push(kt(a.href).then(s=>Lt(s,t)).then(s=>Tt(s).forEach(c=>{i.insertRule(c,i.cssRules.length)})).catch(s=>{console.error("Error loading remote stylesheet",s)})),console.error("Error inlining remote css file",r)}}),Promise.all(o).then(()=>(e.forEach(a=>{if("cssRules"in a)try{$(a.cssRules||[]).forEach(r=>{n.push(r)})}catch(r){console.error(`Error while reading CSS rules from ${a.href}`,r)}}),n))}function Lr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Et(t.style.getPropertyValue("src")))}async function Tr(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=$(e.ownerDocument.styleSheets),o=await kr(n,t);return Lr(o)}function Rt(e){return e.trim().replace(/["']/g,"")}function Rr(e){const t=new Set;function n(o){(o.style.fontFamily||getComputedStyle(o).fontFamily).split(",").forEach(r=>{t.add(Rt(r))}),Array.from(o.children).forEach(r=>{r instanceof HTMLElement&&n(r)})}return n(e),t}async function Mt(e,t){const n=await Tr(e,t),o=Rr(e);return(await Promise.all(n.filter(r=>o.has(Rt(r.style.fontFamily))).map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return St(r.cssText,i,t)}))).join(`
722
+ `)}async function Mr(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Mt(e,t);if(n){const o=document.createElement("style"),a=document.createTextNode(n);o.appendChild(a),e.firstChild?e.insertBefore(o,e.firstChild):e.appendChild(o)}}async function Pt(e,t={}){const{width:n,height:o}=Ee(e,t),a=await te(e,t,!0);return await Mr(a,t),await Ct(a,t),Ar(a,t),await Go(a,n,o)}async function X(e,t={}){const{width:n,height:o}=Ee(e,t),a=await Pt(e,t),r=await ee(a),i=document.createElement("canvas"),s=i.getContext("2d"),c=t.pixelRatio||Vo(),u=t.canvasWidth||n,l=t.canvasHeight||o;return i.width=u*c,i.height=l*c,t.skipAutoScale||Wo(i),i.style.width=`${u}`,i.style.height=`${l}`,t.backgroundColor&&(s.fillStyle=t.backgroundColor,s.fillRect(0,0,i.width,i.height)),s.drawImage(r,0,0,i.width,i.height),i}async function Pr(e,t={}){const{width:n,height:o}=Ee(e,t);return(await X(e,t)).getContext("2d").getImageData(0,0,n,o).data}async function Ir(e,t={}){return(await X(e,t)).toDataURL()}async function Nr(e,t={}){return(await X(e,t)).toDataURL("image/jpeg",t.quality||1)}async function _r(e,t={}){const n=await X(e,t);return await Xo(n)}async function $r(e,t={}){return Mt(e,t)}const Dr=Object.freeze(Object.defineProperty({__proto__:null,getFontEmbedCSS:$r,toBlob:_r,toCanvas:X,toJpeg:Nr,toPixelData:Pr,toPng:Ir,toSvg:Pt},Symbol.toStringTag,{value:"Module"}));k.currentMonitorUrl=we,k.destroy=dt,k.domEle=Ve,k.domSS=Xe,k.errors=Ie,k.hide=Po,k.init=Mo,k.isMonitorActive=ye,k.isPluginFailure=We,k.liveMonitor=Ro,k.metadata=Re,k.off=pt,k.on=No,k.probe=Lo,k.show=ut,k.startMonitor=ge,k.status=Io,k.stopMonitor=V,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
723
723
  //# sourceMappingURL=beacon.umd.js.map