@signalsupport/sdk 0.0.0-stage → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +373 -2
  3. package/dist/chunks/app-7692BILt.js +2 -0
  4. package/dist/chunks/app-7692BILt.js.map +1 -0
  5. package/dist/chunks/constants-ClGbEpjT.js +2 -0
  6. package/dist/chunks/constants-ClGbEpjT.js.map +1 -0
  7. package/dist/chunks/support-x7N-k02b.js +4 -0
  8. package/dist/chunks/support-x7N-k02b.js.map +1 -0
  9. package/dist/chunks/widget-Bxsz5StK.js +2 -0
  10. package/dist/chunks/widget-Bxsz5StK.js.map +1 -0
  11. package/dist/client.d.ts +99 -0
  12. package/dist/constants.d.ts +2 -0
  13. package/dist/errors.d.ts +25 -0
  14. package/dist/evidence.d.ts +87 -0
  15. package/dist/iife.d.ts +12 -0
  16. package/dist/index.d.ts +21 -0
  17. package/dist/index.js +1 -0
  18. package/dist/model.d.ts +201 -0
  19. package/dist/react.d.ts +26 -0
  20. package/dist/react.js +2 -0
  21. package/dist/react.js.map +1 -0
  22. package/dist/reporter.d.ts +14 -0
  23. package/dist/server.d.ts +54 -0
  24. package/dist/server.js +2 -0
  25. package/dist/server.js.map +1 -0
  26. package/dist/session.d.ts +29 -0
  27. package/dist/signal.iife.js +4 -0
  28. package/dist/signal.iife.js.map +1 -0
  29. package/dist/support.d.ts +108 -0
  30. package/dist/trail.d.ts +27 -0
  31. package/dist/widget/app.d.ts +31 -0
  32. package/dist/widget/copy.d.ts +104 -0
  33. package/dist/widget/ctx.d.ts +75 -0
  34. package/dist/widget/icons.d.ts +38 -0
  35. package/dist/widget/index.d.ts +111 -0
  36. package/dist/widget/index.js +1 -0
  37. package/dist/widget/parts.d.ts +28 -0
  38. package/dist/widget/pick.d.ts +30 -0
  39. package/dist/widget/screens/faq.d.ts +8 -0
  40. package/dist/widget/screens/feedback.d.ts +11 -0
  41. package/dist/widget/screens/home.d.ts +12 -0
  42. package/dist/widget/screens/report.d.ts +9 -0
  43. package/dist/widget/screens/reports.d.ts +26 -0
  44. package/dist/widget/store.d.ts +31 -0
  45. package/dist/widget/styles.d.ts +10 -0
  46. package/dist/widget/theme.d.ts +57 -0
  47. package/dist/widget/ui.d.ts +58 -0
  48. package/package.json +73 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Charky Labs Pvt. Ltd.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,374 @@
