@sphoro/bugcatch-web-sdk 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(){"use strict";const He='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4 11.5a7.5 7 0 0 1 7.5-7h1a7.5 7 0 0 1 0 14H9l-4.2 2.6a.5.5 0 0 1-.76-.5l.5-3.1A7 7 0 0 1 4 11.5z"/><path d="M8.5 11.5h.01M12 11.5h.01M15.5 11.5h.01" stroke-width="2.6"/></svg>',Ie='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4.2"/><path d="M12 2.6v2.2M12 19.2v2.2M2.6 12h2.2M19.2 12h2.2M5.4 5.4l1.6 1.6M17 17l1.6 1.6M18.6 5.4L17 7M7 17l-1.6 1.6"/></svg>',Re='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M20 13.4A8.2 8.2 0 1 1 10.6 4a6.6 6.6 0 0 0 9.4 9.4z"/></svg>',Ae='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><rect x="2.8" y="4.4" width="18.4" height="12.6" rx="2.2"/><path d="M8.6 20.2h6.8"/><path d="M12 4.4v12.6"/><path d="M12 7.2a3.6 3.6 0 0 1 0 7.2z" fill="currentColor" stroke="none"/></svg>',Y='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 7.5v5.2M12 16.3h.01"/></svg>',X='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg>',W='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.8l4.6 4.4L19 7"/></svg>',pe='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 11v5.5M12 7.7h.01"/></svg>',De='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.3 4.2a2 2 0 0 1 3.4 0l7.6 13.1a2 2 0 0 1-1.7 3H4.4a2 2 0 0 1-1.7-3z"/><path d="M12 9.5v4.2M12 17h.01"/></svg>',Ve='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 8.5A1.5 1.5 0 0 1 4.5 7h2.2a1 1 0 0 0 .83-.45l.94-1.4A1 1 0 0 1 9.3 4.7h5.4a1 1 0 0 1 .83.45l.94 1.4a1 1 0 0 0 .83.45h2.2A1.5 1.5 0 0 1 21 8.5v9A1.5 1.5 0 0 1 19.5 19h-15A1.5 1.5 0 0 1 3 17.5z"/><circle cx="12" cy="13" r="3.4"/></svg>',je='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="6" width="12.5" height="12" rx="2.2"/><path d="M15.5 10.8l4.2-2.6a.6.6 0 0 1 .92.5v6.6a.6.6 0 0 1-.92.5l-4.2-2.6z"/></svg>',ue='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20 11.5l-7.6 7.6a4.6 4.6 0 0 1-6.5-6.5l8-8a3.2 3.2 0 0 1 4.5 4.5l-8 8a1.8 1.8 0 0 1-2.5-2.5l7.1-7.1"/></svg>',he='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="2.5" width="6" height="11" rx="3"/><path d="M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M9 21h6"/></svg>',be='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12l16-8-6 16-2.6-6.2L4 12Z"/></svg>',Oe='<svg viewBox="0 0 24 24" fill="currentColor"><rect x="7" y="7" width="10" height="10" rx="2"/></svg>',Be='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.5 5.5L8 12l6.5 6.5"/></svg>',J='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M6.2 3.5h3l1.5 3.7-2 1.4a11.5 11.5 0 0 0 5.7 5.7l1.4-2 3.7 1.5v3a1.8 1.8 0 0 1-2 1.8A15.6 15.6 0 0 1 4.4 5.5a1.8 1.8 0 0 1 1.8-2z"/></svg>',Ne='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 12a8 8 0 1 1-2.6-5.9M20 4v4.5h-4.5"/></svg>',Pe='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9.5 6l6 6-6 6"/></svg>',fe='<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.9l2.75 5.82 6.37.76-4.7 4.37 1.24 6.3L12 17.03l-5.66 3.12 1.24-6.3-4.7-4.37 6.37-.76z"/></svg>',We='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3.5 13.5l2.6-7.2A1.5 1.5 0 0 1 7.5 5.3h9a1.5 1.5 0 0 1 1.4 1L20.5 13.5V18a1.5 1.5 0 0 1-1.5 1.5H5A1.5 1.5 0 0 1 3.5 18z"/><path d="M3.5 13.5h4.8l1.2 2.2h5l1.2-2.2h4.8"/></svg>',Fe='<svg class="bc-brand" viewBox="0 0 254 60" fill="none" role="img" aria-label="sphoro BugCatch"><g fill="currentColor"><path transform="translate(0.00 40.00) scale(0.04000 -0.04000)" d="M276.00 -14.00Q179.00 -14.00 117.00 28.00Q55.00 70.00 42.00 148.00L158.00 178.00Q165.00 143.00 181.50 123.00Q198.00 103.00 222.50 94.50Q247.00 86.00 276.00 86.00Q320.00 86.00 341.00 101.50Q362.00 117.00 362.00 140.00Q362.00 163.00 342.00 175.50Q322.00 188.00 278.00 196.00L250.00 201.00Q198.00 211.00 155.00 228.50Q112.00 246.00 86.00 277.00Q60.00 308.00 60.00 357.00Q60.00 431.00 114.00 470.50Q168.00 510.00 256.00 510.00Q339.00 510.00 394.00 473.00Q449.00 436.00 466.00 376.00L349.00 340.00Q341.00 378.00 316.50 394.00Q292.00 410.00 256.00 410.00Q220.00 410.00 201.00 397.50Q182.00 385.00 182.00 363.00Q182.00 339.00 202.00 327.50Q222.00 316.00 256.00 310.00L284.00 305.00Q340.00 295.00 385.50 278.50Q431.00 262.00 457.50 231.50Q484.00 201.00 484.00 149.00Q484.00 71.00 427.50 28.50Q371.00 -14.00 276.00 -14.00Z"/><path transform="translate(19.56 40.00) scale(0.04000 -0.04000)" d="M70.00 -200.00V496.00H194.00V436.00H212.00Q229.00 465.00 265.00 487.50Q301.00 510.00 368.00 510.00Q428.00 510.00 479.00 480.50Q530.00 451.00 561.00 394.00Q592.00 337.00 592.00 256.00V240.00Q592.00 159.00 561.00 102.00Q530.00 45.00 479.00 15.50Q428.00 -14.00 368.00 -14.00Q323.00 -14.00 292.50 -3.50Q262.00 7.00 243.50 23.50Q225.00 40.00 214.00 57.00H196.00V-200.00ZM330.00 96.00Q389.00 96.00 427.50 133.50Q466.00 171.00 466.00 243.00V253.00Q466.00 325.00 427.00 362.50Q388.00 400.00 330.00 400.00Q272.00 400.00 233.00 362.50Q194.00 325.00 194.00 253.00V243.00Q194.00 171.00 233.00 133.50Q272.00 96.00 330.00 96.00Z"/><path transform="translate(43.68 40.00) scale(0.04000 -0.04000)" d="M70.00 0.00V700.00H196.00V435.00H214.00Q222.00 451.00 239.00 467.00Q256.00 483.00 284.50 493.50Q313.00 504.00 357.00 504.00Q415.00 504.00 458.50 477.50Q502.00 451.00 526.00 404.50Q550.00 358.00 550.00 296.00V0.00H424.00V286.00Q424.00 342.00 396.50 370.00Q369.00 398.00 318.00 398.00Q260.00 398.00 228.00 359.50Q196.00 321.00 196.00 252.00V0.00Z"/><path transform="translate(66.92 40.00) scale(0.04000 -0.04000)" d="M306.00 -14.00Q232.00 -14.00 173.00 16.00Q114.00 46.00 80.00 103.00Q46.00 160.00 46.00 240.00V256.00Q46.00 336.00 80.00 393.00Q114.00 450.00 173.00 480.00Q232.00 510.00 306.00 510.00Q380.00 510.00 439.00 480.00Q498.00 450.00 532.00 393.00Q566.00 336.00 566.00 256.00V240.00Q566.00 160.00 532.00 103.00Q498.00 46.00 439.00 16.00Q380.00 -14.00 306.00 -14.00ZM306.00 98.00Q364.00 98.00 402.00 135.50Q440.00 173.00 440.00 243.00V253.00Q440.00 323.00 402.50 360.50Q365.00 398.00 306.00 398.00Q248.00 398.00 210.00 360.50Q172.00 323.00 172.00 253.00V243.00Q172.00 173.00 210.00 135.50Q248.00 98.00 306.00 98.00Z"/><path transform="translate(90.00 40.00) scale(0.04000 -0.04000)" d="M70.00 0.00V496.00H194.00V440.00H212.00Q223.00 470.00 248.50 484.00Q274.00 498.00 308.00 498.00H368.00V386.00H306.00Q258.00 386.00 227.00 360.50Q196.00 335.00 196.00 282.00V0.00Z"/><path transform="translate(104.44 40.00) scale(0.04000 -0.04000)" d="M306.00 -14.00Q232.00 -14.00 173.00 16.00Q114.00 46.00 80.00 103.00Q46.00 160.00 46.00 240.00V256.00Q46.00 336.00 80.00 393.00Q114.00 450.00 173.00 480.00Q232.00 510.00 306.00 510.00Q380.00 510.00 439.00 480.00Q498.00 450.00 532.00 393.00Q566.00 336.00 566.00 256.00V240.00Q566.00 160.00 532.00 103.00Q498.00 46.00 439.00 16.00Q380.00 -14.00 306.00 -14.00ZM306.00 98.00Q364.00 98.00 402.00 135.50Q440.00 173.00 440.00 243.00V253.00Q440.00 323.00 402.50 360.50Q365.00 398.00 306.00 398.00Q248.00 398.00 210.00 360.50Q172.00 323.00 172.00 253.00V243.00Q172.00 173.00 210.00 135.50Q248.00 98.00 306.00 98.00Z"/></g><rect x="139.52" y="16" width="1.6" height="26" rx="0.8" fill="var(--bc-brand-mark, #5647ee)" opacity="0.4"/><g fill="var(--bc-brand-mark, #5647ee)"><path transform="translate(154.52 35.00) scale(0.01400 -0.01400)" d="M46.35 0.00V105.85H139.75V594.15H46.35V700.00H404.08Q467.38 700.00 514.79 678.41Q562.20 656.83 588.70 617.33Q615.20 577.83 615.20 523.35V513.70Q615.20 465.52 597.03 434.76Q578.85 404.00 553.91 387.24Q528.98 370.48 506.28 363.30V346.35Q528.98 340.35 555.24 323.50Q581.50 306.65 600.00 275.48Q618.50 244.30 618.50 194.48V184.48Q618.50 126.65 591.41 85.24Q564.33 43.83 516.83 21.91Q469.33 0.00 406.85 0.00ZM259.85 109.15H392.60Q441.20 109.15 469.80 132.60Q498.40 156.05 498.40 198.55V208.20Q498.40 250.70 470.21 274.15Q442.02 297.60 392.60 297.60H259.85ZM259.85 406.75H391.65Q437.55 406.75 466.32 430.11Q495.10 453.48 495.10 493.80V503.80Q495.10 544.95 466.74 567.90Q438.37 590.85 391.65 590.85H259.85Z"/><path transform="translate(167.00 35.00) scale(0.01400 -0.01400)" d="M335.30 -14.00Q251.22 -14.00 190.60 16.63Q129.97 47.25 97.56 104.96Q65.15 162.68 65.15 243.03V700.00H185.25V239.73Q185.25 170.48 224.03 131.99Q262.80 93.50 335.30 93.50Q407.80 93.50 446.57 131.99Q485.35 170.48 485.35 239.73V700.00H605.45V243.03Q605.45 162.68 573.13 104.96Q540.80 47.25 480.09 16.63Q419.38 -14.00 335.30 -14.00Z"/><path transform="translate(179.60 35.00) scale(0.01400 -0.01400)" d="M311.85 -14.00Q238.45 -14.00 179.69 18.50Q120.92 51.00 86.69 113.67Q52.45 176.35 52.45 266.87V433.13Q52.45 569.00 128.01 641.50Q203.57 714.00 332.35 714.00Q460.13 714.00 529.23 645.59Q598.33 577.17 598.33 460.87V456.70H479.87V464.52Q479.87 504.67 463.76 536.86Q447.65 569.05 414.99 587.77Q382.32 606.50 332.35 606.50Q257.63 606.50 215.09 560.70Q172.55 514.90 172.55 435.13V264.87Q172.55 185.93 215.09 138.89Q257.63 91.85 334.00 91.85Q410.02 91.85 445.12 132.83Q480.22 173.80 480.22 237.92V249.67H302.85V351.88H598.33V0.00H487.52V69.10H470.57Q462.70 50.87 446.06 31.44Q429.42 12.00 397.64 -1.00Q365.85 -14.00 311.85 -14.00Z"/><path transform="translate(192.05 35.00) scale(0.01400 -0.01400)" d="M332.35 -14.00Q203.57 -14.00 128.01 58.50Q52.45 131.00 52.45 266.87V433.13Q52.45 569.00 128.01 641.50Q203.57 714.00 332.35 714.00Q460.13 714.00 529.58 643.85Q599.03 573.70 599.03 451.57V445.75H480.57V455.22Q480.57 521.42 444.15 563.96Q407.72 606.50 332.35 606.50Q257.63 606.50 215.09 560.70Q172.55 514.90 172.55 435.13V264.87Q172.55 185.93 215.09 139.71Q257.63 93.50 332.35 93.50Q407.72 93.50 444.15 136.45Q480.57 179.40 480.57 244.78V262.25H599.03V248.43Q599.03 126.30 529.58 56.15Q460.13 -14.00 332.35 -14.00Z"/><path transform="translate(204.25 35.00) scale(0.01400 -0.01400)" d="M19.75 0.00 211.62 700.00H421.33L613.20 0.00H489.27L447.42 159.60H185.53L143.68 0.00ZM214.25 270.40H418.70L324.95 624.87H308.00Z"/><path transform="translate(216.31 35.00) scale(0.01400 -0.01400)" d="M233.95 0.00V590.85H24.70V700.00H563.30V590.85H354.05V0.00Z"/><path transform="translate(227.75 35.00) scale(0.01400 -0.01400)" d="M332.35 -14.00Q203.57 -14.00 128.01 58.50Q52.45 131.00 52.45 266.87V433.13Q52.45 569.00 128.01 641.50Q203.57 714.00 332.35 714.00Q460.13 714.00 529.58 643.85Q599.03 573.70 599.03 451.57V445.75H480.57V455.22Q480.57 521.42 444.15 563.96Q407.72 606.50 332.35 606.50Q257.63 606.50 215.09 560.70Q172.55 514.90 172.55 435.13V264.87Q172.55 185.93 215.09 139.71Q257.63 93.50 332.35 93.50Q407.72 93.50 444.15 136.45Q480.57 179.40 480.57 244.78V262.25H599.03V248.43Q599.03 126.30 529.58 56.15Q460.13 -14.00 332.35 -14.00Z"/><path transform="translate(239.95 35.00) scale(0.01400 -0.01400)" d="M69.50 0.00V700.00H189.60V405.58H466.40V700.00H586.50V0.00H466.40V296.42H189.60V0.00Z"/></g></svg>',Ye=`
1
+ (function(){"use strict";const Ie='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4 11.5a7.5 7 0 0 1 7.5-7h1a7.5 7 0 0 1 0 14H9l-4.2 2.6a.5.5 0 0 1-.76-.5l.5-3.1A7 7 0 0 1 4 11.5z"/><path d="M8.5 11.5h.01M12 11.5h.01M15.5 11.5h.01" stroke-width="2.6"/></svg>',De='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4.2"/><path d="M12 2.6v2.2M12 19.2v2.2M2.6 12h2.2M19.2 12h2.2M5.4 5.4l1.6 1.6M17 17l1.6 1.6M18.6 5.4L17 7M7 17l-1.6 1.6"/></svg>',je='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M20 13.4A8.2 8.2 0 1 1 10.6 4a6.6 6.6 0 0 0 9.4 9.4z"/></svg>',Ve='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><rect x="2.8" y="4.4" width="18.4" height="12.6" rx="2.2"/><path d="M8.6 20.2h6.8"/><path d="M12 4.4v12.6"/><path d="M12 7.2a3.6 3.6 0 0 1 0 7.2z" fill="currentColor" stroke="none"/></svg>',F='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 7.5v5.2M12 16.3h.01"/></svg>',J='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M6 6l12 12M18 6L6 18"/></svg>',O='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.8l4.6 4.4L19 7"/></svg>',ue='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 11v5.5M12 7.7h.01"/></svg>',Oe='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.3 4.2a2 2 0 0 1 3.4 0l7.6 13.1a2 2 0 0 1-1.7 3H4.4a2 2 0 0 1-1.7-3z"/><path d="M12 9.5v4.2M12 17h.01"/></svg>',Be='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 8.5A1.5 1.5 0 0 1 4.5 7h2.2a1 1 0 0 0 .83-.45l.94-1.4A1 1 0 0 1 9.3 4.7h5.4a1 1 0 0 1 .83.45l.94 1.4a1 1 0 0 0 .83.45h2.2A1.5 1.5 0 0 1 21 8.5v9A1.5 1.5 0 0 1 19.5 19h-15A1.5 1.5 0 0 1 3 17.5z"/><circle cx="12" cy="13" r="3.4"/></svg>',Ne='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="6" width="12.5" height="12" rx="2.2"/><path d="M15.5 10.8l4.2-2.6a.6.6 0 0 1 .92.5v6.6a.6.6 0 0 1-.92.5l-4.2-2.6z"/></svg>',he='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20 11.5l-7.6 7.6a4.6 4.6 0 0 1-6.5-6.5l8-8a3.2 3.2 0 0 1 4.5 4.5l-8 8a1.8 1.8 0 0 1-2.5-2.5l7.1-7.1"/></svg>',fe='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="2.5" width="6" height="11" rx="3"/><path d="M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21M9 21h6"/></svg>',be='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12l16-8-6 16-2.6-6.2L4 12Z"/></svg>',We='<svg viewBox="0 0 24 24" fill="currentColor"><rect x="7" y="7" width="10" height="10" rx="2"/></svg>',Pe='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.5 5.5L8 12l6.5 6.5"/></svg>',ee='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M6.2 3.5h3l1.5 3.7-2 1.4a11.5 11.5 0 0 0 5.7 5.7l1.4-2 3.7 1.5v3a1.8 1.8 0 0 1-2 1.8A15.6 15.6 0 0 1 4.4 5.5a1.8 1.8 0 0 1 1.8-2z"/></svg>',Ye='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 12a8 8 0 1 1-2.6-5.9M20 4v4.5h-4.5"/></svg>',Fe='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9.5 6l6 6-6 6"/></svg>',ge='<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.9l2.75 5.82 6.37.76-4.7 4.37 1.24 6.3L12 17.03l-5.66 3.12 1.24-6.3-4.7-4.37 6.37-.76z"/></svg>',_e='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3.5 13.5l2.6-7.2A1.5 1.5 0 0 1 7.5 5.3h9a1.5 1.5 0 0 1 1.4 1L20.5 13.5V18a1.5 1.5 0 0 1-1.5 1.5H5A1.5 1.5 0 0 1 3.5 18z"/><path d="M3.5 13.5h4.8l1.2 2.2h5l1.2-2.2h4.8"/></svg>',Ke='<svg class="bc-brand" viewBox="0 0 254 60" fill="none" role="img" aria-label="sphoro BugCatch"><g fill="currentColor"><path transform="translate(0.00 40.00) scale(0.04000 -0.04000)" d="M276.00 -14.00Q179.00 -14.00 117.00 28.00Q55.00 70.00 42.00 148.00L158.00 178.00Q165.00 143.00 181.50 123.00Q198.00 103.00 222.50 94.50Q247.00 86.00 276.00 86.00Q320.00 86.00 341.00 101.50Q362.00 117.00 362.00 140.00Q362.00 163.00 342.00 175.50Q322.00 188.00 278.00 196.00L250.00 201.00Q198.00 211.00 155.00 228.50Q112.00 246.00 86.00 277.00Q60.00 308.00 60.00 357.00Q60.00 431.00 114.00 470.50Q168.00 510.00 256.00 510.00Q339.00 510.00 394.00 473.00Q449.00 436.00 466.00 376.00L349.00 340.00Q341.00 378.00 316.50 394.00Q292.00 410.00 256.00 410.00Q220.00 410.00 201.00 397.50Q182.00 385.00 182.00 363.00Q182.00 339.00 202.00 327.50Q222.00 316.00 256.00 310.00L284.00 305.00Q340.00 295.00 385.50 278.50Q431.00 262.00 457.50 231.50Q484.00 201.00 484.00 149.00Q484.00 71.00 427.50 28.50Q371.00 -14.00 276.00 -14.00Z"/><path transform="translate(19.56 40.00) scale(0.04000 -0.04000)" d="M70.00 -200.00V496.00H194.00V436.00H212.00Q229.00 465.00 265.00 487.50Q301.00 510.00 368.00 510.00Q428.00 510.00 479.00 480.50Q530.00 451.00 561.00 394.00Q592.00 337.00 592.00 256.00V240.00Q592.00 159.00 561.00 102.00Q530.00 45.00 479.00 15.50Q428.00 -14.00 368.00 -14.00Q323.00 -14.00 292.50 -3.50Q262.00 7.00 243.50 23.50Q225.00 40.00 214.00 57.00H196.00V-200.00ZM330.00 96.00Q389.00 96.00 427.50 133.50Q466.00 171.00 466.00 243.00V253.00Q466.00 325.00 427.00 362.50Q388.00 400.00 330.00 400.00Q272.00 400.00 233.00 362.50Q194.00 325.00 194.00 253.00V243.00Q194.00 171.00 233.00 133.50Q272.00 96.00 330.00 96.00Z"/><path transform="translate(43.68 40.00) scale(0.04000 -0.04000)" d="M70.00 0.00V700.00H196.00V435.00H214.00Q222.00 451.00 239.00 467.00Q256.00 483.00 284.50 493.50Q313.00 504.00 357.00 504.00Q415.00 504.00 458.50 477.50Q502.00 451.00 526.00 404.50Q550.00 358.00 550.00 296.00V0.00H424.00V286.00Q424.00 342.00 396.50 370.00Q369.00 398.00 318.00 398.00Q260.00 398.00 228.00 359.50Q196.00 321.00 196.00 252.00V0.00Z"/><path transform="translate(66.92 40.00) scale(0.04000 -0.04000)" d="M306.00 -14.00Q232.00 -14.00 173.00 16.00Q114.00 46.00 80.00 103.00Q46.00 160.00 46.00 240.00V256.00Q46.00 336.00 80.00 393.00Q114.00 450.00 173.00 480.00Q232.00 510.00 306.00 510.00Q380.00 510.00 439.00 480.00Q498.00 450.00 532.00 393.00Q566.00 336.00 566.00 256.00V240.00Q566.00 160.00 532.00 103.00Q498.00 46.00 439.00 16.00Q380.00 -14.00 306.00 -14.00ZM306.00 98.00Q364.00 98.00 402.00 135.50Q440.00 173.00 440.00 243.00V253.00Q440.00 323.00 402.50 360.50Q365.00 398.00 306.00 398.00Q248.00 398.00 210.00 360.50Q172.00 323.00 172.00 253.00V243.00Q172.00 173.00 210.00 135.50Q248.00 98.00 306.00 98.00Z"/><path transform="translate(90.00 40.00) scale(0.04000 -0.04000)" d="M70.00 0.00V496.00H194.00V440.00H212.00Q223.00 470.00 248.50 484.00Q274.00 498.00 308.00 498.00H368.00V386.00H306.00Q258.00 386.00 227.00 360.50Q196.00 335.00 196.00 282.00V0.00Z"/><path transform="translate(104.44 40.00) scale(0.04000 -0.04000)" d="M306.00 -14.00Q232.00 -14.00 173.00 16.00Q114.00 46.00 80.00 103.00Q46.00 160.00 46.00 240.00V256.00Q46.00 336.00 80.00 393.00Q114.00 450.00 173.00 480.00Q232.00 510.00 306.00 510.00Q380.00 510.00 439.00 480.00Q498.00 450.00 532.00 393.00Q566.00 336.00 566.00 256.00V240.00Q566.00 160.00 532.00 103.00Q498.00 46.00 439.00 16.00Q380.00 -14.00 306.00 -14.00ZM306.00 98.00Q364.00 98.00 402.00 135.50Q440.00 173.00 440.00 243.00V253.00Q440.00 323.00 402.50 360.50Q365.00 398.00 306.00 398.00Q248.00 398.00 210.00 360.50Q172.00 323.00 172.00 253.00V243.00Q172.00 173.00 210.00 135.50Q248.00 98.00 306.00 98.00Z"/></g><rect x="139.52" y="16" width="1.6" height="26" rx="0.8" fill="var(--bc-brand-mark, #5647ee)" opacity="0.4"/><g fill="var(--bc-brand-mark, #5647ee)"><path transform="translate(154.52 35.00) scale(0.01400 -0.01400)" d="M46.35 0.00V105.85H139.75V594.15H46.35V700.00H404.08Q467.38 700.00 514.79 678.41Q562.20 656.83 588.70 617.33Q615.20 577.83 615.20 523.35V513.70Q615.20 465.52 597.03 434.76Q578.85 404.00 553.91 387.24Q528.98 370.48 506.28 363.30V346.35Q528.98 340.35 555.24 323.50Q581.50 306.65 600.00 275.48Q618.50 244.30 618.50 194.48V184.48Q618.50 126.65 591.41 85.24Q564.33 43.83 516.83 21.91Q469.33 0.00 406.85 0.00ZM259.85 109.15H392.60Q441.20 109.15 469.80 132.60Q498.40 156.05 498.40 198.55V208.20Q498.40 250.70 470.21 274.15Q442.02 297.60 392.60 297.60H259.85ZM259.85 406.75H391.65Q437.55 406.75 466.32 430.11Q495.10 453.48 495.10 493.80V503.80Q495.10 544.95 466.74 567.90Q438.37 590.85 391.65 590.85H259.85Z"/><path transform="translate(167.00 35.00) scale(0.01400 -0.01400)" d="M335.30 -14.00Q251.22 -14.00 190.60 16.63Q129.97 47.25 97.56 104.96Q65.15 162.68 65.15 243.03V700.00H185.25V239.73Q185.25 170.48 224.03 131.99Q262.80 93.50 335.30 93.50Q407.80 93.50 446.57 131.99Q485.35 170.48 485.35 239.73V700.00H605.45V243.03Q605.45 162.68 573.13 104.96Q540.80 47.25 480.09 16.63Q419.38 -14.00 335.30 -14.00Z"/><path transform="translate(179.60 35.00) scale(0.01400 -0.01400)" d="M311.85 -14.00Q238.45 -14.00 179.69 18.50Q120.92 51.00 86.69 113.67Q52.45 176.35 52.45 266.87V433.13Q52.45 569.00 128.01 641.50Q203.57 714.00 332.35 714.00Q460.13 714.00 529.23 645.59Q598.33 577.17 598.33 460.87V456.70H479.87V464.52Q479.87 504.67 463.76 536.86Q447.65 569.05 414.99 587.77Q382.32 606.50 332.35 606.50Q257.63 606.50 215.09 560.70Q172.55 514.90 172.55 435.13V264.87Q172.55 185.93 215.09 138.89Q257.63 91.85 334.00 91.85Q410.02 91.85 445.12 132.83Q480.22 173.80 480.22 237.92V249.67H302.85V351.88H598.33V0.00H487.52V69.10H470.57Q462.70 50.87 446.06 31.44Q429.42 12.00 397.64 -1.00Q365.85 -14.00 311.85 -14.00Z"/><path transform="translate(192.05 35.00) scale(0.01400 -0.01400)" d="M332.35 -14.00Q203.57 -14.00 128.01 58.50Q52.45 131.00 52.45 266.87V433.13Q52.45 569.00 128.01 641.50Q203.57 714.00 332.35 714.00Q460.13 714.00 529.58 643.85Q599.03 573.70 599.03 451.57V445.75H480.57V455.22Q480.57 521.42 444.15 563.96Q407.72 606.50 332.35 606.50Q257.63 606.50 215.09 560.70Q172.55 514.90 172.55 435.13V264.87Q172.55 185.93 215.09 139.71Q257.63 93.50 332.35 93.50Q407.72 93.50 444.15 136.45Q480.57 179.40 480.57 244.78V262.25H599.03V248.43Q599.03 126.30 529.58 56.15Q460.13 -14.00 332.35 -14.00Z"/><path transform="translate(204.25 35.00) scale(0.01400 -0.01400)" d="M19.75 0.00 211.62 700.00H421.33L613.20 0.00H489.27L447.42 159.60H185.53L143.68 0.00ZM214.25 270.40H418.70L324.95 624.87H308.00Z"/><path transform="translate(216.31 35.00) scale(0.01400 -0.01400)" d="M233.95 0.00V590.85H24.70V700.00H563.30V590.85H354.05V0.00Z"/><path transform="translate(227.75 35.00) scale(0.01400 -0.01400)" d="M332.35 -14.00Q203.57 -14.00 128.01 58.50Q52.45 131.00 52.45 266.87V433.13Q52.45 569.00 128.01 641.50Q203.57 714.00 332.35 714.00Q460.13 714.00 529.58 643.85Q599.03 573.70 599.03 451.57V445.75H480.57V455.22Q480.57 521.42 444.15 563.96Q407.72 606.50 332.35 606.50Q257.63 606.50 215.09 560.70Q172.55 514.90 172.55 435.13V264.87Q172.55 185.93 215.09 139.71Q257.63 93.50 332.35 93.50Q407.72 93.50 444.15 136.45Q480.57 179.40 480.57 244.78V262.25H599.03V248.43Q599.03 126.30 529.58 56.15Q460.13 -14.00 332.35 -14.00Z"/><path transform="translate(239.95 35.00) scale(0.01400 -0.01400)" d="M69.50 0.00V700.00H189.60V405.58H466.40V700.00H586.50V0.00H466.40V296.42H189.60V0.00Z"/></g></svg>',Ue=`
2
2
  @keyframes bc-fade-in { from { opacity: 0 } to { opacity: 1 } }
3
3
  @keyframes bc-fade-out { to { opacity: 0 } }
4
4
  @keyframes bc-panel-in { from { opacity: 0; transform: translateY(14px) scale(.965) } to { opacity: 1; transform: none } }
@@ -821,6 +821,34 @@ button.quiet:hover { color: var(--bc-fg); text-decoration-color: color-mix(in sr
821
821
  .history .sub .rated svg { width: 11px; height: 11px; color: #f0a81c; }
822
822
  .history .sub .rate-ask { color: var(--bc-fg); font-weight: 600; }
823
823
 
824
+ /* ---------- a settled report waiting for its rating ----------
825
+ Above the form on the first screen: the same stars as under a report's
826
+ conversation, with the report they are about named on top. */
827
+ .rate-due { margin: 0 0 14px; }
828
+ .rate-due:focus { outline: none; }
829
+ .rate-due:focus-visible { box-shadow: var(--bc-ring); }
830
+ .rate-due .rd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
831
+ .rate-due .rd-eyebrow {
832
+ font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--bc-faint);
833
+ }
834
+ .rate-due.is-required .rd-eyebrow { color: var(--bc-fg); }
835
+ .rate-due .rd-later { font-size: var(--bc-fs-xs); color: var(--bc-muted); }
836
+ .rate-due .rd-report {
837
+ display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 9px; align-items: center;
838
+ margin: 0 0 10px; padding: 0 0 10px; border-bottom: 1px solid var(--bc-border);
839
+ }
840
+ .rate-due .rd-ico {
841
+ grid-row: span 2; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 999px;
842
+ background: color-mix(in srgb, var(--bc-ok) 14%, transparent); color: var(--bc-ok);
843
+ }
844
+ .rate-due .rd-ico svg { width: 13px; height: 13px; }
845
+ .rate-due .rd-ttl { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
846
+ .rate-due .rd-sub { font-size: var(--bc-fs-xs); color: var(--bc-muted); }
847
+
848
+ /* What a required rating is holding: still in sight, plainly not yet. */
849
+ .held { opacity: .42; transition: opacity 200ms ease; }
850
+ @media (prefers-reduced-motion: reduce) { .held { transition: none; } }
851
+
824
852
  /* A call in progress, in place of the form.
825
853
  ---------------------------------------------------------------------------
826
854
  Deliberately not styled as a chat. Nothing arrives here to read — the
@@ -1003,28 +1031,28 @@ div.done { padding: 44px 26px 44px; text-align: center; animation: bc-fade-in 24
1003
1031
  @media (hover: none) {
1004
1032
  .tool:hover:not(:disabled) { transform: none; }
1005
1033
  }
1006
- `;function re({title:e,sub:t,id:a="",back:h=!1,theme:i=""}){return`
1034
+ `;function re({title:e,sub:t,id:a="",back:r=!1,theme:s=""}){return`
1007
1035
  <div class="head">
1008
- ${h?`<button class="icon-btn back" type="button" data-act="back" aria-label="Back to your reports">${Be}</button>`:""}
1036
+ ${r?`<button class="icon-btn back" type="button" data-act="back" aria-label="Back to your reports">${Pe}</button>`:""}
1009
1037
  <span class="orb mark" aria-hidden="true"></span>
1010
1038
  <div class="titles">
1011
- <h2${a?` id="${a}"`:""}>${$(e)}</h2>
1012
- <p>${$(t)}</p>
1039
+ <h2${a?` id="${a}"`:""}>${k(e)}</h2>
1040
+ <p>${k(t)}</p>
1013
1041
  </div>
1014
- ${i?`<button class="icon-btn theme" type="button" data-act="theme" title="Theme: ${$(i)}"
1015
- aria-label="Theme: ${$(i)}. Change theme"><span class="m-light">${Ie}</span><span class="m-dark">${Re}</span><span class="m-auto">${Ae}</span></button>`:""}
1016
- <button class="icon-btn" type="button" data-act="close" aria-label="Close">${X}</button>
1017
- </div>`}function ie(e,t){return`<div class="empty"><span class="empty-ico" aria-hidden="true">${t}</span>${$(e)}</div>`}function _e(e){return Array.from({length:e},()=>`
1042
+ ${s?`<button class="icon-btn theme" type="button" data-act="theme" title="Theme: ${k(s)}"
1043
+ aria-label="Theme: ${k(s)}. Change theme"><span class="m-light">${De}</span><span class="m-dark">${je}</span><span class="m-auto">${Ve}</span></button>`:""}
1044
+ <button class="icon-btn" type="button" data-act="close" aria-label="Close">${J}</button>
1045
+ </div>`}function ie(e,t){return`<div class="empty"><span class="empty-ico" aria-hidden="true">${t}</span>${k(e)}</div>`}function Ze(e){return Array.from({length:e},()=>`
1018
1046
  <div class="row" aria-hidden="true">
1019
1047
  <span class="row-ico"></span>
1020
1048
  <span class="who"><span class="skel" style="width:70%"></span><span class="skel" style="width:40%;height:9px"></span></span>
1021
- </div>`).join("")+'<span class="sr-only">Loading…</span>'}function Ke(){return`
1049
+ </div>`).join("")+'<span class="sr-only">Loading…</span>'}function Ge(){return`
1022
1050
  <div aria-hidden="true" style="display:flex;flex-direction:column;gap:10px;padding-top:6px">
1023
1051
  <span class="skel" style="width:42%;height:34px;border-radius:16px;align-self:center"></span>
1024
1052
  <span class="skel" style="width:66%;height:52px;border-radius:18px"></span>
1025
1053
  <span class="skel" style="width:48%;height:38px;border-radius:18px;align-self:flex-end"></span>
1026
1054
  </div>
1027
- <span class="sr-only">Loading…</span>`}function Ue(e){const t=String(e).trim().split(/\s+/).filter(Boolean);return t.length?(t[0][0]+(t.length>1?t[t.length-1][0]:"")).toUpperCase():"?"}function K(e){const t=new Date(e);return Number.isFinite(t.getTime())?`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`:null}function Ze(e){const t=new Date(e),a=new Date,h=new Date(a.getFullYear(),a.getMonth(),a.getDate()-1);if(K(t)===K(a))return"Today";if(K(t)===K(h))return"Yesterday";try{return t.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short",...t.getFullYear()!==a.getFullYear()?{year:"numeric"}:{}})}catch{return ee(e)}}function ge(e){const t=new Date(e);if(!Number.isFinite(t.getTime()))return"";try{return t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}catch{return""}}function me(e){return e.scrollHeight-e.scrollTop-e.clientHeight<40}function U(e,{smooth:t=!1}={}){const a=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;t&&!a&&e.scrollTo?e.scrollTo({top:e.scrollHeight,behavior:"smooth"}):e.scrollTop=e.scrollHeight}function se(e){return{OPEN:"Open",IN_PROGRESS:"In progress",RESOLVED:"Fixed",CLOSED:"Closed"}[e]||String(e||"").toLowerCase()}function ee(e){const t=new Date(e).getTime();if(!Number.isFinite(t))return"";const a=Math.floor((Date.now()-t)/864e5);if(a<=0)return"today";if(a===1)return"yesterday";if(a<30)return`${a} days ago`;const h=Math.floor(a/30);return h===1?"a month ago":`${h} months ago`}function $(e){return String(e).replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}typeof window<"u"&&window.fetch&&window.fetch.bind(window);const ve=["image/png","image/jpeg","image/webp","image/gif","video/webm","video/mp4","audio/webm","audio/ogg","audio/mpeg","audio/mp4","audio/wav","application/pdf","text/plain","text/csv","application/json","application/zip","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],xe=["image/png","image/jpeg","image/webp","video/webm","video/mp4"],Ge=()=>{var e;return!!((e=navigator==null?void 0:navigator.mediaDevices)!=null&&e.getUserMedia&&typeof MediaRecorder<"u")},Xe=()=>{var e;return!!((e=navigator==null?void 0:navigator.mediaDevices)!=null&&e.getDisplayMedia&&typeof MediaRecorder<"u")},Je=()=>{var e;return!!((e=navigator==null?void 0:navigator.mediaDevices)!=null&&e.getDisplayMedia)};function et(e,t=ve){const a=String(e||"").split(";")[0].trim().toLowerCase();return t.includes(a)?a:null}async function tt(){const e=await navigator.mediaDevices.getDisplayMedia({video:{frameRate:1},audio:!1});try{const t=e.getVideoTracks()[0],a=document.createElement("video");a.srcObject=e,a.muted=!0,a.playsInline=!0,await a.play(),await new Promise(s=>requestAnimationFrame(()=>requestAnimationFrame(s)));const{width:h,height:i}=t.getSettings(),v=document.createElement("canvas");v.width=h||a.videoWidth,v.height=i||a.videoHeight,v.getContext("2d").drawImage(a,0,0,v.width,v.height);const x=await new Promise(s=>v.toBlob(s,"image/png"));if(!x)throw new Error("The browser returned an empty screenshot.");return{blob:x,mime:"image/png",kind:"SCREENSHOT"}}finally{e.getTracks().forEach(t=>t.stop())}}async function at({maxMs:e=12e4,onTick:t,onAutoStop:a}={}){const h=await navigator.mediaDevices.getDisplayMedia({video:{frameRate:15},audio:!1}),i=["video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"].find(l=>MediaRecorder.isTypeSupported(l))||"video/webm",v=new MediaRecorder(h,{mimeType:i,videoBitsPerSecond:25e5}),x=[];v.ondataavailable=l=>{l.data.size&&x.push(l.data)},v.start(1e3);const s=Date.now(),y=setInterval(()=>t==null?void 0:t(Math.floor((Date.now()-s)/1e3)),500),p=()=>{clearInterval(y),clearTimeout(r),h.getTracks().forEach(l=>l.stop())},b=new Promise(l=>{v.onstop=()=>{p(),l(new Blob(x,{type:i}))}}),E=()=>{v.state!=="inactive"&&v.stop(),a==null||a()};h.getVideoTracks()[0].addEventListener("ended",E);const r=setTimeout(E,e);return{mime:i,maxMs:e,async stop(){return clearTimeout(r),v.state!=="inactive"&&v.stop(),{blob:await b,mime:i,kind:"VIDEO"}},cancel(){p(),v.state!=="inactive"&&v.stop()}}}async function nt({maxMs:e=12e4,onTick:t,onAutoStop:a}={}){const h=await navigator.mediaDevices.getUserMedia({audio:!0}),i=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg"].find(l=>MediaRecorder.isTypeSupported(l))||"",v=new MediaRecorder(h,i?{mimeType:i}:void 0),x=[];v.ondataavailable=l=>{l.data.size&&x.push(l.data)},v.start(1e3);const s=Date.now(),y=setInterval(()=>t==null?void 0:t(Math.floor((Date.now()-s)/1e3)),500),p=()=>{clearInterval(y),clearTimeout(r),h.getTracks().forEach(l=>l.stop())},b=new Promise(l=>{v.onstop=()=>{p(),l(new Blob(x,{type:v.mimeType||i}))}}),r=setTimeout(()=>{v.state!=="inactive"&&v.stop(),a==null||a()},e);return{mime:v.mimeType||i,maxMs:e,async stop(){clearTimeout(r),v.state!=="inactive"&&v.stop();const l=await b;return{blob:l,mime:l.type||v.mimeType||i,kind:"AUDIO"}},cancel(){p(),v.state!=="inactive"&&v.stop()}}}function _(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function te(e){const t=Math.floor(e/60),a=e%60;return`${t}:${String(a).padStart(2,"0")}`}const ot=7*24*60*60*1e3;let ae;function rt(){return ae||(ae=new Promise((e,t)=>{const a=indexedDB.open("bugcatch-drafts",1);a.onupgradeneeded=()=>a.result.createObjectStore("drafts"),a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error),a.onblocked=()=>t(new Error("Draft storage is blocked."))}).catch(e=>{throw ae=null,e})),ae}function it(e,t){var a,h;return JSON.stringify([e.apiBase,e.projectId,t||((a=e.user)==null?void 0:a.email)||((h=e.user)==null?void 0:h.id)||"anonymous"])}async function ne(e,t){const a=await rt();return new Promise((h,i)=>{const v=a.transaction("drafts",t===void 0?"readonly":"readwrite"),x=v.objectStore("drafts"),s=t===void 0?x.get(e):t===null?x.delete(e):x.put({...t,savedAt:Date.now()},e);v.oncomplete=()=>h(s.result),v.onerror=()=>i(v.error),v.onabort=()=>i(v.error||new Error("Draft was not saved."))})}async function st(e){const t=await ne(e);return t&&Date.now()-t.savedAt>ot?(await ne(e,null),null):t||null}const ye=[{value:"LOW",label:"Low"},{value:"MEDIUM",label:"Medium"},{value:"HIGH",label:"High"},{value:"CRITICAL",label:"Critical"}],we="MEDIUM";function lt(e){const t=e.attachments!==!1,a=t&&Je(),h=t&&Xe();return`
1055
+ <span class="sr-only">Loading…</span>`}function Xe(e){const t=String(e).trim().split(/\s+/).filter(Boolean);return t.length?(t[0][0]+(t.length>1?t[t.length-1][0]:"")).toUpperCase():"?"}function K(e){const t=new Date(e);return Number.isFinite(t.getTime())?`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`:null}function Je(e){const t=new Date(e),a=new Date,r=new Date(a.getFullYear(),a.getMonth(),a.getDate()-1);if(K(t)===K(a))return"Today";if(K(t)===K(r))return"Yesterday";try{return t.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short",...t.getFullYear()!==a.getFullYear()?{year:"numeric"}:{}})}catch{return Z(e)}}function me(e){const t=new Date(e);if(!Number.isFinite(t.getTime()))return"";try{return t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}catch{return""}}function ve(e){return e.scrollHeight-e.scrollTop-e.clientHeight<40}function U(e,{smooth:t=!1}={}){const a=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;t&&!a&&e.scrollTo?e.scrollTo({top:e.scrollHeight,behavior:"smooth"}):e.scrollTop=e.scrollHeight}function se(e){return{OPEN:"Open",IN_PROGRESS:"In progress",RESOLVED:"Fixed",CLOSED:"Closed"}[e]||String(e||"").toLowerCase()}function Z(e){const t=new Date(e).getTime();if(!Number.isFinite(t))return"";const a=Math.floor((Date.now()-t)/864e5);if(a<=0)return"today";if(a===1)return"yesterday";if(a<30)return`${a} days ago`;const r=Math.floor(a/30);return r===1?"a month ago":`${r} months ago`}function k(e){return String(e).replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}typeof window<"u"&&window.fetch&&window.fetch.bind(window);const we=["image/png","image/jpeg","image/webp","image/gif","video/webm","video/mp4","audio/webm","audio/ogg","audio/mpeg","audio/mp4","audio/wav","application/pdf","text/plain","text/csv","application/json","application/zip","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],ye=["image/png","image/jpeg","image/webp","video/webm","video/mp4"],et=()=>{var e;return!!((e=navigator==null?void 0:navigator.mediaDevices)!=null&&e.getUserMedia&&typeof MediaRecorder<"u")},tt=()=>{var e;return!!((e=navigator==null?void 0:navigator.mediaDevices)!=null&&e.getDisplayMedia&&typeof MediaRecorder<"u")},at=()=>{var e;return!!((e=navigator==null?void 0:navigator.mediaDevices)!=null&&e.getDisplayMedia)};function nt(e,t=we){const a=String(e||"").split(";")[0].trim().toLowerCase();return t.includes(a)?a:null}async function ot(){const e=await navigator.mediaDevices.getDisplayMedia({video:{frameRate:1},audio:!1});try{const t=e.getVideoTracks()[0],a=document.createElement("video");a.srcObject=e,a.muted=!0,a.playsInline=!0,await a.play(),await new Promise(c=>requestAnimationFrame(()=>requestAnimationFrame(c)));const{width:r,height:s}=t.getSettings(),h=document.createElement("canvas");h.width=r||a.videoWidth,h.height=s||a.videoHeight,h.getContext("2d").drawImage(a,0,0,h.width,h.height);const b=await new Promise(c=>h.toBlob(c,"image/png"));if(!b)throw new Error("The browser returned an empty screenshot.");return{blob:b,mime:"image/png",kind:"SCREENSHOT"}}finally{e.getTracks().forEach(t=>t.stop())}}async function rt({maxMs:e=12e4,onTick:t,onAutoStop:a}={}){const r=await navigator.mediaDevices.getDisplayMedia({video:{frameRate:15},audio:!1}),s=["video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"].find(d=>MediaRecorder.isTypeSupported(d))||"video/webm",h=new MediaRecorder(r,{mimeType:s,videoBitsPerSecond:25e5}),b=[];h.ondataavailable=d=>{d.data.size&&b.push(d.data)},h.start(1e3);const c=Date.now(),m=setInterval(()=>t==null?void 0:t(Math.floor((Date.now()-c)/1e3)),500),u=()=>{clearInterval(m),clearTimeout(i),r.getTracks().forEach(d=>d.stop())},f=new Promise(d=>{h.onstop=()=>{u(),d(new Blob(b,{type:s}))}}),S=()=>{h.state!=="inactive"&&h.stop(),a==null||a()};r.getVideoTracks()[0].addEventListener("ended",S);const i=setTimeout(S,e);return{mime:s,maxMs:e,async stop(){return clearTimeout(i),h.state!=="inactive"&&h.stop(),{blob:await f,mime:s,kind:"VIDEO"}},cancel(){u(),h.state!=="inactive"&&h.stop()}}}async function it({maxMs:e=12e4,onTick:t,onAutoStop:a}={}){const r=await navigator.mediaDevices.getUserMedia({audio:!0}),s=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg"].find(d=>MediaRecorder.isTypeSupported(d))||"",h=new MediaRecorder(r,s?{mimeType:s}:void 0),b=[];h.ondataavailable=d=>{d.data.size&&b.push(d.data)},h.start(1e3);const c=Date.now(),m=setInterval(()=>t==null?void 0:t(Math.floor((Date.now()-c)/1e3)),500),u=()=>{clearInterval(m),clearTimeout(i),r.getTracks().forEach(d=>d.stop())},f=new Promise(d=>{h.onstop=()=>{u(),d(new Blob(b,{type:h.mimeType||s}))}}),i=setTimeout(()=>{h.state!=="inactive"&&h.stop(),a==null||a()},e);return{mime:h.mimeType||s,maxMs:e,async stop(){clearTimeout(i),h.state!=="inactive"&&h.stop();const d=await f;return{blob:d,mime:d.type||h.mimeType||s,kind:"AUDIO"}},cancel(){u(),h.state!=="inactive"&&h.stop()}}}function _(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function te(e){const t=Math.floor(e/60),a=e%60;return`${t}:${String(a).padStart(2,"0")}`}const st=7*24*60*60*1e3;let ae;function lt(){return ae||(ae=new Promise((e,t)=>{const a=indexedDB.open("bugcatch-drafts",1);a.onupgradeneeded=()=>a.result.createObjectStore("drafts"),a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error),a.onblocked=()=>t(new Error("Draft storage is blocked."))}).catch(e=>{throw ae=null,e})),ae}function ct(e,t){var a,r;return JSON.stringify([e.apiBase,e.projectId,t||((a=e.user)==null?void 0:a.email)||((r=e.user)==null?void 0:r.id)||"anonymous"])}async function ne(e,t){const a=await lt();return new Promise((r,s)=>{const h=a.transaction("drafts",t===void 0?"readonly":"readwrite"),b=h.objectStore("drafts"),c=t===void 0?b.get(e):t===null?b.delete(e):b.put({...t,savedAt:Date.now()},e);h.oncomplete=()=>r(c.result),h.onerror=()=>s(h.error),h.onabort=()=>s(h.error||new Error("Draft was not saved."))})}async function dt(e){const t=await ne(e);return t&&Date.now()-t.savedAt>st?(await ne(e,null),null):t||null}const xe=[{value:"LOW",label:"Low"},{value:"MEDIUM",label:"Medium"},{value:"HIGH",label:"High"},{value:"CRITICAL",label:"Critical"}],ke="MEDIUM";function pt(e){const t=e.attachments!==!1,a=t&&at(),r=t&&tt();return`
1028
1056
  <div class="compose">
1029
1057
  <div class="field">
1030
1058
  <label for="bc-title">What went wrong?</label>
@@ -1044,8 +1072,8 @@ div.done { padding: 44px 26px 44px; text-align: center; animation: bc-fade-in 24
1044
1072
  <div class="field">
1045
1073
  <label id="bc-prio-l">How much is it getting in your way?</label>
1046
1074
  <div class="seg" role="group" aria-labelledby="bc-prio-l">
1047
- ${ye.map(i=>`
1048
- <button type="button" data-prio="${i.value}" aria-pressed="${i.value===we}">${i.label}</button>
1075
+ ${xe.map(s=>`
1076
+ <button type="button" data-prio="${s.value}" aria-pressed="${s.value===ke}">${s.label}</button>
1049
1077
  `).join("")}
1050
1078
  </div>
1051
1079
  </div>
@@ -1056,233 +1084,246 @@ div.done { padding: 44px 26px 44px; text-align: center; animation: bc-fade-in 24
1056
1084
  <span class="count" aria-live="polite"></span>
1057
1085
  </div>
1058
1086
  <div class="tools" role="group" aria-labelledby="bc-att-l">
1059
- ${a?`<button class="tool" type="button" data-act="shot">${Ve}Screenshot</button>`:""}
1060
- ${h?`<button class="tool" type="button" data-act="rec">${je}Record screen</button>`:""}
1061
- <button class="tool" type="button" data-act="file">${ue}Upload file</button>
1087
+ ${a?`<button class="tool" type="button" data-act="shot">${Be}Screenshot</button>`:""}
1088
+ ${r?`<button class="tool" type="button" data-act="rec">${Ne}Record screen</button>`:""}
1089
+ <button class="tool" type="button" data-act="file">${he}Upload file</button>
1062
1090
  </div>
1063
1091
  <div class="thumbs"></div>
1064
- <input type="file" accept="${xe.join(",")}" multiple hidden />
1092
+ <input type="file" accept="${ye.join(",")}" multiple hidden />
1065
1093
  </div>`:""}
1066
- </div>`}function ct(e){var de,Z,G,q;const{client:t,cfg:a,root:h,host:i,dock:v,scrim:x,$:s,say:y,titleInput:p,descInput:b,compose:E,sendBtn:r,note:l}=e,S=s(".thumbs"),T=x.querySelector("input[type=file]"),M=[];let n=we,f=null;const o=document.createElement("div");o.setAttribute("role","status"),o.className="note",E.prepend(o);const u=it(a,(de=t.signedInAs())==null?void 0:de.email);let g=a.drafts===!1,c=!1,d=Promise.resolve(),k;function L(){if(clearTimeout(k),!g||c||a.drafts===!1)return d;const m=p.value||b.value||M.length?{title:p.value,description:b.value,priority:n,items:M.map(({blob:Q,mime:R,kind:C})=>({blob:Q,mime:R,kind:C}))}:null;return d=d.catch(()=>{}).then(()=>ne(u,m)).then(()=>{o.textContent=m?"Draft saved on this device":""}).catch(()=>{o.textContent="Draft could not be saved. Keep this tab open."}),d}function H(){clearTimeout(k),k=setTimeout(L,250)}E.addEventListener("input",H),E.addEventListener("change",H);const j=()=>{L()};window.addEventListener("pagehide",j);function N(){M.filter(m=>m.status==="failed").forEach(D)}window.addEventListener("online",N),a.drafts!==!1&&(E.inert=!0,st(u).then(m=>{e.closed||!m||(o.innerHTML='<span>You have an unfinished report on this device.</span> <button type="button" data-resume>Resume report</button> <button type="button" data-discard>Discard</button>',o.querySelector("[data-resume]").onclick=()=>{p.value=m.title||"",b.value=m.description||"",n=ye.some(Q=>Q.value===m.priority)?m.priority:"MEDIUM",x.querySelectorAll("[data-prio]").forEach(Q=>Q.setAttribute("aria-pressed",String(Q.dataset.prio===n)));for(const Q of(m.items||[]).slice(0,a.maxAttachments??5))O(Q);g=!0,L()},o.querySelector("[data-discard]").onclick=()=>{g=!0,L()})}).catch(()=>{o.textContent="Draft storage is unavailable. Keep this tab open."}).finally(()=>{E.inert=!1,o.querySelector("[data-resume]")||(g=!0)})),e.onDestroy(()=>{var m;L(),clearTimeout(k),window.removeEventListener("pagehide",j),window.removeEventListener("online",N),f==null||f.cancel(),M.forEach(Q=>Q.previewUrl&&URL.revokeObjectURL(Q.previewUrl)),(m=h.querySelector(".recbar"))==null||m.remove()}),x.querySelectorAll("[data-prio]").forEach(m=>{m.addEventListener("click",()=>{n=m.dataset.prio,H(),x.querySelectorAll("[data-prio]").forEach(Q=>{Q.setAttribute("aria-pressed",String(Q===m))})})});const B=s("#bc-title-err");function w(m){B.hidden=!m,B.innerHTML=m?`${Y}<span>${$(m)}</span>`:"",p.classList.toggle("invalid",!!m),p.setAttribute("aria-invalid",String(!!m))}p.addEventListener("input",()=>{p.value.trim()&&w("")});function z(){const m=M.some(C=>C.status==="uploading");r.disabled=e.sending||m||M.some(C=>C.status==="failed"),l.textContent=m?"Waiting for the upload to finish…":M.some(C=>C.status==="failed")?"Retry or remove failed attachments before sending.":"";const Q=a.maxAttachments??5;x.querySelectorAll(".tool").forEach(C=>{C.disabled=e.sending||M.length>=Q});const R=s(".field-head .count");R&&(R.textContent=M.length?`${M.length} of ${Q}`:"")}e.refreshSendState=z;function A(m){var F;const Q=m.el,R=m.kind==="VIDEO"?"Video":"Shot",C=m.kind==="VIDEO"?`<video src="${m.previewUrl}" muted playsinline preload="metadata"></video>`:`<img src="${m.previewUrl}" alt="" />`;let V="";m.status==="uploading"?V=`<div class="veil"><div class="spinner"></div><div class="bar"><i style="width:${Math.round(m.progress*100)}%"></i></div></div>`:m.status==="failed"&&(V=`<div class="veil err"><button type="button" data-act="retry" aria-label="Retry upload">${Ne}</button>Failed</div>`),Q.innerHTML=`
1067
- ${C}
1068
- <span class="kind">${R} · ${_(m.size)}</span>
1069
- <button class="drop" type="button" data-act="drop" aria-label="Remove ${R.toLowerCase()}">${X}</button>
1070
- ${V}`,Q.querySelector('[data-act="drop"]').addEventListener("click",()=>I(m)),(F=Q.querySelector('[data-act="retry"]'))==null||F.addEventListener("click",()=>D(m))}function I(m){const Q=M.indexOf(m);Q>=0&&M.splice(Q,1),m.previewUrl&&URL.revokeObjectURL(m.previewUrl),m.el.remove(),L(),z()}async function D(m){m.status="uploading",m.progress=0,A(m),z();try{const{storageKey:Q,mime:R}=await t.uploadAttachment(m.blob,m.mime,C=>{m.progress=C;const V=m.el.querySelector(".bar i");V&&(V.style.width=`${Math.round(C*100)}%`)});m.storageKey=Q,m.mime=R,m.status="ready"}catch(Q){m.status="failed",y(Q.message.replace("[BugCatch] ",""))}A(m),z()}function O({blob:m,mime:Q,kind:R}){const C=a.maxAttachmentBytes??26214400;if(m.size>C){y(`That file is ${_(m.size)} — the limit is ${_(C)}.`);return}const V=et(Q||m.type,xe);if(!V){y("Only PNG, JPEG, WebP, WebM and MP4 files can be attached to a report.");return}const F={blob:m,kind:R,mime:V,size:m.size,previewUrl:URL.createObjectURL(m),status:"uploading",progress:0,storageKey:null,el:document.createElement("div")};F.el.className="thumb",M.push(F),S.appendChild(F.el),y(""),L(),D(F)}async function oe(m){i.style.opacity="0",i.style.pointerEvents="none",await new Promise(Q=>requestAnimationFrame(()=>requestAnimationFrame(Q)));try{return await m()}finally{i.style.opacity="",i.style.pointerEvents=""}}(Z=x.querySelector('[data-act="shot"]'))==null||Z.addEventListener("click",async()=>{try{const m=await oe(tt);O(m)}catch(m){(m==null?void 0:m.name)!=="NotAllowedError"&&y(`Screenshot failed: ${m.message}`)}}),(G=x.querySelector('[data-act="file"]'))==null||G.addEventListener("click",()=>T.click()),T==null||T.addEventListener("change",()=>{const m=(a.maxAttachments??5)-M.length;[...T.files].slice(0,Math.max(m,0)).forEach(Q=>{O({blob:Q,mime:Q.type,kind:Q.type.startsWith("video/")?"VIDEO":"SCREENSHOT"})}),T.value=""}),(q=x.querySelector('[data-act="rec"]'))==null||q.addEventListener("click",async()=>{const m=a.maxRecordingMs??12e4;let Q;try{f=await at({maxMs:m,onTick:R=>{Q&&(Q.querySelector(".time").textContent=te(R))},onAutoStop:()=>{f&&P({keep:!0})}})}catch(R){(R==null?void 0:R.name)!=="NotAllowedError"&&y(`Recording failed: ${R.message}`);return}x.style.display="none",v.hidden=!0,Q=document.createElement("div"),Q.className="recbar",Q.innerHTML=`
1094
+ </div>`}function ut(e){var pe,G,X,q;const{client:t,cfg:a,root:r,host:s,dock:h,scrim:b,$:c,say:m,titleInput:u,descInput:f,compose:S,sendBtn:i,note:d}=e,v=c(".thumbs"),E=b.querySelector("input[type=file]"),p=[];let o=ke,l=null;const n=document.createElement("div");n.setAttribute("role","status"),n.className="note",S.prepend(n);const $=ct(a,(pe=t.signedInAs())==null?void 0:pe.email);let x=a.drafts===!1,y=!1,g=Promise.resolve(),L;function M(){if(clearTimeout(L),!x||y||a.drafts===!1)return g;const w=u.value||f.value||p.length?{title:u.value,description:f.value,priority:o,items:p.map(({blob:Q,mime:R,kind:A})=>({blob:Q,mime:R,kind:A}))}:null;return g=g.catch(()=>{}).then(()=>ne($,w)).then(()=>{n.textContent=w?"Draft saved on this device":""}).catch(()=>{n.textContent="Draft could not be saved. Keep this tab open."}),g}function C(){clearTimeout(L),L=setTimeout(M,250)}S.addEventListener("input",C),S.addEventListener("change",C);const B=()=>{M()};window.addEventListener("pagehide",B);function N(){p.filter(w=>w.status==="failed").forEach(j)}window.addEventListener("online",N),a.drafts!==!1&&(S.inert=!0,dt($).then(w=>{e.closed||!w||(n.innerHTML='<span>You have an unfinished report on this device.</span> <button type="button" data-resume>Resume report</button> <button type="button" data-discard>Discard</button>',n.querySelector("[data-resume]").onclick=()=>{u.value=w.title||"",f.value=w.description||"",o=xe.some(Q=>Q.value===w.priority)?w.priority:"MEDIUM",b.querySelectorAll("[data-prio]").forEach(Q=>Q.setAttribute("aria-pressed",String(Q.dataset.prio===o)));for(const Q of(w.items||[]).slice(0,a.maxAttachments??5))P(Q);x=!0,M()},n.querySelector("[data-discard]").onclick=()=>{x=!0,M()})}).catch(()=>{n.textContent="Draft storage is unavailable. Keep this tab open."}).finally(()=>{S.inert=e.mustRate(),n.querySelector("[data-resume]")||(x=!0)})),e.onDestroy(()=>{var w;M(),clearTimeout(L),window.removeEventListener("pagehide",B),window.removeEventListener("online",N),l==null||l.cancel(),p.forEach(Q=>Q.previewUrl&&URL.revokeObjectURL(Q.previewUrl)),(w=r.querySelector(".recbar"))==null||w.remove()}),b.querySelectorAll("[data-prio]").forEach(w=>{w.addEventListener("click",()=>{o=w.dataset.prio,C(),b.querySelectorAll("[data-prio]").forEach(Q=>{Q.setAttribute("aria-pressed",String(Q===w))})})});const W=c("#bc-title-err");function T(w){W.hidden=!w,W.innerHTML=w?`${F}<span>${k(w)}</span>`:"",u.classList.toggle("invalid",!!w),u.setAttribute("aria-invalid",String(!!w))}u.addEventListener("input",()=>{u.value.trim()&&T("")});function H(){const w=p.some(I=>I.status==="uploading"),Q=e.mustRate();i.disabled=e.sending||w||Q||p.some(I=>I.status==="failed"),d.textContent=Q?"Rate your last report to send a new one.":w?"Waiting for the upload to finish…":p.some(I=>I.status==="failed")?"Retry or remove failed attachments before sending.":"";const R=a.maxAttachments??5;b.querySelectorAll(".tool").forEach(I=>{I.disabled=e.sending||p.length>=R});const A=c(".field-head .count");A&&(A.textContent=p.length?`${p.length} of ${R}`:"")}e.refreshSendState=H;function z(w){var Y;const Q=w.el,R=w.kind==="VIDEO"?"Video":"Shot",A=w.kind==="VIDEO"?`<video src="${w.previewUrl}" muted playsinline preload="metadata"></video>`:`<img src="${w.previewUrl}" alt="" />`;let I="";w.status==="uploading"?I=`<div class="veil"><div class="spinner"></div><div class="bar"><i style="width:${Math.round(w.progress*100)}%"></i></div></div>`:w.status==="failed"&&(I=`<div class="veil err"><button type="button" data-act="retry" aria-label="Retry upload">${Ye}</button>Failed</div>`),Q.innerHTML=`
1095
+ ${A}
1096
+ <span class="kind">${R} · ${_(w.size)}</span>
1097
+ <button class="drop" type="button" data-act="drop" aria-label="Remove ${R.toLowerCase()}">${J}</button>
1098
+ ${I}`,Q.querySelector('[data-act="drop"]').addEventListener("click",()=>D(w)),(Y=Q.querySelector('[data-act="retry"]'))==null||Y.addEventListener("click",()=>j(w))}function D(w){const Q=p.indexOf(w);Q>=0&&p.splice(Q,1),w.previewUrl&&URL.revokeObjectURL(w.previewUrl),w.el.remove(),M(),H()}async function j(w){w.status="uploading",w.progress=0,z(w),H();try{const{storageKey:Q,mime:R}=await t.uploadAttachment(w.blob,w.mime,A=>{w.progress=A;const I=w.el.querySelector(".bar i");I&&(I.style.width=`${Math.round(A*100)}%`)});w.storageKey=Q,w.mime=R,w.status="ready"}catch(Q){w.status="failed",m(Q.message.replace("[BugCatch] ",""))}z(w),H()}function P({blob:w,mime:Q,kind:R}){const A=a.maxAttachmentBytes??26214400;if(w.size>A){m(`That file is ${_(w.size)} — the limit is ${_(A)}.`);return}const I=nt(Q||w.type,ye);if(!I){m("Only PNG, JPEG, WebP, WebM and MP4 files can be attached to a report.");return}const Y={blob:w,kind:R,mime:I,size:w.size,previewUrl:URL.createObjectURL(w),status:"uploading",progress:0,storageKey:null,el:document.createElement("div")};Y.el.className="thumb",p.push(Y),v.appendChild(Y.el),m(""),M(),j(Y)}async function oe(w){s.style.opacity="0",s.style.pointerEvents="none",await new Promise(Q=>requestAnimationFrame(()=>requestAnimationFrame(Q)));try{return await w()}finally{s.style.opacity="",s.style.pointerEvents=""}}(G=b.querySelector('[data-act="shot"]'))==null||G.addEventListener("click",async()=>{try{const w=await oe(ot);P(w)}catch(w){(w==null?void 0:w.name)!=="NotAllowedError"&&m(`Screenshot failed: ${w.message}`)}}),(X=b.querySelector('[data-act="file"]'))==null||X.addEventListener("click",()=>E.click()),E==null||E.addEventListener("change",()=>{const w=(a.maxAttachments??5)-p.length;[...E.files].slice(0,Math.max(w,0)).forEach(Q=>{P({blob:Q,mime:Q.type,kind:Q.type.startsWith("video/")?"VIDEO":"SCREENSHOT"})}),E.value=""}),(q=b.querySelector('[data-act="rec"]'))==null||q.addEventListener("click",async()=>{const w=a.maxRecordingMs??12e4;let Q;try{l=await rt({maxMs:w,onTick:R=>{Q&&(Q.querySelector(".time").textContent=te(R))},onAutoStop:()=>{l&&V({keep:!0})}})}catch(R){(R==null?void 0:R.name)!=="NotAllowedError"&&m(`Recording failed: ${R.message}`);return}b.style.display="none",h.hidden=!0,Q=document.createElement("div"),Q.className="recbar",Q.innerHTML=`
1071
1099
  <span class="dot"></span>
1072
1100
  <span class="time">0:00</span>
1073
- <span class="hint">Recording — up to ${te(Math.round(m/1e3))}</span>
1101
+ <span class="hint">Recording — up to ${te(Math.round(w/1e3))}</span>
1074
1102
  <button class="stop" type="button">Stop</button>
1075
- <button class="ghost" type="button">Discard</button>`,Q.querySelector(".stop").addEventListener("click",()=>P({keep:!0})),Q.querySelector(".ghost").addEventListener("click",()=>P({keep:!1})),h.appendChild(Q),Q.querySelector(".stop").focus()});async function P({keep:m}){var R;const Q=f;if(Q){if(f=null,(R=h.querySelector(".recbar"))==null||R.remove(),x.style.display="",v.hidden=!1,!m){Q.cancel(),p.focus();return}try{const C=await Q.stop();C.blob.size?O(C):y("That recording came back empty — nothing was captured.")}catch(C){y(`Recording failed: ${C.message}`)}p.focus()}}e.isRecording=()=>!!f,e.stopRecording=P,r.addEventListener("click",async()=>{var R;const m=p.value;if(!m.trim()){w("Add a few words about what went wrong — a short sentence is plenty."),p.focus();return}if(e.holdForReference())return;e.sending=!0,y(""),z();const Q=r.innerHTML;r.innerHTML='<span class="spinner" aria-hidden="true"></span>Sending…';try{const C=await t.report({title:m,description:b.value,priority:n,references:e.answeredReference(),issue:((R=e.pickedIssue())==null?void 0:R.key)||null,attachments:M.filter(V=>V.status==="ready").map(V=>({type:V.kind,storageKey:V.storageKey,mime:V.mime}))});if(C!=null&&C.cancelled){e.sending=!1,r.innerHTML=Q,z();return}c=!0,clearTimeout(k),await d,a.drafts!==!1&&await ne(u,null).catch(()=>{}),e.succeed(C)}catch(C){e.sending=!1,r.innerHTML=Q,y(C.message.replace("[BugCatch] ","")),z(),e.recheckSignIn()}})}const dt=2e4,ke=120,le=200;function $e(e){if(typeof e!="string"||!e.trim()||e.length>400)return null;try{return new RegExp(e.trim(),"gi")}catch{return null}}const Se=e=>String(e).replace(/\s+/g," ").trim().slice(0,ke);function Le(e,t){const a=e&&e.normalize;if(a==="phone"){const h=t.replace(/\D/g,"");return h.length===10?h:h.length===12&&h.startsWith("91")?h.slice(2):h.length===11&&h.startsWith("0")?h.slice(1):t}return a==="upper"?t.toUpperCase():t}function Ee(e){const t=e.length>1&&e[1]!==void 0?e[1]:e[0];return typeof t!="string"||!t.trim()?null:{value:Se(t),start:e.index,end:e.index+e[0].length}}function pt(e,t){return((e.slice(t.start,t.valueStart)+e.slice(t.valueEnd,t.end)).match(/[a-z]/gi)||[]).length}const ut=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[A-Za-z0-9][\w-]{5,40}/gi,Me=/[\w-]/;function ht(e,t){const a=(e||[]).filter(r=>r&&r.scan!==!1&&r.pattern),h=[],i=[],v=(t||[]).map(r=>typeof r=="string"?r.slice(0,dt):"");v.forEach((r,l)=>{r&&a.forEach((S,T)=>{const M=$e(S.pattern);if(!M)return;let n,f=0;for(M.lastIndex=0;(n=M.exec(r))!==null&&!(++f>le);){if(n[0]===""){M.lastIndex+=1;continue}const o=Ee(n);if(!o)continue;const u=n.length>1&&n[1]!==void 0?n[1]:n[0],g=n.index+Math.max(0,n[0].indexOf(u)),c={block:l,order:T,key:S.key,label:S.label,value:Le(S,o.value),start:o.start,end:o.end,valueStart:g,valueEnd:g+u.length};c.weight=pt(r,c),h.push(c)}})});const x=h.filter(r=>!h.some(l=>l!==r&&l.block===r.block&&l.key!==r.key&&l.valueStart<=r.valueStart&&l.valueEnd>=r.valueEnd&&l.weight>r.weight)),s=new Map;for(const r of x){const l=r.value.toLowerCase();s.has(l)||s.set(l,{value:r.value,keys:new Map});const S=s.get(l);S.keys.has(r.key)||S.keys.set(r.key,{key:r.key,label:r.label,order:r.order})}const y=[],p=[],b=new Map;for(const r of s.values()){const l=[...r.keys.values()].sort((M,n)=>M.order-n.order);if(l.length>1){p.push({value:r.value,kinds:l.map(({key:M,label:n})=>({key:M,label:n}))});continue}const[{key:S,label:T}]=l;b.has(S)||b.set(S,[]),b.get(S).push({key:S,label:T,value:r.value})}for(const r of b.values())if(r.length===1)y.push(r[0]);else for(const l of r)p.push({value:l.value,kinds:[{key:l.key,label:l.label}]});const E=new Set(s.keys());return v.forEach((r,l)=>{if(!r)return;const S=h.filter(f=>f.block===l),T=new RegExp(ut.source,"gi");let M,n=0;for(;(M=T.exec(r))!==null&&++n<=le;){const f=M.index,o=f+M[0].length;if(S.some(L=>f<L.end&&o>L.start))continue;const u=r[f-1]||"",g=r[o]||"";if(Me.test(u)||Me.test(g)||u==="/"||u==="@"||g==="@"||u==="."||g==="."&&/\w/.test(r[o+1]||"")||!/\d/.test(M[0]))continue;const c=Se(M[0]),d=c.toLowerCase();if(E.has(d))continue;const k=(e||[]).filter(L=>L&&Qe(L,c)).map(({key:L,label:H})=>({key:L,label:H}));k.length&&(E.add(d),i.push({value:c,kinds:k}))}}),{found:y,conflicts:p,loose:i}}function Qe(e,t){const a=typeof t=="string"?t.trim():"";if(!a||a.length>ke)return null;const h=$e(e&&(e.valuePattern||e.pattern));if(!h)return null;let i,v=0;for(h.lastIndex=0;(i=h.exec(a))!==null&&!(++v>le);){if(i[0]===""){h.lastIndex+=1;continue}const x=i.index+i[0].length===a.length,s=i.index===0||i.index===1;if(x&&s){const y=Ee(i);if(y)return Le(e,y.value)}}return null}function bt(e){const{client:t,say:a,titleInput:h,descInput:i,sendBtn:v,refsBox:x}=e;let s={policy:"off",fields:[]},y=!1,p=null,b="",E="",r=[],l="ask",S=!1,T=!1;t.referenceFields().then(w=>{s=w,g()}).catch(()=>{});function M(){return s.policy==="off"||!s.fields.length?{found:[],conflicts:[],loose:[]}:ht(s.fields,[h.value,i.value])}function n(w=M()){return w.found.length>0&&w.conflicts.length===0}function f(){return!p||!b.trim()?[]:[{key:p,value:b.trim().slice(0,120)}]}const o=document.createElement("p");o.className="ref-found",o.setAttribute("aria-live","polite"),o.hidden=!0,i.closest(".field").after(o);let u;function g(){const w=M();if(n(w)){const z=w.found.slice(0,2).map(A=>`${$(A.label)} <b>${$(d(A.value))}</b>`).join(", ");o.innerHTML=`${W}<span>Found your ${z} — no need to add it again.</span>`,o.hidden=!1,y&&!f().length&&(y=!1,H())}else o.hidden=!0,o.innerHTML=""}const c=()=>{clearTimeout(u),u=setTimeout(g,250)};h.addEventListener("input",c),i.addEventListener("input",c);function d(w){return w.length>20?`${w.slice(0,8)}…${w.slice(-4)}`:w}function k(w){const z=w.trim().toLowerCase();return r.find(A=>A.value.toLowerCase()===z)||null}function L(w){b=w.value,w.kinds.length===1?p=w.kinds[0].key:w.kinds.some(z=>z.key===p)||(p=null),E="",T=!1}function H(){var Z,G;if(!y){x.hidden=!0,x.innerHTML="";return}const w=s.fields.find(q=>q.key===p)||null,z=s.policy!=="required",A=k(b),I=A&&A.kinds.length>1?s.fields.filter(q=>A.kinds.some(m=>m.key===q.key)):s.fields,D=r.length>1&&r.every(q=>q.kinds.length===1&&q.kinds[0].key===r[0].kinds[0].key),O={confirm:r.length>1?["Which one is this about?","We found more than one ID in your message. Pick the one this problem is about."]:["Is this the right ID?","This could be more than one kind of ID. Tell us which it is."],suggest:["Is this your ID?","We spotted this in your message. Tell us what it is so we can find your record."],ask:z?["One more thing","So we can find your record — this helps us answer faster."]:["We need one detail","We need one of these to look this up."]}[l];x.hidden=!1;const oe=I.length>6;x.innerHTML=`
1103
+ <button class="ghost" type="button">Discard</button>`,Q.querySelector(".stop").addEventListener("click",()=>V({keep:!0})),Q.querySelector(".ghost").addEventListener("click",()=>V({keep:!1})),r.appendChild(Q),Q.querySelector(".stop").focus()});async function V({keep:w}){var R;const Q=l;if(Q){if(l=null,(R=r.querySelector(".recbar"))==null||R.remove(),b.style.display="",h.hidden=!1,!w){Q.cancel(),u.focus();return}try{const A=await Q.stop();A.blob.size?P(A):m("That recording came back empty — nothing was captured.")}catch(A){m(`Recording failed: ${A.message}`)}u.focus()}}e.isRecording=()=>!!l,e.stopRecording=V,i.addEventListener("click",async()=>{var R;const w=u.value;if(!w.trim()){T("Add a few words about what went wrong — a short sentence is plenty."),u.focus();return}if(e.holdForReference())return;e.sending=!0,m(""),H();const Q=i.innerHTML;i.innerHTML='<span class="spinner" aria-hidden="true"></span>Sending…';try{const A=await t.report({title:w,description:f.value,priority:o,references:e.answeredReference(),issue:((R=e.pickedIssue())==null?void 0:R.key)||null,attachments:p.filter(I=>I.status==="ready").map(I=>({type:I.kind,storageKey:I.storageKey,mime:I.mime}))});if(A!=null&&A.cancelled){e.sending=!1,i.innerHTML=Q,H();return}y=!0,clearTimeout(L),await g,a.drafts!==!1&&await ne($,null).catch(()=>{}),e.succeed(A)}catch(A){e.sending=!1,i.innerHTML=Q,m(A.message.replace("[BugCatch] ","")),H(),e.recheckSignIn()}})}const ht=2e4,$e=120,le=200;function Se(e){if(typeof e!="string"||!e.trim()||e.length>400)return null;try{return new RegExp(e.trim(),"gi")}catch{return null}}const Le=e=>String(e).replace(/\s+/g," ").trim().slice(0,$e);function Ee(e,t){const a=e&&e.normalize;if(a==="phone"){const r=t.replace(/\D/g,"");return r.length===10?r:r.length===12&&r.startsWith("91")?r.slice(2):r.length===11&&r.startsWith("0")?r.slice(1):t}return a==="upper"?t.toUpperCase():t}function Me(e){const t=e.length>1&&e[1]!==void 0?e[1]:e[0];return typeof t!="string"||!t.trim()?null:{value:Le(t),start:e.index,end:e.index+e[0].length}}function ft(e,t){return((e.slice(t.start,t.valueStart)+e.slice(t.valueEnd,t.end)).match(/[a-z]/gi)||[]).length}const bt=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[A-Za-z0-9][\w-]{5,40}/gi,Te=/[\w-]/;function gt(e,t){const a=(e||[]).filter(i=>i&&i.scan!==!1&&i.pattern),r=[],s=[],h=(t||[]).map(i=>typeof i=="string"?i.slice(0,ht):"");h.forEach((i,d)=>{i&&a.forEach((v,E)=>{const p=Se(v.pattern);if(!p)return;let o,l=0;for(p.lastIndex=0;(o=p.exec(i))!==null&&!(++l>le);){if(o[0]===""){p.lastIndex+=1;continue}const n=Me(o);if(!n)continue;const $=o.length>1&&o[1]!==void 0?o[1]:o[0],x=o.index+Math.max(0,o[0].indexOf($)),y={block:d,order:E,key:v.key,label:v.label,value:Ee(v,n.value),start:n.start,end:n.end,valueStart:x,valueEnd:x+$.length};y.weight=ft(i,y),r.push(y)}})});const b=r.filter(i=>!r.some(d=>d!==i&&d.block===i.block&&d.key!==i.key&&d.valueStart<=i.valueStart&&d.valueEnd>=i.valueEnd&&d.weight>i.weight)),c=new Map;for(const i of b){const d=i.value.toLowerCase();c.has(d)||c.set(d,{value:i.value,keys:new Map});const v=c.get(d);v.keys.has(i.key)||v.keys.set(i.key,{key:i.key,label:i.label,order:i.order})}const m=[],u=[],f=new Map;for(const i of c.values()){const d=[...i.keys.values()].sort((p,o)=>p.order-o.order);if(d.length>1){u.push({value:i.value,kinds:d.map(({key:p,label:o})=>({key:p,label:o}))});continue}const[{key:v,label:E}]=d;f.has(v)||f.set(v,[]),f.get(v).push({key:v,label:E,value:i.value})}for(const i of f.values())if(i.length===1)m.push(i[0]);else for(const d of i)u.push({value:d.value,kinds:[{key:d.key,label:d.label}]});const S=new Set(c.keys());return h.forEach((i,d)=>{if(!i)return;const v=r.filter(l=>l.block===d),E=new RegExp(bt.source,"gi");let p,o=0;for(;(p=E.exec(i))!==null&&++o<=le;){const l=p.index,n=l+p[0].length;if(v.some(M=>l<M.end&&n>M.start))continue;const $=i[l-1]||"",x=i[n]||"";if(Te.test($)||Te.test(x)||$==="/"||$==="@"||x==="@"||$==="."||x==="."&&/\w/.test(i[n+1]||"")||!/\d/.test(p[0]))continue;const y=Le(p[0]),g=y.toLowerCase();if(S.has(g))continue;const L=(e||[]).filter(M=>M&&Qe(M,y)).map(({key:M,label:C})=>({key:M,label:C}));L.length&&(S.add(g),s.push({value:y,kinds:L}))}}),{found:m,conflicts:u,loose:s}}function Qe(e,t){const a=typeof t=="string"?t.trim():"";if(!a||a.length>$e)return null;const r=Se(e&&(e.valuePattern||e.pattern));if(!r)return null;let s,h=0;for(r.lastIndex=0;(s=r.exec(a))!==null&&!(++h>le);){if(s[0]===""){r.lastIndex+=1;continue}const b=s.index+s[0].length===a.length,c=s.index===0||s.index===1;if(b&&c){const m=Me(s);if(m)return Ee(e,m.value)}}return null}function mt(e){const{client:t,say:a,titleInput:r,descInput:s,sendBtn:h,refsBox:b}=e;let c={policy:"off",fields:[]},m=!1,u=null,f="",S="",i=[],d="ask",v=!1,E=!1;t.referenceFields().then(T=>{c=T,x()}).catch(()=>{});function p(){return c.policy==="off"||!c.fields.length?{found:[],conflicts:[],loose:[]}:gt(c.fields,[r.value,s.value])}function o(T=p()){return T.found.length>0&&T.conflicts.length===0}function l(){return!u||!f.trim()?[]:[{key:u,value:f.trim().slice(0,120)}]}const n=document.createElement("p");n.className="ref-found",n.setAttribute("aria-live","polite"),n.hidden=!0,s.closest(".field").after(n);let $;function x(){const T=p();if(o(T)){const H=T.found.slice(0,2).map(z=>`${k(z.label)} <b>${k(g(z.value))}</b>`).join(", ");n.innerHTML=`${O}<span>Found your ${H} — no need to add it again.</span>`,n.hidden=!1,m&&!l().length&&(m=!1,C())}else n.hidden=!0,n.innerHTML=""}const y=()=>{clearTimeout($),$=setTimeout(x,250)};r.addEventListener("input",y),s.addEventListener("input",y);function g(T){return T.length>20?`${T.slice(0,8)}…${T.slice(-4)}`:T}function L(T){const H=T.trim().toLowerCase();return i.find(z=>z.value.toLowerCase()===H)||null}function M(T){f=T.value,T.kinds.length===1?u=T.kinds[0].key:T.kinds.some(H=>H.key===u)||(u=null),S="",E=!1}function C(){var G,X;if(!m){b.hidden=!0,b.innerHTML="";return}const T=c.fields.find(q=>q.key===u)||null,H=c.policy!=="required",z=L(f),D=z&&z.kinds.length>1?c.fields.filter(q=>z.kinds.some(w=>w.key===q.key)):c.fields,j=i.length>1&&i.every(q=>q.kinds.length===1&&q.kinds[0].key===i[0].kinds[0].key),P={confirm:i.length>1?["Which one is this about?","We found more than one ID in your message. Pick the one this problem is about."]:["Is this the right ID?","This could be more than one kind of ID. Tell us which it is."],suggest:["Is this your ID?","We spotted this in your message. Tell us what it is so we can find your record."],ask:H?["One more thing","So we can find your record — this helps us answer faster."]:["We need one detail","We need one of these to look this up."]}[d];b.hidden=!1;const oe=D.length>6;b.innerHTML=`
1076
1104
  <div class="ask-head">
1077
1105
  <span class="avatar orb" aria-hidden="true"></span>
1078
1106
  <div>
1079
- <strong>${$(O[0])}</strong>
1080
- <p class="why">${$(O[1])}</p>
1107
+ <strong>${k(P[0])}</strong>
1108
+ <p class="why">${k(P[1])}</p>
1081
1109
  </div>
1082
1110
  </div>
1083
- ${r.length>1?`
1111
+ ${i.length>1?`
1084
1112
  <div class="chips cands" role="group" aria-label="IDs found in your message">
1085
- ${r.map((q,m)=>`
1086
- <button type="button" data-ref-cand="${m}" title="${$(q.value)}"
1087
- aria-pressed="${!!A&&A===q}">${$(d(q.value))}</button>
1113
+ ${i.map((q,w)=>`
1114
+ <button type="button" data-ref-cand="${w}" title="${k(q.value)}"
1115
+ aria-pressed="${!!z&&z===q}">${k(g(q.value))}</button>
1088
1116
  `).join("")}
1089
1117
  </div>`:""}
1090
- ${I.length>1&&!oe&&!D?`
1118
+ ${D.length>1&&!oe&&!j?`
1091
1119
  <div class="chips" role="group" aria-label="Which detail you are giving">
1092
- ${I.map(q=>`
1093
- <button type="button" data-ref-kind="${$(q.key)}" aria-pressed="${!!w&&q.key===w.key}">${$(q.label)}</button>
1120
+ ${D.map(q=>`
1121
+ <button type="button" data-ref-kind="${k(q.key)}" aria-pressed="${!!T&&q.key===T.key}">${k(q.label)}</button>
1094
1122
  `).join("")}
1095
1123
  </div>`:""}
1096
1124
  <div class="row">
1097
1125
  ${oe?`
1098
1126
  <select class="ref-kind" aria-label="Which detail you are giving">
1099
- ${w?"":'<option value="" selected disabled>What is it?</option>'}
1100
- ${I.map(q=>`
1101
- <option value="${$(q.key)}" ${w&&q.key===w.key?"selected":""}>${$(q.label)}</option>
1127
+ ${T?"":'<option value="" selected disabled>What is it?</option>'}
1128
+ ${D.map(q=>`
1129
+ <option value="${k(q.key)}" ${T&&q.key===T.key?"selected":""}>${k(q.label)}</option>
1102
1130
  `).join("")}
1103
1131
  </select>`:""}
1104
- <input class="ref-value${E?" invalid":""}" type="${(w==null?void 0:w.inputMode)==="email"?"email":"text"}"
1105
- inputmode="${$((w==null?void 0:w.inputMode)==="numeric"||(w==null?void 0:w.inputMode)==="tel"?"numeric":"text")}"
1106
- value="${$(b)}"
1107
- placeholder="${$(w?w.placeholder||w.label:"Your ID")}"
1108
- aria-label="${$(w?w.label:"Your ID")}" ${E?'aria-invalid="true"':""} />
1132
+ <input class="ref-value${S?" invalid":""}" type="${(T==null?void 0:T.inputMode)==="email"?"email":"text"}"
1133
+ inputmode="${k((T==null?void 0:T.inputMode)==="numeric"||(T==null?void 0:T.inputMode)==="tel"?"numeric":"text")}"
1134
+ value="${k(f)}"
1135
+ placeholder="${k(T?T.placeholder||T.label:"Your ID")}"
1136
+ aria-label="${k(T?T.label:"Your ID")}" ${S?'aria-invalid="true"':""} />
1109
1137
  </div>
1110
- ${w!=null&&w.hint?`<p class="hint">${$(w.hint)}</p>`:""}
1111
- ${E?`<p class="field-err" role="alert">${Y}<span>${$(E)}</span></p>`:""}
1112
- ${z?`<button type="button" class="link" data-act="ref-skip">${l==="ask"?"I don't have this — send without it":"Not sure — send as it is"}</button>`:""}`,x.querySelectorAll("[data-ref-cand]").forEach(q=>{q.addEventListener("click",()=>{L(r[Number(q.dataset.refCand)]),H()})}),x.querySelectorAll("[data-ref-kind]").forEach(q=>{q.addEventListener("click",()=>{p=q.dataset.refKind,E="",T=!1,H()})});const P=x.querySelector(".ref-value");P.addEventListener("input",()=>{b=P.value,E="",T=!1}),P.addEventListener("keydown",q=>{q.key==="Enter"&&(q.preventDefault(),v.click())}),(Z=x.querySelector(".ref-kind"))==null||Z.addEventListener("change",q=>{var m;p=q.target.value,E="",H(),(m=x.querySelector(".ref-value"))==null||m.focus()}),(G=x.querySelector('[data-act="ref-skip"]'))==null||G.addEventListener("click",()=>{S=!0,y=!1,p=null,b="",E="",T=!1,H(),a("")}),((!w&&b?x.querySelector("[data-ref-kind], .ref-kind"):null)||P).focus()}function j(w){if(r=w.conflicts.length?w.conflicts:w.loose.slice(0,4),l=w.conflicts.length?"confirm":w.loose.length?"suggest":"ask",y=!0,r.length)if(r.length===1)L(r[0]);else{b="";const[z]=r;p=r.every(I=>I.kinds.length===1&&I.kinds[0].key===z.kinds[0].key)?z.kinds[0].key:null}else p=p||s.fields[0].key;H()}function N(){if(s.policy==="off"||!s.fields.length||f().length)return!1;const w=M();return n(w)||S&&s.policy!=="required"?!1:w}function B(){if(y&&b.trim()&&!p)return E="Pick what this ID is.",H(),!0;const w=N();if(w)return y?H():j(w),a(""),!0;if(p&&b.trim()){const z=s.fields.find(A=>A.key===p);if(!T&&z&&!Qe(z,b))return E=`That does not look like a ${z.label.toLowerCase()}. Press Send again to use it anyway.`,T=!0,H(),!0}return!1}e.holdForReference=B,e.answeredReference=f}const ft={info:pe,success:W,warning:De,critical:Y};function gt(e,{where:t,onDismiss:a}){const h=document.createElement("div");h.className=`notice tone-${e.tone} at-${t}`,h.setAttribute("role","status");const i=document.createElement("span");i.className="notice-ico",i.setAttribute("aria-hidden","true"),i.innerHTML=ft[e.tone]||pe;const v=document.createElement("div");v.className="notice-text";const x=document.createElement("strong");if(x.textContent=e.title,v.append(x),e.body){const s=document.createElement("p");s.textContent=e.body,v.append(s)}if(e.ctaHref&&e.ctaLabel){const s=document.createElement("a");s.className="notice-cta",s.href=e.ctaHref,s.textContent=e.ctaLabel,/^https?:/i.test(e.ctaHref)&&(s.target="_blank",s.rel="noopener noreferrer"),v.append(s)}if(h.append(i,v),e.dismissible&&a){const s=document.createElement("button");s.type="button",s.className="notice-x",s.setAttribute("aria-label","Dismiss this notice"),s.innerHTML=X,s.addEventListener("click",()=>a(e)),h.append(s)}return h}const mt=3;function vt(e){const{client:t,cfg:a,notices:h}=e;let i=[];function v(){const s=i.slice(0,mt);h.replaceChildren(...s.map(y=>gt(y,{where:"panel",onDismiss:x}))),h.hidden=s.length===0}function x(s){t.dismissAnnouncement(s),i=i.filter(y=>y!==s),v(),e.titleInput.focus()}a.announcements!==!1&&typeof t.announcements=="function"&&t.announcements().then(s=>{e.closed||(i=s,v())}).catch(()=>{})}function xt(e){const{client:t,cfg:a,titleInput:h,known:i}=e;let v=[],x="",s=null,y=null;function p(){a.knownIssues!==!1&&t.knownIssues().then(S=>{v=S,r()}).catch(()=>{})}let b=null;function E(S){if(a.knownIssues===!1)return;clearTimeout(b),y==null||y.abort();const T=(S||"").trim();if(T.length<3){p();return}b=setTimeout(()=>{y=new AbortController,t.matchKnownIssues(T,{signal:y.signal}).then(M=>{M.length&&(v=M,r())}).catch(()=>{})},250)}function r(){if(!v.length){i.hidden=!0,i.innerHTML="";return}i.hidden=!1,i.innerHTML=`
1138
+ ${T!=null&&T.hint?`<p class="hint">${k(T.hint)}</p>`:""}
1139
+ ${S?`<p class="field-err" role="alert">${F}<span>${k(S)}</span></p>`:""}
1140
+ ${H?`<button type="button" class="link" data-act="ref-skip">${d==="ask"?"I don't have this — send without it":"Not sure — send as it is"}</button>`:""}`,b.querySelectorAll("[data-ref-cand]").forEach(q=>{q.addEventListener("click",()=>{M(i[Number(q.dataset.refCand)]),C()})}),b.querySelectorAll("[data-ref-kind]").forEach(q=>{q.addEventListener("click",()=>{u=q.dataset.refKind,S="",E=!1,C()})});const V=b.querySelector(".ref-value");V.addEventListener("input",()=>{f=V.value,S="",E=!1}),V.addEventListener("keydown",q=>{q.key==="Enter"&&(q.preventDefault(),h.click())}),(G=b.querySelector(".ref-kind"))==null||G.addEventListener("change",q=>{var w;u=q.target.value,S="",C(),(w=b.querySelector(".ref-value"))==null||w.focus()}),(X=b.querySelector('[data-act="ref-skip"]'))==null||X.addEventListener("click",()=>{v=!0,m=!1,u=null,f="",S="",E=!1,C(),a("")}),((!T&&f?b.querySelector("[data-ref-kind], .ref-kind"):null)||V).focus()}function B(T){if(i=T.conflicts.length?T.conflicts:T.loose.slice(0,4),d=T.conflicts.length?"confirm":T.loose.length?"suggest":"ask",m=!0,i.length)if(i.length===1)M(i[0]);else{f="";const[H]=i;u=i.every(D=>D.kinds.length===1&&D.kinds[0].key===H.kinds[0].key)?H.kinds[0].key:null}else u=u||c.fields[0].key;C()}function N(){if(c.policy==="off"||!c.fields.length||l().length)return!1;const T=p();return o(T)||v&&c.policy!=="required"?!1:T}function W(){if(m&&f.trim()&&!u)return S="Pick what this ID is.",C(),!0;const T=N();if(T)return m?C():B(T),a(""),!0;if(u&&f.trim()){const H=c.fields.find(z=>z.key===u);if(!E&&H&&!Qe(H,f))return S=`That does not look like a ${H.label.toLowerCase()}. Press Send again to use it anyway.`,E=!0,C(),!0}return!1}e.holdForReference=W,e.answeredReference=l}const vt={info:ue,success:O,warning:Oe,critical:F};function wt(e,{where:t,onDismiss:a}){const r=document.createElement("div");r.className=`notice tone-${e.tone} at-${t}`,r.setAttribute("role","status");const s=document.createElement("span");s.className="notice-ico",s.setAttribute("aria-hidden","true"),s.innerHTML=vt[e.tone]||ue;const h=document.createElement("div");h.className="notice-text";const b=document.createElement("strong");if(b.textContent=e.title,h.append(b),e.body){const c=document.createElement("p");c.textContent=e.body,h.append(c)}if(e.ctaHref&&e.ctaLabel){const c=document.createElement("a");c.className="notice-cta",c.href=e.ctaHref,c.textContent=e.ctaLabel,/^https?:/i.test(e.ctaHref)&&(c.target="_blank",c.rel="noopener noreferrer"),h.append(c)}if(r.append(s,h),e.dismissible&&a){const c=document.createElement("button");c.type="button",c.className="notice-x",c.setAttribute("aria-label","Dismiss this notice"),c.innerHTML=J,c.addEventListener("click",()=>a(e)),r.append(c)}return r}const yt=3;function xt(e){const{client:t,cfg:a,notices:r}=e;let s=[];function h(){const c=s.slice(0,yt);r.replaceChildren(...c.map(m=>wt(m,{where:"panel",onDismiss:b}))),r.hidden=c.length===0}function b(c){t.dismissAnnouncement(c),s=s.filter(m=>m!==c),h(),e.titleInput.focus()}a.announcements!==!1&&typeof t.announcements=="function"&&t.announcements().then(c=>{e.closed||(s=c,h())}).catch(()=>{})}function kt(e){const{client:t,cfg:a,titleInput:r,known:s}=e;let h=[],b="",c=null,m=null;function u(){a.knownIssues!==!1&&t.knownIssues().then(v=>{h=v,i()}).catch(()=>{})}let f=null;function S(v){if(a.knownIssues===!1)return;clearTimeout(f),m==null||m.abort();const E=(v||"").trim();if(E.length<3){u();return}f=setTimeout(()=>{m=new AbortController,t.matchKnownIssues(E,{signal:m.signal}).then(p=>{p.length&&(h=p,i())}).catch(()=>{})},250)}function i(){if(!h.length){s.hidden=!0,s.innerHTML="";return}s.hidden=!1,s.innerHTML=`
1113
1141
  <p class="known-h">Already reported</p>
1114
- ${v.map(S=>`
1115
- <div class="issue ${S.joined?"is-joined":""}">
1142
+ ${h.map(v=>`
1143
+ <div class="issue ${v.joined?"is-joined":""}">
1116
1144
  <span class="who">
1117
- <span class="t">${$(S.title)}</span>
1118
- <span class="meta">${$(l(S))}</span>
1145
+ <span class="t">${k(v.title)}</span>
1146
+ <span class="meta">${k(d(v))}</span>
1119
1147
  </span>
1120
- <button class="join" type="button" data-join="${$(S.id)}"
1121
- ${S.joined?"disabled":""}>${S.joined?"Following":"Me too"}</button>
1148
+ <button class="join" type="button" data-join="${k(v.id)}"
1149
+ ${v.joined?"disabled":""}>${v.joined?"Following":"Me too"}</button>
1122
1150
  </div>
1123
- ${s===S.id?`
1151
+ ${c===v.id?`
1124
1152
  <div class="ask">
1125
1153
  <input type="email" class="join-email" placeholder="you@example.com"
1126
1154
  aria-label="Your email, so we can tell you when this is fixed" />
1127
- <button class="ghost" type="button" data-join-confirm="${$(S.id)}">Follow</button>
1155
+ <button class="ghost" type="button" data-join-confirm="${k(v.id)}">Follow</button>
1128
1156
  </div>`:""}
1129
1157
  `).join("")}
1130
- ${x?`<p class="err">${$(x)}</p>`:""}`}function l(S){const T=S.status==="IN_PROGRESS"?"Being worked on now":"Not fixed yet",M=S.affectedCount===0?"":` · ${S.affectedCount} ${S.affectedCount===1?"person has":"people have"} said this is happening to them`;return`${T} · reported ${ee(S.since)}${M}`}i.addEventListener("click",async S=>{var o,u,g,c,d;const T=S.target.closest("[data-join]"),M=S.target.closest("[data-join-confirm]");if(!T&&!M)return;const n=(M||T).getAttribute(M?"data-join-confirm":"data-join");x="";const f=((u=(o=i.querySelector(".join-email"))==null?void 0:o.value)==null?void 0:u.trim())||((g=t.signedInAs())==null?void 0:g.email)||((c=t.config.user)==null?void 0:c.email);if(!f){s=n,r(),(d=i.querySelector(".join-email"))==null||d.focus();return}try{const k=await t.meToo(n,{email:f});s=null,v=v.map(L=>L.id===n?{...L,joined:!0,affectedCount:k.affectedCount??L.affectedCount}:L),r()}catch(k){x=k.message.replace("[BugCatch] ",""),r()}}),p(),h.addEventListener("input",()=>E(h.value))}function yt(e){const{client:t,cfg:a,titleInput:h,descInput:i,picks:v}=e;let x=[],s=null;function y(){if(!x.length){v.hidden=!0,v.innerHTML="";return}v.hidden=!1,v.innerHTML=`
1158
+ ${b?`<p class="err">${k(b)}</p>`:""}`}function d(v){const E=v.status==="IN_PROGRESS"?"Being worked on now":"Not fixed yet",p=v.affectedCount===0?"":` · ${v.affectedCount} ${v.affectedCount===1?"person has":"people have"} said this is happening to them`;return`${E} · reported ${Z(v.since)}${p}`}s.addEventListener("click",async v=>{var n,$,x,y,g;const E=v.target.closest("[data-join]"),p=v.target.closest("[data-join-confirm]");if(!E&&!p)return;const o=(p||E).getAttribute(p?"data-join-confirm":"data-join");b="";const l=(($=(n=s.querySelector(".join-email"))==null?void 0:n.value)==null?void 0:$.trim())||((x=t.signedInAs())==null?void 0:x.email)||((y=t.config.user)==null?void 0:y.email);if(!l){c=o,i(),(g=s.querySelector(".join-email"))==null||g.focus();return}try{const L=await t.meToo(o,{email:l});c=null,h=h.map(M=>M.id===o?{...M,joined:!0,affectedCount:L.affectedCount??M.affectedCount}:M),i()}catch(L){b=L.message.replace("[BugCatch] ",""),i()}}),u(),r.addEventListener("input",()=>S(r.value))}function $t(e){const{client:t,cfg:a,titleInput:r,descInput:s,picks:h}=e;let b=[],c=null;function m(){if(!b.length){h.hidden=!0,h.innerHTML="";return}h.hidden=!1,h.innerHTML=`
1131
1159
  <p class="picks-h">Get an answer right away</p>
1132
1160
  <div class="picks-grid" role="group" aria-label="Common questions">
1133
- ${x.map((p,b)=>`
1134
- <button type="button" class="pick" data-pick="${$(p.key)}"
1135
- ${p.hint?`title="${$(p.hint)}" aria-describedby="bc-pick-h${b}"`:""}
1136
- aria-pressed="${(s==null?void 0:s.key)===p.key}">
1137
- <span class="t">${$(p.title)}</span>
1138
- ${p.hint?`<span class="h sr-only" id="bc-pick-h${b}">${$(p.hint)}</span>`:""}
1161
+ ${b.map((u,f)=>`
1162
+ <button type="button" class="pick" data-pick="${k(u.key)}"
1163
+ ${u.hint?`title="${k(u.hint)}" aria-describedby="bc-pick-h${f}"`:""}
1164
+ aria-pressed="${(c==null?void 0:c.key)===u.key}">
1165
+ <span class="t">${k(u.title)}</span>
1166
+ ${u.hint?`<span class="h sr-only" id="bc-pick-h${f}">${k(u.hint)}</span>`:""}
1139
1167
  </button>`).join("")}
1140
1168
  </div>
1141
- ${s?`<p class="picks-note">${W}<span>Our assistant will check your account and reply here. Add anything else below, then send.</span></p>`:""}`}v.addEventListener("click",p=>{const b=p.target.closest("[data-pick]");if(!b)return;const E=x.find(l=>l.key===b.dataset.pick);if(!E)return;const r=s&&h.value.trim()===s.title;(s==null?void 0:s.key)===E.key?(s=null,r&&(h.value="")):(s=E,(!h.value.trim()||r)&&(h.value=E.title)),h.dispatchEvent(new Event("input",{bubbles:!0})),y(),s&&i.focus()}),a.agentIssues!==!1&&typeof t.agentIssues=="function"&&t.agentIssues().then(p=>{x=p,y()}).catch(()=>{}),e.pickedIssue=()=>s}function wt(e){const{client:t,scrim:a,say:h,callBtn:i,close:v}=e;let x=!1;function s(){t.callKind().then(b=>{b&&(x=!0,e.preloadCall(),i.hidden=e.mustSignIn())}).catch(()=>{})}s(),i.addEventListener("click",async()=>{e.sending=!0,h(""),e.refreshSendState(),i.disabled=!0,i.innerHTML='<span class="spinner"></span>Ringing…';try{const b=await t.startCall();y(b)}catch(b){e.sending=!1,i.disabled=!1,i.innerHTML=`${J}Talk to the team`,e.refreshSendState(),b.filed?e.succeed(b.filed,{callFailed:b.reason||"The call could not be started."}):(h(b.message.replace("[BugCatch] ","")),e.recheckSignIn())}});function y(b){const E=a.querySelector(".panel"),r=b!=null&&b.bugId?String(b.bugId).slice(0,8):null;E.innerHTML=`
1169
+ ${c?`<p class="picks-note">${O}<span>Our assistant will check your account and reply here. Add anything else below, then send.</span></p>`:""}`}h.addEventListener("click",u=>{const f=u.target.closest("[data-pick]");if(!f)return;const S=b.find(d=>d.key===f.dataset.pick);if(!S)return;const i=c&&r.value.trim()===c.title;(c==null?void 0:c.key)===S.key?(c=null,i&&(r.value="")):(c=S,(!r.value.trim()||i)&&(r.value=S.title)),r.dispatchEvent(new Event("input",{bubbles:!0})),m(),c&&s.focus()}),a.agentIssues!==!1&&typeof t.agentIssues=="function"&&t.agentIssues().then(u=>{b=u,m()}).catch(()=>{}),e.pickedIssue=()=>c}function St(e){const{client:t,scrim:a,say:r,callBtn:s,close:h}=e;let b=!1;function c(){t.callKind().then(f=>{f&&(b=!0,e.preloadCall(),s.hidden=e.mustSignIn()||e.mustRate())}).catch(()=>{})}c(),s.addEventListener("click",async()=>{e.sending=!0,r(""),e.refreshSendState(),s.disabled=!0,s.innerHTML='<span class="spinner"></span>Ringing…';try{const f=await t.startCall();m(f)}catch(f){e.sending=!1,s.disabled=!1,s.innerHTML=`${ee}Talk to the team`,e.refreshSendState(),f.filed?e.succeed(f.filed,{callFailed:f.reason||"The call could not be started."}):(r(f.message.replace("[BugCatch] ","")),e.recheckSignIn())}});function m(f){const S=a.querySelector(".panel"),i=f!=null&&f.bugId?String(f.bugId).slice(0,8):null;S.innerHTML=`
1142
1170
  <div class="call">
1143
1171
  <div class="call-head">
1144
1172
  <span class="call-dot" aria-hidden="true"></span>
1145
1173
  <strong class="call-state">Ringing…</strong>
1146
1174
  </div>
1147
1175
  <p class="call-note">
1148
- We're ringing the team now. Someone will pick up if they're free — your report${r?` <code>${$(r)}</code>`:""} is already filed either way, so nothing is lost if nobody answers.
1176
+ We're ringing the team now. Someone will pick up if they're free — your report${i?` <code>${k(i)}</code>`:""} is already filed either way, so nothing is lost if nobody answers.
1149
1177
  </p>
1150
1178
  <div class="foot">
1151
1179
  <span class="spacer"></span>
1152
1180
  <button class="primary" type="button" data-act="hangup">Cancel</button>
1153
1181
  </div>
1154
- </div>`;const l=E.querySelector(".call-state"),S=E.querySelector(".call-dot"),T={ringing:"Ringing the team…",connecting:"Someone answered — connecting…",connected:"Connected",missed:"Nobody was free",ended:"Call ended",failed:"The call dropped"},M=["ended","failed","missed"],n=t.on("call",({state:f})=>{if(l.textContent=T[f]||f,S.classList.toggle("off",M.includes(f)),M.includes(f)&&(E.querySelector('[data-act="hangup"]').textContent="Close",f==="missed")){const o=E.querySelector(".call-note");o&&(o.textContent="Nobody was free to pick up just now. Your report is filed and the team will reply in the chat.")}});E.querySelector('[data-act="hangup"]').addEventListener("click",()=>{n(),t.endCall(),v()})}function p(b,E,r){const l=document.createElement("div");l.className="livecall",l.innerHTML=`
1182
+ </div>`;const d=S.querySelector(".call-state"),v=S.querySelector(".call-dot"),E={ringing:"Ringing the team…",connecting:"Someone answered — connecting…",connected:"Connected",missed:"Nobody was free",ended:"Call ended",failed:"The call dropped"},p=["ended","failed","missed"],o=t.on("call",({state:l})=>{if(d.textContent=E[l]||l,v.classList.toggle("off",p.includes(l)),p.includes(l)&&(S.querySelector('[data-act="hangup"]').textContent="Close",l==="missed")){const n=S.querySelector(".call-note");n&&(n.textContent="Nobody was free to pick up just now. Your report is filed and the team will reply in the chat.")}});S.querySelector('[data-act="hangup"]').addEventListener("click",()=>{o(),t.endCall(),h()})}function u(f,S,i){const d=document.createElement("div");d.className="livecall",d.innerHTML=`
1155
1183
  <span class="call-dot" aria-hidden="true"></span>
1156
1184
  <span class="who" role="status" aria-live="polite">Calling the team…</span>
1157
1185
  <span class="secs" hidden></span>
1158
- ${r!=null&&r.recorded?'<span class="call-kept">This call is recorded.</span>':""}
1186
+ ${i!=null&&i.recorded?'<span class="call-kept">This call is recorded.</span>':""}
1159
1187
  <button class="act" type="button" data-act="mute" hidden>Mute</button>
1160
- <button class="act danger" type="button" data-act="hangup">Cancel</button>`,b.insertBefore(l,E);const S=l.querySelector(".who"),T=l.querySelector(".secs"),M=l.querySelector(".call-dot"),n=l.querySelector('[data-act="mute"]'),f=l.querySelector('[data-act="hangup"]');let o=null;const u=()=>{o&&(clearInterval(o),o=null)},g=d=>{u(),M.classList.add("off"),l.classList.add("over"),S.textContent=d,T.hidden=!0,n.hidden=!0,f.textContent="Dismiss",f.classList.remove("danger")},c=t.on("call",({state:d})=>{if(d==="ringing"&&(S.textContent="Calling the team…"),d==="connecting"&&(S.textContent="Someone answered — connecting…"),d==="connected"){S.textContent="You're on a call with the team",n.hidden=!1,T.hidden=!1;const k=Date.now();u(),o=setInterval(()=>{T.textContent=te(Math.floor((Date.now()-k)/1e3))},1e3),T.textContent="0s"}d==="missed"&&g("Nobody was free. Send a message instead and the team will pick it up."),d==="ended"&&g("Call ended."),d==="failed"&&g("The call dropped.")});n.addEventListener("click",()=>{const d=r.setMuted(!r.isMuted());n.textContent=d?"Unmute":"Mute",S.textContent=d?"You're muted":"You're on a call with the team"}),f.addEventListener("click",()=>{c(),u(),t.endCall(),l.remove(),e.refreshThread(e.openReportId())})}e.offerCall=s,e.callOffered=()=>x,e.showLiveCall=p}function kt(e){var c;const{client:t,say:a,compose:h,sendBtn:i,historyBtn:v,callBtn:x,whoami:s}=e;let y={mode:t.lastLoginMode||"off",signedIn:null},p="idle",b=((c=t.config.user)==null?void 0:c.email)||"",E="",r=!1,l="";const S=()=>y.mode==="required"&&!y.signedIn;function T(){const d=S();h.hidden=d,i.hidden=d,v&&(v.hidden=d),d?x.hidden=!0:e.callOffered()&&(x.hidden=!1)}function M(){var k;if(y.mode==="off"){s.hidden=!0,s.innerHTML="";return}s.hidden=!1,s.classList.toggle("asking",p!=="idle");const d=l?`<div class="after err">${$(l)}</div>`:"";if(p==="idle"){if(y.signedIn){s.innerHTML=`<span class="who">Signed in as <strong>${$(y.signedIn.email)}</strong></span><button type="button" class="link" data-act="signout">Sign out</button>`;return}const L=(k=t.config.user)==null?void 0:k.email;s.innerHTML=`<span class="who">${y.mode==="required"?"Sign in to report a bug here.":L?`Reporting as <strong>${$(L)}</strong>.`:"Reporting anonymously — sign in and we can tell you what happens next."}</span><button type="button" class="link" data-act="signin">Sign in</button>`;return}if(p==="email"){s.innerHTML=`
1188
+ <button class="act danger" type="button" data-act="hangup">Cancel</button>`,f.insertBefore(d,S);const v=d.querySelector(".who"),E=d.querySelector(".secs"),p=d.querySelector(".call-dot"),o=d.querySelector('[data-act="mute"]'),l=d.querySelector('[data-act="hangup"]');let n=null;const $=()=>{n&&(clearInterval(n),n=null)},x=g=>{$(),p.classList.add("off"),d.classList.add("over"),v.textContent=g,E.hidden=!0,o.hidden=!0,l.textContent="Dismiss",l.classList.remove("danger")},y=t.on("call",({state:g})=>{if(g==="ringing"&&(v.textContent="Calling the team…"),g==="connecting"&&(v.textContent="Someone answered — connecting…"),g==="connected"){v.textContent="You're on a call with the team",o.hidden=!1,E.hidden=!1;const L=Date.now();$(),n=setInterval(()=>{E.textContent=te(Math.floor((Date.now()-L)/1e3))},1e3),E.textContent="0s"}g==="missed"&&x("Nobody was free. Send a message instead and the team will pick it up."),g==="ended"&&x("Call ended."),g==="failed"&&x("The call dropped.")});o.addEventListener("click",()=>{const g=i.setMuted(!i.isMuted());o.textContent=g?"Unmute":"Mute",v.textContent=g?"You're muted":"You're on a call with the team"}),l.addEventListener("click",()=>{y(),$(),t.endCall(),d.remove(),e.refreshThread(e.openReportId())})}e.offerCall=c,e.callOffered=()=>b,e.showLiveCall=u}function Lt(e){var y;const{client:t,say:a,compose:r,sendBtn:s,historyBtn:h,callBtn:b,whoami:c}=e;let m={mode:t.lastLoginMode||"off",signedIn:null},u="idle",f=((y=t.config.user)==null?void 0:y.email)||"",S="",i=!1,d="";const v=()=>m.mode==="required"&&!m.signedIn;function E(){const g=v();r.hidden=g,s.hidden=g,h&&(h.hidden=g),g?b.hidden=!0:e.callOffered()&&!e.mustRate()&&(b.hidden=!1)}function p(){var L;if(m.mode==="off"){c.hidden=!0,c.innerHTML="";return}c.hidden=!1,c.classList.toggle("asking",u!=="idle");const g=d?`<div class="after err">${k(d)}</div>`:"";if(u==="idle"){if(m.signedIn){c.innerHTML=`<span class="who">Signed in as <strong>${k(m.signedIn.email)}</strong></span><button type="button" class="link" data-act="signout">Sign out</button>`;return}const M=(L=t.config.user)==null?void 0:L.email;c.innerHTML=`<span class="who">${m.mode==="required"?"Sign in to report a bug here.":M?`Reporting as <strong>${k(M)}</strong>.`:"Reporting anonymously — sign in and we can tell you what happens next."}</span><button type="button" class="link" data-act="signin">Sign in</button>`;return}if(u==="email"){c.innerHTML=`
1161
1189
  <p class="why">Sign in with any email address — we'll send you a code.
1162
- It's how you hear back about this report${y.mode==="required"?", and this project asks for it":""}.</p>
1190
+ It's how you hear back about this report${m.mode==="required"?", and this project asks for it":""}.</p>
1163
1191
  <div class="row">
1164
- <input type="email" data-fld="email" value="${$(b)}"
1192
+ <input type="email" data-fld="email" value="${k(f)}"
1165
1193
  placeholder="you@example.com" autocomplete="email" spellcheck="false"
1166
- aria-label="Your email address" ${r?"disabled":""} />
1167
- <button type="button" class="primary" data-act="code" ${r?"disabled":""}>
1168
- ${r?"Sending…":"Send code"}
1194
+ aria-label="Your email address" ${i?"disabled":""} />
1195
+ <button type="button" class="primary" data-act="code" ${i?"disabled":""}>
1196
+ ${i?"Sending…":"Send code"}
1169
1197
  </button>
1170
1198
  </div>
1171
- ${d}
1172
- ${y.mode==="optional"?'<div class="after"><button type="button" class="link" data-act="skip">Not now</button></div>':""}`;return}s.innerHTML=`
1173
- <p class="why">We sent a code to <strong>${$(b)}</strong>. It expires in ten minutes.</p>
1199
+ ${g}
1200
+ ${m.mode==="optional"?'<div class="after"><button type="button" class="link" data-act="skip">Not now</button></div>':""}`;return}c.innerHTML=`
1201
+ <p class="why">We sent a code to <strong>${k(f)}</strong>. It expires in ten minutes.</p>
1174
1202
  <div class="row">
1175
- <input type="text" class="code" data-fld="code" value="${$(E)}"
1203
+ <input type="text" class="code" data-fld="code" value="${k(S)}"
1176
1204
  placeholder="123456" inputmode="numeric" autocomplete="one-time-code"
1177
- maxlength="8" aria-label="The code we emailed you" ${r?"disabled":""} />
1178
- <button type="button" class="primary" data-act="confirm" ${r?"disabled":""}>
1179
- ${r?"Checking…":"Sign in"}
1205
+ maxlength="8" aria-label="The code we emailed you" ${i?"disabled":""} />
1206
+ <button type="button" class="primary" data-act="confirm" ${i?"disabled":""}>
1207
+ ${i?"Checking…":"Sign in"}
1180
1208
  </button>
1181
1209
  </div>
1182
- ${d}
1210
+ ${g}
1183
1211
  <div class="after">
1184
- <button type="button" class="link" data-act="resend" ${r?"disabled":""}>Send it again</button>
1185
- <button type="button" class="link" data-act="signin-back" ${r?"disabled":""}>Use another address</button>
1186
- </div>`}function n({focus:d=!1}={}){var L;if(M(),T(),!d||r)return;const k=s.querySelector("[data-fld]");k&&(k.focus(),(L=k.setSelectionRange)==null||L.call(k,k.value.length,k.value.length))}s.addEventListener("input",d=>{const k=d.target.closest("[data-fld]");k&&(k.dataset.fld==="email"?b=k.value:E=k.value)}),s.addEventListener("keydown",d=>{d.key!=="Enter"||!d.target.closest("[data-fld]")||(d.preventDefault(),p==="email"?f():o())});async function f({resent:d=!1}={}){const k=b.trim();if(!k){l="Enter the address to send the code to.",n({focus:!0});return}r=!0,l="",n();try{await t.signIn(k),b=k,d||(E=""),p="code"}catch(L){l=L.message}finally{r=!1,n({focus:!0})}}async function o(){const d=E.trim();if(!d){l="Enter the code we emailed you.",n({focus:!0});return}r=!0,l="",n();try{const k=await t.confirmSignIn(b.trim(),d);y.signedIn=k,p="idle",E="",a(""),e.offerCall()}catch(k){l=k.message}finally{r=!1,n({focus:p!=="idle"})}}s.addEventListener("click",async d=>{const k=d.target.closest("button[data-act]");if(!k)return;const L=k.dataset.act;if(L==="signin"){p="email",l="",n({focus:!0});return}if(L==="skip"){p="idle",l="",n();return}if(L==="signin-back"){p="email",l="",E="",n({focus:!0});return}if(L==="code"){f();return}if(L==="resend"){f({resent:!0});return}if(L==="confirm"){o();return}if(L==="signout"){r=!0,n();try{await t.signOut()}finally{y.signedIn=null,r=!1,p=y.mode==="required"?"email":"idle",n({focus:p!=="idle"})}}});async function u({announce:d=!1}={}){const k=await t.loginState();y={mode:k.mode,signedIn:k.signedIn},t.lastLoginMode=k.mode,S()&&p==="idle"&&(p="email"),y.signedIn&&(p="idle"),d&&k.signedOutReason&&a(k.signedOutReason,"info"),n()}u({announce:!0}).catch(()=>{});function g(){y.mode!=="off"&&u().catch(()=>{})}e.mustSignIn=S,e.recheckSignIn=g}const $t=/Did this answer your question\?/i;function Te(e){const t=e||[];if(!t.length)return"";let a=null,h=null;return t.map(i=>{var b,E,r,l;const v=K(i.at),x=v&&v!==a?`<div class="day-sep" role="separator">${$(Ze(i.at))}</div>`:"";if(x&&(a=v,h=null),!i.from)return h=null,x+Lt(i);const s={from:i.from,author:(b=i.reply)==null?void 0:b.author,automated:(E=i.reply)==null?void 0:E.automated,body:(r=i.reply)==null?void 0:r.body,at:i.at,attachments:(l=i.reply)==null?void 0:l.attachments},y=St(s),p=h&&h.who===y&&Math.abs(new Date(i.at).getTime()-new Date(h.at).getTime())<5*6e4;return h={who:y,at:i.at},x+ze(s,p?"cont":"")}).join("")}function St(e){return e.from==="reporter"?"me":e.automated?"assistant":`team:${e.author||""}`}function Lt(e){const t=ge(e.at);return`
1187
- <div class="sys k-${$(e.kind)}">
1188
- <span class="dot" aria-hidden="true"></span>${$(e.summary||"")}${t?`
1189
- <span class="t">· ${$(t)}</span>`:""}
1190
- </div>`}function ze(e,t=""){const a=e.from==="reporter",h=e.body||"",i=e.attachments||[],v=!a&&!!e.automated,x=h?`<span class="msg-text">${$(h)}</span>`:"",s=i.length?`<div class="att">${i.map(Mt).join("")}</div>`:"";let y="",p="";if(v)y='<span class="msg-who auto">Assistant <span class="tag">AI</span></span>',p='<span class="av bot orb" aria-hidden="true"></span>';else if(!a){const E=e.author||"Support team";y=`<span class="msg-who">${$(E)}</span>`,p=`<span class="av" aria-hidden="true">${$(Ue(E))}</span>`}t.includes("cont")&&(y="");const b=v&&/it goes to the same person/i.test(h)?`<div class="quick" role="group" aria-label="Answer">
1191
- <button type="button" data-quick="Yes, this is the problem">${W}That's right</button>
1212
+ <button type="button" class="link" data-act="resend" ${i?"disabled":""}>Send it again</button>
1213
+ <button type="button" class="link" data-act="signin-back" ${i?"disabled":""}>Use another address</button>
1214
+ </div>`}function o({focus:g=!1}={}){var M;if(p(),E(),!g||i)return;const L=c.querySelector("[data-fld]");L&&(L.focus(),(M=L.setSelectionRange)==null||M.call(L,L.value.length,L.value.length))}c.addEventListener("input",g=>{const L=g.target.closest("[data-fld]");L&&(L.dataset.fld==="email"?f=L.value:S=L.value)}),c.addEventListener("keydown",g=>{g.key!=="Enter"||!g.target.closest("[data-fld]")||(g.preventDefault(),u==="email"?l():n())});async function l({resent:g=!1}={}){const L=f.trim();if(!L){d="Enter the address to send the code to.",o({focus:!0});return}i=!0,d="",o();try{await t.signIn(L),f=L,g||(S=""),u="code"}catch(M){d=M.message}finally{i=!1,o({focus:!0})}}async function n(){const g=S.trim();if(!g){d="Enter the code we emailed you.",o({focus:!0});return}i=!0,d="",o();try{const L=await t.confirmSignIn(f.trim(),g);m.signedIn=L,u="idle",S="",a(""),e.offerCall()}catch(L){d=L.message}finally{i=!1,o({focus:u!=="idle"})}}c.addEventListener("click",async g=>{const L=g.target.closest("button[data-act]");if(!L)return;const M=L.dataset.act;if(M==="signin"){u="email",d="",o({focus:!0});return}if(M==="skip"){u="idle",d="",o();return}if(M==="signin-back"){u="email",d="",S="",o({focus:!0});return}if(M==="code"){l();return}if(M==="resend"){l({resent:!0});return}if(M==="confirm"){n();return}if(M==="signout"){i=!0,o();try{await t.signOut()}finally{m.signedIn=null,i=!1,u=m.mode==="required"?"email":"idle",o({focus:u!=="idle"})}}});async function $({announce:g=!1}={}){const L=await t.loginState();m={mode:L.mode,signedIn:L.signedIn},t.lastLoginMode=L.mode,v()&&u==="idle"&&(u="email"),m.signedIn&&(u="idle"),g&&L.signedOutReason&&a(L.signedOutReason,"info"),o()}$({announce:!0}).catch(()=>{});function x(){m.mode!=="off"&&$().catch(()=>{})}e.mustSignIn=v,e.recheckSignIn=x}const Et=/Did this answer your question\?/i;function qe(e){const t=e||[];if(!t.length)return"";let a=null,r=null;return t.map(s=>{var f,S,i,d;const h=K(s.at),b=h&&h!==a?`<div class="day-sep" role="separator">${k(Je(s.at))}</div>`:"";if(b&&(a=h,r=null),!s.from)return r=null,b+Tt(s);const c={from:s.from,author:(f=s.reply)==null?void 0:f.author,automated:(S=s.reply)==null?void 0:S.automated,body:(i=s.reply)==null?void 0:i.body,at:s.at,attachments:(d=s.reply)==null?void 0:d.attachments},m=Mt(c),u=r&&r.who===m&&Math.abs(new Date(s.at).getTime()-new Date(r.at).getTime())<5*6e4;return r={who:m,at:s.at},b+ze(c,u?"cont":"")}).join("")}function Mt(e){return e.from==="reporter"?"me":e.automated?"assistant":`team:${e.author||""}`}function Tt(e){const t=me(e.at);return`
1215
+ <div class="sys k-${k(e.kind)}">
1216
+ <span class="dot" aria-hidden="true"></span>${k(e.summary||"")}${t?`
1217
+ <span class="t">· ${k(t)}</span>`:""}
1218
+ </div>`}function ze(e,t=""){const a=e.from==="reporter",r=e.body||"",s=e.attachments||[],h=!a&&!!e.automated,b=r?`<span class="msg-text">${k(r)}</span>`:"",c=s.length?`<div class="att">${s.map(qt).join("")}</div>`:"";let m="",u="";if(h)m='<span class="msg-who auto">Assistant <span class="tag">AI</span></span>',u='<span class="av bot orb" aria-hidden="true"></span>';else if(!a){const S=e.author||"Support team";m=`<span class="msg-who">${k(S)}</span>`,u=`<span class="av" aria-hidden="true">${k(Xe(S))}</span>`}t.includes("cont")&&(m="");const f=h&&/it goes to the same person/i.test(r)?`<div class="quick" role="group" aria-label="Answer">
1219
+ <button type="button" data-quick="Yes, this is the problem">${O}That's right</button>
1192
1220
  <button type="button" data-quick="No, that is not the problem">That's not it</button>
1193
- </div>`:v&&$t.test(h)?`<div class="quick" role="group" aria-label="Did this answer your question?">
1194
- <button type="button" data-quick="Yes, that answers it">${W}Yes, that answers it</button>
1221
+ </div>`:h&&Et.test(r)?`<div class="quick" role="group" aria-label="Did this answer your question?">
1222
+ <button type="button" data-quick="Yes, that answers it">${O}Yes, that answers it</button>
1195
1223
  <button type="button" data-quick="No, I still need help">No, I still need help</button>
1196
1224
  </div>`:"";return`
1197
- <div class="msg-row ${a?"mine":"theirs"} ${v?"auto":""} ${t}">
1198
- ${p}
1199
- ${y}
1200
- <div class="bubble ${h?"":"silent"}">${x}${s}</div>
1201
- ${b}
1202
- <span class="msg-when">${$(ge(e.at)||ee(e.at))}</span>
1203
- </div>`}function Et(){return`
1225
+ <div class="msg-row ${a?"mine":"theirs"} ${h?"auto":""} ${t}">
1226
+ ${u}
1227
+ ${m}
1228
+ <div class="bubble ${r?"":"silent"}">${b}${c}</div>
1229
+ ${f}
1230
+ <span class="msg-when">${k(me(e.at)||Z(e.at))}</span>
1231
+ </div>`}function Qt(){return`
1204
1232
  <div class="typing-row">
1205
1233
  <span class="av bot orb" aria-hidden="true"></span>
1206
1234
  <span class="msg-who auto">Assistant <span class="tag">AI</span></span>
1207
1235
  <div class="bubble typing" role="img" aria-label="The assistant is working on it"><i></i><i></i><i></i></div>
1208
- </div>`}function Mt(e){const t=$(e.name||"attachment");if(!e.url)return`<span class="file"><span class="nm">${t}</span></span>`;const a=$(e.url);return e.type==="SCREENSHOT"?`<a href="${a}" target="_blank" rel="noopener noreferrer"><img src="${a}" alt="${t}" loading="lazy"></a>`:e.type==="AUDIO"?`<audio controls preload="metadata" src="${a}"></audio>`:e.type==="VIDEO"?`<video controls preload="metadata" src="${a}"></video>`:`
1236
+ </div>`}function qt(e){const t=k(e.name||"attachment");if(!e.url)return`<span class="file"><span class="nm">${t}</span></span>`;const a=k(e.url);return e.type==="SCREENSHOT"?`<a href="${a}" target="_blank" rel="noopener noreferrer"><img src="${a}" alt="${t}" loading="lazy"></a>`:e.type==="AUDIO"?`<audio controls preload="metadata" src="${a}"></audio>`:e.type==="VIDEO"?`<video controls preload="metadata" src="${a}"></video>`:`
1209
1237
  <a class="file" href="${a}" target="_blank" rel="noopener noreferrer" download>
1210
1238
  <span class="nm">${t}</span>
1211
- ${e.size?`<span class="sz">${$(_(e.size))}</span>`:""}
1212
- </a>`}function Qt(e,t,a,h){var g;const{client:i,cfg:v}=e,x=document.createElement("div");x.className="composer",x.innerHTML=`
1239
+ ${e.size?`<span class="sz">${k(_(e.size))}</span>`:""}
1240
+ </a>`}function zt(e,t,a,r){var x;const{client:s,cfg:h}=e,b=document.createElement("div");b.className="composer",b.innerHTML=`
1213
1241
  <div class="staged" hidden></div>
1214
1242
  <div class="row">
1215
1243
  <div class="tools">
1216
- ${v.attachments===!1?"":`
1217
- <button class="tool" type="button" data-act="attach" title="Attach a file" aria-label="Attach a file">${ue}</button>
1218
- <button class="tool" type="button" data-act="voice" title="Record a voice note" aria-label="Record a voice note">${he}</button>`}
1219
- <button class="tool" type="button" data-act="livecall" title="Call the team" aria-label="Call the team" hidden>${J}</button>
1244
+ ${h.attachments===!1?"":`
1245
+ <button class="tool" type="button" data-act="attach" title="Attach a file" aria-label="Attach a file">${he}</button>
1246
+ <button class="tool" type="button" data-act="voice" title="Record a voice note" aria-label="Record a voice note">${fe}</button>`}
1247
+ <button class="tool" type="button" data-act="livecall" title="Call the team" aria-label="Call the team" hidden>${ee}</button>
1220
1248
  </div>
1221
1249
  <textarea rows="1" placeholder="Write a reply…" aria-label="Write a reply"></textarea>
1222
1250
  <button class="send" type="button" data-act="send" title="Send" aria-label="Send" disabled>${be}</button>
1223
1251
  </div>
1224
1252
  <div class="note" hidden></div>
1225
- <input type="file" hidden multiple accept="${ve.join(",")}">`,t.appendChild(x);const s=x.querySelector(".staged"),y=x.querySelector("textarea"),p=x.querySelector('[data-act="send"]'),b=x.querySelector('[data-act="voice"]'),E=x.querySelector('[data-act="livecall"]'),r=x.querySelector("input[type=file]"),l=x.querySelector(".note"),S=[];let T=null,M=!1;function n(c,d=""){l.hidden=!c,l.className=`note ${d}`,l.textContent=c||""}function f(){const c=S.filter(d=>d.storageKey);p.disabled=M||!y.value.trim()&&!c.length,s.hidden=!S.length,s.innerHTML=S.map((d,k)=>`
1226
- <span class="chip ${d.storageKey?"":"uploading"}">
1227
- <span class="nm">${$(d.name)}</span>
1228
- <span class="sz">${d.storageKey?_(d.size):"sending…"}</span>
1229
- <button type="button" data-drop="${k}" aria-label="Remove ${$(d.name)}">${X}</button>
1230
- </span>`).join("");for(const d of s.querySelectorAll("[data-drop]"))d.addEventListener("click",()=>{S.splice(Number(d.dataset.drop),1),f()})}async function o(c,d,k){const L={name:k,size:c.size,storageKey:null};S.push(L),f();try{const{storageKey:H,mime:j}=await i.uploadAttachment(c,d);L.storageKey=H,L.mime=j}catch(H){S.splice(S.indexOf(L),1),n(H.message||"That file could not be sent.","err")}f()}y.addEventListener("input",()=>{y.style.height="auto",y.style.height=`${Math.min(y.scrollHeight,120)}px`,f()}),y.addEventListener("keydown",c=>{c.key==="Enter"&&!c.shiftKey&&!c.isComposing&&(c.preventDefault(),u())}),(g=x.querySelector('[data-act="attach"]'))==null||g.addEventListener("click",()=>r.click()),r.addEventListener("change",()=>{n("");for(const c of r.files){if(c.size>i.config.maxAttachmentBytes){n(`${c.name} is larger than ${_(i.config.maxAttachmentBytes)}.`,"err");continue}o(c,c.type,c.name)}r.value=""}),b&&!Ge()&&(b.disabled=!0,b.title="This browser cannot record audio"),b==null||b.addEventListener("click",async()=>{if(T){const c=T;T=null,b.classList.remove("recording"),b.innerHTML=he,n("");const{blob:d,mime:k}=await c.stop();d.size&&o(d,k,"Voice note");return}try{n(""),T=await nt({maxMs:i.config.maxRecordingMs,onTick:c=>n(`Recording — ${te(c)}. Tap the mic to stop.`),onAutoStop:()=>b.click()}),b.classList.add("recording"),b.innerHTML=Oe}catch{T=null,n("The microphone is not available — check the browser permission.","err")}}),i.canCallTeam(h).then(c=>{c&&(E.hidden=!1,e.preloadCall())}).catch(()=>{}),E.addEventListener("click",async()=>{E.disabled=!0,n("");try{const c=await i.startLiveCall(h);e.showLiveCall(t,a,c)}catch(c){n(c.message.replace("[BugCatch] ",""),"err")}finally{E.disabled=!1}}),p.addEventListener("click",u),a.addEventListener("click",c=>{var k,L;const d=(L=(k=c.target).closest)==null?void 0:L.call(k,"[data-quick]");!d||M||(y.value=d.dataset.quick,u())});async function u(){var k;const c=y.value.trim(),d=S.filter(L=>L.storageKey);if(!(M||!c&&!d.length)){M=!0,f(),n(""),a.insertAdjacentHTML("beforeend",ze({from:"reporter",body:c,at:new Date().toISOString(),attachments:d.map(L=>({type:"FILE",name:L.name,size:L.size}))},"pending")),U(a,{smooth:!0});try{await i.replyToReport(h,{body:c,attachments:d.map(L=>({storageKey:L.storageKey,mime:L.mime,name:L.name,size:L.size}))}),y.value="",y.style.height="auto",S.length=0,await e.refreshThread(h)}catch(L){(k=a.querySelector(".msg-row.pending"))==null||k.classList.replace("pending","failed"),n(L.message||"That could not be sent — try again.","err")}finally{M=!1,f()}}}f()}const ce=new WeakMap;function qe(e){return JSON.stringify(e?[e.score,e.current,e.comment||null]:null)}function Tt(e){return e.rating?` · <span class="rated" aria-label="You rated this ${Number(e.rating)} out of 5">${fe}${Number(e.rating)}</span>`:e.ratingAsked?' · <span class="rate-ask">Rate it</span>':""}function zt(e){var M;const{client:t,scrim:a,close:h}=e;let i=null;function v(n,{callFailed:f=null}={}){if(n!=null&&n.id&&!f){y(n.id,{fresh:!0}).then(o=>{o||x(n,{callFailed:f})});return}x(n,{callFailed:f})}function x(n,{callFailed:f=null}={}){var c;const o=n!=null&&n.id?String(n.id).slice(0,8):null,u=(c=n==null?void 0:n.estimate)!=null&&c.label?String(n.estimate.label):null,g=f?`<p class="eta">${$(f)} Your report is filed, and the team will reply in the chat.</p>`:"";a.querySelector(".panel").innerHTML=`
1253
+ <input type="file" hidden multiple accept="${we.join(",")}">`,t.appendChild(b);const c=b.querySelector(".staged"),m=b.querySelector("textarea"),u=b.querySelector('[data-act="send"]'),f=b.querySelector('[data-act="voice"]'),S=b.querySelector('[data-act="livecall"]'),i=b.querySelector("input[type=file]"),d=b.querySelector(".note"),v=[];let E=null,p=!1;function o(y,g=""){d.hidden=!y,d.className=`note ${g}`,d.textContent=y||""}function l(){const y=v.filter(g=>g.storageKey);u.disabled=p||!m.value.trim()&&!y.length,c.hidden=!v.length,c.innerHTML=v.map((g,L)=>`
1254
+ <span class="chip ${g.storageKey?"":"uploading"}">
1255
+ <span class="nm">${k(g.name)}</span>
1256
+ <span class="sz">${g.storageKey?_(g.size):"sending…"}</span>
1257
+ <button type="button" data-drop="${L}" aria-label="Remove ${k(g.name)}">${J}</button>
1258
+ </span>`).join("");for(const g of c.querySelectorAll("[data-drop]"))g.addEventListener("click",()=>{v.splice(Number(g.dataset.drop),1),l()})}async function n(y,g,L){const M={name:L,size:y.size,storageKey:null};v.push(M),l();try{const{storageKey:C,mime:B}=await s.uploadAttachment(y,g);M.storageKey=C,M.mime=B}catch(C){v.splice(v.indexOf(M),1),o(C.message||"That file could not be sent.","err")}l()}m.addEventListener("input",()=>{m.style.height="auto",m.style.height=`${Math.min(m.scrollHeight,120)}px`,l()}),m.addEventListener("keydown",y=>{y.key==="Enter"&&!y.shiftKey&&!y.isComposing&&(y.preventDefault(),$())}),(x=b.querySelector('[data-act="attach"]'))==null||x.addEventListener("click",()=>i.click()),i.addEventListener("change",()=>{o("");for(const y of i.files){if(y.size>s.config.maxAttachmentBytes){o(`${y.name} is larger than ${_(s.config.maxAttachmentBytes)}.`,"err");continue}n(y,y.type,y.name)}i.value=""}),f&&!et()&&(f.disabled=!0,f.title="This browser cannot record audio"),f==null||f.addEventListener("click",async()=>{if(E){const y=E;E=null,f.classList.remove("recording"),f.innerHTML=fe,o("");const{blob:g,mime:L}=await y.stop();g.size&&n(g,L,"Voice note");return}try{o(""),E=await it({maxMs:s.config.maxRecordingMs,onTick:y=>o(`Recording — ${te(y)}. Tap the mic to stop.`),onAutoStop:()=>f.click()}),f.classList.add("recording"),f.innerHTML=We}catch{E=null,o("The microphone is not available — check the browser permission.","err")}}),s.canCallTeam(r).then(y=>{y&&(S.hidden=!1,e.preloadCall())}).catch(()=>{}),S.addEventListener("click",async()=>{S.disabled=!0,o("");try{const y=await s.startLiveCall(r);e.showLiveCall(t,a,y)}catch(y){o(y.message.replace("[BugCatch] ",""),"err")}finally{S.disabled=!1}}),u.addEventListener("click",$),a.addEventListener("click",y=>{var L,M;const g=(M=(L=y.target).closest)==null?void 0:M.call(L,"[data-quick]");!g||p||(m.value=g.dataset.quick,$())});async function $(){var L;const y=m.value.trim(),g=v.filter(M=>M.storageKey);if(!(p||!y&&!g.length)){p=!0,l(),o(""),a.insertAdjacentHTML("beforeend",ze({from:"reporter",body:y,at:new Date().toISOString(),attachments:g.map(M=>({type:"FILE",name:M.name,size:M.size}))},"pending")),U(a,{smooth:!0});try{await s.replyToReport(r,{body:y,attachments:g.map(M=>({storageKey:M.storageKey,mime:M.mime,name:M.name,size:M.size}))}),m.value="",m.style.height="auto",v.length=0,await e.refreshThread(r)}catch(M){(L=a.querySelector(".msg-row.pending"))==null||L.classList.replace("pending","failed"),o(M.message||"That could not be sent — try again.","err")}finally{p=!1,l()}}}l()}function Ce(e){return JSON.stringify(e?[e.score,e.current,e.comment||null]:null)}function ce(e,{client:t,report:a,rating:r,justRated:s=!1,question:h=null,onRated:b=null,onError:c=null}){var p;e.dataset.key=Ce(r);const m=r!=null&&r.current?r.score:0,u=r?r.current?s?"Thanks — the team will see that.":`You rated this ${r.score} out of 5.`:`You rated an earlier fix ${r.score} out of 5. How did this one go?`:h||"How did we do?",f=s&&(r==null?void 0:r.current)&&!r.comment;e.innerHTML=`
1259
+ <p class="fr-q">${k(u)}</p>
1260
+ <div class="stars" role="group" aria-label="Rate how this was handled, 1 to 5">${[1,2,3,4,5].map(o=>`
1261
+ <button type="button" data-score="${o}" aria-pressed="${o===m}" aria-label="${o} out of 5${o===1?", poor":o===5?", great":""}" class="${o<=m?"on":""}">${ge}</button>`).join("")}
1262
+ </div>
1263
+ ${r!=null&&r.current&&r.comment?`<p class="fr-said">“${k(r.comment)}”</p>`:""}
1264
+ ${f?`
1265
+ <div class="fr-note">
1266
+ <textarea maxlength="2000" aria-label="Add a note to your rating" placeholder="${r.score<=2?"What went wrong? (optional)":"Anything to add? (optional)"}"></textarea>
1267
+ <button type="button" data-act="rating-note">Add note</button>
1268
+ </div>`:""}
1269
+ ${r?"":'<p class="fr-hint">1 is poor, 5 is great.</p>'}
1270
+ <p class="feedback-status" role="status"></p>`;const S=[...e.querySelectorAll("[data-score]")],i=o=>S.forEach(l=>l.classList.toggle("on",Number(l.dataset.score)<=o)),d=o=>e.querySelectorAll("button, textarea").forEach(l=>{l.disabled=o}),v=e.querySelector(".feedback-status");async function E(o,l){var n;d(!0),v.textContent="";try{const $=await t.rate(a.id,{score:o,comment:l});ce(e,{client:t,report:a,rating:$,justRated:!0,question:h,onRated:b,onError:c}),(n=e.querySelector(".fr-note textarea"))==null||n.focus(),b==null||b($)}catch($){v.textContent=$.message,d(!1),i(m),c==null||c($)}}for(const o of S){const l=Number(o.dataset.score);o.addEventListener("mouseenter",()=>i(l)),o.addEventListener("focus",()=>i(l)),o.addEventListener("blur",()=>i(m)),o.addEventListener("click",()=>E(l))}e.querySelector(".stars").addEventListener("mouseleave",()=>i(m)),(p=e.querySelector('[data-act="rating-note"]'))==null||p.addEventListener("click",()=>{var l;const o=e.querySelector(".fr-note textarea").value.trim();if(!o){(l=e.querySelector(".fr-note"))==null||l.remove();return}E(r.score,o)})}const de=new WeakMap;function Ct(e){return e.rating?` · <span class="rated" aria-label="You rated this ${Number(e.rating)} out of 5">${ge}${Number(e.rating)}</span>`:e.ratingAsked?' · <span class="rate-ask">Rate it</span>':""}function Ht(e){var E;const{client:t,scrim:a,close:r}=e;let s=null;function h(p,{callFailed:o=null}={}){if(p!=null&&p.id&&!o){m(p.id,{fresh:!0}).then(l=>{l||b(p,{callFailed:o})});return}b(p,{callFailed:o})}function b(p,{callFailed:o=null}={}){var x;const l=p!=null&&p.id?String(p.id).slice(0,8):null,n=(x=p==null?void 0:p.estimate)!=null&&x.label?String(p.estimate.label):null,$=o?`<p class="eta">${k(o)} Your report is filed, and the team will reply in the chat.</p>`:"";a.querySelector(".panel").innerHTML=`
1231
1271
  <div class="done">
1232
- <div class="tick">${W}</div>
1272
+ <div class="tick">${O}</div>
1233
1273
  <h3>Thanks — that's on its way.</h3>
1234
- <p>${o?`Filed as <code>${$(o)}</code>.`:"The team has what they need to reproduce it."}</p>
1235
- ${g}
1236
- ${u?`<p class="eta">Reports like this usually take <strong>${$(u)}</strong>. We'll let you know when it moves.</p>`:""}
1237
- </div>`,setTimeout(h,g?6e3:u?4e3:2e3)}async function s(){const n=a.querySelector(".panel");clearTimeout(p),i=null,n.classList.remove("is-chat"),n.innerHTML=`
1274
+ <p>${l?`Filed as <code>${k(l)}</code>.`:"The team has what they need to reproduce it."}</p>
1275
+ ${$}
1276
+ ${n?`<p class="eta">Reports like this usually take <strong>${k(n)}</strong>. We'll let you know when it moves.</p>`:""}
1277
+ </div>`,setTimeout(r,$?6e3:n?4e3:2e3)}async function c(){const p=a.querySelector(".panel");clearTimeout(u),s=null,p.classList.remove("is-chat"),p.innerHTML=`
1238
1278
  ${re({title:"Your reports",sub:"Where each one has got to.",theme:e.themeLabel()})}
1239
- <div class="history" aria-busy="true">${_e(3)}</div>`,n.querySelector('[data-act="close"]').addEventListener("click",h);let f=[];try{({reports:f}=await t.myReports())}catch{const u=n.querySelector(".history");u&&(u.innerHTML=ie("Couldn't load your reports just now.",Y));return}const o=n.querySelector(".history");if(o){o.removeAttribute("aria-busy"),o.innerHTML=f.length?f.map((u,g)=>`
1240
- <button class="row" type="button" data-report="${$(u.id)}" style="animation-delay:${Math.min(g,8)*30}ms">
1241
- <span class="row-ico" aria-hidden="true">${He}</span>
1279
+ <div class="history" aria-busy="true">${Ze(3)}</div>`,p.querySelector('[data-act="close"]').addEventListener("click",r);let o=[];try{({reports:o}=await t.myReports())}catch{const n=p.querySelector(".history");n&&(n.innerHTML=ie("Couldn't load your reports just now.",F));return}const l=p.querySelector(".history");if(l){l.removeAttribute("aria-busy"),l.innerHTML=o.length?o.map((n,$)=>`
1280
+ <button class="row" type="button" data-report="${k(n.id)}" style="animation-delay:${Math.min($,8)*30}ms">
1281
+ <span class="row-ico" aria-hidden="true">${Ie}</span>
1242
1282
  <span class="who">
1243
- <span class="ttl">${$(u.title)}</span>
1244
- <span class="sub">${$(u.reference)} · ${$(ee(u.createdAt))}${Tt(u)}</span>
1283
+ <span class="ttl">${k(n.title)}</span>
1284
+ <span class="sub">${k(n.reference)} · ${k(Z(n.createdAt))}${Ct(n)}</span>
1245
1285
  </span>
1246
- <span class="pill ${$(String(u.status).toLowerCase())}">${$(se(u.status))}</span>
1247
- <span class="chev" aria-hidden="true">${Pe}</span>
1248
- </button>`).join(""):ie("You haven't reported anything yet.",We);for(const u of o.querySelectorAll("[data-report]"))u.addEventListener("click",()=>y(u.dataset.report))}}async function y(n,{fresh:f=!1}={}){var k;const o=a.querySelector(".panel");clearTimeout(p),o.classList.add("is-chat"),o.innerHTML=`
1249
- ${re({back:!0,title:f?"Looking into it":"Your report",sub:f?"It may ask you a question here.":"Updates, and a way to reply.",theme:e.themeLabel()})}
1250
- <div class="history chatting" aria-busy="true"><div class="thread">${Ke()}</div></div>`,o.querySelector('[data-act="close"]').addEventListener("click",h),o.querySelector('[data-act="back"]').addEventListener("click",s);let u=null;try{u=await t.myReport(n)}catch{u=null}const g=o.querySelector(".history");if(!g||!o.querySelector('[data-act="back"]'))return!1;if(!u)return f?(o.classList.remove("is-chat"),!1):(g.removeAttribute("aria-busy"),g.innerHTML=ie("Couldn't load that report just now.",Y),!1);i=n,t.markReportRead(n);const c=Te(u.timeline);g.classList.add("chatting"),g.removeAttribute("aria-busy"),g.innerHTML=`
1286
+ <span class="pill ${k(String(n.status).toLowerCase())}">${k(se(n.status))}</span>
1287
+ <span class="chev" aria-hidden="true">${Fe}</span>
1288
+ </button>`).join(""):ie("You haven't reported anything yet.",_e);for(const n of l.querySelectorAll("[data-report]"))n.addEventListener("click",()=>m(n.dataset.report))}}async function m(p,{fresh:o=!1}={}){var g;const l=a.querySelector(".panel");clearTimeout(u),l.classList.add("is-chat"),l.innerHTML=`
1289
+ ${re({back:!0,title:o?"Looking into it":"Your report",sub:o?"It may ask you a question here.":"Updates, and a way to reply.",theme:e.themeLabel()})}
1290
+ <div class="history chatting" aria-busy="true"><div class="thread">${Ge()}</div></div>`,l.querySelector('[data-act="close"]').addEventListener("click",r),l.querySelector('[data-act="back"]').addEventListener("click",c);let n=null;try{n=await t.myReport(p)}catch{n=null}const $=l.querySelector(".history");if(!$||!l.querySelector('[data-act="back"]'))return!1;if(!n)return o?(l.classList.remove("is-chat"),!1):($.removeAttribute("aria-busy"),$.innerHTML=ie("Couldn't load that report just now.",F),!1);s=p,t.markReportRead(p);const x=qe(n.timeline);$.classList.add("chatting"),$.removeAttribute("aria-busy"),$.innerHTML=`
1251
1291
  <div class="report-head">
1252
- <span class="ttl">${$(u.title)}</span>
1253
- <span class="sub">${$(u.reference)} · ${$(u.project||"")}</span>
1254
- <span class="pill ${$(String(u.status).toLowerCase())}">${$(se(u.status))}</span>
1255
- ${(k=u.estimate)!=null&&k.label?`<span class="eta-line">Usually takes ${$(String(u.estimate.label))}</span>`:""}
1292
+ <span class="ttl">${k(n.title)}</span>
1293
+ <span class="sub">${k(n.reference)} · ${k(n.project||"")}</span>
1294
+ <span class="pill ${k(String(n.status).toLowerCase())}">${k(se(n.status))}</span>
1295
+ ${(g=n.estimate)!=null&&g.label?`<span class="eta-line">Usually takes ${k(String(n.estimate.label))}</span>`:""}
1256
1296
  </div>
1257
- <div class="thread" role="log" aria-live="polite" aria-label="Conversation">${c}</div>`;const d=g.querySelector(".thread");return ce.set(d,c),U(d),E(g,u),r(g,u),u.canReply&&Qt(e,g,d,n),b(g,u,n),U(d),!0}let p=null;function b(n,f,o){var w,z,A;clearTimeout(p);const u=f.assistant,g=n.querySelector(".thread");let c=n.querySelector(".assistant");if(!u){c==null||c.remove(),(w=g==null?void 0:g.querySelector(".typing-row"))==null||w.remove();return}const d=(c==null?void 0:c.dataset.phase)||null;c||(c=document.createElement("div"),c.setAttribute("role","status"),c.setAttribute("aria-live","polite"),(z=n.querySelector(".report-head"))==null||z.after(c)),c.className=`assistant ${$(u.phase)}`,c.dataset.phase=u.phase;const k=u.steps||[],L=k.filter(I=>I.state==="done").length,H=k.some(I=>I.state==="active")?.5:0,j=k.length?Math.round((L+H)/k.length*100):0,N=`
1258
- <div class="as-body${d&&d!==u.phase?" entering":""}">
1297
+ <div class="thread" role="log" aria-live="polite" aria-label="Conversation">${x}</div>`;const y=$.querySelector(".thread");return de.set(y,x),U(y),S($,n),i($,n),n.canReply&&zt(e,$,y,p),f($,n,p),U(y),!0}let u=null;function f(p,o,l){var W,T,H;clearTimeout(u);const n=o.assistant,$=p.querySelector(".thread");let x=p.querySelector(".assistant");if(!n){x==null||x.remove(),(W=$==null?void 0:$.querySelector(".typing-row"))==null||W.remove();return}const y=(x==null?void 0:x.dataset.phase)||null;x||(x=document.createElement("div"),x.setAttribute("role","status"),x.setAttribute("aria-live","polite"),(T=p.querySelector(".report-head"))==null||T.after(x)),x.className=`assistant ${k(n.phase)}`,x.dataset.phase=n.phase;const g=n.steps||[],L=g.filter(z=>z.state==="done").length,M=g.some(z=>z.state==="active")?.5:0,C=g.length?Math.round((L+M)/g.length*100):0,B=`
1298
+ <div class="as-body${y&&y!==n.phase?" entering":""}">
1259
1299
  <div class="as-top">
1260
- <span class="as-orb${u.phase==="calling"||u.phase==="resolved"?"":" orb"}" aria-hidden="true">${u.phase==="calling"?J:u.phase==="resolved"?W:""}</span>
1300
+ <span class="as-orb${n.phase==="calling"||n.phase==="resolved"?"":" orb"}" aria-hidden="true">${n.phase==="calling"?ee:n.phase==="resolved"?O:""}</span>
1261
1301
  <div class="as-text">
1262
- <div class="as-title">${$(u.title)}</div>
1263
- <div class="as-detail">${$(u.detail)}</div>
1302
+ <div class="as-title">${k(n.title)}</div>
1303
+ <div class="as-detail">${k(n.detail)}</div>
1264
1304
  </div>
1265
1305
  </div>
1266
1306
  </div>
1267
- ${k.length?`
1268
- <div class="as-progress" role="progressbar" aria-label="Progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="${j}"><i style="width:${j}%"></i></div>
1269
- <ol class="as-steps">${k.map(I=>`<li class="${$(I.state)}"${I.state==="active"?' aria-current="step"':""}><span class="dot"></span><span class="lbl">${$(I.label)}</span></li>`).join("")}</ol>`:""}`,B=JSON.stringify([u.phase,u.title,u.detail,k]);if(c.dataset.key!==B){const I=c.querySelector(".as-progress i"),D=I==null?void 0:I.style.width;c.innerHTML=N,c.dataset.key=B;const O=c.querySelector(".as-progress i");O&&D&&(O.style.width=D,requestAnimationFrame(()=>{O.style.width=`${j}%`}))}if(g){const I=me(g),D=g.querySelector(".typing-row");u.phase!=="analyzing"?D==null||D.remove():(!D||D!==g.lastElementChild)&&(D==null||D.remove(),g.insertAdjacentHTML("beforeend",Et()),I&&U(g))}u.phase==="analyzing"?p=setTimeout(()=>S(o),3e3):u.phase==="calling"?p=setTimeout(()=>S(o),1e4):u.phase==="needs_info"&&d!=="needs_info"&&((A=n.querySelector(".composer textarea"))==null||A.focus())}function E(n,f){var u,g;if((u=n.querySelector(".fix-verification"))==null||u.remove(),!f.resolvedAt||!["RESOLVED","CLOSED"].includes(f.status))return;const o=document.createElement("div");o.className="fix-verification",f.verification?o.textContent=f.verification==="CONFIRMED"?"You confirmed that this fix works.":"Your feedback was recorded.":(o.innerHTML='<p>Does the fix work for you?</p><textarea maxlength="4000" aria-label="Fix feedback" placeholder="What happens when you try again? (optional)"></textarea><button type="button" data-result="CONFIRMED">It works now</button> <button type="button" data-result="STILL_HAPPENING">Still happening</button><p class="feedback-status" role="status"></p>',o.querySelectorAll("[data-result]").forEach(c=>{c.onclick=async()=>{o.querySelectorAll("button").forEach(d=>{d.disabled=!0});try{await t.verifyFix(f.id,{result:c.dataset.result,resolvedAt:f.resolvedAt,note:o.querySelector("textarea").value}),await y(f.id)}catch(d){o.querySelector(".feedback-status").textContent=d.message,o.querySelectorAll("button").forEach(k=>{k.disabled=!1})}}})),(g=n.querySelector(".report-head"))==null||g.after(o)}function r(n,f){var g;let o=n.querySelector(".fix-rating");if(!["RESOLVED","CLOSED"].includes(f.status)||!f.ratingAsked){o==null||o.remove();return}o&&o.dataset.key===qe(f.rating)||(o||(o=document.createElement("div"),o.className="fix-rating",(g=n.querySelector(".fix-verification")||n.querySelector(".report-head"))==null||g.after(o)),l(o,f,f.rating||null))}function l(n,f,o,{justRated:u=!1}={}){var B;n.dataset.key=qe(o);const g=o!=null&&o.current?o.score:0,c=o?o.current?u?"Thanks — the team will see that.":`You rated this ${o.score} out of 5.`:`You rated an earlier fix ${o.score} out of 5. How did this one go?`:"How did we do?",d=u&&(o==null?void 0:o.current)&&!o.comment;n.innerHTML=`
1270
- <p class="fr-q">${$(c)}</p>
1271
- <div class="stars" role="group" aria-label="Rate how this was handled, 1 to 5">${[1,2,3,4,5].map(w=>`
1272
- <button type="button" data-score="${w}" aria-pressed="${w===g}" aria-label="${w} out of 5${w===1?", poor":w===5?", great":""}" class="${w<=g?"on":""}">${fe}</button>`).join("")}
1307
+ ${g.length?`
1308
+ <div class="as-progress" role="progressbar" aria-label="Progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="${C}"><i style="width:${C}%"></i></div>
1309
+ <ol class="as-steps">${g.map(z=>`<li class="${k(z.state)}"${z.state==="active"?' aria-current="step"':""}><span class="dot"></span><span class="lbl">${k(z.label)}</span></li>`).join("")}</ol>`:""}`,N=JSON.stringify([n.phase,n.title,n.detail,g]);if(x.dataset.key!==N){const z=x.querySelector(".as-progress i"),D=z==null?void 0:z.style.width;x.innerHTML=B,x.dataset.key=N;const j=x.querySelector(".as-progress i");j&&D&&(j.style.width=D,requestAnimationFrame(()=>{j.style.width=`${C}%`}))}if($){const z=ve($),D=$.querySelector(".typing-row");n.phase!=="analyzing"?D==null||D.remove():(!D||D!==$.lastElementChild)&&(D==null||D.remove(),$.insertAdjacentHTML("beforeend",Qt()),z&&U($))}n.phase==="analyzing"?u=setTimeout(()=>d(l),3e3):n.phase==="calling"?u=setTimeout(()=>d(l),1e4):n.phase==="needs_info"&&y!=="needs_info"&&((H=p.querySelector(".composer textarea"))==null||H.focus())}function S(p,o){var n,$;if((n=p.querySelector(".fix-verification"))==null||n.remove(),!o.resolvedAt||!["RESOLVED","CLOSED"].includes(o.status))return;const l=document.createElement("div");l.className="fix-verification",o.verification?l.textContent=o.verification==="CONFIRMED"?"You confirmed that this fix works.":"Your feedback was recorded.":(l.innerHTML='<p>Does the fix work for you?</p><textarea maxlength="4000" aria-label="Fix feedback" placeholder="What happens when you try again? (optional)"></textarea><button type="button" data-result="CONFIRMED">It works now</button> <button type="button" data-result="STILL_HAPPENING">Still happening</button><p class="feedback-status" role="status"></p>',l.querySelectorAll("[data-result]").forEach(x=>{x.onclick=async()=>{l.querySelectorAll("button").forEach(y=>{y.disabled=!0});try{await t.verifyFix(o.id,{result:x.dataset.result,resolvedAt:o.resolvedAt,note:l.querySelector("textarea").value}),await m(o.id)}catch(y){l.querySelector(".feedback-status").textContent=y.message,l.querySelectorAll("button").forEach(g=>{g.disabled=!1})}}})),($=p.querySelector(".report-head"))==null||$.after(l)}function i(p,o){var $;let l=p.querySelector(".fix-rating");if(!["RESOLVED","CLOSED"].includes(o.status)||!o.ratingAsked){l==null||l.remove();return}l&&l.dataset.key===Ce(o.rating)||(l||(l=document.createElement("div"),l.className="fix-rating",($=p.querySelector(".fix-verification")||p.querySelector(".report-head"))==null||$.after(l)),ce(l,{client:t,report:o,rating:o.rating||null}))}async function d(p){const o=a.querySelector(".history.chatting"),l=o==null?void 0:o.querySelector(".thread");if(!l||s!==p)return;let n=null;try{n=await t.myReport(p)}catch{}if(e.closed||!n||s!==p)return;S(o,n),i(o,n);const $=ve(l),x=qe(n.timeline);de.get(l)!==x&&(l.innerHTML=x,de.set(l,x)),f(o,n,p),$&&U(l);const y=o.querySelector(".report-head .pill");y&&(y.className=`pill ${String(n.status).toLowerCase()}`,y.textContent=se(n.status))}const v=t.on("update",p=>{!s||(p==null?void 0:p.bugId)!==s||(t.markReportRead(s),d(s))});e.onDestroy(()=>{v(),clearTimeout(u)}),(E=a.querySelector('[data-act="history"]'))==null||E.addEventListener("click",c),e.succeed=h,e.refreshThread=d,e.openReportId=()=>s}const He="bugcatch.rateLater",Rt=50;function Re(){try{const e=JSON.parse(window.localStorage.getItem(He)||"[]");return Array.isArray(e)?e:[]}catch{return[]}}function At(e){try{const t=Re().filter(a=>a!==e);t.push(e),window.localStorage.setItem(He,JSON.stringify(t.slice(-Rt)))}catch{}}function It(e,t=Re()){const a=new Set(t),r=(e||[]).filter(h=>h.ratingDue==="require"||h.ratingDue==="ask"&&!a.has(h.id));if(!r.length)return null;const s=h=>new Date(h.resolvedAt||h.updatedAt||0).getTime()||0;return r.reduce((h,b)=>s(b)>s(h)?b:h)}function Dt(e){const{client:t,rateDue:a,compose:r,picks:s,known:h,callBtn:b,titleInput:c,scrim:m}=e;let u=!1;e.mustRate=()=>u;function f(v){u=v;for(const E of[r,s,h])E.classList.toggle("held",v),E.inert=v;v?b.hidden=!0:e.callOffered()&&!e.mustSignIn()&&(b.hidden=!1),e.refreshSendState()}function S(){u&&f(!1)}function i(){a.hidden=!0,a.replaceChildren(),S(),c.focus()}function d(v){var l;const E=v.ratingDue==="require",p=v.resolvedAt?Z(v.resolvedAt):"",o=v.status==="CLOSED"?"closed":"fixed";if(a.hidden=!1,a.classList.toggle("is-required",E),a.innerHTML=`
1310
+ <div class="rd-head">
1311
+ <span class="rd-eyebrow">${E?"Before you report something new":`Your report was ${o}`}</span>
1312
+ ${E?"":'<button type="button" class="link rd-later" data-act="rate-later">Not now</button>'}
1273
1313
  </div>
1274
- ${o!=null&&o.current&&o.comment?`<p class="fr-said">“${$(o.comment)}”</p>`:""}
1275
- ${d?`
1276
- <div class="fr-note">
1277
- <textarea maxlength="2000" aria-label="Add a note to your rating" placeholder="${o.score<=2?"What went wrong? (optional)":"Anything to add? (optional)"}"></textarea>
1278
- <button type="button" data-act="rating-note">Add note</button>
1279
- </div>`:""}
1280
- ${o?"":'<p class="fr-hint">1 is poor, 5 is great.</p>'}
1281
- <p class="feedback-status" role="status"></p>`;const k=[...n.querySelectorAll("[data-score]")],L=w=>k.forEach(z=>z.classList.toggle("on",Number(z.dataset.score)<=w)),H=w=>n.querySelectorAll("button, textarea").forEach(z=>{z.disabled=w}),j=n.querySelector(".feedback-status");async function N(w,z){var A;H(!0),j.textContent="";try{const I=await t.rate(f.id,{score:w,comment:z});l(n,f,I,{justRated:!0}),(A=n.querySelector(".fr-note textarea"))==null||A.focus()}catch(I){j.textContent=I.message,H(!1),L(g)}}for(const w of k){const z=Number(w.dataset.score);w.addEventListener("mouseenter",()=>L(z)),w.addEventListener("focus",()=>L(z)),w.addEventListener("blur",()=>L(g)),w.addEventListener("click",()=>N(z))}n.querySelector(".stars").addEventListener("mouseleave",()=>L(g)),(B=n.querySelector('[data-act="rating-note"]'))==null||B.addEventListener("click",()=>{var z;const w=n.querySelector(".fr-note textarea").value.trim();if(!w){(z=n.querySelector(".fr-note"))==null||z.remove();return}N(o.score,w)})}async function S(n){const f=a.querySelector(".history.chatting"),o=f==null?void 0:f.querySelector(".thread");if(!o||i!==n)return;let u=null;try{u=await t.myReport(n)}catch{}if(e.closed||!u||i!==n)return;E(f,u),r(f,u);const g=me(o),c=Te(u.timeline);ce.get(o)!==c&&(o.innerHTML=c,ce.set(o,c)),b(f,u,n),g&&U(o);const d=f.querySelector(".report-head .pill");d&&(d.className=`pill ${String(u.status).toLowerCase()}`,d.textContent=se(u.status))}const T=t.on("update",n=>{!i||(n==null?void 0:n.bugId)!==i||(t.markReportRead(i),S(i))});e.onDestroy(()=>{T(),clearTimeout(p)}),(M=a.querySelector('[data-act="history"]'))==null||M.addEventListener("click",s),e.succeed=v,e.refreshThread=S,e.openReportId=()=>i}function qt({root:e,host:t,dock:a,client:h,onClose:i,preloadCall:v=()=>{},themeControls:x=null}){Ct(e);const s=h.config,y=()=>(x==null?void 0:x.label())||"",p=document.createElement("div");p.className=`scrim ${a.classList.contains("at-left")?"at-left":"at-right"} ${a.classList.contains("at-top")?"at-top":"at-bottom"}`,p.style.setProperty("--bc-dock-h",`${Math.round(a.getBoundingClientRect().height)}px`),p.innerHTML=`
1314
+ <p class="rd-report">
1315
+ <span class="rd-ico" aria-hidden="true">${O}</span>
1316
+ <span class="rd-ttl">${k(v.title)}</span>
1317
+ <span class="rd-sub">${k(v.reference)}${p?` · ${o} ${k(p)}`:""}</span>
1318
+ </p>
1319
+ <div class="rd-stars"></div>`,(l=a.querySelector('[data-act="rate-later"]'))==null||l.addEventListener("click",()=>{At(v.id),i()}),ce(a.querySelector(".rd-stars"),{client:t,report:v,rating:null,question:E?"How did we handle it? Rate it to send a new one.":"How did we do?",onRated:()=>{var n;a.querySelector(".rd-eyebrow").textContent=`Your report was ${o}`,(n=a.querySelector('[data-act="skip"]'))==null||n.remove(),a.classList.remove("is-required"),S()},onError:()=>{if(!u||a.querySelector('[data-act="skip"]'))return;const n=document.createElement("button");n.type="button",n.className="link rd-later",n.dataset.act="skip",n.textContent="Skip for now",n.addEventListener("click",i),a.querySelector(".rd-head").append(n)}}),E){f(!0);const n=m.getRootNode().activeElement;(!n||!a.contains(n))&&a.focus()}}t.hasReports()&&t.myReports().then(({reports:v})=>{if(e.closed)return;const E=It(v);E&&d(E)}).catch(()=>{})}function jt({root:e,host:t,dock:a,client:r,onClose:s,preloadCall:h=()=>{},themeControls:b=null}){Vt(e);const c=r.config,m=()=>(b==null?void 0:b.label())||"",u=document.createElement("div");u.className=`scrim ${a.classList.contains("at-left")?"at-left":"at-right"} ${a.classList.contains("at-top")?"at-top":"at-bottom"}`,u.style.setProperty("--bc-dock-h",`${Math.round(a.getBoundingClientRect().height)}px`),u.innerHTML=`
1282
1320
  <div class="panel" role="dialog" aria-modal="true" aria-labelledby="bc-h">
1283
- ${re({id:"bc-h",title:"Report a bug",sub:"We attach the page details for you.",theme:y()})}
1321
+ ${re({id:"bc-h",title:"Report a bug",sub:"We attach the page details for you.",theme:m()})}
1284
1322
  <div class="body">
1285
1323
  <div class="slot" role="alert"></div>
1324
+ <!-- A settled report still waiting for its rating. Drawn only when the
1325
+ project asks for one here; see rate-due.js. -->
1326
+ <div class="rate-due fix-rating" tabindex="-1" hidden></div>
1286
1327
  <!-- What the project's team is telling visitors. Drawn only when it
1287
1328
  has published something. -->
1288
1329
  <div class="notices" hidden></div>
@@ -1291,21 +1332,21 @@ div.done { padding: 44px 26px 44px; text-align: center; animation: bc-fade-in 24
1291
1332
  close by itself. Drawn only when the project offers any. -->
1292
1333
  <div class="picks" hidden></div>
1293
1334
  <div class="known" hidden></div>
1294
- ${lt(s)}
1335
+ ${pt(c)}
1295
1336
  </div>
1296
1337
  <div class="foot">
1297
1338
  <span class="note" aria-live="polite"></span>
1298
- ${h.hasReports()?'<button class="quiet" type="button" data-act="history">Your reports</button>':""}
1339
+ ${r.hasReports()?'<button class="quiet" type="button" data-act="history">Your reports</button>':""}
1299
1340
  <span class="spacer"></span>
1300
1341
  <!-- Hidden until the API confirms this project can take a call, which
1301
1342
  most cannot. Drawn here rather than as a second launcher because it
1302
1343
  is the same errand as Send report — the difference is only whether
1303
1344
  the reporter would rather say it than type it. -->
1304
- <button class="ghost" type="button" data-act="call" hidden>${J}Talk to the team</button>
1345
+ <button class="ghost" type="button" data-act="call" hidden>${ee}Talk to the team</button>
1305
1346
  <button class="primary" type="button" data-act="send">Send report ${be}</button>
1306
1347
  </div>
1307
1348
  <div class="powered">Powered by
1308
- <a class="brand-credit" href="https://bugcatch.sphoro.com" target="_blank" rel="noopener noreferrer" aria-label="BugCatch">${Fe}</a>
1349
+ <a class="brand-credit" href="https://bugcatch.sphoro.com" target="_blank" rel="noopener noreferrer" aria-label="BugCatch">${Ke}</a>
1309
1350
  </div>
1310
- </div>`;const b=g=>p.querySelector(g),E=b(".slot"),r=[],l={client:h,cfg:s,root:e,host:t,dock:a,scrim:p,$:b,titleInput:b("#bc-title"),descInput:b("#bc-desc"),compose:b(".compose"),sendBtn:b('[data-act="send"]'),callBtn:b('[data-act="call"]'),historyBtn:b('[data-act="history"]'),note:b(".foot .note"),whoami:b(".whoami"),refsBox:b(".refs"),notices:b(".notices"),known:b(".known"),picks:b(".picks"),sending:!1,closed:!1,say:u,close:f,preloadCall:v,themeLabel:y,onDestroy:g=>{r.push(g)},refreshSendState:null,isRecording:null,stopRecording:null,holdForReference:null,answeredReference:null,pickedIssue:null,offerCall:null,callOffered:null,showLiveCall:null,mustSignIn:null,recheckSignIn:null,succeed:null,refreshThread:null,openReportId:null};ct(l),bt(l),vt(l),xt(l),yt(l),wt(l),kt(l),zt(l);const S=document.activeElement,T=document.documentElement.style,M=T.overflow;T.overflow="hidden";function n(){l.closed||(r.forEach(g=>g()),l.closed=!0,T.overflow=M,document.removeEventListener("keydown",o,!0),p.remove(),a.hidden=!1,t.style.opacity="",i==null||i())}function f(){var g;if(!l.closed){p.classList.add("closing"),setTimeout(n,160);try{(g=S==null?void 0:S.focus)==null||g.call(S)}catch{}}}function o(g){if(g.key==="Escape"){if(g.stopPropagation(),l.isRecording()){l.stopRecording({keep:!1});return}l.sending||f();return}if(g.key!=="Tab"||l.isRecording())return;const c=[...p.querySelectorAll("button:not(:disabled), input:not([hidden]), textarea, select, [href]")].filter(H=>H.offsetParent!==null||H===document.activeElement);if(!c.length)return;const d=c[0],k=c[c.length-1],L=p.getRootNode().activeElement;g.shiftKey&&L===d?(g.preventDefault(),k.focus()):!g.shiftKey&&L===k&&(g.preventDefault(),d.focus())}document.addEventListener("keydown",o,!0),p.addEventListener("click",g=>{g.target===p&&!l.sending&&f()}),b('[data-act="close"]').addEventListener("click",f),p.addEventListener("click",g=>{const c=g.target.closest('[data-act="theme"]');if(!c||!x)return;const d=x.cycle();c.title=`Theme: ${d.label}`,c.setAttribute("aria-label",`Theme: ${d.label}. Change theme`)});function u(g,c="err"){E.innerHTML=g?`<div class="msg ${c}">${c==="err"?Y:""}<span>${$(g)}</span></div>`:""}return e.appendChild(p),l.refreshSendState(),l.titleInput.focus(),{destroy:n,close:f}}function Ct(e){if(e.querySelector("style[data-panel]"))return;const t=document.createElement("style");t.setAttribute("data-panel",""),t.textContent=Ye;const a=e.querySelector("style");a?a.after(t):e.prepend(t)}const Ht=Object.freeze(Object.defineProperty({__proto__:null,openPanel:qt},Symbol.toStringTag,{value:"Module"})),It="0.19.0",Ce="__bugcatchChunks",Rt=e=>`${e}@${It}`;function At(e,t){const a=window[Ce]||(window[Ce]={});a[Rt(e)]=t}At("panel",Ht)})();
1351
+ </div>`;const f=x=>u.querySelector(x),S=f(".slot"),i=[],d={client:r,cfg:c,root:e,host:t,dock:a,scrim:u,$:f,titleInput:f("#bc-title"),descInput:f("#bc-desc"),compose:f(".compose"),sendBtn:f('[data-act="send"]'),callBtn:f('[data-act="call"]'),historyBtn:f('[data-act="history"]'),note:f(".foot .note"),whoami:f(".whoami"),refsBox:f(".refs"),notices:f(".notices"),known:f(".known"),picks:f(".picks"),rateDue:f(".rate-due"),sending:!1,closed:!1,say:$,close:l,preloadCall:h,themeLabel:m,onDestroy:x=>{i.push(x)},refreshSendState:null,isRecording:null,stopRecording:null,holdForReference:null,answeredReference:null,pickedIssue:null,offerCall:null,callOffered:null,showLiveCall:null,mustSignIn:null,recheckSignIn:null,mustRate:()=>!1,succeed:null,refreshThread:null,openReportId:null};ut(d),mt(d),xt(d),kt(d),$t(d),St(d),Lt(d),Ht(d),Dt(d);const v=document.activeElement,E=document.documentElement.style,p=E.overflow;E.overflow="hidden";function o(){d.closed||(i.forEach(x=>x()),d.closed=!0,E.overflow=p,document.removeEventListener("keydown",n,!0),u.remove(),a.hidden=!1,t.style.opacity="",s==null||s())}function l(){var x;if(!d.closed){u.classList.add("closing"),setTimeout(o,160);try{(x=v==null?void 0:v.focus)==null||x.call(v)}catch{}}}function n(x){if(x.key==="Escape"){if(x.stopPropagation(),d.isRecording()){d.stopRecording({keep:!1});return}d.sending||l();return}if(x.key!=="Tab"||d.isRecording())return;const y=[...u.querySelectorAll("button:not(:disabled), input:not([hidden]), textarea, select, [href]")].filter(C=>C.offsetParent!==null||C===document.activeElement);if(!y.length)return;const g=y[0],L=y[y.length-1],M=u.getRootNode().activeElement;x.shiftKey&&M===g?(x.preventDefault(),L.focus()):!x.shiftKey&&M===L&&(x.preventDefault(),g.focus())}document.addEventListener("keydown",n,!0),u.addEventListener("click",x=>{x.target===u&&!d.sending&&l()}),f('[data-act="close"]').addEventListener("click",l),u.addEventListener("click",x=>{const y=x.target.closest('[data-act="theme"]');if(!y||!b)return;const g=b.cycle();y.title=`Theme: ${g.label}`,y.setAttribute("aria-label",`Theme: ${g.label}. Change theme`)});function $(x,y="err"){S.innerHTML=x?`<div class="msg ${y}">${y==="err"?F:""}<span>${k(x)}</span></div>`:""}return e.appendChild(u),d.refreshSendState(),d.titleInput.focus(),{destroy:o,close:l}}function Vt(e){if(e.querySelector("style[data-panel]"))return;const t=document.createElement("style");t.setAttribute("data-panel",""),t.textContent=Ue;const a=e.querySelector("style");a?a.after(t):e.prepend(t)}const Ot=Object.freeze(Object.defineProperty({__proto__:null,openPanel:jt},Symbol.toStringTag,{value:"Module"})),Bt="0.20.0",Ae="__bugcatchChunks",Nt=e=>`${e}@${Bt}`;function Wt(e,t){const a=window[Ae]||(window[Ae]={});a[Nt(e)]=t}Wt("panel",Ot)})();
1311
1352
  //# sourceMappingURL=bugcatch-panel.umd.js.map