1
- # Temporary Holding Version
1
+ # @signalsupport/sdk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Support inside your product, backed by [Signal](https://signal.character.xyz).
4
+ People report an issue with the evidence that makes it fixable, share
5
+ feedback, read your FAQs, follow what happens to their reports, hear back from
6
+ your team, and confirm the fix on their own machine. Your team works all of it
7
+ from the Signal console.
8
+
9
+ - **A panel for any framework.** It renders in its own Shadow DOM, so it drops
10
+ into React, Vue, Svelte or plain HTML, and your CSS and its CSS never meet.
11
+ - **Themed to your brand.** Four presets, every colour, radius and size as a
12
+ token, four layouts, your own copy.
13
+ - **Headless if you want your own UI.** The whole loop as plain functions and
14
+ one subscribable state.
15
+ - **Evidence people choose to send.** One screen frame they take, system and
16
+ browser, the last steps they took (with any uncaught error), and your own
17
+ diagnostics, each shown in full and switchable before anything is sent.
18
+
19
+ ## Set up in one command
20
+
21
+ ```bash
22
+ npx @signalsupport/cli init
23
+ ```
24
+
25
+ Signs you in through the browser, picks or creates the product, and writes its
26
+ keys into your env files without anybody copying or seeing the secret. It is a
27
+ separate package ([@signalsupport/cli](https://www.npmjs.com/package/@signalsupport/cli)),
28
+ so this SDK carries nothing but what runs in your app.
29
+
30
+ Prefer to do it by hand? The manual steps follow.
31
+
32
+ ## Get started
33
+
34
+ ### 1. Get your keys
35
+
36
+ In Signal, open **Products → Add a product**. You get two keys:
37
+
38
+ | | Where it goes | Can |
39
+ |---|---|---|
40
+ | **Publishable key** `sig_pub_…` | your browser bundle | file reports, nothing else |
41
+ | **Secret key** `sig_live_…` | your server only | vouch for your signed-in users |
42
+
43
+ ```bash
44
+ # .env
45
+ NEXT_PUBLIC_SIGNAL_KEY_ID=sig_pub_…
46
+ SIGNAL_KEY_SECRET=sig_live_…
47
+ ```
48
+
49
+ ### 2. Install
50
+
51
+ ```bash
52
+ npm install @signalsupport/sdk
53
+ ```
54
+
55
+ ### 3. Add one server route
56
+
57
+ This is what lets a signed-in person follow their own reports. Your server
58
+ vouches for them with the secret key, and their browser gets a short-lived
59
+ session that can only see what *they* filed.
60
+
61
+ ```ts
62
+ // app/api/signal/session/route.ts (Next.js; any Request/Response framework works)
63
+ import { sessionHandler } from '@signalsupport/sdk/server';
64
+
65
+ export const POST = sessionHandler({
66
+ secretKey: process.env.SIGNAL_KEY_SECRET!,
67
+ getUser: async () => {
68
+ const user = await getCurrentUser(); // your own auth
69
+ return user && { id: user.id, name: user.name, email: user.email };
70
+ },
71
+ });
72
+ ```
73
+
74
+ No signed-in user? It answers 401 and the panel works anonymously: people can
75
+ still report and send feedback, and leave an email if they want a reply.
76
+
77
+ ### 4. Mount the panel
78
+
79
+ ```ts
80
+ import { mountSupport } from '@signalsupport/sdk/widget';
81
+
82
+ const support = mountSupport({
83
+ key: process.env.NEXT_PUBLIC_SIGNAL_KEY_ID,
84
+ session: '/api/signal/session',
85
+ appVersion: '2.4.0',
86
+ context: { area: 'Editor' },
87
+ theme: { preset: 'midnight', accent: '#7a50dd' },
88
+ });
89
+ ```
90
+
91
+ That is a working support panel with a floating **Help** button.
92
+
93
+ ## Your own button
94
+
95
+ Most products already have a place for help. Turn the floating button off and
96
+ open the panel from yours; the badge count is yours to draw.
97
+
98
+ ```ts
99
+ const support = mountSupport({ /* … */ launcher: false });
100
+
101
+ helpButton.onclick = () => support.toggle();
102
+ support.on('attention', (n) => (helpBadge.textContent = n ? String(n) : ''));
103
+
104
+ support.open('report'); // or 'feedback', 'faq', 'reports', 'home'
105
+ ```
106
+
107
+ `attention` counts reports that want something from the person: a fix waiting
108
+ for their check, a question from your team, or a reply they have not read. It
109
+ never counts your team simply moving a report along.
110
+
111
+ ## Context, versions and the fix check
112
+
113
+ ```ts
114
+ support.setContext({ area: 'Rigging', projectId: 'prj_42' }); // as people move around
115
+ ```
116
+
117
+ `context` travels with every report (`area` also prefills "Where in the
118
+ product?"). `appVersion` matters more than it looks: when your team resolves a
119
+ report in Signal they can name the build that carries the fix, and the panel
120
+ only asks "does it work now?" once the person is running that build or newer.
121
+ Below it, it says which version to update to instead. "No, still happening"
122
+ reopens the report with their note; "Yes" closes the loop.
123
+
124
+ ## The trail and your diagnostics
125
+
126
+ ```ts
127
+ support.support.record('click', 'Exported hero.glb'); // things worth knowing
128
+ mountSupport({
129
+ diagnostics: {
130
+ gpu: () => renderer.describeAdapter(),
131
+ project: async () => ({ id: project.id, meshes: project.meshes.length }),
132
+ },
133
+ });
134
+ ```
135
+
136
+ The last ten steps, including any uncaught error, and whatever `diagnostics`
137
+ return are read only when the person reaches the Attach step, shown in full,
138
+ and sent only if they keep them switched on. Nothing is collected in the
139
+ background, and the error hooks only observe: they never swallow an error or
140
+ send anything by themselves.
141
+
142
+ ## Theme and layout
143
+
144
+ ```ts
145
+ mountSupport({
146
+ theme: 'daylight', // a preset
147
+ theme: { preset: 'studio', accent: '#e11d48' }, // or tokens on top of one
148
+ theme: { scheme: 'auto', accent: '#7a50dd' }, // follow the system, live
149
+ layout: 'drawer', // 'drawer' | 'modal' | 'popover' | 'sheet' (phones always get a sheet)
150
+ side: 'right', // for drawers
151
+ launcher: { position: 'bottom-left', label: 'Support' },
152
+ brand: { name: 'Lumen Studio', logo: '/logo.svg' },
153
+ copy: { launcher: 'Help', reportAction: 'Report a bug' },
154
+ features: { faq: false },
155
+ zIndex: 2147483000,
156
+ });
157
+
158
+ support.setTheme({ preset: 'paper' }); // repaint without remounting
159
+ ```
160
+
161
+ | Preset | For |
162
+ |---|---|
163
+ | `midnight` | dark and neutral; tools people use all day |
164
+ | `daylight` | light and quiet; SaaS and sites |
165
+ | `studio` | deep and saturated, compact; creative tools |
166
+ | `paper` | warm and editorial; consumer and content |
167
+
168
+ Every token: `scheme`, `accent`, `accentText`, `background`, `surface`,
169
+ `raised`, `border`, `text`, `muted`, `dim`, `success`, `warning`, `danger`,
170
+ `info`, `radius`, `font` (default `inherit`, so the panel speaks in your
171
+ typeface), `mono`, `fontSize`, `width`, `shadow`, `scrim`.
172
+
173
+ ## Make it yours
174
+
175
+ Tokens get most products most of the way. When yours needs more, there are
176
+ three ways in, and none of them can break the panel or leak into your page.
177
+
178
+ **Your own CSS, inside the panel.** `css` is applied after the panel's own
179
+ styles, so it wins at equal specificity, and `setCss()` changes it live:
180
+
181
+ ```ts
182
+ mountSupport({ css: `[part~="button-primary"] { border-radius: 999px; text-transform: uppercase; }` });
183
+ support.setCss(nextCss);
184
+ ```
185
+
186
+ **`::part()`, from your stylesheet:**
187
+
188
+ ```css
189
+ [data-signal-support]::part(launcher) { border-radius: 8px; }
190
+ [data-signal-support]::part(action):hover { border-color: var(--brand); }
191
+ ```
192
+
193
+ The part names are the stable contract (the internal class names are not):
194
+ `launcher` `badge` `scrim` `panel` `header` `title` `subtitle` `icon-button`
195
+ `body` `footer` `section` `section-title` `action` `action-label`
196
+ `action-hint` `tile` `button` `button-primary` `button-ghost` `button-danger`
197
+ `link` `label` `hint` `error` `input` `textarea` `chip` `chip-selected`
198
+ `switch` `pill` `banner` `card` `steps` `row` `row-title` `rail` `message`
199
+ `message-team` `message-you` `composer` `faq-item` `confirmation` `reference`
200
+ `capture-bar`.
201
+
202
+ **Your own components, in slots.** Each slot is a native `<slot>`: what you
203
+ put there lives in your document, so your CSS styles it and your framework
204
+ renders it.
205
+
206
+ ```ts
207
+ const support = mountSupport({ /* … */ });
208
+ support.slot('home-top').append(statusBanner); // plain DOM
209
+ // React: createPortal(<KnownIssues />, support.slot('report-top'))
210
+ // Vue: <Teleport :to="support.slot('footer')"> … </Teleport>
211
+ ```
212
+
213
+ | Slot | Where |
214
+ |---|---|
215
+ | `header` | beside the close button |
216
+ | `home-top` · `home-bottom` | above and below the home screen |
217
+ | `report-top` | above the first step of a report |
218
+ | `feedback-top` | above the feedback form |
219
+ | `sent` | under "report sent" |
220
+ | `footer` | the bottom of the panel, on every screen |
221
+
222
+ An empty slot takes no space. In React, `useSignalSlot(widget, 'home-top')`
223
+ returns the element for `createPortal`.
224
+
225
+ **Your own entries on the home screen**, drawn like the built-in ones:
226
+
227
+ ```ts
228
+ mountSupport({
229
+ actions: [
230
+ { label: 'Status page', hint: 'All systems normal', href: 'https://status.example.com' },
231
+ { label: 'Talk to sales', icon: 'message', onClick: () => openChat() },
232
+ ],
233
+ });
234
+ ```
235
+
236
+ `icon` is a built-in name (`external`, `book`, `message`, `question`, …) or an
237
+ image URL. A `href` opens in a new tab.
238
+
239
+ **Touch.** On a touch screen every control gets a 44px target and text fields
240
+ are at least 16px, so iOS never zooms the page when someone starts typing.
241
+ Nothing to configure.
242
+
243
+ ## Inside a desktop app
244
+
245
+ Capture uses the browser's screen capture, which in a desktop shell (WebView2,
246
+ Electron) opens the shell's own permission dialog: unstyled, and often wider than
247
+ the window. Give the panel your own picture of your own window instead and there
248
+ is no prompt at all; capture mode is otherwise the same.
249
+
250
+ ```ts
251
+ mountSupport({
252
+ // ...
253
+ // WebView2: ICoreWebView2::CapturePreview. Electron: webContents.capturePage().
254
+ captureFrame: () => window.myShell.capturePanel(), // resolves to a data:image/png URL
255
+ });
256
+ ```
257
+
258
+ ## FAQs
259
+
260
+ ```ts
261
+ mountSupport({
262
+ faq: [
263
+ { q: 'How do I export to GLB?', a: 'Open Export, pick GLB…', tags: ['gltf'] },
264
+ ],
265
+ });
266
+ ```
267
+
268
+ ## React
269
+
270
+ ```tsx
271
+ import { SignalSupport } from '@signalsupport/sdk/react';
272
+
273
+ <SignalSupport
274
+ keyId={process.env.NEXT_PUBLIC_SIGNAL_KEY_ID}
275
+ session="/api/signal/session"
276
+ appVersion={version}
277
+ context={{ area, projectId }} // kept current on every render
278
+ theme={{ preset: 'studio' }}
279
+ launcher={false}
280
+ onReady={(w) => (supportRef.current = w)}
281
+ onAttention={setBadge}
282
+ />
283
+ ```
284
+
285
+ ## No bundler
286
+
287
+ ```html
288
+ <script src="https://unpkg.com/@signalsupport/sdk/dist/signal.iife.js"></script>
289
+ <script>
290
+ SignalSupport.mountSupport({ key: 'sig_pub_…', theme: 'daylight', layout: 'popover' });
291
+ </script>
292
+ ```
293
+
294
+ ## Headless
295
+
296
+ The panel is built on this; your own UI can be too.
297
+
298
+ ```ts
299
+ import { createSupport } from '@signalsupport/sdk';
300
+
301
+ const support = createSupport({ key, session: '/api/signal/session', appVersion: '2.4.0' });
302
+
303
+ support.subscribe(({ reports, attention, signedIn }) => render(reports));
304
+ await support.submitIssue({ what, expected, severity: 'major', screenshot });
305
+ await support.submitFeedback({ kind: 'idea', body });
306
+ const report = await support.detail(id); // with its public timeline
307
+ await support.reply(id, 'It happens with two bones too.');
308
+ await support.verify(id, true); // or false, with a note: reopens it
309
+ ```
310
+
311
+ `statusView(report, appVersion)` turns any report into what it means for the
312
+ person who filed it (label, one-sentence blurb, tone, stage on the journey,
313
+ whether it needs them), so a custom UI says the same things the panel does.
314
+ `threadOf(detail)` is the conversation as the panel draws it, with the moment
315
+ the team first opened the report (`read_at`) placed where it happened, as
316
+ "Read by the team": never a person's name, the team speaks as one.
317
+
318
+ ## Just file a signal
319
+
320
+ From a script, a monitor or a server:
321
+
322
+ ```ts
323
+ import { createClient } from '@signalsupport/sdk';
324
+
325
+ const signal = createClient({ key: process.env.SIGNAL_KEY_SECRET });
326
+ await signal.report({ subject: 'Nightly reconciliation failed', reporterKind: 'monitor' });
327
+ ```
328
+
329
+ Every report carries an idempotency key, so a retry after a dropped connection
330
+ never files twice. Failures are a `SignalError` with `code`, `status`, the
331
+ offending `path` on a 422 and `retryAfter` on a 429; `retryable` says whether
332
+ trying again could work.
333
+
334
+ ## Size and loading
335
+
336
+ Measured on every build (`npm run size`), gzipped, and refused at publish if
337
+ anything grows past its budget:
338
+
339
+ | You import | Cost before anyone opens help |
340
+ |---|---|
341
+ | `@signalsupport/sdk` (report, headless support) | ~8 KB |
342
+ | `@signalsupport/sdk/widget` | ~11 KB, then the panel (~18 KB) on idle or first open |
343
+ | `@signalsupport/sdk/server` | ~1.5 KB, server only |
344
+ | Script tag (`signal.iife.js`, everything) | ~29 KB |
345
+
346
+ The panel itself is a separate chunk, fetched once the browser is idle after
347
+ your page has loaded, or the moment `open()` is called, so your first paint
348
+ never waits for it. Pass `eager: true` to load it straight away; `await
349
+ support.ready()` resolves when it has rendered.
350
+
351
+ ## Security
352
+
353
+ - **No runtime dependencies** and no install scripts. Preact is compiled in.
354
+ - **The secret key never reaches a browser.** The publishable key can only file reports.
355
+ Reading reports needs a reporter session your server mints for one person,
356
+ which lasts an hour by default, dies with the key that minted it, and can
357
+ only see what that person filed.
358
+ - **The session lives in memory**, never in storage.
359
+ - **Nothing is collected in the background.** Every piece of evidence is shown
360
+ to the person and can be switched off before it is sent; the error hooks only
361
+ observe.
362
+ - **Strict pages work.** No `eval`, no HTML strings (Trusted Types safe), and
363
+ styles go in through a constructable stylesheet, so a Content-Security-Policy
364
+ without `'unsafe-inline'` styles still gets a styled panel.
365
+ - **Isolated rendering.** The panel lives in a Shadow DOM: your CSS cannot
366
+ restyle it, and its CSS cannot reach your page.
367
+
368
+ ## What the service cannot do yet
369
+
370
+ `GET https://signal-api.character.xyz/v1/agent` lists every endpoint and,
371
+ under `not_available_yet`, what Signal does not do, with reasons. Today:
372
+ one screenshot per report (up to 2 MB, downscaled for you), no other file
373
+ attachments, and no email to reporters: they hear back in the panel, or you
374
+ relay `signal.replied` webhooks yourself.
@@ -0,0 +1,2 @@
1
+ import{M as e,N as t,O as n,_ as r,b as i,d as a,f as o,g as s,h as c,j as l,k as u,l as d,m as f,o as p,u as m,x as h,y as g}from"./support-x7N-k02b.js";import{a as _,c as v,o as y,r as b}from"./widget-Bxsz5StK.js";var x,S,C,w,T,E,D,O,k,A,j,M,N,P,F={},I=[],ee=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,L=Array.isArray;function R(e,t){for(var n in t)e[n]=t[n];return e}function z(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function te(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?x.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return B(e,o,r,i,null)}function B(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++C,__i:-1,__u:0};return i==null&&S.vnode!=null&&S.vnode(a),a}function V(e){return e.children}function H(e,t){this.props=e,this.context=t}function U(e,t){if(t==null)return e.__?U(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?U(e):null}function ne(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],a=R({},t);a.__v=t.__v+1,S.vnode&&S.vnode(a),pe(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??U(t),!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,he(r,a,i),t.__e=t.__=null,a.__e!=n&&re(a)}}function re(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),re(e)}function ie(e){(!e.__d&&(e.__d=!0)&&w.push(e)&&!ae.__r++||T!=S.debounceRendering)&&((T=S.debounceRendering)||E)(ae)}function ae(){try{for(var e,t=1;w.length;)w.length>t&&w.sort(D),e=w.shift(),t=w.length,ne(e)}finally{w.length=ae.__r=0}}function oe(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_=r&&r.__k||I,v=t.length;for(c=se(n,t,_,c,v),d=0;d<v;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&_[p.__i]||F,p.__i=d,g=pe(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&ve(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),4&p.__u?(c=ce(p,c,e),f.__e&&(f.__e=null)):typeof p.type==`function`&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function se(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=B(null,o,null,null,null):L(o)?o=e.__k[a]=B(V,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=B(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=le(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=U(s)),ye(s,s));return r}function ce(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=ce(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=U(e)),t=n.insertBefore(e.__e,t||null));do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function le(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ue(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||ee.test(t)?n:n+`px`}function de(e,t,n,r,i){var a,o;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ue(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ue(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(j,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n[A]=r[A]:(n[A]=M,e.addEventListener(t,a?P:N,a)):e.removeEventListener(t,a?P:N,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function fe(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[k]==null)t[k]=M++;else if(t[k]<n[A])return;return n(S.event?S.event(t):t)}}}function pe(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y,b,x,C,w,T,E,D=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=S.__b)&&u(t);n:if(typeof D==`function`){d=o.length;try{if(v=t.props,y=D.prototype&&D.prototype.render,b=(u=D.contextType)&&r[u.__c],x=u?b?b.props.value:u.__:r,n.__c?_=(f=t.__c=n.__c).__=f.__E:(y?t.__c=f=new D(v,x):(t.__c=f=new H(v,x),f.constructor=D,f.render=be),b&&b.sub(f),f.state||(f.state={}),f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&D.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=R({},f.__s)),R(f.__s,D.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&D.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&D.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),t.__v==n.__v||!f.__e&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)){t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),I.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f),s=U(n);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__e=!1,C=S.__r,w=0,y)f.state=f.__s,f.__d=!1,C&&C(t),u=f.render(f.props,f.state,f.context),I.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,C&&C(t),u=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=R(R({},r),f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),T=u!=null&&u.type===V&&u.key==null?ge(u.props.children):u,s=oe(e,L(T)?T:[T],t,n,r,i,a,o,s,c,l),f.base=t.__e,t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__E=f.__=null)}catch(e){if(o.length=d,t.__v=null,c||a!=null){if(e.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a!=null&&(a[a.indexOf(s)]=null),t.__e=s}else if(a!=null)for(E=a.length;E--;)z(a[E])}else t.__e=n.__e;t.__k??(t.__k=n.__k||[]),e.then||me(t),S.__e(e,t,n)}}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=_e(n.__e,t,n,r,i,a,o,c,l);return(u=S.diffed)&&u(t),128&t.__u?void 0:s}function me(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(me))}function he(e,t,n){for(var r=0;r<n.length;r++)ve(n[r],n[++r],n[++r]);S.__c&&S.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){S.__e(e,t.__v)}})}function ge(e){return typeof e!=`object`||!e||e.__b>0?e:L(e)?e.map(ge):e.constructor===void 0?R({},e):null}function _e(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g=n.props||F,_=t.props,v=t.type;if(v==`svg`?i=`http://www.w3.org/2000/svg`:v==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||(i=`http://www.w3.org/1999/xhtml`),a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!v&&(v?p.localName==v:p.nodeType==3)){e=p,a[l]=null;break}}if(e==null){if(v==null)return document.createTextNode(_);e=document.createElementNS(i,v,_.is&&_),s&&(S.__m&&S.__m(t,a),s=!1),a=null}if(v==null)g===_||s&&e.data==_||(e.data=_);else{if(a=v==`textarea`&&_.defaultValue!=null?null:a&&x.call(e.childNodes),!s&&a!=null)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)p=g[l],l==`dangerouslySetInnerHTML`?d=p:l==`children`||l in _||l==`value`&&`defaultValue`in _||l==`checked`&&`defaultChecked`in _||de(e,l,null,p,i);for(l in _)p=_[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?m=p:l==`checked`?h=p:s&&typeof p!=`function`||g[l]===p||de(e,l,p,g[l],i);if(u)s||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),oe(t.type==`template`?e.content:e,L(f)?f:[f],t,n,r,v==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&U(n,0),s,c),a!=null)for(l=a.length;l--;)z(a[l]);s&&v!=`textarea`||(l=`value`,v==`progress`&&m==null?e.removeAttribute(`value`):m!=null&&(m!==e[l]||v==`progress`&&!m||v==`option`&&m!=g[l])&&de(e,l,m,g[l],i),l=`checked`,h!=null&&h!=e[l]&&de(e,l,h,g[l],i))}return e}function ve(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){S.__e(e,n)}}function ye(e,t,n){var r,i;if(S.unmount&&S.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||ve(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){S.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&ye(r[i],t,n||typeof e.type!=`function`);n||z(e.__e),e.__c=e.__=e.__e=void 0}function be(e,t,n){return this.constructor(e,n)}function xe(e,t,n){var r,i,a,o;t==document&&(t=document.documentElement),S.__&&S.__(e,t),i=(r=typeof n==`function`)?null:n&&n.__k||t.__k,a=[],o=[],pe(t,e=(!r&&n||t).__k=te(V,null,[e]),i||F,F,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?x.call(t.childNodes):null,a,!r&&n?n:i?i.__e:t.firstChild,r,o),he(a,e,o),e.props.children=null}x=I.slice,S={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},C=0,H.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=R({},this.state);typeof e==`function`&&(e=e(R({},n),this.props)),e&&R(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ie(this))},H.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ie(this))},H.prototype.render=V,w=[],E=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,D=function(e,t){return e.__v.__b-t.__v.__b},ae.__r=0,O=Math.random().toString(8),k=`__d`+O,A=`__a`+O,j=/(PointerCapture)$|Capture$/i,M=0,N=fe(!1),P=fe(!0);var Se,W,Ce,we,Te=0,Ee=[],G=S,De=G.__b,Oe=G.__r,ke=G.diffed,Ae=G.__c,je=G.unmount,Me=G.__;function Ne(e,t){G.__h&&G.__h(W,e,Te||t),Te=0;var n=W.__H||(W.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function K(e){return Te=1,Pe(He,e)}function Pe(e,t,n){var r=Ne(Se++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):He(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=W,!W.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a){var s=a.call(this,e,t,n);return i?s||o:s}return!i||o};W.__f=!0;var a=W.shouldComponentUpdate,o=W.componentWillUpdate;W.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},W.shouldComponentUpdate=i}return r.__N||r.__}function q(e,t){var n=Ne(Se++,3);!G.__s&&Ve(n.__H,t)&&(n.__=e,n.u=t,W.__H.__h.push(n))}function J(e){return Te=5,Fe(function(){return{current:e}},[])}function Fe(e,t){var n=Ne(Se++,7);return Ve(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ie(){for(var e;e=Ee.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ze),t.__h.some(Be),t.__h=[]}catch(n){t.__h=[],G.__e(n,e.__v)}}}G.__b=function(e){W=null,De&&De(e)},G.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Me&&Me(e,t)},G.__r=function(e){Oe&&Oe(e),Se=0;var t=(W=e.__c).__H;t&&(Ce===W?(t.__h=[],W.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(ze),t.__h.some(Be),t.__h=[],Se=0)),Ce=W},G.diffed=function(e){ke&&ke(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ee.push(t)!==1&&we===G.requestAnimationFrame||((we=G.requestAnimationFrame)||Re)(Ie)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),Ce=W=null},G.__c=function(e,t){t.some(function(e){try{e.__h.some(ze),e.__h=e.__h.filter(function(e){return!e.__||Be(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],G.__e(n,e.__v)}}),Ae&&Ae(e,t)},G.unmount=function(e){je&&je(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{ze(e)}catch(e){t=e}}),n.__H=void 0,t&&G.__e(t,n.__v))};var Le=typeof requestAnimationFrame==`function`;function Re(e){var t,n=function(){clearTimeout(r),Le&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Le&&(t=requestAnimationFrame(n))}function ze(e){var t=W,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),W=t}function Be(e){var t=W;e.__c=e.__(),W=t}function Ve(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function He(e,t){return typeof t==`function`?t(e):t}var Ue=0;Array.isArray;function Y(e,t,n,r,i,a){t||(t={});var o,s,c=t;if(`ref`in c)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ue,__i:-1,__u:0,__source:i,__self:a};if(typeof e==`function`&&(o=e.defaultProps))for(s in o)c[s]===void 0&&(c[s]=o[s]);return S.vnode&&S.vnode(l),l}var We={lifebuoy:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-5a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm2.8-6.8L18.4 5.6M9.2 9.2 5.6 5.6m3.6 9.2-3.6 3.6m9.2-3.6 3.6 3.6`,bug:`M9 9V8a3 3 0 0 1 6 0v1M8 9h8a6 6 0 0 1 1 3v3a5 5 0 0 1-10 0v-3a6 6 0 0 1 1-3ZM3 13h4m10 0h4M12 20v-6M4 19l3.35-2M20 19l-3.35-2M4 7l3.75 2.4M20 7l-3.75 2.4`,bulb:`M3 12h1m8-9v1m8 8h1M5.6 5.6l.7.7m12.1-.7-.7.7M9 16a5 5 0 1 1 6 0 3.5 3.5 0 0 0-1 3 2 2 0 0 1-4 0 3.5 3.5 0 0 0-1-3M9.7 17h4.6`,question:`M8 9h8M8 13h6M9 18H6a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-3l-3 3-3-3Z`,chevronRight:`m9 6 6 6-6 6`,chevronLeft:`m15 6-6 6 6 6`,arrowLeft:`M5 12h14M5 12l6 6M5 12l6-6`,x:`M18 6 6 18M6 6l12 12`,check:`m5 12 5 5L20 7`,checkCircle:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm-3-9 2 2 4-4`,camera:`M5 7h1a2 2 0 0 0 2-2 1 1 0 0 1 1-1h6a1 1 0 0 1 1 1 2 2 0 0 0 2 2h1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2Zm7 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z`,monitor:`M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5Zm4 15h10M9 16v4m6-4v4`,history:`M12 8v4l2 2M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5`,cpu:`M5 6a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6Zm4 3h6v6H9V9ZM3 10h2m-2 4h2m14-4h2m-2 4h2M10 3v2m4-2v2m-4 14v2m4-2v2`,send:`M10 14 21 3M21 3l-6.5 18a.55.55 0 0 1-1 0L10 14l-7-3.5a.55.55 0 0 1 0-1L21 3`,search:`M10 17a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm11 4-6-6`,thumbUp:`M7 11v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h3Zm0 0a4 4 0 0 0 4-4V6a2 2 0 0 1 4 0v5h3a2 2 0 0 1 2 2l-1 5a2 3 0 0 1-2 2h-7a3 3 0 0 1-3-3`,refresh:`M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4`,download:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12`,external:`M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1 9-9m-5 0h5v5`,book:`M3 19a9 9 0 0 1 9 0 9 9 0 0 1 9 0M3 6a9 9 0 0 1 9 0 9 9 0 0 1 9 0M3 6v13M12 6v13M21 6v13`,message:`M8 9h8M8 13h6M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-5l-5 3v-3H6a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h12Z`};function Ge(e){return Object.prototype.hasOwnProperty.call(We,e)}function X({name:e,size:t=16,stroke:n=1.8}){return Y(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":n,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:Y(`path`,{d:We[e]})})}function Z({icon:e,tone:t,small:n}){return Y(`span`,{class:`sg-tile sg-t-${t}${n?` sg-sm`:``}`,children:Y(X,{name:e,size:n?14:17})})}function Ke({tone:e,children:t}){return Y(`span`,{class:`sg-pill sg-t-${e}`,children:t})}function Q({children:e,onClick:t,variant:n=`primary`,disabled:r,busy:i,icon:a,type:o=`button`,testId:s,btnRef:c,label:l}){return Y(`button`,{ref:c,type:o,class:n===`primary`?`sg-btn`:n===`ghost`?`sg-btn sg-btn-ghost`:`sg-btn sg-btn-danger`,onClick:t,disabled:r||i,"data-testid":s,"aria-label":l,children:[i?Y(`span`,{class:`sg-spin`,"aria-hidden":`true`}):a?Y(X,{name:a,size:15}):null,e]})}function qe({label:e,hint:t,error:n,children:r}){return Y(`label`,{class:`sg-field`,children:[Y(`span`,{class:`sg-label`,children:e}),r,n?Y(`span`,{class:`sg-err`,role:`alert`,children:n}):t?Y(`span`,{class:`sg-hint`,children:t}):null]})}function $({name:e,filled:t}){return t.has(e)?Y(`div`,{class:`sg-slot sg-slot-${e}`,"data-testid":`sg-slot-${e}`,children:Y(`slot`,{name:e})}):null}function Je({on:e,onChange:t,label:n}){return Y(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":n,class:`sg-switch`,onClick:()=>t(!e)})}function Ye({view:e}){let t=e.stages.length;return Y(`div`,{class:`sg-rail sg-t-${e.offPath?`neutral`:e.tone}`,role:`img`,"aria-label":`${e.label}: stage ${e.stage+1} of ${t}`,children:e.stages.map((n,r)=>{let i=r<=e.stage,a=r===e.stage,o=r===t-1&&!e.offPath&&r>e.stage;return Y(`div`,{class:`sg-rail-stage`,children:[Y(`div`,{class:`sg-rail-line`,children:[Y(`span`,{class:`sg-rail-seg ${r===0?`sg-none`:r<=e.stage?`sg-on`:``}`}),Y(`span`,{class:`sg-rail-node${i?` sg-on`:``}${a?` sg-here`:``}${a&&e.active?` sg-pulse`:``}${o?` sg-yours`:``}`}),Y(`span`,{class:`sg-rail-seg ${r===t-1?`sg-none`:r<e.stage?`sg-on`:``}`})]}),Y(`span`,{class:`sg-rail-label${i?` sg-on`:``}`,children:e.offPath&&r>e.stage?``:n})]},n)})})}function Xe({w:e}){let[t,n]=K(``),r=Fe(()=>{let n=t.trim().toLowerCase();return n?e.faq.filter(e=>`${e.q} ${e.a} ${(e.tags??[]).join(` `)}`.toLowerCase().includes(n)):e.faq},[t,e.faq]);return Y(`div`,{class:`sg-body`,children:Y(`div`,{class:`sg-pad`,children:[Y(`div`,{style:{position:`relative`,marginBottom:`12px`},children:[Y(`span`,{class:`sg-dim`,style:{position:`absolute`,left:`10px`,top:`9px`},children:Y(X,{name:`search`,size:15})}),Y(`input`,{class:`sg-input`,style:{paddingLeft:`32px`},placeholder:e.copy.faqSearch,"aria-label":e.copy.faqSearch,value:t,onInput:e=>n(e.currentTarget.value),"data-testid":`sg-faq-search`})]}),r.length===0&&Y(`p`,{class:`sg-p sg-dim sg-small`,children:e.copy.faqEmpty}),r.map(e=>Y(`details`,{class:`sg-faq`,children:[Y(`summary`,{children:[e.q,Y(`span`,{class:`sg-chev`,children:Y(X,{name:`chevronRight`,size:14})})]}),Y(`div`,{class:`sg-faq-a`,children:e.a})]},e.q)),e.features.report&&Y(`div`,{class:`sg-banner sg-t-accent`,style:{marginTop:`16px`,alignItems:`center`},children:[Y(`span`,{style:{flex:1},class:`sg-banner-title`,children:e.copy.faqNotFound}),Y(Q,{variant:`ghost`,icon:`bug`,onClick:()=>e.go({name:`report`}),children:e.copy.reportAction})]})]})})}function Ze({w:e}){let{copy:t,support:n,state:r,features:i}=e,[a,o]=K(`idea`),[s,c]=K(``),[l,u]=K(null),[d,f]=K({name:``,email:``}),[m,h]=K(!1),[g,_]=K(!1),[v,y]=K(null),b=s.trim().length<4,x=r.signedIn!==!0;async function S(){if(_(!0),!b){h(!0),y(null);try{let t=await n.submitFeedback({kind:a,body:s,screenshot:l??void 0,contact:x&&(d.name||d.email)?{name:d.name||void 0,email:d.email||void 0}:void 0});e.emit(`submitted`,{...t,type:`feedback`}),e.go({name:`thanks`})}catch(e){y(e instanceof Error?e.message:t.error)}finally{h(!1)}}}return Y(V,{children:[Y(`div`,{class:`sg-body`,children:[Y($,{name:`feedback-top`,filled:e.slots}),Y(`div`,{class:`sg-pad sg-stack`,children:[Y(`div`,{children:[Y(`span`,{class:`sg-label`,children:t.feedbackKindLabel}),Y(`div`,{class:`sg-chips`,role:`radiogroup`,"aria-label":t.feedbackKindLabel,children:Object.keys(p).map(e=>Y(`button`,{type:`button`,class:`sg-chip`,role:`radio`,"aria-checked":a===e,onClick:()=>o(e),"data-testid":`sg-kind-${e}`,children:p[e].label},e))}),Y(`span`,{class:`sg-hint`,children:p[a].hint})]}),Y(qe,{label:t.feedbackLabel,error:g&&b?`Say a little more.`:null,children:Y(`textarea`,{class:`sg-textarea${g&&b?` sg-invalid`:``}`,value:s,onInput:e=>c(e.currentTarget.value),placeholder:t.feedbackPlaceholder,"data-testid":`sg-feedback-body`,autoFocus:!0})}),i.screenshot&&Y(`div`,{children:l?Y(V,{children:[Y(`img`,{class:`sg-shot`,src:l,alt:`The frame that will be attached`}),Y(`button`,{type:`button`,class:`sg-link`,style:{marginTop:`6px`},onClick:()=>u(null),children:`Remove`})]}):Y(`button`,{type:`button`,class:`sg-link`,onClick:async()=>{let t=await e.capture();t.ok&&u(t.dataUrl)},children:[`+ `,t.capture]})}),x&&Y(`div`,{children:[Y(`span`,{class:`sg-label`,children:t.contactLabel}),Y(`div`,{class:`sg-stack`,children:[Y(`input`,{class:`sg-input`,placeholder:t.namePlaceholder,value:d.name,onInput:e=>f(t=>({...t,name:e.currentTarget.value}))}),Y(`input`,{class:`sg-input`,type:`email`,placeholder:t.emailPlaceholder,value:d.email,onInput:e=>f(t=>({...t,email:e.currentTarget.value}))})]}),Y(`span`,{class:`sg-hint`,children:t.contactHint})]}),v&&Y(`p`,{class:`sg-err`,role:`alert`,children:v})]})]}),Y(`div`,{class:`sg-footer`,children:[Y(Q,{variant:`ghost`,onClick:()=>e.go({name:`home`}),children:t.cancel}),Y(Q,{onClick:()=>void S(),busy:m,icon:`send`,testId:`sg-send-feedback`,children:t.sendFeedback})]})]})}function Qe({w:e,compact:t=!1}){let n=e.state.reports;if(n.length===0)return Y(`div`,{class:`sg-empty`,children:[Y(`span`,{class:`sg-empty-icon`,children:Y(X,{name:`bug`,size:20})}),Y(`p`,{class:`sg-p`,style:{marginTop:`10px`,fontWeight:600},children:e.copy.noReports}),Y(`p`,{class:`sg-p sg-small sg-dim`,style:{marginTop:`4px`},children:e.copy.noReportsBody}),e.features.report&&Y(`div`,{style:{marginTop:`14px`},children:Y(Q,{variant:`ghost`,icon:`bug`,onClick:()=>e.go({name:`report`}),children:e.copy.reportAction})})]});let r=n.filter(t=>g(t,e.appVersion).open),i=n.filter(t=>!g(t,e.appVersion).open);return t?Y(V,{children:[r.length>0?Y($e,{w:e,reports:r.slice(0,3)}):Y(`p`,{class:`sg-p sg-small sg-dim sg-pad`,children:e.copy.nothingOpen}),i.length>0&&Y(`button`,{type:`button`,class:`sg-closed-link`,onClick:()=>e.go({name:`reports`}),"data-testid":`sg-closed-link`,children:[e.copy.closedReports,` · `,i.length,Y(X,{name:`chevronRight`,size:14})]})]}):Y(V,{children:[r.length>0?Y($e,{w:e,reports:r}):Y(`p`,{class:`sg-p sg-small sg-dim sg-pad`,children:e.copy.nothingOpen}),i.length>0&&Y(`details`,{class:`sg-closed`,"data-testid":`sg-closed`,children:[Y(`summary`,{children:[Y(X,{name:`chevronRight`,size:14}),e.copy.closedReports,` · `,i.length]}),Y($e,{w:e,reports:i})]})]})}function $e({w:e,reports:t}){return Y(`ul`,{class:`sg-list`,"data-testid":`sg-report-list`,children:t.map(t=>{let n=g(t,e.appVersion),r=e.support.unread(t),i=typeof t.source_context?.area==`string`?t.source_context.area:null;return Y(`li`,{children:Y(`button`,{type:`button`,class:`sg-row`,onClick:()=>e.go({name:`detail`,id:t.id}),"data-testid":`sg-report-row`,children:[Y(`div`,{class:`sg-row-main`,children:[Y(`div`,{class:`sg-row-top`,children:[r&&Y(`span`,{class:`sg-dot`,style:{marginTop:`7px`},"aria-label":`New reply`}),Y(`span`,{class:`sg-row-title`,children:t.subject}),Y(Ke,{tone:n.tone,children:n.label})]}),Y(`div`,{class:`sg-row-meta`,children:[Y(`span`,{class:`sg-mono`,children:t.ref}),i&&Y(`span`,{children:[`· `,i]}),Y(`span`,{children:[`· `,c(t.created_at)]})]}),n.needsYou&&Y(`span`,{class:`sg-row-cta sg-t-${t.status===`waiting_user`?`warn`:`success`}`,children:[Y(X,{name:t.status===`waiting_user`?`message`:`checkCircle`,size:13}),t.status===`waiting_user`?`Reply to the team`:`Check the fix and tell the team`]})]}),Y(`span`,{class:`sg-chev`,style:{paddingTop:`2px`},children:Y(X,{name:`chevronRight`})})]})},t.id)})})}function et({w:e,id:t}){let{copy:n,support:l}=e,[u,d]=K(null),[p,h]=K(null),[_,y]=K(``),[b,x]=K(!1),[S,C]=K(!1),[w,T]=K(``),[E,D]=K(!1),[O,k]=K(!1),[A,j]=K(``),[M,N]=K(!1),P=J(null);if(q(()=>{let e=!0,r=()=>l.detail(t).then(n=>{e&&(d(n),l.markSeen(t))}).catch(t=>e&&h(t instanceof Error?t.message:n.error));r();let i=setInterval(()=>{document.visibilityState===`visible`&&r()},1e4),a=()=>{document.visibilityState===`visible`&&r()};return window.addEventListener(`focus`,a),document.addEventListener(`visibilitychange`,a),()=>{e=!1,clearInterval(i),window.removeEventListener(`focus`,a),document.removeEventListener(`visibilitychange`,a)}},[t,l,n.error,e.tick]),q(()=>{P.current?.scrollIntoView({block:`end`})},[u?.timeline.length??0]),!u)return Y(`div`,{class:`sg-body`,"aria-busy":`true`,children:p?Y(`p`,{class:`sg-err sg-pad`,children:p}):Y(V,{children:[Y(`div`,{class:`sg-skeleton`}),Y(`div`,{class:`sg-skeleton`})]})});let F=g(u,e.appVersion),I=r(u.body),ee=a(u,e.appVersion),L=m(u,e.appVersion),R=typeof u.source_context?.area==`string`?u.source_context.area:null,z=typeof u.source_context?.app_version==`string`?u.source_context.app_version:null;async function te(r){D(!0),h(null);try{let n=await l.verify(t,r,r?void 0:w.trim()||void 0);d(n),C(!1),T(``),e.emit(`verified`,{id:t,works:r})}catch(e){h(e instanceof Error?e.message:n.error)}finally{D(!1)}}async function B(){N(!0),h(null);try{let n=await l.withdraw(t,A.trim()||void 0);d(n),k(!1),j(``),e.emit(`withdrawn`,{id:t})}catch(e){h(e instanceof Error?e.message:n.error)}finally{N(!1)}}async function H(){let e=_.trim();if(e){x(!0),h(null);try{d(await l.reply(t,e)),y(``)}catch(e){h(e instanceof Error?e.message:n.error)}finally{x(!1)}}}return Y(V,{children:[Y(`div`,{class:`sg-body`,"data-testid":`sg-detail`,children:Y(`div`,{class:`sg-pad sg-stack`,children:[Y(`div`,{class:`sg-rail-box`,children:Y(Ye,{view:F})}),Y(`div`,{children:[Y(Ke,{tone:F.tone,children:F.label}),Y(`p`,{class:`sg-p sg-muted`,style:{marginTop:`6px`},children:F.blurb})]}),ee&&Y(`div`,{class:`sg-banner sg-t-success`,style:{display:`block`},"data-testid":`sg-verify`,children:[Y(`p`,{class:`sg-banner-title`,style:{display:`flex`,gap:`8px`,alignItems:`center`},children:[Y(X,{name:`checkCircle`}),` `,n.verifyTitle]}),Y(`p`,{class:`sg-banner-body`,children:[u.fixed_in_version&&e.appVersion?`Fixed in ${u.fixed_in_version}; you are on ${e.appVersion}. `:``,n.verifyBody]}),S?Y(`div`,{style:{marginTop:`10px`},class:`sg-stack`,children:[Y(`textarea`,{class:`sg-textarea`,value:w,onInput:e=>T(e.currentTarget.value),placeholder:n.verifyNoPlaceholder,autoFocus:!0,"data-testid":`sg-verify-note`}),Y(`div`,{style:{display:`flex`,gap:`8px`},children:[Y(Q,{variant:`danger`,onClick:()=>void te(!1),busy:E,testId:`sg-verify-send-no`,children:n.verifySend}),Y(Q,{variant:`ghost`,onClick:()=>C(!1),children:n.cancel})]})]}):Y(`div`,{style:{marginTop:`10px`,display:`flex`,gap:`8px`,flexWrap:`wrap`},children:[Y(Q,{icon:`thumbUp`,onClick:()=>void te(!0),busy:E,testId:`sg-verify-yes`,children:n.verifyYes}),Y(Q,{variant:`danger`,onClick:()=>C(!0),testId:`sg-verify-no`,children:n.verifyNo})]})]}),L&&Y(`div`,{class:`sg-banner sg-t-warn`,children:[Y(Z,{icon:`download`,tone:`warn`,small:!0}),Y(`div`,{children:[Y(`p`,{class:`sg-banner-title`,children:v(n.updateTitle,{version:u.fixed_in_version??``,running:e.appVersion??``})}),Y(`p`,{class:`sg-banner-body`,children:n.updateBody})]})]}),Y(`div`,{children:[Y(`span`,{class:`sg-label`,children:n.whatYouReported}),I.some(e=>e.label)?Y(`dl`,{class:`sg-review`,style:{margin:`4px 0 0`},children:I.map((e,t)=>Y(V,{children:[e.label&&Y(`dt`,{children:e.label},`l${t}`),Y(`dd`,{children:e.text},`t${t}`)]}))}):Y(V,{children:[Y(`p`,{class:`sg-p`,style:{fontWeight:600},children:u.subject}),u.body&&Y(`p`,{class:`sg-p sg-muted`,style:{whiteSpace:`pre-wrap`,marginTop:`4px`},children:u.body})]}),Y(`div`,{class:`sg-row-meta`,style:{marginTop:`6px`},children:[Y(`span`,{class:`sg-mono`,children:u.ref}),R&&Y(`span`,{children:[`· `,R]}),z&&Y(`span`,{children:[`· reported on `,z]}),Y(`span`,{children:[`· `,c(u.created_at)]})]})]}),Y(`div`,{children:[Y(`span`,{class:`sg-label`,children:n.conversation}),Y(`div`,{class:`sg-thread`,"data-testid":`sg-thread`,children:[i(u).map((e,t)=>e.kind===`read`?Y(`div`,{class:`sg-event`,"data-testid":`sg-read`,children:[s(e.name),` · `,c(e.at)]},t):e.kind===`status`?Y(`div`,{class:`sg-event`,children:[f(e),` · `,c(e.at)]},t):Y(`div`,{class:`sg-msg ${e.by===`you`?`sg-you`:`sg-team`}`,"data-testid":`sg-msg-${e.by}`,children:[Y(`span`,{class:`sg-msg-meta`,children:[e.by===`you`?n.you:e.author_name,` · `,c(e.at)]}),e.body]},t)),Y(`div`,{ref:P})]})]}),o(u)&&!ee&&(O?Y(`div`,{class:`sg-banner`,style:{display:`block`},"data-testid":`sg-withdraw`,children:[Y(`p`,{class:`sg-banner-title`,children:n.withdrawTitle}),Y(`p`,{class:`sg-banner-body`,children:n.withdrawBody}),Y(`div`,{style:{marginTop:`10px`},class:`sg-stack`,children:[Y(`textarea`,{class:`sg-textarea`,value:A,onInput:e=>j(e.currentTarget.value),placeholder:n.withdrawPlaceholder,autoFocus:!0,"data-testid":`sg-withdraw-note`}),Y(`div`,{style:{display:`flex`,gap:`8px`},children:[Y(Q,{variant:`danger`,onClick:()=>void B(),busy:M,testId:`sg-withdraw-confirm`,children:n.withdrawConfirm}),Y(Q,{variant:`ghost`,onClick:()=>k(!1),children:n.withdrawKeep})]})]})]}):Y(`button`,{type:`button`,class:`sg-quiet-link`,onClick:()=>k(!0),"data-testid":`sg-withdraw-open`,children:n.withdrawAction})),p&&Y(`p`,{class:`sg-err`,role:`alert`,children:p})]})}),F.open?Y(`form`,{class:`sg-composer`,onSubmit:e=>{e.preventDefault(),H()},children:[Y(`textarea`,{class:`sg-textarea`,rows:1,value:_,onInput:e=>y(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),H())},placeholder:n.replyPlaceholder,"aria-label":n.replyPlaceholder,"data-testid":`sg-reply`}),Y(Q,{type:`submit`,icon:`send`,busy:b,disabled:!_.trim(),testId:`sg-reply-send`,children:n.send})]}):Y(`div`,{class:`sg-footer sg-small sg-dim`,children:n.closedNote})]})}function tt({w:e}){let{copy:t,features:n,state:r}=e,i=r.reports,a=i.filter(t=>t.status===`resolved`&&g(t,e.appVersion).needsYou),o=i.filter(e=>e.status===`waiting_user`),s=n.reports&&r.signedIn!==!1,c=i.filter(t=>g(t,e.appVersion).open).length;return Y(`div`,{class:`sg-body`,"data-testid":`sg-home`,children:[Y($,{name:`home-top`,filled:e.slots}),Y(`section`,{class:`sg-section`,children:[Y(`div`,{class:`sg-section-head`,children:Y(`h3`,{class:`sg-section-title`,children:t.homeTitle})}),n.report&&Y(`button`,{type:`button`,class:`sg-action`,onClick:()=>e.go({name:`report`}),"data-testid":`sg-open-report`,children:[Y(Z,{icon:`bug`,tone:`danger`}),Y(`span`,{class:`sg-action-text`,children:[Y(`span`,{class:`sg-action-label`,children:t.reportAction}),Y(`span`,{class:`sg-action-hint`,children:t.reportHint})]}),Y(`span`,{class:`sg-chev`,children:Y(X,{name:`chevronRight`})})]}),n.feedback&&Y(`button`,{type:`button`,class:`sg-action`,onClick:()=>e.go({name:`feedback`}),"data-testid":`sg-open-feedback`,children:[Y(Z,{icon:`bulb`,tone:`warn`}),Y(`span`,{class:`sg-action-text`,children:[Y(`span`,{class:`sg-action-label`,children:t.feedbackAction}),Y(`span`,{class:`sg-action-hint`,children:t.feedbackHint})]}),Y(`span`,{class:`sg-chev`,children:Y(X,{name:`chevronRight`})})]}),n.faq&&e.faq.length>0&&Y(`button`,{type:`button`,class:`sg-action`,onClick:()=>e.go({name:`faq`}),"data-testid":`sg-open-faq`,children:[Y(Z,{icon:`question`,tone:`accent`}),Y(`span`,{class:`sg-action-text`,children:[Y(`span`,{class:`sg-action-label`,children:t.faqAction}),Y(`span`,{class:`sg-action-hint`,children:t.faqHint})]}),Y(`span`,{class:`sg-chev`,children:Y(X,{name:`chevronRight`})})]}),e.actions.map((e,t)=>Y(nt,{action:e,index:t},`${e.label}-${t}`))]}),s&&Y(`section`,{class:`sg-section`,style:{paddingLeft:0,paddingRight:0},children:[Y(`div`,{class:`sg-section-head`,style:{padding:`0 16px`},children:[Y(`h3`,{class:`sg-section-title`,children:[t.yourReports,c?` · ${c}`:``]}),c>3&&Y(`button`,{type:`button`,class:`sg-link`,onClick:()=>e.go({name:`reports`}),children:[t.seeAll,` `,c]})]}),(a.length>0||o.length>0)&&Y(`div`,{style:{padding:`0 16px 10px`},children:Y(`button`,{type:`button`,class:`sg-banner sg-t-${a.length?`success`:`warn`}`,onClick:()=>e.go(a.length+o.length===1?{name:`detail`,id:(a[0]??o[0]).id}:{name:`reports`}),"data-testid":`sg-attention`,children:[Y(Z,{icon:a.length?`checkCircle`:`message`,tone:a.length?`success`:`warn`,small:!0}),Y(`span`,{children:Y(`span`,{class:`sg-banner-title`,children:a.length?a.length===1?t.fixesWaitingOne:v(t.fixesWaitingMany,{n:a.length}):t.questionWaiting})})]})}),r.signedIn===null||r.loading&&i.length===0?Y(`div`,{"aria-busy":`true`,children:[Y(`div`,{class:`sg-skeleton`}),Y(`div`,{class:`sg-skeleton`})]}):i.length===0?Y(rt,{w:e}):Y(Qe,{w:e,compact:!0})]}),n.reports&&r.signedIn===!1&&Y(`section`,{class:`sg-section`,children:Y(`p`,{class:`sg-p sg-small sg-dim`,children:t.signedOutReports})}),Y($,{name:`home-bottom`,filled:e.slots})]})}function nt({action:e,index:t}){let n=e.icon&&Ge(e.icon)?e.icon:null,r=e.icon&&!n?e.icon:null,i=Y(V,{children:[r?Y(`span`,{class:`sg-tile sg-t-accent`,children:Y(`img`,{src:r,alt:``,class:`sg-tile-img`})}):Y(Z,{icon:n??(e.href?`external`:`chevronRight`),tone:`accent`}),Y(`span`,{class:`sg-action-text`,children:[Y(`span`,{class:`sg-action-label`,children:e.label}),e.hint&&Y(`span`,{class:`sg-action-hint`,children:e.hint})]}),Y(`span`,{class:`sg-chev`,children:Y(X,{name:e.href?`external`:`chevronRight`})})]});return e.href?Y(`a`,{class:`sg-action`,href:e.href,target:`_blank`,rel:`noopener noreferrer`,"data-testid":`sg-host-action-${t}`,children:i}):Y(`button`,{type:`button`,class:`sg-action`,onClick:()=>e.onClick?.(),"data-testid":`sg-host-action-${t}`,children:i})}function rt({w:e}){return Y(`div`,{style:{padding:`0 16px`},children:Y(`div`,{class:`sg-rail-box`,children:[Y(Ye,{view:{label:`How a report travels`,blurb:``,tone:`accent`,stages:[`Sent`,`Read`,`Accepted`,`Fixed`,`You check`],stage:-1,active:!1,offPath:!1,open:!0,needsYou:!1}}),Y(`p`,{class:`sg-p sg-small sg-muted`,style:{marginTop:`10px`},children:e.copy.noReportsBody})]})})}var it=[`blocking`,`major`,`minor`,`cosmetic`];function at({w:n}){let{copy:r,support:i,state:a,features:o}=n,[s,u]=K(1),[f,p]=K(``),[m,g]=K(``),[_,v]=K(`major`),[y,b]=K(String(i.context().area??``)),[x,S]=K(!1),[C,w]=K(null),[T,E]=K(null),[D,O]=K(null),[k,A]=K(!1),[j,M]=K({screenshot:!0,system:!0,trail:!0,extra:!0}),[N,P]=K({name:``,email:``}),[F,I]=K(!1),[ee,L]=K(null),R=a.signedIn!==!0,z=h({what:f,expected:m});async function te(){if(S(!0),!z){I(!0);try{w(await i.collect())}catch{w({trail:i.trail.recent(10)})}finally{I(!1),u(2)}}}async function B(){A(!0),O(null);let e=await n.capture();A(!1),e.ok?(E({dataUrl:e.dataUrl,width:e.width,height:e.height,bytes:e.bytes,mime:e.mime}),M(e=>({...e,screenshot:!0}))):e.reason!==`cancelled`&&O(e.message)}async function H(){I(!0),L(null);try{let e=await i.submitIssue({what:f,expected:m,severity:_,area:y,screenshot:j.screenshot&&T?T.dataUrl:void 0,include:{screenshot:j.screenshot&&!!T,system:j.system,browser:j.system,trail:j.trail,extra:j.extra},contact:R&&(N.name||N.email)?{name:N.name||void 0,email:N.email||void 0}:void 0});n.emit(`submitted`,{...e,type:`incident`}),n.go({name:`sent`,id:e.id,ref:e.ref})}catch(e){L(e instanceof Error?e.message:r.error)}finally{I(!1)}}let U=C?.trail??[],ne=C?.extra?Object.keys(C.extra):[];return Y(V,{children:[Y(ot,{step:s,labels:[r.stepDescribe,r.stepAttach,r.stepReview]}),Y(`div`,{class:`sg-body`,children:[s===1&&Y($,{name:`report-top`,filled:n.slots}),s===1&&Y(`div`,{class:`sg-pad sg-stack`,children:[Y(qe,{label:r.whatLabel,hint:r.whatHint,error:x&&z?.field===`what`?z.message:null,children:Y(`textarea`,{class:`sg-textarea${x&&z?.field===`what`?` sg-invalid`:``}`,value:f,onInput:e=>p(e.currentTarget.value),placeholder:r.whatPlaceholder,"data-testid":`sg-what`,autoFocus:!0})}),Y(qe,{label:r.expectedLabel,hint:r.expectedHint,error:x&&z?.field===`expected`?z.message:null,children:Y(`textarea`,{class:`sg-textarea${x&&z?.field===`expected`?` sg-invalid`:``}`,value:m,onInput:e=>g(e.currentTarget.value),placeholder:r.expectedPlaceholder,"data-testid":`sg-expected`})}),Y(`div`,{children:[Y(`span`,{class:`sg-label`,children:r.severityLabel}),Y(`div`,{class:`sg-chips`,role:`radiogroup`,"aria-label":r.severityLabel,children:it.map(e=>Y(`button`,{type:`button`,class:`sg-chip`,role:`radio`,"aria-checked":_===e,onClick:()=>v(e),"data-testid":`sg-sev-${e}`,children:[Y(`span`,{class:`sg-dot sg-t-${d[e].tone}`}),d[e].label]},e))}),Y(`span`,{class:`sg-hint`,children:d[_].hint})]}),Y(qe,{label:r.whereLabel,hint:r.whereHint,children:Y(`input`,{class:`sg-input`,value:y,onInput:e=>b(e.currentTarget.value),"data-testid":`sg-where`})})]}),s===2&&Y(`div`,{class:`sg-pad`,children:[Y(`p`,{class:`sg-p sg-small sg-muted`,style:{marginBottom:`12px`},children:r.attachIntro}),o.screenshot&&Y(st,{icon:`camera`,title:r.screenshot,summary:T?`${T.width}×${T.height} · ${t(T.bytes)}`:r.screenshotNone,on:j.screenshot&&!!T,onToggle:e=>T?M(t=>({...t,screenshot:e})):void B(),accessory:Y(`button`,{type:`button`,class:`sg-link`,onClick:()=>void B(),disabled:k,"data-testid":`sg-capture`,children:k?r.capturing:T?r.retake:r.capture}),children:[T&&Y(`img`,{class:`sg-shot`,src:T.dataUrl,alt:`The frame that will be attached`,"data-testid":`sg-shot`}),D&&Y(`span`,{class:`sg-err`,children:D})]}),Y(st,{icon:`monitor`,title:r.system,summary:`${e(C?.system)} · ${l(C?.browser)}`,on:j.system,onToggle:e=>M(t=>({...t,system:e})),children:Y(`pre`,{class:`sg-json`,children:JSON.stringify({system:C?.system,browser:C?.browser},null,2)})}),Y(st,{icon:`history`,title:r.trail,summary:U.length?`${U.length} steps, ending with “${U[U.length-1].label}”`:r.trailNone,on:j.trail&&U.length>0,onToggle:e=>M(t=>({...t,trail:e})),children:U.length>0&&Y(`ol`,{class:`sg-steplist`,children:U.map((e,t)=>Y(`li`,{children:[Y(`span`,{class:`sg-when`,children:c(e.at)}),Y(`span`,{class:e.kind===`error`?`sg-err-step`:``,children:e.label})]},t))})}),ne.length>0&&Y(st,{icon:`cpu`,title:r.diagnostics,summary:ne.join(`, `),on:j.extra,onToggle:e=>M(t=>({...t,extra:e})),children:Y(`pre`,{class:`sg-json`,children:JSON.stringify(C?.extra,null,2)})})]}),s===3&&Y(`div`,{class:`sg-pad`,children:[Y(`dl`,{class:`sg-review`,style:{margin:0},children:[Y(`dt`,{children:r.whatLabel}),Y(`dd`,{children:f.trim()}),Y(`dt`,{children:r.expectedLabel}),Y(`dd`,{children:m.trim()}),Y(`dt`,{children:r.severityLabel}),Y(`dd`,{children:d[_].label}),y.trim()&&Y(V,{children:[Y(`dt`,{children:r.whereLabel}),Y(`dd`,{children:y.trim()})]}),n.appVersion&&Y(V,{children:[Y(`dt`,{children:`Version`}),Y(`dd`,{children:n.appVersion})]})]}),Y(`span`,{class:`sg-label`,children:r.attached}),Y(`ul`,{class:`sg-attached`,children:[o.screenshot&&Y(ct,{on:j.screenshot&&!!T,label:r.screenshot,copy:r.notAttached}),Y(ct,{on:j.system,label:r.system,copy:r.notAttached}),Y(ct,{on:j.trail&&U.length>0,label:r.trail,copy:r.notAttached}),ne.length>0&&Y(ct,{on:j.extra,label:r.diagnostics,copy:r.notAttached})]}),R&&Y(`div`,{style:{marginTop:`16px`},children:[Y(`span`,{class:`sg-label`,children:r.contactLabel}),Y(`div`,{class:`sg-stack`,children:[Y(`input`,{class:`sg-input`,placeholder:r.namePlaceholder,value:N.name,onInput:e=>P(t=>({...t,name:e.currentTarget.value}))}),Y(`input`,{class:`sg-input`,type:`email`,placeholder:r.emailPlaceholder,value:N.email,onInput:e=>P(t=>({...t,email:e.currentTarget.value}))})]}),Y(`span`,{class:`sg-hint`,children:r.contactHint})]}),ee&&Y(`p`,{class:`sg-err`,role:`alert`,style:{marginTop:`12px`},children:ee})]})]}),Y(`div`,{class:`sg-footer`,children:[Y(Q,{variant:`ghost`,icon:s===1?void 0:`chevronLeft`,onClick:()=>s===1?n.go({name:`home`}):u(e=>e-1),children:s===1?r.cancel:r.back}),s===1&&Y(Q,{onClick:()=>void te(),busy:F,testId:`sg-next`,children:r.next}),s===2&&Y(Q,{onClick:()=>u(3),testId:`sg-next`,children:r.next}),s===3&&Y(Q,{onClick:()=>void H(),busy:F,icon:`send`,testId:`sg-submit`,children:r.submitReport})]})]})}function ot({step:e,labels:t}){return Y(`div`,{class:`sg-steps`,"aria-label":`Step ${e} of ${t.length}`,children:t.map((n,r)=>{let i=r+1,a=i<e,o=i===e;return Y(`div`,{class:`sg-step`,children:[Y(`div`,{class:`sg-step-line`,children:[Y(`span`,{class:`sg-step-seg ${r===0?`sg-none`:a||o?`sg-on`:``}`}),Y(`span`,{class:`sg-step-node${o?` sg-now`:a?` sg-done`:``}`,children:a?Y(X,{name:`check`,size:11,stroke:2.6}):i}),Y(`span`,{class:`sg-step-seg ${r===t.length-1?`sg-none`:a?`sg-on`:``}`})]}),Y(`span`,{class:`sg-step-label${o?` sg-now`:``}`,children:n})]},n)})})}function st({icon:e,title:t,summary:n,on:r,onToggle:i,accessory:a,children:o}){return Y(`div`,{class:`sg-card${r?``:` sg-off`}`,children:[Y(`div`,{class:`sg-card-head`,children:[Y(`span`,{class:`sg-dim`,style:{paddingTop:`2px`},children:Y(X,{name:e})}),Y(`div`,{class:`sg-card-text`,children:[Y(`p`,{class:`sg-card-title`,children:t}),Y(`p`,{class:`sg-card-sum`,children:n}),a&&Y(`div`,{style:{marginTop:`4px`},children:a})]}),Y(Je,{on:r,onChange:i,label:`Attach ${t}`})]}),o&&Y(`div`,{class:`sg-card-body`,children:o})]})}function ct({on:e,label:t,copy:n}){return Y(`li`,{class:e?``:`sg-dim`,children:[Y(`span`,{style:{color:e?`var(--sg-success)`:`var(--sg-dim)`},children:e?Y(X,{name:`check`,size:14,stroke:2.4}):`–`}),t,!e&&Y(`span`,{class:`sg-small sg-dim`,children:n})]})}var lt={ok:!1,reason:`cancelled`,message:`Capture was cancelled.`};function ut(e,t,n){let r=null,i=!1;function a(t){let n=r;r=null,i=!1,e.set({picking:!1,hidden:!1}),n?.(t)}return{get active(){return r!==null},start(){return n()?(r&&a(lt),new Promise(t=>{r=t,e.set({picking:!0,hidden:!1})})):Promise.resolve({ok:!1,reason:`unsupported`,message:`This browser cannot capture the screen.`})},async capture(){if(!r||i)return;i=!0,e.set({hidden:!0});let n=await t({beforeCapture:()=>e.set({hidden:!0}),afterCapture:()=>{}});if(i=!1,r){if(!n.ok&&n.reason===`cancelled`){e.set({hidden:!1});return}a(n)}},cancel(){r&&a(lt)}}}var dt=`:host{all:initial;font-family:inherit}.sg-root{font-family:var(--sg-font);font-size:var(--sg-size);line-height:1.5;color:var(--sg-text);-webkit-font-smoothing:antialiased}.sg-root *,.sg-root *::before,.sg-root *::after{box-sizing:border-box}.sg-root button,.sg-root input,.sg-root textarea{font:inherit;color:inherit}.sg-root :focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}.sg-launcher{position:fixed;bottom:20px;z-index:var(--sg-z);display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 16px 0 14px;border:0;border-radius:999px;cursor:pointer;background:var(--sg-accent);color:var(--sg-accent-text);font-weight:600;font-size:calc(var(--sg-size) + 0.5px);box-shadow:0 10px 30px -10px color-mix(in srgb,var(--sg-accent) 70%,black),0 2px 6px rgba(0,0,0,0.18);transition:transform .16s ease,box-shadow .16s ease}.sg-launcher:hover{transform:translateY(-1px)}.sg-launcher.sg-right{right:20px}.sg-launcher.sg-left{left:20px}.sg-launcher[data-hidden="true"]{opacity:0;pointer-events:none;transform:scale(.9)}.sg-badge{min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--sg-danger);color:#fff;font-size:11px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;line-height:1}.sg-launcher .sg-badge{margin-left:2px;box-shadow:0 0 0 2px var(--sg-accent)}.sg-scrim{position:fixed;inset:0;z-index:var(--sg-z);background:var(--sg-scrim);opacity:0;transition:opacity .18s ease;backdrop-filter:blur(1.5px)}.sg-open .sg-scrim{opacity:1}.sg-panel{position:fixed;z-index:calc(var(--sg-z) + 1);display:flex;flex-direction:column;overflow:hidden;background:var(--sg-bg);color:var(--sg-text);border:1px solid var(--sg-border);box-shadow:var(--sg-shadow);transition:transform .24s cubic-bezier(.22,1,.36,1),opacity .2s ease}.sg-panel[hidden]{display:none}.sg-panel:focus{outline:none}.sg-drawer{top:0;bottom:0;width:min(var(--sg-width),100vw);border-top:0;border-bottom:0}.sg-drawer.sg-right{right:0;border-right:0;transform:translateX(100%)}.sg-drawer.sg-left{left:0;border-left:0;transform:translateX(-100%)}.sg-open .sg-drawer{transform:none}.sg-modal{left:50%;top:50%;width:min(560px,calc(100vw - 32px));height:min(720px,calc(100vh - 48px));border-radius:calc(var(--sg-radius) + 4px);transform:translate(-50%,-48%) scale(.98);opacity:0}.sg-open .sg-modal{transform:translate(-50%,-50%);opacity:1}.sg-popover{bottom:80px;width:min(calc(var(--sg-width) - 40px),calc(100vw - 32px));height:min(680px,calc(100vh - 110px));border-radius:calc(var(--sg-radius) + 4px);transform:translateY(12px) scale(.98);opacity:0;transform-origin:bottom right}.sg-popover.sg-right{right:20px}.sg-popover.sg-left{left:20px;transform-origin:bottom left}.sg-open .sg-popover{transform:none;opacity:1}.sg-sheet{left:0;right:0;bottom:0;height:min(88vh,760px);border-radius:calc(var(--sg-radius) + 6px) calc(var(--sg-radius) + 6px) 0 0;border-bottom:0;transform:translateY(100%)}.sg-open .sg-sheet{transform:none}.sg-grabber{width:36px;height:4px;border-radius:4px;background:var(--sg-border);margin:8px auto 0;flex:none}.sg-accentline{position:absolute;inset:0 0 auto 0;height:1px;pointer-events:none;background:linear-gradient(90deg,var(--sg-accent),color-mix(in srgb,var(--sg-accent) 30%,transparent),transparent)}.sg-header{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--sg-border);flex:none;position:relative}.sg-brand{width:28px;height:28px;border-radius:var(--sg-radius-sm);object-fit:contain;flex:none}.sg-head-text{min-width:0;flex:1}.sg-title{margin:0;font-size:calc(var(--sg-size) + 1.5px);font-weight:650;letter-spacing:-0.01em;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sg-sub{margin:1px 0 0;font-size:calc(var(--sg-size) - 2.5px);color:var(--sg-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sg-iconbtn{width:30px;height:30px;border:0;background:transparent;border-radius:var(--sg-radius-sm);color:var(--sg-muted);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex:none}.sg-iconbtn:hover{background:var(--sg-raised);color:var(--sg-text)}.sg-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}.sg-pad{padding:14px 16px}.sg-stack>* + *{margin-top:14px}.sg-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px;border-top:1px solid var(--sg-border);flex:none}.sg-section{padding:14px 16px}.sg-section + .sg-section{border-top:1px solid var(--sg-border)}.sg-section-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:10px}.sg-section-title{margin:0;font-size:calc(var(--sg-size) - 2px);font-weight:650;letter-spacing:.06em;text-transform:uppercase;color:var(--sg-dim)}.sg-muted{color:var(--sg-muted)}.sg-dim{color:var(--sg-dim)}.sg-small{font-size:calc(var(--sg-size) - 1.5px)}.sg-mono{font-family:var(--sg-mono);font-size:calc(var(--sg-size) - 2px);letter-spacing:.02em}.sg-p{margin:0}.sg-action{width:100%;display:flex;align-items:center;gap:12px;padding:11px 12px;border:1px solid var(--sg-border);border-radius:var(--sg-radius);background:var(--sg-surface);cursor:pointer;text-align:left;transition:background .12s ease,border-color .12s ease}.sg-action + .sg-action{margin-top:8px}.sg-action:hover{background:var(--sg-raised);border-color:color-mix(in srgb,var(--sg-accent) 35%,var(--sg-border))}.sg-action-text{flex:1;min-width:0}.sg-action-label{display:block;font-weight:600}.sg-action-hint{display:block;font-size:calc(var(--sg-size) - 1.5px);color:var(--sg-dim)}.sg-chev{color:var(--sg-dim);flex:none}.sg-tile{width:34px;height:34px;border-radius:var(--sg-radius-sm);display:inline-flex;align-items:center;justify-content:center;flex:none}.sg-tile.sg-sm{width:28px;height:28px}.sg-tile-img{width:20px;height:20px;object-fit:contain}a.sg-action{color:inherit;text-decoration:none}.sg-slot{padding:12px 16px 0}.sg-slot-header{padding:0;display:flex;align-items:center;flex:none}.sg-slot-footer{padding:10px 14px;border-top:1px solid var(--sg-border);flex:none}.sg-slot-sent{padding:18px 0 0;width:100%}.sg-slot-home-bottom{padding:12px 16px 16px}.sg-t-accent{--sg-tone:var(--sg-accent)}.sg-t-info{--sg-tone:var(--sg-info)}.sg-t-warn{--sg-tone:var(--sg-warning)}.sg-t-danger{--sg-tone:var(--sg-danger)}.sg-t-success{--sg-tone:var(--sg-success)}.sg-t-neutral{--sg-tone:var(--sg-muted)}.sg-tile[class*="sg-t-"]{color:var(--sg-tone);background:color-mix(in srgb,var(--sg-tone) 15%,transparent)}.sg-pill{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border-radius:999px;white-space:nowrap;font-size:calc(var(--sg-size) - 2.5px);font-weight:600;color:var(--sg-tone);background:color-mix(in srgb,var(--sg-tone) 14%,transparent);border:1px solid color-mix(in srgb,var(--sg-tone) 30%,transparent)}.sg-banner{display:flex;gap:10px;align-items:flex-start;padding:11px 12px;border-radius:var(--sg-radius);background:color-mix(in srgb,var(--sg-tone) 11%,transparent);border:1px solid color-mix(in srgb,var(--sg-tone) 32%,transparent)}.sg-banner-title{margin:0;font-weight:600}.sg-banner-body{margin:2px 0 0;color:var(--sg-muted);font-size:calc(var(--sg-size) - 1px)}button.sg-banner{width:100%;text-align:left;cursor:pointer}.sg-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:34px;padding:0 14px;border-radius:var(--sg-radius-sm);border:1px solid transparent;background:var(--sg-accent);color:var(--sg-accent-text);font-weight:600;cursor:pointer;white-space:nowrap;transition:filter .12s ease,opacity .12s ease}.sg-btn:hover{filter:brightness(1.08)}.sg-btn:disabled{opacity:.45;cursor:default;filter:none}.sg-btn-ghost{background:transparent;color:var(--sg-muted);border-color:var(--sg-border)}.sg-btn-ghost:hover{background:var(--sg-raised);color:var(--sg-text);filter:none}.sg-btn-danger{background:transparent;color:var(--sg-danger);border-color:color-mix(in srgb,var(--sg-danger) 40%,transparent)}.sg-link{border:0;background:none;padding:0;color:var(--sg-accent);cursor:pointer;font-weight:600;font-size:calc(var(--sg-size) - 1px)}.sg-link:hover{text-decoration:underline}.sg-quiet-link{align-self:flex-start;border:0;background:none;padding:0;color:var(--sg-dim);cursor:pointer;font:inherit;font-size:calc(var(--sg-size) - 1.5px);text-decoration:underline;text-underline-offset:3px;text-decoration-color:color-mix(in srgb,currentColor 40%,transparent)}.sg-quiet-link:hover{color:var(--sg-text)}.sg-closed{border-top:1px solid var(--sg-border)}.sg-closed>summary,.sg-closed-link{display:flex;align-items:center;gap:6px;width:100%;padding:12px 16px;list-style:none;cursor:pointer;border:0;background:none;color:var(--sg-muted);font:inherit;font-weight:600;font-size:calc(var(--sg-size) - 1.5px);text-align:left}.sg-closed>summary::-webkit-details-marker{display:none}.sg-closed>summary:hover,.sg-closed-link:hover{color:var(--sg-text)}.sg-closed>summary svg{transition:transform .15s ease}.sg-closed[open]>summary svg{transform:rotate(90deg)}.sg-closed-link{justify-content:space-between;border-top:1px solid var(--sg-border)}.sg-back{border:0;background:none;padding:0;color:var(--sg-muted);cursor:pointer;display:inline-flex;align-items:center;gap:4px}.sg-back:hover{color:var(--sg-text)}.sg-field{display:block}.sg-label{display:block;font-weight:600;margin-bottom:4px}.sg-hint{display:block;color:var(--sg-dim);font-size:calc(var(--sg-size) - 1.5px);margin-top:4px}.sg-err{display:block;color:var(--sg-danger);font-size:calc(var(--sg-size) - 1.5px);margin-top:4px}.sg-input,.sg-textarea{width:100%;border:1px solid var(--sg-border);background:var(--sg-surface);border-radius:var(--sg-radius-sm);padding:8px 10px;outline:none;transition:border-color .12s ease,box-shadow .12s ease}.sg-textarea{min-height:84px;resize:vertical;line-height:1.45}.sg-input:focus,.sg-textarea:focus{border-color:var(--sg-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--sg-accent) 22%,transparent)}.sg-input::placeholder,.sg-textarea::placeholder{color:var(--sg-dim)}.sg-invalid{border-color:var(--sg-danger) !important}.sg-chips{display:flex;flex-wrap:wrap;gap:6px}.sg-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:999px;border:1px solid var(--sg-border);background:var(--sg-surface);cursor:pointer;font-size:calc(var(--sg-size) - 1px)}.sg-chip:hover{background:var(--sg-raised)}.sg-chip[aria-pressed="true"],.sg-chip[aria-checked="true"]{border-color:var(--sg-accent);background:color-mix(in srgb,var(--sg-accent) 16%,transparent);color:var(--sg-text)}.sg-dot{width:7px;height:7px;border-radius:999px;background:var(--sg-tone,var(--sg-accent));flex:none;display:inline-block}.sg-steps{display:flex;padding:12px 16px 10px;border-bottom:1px solid var(--sg-border);flex:none}.sg-step{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center}.sg-step-line{display:flex;align-items:center;width:100%}.sg-step-seg{flex:1;height:1px;background:var(--sg-border)}.sg-step-seg.sg-on{background:color-mix(in srgb,var(--sg-accent) 70%,transparent)}.sg-step-seg.sg-none{background:transparent}.sg-step-node{width:20px;height:20px;border-radius:999px;border:1px solid var(--sg-border);display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;color:var(--sg-dim);flex:none}.sg-step-node.sg-now{background:var(--sg-accent);border-color:var(--sg-accent);color:var(--sg-accent-text);box-shadow:0 0 14px -2px color-mix(in srgb,var(--sg-accent) 85%,transparent)}.sg-step-node.sg-done{background:color-mix(in srgb,var(--sg-accent) 20%,transparent);border-color:color-mix(in srgb,var(--sg-accent) 60%,transparent);color:var(--sg-accent)}.sg-step-label{margin-top:5px;font-size:calc(var(--sg-size) - 3px);color:var(--sg-dim);letter-spacing:.02em}.sg-step-label.sg-now{color:var(--sg-text);font-weight:600}.sg-card{border:1px solid var(--sg-border);border-radius:var(--sg-radius);background:var(--sg-surface);overflow:hidden}.sg-card + .sg-card{margin-top:8px}.sg-card-head{display:flex;align-items:flex-start;gap:10px;padding:10px 12px}.sg-card-text{flex:1;min-width:0}.sg-card-title{margin:0;font-weight:600}.sg-card-sum{margin:1px 0 0;color:var(--sg-dim);font-size:calc(var(--sg-size) - 1.5px)}.sg-card-body{padding:0 12px 12px}.sg-card.sg-off .sg-card-body,.sg-card.sg-off .sg-card-title{opacity:.55}.sg-switch{position:relative;width:34px;height:20px;border-radius:999px;border:0;background:var(--sg-raised);cursor:pointer;flex:none;box-shadow:inset 0 0 0 1px var(--sg-border);transition:background .15s ease}.sg-switch::after{content:'';position:absolute;top:3px;left:3px;width:14px;height:14px;border-radius:999px;background:var(--sg-muted);transition:transform .15s ease,background .15s ease}.sg-switch[aria-checked="true"]{background:var(--sg-accent);box-shadow:none}.sg-switch[aria-checked="true"]::after{transform:translateX(14px);background:var(--sg-accent-text)}.sg-shot{display:block;width:100%;max-height:220px;object-fit:contain;border-radius:var(--sg-radius-sm);border:1px solid var(--sg-border);background:var(--sg-bg)}.sg-json{margin:0;max-height:180px;overflow:auto;padding:8px 10px;border-radius:var(--sg-radius-sm);background:var(--sg-bg);border:1px solid var(--sg-border);font-family:var(--sg-mono);font-size:calc(var(--sg-size) - 2.5px);line-height:1.5;color:var(--sg-muted);white-space:pre-wrap;word-break:break-word}.sg-steplist{margin:0;padding:0;list-style:none}.sg-steplist li{display:flex;gap:8px;font-size:calc(var(--sg-size) - 1px);padding:2px 0}.sg-steplist .sg-when{width:54px;flex:none;text-align:right;color:var(--sg-dim);font-size:calc(var(--sg-size) - 2.5px);padding-top:1px}.sg-steplist .sg-err-step{color:var(--sg-danger)}.sg-review dt{font-size:calc(var(--sg-size) - 3px);text-transform:uppercase;letter-spacing:.07em;color:var(--sg-dim);font-weight:650}.sg-review dd{margin:2px 0 12px;white-space:pre-wrap;word-break:break-word}.sg-attached{margin:0;padding:0;list-style:none}.sg-attached li{display:flex;gap:8px;align-items:center;padding:2px 0}.sg-list{margin:0;padding:0;list-style:none}.sg-row{width:100%;display:flex;gap:10px;align-items:flex-start;padding:11px 16px;border:0;background:transparent;cursor:pointer;text-align:left}.sg-row:hover{background:var(--sg-surface)}.sg-list li + li .sg-row{border-top:1px solid var(--sg-border)}.sg-row-main{flex:1;min-width:0}.sg-row-top{display:flex;align-items:flex-start;gap:8px}.sg-row-title{flex:1;min-width:0;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sg-row-meta{margin-top:2px;color:var(--sg-dim);font-size:calc(var(--sg-size) - 2.5px);display:flex;gap:6px;flex-wrap:wrap;align-items:center}.sg-row-cta{margin-top:6px;display:inline-flex;align-items:center;gap:6px;padding:3px 8px;border-radius:var(--sg-radius-sm);font-size:calc(var(--sg-size) - 2px);font-weight:600;color:var(--sg-tone);background:color-mix(in srgb,var(--sg-tone) 13%,transparent)}.sg-empty{text-align:center;padding:34px 20px}.sg-empty-icon{width:44px;height:44px;border-radius:999px;border:1px solid var(--sg-border);display:inline-flex;align-items:center;justify-content:center;color:var(--sg-dim)}.sg-rail{display:flex;align-items:flex-start}.sg-rail-stage{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;text-align:center}.sg-rail-line{display:flex;align-items:center;width:100%}.sg-rail-seg{flex:1;height:2px;border-radius:2px;background:var(--sg-border)}.sg-rail-seg.sg-on{background:var(--sg-tone,var(--sg-accent))}.sg-rail-seg.sg-none{background:transparent}.sg-rail-node{width:12px;height:12px;border-radius:999px;border:2px solid var(--sg-border);background:var(--sg-bg);flex:none}.sg-rail-node.sg-on{border-color:var(--sg-tone,var(--sg-accent));background:var(--sg-tone,var(--sg-accent))}.sg-rail-node.sg-here{box-shadow:0 0 0 4px color-mix(in srgb,var(--sg-tone,var(--sg-accent)) 25%,transparent)}.sg-rail-node.sg-yours{border-color:var(--sg-tone,var(--sg-accent));border-style:dashed}.sg-rail-node.sg-pulse{animation:sg-pulse 1.6s ease-in-out infinite}.sg-rail-label{margin-top:6px;font-size:calc(var(--sg-size) - 3px);color:var(--sg-dim);line-height:1.2}.sg-rail-label.sg-on{color:var(--sg-text)}.sg-rail-box{padding:12px 10px 10px;border-radius:var(--sg-radius);border:1px solid var(--sg-border);background:linear-gradient(180deg,var(--sg-surface),transparent)}@keyframes sg-pulse{0%,100%{box-shadow:0 0 0 3px color-mix(in srgb,var(--sg-tone,var(--sg-accent)) 15%,transparent)}50%{box-shadow:0 0 0 7px color-mix(in srgb,var(--sg-tone,var(--sg-accent)) 28%,transparent)}}.sg-thread{display:flex;flex-direction:column;gap:10px}.sg-event{display:flex;align-items:center;gap:8px;color:var(--sg-dim);font-size:calc(var(--sg-size) - 2px)}.sg-event::before,.sg-event::after{content:'';flex:1;height:1px;background:var(--sg-border)}.sg-msg{max-width:88%;padding:9px 11px;border-radius:var(--sg-radius);white-space:pre-wrap;word-break:break-word}.sg-msg-meta{display:block;font-size:calc(var(--sg-size) - 3px);color:var(--sg-dim);margin-bottom:2px}.sg-msg.sg-team{align-self:flex-start;background:var(--sg-surface);border:1px solid var(--sg-border);border-top-left-radius:4px}.sg-msg.sg-you{align-self:flex-end;background:color-mix(in srgb,var(--sg-accent) 18%,var(--sg-bg));border:1px solid color-mix(in srgb,var(--sg-accent) 35%,transparent);border-top-right-radius:4px}.sg-composer{display:flex;gap:8px;align-items:flex-end;padding:10px 14px;border-top:1px solid var(--sg-border);flex:none}.sg-composer .sg-textarea{min-height:38px;max-height:140px}.sg-confirm{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px}.sg-ring{width:50px;height:50px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--sg-success);background:color-mix(in srgb,var(--sg-success) 12%,transparent);border:1px solid color-mix(in srgb,var(--sg-success) 40%,transparent)}.sg-ref{margin-top:8px;padding:3px 10px;border-radius:999px;border:1px solid var(--sg-border);background:var(--sg-surface);font-family:var(--sg-mono);font-size:calc(var(--sg-size) - 2px)}.sg-faq{border:1px solid var(--sg-border);border-radius:var(--sg-radius);background:var(--sg-surface)}.sg-faq + .sg-faq{margin-top:8px}.sg-faq summary{list-style:none;cursor:pointer;padding:10px 12px;font-weight:600;display:flex;gap:8px;align-items:center}.sg-faq summary::-webkit-details-marker{display:none}.sg-faq summary .sg-chev{margin-left:auto;transition:transform .15s ease}.sg-faq[open] summary .sg-chev{transform:rotate(90deg)}.sg-faq-a{padding:0 12px 12px;color:var(--sg-muted);white-space:pre-wrap}.sg-skeleton{height:46px;border-radius:var(--sg-radius-sm);background:var(--sg-surface);margin:8px 16px;animation:sg-shimmer 1.2s ease-in-out infinite}@keyframes sg-shimmer{50%{opacity:.55}}.sg-spin{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-right-color:transparent;animation:sg-rot .7s linear infinite}@keyframes sg-rot{to{transform:rotate(360deg)}}.sg-refresh.sg-busy svg{animation:sg-rot .7s linear infinite}.sg-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}@media (max-width:560px){.sg-panel.sg-drawer,.sg-panel.sg-modal,.sg-panel.sg-popover{left:0;right:0;top:auto;bottom:0;width:100%;height:min(90vh,760px);border-radius:calc(var(--sg-radius) + 6px) calc(var(--sg-radius) + 6px) 0 0;border:1px solid var(--sg-border);border-bottom:0;transform:translateY(100%);opacity:1}.sg-open .sg-panel{transform:none}.sg-launcher{bottom:calc(16px + env(safe-area-inset-bottom))}}.sg-pickbar{visibility:visible;position:fixed;top:12px;left:50%;transform:translateX(-50%);z-index:calc(var(--sg-z) + 2);display:flex;align-items:center;gap:10px;max-width:calc(100vw - 24px);padding:6px 6px 6px 14px;border-radius:999px;background:var(--sg-bg);color:var(--sg-text);border:1px solid var(--sg-border);box-shadow:var(--sg-shadow)}.sg-pickdot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--sg-accent);box-shadow:0 0 0 0 color-mix(in srgb,var(--sg-accent) 60%,transparent);animation:sg-pickpulse 1.6s ease-out infinite}@keyframes sg-pickpulse{70%{box-shadow:0 0 0 7px transparent}100%{box-shadow:0 0 0 0 transparent}}.sg-pickhint{min-width:0;font-size:calc(var(--sg-size) - 0.5px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sg-pickbar .sg-btn{border-radius:999px}.sg-pickbar .sg-btn-ghost{padding:0 12px}@media (max-width:480px){.sg-pickbar{left:12px;right:12px;transform:none;border-radius:22px}.sg-pickhint{flex:1;white-space:normal;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.sg-pick-cancel-label{display:none}.sg-pickbar .sg-btn-ghost{padding:0;width:34px}}@media (max-width:480px) and (pointer:coarse){.sg-pickbar .sg-btn-ghost{width:44px}}@media (pointer:coarse){.sg-iconbtn{width:44px;height:44px}.sg-btn{height:44px;padding:0 16px}.sg-chip{min-height:44px;padding:8px 14px}.sg-link,.sg-back,.sg-quiet-link{min-height:44px;display:inline-flex;align-items:center}.sg-closed>summary,.sg-closed-link{min-height:44px}.sg-switch::before{content:'';position:absolute;inset:-12px -5px}.sg-root .sg-input,.sg-root .sg-textarea{font-size:max(16px,var(--sg-size))}.sg-input{min-height:44px}.sg-composer .sg-textarea{min-height:44px}.sg-faq summary{min-height:44px}.sg-row,.sg-action{min-height:44px}}@media (prefers-reduced-motion:reduce){.sg-panel,.sg-scrim,.sg-launcher{transition:none}.sg-rail-node.sg-pulse,.sg-skeleton,.sg-spin,.sg-refresh.sg-busy svg,.sg-pickdot{animation:none}}`;function ft(e,t){let[,n]=K(0);return q(()=>e(()=>n(e=>e+1)),[e]),t()}function pt(){let e=typeof matchMedia>`u`?null:matchMedia(`(prefers-color-scheme: dark)`),[t,n]=K(e?.matches??!0);return q(()=>{if(!e)return;let t=()=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),t}function mt(e){let t=ft(e.ui.subscribe,e.ui.get),r=ft(e.support.subscribe,e.support.getState),i=pt(),a=Fe(()=>_(t.theme,i),[t.theme,i]),o=J(null),s=J(null),l=t.history[t.history.length-1]??{name:`home`},d=Fe(()=>{let t=e.captureFrame;return t?ut(e.ui,e=>n(t,e),()=>!0):ut(e.ui,u,()=>typeof navigator<`u`&&!!navigator.mediaDevices?.getDisplayMedia)},[e.ui]),f=J(null),p=J(null),m=n=>e.ui.set({history:n.name===`home`?[n]:[...t.history.filter(e=>e.name!==n.name||n.name===`detail`),n]}),h=()=>e.ui.set({history:t.history.length>1?t.history.slice(0,-1):[{name:`home`}]}),g=()=>e.ui.set({open:!1});q(()=>{t.open&&e.support.refresh()},[t.open,t.session]),q(()=>{if(!t.open)return;let n=setInterval(()=>{document.visibilityState===`visible`&&e.support.refresh()},15e3);return()=>clearInterval(n)},[t.open,e.support]);let[b,x]=K(!1),[S,C]=K(0);async function w(){b||(x(!0),e.ui.set({tick:t.tick+1}),await Promise.all([e.support.refresh(),new Promise(e=>setTimeout(e,600))]),x(!1),C(Date.now()))}q(()=>{if(r.signedIn!==!1)return;let n=t.history.filter(e=>e.name!==`reports`&&e.name!==`detail`);n.length!==t.history.length&&e.ui.set({history:n.length?n:[{name:`home`}]})},[r.signedIn,t.history,e.ui]),q(()=>{if(!t.open)return;s.current=document.activeElement;let n=setTimeout(()=>{(o.current?.querySelector(`[autofocus]`)??o.current)?.focus({preventScroll:!0})},60),r=t=>{if(e.ui.get().picking){t.key===`Escape`&&(t.stopPropagation(),t.preventDefault(),d.cancel());return}if(t.key===`Escape`){t.stopPropagation(),t.preventDefault(),g();return}if(t.key!==`Tab`||!o.current||e.layout===`popover`)return;let n=[...o.current.querySelectorAll(`button:not([disabled]), input, textarea, summary, [tabindex="0"]`)].filter(e=>e.offsetParent!==null);if(!n.length)return;let r=e.root.activeElement,i=n[0],a=n[n.length-1];t.shiftKey&&r===i?(t.preventDefault(),a.focus()):!t.shiftKey&&r===a&&(t.preventDefault(),i.focus())};return window.addEventListener(`keydown`,r,!0),()=>{clearTimeout(n),window.removeEventListener(`keydown`,r,!0),s.current?.focus?.({preventScroll:!0})}},[t.open]),q(()=>{!t.open&&d.active&&d.cancel()},[t.open,d]);let T=J(!1);q(()=>{t.picking&&!T.current&&f.current?.focus({preventScroll:!0}),!t.picking&&T.current&&o.current?.focus({preventScroll:!0}),T.current=t.picking},[t.picking]),q(()=>{if(!t.picking||t.hidden||!p.current)return;let e=document.documentElement,n=e.style.getPropertyValue(`padding-top`),r=e.style.getPropertyPriority(`padding-top`),i=parseFloat(getComputedStyle(e).paddingTop)||0,a=Math.ceil(p.current.getBoundingClientRect().bottom)+8;return e.style.setProperty(`padding-top`,`${i+a}px`,`important`),()=>{n?e.style.setProperty(`padding-top`,n,r):e.style.removeProperty(`padding-top`)}},[t.picking,t.hidden]);let E={support:e.support,state:r,tick:t.tick,copy:e.copy,features:{...e.features,reports:e.features.reports},faq:e.faq,actions:e.actions,slots:new Set(t.slots),appVersion:e.support.appVersion,go:m,capture:()=>d.start(),emit:e.emit},D=l.name===`report`?e.copy.reportAction:l.name===`feedback`?e.copy.feedbackAction:l.name===`faq`?`FAQs`:l.name===`reports`?e.copy.yourReports:l.name===`detail`?r.reports.find(e=>e.id===l.id)?.ref??`Report`:e.copy.title,O=[e.support.context().area,e.support.appVersion?`v${e.support.appVersion}`:null].filter(Boolean).join(` · `)||e.brand?.name||``,k=l.name===`faq`||l.name===`reports`||l.name===`detail`,A=r.signedIn===!0&&(l.name===`reports`||l.name===`detail`||l.name===`home`&&r.reports.length>0),j=r.updatedAt?`${e.copy.refresh} · ${v(e.copy.updatedAgo,{ago:c(new Date(r.updatedAt).toISOString())})}`:e.copy.refresh,M=e.layout!==`popover`,N=e.launcher&&e.launcher.position===`bottom-left`?`sg-left`:`sg-right`,P=e.layout===`popover`&&e.launcher?N:e.side===`left`?`sg-left`:`sg-right`;return Y(`div`,{class:`sg-root${t.open?` sg-open`:``}`,style:`${y(a)};--sg-z:${e.zIndex};${t.hidden||t.picking?`visibility:hidden;`:``}`,"data-theme":a.scheme,children:[e.launcher&&!(t.open&&M)&&Y(`button`,{type:`button`,class:`sg-launcher ${N}`,onClick:()=>t.open?g():e.ui.set({open:!0,history:[{name:`home`}],session:t.session+1}),"aria-label":r.attention?`${e.launcher.label??e.copy.launcher}, ${r.attention} need you`:e.launcher.label??e.copy.launcher,"aria-expanded":t.open,"data-testid":`sg-launcher`,children:[Y(X,{name:t.open?`x`:`lifebuoy`,size:18,stroke:2}),e.launcher.label??e.copy.launcher,r.attention>0&&!t.open&&Y(`span`,{class:`sg-badge`,children:r.attention>9?`9+`:r.attention})]}),M&&t.open&&Y(`div`,{class:`sg-scrim`,onClick:g,"aria-hidden":`true`}),Y(`div`,{ref:o,class:`sg-panel sg-${e.layout} ${P}`,role:`dialog`,"aria-modal":M?`true`:void 0,"aria-label":e.copy.title,hidden:!t.open,tabIndex:-1,"data-testid":`sg-panel`,children:[e.layout===`sheet`&&Y(`span`,{class:`sg-grabber`,"aria-hidden":`true`}),Y(`span`,{class:`sg-accentline`,"aria-hidden":`true`}),Y(`div`,{class:`sg-header`,children:[k?Y(`button`,{type:`button`,class:`sg-iconbtn`,onClick:h,"aria-label":`Back`,"data-testid":`sg-back`,children:Y(X,{name:`arrowLeft`})}):e.brand?.logo?Y(`img`,{class:`sg-brand`,src:e.brand.logo,alt:``}):Y(Z,{icon:`lifebuoy`,tone:`accent`,small:!0}),Y(`div`,{class:`sg-head-text`,children:[Y(`h2`,{class:`sg-title`,children:D}),O&&Y(`p`,{class:`sg-sub`,children:O})]}),Y($,{name:`header`,filled:E.slots}),A&&Y(`button`,{type:`button`,class:`sg-iconbtn sg-refresh${b?` sg-busy`:``}`,onClick:()=>void w(),"aria-label":j,title:j,"aria-busy":b?`true`:void 0,"data-testid":`sg-refresh`,children:Y(X,{name:`refresh`})}),Y(`span`,{class:`sg-sr`,"aria-live":`polite`,children:S&&!b?e.copy.upToDate:``}),Y(`button`,{type:`button`,class:`sg-iconbtn`,onClick:g,"aria-label":`Close`,"data-testid":`sg-close`,children:Y(X,{name:`x`})})]}),t.open&&Y(ht,{w:E,screen:l},t.session),Y($,{name:`footer`,filled:E.slots})]}),t.picking&&!t.hidden&&Y(`div`,{ref:p,class:`sg-pickbar`,role:`toolbar`,"aria-label":e.copy.screenshot,"data-testid":`sg-pickbar`,children:[Y(`span`,{class:`sg-pickdot`,"aria-hidden":`true`}),Y(`span`,{class:`sg-pickhint`,children:e.copy.pickHint}),Y(Q,{onClick:()=>void d.capture(),icon:`camera`,testId:`sg-pick-capture`,btnRef:f,children:e.copy.pickCapture}),Y(Q,{variant:`ghost`,onClick:()=>d.cancel(),testId:`sg-pick-cancel`,icon:`x`,label:e.copy.cancel,children:Y(`span`,{class:`sg-pick-cancel-label`,children:e.copy.cancel})})]})]})}function ht({w:e,screen:t}){switch(t.name){case`report`:return Y(at,{w:e});case`feedback`:return Y(Ze,{w:e});case`faq`:return Y(Xe,{w:e});case`reports`:return Y(`div`,{class:`sg-body`,children:Y(Qe,{w:e})});case`detail`:return Y(et,{w:e,id:t.id});case`sent`:return Y(gt,{heading:e.copy.reportSent,reference:t.ref,body:e.state.signedIn?e.copy.reportSentBody:e.copy.reportSentAnon,primary:e.state.signedIn?{label:e.copy.track,onClick:()=>e.go({name:`detail`,id:t.id})}:void 0,onDone:()=>e.go({name:`home`}),doneLabel:e.copy.done,slots:e.slots});case`thanks`:return Y(gt,{heading:e.copy.thanks,body:e.copy.thanksBody,onDone:()=>e.go({name:`home`}),doneLabel:e.copy.done});default:return Y(tt,{w:e})}}function gt({heading:e,body:t,reference:n,primary:r,onDone:i,doneLabel:a,slots:o}){return Y(`div`,{class:`sg-body`,children:Y(`div`,{class:`sg-confirm`,"data-testid":`sg-confirm`,children:[Y(`span`,{class:`sg-ring`,children:Y(X,{name:`checkCircle`,size:24,stroke:1.6})}),Y(`p`,{class:`sg-p`,style:{marginTop:`12px`,fontWeight:650,fontSize:`calc(var(--sg-size) + 2px)`},children:e}),n&&Y(`span`,{class:`sg-ref`,"data-testid":`sg-ref`,children:n}),Y(`p`,{class:`sg-p sg-muted`,style:{marginTop:`10px`,maxWidth:`36ch`},children:t}),Y(`div`,{style:{marginTop:`18px`,display:`flex`,gap:`8px`},children:[r&&Y(Q,{onClick:r.onClick,children:r.label}),Y(Q,{variant:`ghost`,onClick:i,children:a})]}),o&&Y($,{name:`sent`,filled:o})]})})}var _t=new WeakMap;function vt(e,t,n){try{let e=new CSSStyleSheet;e.replaceSync(dt),t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}catch{let e=document.createElement(`style`);e.textContent=dt,t.insertBefore(e,t.firstChild)}xe(Y(mt,{...n}),e),_t.set(e,b(t))}function yt(e){_t.get(e)?.(),xe(null,e)}export{mt as App,vt as renderPanel,yt as unmountPanel};
2
+ //# sourceMappingURL=app-7692BILt.js.map