slidetake 0.2.3 → 0.3.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.
package/dist/slidetake.js CHANGED
@@ -1,5 +1,5 @@
1
- /* Slidetake 0.2.3 · https://slidetake.com · Apache-2.0 */
2
- "use strict";(()=>{var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var Wt,jn=j(()=>{Wt=`---
1
+ /* Slidetake 0.3.0 · https://slidetake.com · Apache-2.0 */
2
+ "use strict";(()=>{var R=(e,t)=>()=>(e&&(t=e(e=0)),t);var Yt,Ha=R(()=>{Yt=`---
3
3
  title: Slidetake \u2014 write in markdown, record without timeline editing
4
4
  brand: slidetake
5
5
  pip: bottom-right
@@ -7,23 +7,31 @@ pip: bottom-right
7
7
 
8
8
  <!-- camera: on, full, on -->
9
9
 
10
- # ![](/favicon.svg) Slidetake
10
+ # ![](/favicon.svg) Slide<span class="st-take">take</span>
11
11
 
12
12
  **Write in markdown. Present on a spatial canvas. Record without timeline editing.**
13
13
 
14
- For developers and technical educators who explain things on video. You're inside a Slidetake deck right now: press \u2192 to walk it, **O** for the map.
14
+ For developers and technical educators who explain things on video. You're inside a Slidetake deck right now. Press \u2192 to walk it, **O** for the map.
15
15
 
16
- ## \u2702\uFE0F Stop editing on a timeline
16
+ ## \u2702\uFE0F Record without timeline editing
17
17
 
18
18
  **Retake by slide.** The slide is the timeline marker, so a fumbled line costs one press, not an editing session.
19
19
 
20
+ ### OBS records, the deck drives it
21
+
22
+ **[OBS Studio](https://obsproject.com)** records at full quality. Press **<span class="st-rec">\u25CF Record</span>** and Slidetake starts it, moves through your slides and stops it at the end. No scenes to switch, no recording to watch.
23
+
20
24
  ### Every slide is a take
21
25
 
22
26
  Stumbled on a slide? Press \u2190 and say it again. Every attempt is kept, and recording carries on.
23
27
 
24
28
  ### Pick, don't scrub
25
29
 
26
- Choose the best take of each slide. Slidetake writes the frame-exact **ffmpeg** cut, the YouTube **chapters** and the description.
30
+ Choose the best take of each slide. Slidetake writes the frame-exact **[ffmpeg](https://ffmpeg.org)** cut, the YouTube **chapters** and the description.
31
+
32
+ ### One session, one finished video
33
+
34
+ Write, present and record in one sitting. What comes out is ready to upload.
27
35
 
28
36
  ## \u{1F5FA}\uFE0F A map, not a stack
29
37
 
@@ -45,42 +53,140 @@ Your headings are the hierarchy: zoom out for the whole system, zoom in for one
45
53
 
46
54
  A comment in a slide moves you: corner, full screen, or off. Turn on **Camera** and watch this slide do it.
47
55
 
48
- ### Broadcast-quality recording
56
+ ### Camera moves, step by step
49
57
 
50
- **[OBS](https://obsproject.com)** records at full quality; Slidetake drives it. No scenes to switch, no recording to watch.
58
+ <!-- camera: 40%, full, on -->
51
59
 
52
- ### One session, one finished video
60
+ With **Camera** on, press \u2192: this slide puts you large in the corner, then full screen, then back to the corner. One comment, one press per move:
53
61
 
54
- Write, present and record in one sitting. What comes out is ready to upload.
62
+ \`\`\`md
63
+ ### Camera moves, step by step
64
+ <!-- camera: 40%, full, on -->
65
+ \`\`\`
55
66
 
56
- ## \u270D\uFE0F Plain text in
67
+ Combine \`on\`, \`off\`, \`full\`, a size like \`40%\`, a corner, \`flip\` or \`circle\`.
57
68
 
58
- Markdown you already know: headings, lists, tables, code, diagrams, charts, images and YouTube links. [See every example \u2192](/examples)
69
+ ## \u270D\uFE0F Plain markdown in
59
70
 
60
- ### Your copy
71
+ Markdown you already know: headings, lists, tables, code, steps, diagrams (Graphviz, D2, SVG), charts, images and YouTube links. [See them all in the showcase \u2192](/showcase)
72
+
73
+ ### A few comments do the rest
61
74
 
62
- Type in any deck, this one included, and it becomes your own copy. The original stays as it is.
75
+ Markdown has no word for "reveal one at a time" or "move the camera", so a handful of HTML comments say it. They stay invisible anywhere else markdown is read:
76
+
77
+ \`\`\`md
78
+ <!-- steps --> \u2190 one item per press
79
+ <!-- camera: full, on --> \u2190 move the camera
80
+ <!-- view: overview --> \u2190 the map first
81
+ <!-- view: full --> \u2190 a big-image card
82
+ \`\`\`
63
83
 
64
- ### Open and share
84
+ ## \u{1F3A8} Your colours
65
85
 
66
- **\u21E3 Load** a GitHub file or gist, start from a template, and **Share** a link with the deck inside it.
86
+ One line, \`accent: "#3b82f6"\`, gives a deck its own colour, shaded for dark and light. On your website, decks wear your site's palette.
67
87
 
68
- ## \u{1F49B} Free and open
88
+ \`brand:\` and \`logo:\` put your name and logo in the corner of every slide, so every frame of the video carries them.
69
89
 
70
- Open source, Apache 2.0: [github.com/slidetake/slidetake](https://github.com/slidetake/slidetake).
90
+ ## \u{1F310} Run it anywhere
71
91
 
72
- Everything else is in the guide: **[slidetake.com/help](/help)**.
73
- `});var Nn,_n=j(()=>{Nn=`---
74
- title: Slidetake help
92
+ Three places, one deck format: a markdown file.
93
+
94
+ ### slidetake.com: write, view, share
95
+
96
+ Write a deck in the **\u270E Editor**, or view one straight from a link: a GitHub file, a gist or any markdown URL. **Share** a link with the deck inside it. Nothing to install.
97
+
98
+ ### Your computer: all that, plus AI
99
+
100
+ The same app on your own files, offline:
101
+
102
+ \`\`\`sh
103
+ npx slidetake deck.md
104
+ \`\`\`
105
+
106
+ Images next to the markdown load as they are. Save in any editor and the deck reloads where you are; type in the browser and it saves to the file. So an AI agent can write \`deck.md\` while you watch it take shape.
107
+
108
+ ### Your website: users view, you record
109
+
110
+ \`slidetake.js\` puts decks inside your own pages, in your site's colours. Users get a clean viewer; add \`?obs\` to the address and the same page records your video.
111
+
112
+ ## <span class="st-heart" aria-hidden="true"></span> Open source
113
+
114
+ Open source, Apache 2.0: [github.com/slidetake/slidetake](https://github.com/slidetake/slidetake). Nothing to sign up for, and your decks stay yours: [Privacy](/privacy).
115
+
116
+ Next, every feature and what it saves you: **[Features \u2192](/features)**
117
+ `});var qa,Ua=R(()=>{qa=`---
118
+ title: Slidetake Docs
75
119
  brand: slidetake
76
120
  pip: none
77
121
  ---
78
122
 
79
- # ![](/favicon.svg) Slidetake help
123
+ # ![](/favicon.svg) Slide<span class="st-take">take</span> Docs
124
+
125
+ Everything in order: **get started \u2192 write \u2192 present \u2192 record \u2192 share**. Press \u2192 to walk it, \u2193 \u2191 to go into a step and back out, **O** for the map.
126
+
127
+ ## 1\uFE0F\u20E3 Get started
128
+
129
+ Three places to use Slidetake, one deck format for all of them: a markdown file. And any AI can write the deck.
130
+
131
+ | Where | Best for |
132
+ |---|---|
133
+ | **slidetake.com** | writing in the Editor, viewing any deck from a link, sharing |
134
+ | **Your computer** | the same on your own files and images, offline, with an AI agent writing alongside |
135
+ | **Your website** | decks your users view, and the page you record from |
136
+
137
+ ### On slidetake.com
138
+
139
+ Open a deck straight from a link: a GitHub file, a gist or any markdown URL. Or press **\u270E Editor** and type: the first keystroke makes it [your copy](#your-copy), kept in this browser.
140
+
141
+ | Link | Opens |
142
+ |---|---|
143
+ | \`/gh/owner/repo/path/deck.md\` | a GitHub file, default branch |
144
+ | \`/gh/owner/repo@branch/deck.md\` | another branch or tag |
145
+ | \`/gist/<id>\` | a gist's first markdown file |
146
+ | \`/?src=https://\u2026/deck.md\` | anything else |
147
+ | \`/new\` | a template: blank, talk or recording |
148
+
149
+ ### On your computer
150
+
151
+ Keep the deck and its images together in a folder, and run one command there:
152
+
153
+ \`\`\`sh
154
+ npx slidetake deck.md
155
+ \`\`\`
156
+
157
+ It opens on \`http://localhost:4300\` with the files next to the deck served beside it, so \`![](diagram.png)\` just works. Save the file in any editor and the deck reloads where you are; type in the browser's editor and it saves to the file. Nothing leaves your machine. Needs Node 20 or later.
158
+
159
+ \`npx slidetake\` in a folder opens its \`index.md\`, \`deck.md\`, \`slides.md\` or \`README.md\`. \`--open\` opens the browser; \`--port 5000\` picks the port.
160
+
161
+ ### On your website
162
+
163
+ \`slidetake.js\` turns a deck on any page into a Slidetake deck. Describe the deck, then load the script:
164
+
165
+ \`\`\`html
166
+ <script>
167
+ window.SLIDETAKE = {
168
+ markdown: "# My deck\\n\\n## A section",
169
+ settings: {title: "My deck"},
170
+ base: location.href, // where relative images resolve
171
+ trail: [{label: "My site", url: "/"}],
172
+ themeKey: "my-site-theme", // optional: your site's light/dark key
173
+ colors: {accent: "#2563eb"} // optional: your colours
174
+ };
175
+ <\/script>
176
+ <script src="https://cdn.jsdelivr.net/npm/slidetake/dist/slidetake.js"><\/script>
177
+ \`\`\`
178
+
179
+ Users get a viewer with no recording controls; \`?obs\` on the page's address brings them back for you. The hugo-continuum theme writes this for slide pages with \`engine: slidetake\`, so a Hugo site previews decks locally with \`hugo server\`.
180
+
181
+ ### With AI
182
+
183
+ The deck is plain markdown, so any AI can write one. Point it at the format, [slidetake.com/llms.txt](/llms.txt), and say what the talk is about.
80
184
 
81
- The details behind the [home deck](/): writing, sharing, presenting, recording and the camera. Press \u2192 to read in order, \u2193 \u2191 to go into a section and back out, or **O** for the whole map.
185
+ - **With an agent that edits files** (Claude Code and the like): *"Write a Slidetake deck about X in talk/deck.md, following slidetake.com/llms.txt"*, then \`npx slidetake talk/deck.md\`. Ask for changes and the open deck reloads as the file is saved.
186
+ - **In a chat** (Claude, no tools): ask for the deck as one markdown block, then on slidetake.com press **\u270E Editor**, select all and paste. It's your copy at once; **Share** gives a link with the deck inside it.
187
+ - **Images:** an agent places them next to the file; in a chat, use full image URLs, or \`base:\` pointing at where they live.
82
188
 
83
- ## \u270D\uFE0F Writing a deck
189
+ ## 2\uFE0F\u20E3 Write a deck
84
190
 
85
191
  A deck is an ordinary markdown file. **Every heading becomes a card**, and a heading branches off the nearest shallower heading above it.
86
192
 
@@ -95,195 +201,125 @@ Intro text.
95
201
  See the [roadmap](#plan).
96
202
  \`\`\`
97
203
 
98
- ### Rules
204
+ ### Cards
99
205
 
100
206
  - Text before the first heading becomes a card of its own.
101
207
  - Headings inside fenced code blocks are ignored.
102
208
  - A card's id is its heading slugified (\`## Moving around\` \u2192 \`moving-around\`), or set one with \`{#id}\` at the end of the heading.
103
209
  - A link to \`#id\` flies to that card.
210
+ - Cards widen for wide tables, columns, diagrams and embeds; anything wider still is scaled to fit.
104
211
 
105
212
  ### What a card can hold
106
213
 
107
- Plain markdown, and the layout follows from what's on the card. [See every one \u2192](/examples)
214
+ Plain markdown, and the layout follows from what's on the card. [See every one in the showcase \u2192](/showcase)
108
215
 
109
216
  | Write | Get |
110
217
  |---|---|
111
218
  | \`<!-- steps -->\` before a list | one item per press |
112
219
  | \` \`\`\`dot \`, \` \`\`\`d2 \` | a Graphviz or D2 diagram |
113
- | \` \`\`\`echarts \` with JSON options | a chart, in the deck's colors for dark and light |
220
+ | \` \`\`\`echarts \` with JSON options | a chart, in the deck's colours for dark and light |
114
221
  | \` \`\`\`svg \` or \`![](drawing.svg)\` | an SVG drawing |
115
222
  | an image alone | an image card: a phone shot sits beside the heading and caption, a landscape one spans the card between them, a 16:9 one fills it |
116
223
  | an image and text | a split card: the image sits on the side written first |
117
- | a list of images | a gallery; with \`<!-- steps -->\` a carousel, one image per press, laid out like an image card |
118
- | \`<!-- view: full -->\` in a card | a 16:9 card for a big image, without the camera unless the card asks for it; an image narrower than 16:9 sits on the right, with the text beside it |
224
+ | a list of images | a gallery; with \`<!-- steps -->\` a carousel, one image per press |
119
225
  | images in one paragraph | a grid, up to four a row |
226
+ | \`<!-- view: full -->\` in a card | a 16:9 card for a big image, without the camera unless the card asks for it |
120
227
  | a YouTube link alone on a line | the video: the next press plays it, leaving pauses it |
121
228
 
122
229
  The first and last cards animate in on their own. The alt text of an image is its caption.
123
230
 
124
- ### reveal.js decks
125
-
126
- Decks written for reveal.js open as they are: \`---\` starts a slide and \`--\` a vertical one beneath it, and the first slide becomes the root card.
127
-
128
- Supported: fragments (\`fade-up\`, \`fade-in-then-out\`, \`grow\`, \u2026, one per \u2192), \`r-stack\`, \`<!-- .element: \u2026 -->\`, \`<section>\` slides, \`data-autoslide\`, Graphviz \`dot\` diagrams, ECharts charts, \`data-gsap\` entrance animations and \`title-scramble\`.
129
-
130
- ### Older +++ decks
131
-
132
- Decks that separate slides with \`+++\` and use \`id\`, \`parent\`, \`x\`, \`y\` frontmatter still load.
133
-
134
- ### Wide content
135
-
136
- Cards widen for wide tables, columns, diagrams and embeds; anything wider still is scaled to fit.
137
-
138
- ## \u{1F517} Opening, editing and sharing
139
-
140
- Every deck you open is **read-only**: Slidetake's own decks, templates, files on the web and shared links. Viewing one never changes anything.
141
-
142
- **Type in it**, and it becomes **your copy**, at \`/edit\`. Your copy lives in this browser, remembers where it came from, and is there whenever you come back: the **Your copy \u2192** button at the top takes you to it.
143
-
144
- ### Where decks come from
145
-
146
- Press **\u270E Editor**, then **\u21E3 Load**, and paste a link: a GitHub file or folder, a gist, or any URL that lets other sites read it. Or link straight to a deck:
147
-
148
- | Link | Opens |
149
- |---|---|
150
- | \`/gh/owner/repo/path/deck.md\` | a GitHub file, default branch |
151
- | \`/gh/owner/repo@branch/deck.md\` | another branch or tag |
152
- | \`/gist/<id>\` | a gist's first markdown file |
153
- | \`/?src=https://\u2026/deck.md\` | anything else |
154
- | \`/share#deflate:\u2026\` | a shared deck, carried inside the link |
155
- | \`/new\` | a template: blank, talk or recording |
156
-
157
- Images next to the deck load as they are. **Open** opens a markdown file from your computer, straight into your copy.
158
-
159
- ### Your copy
231
+ ### Deck settings
160
232
 
161
- There's one working copy at a time. The editor bar says whose copy it is, and marks **edited** while it has changes you haven't saved or shared.
233
+ An optional block at the top of the file:
162
234
 
163
- - **Reset to original** throws your edits away and goes back to the deck you started from.
164
- - Starting a new copy, by typing in another deck or opening a file, asks first if the old one has edits you haven't kept.
235
+ \`\`\`yaml
236
+ ---
237
+ title: My talk \u2190 the page title, and the video's
238
+ duration: 10m \u2190 talk length, for the timer
239
+ accent: "#3b82f6" \u2190 the deck's colour (Slidetake's own is green)
240
+ brand: example.com/talks \u2190 text in the top-right corner
241
+ logo: https://\u2026/logo.png \u2190 image beside it
242
+ base: https://\u2026/deck-folder/ \u2190 where relative images live, for a file opened from elsewhere
243
+ ---
244
+ \`\`\`
165
245
 
166
- ### Saving and sharing
246
+ \`accent\` is one colour; Slidetake makes it bright for dark mode and deep enough to read on white for light mode, and uses it for text accents, lines, charts and diagrams. Camera and recording settings are in [step 4](#4-record-a-video).
167
247
 
168
- **Save** downloads your markdown as a file. **Share** copies a link: the short link while your copy still matches an online original, and otherwise a \`/share#deflate:\u2026\` link with the whole deck compressed inside it. That part of a link is never sent to a server, so nothing is uploaded. Shared links never include \`?obs=\`.
248
+ ### Decks from elsewhere
169
249
 
170
- For a file from your computer whose images sit next to it online, add \`base: https://\u2026/deck-folder/\` to its top block.
250
+ **reveal.js** decks open as they are: \`---\` starts a slide and \`--\` a vertical one beneath it. Fragments (\`fade-up\`, \`grow\`, \u2026), \`r-stack\`, \`<!-- .element: \u2026 -->\`, \`<section>\` slides, \`data-autoslide\`, \`data-gsap\` entrances and \`title-scramble\` all work.
171
251
 
172
- ### Address options
252
+ **Older \`+++\` decks**, with \`id\`, \`parent\`, \`x\`, \`y\` frontmatter, still load.
173
253
 
174
- | Option | Does |
175
- |---|---|
176
- | \`?edit=1\` | opens the editor |
177
- | \`?layout=tree\` (radial, path, focus) | picks the layout |
178
- | \`?mode=light\` | light theme |
179
- | \`?duration=10m\` | talk length for the timer |
180
- | \`#card-id\` | opens at a card |
254
+ ## 3\uFE0F\u20E3 Present
181
255
 
182
- ## \u{1F9ED} Moving around
256
+ Click a card to fly to it. Drag to pan; scroll or pinch to zoom. On a touch screen, the bottom bar adds \u2190 \u2192 buttons.
183
257
 
184
258
  | Key | Does |
185
259
  |---|---|
186
260
  | \u2192 \u2190 Space | next / previous step, in document order |
187
261
  | \u2193 \u2191 | first child / parent |
188
- | O | the whole map; O or Esc goes back to your slide |
189
- | 1 2 3 4 | tree, radial, path, focus |
190
- | F | fullscreen |
262
+ | O | the whole map; **O** again or Esc goes back |
263
+ | F | fullscreen; **F** again or Esc leaves |
264
+ | K or ? | these keys; again closes them |
265
+ | 1 2 3 4 | focus, path, radial, tree |
191
266
  | + \u2212 | bigger / smaller slides (remembered) |
192
- | E | editor |
193
- | L | light / dark |
194
- | K or ? | keys (also \u2328 Keys on screen) |
195
- | C \xB7 V \xB7 R | camera, camera layouts, record |
196
-
197
- Click a card to fly to it. Drag to pan; scroll or pinch to zoom. On a touch screen, the bottom bar adds \u2190 \u2192 buttons.
267
+ | E \xB7 L | editor \xB7 light / dark |
268
+ | C \xB7 V \xB7 R | camera \xB7 camera layouts \xB7 record |
198
269
 
199
270
  ### Layouts
200
271
 
201
- **Tree** is a top-down chart and **radial** rings out from the root.
202
-
203
- **Path** is made for video: a staircase in presenting order. Each section is a row, and the next one starts just below where the last ended, so every move is a short step right or down.
204
-
205
272
  **Focus** doesn't travel at all: the next slide fades in where the last one was.
206
273
 
207
- ### Steady text
208
-
209
- Text keeps one size within a section and only changes when the section does. Charts and diagrams are fitted on their own.
274
+ **Path**, the default, is made for presenting and video: a staircase in presenting order. Each section is a row, and the next one starts just below where the last ended, so every move is a short step right or down.
210
275
 
211
- ### Map moments
276
+ **Radial** rings out from the first card, and **tree** is a top-down chart.
212
277
 
213
- \`<!-- view: overview -->\` on a slide pulls back to the whole map for a beat before flying in: a good start to a chapter.
278
+ The layout you pick is remembered in this browser, for every deck.
214
279
 
215
- ## \u{1F3AC} Presenting
280
+ ### On screen
216
281
 
217
- **F** goes fullscreen, and **F** again (or **Esc**) leaves. The current slide fills the screen, and the cursor and controls hide after two seconds without the mouse moving.
282
+ Text keeps one size within a section and only changes when the section does; charts and diagrams are fitted on their own.
218
283
 
219
- ### Progress and talk timer
284
+ \`<!-- view: overview -->\` on a slide pulls back to the whole map for a beat before flying in: a good start to a chapter.
220
285
 
221
- While presenting, a thin bar along the bottom fills with every press.
286
+ ### Progress and timer
222
287
 
223
- Give the deck a length, \`duration: 10m\` (or \`90s\`, \`1h\`, \`12:30\`), and a lighter layer of the same colour grows behind it with the clock: if the lighter stretch shows past the solid fill, you're behind; if it reaches the end, the bar pulses.
288
+ In fullscreen the cursor and controls hide after two seconds without the mouse moving, and a thin bar along the bottom fills with every press.
224
289
 
225
- The timer is for you, so recordings show progress only, unless the deck says \`timer: always\`. \`progress: off\` hides the bar.
290
+ With \`duration: 10m\` (or \`90s\`, \`1h\`, \`12:30\`), a lighter layer of the same colour grows behind it with the clock: if it shows past the solid fill, you're behind; if it reaches the end, the bar pulses. The timer is for you, so recordings show progress only, unless the deck says \`timer: always\`. \`progress: off\` hides the bar.
226
291
 
227
- ## \u23FA\uFE0F Recording
292
+ ## 4\uFE0F\u20E3 Record a video
228
293
 
229
- Recording needs **[OBS Studio](https://obsproject.com)** (free) with its WebSocket server on: in OBS, Tools \u2192 WebSocket Server Settings. OBS records; Slidetake drives it.
294
+ Recording takes **[OBS Studio](https://obsproject.com)** (free and open source). OBS records at full quality; Slidetake drives it, slide by slide, so there's no timeline to edit afterwards.
230
295
 
231
- ### Connecting to OBS
296
+ ### Set up OBS
232
297
 
233
- Press **\u25CF Record** and enter where OBS is: host, port and the password from OBS's WebSocket settings. Tick *Remember* to skip this next time.
298
+ 1. In OBS, turn on Tools \u2192 WebSocket Server Settings.
299
+ 2. In Slidetake, press **\u25CF Record** and enter OBS's host, port and password. Tick *Remember* to skip this next time.
300
+ 3. Use a 16:9 screen (YouTube is 16:9): the Record dialog checks yours. If it isn't, move the window to one that is, physical or virtual (say 1920\xD71080), and press **F** there.
234
301
 
235
302
  \`?obs=localhost:4455\` (or \`?obs=host:port:password\`) in the address fills this in and connects as the page opens.
236
303
 
237
- ### A 16:9 screen
238
-
239
- YouTube is 16:9, and many laptop screens aren't. The Record dialog checks yours: if it isn't 16:9, move the window to a screen that is, physical or virtual (say 1920\xD71080), and press **F** there.
240
-
241
- ### OBS on another computer
242
-
243
- From https://slidetake.com, OBS must be on the same computer (\`localhost\`): browsers block secure pages from reaching plain \`ws://\` addresses elsewhere. For OBS on another machine, serve a local copy of [\`dist/index.html\`](https://github.com/slidetake/slidetake) over http.
244
-
245
- ### Taking a take
246
-
247
- **\u25CF Record** (or **R**) connects to OBS, counts down and starts recording. From then on the deck drives everything: camera layouts, reveals and slides follow \u2192 (a Bluetooth clicker works).
248
-
249
- - **\u2190** takes the current slide again, keeping every attempt
250
- - **B** pauses and resumes
251
- - one press past the last step stops OBS
252
-
253
- Clicks, dragging and the map are locked so the take only moves forward.
254
-
255
- ### Review and cut
256
-
257
- Then the review opens: every slide with its takes (the last one picked), previews from the OBS file, a ready-to-run **ffmpeg** command for the picked takes (frame-exact), and the YouTube title, description with **chapters** and links, and tags.
304
+ From https://slidetake.com, OBS must be on the same computer: browsers block secure pages from reaching plain \`ws://\` addresses elsewhere. For OBS on another machine, use \`npx slidetake\`, which serves over http.
258
305
 
259
- Sessions are kept in this browser, so a take can be reviewed again later from \u25CF Record.
306
+ ### Add your camera
260
307
 
261
- ## \u{1F4F7} Camera
262
-
263
- **C** (or **Camera** in the bottom bar) turns your webcam on in its box; a plain screen recording then captures you and the slides together. The camera is off every time the page opens, and until it's on, the deck's camera settings are ignored, so readers get slides using the whole screen.
264
-
265
- ### Deck settings
266
-
267
- An optional block at the top of the file:
308
+ **C** (or **Camera**) turns your webcam on in its box, and OBS records you and the slides together. The camera is off every time the page opens; until it's on, the deck's camera settings are ignored, so readers get slides using the whole screen.
268
309
 
269
310
  \`\`\`yaml
270
311
  ---
271
- brand: example.com/talks \u2190 text in the top-right corner
272
- logo: https://\u2026/logo.png \u2190 image beside it
273
312
  pip: bottom-right \u2190 camera corner, or none
274
313
  pip_size: 24% \u2190 camera box width
275
314
  pip_shape: rect \u2190 rect (16:9) or circle
276
315
  pip_mirror: yes \u2190 mirror the webcam
277
316
  camera: 24%, 40%, full, off \u2190 layouts V cycles through
278
- accent: "#3b82f6" \u2190 the deck's colour, instead of Slidetake's green
279
317
  ---
280
318
  \`\`\`
281
319
 
282
- \`accent\` is one colour; Slidetake sets it bright for dark mode and deep enough to read on white for light mode, and uses it for text accents, lines, charts and diagrams.
283
-
284
320
  Slides are always placed clear of the brand and the camera box.
285
321
 
286
- ### Camera per slide
322
+ ### Move the camera per slide
287
323
 
288
324
  A comment in a slide changes the camera from that slide on:
289
325
 
@@ -295,17 +331,25 @@ A comment in a slide changes the camera from that slide on:
295
331
  <!-- camera: 18% flip --> \u2190 small, on the other side
296
332
  \`\`\`
297
333
 
298
- Words you can combine: \`on\`, \`off\`, \`full\`, a size like \`30%\`, a corner, \`flip\`, \`circle\` / \`rect\`, \`mirror\` / \`unmirror\`.
334
+ Words you can combine: \`on\`, \`off\`, \`full\`, a size like \`30%\`, a corner, \`flip\`, \`circle\` / \`rect\`, \`mirror\` / \`unmirror\`. List them with commas to step through them on one slide: \`full, on\` opens on you, and the next \u2192 shrinks the camera to its corner and shows the slide.
299
335
 
300
- ### Several steps on one slide
336
+ **V** steps through the deck's \`camera:\` list by hand.
301
337
 
302
- List layouts with commas to step through them: \`full, on\` opens full screen on you, and the next \u2192 shrinks the camera to its corner and shows the slide. \`on, full, on, off\` ends a closing slide on you, then the slide again, then without the camera.
338
+ ### Take by take
303
339
 
304
- **V** steps through the deck's \`camera:\` list for the current slide.
340
+ **\u25CF Record** (or **R**) connects to OBS, counts down and starts recording. From then on the deck drives everything: camera layouts, reveals and slides follow \u2192 (a Bluetooth clicker works).
305
341
 
306
- ## \u{1F4CB} Publish pack
342
+ - **\u2190** takes the current slide again, keeping every attempt
343
+ - **B** pauses and resumes
344
+ - one press past the last step stops OBS
345
+
346
+ Clicks, dragging and the map are locked so the take only moves forward.
347
+
348
+ ### Review, cut and publish
307
349
 
308
- The review fills the YouTube description from the deck's top block:
350
+ Then the review opens: every slide with its takes (the last one picked), previews from the OBS file, a ready-to-run **[ffmpeg](https://ffmpeg.org)** command for the picked takes (frame-exact), and the YouTube title, description with **chapters** and links, and tags. Sessions are kept in this browser, so a take can be reviewed again later from \u25CF Record.
351
+
352
+ The description comes from the deck's top block:
309
353
 
310
354
  | Key | Used for |
311
355
  |---|---|
@@ -315,14 +359,183 @@ The review fills the YouTube description from the deck's top block:
315
359
  | \`tags\` | tags (any other list ending in \`_tags\` is added too) |
316
360
  | \`permalink\` or \`site\` | the link back to the deck |
317
361
 
318
- ## \u{1F512} Your data
362
+ ## 5\uFE0F\u20E3 Share and keep
363
+
364
+ Every deck you open is **read-only**: Slidetake's own decks, templates, files on the web and shared links. Viewing one never changes anything.
365
+
366
+ ### Your copy
367
+
368
+ **Type in a deck**, and it becomes your copy, at \`/edit\`. It lives in this browser, remembers where it came from, and is there whenever you come back: **Your copy \u2192** in the editor takes you to it.
319
369
 
320
- Your draft and settings stay in this browser. Decks inside links live in the part of the address after \`#\`, which browsers never send to a server. Slidetake has no accounts and stores no decks.
370
+ - There's one copy at a time; the editor bar says whose it is, and marks **edited** while it has changes you haven't saved or shared.
371
+ - **Reset to original** throws your edits away.
372
+ - Starting a new copy asks first if the old one has edits you haven't kept.
321
373
 
322
- slidetake.com counts visits with Google Analytics. What it records leaves out the \`#\` part and \`?obs=\`, so neither your deck nor an OBS password reaches it. Copies you host yourself send nothing.
374
+ ### Save and share
375
+
376
+ **Save** downloads the markdown. **Share** copies a link: the short link while your copy still matches an online original, otherwise a \`/share#deflate:\u2026\` link with the whole deck compressed inside it. That part of a link never reaches a server. **Open** loads a markdown file from your computer into your copy.
377
+
378
+ ### Address options
379
+
380
+ | Option | Does |
381
+ |---|---|
382
+ | \`?edit=1\` | opens the editor |
383
+ | \`?layout=focus\` (path, radial, tree) | picks the layout; path is the default |
384
+ | \`?mode=light\` | light theme |
385
+ | \`?duration=10m\` | talk length for the timer |
386
+ | \`#card-id\` | opens at a card |
387
+
388
+ ## \u{1F512} Your data
389
+
390
+ No accounts, and no decks kept: your copy and settings stay in this browser, and decks inside links never reach a server. \`npx slidetake\` keeps everything on your machine. What slidetake.com does collect (Google Analytics, which the **Privacy & analytics** button in the header turns off), and which services a deck can reach, is all on the [privacy page](/privacy).
323
391
 
324
392
  Slidetake is open source: [github.com/slidetake/slidetake](https://github.com/slidetake/slidetake).
325
- `});var Fn,Hn=j(()=>{Fn=`---
393
+ `});var Ga,Ya=R(()=>{Ga=`---
394
+ title: Slidetake Features
395
+ brand: slidetake
396
+ pip: none
397
+ ---
398
+
399
+ # ![](/favicon.svg) Slide<span class="st-take">take</span> Features
400
+
401
+ The complete list, one line each. Press \u2192 to walk it, **O** for the map.
402
+
403
+ ## \u2702\uFE0F Record without timeline editing
404
+
405
+ | Feature | Advantage |
406
+ |---|---|
407
+ | **Takes per slide** (\u2190) | every attempt kept; recording never stops |
408
+ | **OBS, driven by the deck** | it starts and stops for you; you only talk |
409
+ | **Pause and resume** (B) | step away without a gap to cut |
410
+ | **Clicker support** | any Bluetooth presenter remote moves the deck |
411
+ | **16:9 check** | the Record dialog warns before a video with bars |
412
+ | **Review** | every slide's takes, previewed from the OBS file |
413
+ | **Frame-exact [ffmpeg](https://ffmpeg.org) cut** | one command, no video editor |
414
+ | **Publish pack** | YouTube title, description, chapters, links and tags from the deck |
415
+ | **Saved sessions** | review a recording again later |
416
+
417
+ ## \u{1F5FA}\uFE0F A map, not a stack
418
+
419
+ | Feature | Advantage |
420
+ |---|---|
421
+ | **Four layouts** | focus, path (the default), radial, tree |
422
+ | **The map** (O) | the whole talk at a glance, and back |
423
+ | **Map moments** (\`view: overview\`) | open a chapter on the big picture |
424
+ | **Steady text** | one size per section, so slides don't jump |
425
+ | **Short flights** | camera moves made to read well on video |
426
+ | **Progress and timer** | a bar that fills, and a clock that tells you if you're behind |
427
+
428
+ ## \u{1F3A5} The camera is part of the deck
429
+
430
+ | Feature | Advantage |
431
+ |---|---|
432
+ | **Webcam in its box** | you and the slides in one recording, no compositing |
433
+ | **Camera per slide** | corner, size, side, circle, full screen or off |
434
+ | **Steps on one slide** | open on you, then reveal the slide |
435
+ | **V** | try camera layouts live without editing |
436
+ | **Off until you turn it on** | readers never see an empty camera box |
437
+
438
+ ## \u270D\uFE0F Plain markdown in
439
+
440
+ | Feature | Advantage |
441
+ |---|---|
442
+ | **One file** | any editor, versioned in git, reviewed like code |
443
+ | **Steps, diagrams, charts** | Graphviz, D2, SVG and ECharts as text |
444
+ | **Image cards** | laid out by shape: beside text, across the card, galleries, carousels, grids |
445
+ | **Full-screen cards** (\`view: full\`) | a 16:9 frame for a big image |
446
+ | **YouTube** | plays on the next press, pauses when you leave |
447
+ | **reveal.js and \`+++\` decks** | open as they are |
448
+
449
+ ## \u{1F3A8} Your colours
450
+
451
+ | Feature | Advantage |
452
+ |---|---|
453
+ | **Dark and light** (L) | follows the reader, or your site |
454
+ | **\`accent:\`** | one colour, shaded for both modes, charts and diagrams included |
455
+ | **\`brand:\` and \`logo:\`** | your name on every frame |
456
+ | **Site colours** | embedded decks wear your site's palette and header |
457
+
458
+ ## \u{1F310} Run it anywhere
459
+
460
+ | Where | Also gives you |
461
+ |---|---|
462
+ | **slidetake.com** | share links that carry the whole deck; your copy of any deck, kept in this browser |
463
+ | **Your computer** | relative images, reload on save, browser edits saved to the file; OBS on another machine |
464
+ | **Your website** | \`?obs\` turns your page into the recorder; the hugo-continuum theme with one frontmatter key |
465
+
466
+ ## \u{1F512} Private and open
467
+
468
+ | Feature | Advantage |
469
+ |---|---|
470
+ | **No accounts, no stored decks** | nothing to sign up for or lose ([privacy](/privacy)) |
471
+ | **Decks inside links** | the deck stays in the \`#\` part, never sent to a server |
472
+ | **Analytics you can turn off** | one button on slidetake.com |
473
+ | **Open source, Apache 2.0** | read it, host it, change it: [github.com/slidetake/slidetake](https://github.com/slidetake/slidetake) |
474
+
475
+ Next, see them working: **[Showcase \u2192](/showcase)**
476
+ `});var Va,Ka=R(()=>{Va=`---
477
+ title: Slidetake Privacy
478
+ brand: slidetake
479
+ pip: none
480
+ ---
481
+
482
+ # ![](/favicon.svg) Slide<span class="st-take">take</span> Privacy
483
+
484
+ Slidetake has no accounts and keeps no decks. This page lists everything that leaves your browser, and where it goes.
485
+
486
+ *Last updated 27 October 2026.*
487
+
488
+ ## \u{1F4CA} What slidetake.com collects
489
+
490
+ slidetake.com counts visits with **Google Analytics**: the page's address, your browser and screen, and roughly where you are. Google Analytics sets its own cookies (\`_ga\`) to tell visits apart.
491
+
492
+ The address it records leaves out the part after \`#\` and \`?obs=\`, so neither a deck carried in a link nor an OBS password reaches it.
493
+
494
+ **You can turn it off:** the **Privacy & analytics** button in the header (the pulse icon) \u2192 *Turn analytics off*. Nothing more is sent from that browser, the \`_ga\` cookies are removed, and the tag isn't loaded on later visits. Cloudflare, which serves the site, still sees each request the way any web server does.
495
+
496
+ That is the only analytics. A copy of Slidetake you host yourself, the embed on your own site, and \`npx slidetake\` send none.
497
+
498
+ ## \u{1F4BE} What stays in your browser
499
+
500
+ Kept in this browser's storage on your device, and never sent anywhere:
501
+
502
+ | What | Why |
503
+ |---|---|
504
+ | Your copy of a deck | so it's there when you come back |
505
+ | Theme, layout, slide size, editor width | your preferences |
506
+ | Recorded sessions and publish-pack settings | to review takes later |
507
+ | OBS host, port and password | only if you tick *Remember*, stored as plain text |
508
+ | Your analytics choice | so *off* stays off |
509
+
510
+ Clearing this site's data in your browser removes all of it.
511
+
512
+ ## \u{1F310} Services a deck can reach
513
+
514
+ Opening Slidetake, or a deck that uses these, loads files from other services. Each sees your IP address, as with any web request.
515
+
516
+ | Service | When |
517
+ |---|---|
518
+ | Google Fonts | every page, for the typefaces |
519
+ | cdnjs, jsDelivr | every page (animation, markdown) and for diagrams, charts and OBS |
520
+ | esm.sh | a deck with a D2 diagram |
521
+ | GitHub | opening a GitHub file or gist |
522
+ | YouTube (youtube-nocookie.com) | a deck with a YouTube link; YouTube's own cookies only once you play it |
523
+ | The deck's own address | opening a deck from a link, and its images |
524
+
525
+ OBS is reached only on the address you give it, normally your own computer.
526
+
527
+ ## \u{1F517} Decks in links
528
+
529
+ A shared link carries the whole deck after \`#\`. Browsers never send that part of an address to a server, so the deck travels from you to whoever opens the link without passing through slidetake.com.
530
+
531
+ ## \u{1F4BB} On your computer
532
+
533
+ \`npx slidetake\` runs on your machine, serves only the deck's folder, and listens only on \`localhost\`. It sends nothing to slidetake.com or anyone else. The deck's own diagrams, charts and fonts load from the services above as on the web.
534
+
535
+ ## \u2709\uFE0F Questions
536
+
537
+ Open an issue on [github.com/slidetake/slidetake](https://github.com/slidetake/slidetake/issues). Slidetake is open source, so everything above can be checked in its code.
538
+ `});var Ja,$a=R(()=>{Ja=`---
326
539
  title: My deck
327
540
  ---
328
541
 
@@ -337,7 +550,7 @@ Every heading is a card. \`##\` sections branch from the first card.
337
550
  ### A detail
338
551
 
339
552
  \`###\` branches from the section above it.
340
- `});var Un,Wn=j(()=>{Un=`---
553
+ `});var Qa,Xa=R(()=>{Qa=`---
341
554
  title: Talk title
342
555
  duration: 15m
343
556
  ---
@@ -378,7 +591,7 @@ Something concrete the audience will recognise.
378
591
  ## \u{1F64F} Thank you
379
592
 
380
593
  Where to find you, and the link to these slides.
381
- `});var $n,qn=j(()=>{$n=`---
594
+ `});var eo,Za=R(()=>{eo=`---
382
595
  title: Video title
383
596
  duration: 10m
384
597
  pip: bottom-right
@@ -427,15 +640,15 @@ Slides you talk over in the corner.
427
640
  <!-- camera: on, full, on, off -->
428
641
 
429
642
  Ends on you full screen, then back to the slide, then without the camera.
430
- `});var Gn,Yn=j(()=>{Gn=`---
431
- title: Slidetake examples
643
+ `});var ao,to=R(()=>{ao=`---
644
+ title: Slidetake Showcase
432
645
  brand: slidetake
433
646
  duration: 10m
434
647
  ---
435
648
 
436
- # Slidetake examples
649
+ # ![](https://slidetake.com/favicon.svg) Slide<span class="st-take">take</span> Showcase
437
650
 
438
- Everything a deck can hold, written in plain markdown. Open **\u270E Editor** to see the source of any card, or press **O** for the map.
651
+ Everything a deck can hold, written in plain markdown and working on screen. Open **\u270E Editor** to see the source of any card. Press \u2192 to walk it, **O** for the map.
439
652
 
440
653
  ## \u270D\uFE0F Text
441
654
 
@@ -460,7 +673,7 @@ Put \`<!-- steps -->\` before a list and it reveals one item per press:
460
673
 
461
674
  | Plan | Price | Users |
462
675
  |---|---:|---:|
463
- | Free | \u20B90 | 1 |
676
+ | Starter | \u20B90 | 1 |
464
677
  | Team | \u20B9499 | 10 |
465
678
 
466
679
  ### Code
@@ -470,7 +683,7 @@ def take(slide):
470
683
  return slide.best_attempt()
471
684
  \`\`\`
472
685
 
473
- ## \u{1F9ED} Diagrams
686
+ ## \u{1F4D0} Diagrams
474
687
 
475
688
  Write the diagram in a fenced block named after its language.
476
689
 
@@ -498,9 +711,9 @@ write -> present -> record: one session
498
711
 
499
712
  \`\`\`svg
500
713
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 120">
501
- <rect x="10" y="20" width="90" height="80" rx="10" fill="#22c55e"/>
502
- <rect x="115" y="20" width="90" height="80" rx="10" fill="#22c55e" opacity=".7"/>
503
- <rect x="220" y="20" width="90" height="80" rx="10" fill="#22c55e" opacity=".4"/>
714
+ <rect x="10" y="20" width="90" height="80" rx="10" fill="#10b981"/>
715
+ <rect x="115" y="20" width="90" height="80" rx="10" fill="#10b981" opacity=".7"/>
716
+ <rect x="220" y="20" width="90" height="80" rx="10" fill="#10b981" opacity=".4"/>
504
717
  </svg>
505
718
  \`\`\`
506
719
 
@@ -568,36 +781,57 @@ A YouTube link alone on a line becomes the video. The next press plays it; leavi
568
781
 
569
782
  https://www.youtube.com/watch?v=jNQXAC9IVRw
570
783
 
571
- ## \u{1F3A5} Camera and map
784
+ ## \u{1F3A5} Camera
572
785
 
573
786
  <!-- camera: on, full, on -->
787
+
788
+ Try it: press **C** to turn on your camera, then \u2192. This card puts you in the corner, then full screen, then back, from one comment: \`<!-- camera: on, full, on -->\`.
789
+
790
+ ## \u{1F5FA}\uFE0F Layouts and the map
791
+
574
792
  <!-- view: overview -->
575
793
 
576
- Two comments do what markdown can't: \`<!-- camera: on, full, on -->\` moves the presenter's camera, and \`<!-- view: overview -->\` shows the whole map first.
794
+ This card began by pulling back to the whole map: \`<!-- view: overview -->\` does that. Try it: press **1** to **4** for focus, path (the default), radial and tree, and **O** to zoom out and back.
795
+
796
+ ## \u{1F3A8} Colours
797
+
798
+ Try it: press **L** now. Dark and light switch, charts and diagrams included.
799
+
800
+ A deck sets its own colour with one line, \`accent: "#3b82f6"\`, shaded for both modes. See it in [blue](/share#deflate:ZVJNa9wwEL3rV0y1hzZGTummn6YENodCoYVCAjksC9Zak5VY1zKacXZN2Gt-QH9if0kl2aSBnPTGevPmjZ_KshTsuMUKvnewbQcUummw4wrk4mL7eXn3UYoyksTiiSBurCMw2OzBagLfIeCRg4bWRagZ2CKw7xXUL7RqBbozgPcYRrau28Gdb1t_oAo4iqisQSpLNFYHzvRUGad3Qf8-h18BiaAofhRFnAKECFvPFshqg3QenS7gmrEnIb6-KkughKEsL0UZu658a4pCwToO2tPmzVuy_tBowrM8yaI20RUB6z1OLnzrhxB7rz0YjzR5n3b1Xab0mm0krGanIa2lgx_mmlpnEEY_vA6pJRtcTdsJUdc1ZkjiQR5XR0eyggfJY48RyEYz7nwYpQJpNOv4bS1_-i7VNwOm4xZNruyQjm_Byc0pgvGF1r2O6cmTEiAJg8N0u_5_vdXh-ZT3Cj4p-KDgi4J3y81pc0peZ_NzGNm-WQrjAjbsfFfF5XeWxSE4RigvoY9hxReQYKT4YKr8XihGGOlPile62QuxTkfKNP-1ORf4-_jnWUyLKQ86E_8A), [coral](/share#deflate:ZVJNa9wwEL3rV0y1hzZGSkn6EWJKYHMoFFooJNDDsrATa7IS61pGI2fXhL32B-Qn9pdUkk0TyElvrDdv3vhJay2iiy3V8K2DxgdsBTYNdbEGubi_vPhw9lkKnVhi8cwQt9YxGGp2YJHBdwR0iAGhdQlihGgJou8VbF6JbRRgZ4AeKIzRum4L975t_Z5riElEFQ1WRaKxGGKh58o43Ab8fQo_AzFDVX2vqjQFmAjufLTAFg3xabK6gJtIPQvx5Y3WwBmD1ldCp65r35qqUrBKg3a8fveerd83yHRSJllCk1wxRNzR5MK3fgip98aD8cST92lX3xVKj9EmwnJ2GvJaGPww19w6QzD64W3ILcXgctpOiM1mQwWyeJSH5cGxrOFRxrGnBGSDkbY-jFKBNBgxfVvJH77L9e1A-fhFplR2yMfX4OT6mMD4SusB29RxVAIkU3CUb1fP13cYXk75qOBCwScFlwrOztfH9TF7nc3PYRT75lwYF6iJznd1Wn5ro9gHFwn0FfQprPQCMkwUH0xd3gunCBP9v-I1NjshVvnImZa_NucCf_88vYhpMeXBJ-If) or [violet](/share#deflate:ZVJNa9wwEL3rV0y1hzZGTmlo-mFKYHMoFFooJJDDsmCtNVmJdS2jGe-uCXvtD-hP7C-pJJt0ISe9sd68eeOnsiwFO26xgm8d7J1vkYVuGuy4Arn4tLluHj9IUUaaWJxRxL11BAabHVhN4DsEPHLQ0LoINQNbBPa9gvqFWq1AdwZwj2Fk67otPPq29QeqgKOIyhqkskRjdeBMT5Vxehv0r0v4GZAIiuJ7UcQpQIiw8WyBrDZIl9HrAu4YexLiy6uyBEoYyvJGlLHr1remKBSs4qAdrd-8JesPjSa8yJMsahNdEbDe4eTCt34IsffOg_FIk_dpV99lSq_ZRsJydhrSWjr4Ya6pdQZh9MPrkFqyweW0nRB1XWOGJJ7kcXl0JCt4kjz2GIFsNOPWh1EqkEazjt9W8ofvUn0_YDoe0OTKDun4GpxcnyIYX2jtdRs7TkqAJAwO0-3q__VGh_Mp7xV8VHCt4LOCd1fr0_qUvM7m5zCyfXMljAvYsPNdFZffWhaH4BihvIE-hhVfQIKR4oOp8nuhGGGkPyve6mYnxCodKdP81-Zc4O_vP2cxLaY86EL8Aw).
801
+
802
+ ## \u2702\uFE0F Record a video
803
+
804
+ Try it with [OBS](https://obsproject.com) open and its WebSocket server on: press **\u25CF Record**. This deck records slide by slide; stumble, press \u2190, say it again. At the end the review hands you the cut and the YouTube chapters. Step by step: [Docs \u2192 Record a video](/docs#4-record-a-video).
805
+
806
+ ## \u{1F310} Open from anywhere
807
+
808
+ Try it: this deck is a file on GitHub, and opens from there too: **[slidetake.com/gh/slidetake/slidetake/examples/showcase.md](/gh/slidetake/slidetake/examples/showcase.md)**. Gists, any markdown URL, and a link with the deck inside it open the same way, and \`npx slidetake deck.md\` opens one from your computer.
577
809
 
578
810
  ## \u{1F680} Start your own
579
811
 
580
- Press **New** for a template (blank, talk or recording), or type in this deck to make it your copy.
812
+ Open **\u270E Editor** and press **New** for a template (blank, talk or recording), or type in this deck to make it your copy.
581
813
 
582
814
  The templates and this deck live in [examples/](https://github.com/slidetake/slidetake/tree/main/examples) on GitHub.
583
- `});function Te(e){return e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"")||"card"}function He(e){return e.replace(/!?\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/[*_`~]/g,"").trim()}function C(e){return String(e).replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t])}function Kn(e){if(typeof document<"u"){let t=document.createElement("textarea");return t.innerHTML=e,t.value}return e.replace(/&(#x[\da-f]+|#\d+|\w+);/gi,(t,n)=>n[0]==="#"?String.fromCodePoint(n[1].toLowerCase()==="x"?parseInt(n.slice(2),16):parseInt(n.slice(1),10)):_a[n.toLowerCase()]??t)}function Fe(e){let t={};for(let n of e.matchAll(/([\w-]+)="([^"]*)"/g))t[n[1]]=n[2];return t}function We(e,t){let n=[[]],o=null;return e.split(`
584
- `).forEach(a=>{let r=a.match(/^\s{0,3}(`{3,}|~{3,})/);r&&(o?r[1][0]===o[0]&&r[1].length>=o.length&&(o=null):o=r[1]),!o&&!r&&t.test(a)?n.push([]):n[n.length-1].push(a)}),n.map(a=>a.join(`
585
- `))}function Vn(e){let t=String(e??"").trim().toLowerCase();if(!t)return 0;let n=t.match(/^(\d+):(\d{1,2})$/);if(n)return(+n[1]*60+ +n[2])*1e3;if(n=t.match(/^(\d+(?:\.\d+)?)\s*(h|hrs?|hours?|m|mins?|minutes?|s|secs?|seconds?)?$/),!n)return 0;let o=(n[2]||"m")[0];return parseFloat(n[1])*(o==="h"?3600:o==="s"?1:60)*1e3}function K(e){let t=Math.max(0,Math.round(e/1e3)),n=Math.floor(t/3600),o=Math.floor(t%3600/60),a=t%60;return(n?n+":"+String(o).padStart(2,"0"):o)+":"+String(a).padStart(2,"0")}var _a,lt=j(()=>{"use strict";_a={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",rsquo:"\u2019",lsquo:"\u2018",rdquo:"\u201D",ldquo:"\u201C"}});function Jn(e){let t=null;return e.split(`
586
- `).filter(n=>{let o=n.match(/^\s{0,3}(`{3,}|~{3,})/);return o?(t?o[1][0]===t[0]&&o[1].length>=t.length&&(t=null):t=o[1],!1):!t}).join(`
587
- `).replace(/`[^`\n]*`/g,"")}function Ut(e){return/<!--\s*view\s*:\s*(overview|map)\s*-->/i.test(Jn(e))}function qt(e){let t=Jn(e).match(/<!--\s*camera\s*:\s*([\s\S]*?)\s*-->/i);return t?t[1].trim():null}function Na(e){let t={},n=e.match(/^---[ \t]*\n([\s\S]*?)\n---[ \t]*(?:\n|$)/);if(!n)return{deck:t,body:e};let o=null;return n[1].split(`
588
- `).forEach(a=>{let r=a.match(/^\s+-\s+(.*)$/);if(r&&o){t[o].push(r[1].trim().replace(/^["']|["']$/g,""));return}let i=a.match(/^([A-Za-z_][\w-]*)\s*:\s*(.*)$/);if(!i){o=null;return}let s=i[1].toLowerCase(),l=i[2].trim().replace(/^["']|["']$/g,"");l===""?(t[s]=[],o=s):(t[s]=l,o=null)}),{deck:t,body:e.slice(n[0].length)}}function Zn(e){let t=a=>typeof a=="string"||typeof a=="number"||typeof a=="boolean",n=a=>String(a).replace(/\s*\n\s*/g," "),o=[];for(let[a,r]of Object.entries(e||{}))/^[A-Za-z_][\w-]*$/.test(a)&&(t(r)?o.push(a+": "+n(r)):Array.isArray(r)&&r.every(t)&&(o.push(a+":"),r.forEach(i=>o.push(" - "+n(i)))));return o.length?`---
815
+
816
+ Next, how it all works, step by step: **[Docs \u2192](/docs)**
817
+ `});function Te(e){return e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"")||"card"}function We(e){return e.replace(/<[^>]*>/g,"").replace(/!?\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/[*_`~]/g,"").trim()}function T(e){return String(e).replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t])}function oo(e){if(typeof document<"u"){let t=document.createElement("textarea");return t.innerHTML=e,t.value}return e.replace(/&(#x[\da-f]+|#\d+|\w+);/gi,(t,a)=>a[0]==="#"?String.fromCodePoint(a[1].toLowerCase()==="x"?parseInt(a.slice(2),16):parseInt(a.slice(1),10)):Qn[a.toLowerCase()]??t)}function He(e){let t={};for(let a of e.matchAll(/([\w-]+)="([^"]*)"/g))t[a[1]]=a[2];return t}function Ue(e,t){let a=[[]],o=null;return e.split(`
818
+ `).forEach(n=>{let r=n.match(/^\s{0,3}(`{3,}|~{3,})/);r&&(o?r[1][0]===o[0]&&r[1].length>=o.length&&(o=null):o=r[1]),!o&&!r&&t.test(n)?a.push([]):a[a.length-1].push(n)}),a.map(n=>n.join(`
819
+ `))}function no(e){let t=String(e??"").trim().toLowerCase();if(!t)return 0;let a=t.match(/^(\d+):(\d{1,2})$/);if(a)return(+a[1]*60+ +a[2])*1e3;if(a=t.match(/^(\d+(?:\.\d+)?)\s*(h|hrs?|hours?|m|mins?|minutes?|s|secs?|seconds?)?$/),!a)return 0;let o=(a[2]||"m")[0];return parseFloat(a[1])*(o==="h"?3600:o==="s"?1:60)*1e3}function $(e){let t=Math.max(0,Math.round(e/1e3)),a=Math.floor(t/3600),o=Math.floor(t%3600/60),n=t%60;return(a?a+":"+String(o).padStart(2,"0"):o)+":"+String(n).padStart(2,"0")}var Qn,ht=R(()=>{"use strict";Qn={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",rsquo:"\u2019",lsquo:"\u2018",rdquo:"\u201D",ldquo:"\u201C"}});function io(e){let t=null;return e.split(`
820
+ `).filter(a=>{let o=a.match(/^\s{0,3}(`{3,}|~{3,})/);return o?(t?o[1][0]===t[0]&&o[1].length>=t.length&&(t=null):t=o[1],!1):!t}).join(`
821
+ `).replace(/`[^`\n]*`/g,"")}function Gt(e){return/<!--\s*view\s*:\s*(overview|map)\s*-->/i.test(io(e))}function Kt(e){let t=io(e).match(/<!--\s*camera\s*:\s*([\s\S]*?)\s*-->/i);return t?t[1].trim():null}function Zn(e){let t={},a=e.match(/^---[ \t]*\n([\s\S]*?)\n---[ \t]*(?:\n|$)/);if(!a)return{deck:t,body:e};let o=null;return a[1].split(`
822
+ `).forEach(n=>{let r=n.match(/^\s+-\s+(.*)$/);if(r&&o){t[o].push(r[1].trim().replace(/^["']|["']$/g,""));return}let i=n.match(/^([A-Za-z_][\w-]*)\s*:\s*(.*)$/);if(!i){o=null;return}let s=i[1].toLowerCase(),l=i[2].trim().replace(/^["']|["']$/g,"");l===""?(t[s]=[],o=s):(t[s]=l,o=null)}),{deck:t,body:e.slice(a[0].length)}}function so(e){let t=n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean",a=n=>String(n).replace(/\s*\n\s*/g," "),o=[];for(let[n,r]of Object.entries(e||{}))/^[A-Za-z_][\w-]*$/.test(n)&&(t(r)?o.push(n+": "+a(r)):Array.isArray(r)&&r.every(t)&&(o.push(n+":"),r.forEach(i=>o.push(" - "+a(i)))));return o.length?`---
589
823
  `+o.join(`
590
824
  `)+`
591
825
  ---
592
- `:""}function Ha(e){let t=e.split(`
593
- `),n={},o=e;if(t[0]!==void 0&&t[0].trim()==="---"){let a=-1;for(let r=1;r<t.length;r++)if(t[r].trim()==="---"){a=r;break}a!==-1&&(t.slice(1,a).forEach(r=>{let i=r.indexOf(":");i>-1&&(n[r.slice(0,i).trim()]=r.slice(i+1).trim().replace(/^["']|["']$/g,""))}),o=t.slice(a+1).join(`
594
- `).replace(/^\n+/,""))}return{meta:n,body:o}}function Fa(e){let t=e.replace(/<!--[\s\S]*?-->/g,""),n=t.match(/^\s{0,3}#{1,6}\s+(.+?)\s*#*\s*$/m),o=t.match(/<h[1-6][^>]*>([\s\S]*?)<\/h[1-6]>/i),a=null;if(n&&(!o||n.index<o.index)?a=n[1]:o&&(a=o[1].replace(/<[^>]+>/g," ")),!a){let r=t.split(`
595
- `).map(i=>i.replace(/<[^>]+>/g,"").trim()).find(i=>i&&!/^[-|:\s]+$/.test(i));a=r?r.slice(0,60):null}return a?Kn(He(a)).replace(/\s+/g," ").trim():null}function Xn(e){let t=e.match(/<!--\s*\.slide:([\s\S]*?)-->/i);return t?Fe(t[1]):{}}function Qn(e,{render:t=n=>({html:n,err:null})}={}){let n=new Map,o=b=>{let S=b,g=2;for(;n.has(S);)S=b+"-"+g++;return S},a=b=>(n.set(b.id,{x:null,y:null,children:[],...b}),b.id);e=e.replace(/\r\n?/g,`
596
- `);let r=/^\+\+\+[ \t]*$/m.test(e),i={};r||({deck:i,body:e}=Na(e));let s=/^slides?$/i.test(String(i.layout||""))||/^slides?$/i.test(String(i.type||"")),l=!r&&(We(e,/^--\s*$/).length>1||s&&We(e,/^---\s*$/).length>1),c=r?N():l?O():f();return n.forEach(b=>{(!b.parent||b.parent===b.id||!n.has(b.parent))&&(b.parent=null)}),n.forEach(b=>{let S=new Set([b.id]),g=b.parent;for(;g;){if(S.has(g)){b.parent=null;break}S.add(g),g=n.get(g).parent}}),n.forEach(b=>{b.parent&&n.get(b.parent).children.push(b.id)}),{deck:i,nodes:n,format:r?"+++":l?"reveal":"headings",errCount:c};function f(){let b=[],S=null,g=null,B={level:0,title:null,explicitId:null,lines:[]};e.split(`
597
- `).forEach(m=>{let v=m.match(/^\s{0,3}(`{3,}|~{3,})/);v&&(g?v[1][0]===g[0]&&v[1].length>=g.length&&(g=null):g=v[1]);let L=!g&&!v?m.match(/^\s{0,3}(#{1,6})\s+(.+?)\s*#*\s*$/):null;if(L){let D=L[2],ce=null,ae=D.match(/\s*\{#([\w\-:.]+)\}\s*$/);ae&&(ce=ae[1],D=D.slice(0,ae.index)),S={level:L[1].length,title:He(D),explicitId:ce,lines:[L[1]+" "+D]},b.push(S)}else(S||B).lines.push(m)});let G=B.lines.join(`
598
- `);G.trim()&&(b.length&&!G.replace(/<!--[\s\S]*?-->/g,"").trim()?b[0].lines.splice(1,0,...B.lines):b.unshift(B));let w=[];return b.forEach(m=>{for(;w.length&&w[w.length-1].level>=m.level;)w.pop();let v=w.length?w[w.length-1].id:null,L=m.lines.join(`
599
- `).trim(),D=m.title||He((L.split(`
600
- `).find(be=>be.trim())||"Intro").slice(0,48));m.id=o(m.explicitId||Te(D));let{html:ce,err:ae}=t(L);a({id:m.id,parent:v,title:D,html:ce,err:ae,camera:qt(L),mapFirst:Ut(L)}),w.push(m)}),0}function N(){let b=e.split(/\n\+\+\+[ \t]*\n/).map(B=>B.trim()).filter(B=>B.length),S=null,g=0;return b.forEach((B,G)=>{let{meta:w,body:m}=Ha(B),v=o(w.id||"slide-"+(G+1)),L="parent"in w?w.parent||null:S,D=m.match(/^#{1,6}\s+(.+)$/m),ce=w.title||(D?He(D[1]):v),{html:ae,err:be}=t(m);be&&g++,a({id:v,parent:L,title:ce,html:ae,err:be,camera:w.camera||qt(m),mapFirst:Ut(m),x:w.x!==void 0?parseFloat(w.x):null,y:w.y!==void 0?parseFloat(w.y):null}),S=v}),g}function O(){let b=0,S=0,g=null;function B(w,m){let v=w.body.trim();S++;let L=Fa(v)||"Slide "+S,D=m?n.get(m).title:null;D&&L.startsWith(D+" / ")&&(L=L.slice(D.length+3));let ce=o(Te(L)),{html:ae,err:be}=t(v);return be&&b++,a({id:ce,parent:m,title:L,html:ae,err:be,camera:qt(v),mapFirst:Ut(v),autoslide:parseInt(w.attrs["data-autoslide"],10)||0})}let G=[];return We(e,/^---\s*$/).forEach(w=>{if(/<section\b/i.test(w)){for(let L of w.matchAll(/<section\b([^>]*)>([\s\S]*?)<\/section>/gi))G.push([{body:L[2],attrs:Fe(L[1])}]);let v=w.replace(/<section\b[^>]*>[\s\S]*?<\/section>/gi,"");v.trim()&&G.push([{body:v,attrs:Xn(v)}]);return}let m=We(w,/^--\s*$/).filter(v=>v.trim()).map(v=>({body:v,attrs:Xn(v)}));m.length&&G.push(m)}),G.forEach(w=>{let m=null;w.forEach((v,L)=>{if(!g){g=m=B(v,null);return}L===0?m=B(v,g):B(v,m)})}),b}}var eo=j(()=>{"use strict";lt()});function ct(e,t){return String(t||"").toLowerCase().split(/\s+/).forEach(n=>{n&&(n==="off"||n==="hide"?e.off=!0:n==="on"||n==="pip"||n==="show"?(e.off=!1,e.full=!1,e.used=!0):n==="full"||n==="fullscreen"?(e.full=!0,e.off=!1,e.used=!0):/^\d+(\.\d+)?%?$/.test(n)?(e.size=$t(parseFloat(n)),e.used=!0):Ue.includes(n)?(e.corner=n,e.used=!0):n==="flip"?(e.flip=!e.flip,e.used=!0):n==="circle"?e.circle=!0:n==="rect"?e.circle=!1:n==="mirror"?e.mirror=!0:(n==="unmirror"||n==="no-mirror")&&(e.mirror=!1))}),e}function to(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}function no(e,t){let n=[];if(!e.length){for(let a=0;a<=t;a++)n.push({cam:0,frag:a});return n}let o=e.findIndex(a=>!ct({},a).full);o<0&&(o=e.length-1);for(let a=0;a<=o;a++)n.push({cam:a,frag:0});for(let a=1;a<=t;a++)n.push({cam:o,frag:a});for(let a=o+1;a<e.length;a++)n.push({cam:a,frag:t});return n}var Ue,$t,oo=j(()=>{"use strict";Ue=["top-left","top-right","bottom-left","bottom-right"],$t=e=>Math.max(8,Math.min(60,e))});function ao(e){let t=String(e||"").trim();if(!t)return null;let n;try{n=new URL(/^[a-z]+:\/\//i.test(t)?t:"https://"+t)}catch{return null}let o=n.pathname.split("/").filter(Boolean);if(n.hostname==="github.com"||n.hostname==="www.github.com"){let[a,r,i,s,...l]=o;if(a&&r&&(i==="blob"||i==="raw"||i==="tree")&&s){let c=l.join("/");return(i==="tree"||!/\.(md|markdown|txt)$/i.test(c))&&(c=(c?c+"/":"")+"index.md"),{kind:"url",url:Yt+[a,r,s].join("/")+"/"+c}}if(a&&r&&!i)return{kind:"url",url:Yt+a+"/"+r+"/HEAD/README.md"}}if(n.hostname==="gist.github.com"){let a=o.length>=2?o[1]:o[0];if(a&&/^[\da-f]+$/i.test(a))return{kind:"gist",id:a}}if(n.hostname==="slidetake.com"||n.hostname==="www.slidetake.com"){let a=Gt(n.pathname);if(a)return a;let r=n.searchParams.get("src");if(r)return{kind:"url",url:r}}return{kind:"url",url:n.href}}function Gt(e){let t=String(e||"").split("/").filter(Boolean).map(n=>{try{return decodeURIComponent(n)}catch{return n}});if(t[0]==="gh"&&t.length>=4){let[,n,o,...a]=t,r=o.indexOf("@"),i=r<0?o:o.slice(0,r),s=r<0?"HEAD":o.slice(r+1);return!n||!i||!s?null:{kind:"url",url:Yt+[n,i,s,...a].map(encodeURIComponent).join("/")}}return t.length===1&&t[0]==="help"?{kind:"builtin",id:"help"}:t.length===1&&t[0]==="examples"?{kind:"builtin",id:"showcase"}:t[0]==="gist"&&t[1]&&/^[\da-f]+$/i.test(t[1])?t[2]?{kind:"gist",id:t[1],file:t[2]}:{kind:"gist",id:t[1]}:null}function ro(e){if(e.kind==="builtin")return e.id==="home"?"/":e.id==="showcase"?"/examples":e.id.startsWith("template:")?"/new?template="+e.id.slice(9):"/"+e.id;if(e.kind==="gist")return"/gist/"+e.id+(e.file?"/"+encodeURIComponent(e.file):"");let t=e.url.match(/^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\/([^/]+)\/(.+)$/);if(t){let[,n,o,a,r]=t;if(!/^refs$/.test(a))return"/gh/"+n+"/"+o+(a==="HEAD"?"":"@"+a)+"/"+r}return"/?src="+encodeURIComponent(e.url)}var Yt,Kt=j(()=>{"use strict";Yt="https://raw.githubusercontent.com/"});function Wa(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ua(e){let t=atob(e.replace(/-/g,"+").replace(/_/g,"/")+"===".slice((e.length+3)%4));return Uint8Array.from(t,n=>n.charCodeAt(0))}async function io(e,t){let n=new Response(new Blob([e]).stream().pipeThrough(t));return new Uint8Array(await n.arrayBuffer())}async function so(e){return Wa(await io(new TextEncoder().encode(e),new CompressionStream("deflate-raw")))}async function lo(e){return new TextDecoder().decode(await io(Ua(e),new DecompressionStream("deflate-raw")))}function dt(e){let t=e.replace(/^#/,"");if(!t.startsWith(Vt)){let r=t;try{r=decodeURIComponent(t)}catch{}return{data:null,slide:r}}let n=t.slice(Vt.length),o=n.indexOf("~"),a=o<0?"":n.slice(o+1);try{a=decodeURIComponent(a)}catch{}return{data:o<0?n:n.slice(0,o),slide:a}}function Xt(e,t){return"#"+Vt+e+(t?"~"+encodeURIComponent(t):"")}var Vt,Jt=j(()=>{"use strict";Vt="deflate:"});function co(e,t,n){let o=e.replace(/\/+$/,"")||"/",a=new URLSearchParams(t),{data:r,slide:i}=dt(n);if(o==="/share")return r?{page:"share",data:r,slide:i}:{page:"source",source:{kind:"builtin",id:"home"},slide:""};if(o==="/edit")return{page:"edit",slide:i};if(o==="/new"){let c=a.get("template");return c&&qa.includes(c)?{page:"source",source:{kind:"builtin",id:"template:"+c},slide:i}:{page:"pick"}}let s=Gt(o);if(s)return{page:"source",source:s,slide:i};let l=a.get("src");return o==="/"&&l?{page:"source",source:{kind:"url",url:l},slide:i}:{page:"source",source:{kind:"builtin",id:"home"},slide:i}}function re(e){switch(e.kind){case"builtin":return e.id==="home"?"Home":e.id==="help"?"Help":e.id==="showcase"?"the examples":"the "+e.id.replace(/^template:/,"")+" template";case"gist":return"a gist"+(e.file?" ("+e.file+")":"");case"shared":return"a shared deck";case"file":return e.name;case"url":{let t=e.url.match(/^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\/[^/]+\/(.+)$/);if(t)return t[1]+"/"+t[2]+"/"+t[3];try{let n=new URL(e.url);return n.hostname+n.pathname}catch{return e.url}}}}function pt(e,t,{exported:n=!1}={}){return{text:e,origin:t,originText:e,exported:n?e:null}}function ut(e){return e.text!==(e.exported??e.originText)}function ht(e){return e.text===e.originText}function po(e){try{let t=JSON.parse(e||"null");return!t||typeof t.text!="string"||!t.origin||typeof t.origin.kind!="string"?null:{text:t.text,origin:t.origin,originText:typeof t.originText=="string"?t.originText:t.text,exported:typeof t.exported=="string"?t.exported:null}}catch{return null}}var qa,uo=j(()=>{"use strict";Kt();Jt();qa=["blank","talk","recording"]});function ho(e){let t;try{t=new URL(e)}catch{return null}let n=t.hostname.replace(/^(www\.|m\.)/,""),o=null,a=!1;if(n==="youtu.be")o=t.pathname.slice(1).split("/")[0];else if(n==="youtube.com"||n==="youtube-nocookie.com"){let r=t.pathname.split("/").filter(Boolean);r[0]==="watch"?o=t.searchParams.get("v"):["shorts","live","embed"].includes(r[0])&&(o=r[1]||null,a=r[0]==="shorts")}return!o||!/^[\w-]{6,}$/.test(o)?null:{id:o,start:$a(t.searchParams.get("t")||t.searchParams.get("start")||""),portrait:a}}function $a(e){if(/^\d+$/.test(e))return+e;let t=e.match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);return t&&e?+(t[1]||0)*3600+ +(t[2]||0)*60+ +(t[3]||0):0}function mo(e){return"https://www.youtube-nocookie.com/embed/"+encodeURIComponent(e.id)+"?enablejsapi=1&rel=0&playsinline=1"+(e.start?"&start="+e.start:"")}var fo=j(()=>{"use strict"});function qe(e){let t=new Map,n=e.totalObs??e.total;return e.events.forEach((o,a)=>{t.has(o.id)||t.set(o.id,{id:o.id,title:o.title,takes:[]});let r=t.get(o.id),i=e.events[a+1];r.takes.push({no:r.takes.length+1,start:go(o),end:i?go(i):n})}),t}function $e(e){let t=[],n=ft(e);return qe(e).forEach(o=>{let a=e.picks[o.id]??o.takes.length;if(!a)return;let r=o.takes[a-1];if(!r)return;let i=bo(r.start,n),s=bo(r.end,n);s>i&&t.push({id:o.id,title:o.title,f0:i,f1:s,start:i*1e3/n,end:s*1e3/n})}),t}function Ya(e){let t=[];return e.forEach(n=>{let o=t[t.length-1];o&&n.f0===o.f1?(o.f1=n.f1,o.end=n.end):t.push({f0:n.f0,f1:n.f1,start:n.start,end:n.end})}),t}function Zt(e,t){let n=0,o=[];return $e(e).forEach(a=>{let{sec:r,title:i}=t(a.id,a.title),s=o[o.length-1];(!s||s.sec!==r&&s.title!==i)&&o.push({sec:r,title:i,t:n}),n+=a.end-a.start}),{list:o,length:n}}function vo(e,t){let{list:n,length:o}=Zt(e,t),a=n.filter((r,i)=>i===0||(n[i+1]?n[i+1].t:o)-r.t>=1e4);return a.length&&(a[0].t=0),{lines:a.map(r=>K(r.t)+" "+r.title),dropped:n.length-a.length,length:o}}function xo(e,t,{input:n,outputName:o,sectionOf:a}){let r=Ya($e(e));if(!e.withObs)return"# This was a rehearsal: nothing was recorded.";if(!r.length)return"# Every slide is left out: nothing to render.";let i=Ga(n)+o,{list:s,length:l}=Zt(e,a),c=m=>String(m).replace(/[=;#\\\n]/g,v=>"\\"+v),N=`cat > /tmp/slidetake-chapters.txt <<'EOF'
826
+ `:""}function er(e){let t=e.split(`
827
+ `),a={},o=e;if(t[0]!==void 0&&t[0].trim()==="---"){let n=-1;for(let r=1;r<t.length;r++)if(t[r].trim()==="---"){n=r;break}n!==-1&&(t.slice(1,n).forEach(r=>{let i=r.indexOf(":");i>-1&&(a[r.slice(0,i).trim()]=r.slice(i+1).trim().replace(/^["']|["']$/g,""))}),o=t.slice(n+1).join(`
828
+ `).replace(/^\n+/,""))}return{meta:a,body:o}}function tr(e){let t=e.replace(/<!--[\s\S]*?-->/g,""),a=t.match(/^\s{0,3}#{1,6}\s+(.+?)\s*#*\s*$/m),o=t.match(/<h[1-6][^>]*>([\s\S]*?)<\/h[1-6]>/i),n=null;if(a&&(!o||a.index<o.index)?n=a[1]:o&&(n=o[1].replace(/<[^>]+>/g," ")),!n){let r=t.split(`
829
+ `).map(i=>i.replace(/<[^>]+>/g,"").trim()).find(i=>i&&!/^[-|:\s]+$/.test(i));n=r?r.slice(0,60):null}return n?oo(We(n)).replace(/\s+/g," ").trim():null}function ro(e){let t=e.match(/<!--\s*\.slide:([\s\S]*?)-->/i);return t?He(t[1]):{}}function lo(e,{render:t=a=>({html:a,err:null})}={}){let a=new Map,o=y=>{let S=y,g=2;for(;a.has(S);)S=y+"-"+g++;return S},n=y=>(a.set(y.id,{x:null,y:null,children:[],...y}),y.id);e=e.replace(/\r\n?/g,`
830
+ `);let r=/^\+\+\+[ \t]*$/m.test(e),i={};r||({deck:i,body:e}=Zn(e));let s=/^slides?$/i.test(String(i.layout||""))||/^slides?$/i.test(String(i.type||"")),l=!r&&(Ue(e,/^--\s*$/).length>1||s&&Ue(e,/^---\s*$/).length>1),c=r?_():l?O():f();return a.forEach(y=>{(!y.parent||y.parent===y.id||!a.has(y.parent))&&(y.parent=null)}),a.forEach(y=>{let S=new Set([y.id]),g=y.parent;for(;g;){if(S.has(g)){y.parent=null;break}S.add(g),g=a.get(g).parent}}),a.forEach(y=>{y.parent&&a.get(y.parent).children.push(y.id)}),{deck:i,nodes:a,format:r?"+++":l?"reveal":"headings",errCount:c};function f(){let y=[],S=null,g=null,B={level:0,title:null,explicitId:null,lines:[]};e.split(`
831
+ `).forEach(m=>{let v=m.match(/^\s{0,3}(`{3,}|~{3,})/);v&&(g?v[1][0]===g[0]&&v[1].length>=g.length&&(g=null):g=v[1]);let C=!g&&!v?m.match(/^\s{0,3}(#{1,6})\s+(.+?)\s*#*\s*$/):null;if(C){let F=C[2],de=null,re=F.match(/\s*\{#([\w\-:.]+)\}\s*$/);re&&(de=re[1],F=F.slice(0,re.index)),S={level:C[1].length,title:We(F),explicitId:de,lines:[C[1]+" "+F]},y.push(S)}else(S||B).lines.push(m)});let V=B.lines.join(`
832
+ `);V.trim()&&(y.length&&!V.replace(/<!--[\s\S]*?-->/g,"").trim()?y[0].lines.splice(1,0,...B.lines):y.unshift(B));let x=[];return y.forEach(m=>{for(;x.length&&x[x.length-1].level>=m.level;)x.pop();let v=x.length?x[x.length-1].id:null,C=m.lines.join(`
833
+ `).trim(),F=m.title||We((C.split(`
834
+ `).find(ye=>ye.trim())||"Intro").slice(0,48));m.id=o(m.explicitId||Te(F));let{html:de,err:re}=t(C);n({id:m.id,parent:v,title:F,html:de,err:re,camera:Kt(C),mapFirst:Gt(C)}),x.push(m)}),0}function _(){let y=e.split(/\n\+\+\+[ \t]*\n/).map(B=>B.trim()).filter(B=>B.length),S=null,g=0;return y.forEach((B,V)=>{let{meta:x,body:m}=er(B),v=o(x.id||"slide-"+(V+1)),C="parent"in x?x.parent||null:S,F=m.match(/^#{1,6}\s+(.+)$/m),de=x.title||(F?We(F[1]):v),{html:re,err:ye}=t(m);ye&&g++,n({id:v,parent:C,title:de,html:re,err:ye,camera:x.camera||Kt(m),mapFirst:Gt(m),x:x.x!==void 0?parseFloat(x.x):null,y:x.y!==void 0?parseFloat(x.y):null}),S=v}),g}function O(){let y=0,S=0,g=null;function B(x,m){let v=x.body.trim();S++;let C=tr(v)||"Slide "+S,F=m?a.get(m).title:null;F&&C.startsWith(F+" / ")&&(C=C.slice(F.length+3));let de=o(Te(C)),{html:re,err:ye}=t(v);return ye&&y++,n({id:de,parent:m,title:C,html:re,err:ye,camera:Kt(v),mapFirst:Gt(v),autoslide:parseInt(x.attrs["data-autoslide"],10)||0})}let V=[];return Ue(e,/^---\s*$/).forEach(x=>{if(/<section\b/i.test(x)){for(let C of x.matchAll(/<section\b([^>]*)>([\s\S]*?)<\/section>/gi))V.push([{body:C[2],attrs:He(C[1])}]);let v=x.replace(/<section\b[^>]*>[\s\S]*?<\/section>/gi,"");v.trim()&&V.push([{body:v,attrs:ro(v)}]);return}let m=Ue(x,/^--\s*$/).filter(v=>v.trim()).map(v=>({body:v,attrs:ro(v)}));m.length&&V.push(m)}),V.forEach(x=>{let m=null;x.forEach((v,C)=>{if(!g){g=m=B(v,null);return}C===0?m=B(v,g):B(v,m)})}),y}}var co=R(()=>{"use strict";ht()});function ut(e,t){return String(t||"").toLowerCase().split(/\s+/).forEach(a=>{a&&(a==="off"||a==="hide"?e.off=!0:a==="on"||a==="pip"||a==="show"?(e.off=!1,e.full=!1,e.used=!0):a==="full"||a==="fullscreen"?(e.full=!0,e.off=!1,e.used=!0):/^\d+(\.\d+)?%?$/.test(a)?(e.size=Vt(parseFloat(a)),e.used=!0):qe.includes(a)?(e.corner=a,e.used=!0):a==="flip"?(e.flip=!e.flip,e.used=!0):a==="circle"?e.circle=!0:a==="rect"?e.circle=!1:a==="mirror"?e.mirror=!0:(a==="unmirror"||a==="no-mirror")&&(e.mirror=!1))}),e}function po(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}function ho(e,t){let a=[];if(!e.length){for(let n=0;n<=t;n++)a.push({cam:0,frag:n});return a}let o=e.findIndex(n=>!ut({},n).full);o<0&&(o=e.length-1);for(let n=0;n<=o;n++)a.push({cam:n,frag:0});for(let n=1;n<=t;n++)a.push({cam:o,frag:n});for(let n=o+1;n<e.length;n++)a.push({cam:n,frag:t});return a}var qe,Vt,uo=R(()=>{"use strict";qe=["top-left","top-right","bottom-left","bottom-right"],Vt=e=>Math.max(8,Math.min(60,e))});function mo(e){let t=String(e||"").trim();if(!t)return null;let a;try{a=new URL(/^[a-z]+:\/\//i.test(t)?t:"https://"+t)}catch{return null}let o=a.pathname.split("/").filter(Boolean);if(a.hostname==="github.com"||a.hostname==="www.github.com"){let[n,r,i,s,...l]=o;if(n&&r&&(i==="blob"||i==="raw"||i==="tree")&&s){let c=l.join("/");return(i==="tree"||!/\.(md|markdown|txt)$/i.test(c))&&(c=(c?c+"/":"")+"index.md"),{kind:"url",url:$t+[n,r,s].join("/")+"/"+c}}if(n&&r&&!i)return{kind:"url",url:$t+n+"/"+r+"/HEAD/README.md"}}if(a.hostname==="gist.github.com"){let n=o.length>=2?o[1]:o[0];if(n&&/^[\da-f]+$/i.test(n))return{kind:"gist",id:n}}if(a.hostname==="slidetake.com"||a.hostname==="www.slidetake.com"){let n=Jt(a.pathname);if(n)return n;let r=a.searchParams.get("src");if(r)return{kind:"url",url:r}}return{kind:"url",url:a.href}}function Jt(e){let t=String(e||"").split("/").filter(Boolean).map(a=>{try{return decodeURIComponent(a)}catch{return a}});if(t[0]==="gh"&&t.length>=4){let[,a,o,...n]=t,r=o.indexOf("@"),i=r<0?o:o.slice(0,r),s=r<0?"HEAD":o.slice(r+1);return!a||!i||!s?null:{kind:"url",url:$t+[a,i,s,...n].map(encodeURIComponent).join("/")}}return t.length===1&&(t[0]==="docs"||t[0]==="help")?{kind:"builtin",id:"docs"}:t[0]==="showcase"&&t.length===1?{kind:"builtin",id:"showcase"}:t[0]==="examples"&&(t.length===1||t.length===2&&t[1]==="showcase")?{kind:"builtin",id:"showcase"}:t.length===1&&t[0]==="features"?{kind:"builtin",id:"features"}:t.length===1&&t[0]==="privacy"?{kind:"builtin",id:"privacy"}:t[0]==="gist"&&t[1]&&/^[\da-f]+$/i.test(t[1])?t[2]?{kind:"gist",id:t[1],file:t[2]}:{kind:"gist",id:t[1]}:null}function fo(e){if(e.kind==="builtin")return e.id==="home"?"/":e.id==="showcase"?"/showcase":e.id.startsWith("template:")?"/new?template="+e.id.slice(9):"/"+e.id;if(e.kind==="gist")return"/gist/"+e.id+(e.file?"/"+encodeURIComponent(e.file):"");let t=e.url.match(/^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\/([^/]+)\/(.+)$/);if(t){let[,a,o,n,r]=t;if(!/^refs$/.test(n))return"/gh/"+a+"/"+o+(n==="HEAD"?"":"@"+n)+"/"+r}return"/?src="+encodeURIComponent(e.url)}var $t,Xt=R(()=>{"use strict";$t="https://raw.githubusercontent.com/"});function ar(e){let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function or(e){let t=atob(e.replace(/-/g,"+").replace(/_/g,"/")+"===".slice((e.length+3)%4));return Uint8Array.from(t,a=>a.charCodeAt(0))}async function go(e,t){let a=new Response(new Blob([e]).stream().pipeThrough(t));return new Uint8Array(await a.arrayBuffer())}async function bo(e){return ar(await go(new TextEncoder().encode(e),new CompressionStream("deflate-raw")))}async function yo(e){return new TextDecoder().decode(await go(or(e),new DecompressionStream("deflate-raw")))}function mt(e){let t=e.replace(/^#/,"");if(!t.startsWith(Qt)){let r=t;try{r=decodeURIComponent(t)}catch{}return{data:null,slide:r}}let a=t.slice(Qt.length),o=a.indexOf("~"),n=o<0?"":a.slice(o+1);try{n=decodeURIComponent(n)}catch{}return{data:o<0?a:a.slice(0,o),slide:n}}function Zt(e,t){return"#"+Qt+e+(t?"~"+encodeURIComponent(t):"")}var Qt,ea=R(()=>{"use strict";Qt="deflate:"});function vo(e,t,a){let o=e.replace(/\/+$/,"")||"/",n=new URLSearchParams(t),{data:r,slide:i}=mt(a);if(o==="/share")return r?{page:"share",data:r,slide:i}:{page:"source",source:{kind:"builtin",id:"home"},slide:""};if(o==="/edit")return{page:"edit",slide:i};if(o==="/new"){let c=n.get("template");return c&&nr.includes(c)?{page:"source",source:{kind:"builtin",id:"template:"+c},slide:i}:{page:"pick"}}let s=Jt(o);if(s)return{page:"source",source:s,slide:i};let l=n.get("src");return o==="/"&&l?{page:"source",source:{kind:"url",url:l},slide:i}:{page:"source",source:{kind:"builtin",id:"home"},slide:i}}function ie(e){switch(e.kind){case"builtin":return e.id==="home"?"Home":e.id==="docs"||e.id==="help"?"the docs":e.id==="showcase"?"the showcase":e.id==="features"?"the features":e.id==="privacy"?"the privacy page":"the "+e.id.replace(/^template:/,"")+" template";case"gist":return"a gist"+(e.file?" ("+e.file+")":"");case"shared":return"a shared deck";case"file":return e.name;case"url":{let t=e.url.match(/^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\/[^/]+\/(.+)$/);if(t)return t[1]+"/"+t[2]+"/"+t[3];try{let a=new URL(e.url);return a.hostname+a.pathname}catch{return e.url}}}}function ft(e,t,{exported:a=!1}={}){return{text:e,origin:t,originText:e,exported:a?e:null}}function gt(e){return e.text!==(e.exported??e.originText)}function bt(e){return e.text===e.originText}function wo(e){try{let t=JSON.parse(e||"null");return!t||typeof t.text!="string"||!t.origin||typeof t.origin.kind!="string"?null:{text:t.text,origin:t.origin,originText:typeof t.originText=="string"?t.originText:t.text,exported:typeof t.exported=="string"?t.exported:null}}catch{return null}}var nr,xo=R(()=>{"use strict";Xt();ea();nr=["blank","talk","recording"]});function ko(e){let t;try{t=new URL(e)}catch{return null}let a=t.hostname.replace(/^(www\.|m\.)/,""),o=null,n=!1;if(a==="youtu.be")o=t.pathname.slice(1).split("/")[0];else if(a==="youtube.com"||a==="youtube-nocookie.com"){let r=t.pathname.split("/").filter(Boolean);r[0]==="watch"?o=t.searchParams.get("v"):["shorts","live","embed"].includes(r[0])&&(o=r[1]||null,n=r[0]==="shorts")}return!o||!/^[\w-]{6,}$/.test(o)?null:{id:o,start:rr(t.searchParams.get("t")||t.searchParams.get("start")||""),portrait:n}}function rr(e){if(/^\d+$/.test(e))return+e;let t=e.match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);return t&&e?+(t[1]||0)*3600+ +(t[2]||0)*60+ +(t[3]||0):0}function So(e){return"https://www.youtube-nocookie.com/embed/"+encodeURIComponent(e.id)+"?enablejsapi=1&rel=0&playsinline=1"+(e.start?"&start="+e.start:"")}var Eo=R(()=>{"use strict"});function Ye(e){let t=new Map,a=e.totalObs??e.total;return e.events.forEach((o,n)=>{t.has(o.id)||t.set(o.id,{id:o.id,title:o.title,takes:[]});let r=t.get(o.id),i=e.events[n+1];r.takes.push({no:r.takes.length+1,start:Co(o),end:i?Co(i):a})}),t}function Ge(e){let t=[],a=vt(e);return Ye(e).forEach(o=>{let n=e.picks[o.id]??o.takes.length;if(!n)return;let r=o.takes[n-1];if(!r)return;let i=Lo(r.start,a),s=Lo(r.end,a);s>i&&t.push({id:o.id,title:o.title,f0:i,f1:s,start:i*1e3/a,end:s*1e3/a})}),t}function ir(e){let t=[];return e.forEach(a=>{let o=t[t.length-1];o&&a.f0===o.f1?(o.f1=a.f1,o.end=a.end):t.push({f0:a.f0,f1:a.f1,start:a.start,end:a.end})}),t}function ta(e,t){let a=0,o=[];return Ge(e).forEach(n=>{let{sec:r,title:i}=t(n.id,n.title),s=o[o.length-1];(!s||s.sec!==r&&s.title!==i)&&o.push({sec:r,title:i,t:a}),a+=n.end-n.start}),{list:o,length:a}}function Mo(e,t){let{list:a,length:o}=ta(e,t),n=a.filter((r,i)=>i===0||(a[i+1]?a[i+1].t:o)-r.t>=1e4);return n.length&&(n[0].t=0),{lines:n.map(r=>$(r.t)+" "+r.title),dropped:a.length-n.length,length:o}}function Oo(e,t,{input:a,outputName:o,sectionOf:n}){let r=ir(Ge(e));if(!e.withObs)return"# This was a rehearsal: nothing was recorded.";if(!r.length)return"# Every slide is left out: nothing to render.";let i=sr(a)+o,{list:s,length:l}=ta(e,n),c=m=>String(m).replace(/[=;#\\\n]/g,v=>"\\"+v),_=`cat > /tmp/slidetake-chapters.txt <<'EOF'
601
835
  `+(`;FFMETADATA1
602
836
  title=`+c(e.deckTitle)+`
603
837
  `+s.map((m,v)=>`[CHAPTER]
@@ -607,29 +841,29 @@ END=`+Math.round(s[v+1]?s[v+1].t:l)+`
607
841
  title=`+c(m.title)).join(`
608
842
  `))+`
609
843
  EOF
610
- `,O=" -map 0:v:0 -map 0:a:0 -map_metadata 1 -map_chapters 1";if(t==="copy"){let m=r.map(L=>"file "+mt(n)+`
611
- inpoint `+yo(L.start)+`
612
- outpoint `+yo(L.end)).join(`
844
+ `,O=" -map 0:v:0 -map 0:a:0 -map_metadata 1 -map_chapters 1";if(t==="copy"){let m=r.map(C=>"file "+yt(a)+`
845
+ inpoint `+To(C.start)+`
846
+ outpoint `+To(C.end)).join(`
613
847
  `);return(r.length>1?`# Careful: without re-encoding, cuts can only land on keyframes (OBS puts one about every 2 s),
614
848
  # so `+(r.length===2?"the cut":"each of the "+(r.length-1)+" cuts")+` here may keep or lose up to ~2 s. Use a frame-accurate option for retakes.
615
849
  `:"")+`cat > /tmp/slidetake-cuts.txt <<'EOF'
616
850
  `+m+`
617
851
  EOF
618
- `+N+"ffmpeg -f concat -safe 0 -i /tmp/slidetake-cuts.txt -i /tmp/slidetake-chapters.txt"+O+" -c copy -movflags +faststart "+mt(i)}let b=ft(e),S=m=>(m/b).toFixed(6),g=m=>((m-.5)/b).toFixed(6),B=r.map(m=>"gte(t,"+g(m.f0)+")*lt(t,"+g(m.f1)+")").join("+"),G=r.map(m=>"gte(t,"+S(m.f0)+")*lt(t,"+S(m.f1)+")").join("+"),w=t==="mac"?"-c:v h264_videotoolbox -b:v 12M":"-c:v libx264 -crf 18 -preset medium";return N+"ffmpeg -i "+mt(n)+" -i /tmp/slidetake-chapters.txt"+O+` -vf "select='`+B+`',setpts=N/FRAME_RATE/TB" -af "asetnsamples=n=48:p=0,aselect='`+G+`',asetpts=N/SR/TB" `+w+" -c:a aac -b:a 192k -movflags +faststart "+mt(i)}var go,ft,bo,Me,Ga,mt,yo,wo=j(()=>{"use strict";lt();go=e=>e.obsT??e.t,ft=e=>e.fps||60,bo=(e,t)=>Math.round(e*t/1e3);Me=e=>String(e||"").split(/[\\/]/).pop()||"",Ga=e=>{let t=Math.max(String(e).lastIndexOf("/"),String(e).lastIndexOf("\\"));return t>=0?String(e).slice(0,t+1):""},mt=e=>"'"+String(e).replace(/'/g,"'\\''")+"'",yo=e=>(e/1e3).toFixed(3)});var Li={};function ee(e){try{let t=localStorage.getItem(e);if(t!==null||!e.startsWith("slidetake:"))return t;let n=e.slice(10);return localStorage.getItem("slidetake:"+n)??localStorage.getItem("traverse:"+n)}catch{return null}}function te(e,t){try{localStorage.setItem(e,t)}catch{}}function ar(e){try{return{html:window.marked?window.marked.parse(e):"<pre>"+C(e)+"</pre>",err:null}}catch{return{html:"<p>(could not render)</p>",err:"render error"}}}function wt(){let e=x.brand||"",t=x.logo||"",n=/^chip$/i.test(x.brand_style||""),o=/^slidetake$/i.test(e)?'<span class="st-mark">'+Wo+'<span class="word">Slide<span>take</span></span></span>':(t?'<img alt="" src="'+C(t)+'">':"")+(e?"<span"+(n?' class="chip"':"")+">"+C(e)+"</span>":"");if(de.dataset.html!==o){de.dataset.html=o,de.innerHTML=o;let a=de.querySelector("img");a&&(a.onload=a.onerror=()=>oe(!0))}de.hidden=!o,xn(),document.title=x.title||"Slidetake",ir(),Uo()}function rr(){let e=String(x.accent||"").trim();if(!e||!window.CSS||!CSS.supports("color",e))return null;if(!CSS.supports("color","oklch(from red l c h)"))return{accent:e,line:e};let t=n=>"oklch(from "+e+" "+n+" c h)";return{dark:{accent:t(.8),accentSoft:t(.87),line:t(.5)},light:{accent:t(.45),accentSoft:t(.4),line:t(.75),ring:t(.7)}}}function ir(){let e="",t=(o,a)=>{let r=Object.entries(a||{}).filter(([i,s])=>So[i]&&s&&typeof s!="object").map(([i,s])=>So[i]+":"+String(s).replace(/[;{}<>]/g,"")).join(";");r&&(e+=o+"{"+r+`}
619
- `)};[T&&T.colors,rr()].filter(Boolean).forEach(o=>{["dark","light"].forEach(a=>{let r={...o,...o[a]||{}},i=a==="dark";r.accent&&typeof r.accent=="string"&&(r.accentSoft=r.accentSoft||r.accent,r.line=r.line||"color-mix(in srgb, "+r.accent+(i?" 45%, #09090b)":" 55%, #fff)"),r.ring=r.ring||(i?r.accent:r.line),r.onAccent=r.onAccent||(i?"color-mix(in srgb, "+r.accent+" 15%, #000)":"#fff")),t(i?'body:not([data-mode="light"])':'body[data-mode="light"]',r)})});let n=document.getElementById("st-colors");n||(n=document.createElement("style"),n.id="st-colors",document.head.appendChild(n)),n.textContent!==e&&(n.textContent=e),document.body.classList.toggle("st-header-color",e.includes("--header-bg"))}function Ge(e){let t=document.createElement("span");t.style.color="var("+e+")",document.body.appendChild(t);let n=getComputedStyle(t).color;return t.remove(),ye=ye||Object.assign(document.createElement("canvas"),{width:1,height:1}).getContext("2d",{willReadFrequently:!0}),ye.clearRect(0,0,1,1),ye.fillStyle="#000",ye.fillStyle=n,ye.fillRect(0,0,1,1),"#"+[...ye.getImageData(0,0,1,1).data.slice(0,3)].map(o=>o.toString(16).padStart(2,"0")).join("")}function sr(e,t,n){let o=i=>[1,3,5].map(s=>parseInt(i.slice(s,s+2),16)),a=o(e),r=o(t);return"#"+a.map((i,s)=>Math.round(i*n+r[s]*(1-n)).toString(16).padStart(2,"0")).join("")}function zt(){if(T&&T.themeKey&&!Eo){let t=ee(T.themeKey);return t==="light"||t==="dark"?t:matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return String(Eo||ee("slidetake:mode")||x.mode||"dark").toLowerCase()==="light"?"light":"dark"}function Uo(){let e=zt()==="light";e?document.body.dataset.mode="light":delete document.body.dataset.mode;let t=document.getElementById("btn-mode");t&&(t.innerHTML=e?'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>':'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="4.5"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>',t.title=(e?"Dark theme":"Light theme")+" (L)",t.setAttribute("aria-label",t.title))}function qo(){let e=zt()==="light"?"dark":"light";T&&T.themeKey?(te(T.themeKey,e),document.documentElement.classList.toggle("dark",e==="dark")):te("slidetake:mode",e),Uo(),W.querySelector(".echarts-container, .diagram.d2")&&Rt(!0)}function lr(){let t=(x.camera||"").replace(/^\[|\]$/g,"").split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean);return t.length?t:["on","full","off"]}function cn(e){return!q&&e?to(e.camera):[]}function Ce(e){return no(cn(e),e&&e.frags?e.frags.length:0)}function $o(){let e=Ce(d.get(p));return e[Math.min(ne,e.length-1)]||{cam:0,frag:0}}function cr(){if(!p)return null;let e=d.get(p),t=cn(e);if(t.length)return t[Math.min($o().cam,t.length-1)];if(e&&e.el.classList.contains("card-full"))return"off";for(let n=h.indexOf(p)-1;n>=0;n--){let o=cn(d.get(h[n]));if(o.length)return o[o.length-1]}return null}function dr(){let e={corner:(x.pip||"none").toLowerCase(),size:$t(parseFloat(x.pip_size)||24),circle:(x.pip_shape||"").toLowerCase()==="circle",mirror:!/^(no|false|off)$/i.test(x.pip_mirror||""),full:!1,off:!1,flip:!1,used:!1};return ct(e,cr()),J&&!/\b(off|hide)\b/i.test(J)&&(e.off=!1),ct(e,J),!Ue.includes(e.corner)&&(U||e.used)&&(e.corner="bottom-right"),e.flip&&Ue.includes(e.corner)&&(e.corner=e.corner.includes("left")?e.corner.replace("left","right"):e.corner.replace("right","left")),e}function xn(){let e=!I.hidden&&I.offsetWidth?I.getBoundingClientRect():null,t=Ae=dr(),n=Ue.includes(t.corner);if(I.className=n?[t.corner,t.circle&&"circle",U&&"live",t.mirror&&"mirror",t.full&&"full"].filter(Boolean).join(" "):"",I.style.width=t.size+"%",I.hidden=!n||q||t.off,or.dataset.pip=I.hidden||t.full?"none":t.corner,I.hidden||je||!I.animate)return;let o="cubic-bezier(.65,0,.35,1)";if(!e){I.animate([{opacity:0},{opacity:1}],{duration:300,easing:"ease-out"});return}let a=I.getBoundingClientRect();Math.abs(e.left-a.left)+Math.abs(e.top-a.top)+Math.abs(e.width-a.width)+Math.abs(e.height-a.height)<2||I.animate([{transformOrigin:"0 0",transform:"translate("+(e.left-a.left)+"px,"+(e.top-a.top)+"px) scale("+e.width/a.width+","+e.height/a.height+")"},{transformOrigin:"0 0",transform:"none"}],{duration:600,easing:o})}function pr(){let e=Ae;if(!e||I.hidden||e.full)return null;let t=M.clientWidth,n=M.clientHeight,o=16,a=t*e.size/100,r=e.circle?a:a*9/16,i=e.corner.includes("left")?o:t-o-a,s=e.corner.includes("top")?o:n-o-r;return{x0:i,y0:s,x1:i+a,y1:s+r}}function ur(){if(!tt)return;if(q){An(!0);return}let e=lr();pe=(pe+1)%e.length,J=e[pe],xn(),R||Be("Camera: "+J),!U&&!I.hidden?it():oe()}function Yo(e){let t=Qn(e,{render:ar});x=t.deck,d=t.nodes,wt();let n={"+++":"+++ format",reveal:"reveal.js format",headings:"headings"}[t.format];Ka.textContent=d.size+(d.size===1?" card":" cards")+" \xB7 "+n,Ze.textContent=t.errCount?t.errCount+" card(s) had errors":""}function Go(){le=[...d.values()].filter(o=>!o.parent).map(o=>o.id);let e=0;function t(o,a){let r=d.get(o);if(r.depth=a,r.children.length===0)r._slot=e++;else{r.children.forEach(s=>t(s,a+1));let i=r.children.map(s=>d.get(s)._slot);r._slot=(Math.min(...i)+Math.max(...i))/2}}le.forEach(o=>t(o,0)),h=[];function n(o){h.push(o),d.get(o).children.forEach(n)}return le.forEach(n),Math.max(1,e)}function hr(){let e=[],t=[],n=[];return d.forEach(o=>{e[o.depth]=Math.max(e[o.depth]||0,o._h),t[o.depth]=Math.max(t[o.depth]||0,o._w),n[o.depth]=(n[o.depth]||0)+1}),{maxH:e,maxW:t,count:n,maxDepth:e.length-1}}function Ko(e){e.x!==null&&!isNaN(e.x)&&(e.cx=e.x+e._w/2),e.y!==null&&!isNaN(e.y)&&(e.cy=e.y+e._h/2)}function mr(){let{maxH:e,maxDepth:t}=hr(),n=[0];for(let l=1;l<=t;l++)n[l]=n[l-1]+e[l-1]+Za;let o=Ja-ze,a=[],r=(l,c)=>{let f=d.get(l);f.cx+=c,f.children.forEach(N=>r(N,c))},i=l=>{let c=d.get(l);a[c.depth]=Math.max(a[c.depth]??-1/0,c.cx+c._w/2),c.children.forEach(i)};function s(l){let c=d.get(l),f=a[c.depth]!==void 0?a[c.depth]+o:-1/0;c.children.length?(c.children.forEach(s),c.cx=(d.get(c.children[0]).cx+d.get(c.children[c.children.length-1]).cx)/2,c.cx-c._w/2<f&&r(l,f-(c.cx-c._w/2))):c.cx=(f===-1/0?0:f)+c._w/2,i(l)}le.forEach(s),d.forEach(l=>{l.cy=n[l.depth]+l._h/2,Ko(l)})}function fr(e){let t=Math.PI*2/e,n=32,o=[],a=(s,l)=>Math.abs(s.cx-l.cx)<(s._w+l._w)/2+n&&Math.abs(s.cy-l.cy)<(s._h+l._h)/2+n,r=Math.max(0,...[...d.values()].map(s=>s.depth)),i=0;for(let s=0;s<=r;s++){let l=[...d.values()].filter(f=>f.depth===s);if(!l.length)continue;let c=s===0?le.length>1?er*.5:0:i+Qa;for(let f=0;f<400&&(l.forEach(O=>{let b=(O._slot+.5)*t-Math.PI/2;O.cx=c*Math.cos(b),O.cy=c*Math.sin(b),Ko(O)}),!!l.some((O,b)=>l.some((S,g)=>g>b&&a(O,S))||o.some(S=>a(O,S))));f++)c=c*1.02+10;i=c,o.push(...l)}}function gr(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),n=[];for(;t.nextNode();)n.push(t.currentNode);n.forEach(o=>{let a=o.data.match(/^\s*\.element:\s*([\s\S]*)$/);if(!a)return;let r=o.previousSibling;for(;r&&r.nodeType===3&&!r.data.trim();)r=r.previousSibling;let i=r&&r.nodeType===1?r:o.parentElement;i&&Object.entries(Fe(a[1])).forEach(([s,l])=>{s==="class"?i.classList.add(...l.split(/\s+/).filter(Boolean)):s==="style"?i.style.cssText+=";"+l:i.setAttribute(s,l)})})}function tn(e){let t=document.createElement("figure");t.className="media",e.replaceWith(t),t.appendChild(e);let n=e.getAttribute("alt");return n&&t.insertAdjacentHTML("beforeend","<figcaption>"+C(n)+"</figcaption>"),t}function br(e,t){let n=document.createElement("figure");return n.className="media yt fragment yt-play"+(e.portrait?" portrait":""),n.innerHTML='<div class="frame"><iframe src="'+mo(e)+'" title="'+C(t||"YouTube video")+'" allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen loading="lazy"></iframe></div>'+(t?"<figcaption>"+C(t)+"</figcaption>":""),n}function Lo(e,t){let n=t<=4?t:t<=6?3:4;e.style.setProperty("--cols",n),e.style.setProperty("--rows",Math.ceil(t/n))}function vr(e,t){t.querySelectorAll("pre > code.language-svg").forEach(r=>{let i=document.createElement("img");i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(r.textContent.trim()),i.alt="";let s=document.createElement("p");s.appendChild(i),r.parentElement.replaceWith(s)}),t.querySelectorAll(":scope > p").forEach(r=>{let i=r.children.length===1?r.children[0]:null;if(!i)return;let s=i.tagName==="A"&&r.textContent.trim()===i.textContent.trim()?i.getAttribute("href"):i.tagName==="IMG"?i.getAttribute("src"):null,l=s&&ho(s);l&&r.replaceWith(br(l,i.tagName==="IMG"?i.getAttribute("alt"):""))}),t.querySelectorAll(":scope > ul, :scope > ol").forEach(r=>{let i=[...r.children];!i.length||!i.every(s=>s.querySelector("img")&&!s.textContent.trim())||(r.classList.add("gallery"),i.forEach(s=>{let l=s.querySelector("img");s.innerHTML="",s.appendChild(l),tn(l)}),i.length>1&&i.every(s=>s.classList.contains("fragment"))?(r.classList.add("carousel"),i[0].classList.remove("fragment","fade-up"),i.forEach((s,l)=>{s.classList.replace("fade-up","current-visible");let c=s.querySelector("figcaption");c&&(c.dataset.count=l+1+" / "+i.length)})):Lo(r,i.length))}),t.querySelectorAll(":scope > p").forEach(r=>{if(!yr(r))return;let i=[...r.querySelectorAll("img")];if(i.length===1){r.replaceWith(i[0]),tn(i[0]);return}let s=document.createElement("div");s.className="gallery grid",r.replaceWith(s),i.forEach(l=>{s.appendChild(l),tn(l)}),Lo(s,i.length)});let n=[...t.children].filter(r=>!/^H[1-6]$/.test(r.tagName)&&!(r.nodeType===1&&r.tagName==="HR")),o=n.filter(r=>r.matches("figure.media"));o.length===1&&n.length===1&&e.classList.add("card-media"),n.length===1&&(n[0].matches("figure.media:not(.yt)")||n[0].matches(".gallery.carousel"))&&e.classList.add("card-bleed");let a=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT);for(;a.nextNode();)if(/^\s*view\s*:\s*full\s*$/i.test(a.currentNode.data))e.classList.add("card-full");else if(o.length===1){e.classList.add("card-split",n.indexOf(o[0])===0?"media-first":"media-last");let r=document.createElement("div");r.className="split-text",n.filter(i=>i!==o[0]).forEach(i=>r.appendChild(i)),o[0].after(r),n.indexOf(o[0])!==0&&r.after(o[0])}t.querySelector(".gallery")&&e.classList.add("card-gallery")}function Vo(e,t){let n=e.querySelector("iframe");n&&n.contentWindow&&n.contentWindow.postMessage(JSON.stringify({event:"command",func:t,args:[]}),"*")}function xr(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),n=[];for(;t.nextNode();)/^\s*steps\s*$/i.test(t.currentNode.data)&&n.push(t.currentNode);n.forEach(o=>{let a=o.nextSibling;for(;a&&a.nodeType!==1;)a=a.nextSibling;a&&/^(UL|OL)$/.test(a.tagName)&&a.querySelectorAll(":scope > li").forEach(r=>r.classList.add("fragment","fade-up"))})}function wr(e){let t=[...e.querySelectorAll(".fragment")].map((a,r)=>({e:a,i:r,k:a.dataset.fragmentIndex}));if(t.every(a=>a.k===void 0))return t.map(a=>[a.e]);let n=0;t.forEach(a=>{a.k=a.k===void 0?n:parseFloat(a.k),n=Math.max(n,a.k)+1}),t.sort((a,r)=>a.k-r.k||a.i-r.i);let o=[];return t.forEach((a,r)=>{r&&t[r-1].k===a.k?o[o.length-1].push(a.e):o.push([a.e])}),o}function wn(e,t,n){!e||!e.frags||(n&&e.el.classList.add("snap"),e.frags.forEach((o,a)=>o.forEach(r=>{let i=r.classList.contains("visible");r.classList.toggle("visible",a<t),r.classList.toggle("current-fragment",a===t-1),r.classList.contains("yt-play")&&i!==a<t&&!n&&Vo(r,a<t?"playVideo":"pauseVideo")})),n&&(e.el.offsetWidth,e.el.classList.remove("snap")))}function kr(){try{return x.base?new URL(x.base,Z||location.href):Z?new URL(Z):null}catch{return null}}function Sr(e){let t=kr(),n=0;return e.querySelectorAll("img[src], source[src], video[src], iframe[src], a[href]").forEach(o=>{let a=o.hasAttribute("src")?"src":"href",r=o.getAttribute(a);if(!r||/^(#|[a-z][a-z0-9+.-]*:|\/\/)/i.test(r))return;if(!t){a==="src"&&n++;return}let i=t;try{x.site&&(i=new URL(x.site,t))}catch{}o.setAttribute(a,new URL(r,r.startsWith("/")?i:t).href)}),n}function At(e){let t=e.el,n=t.querySelector(".body");t.classList.add("measuring"),n.style.zoom="";let o=ze;e.visual=!!n.querySelector("iframe, .echarts-container, pre > code.language-dot, pre > code.language-d2, pre > code.language-echarts, .diagram, figure.media"),e.visual&&(o=V);let a=t.classList.contains("card-full");if(t.classList.remove("img-portrait","img-landscape","img-overlay"),a&&(o=V),t.classList.contains("card-bleed")){let s=Math.max(0,...[...n.querySelectorAll("img")].map(c=>c.naturalWidth&&c.naturalHeight?c.naturalWidth/c.naturalHeight:0))||1.7777777777777777,l=V-gt*s>=260;if(a&&l)t.classList.add("img-portrait"),t.style.setProperty("--img-w",Math.round(gt*s)+"px"),o=V;else if(a||Math.abs(s-16/9)<.08)t.classList.add("img-overlay"),o=V;else if(s<1.3){let c=Math.min(Math.round(gt*s),V-300);t.classList.add("img-portrait"),t.style.setProperty("--img-w",c+"px"),o=Math.min(V,Math.max(en,c*2))}else t.classList.add("img-landscape"),o=Math.round(Math.max(ze,Math.min(V,(gt-Xa)*s))),t.style.setProperty("--img-h",Math.round(o/s)+"px")}else(n.querySelector('[style*="flex"], [style*="grid"], .r-hstack')||n.querySelectorAll("img").length>=4)&&(o=en);let r=n.querySelectorAll("table");if(r.length){t.style.width=V+"px";let s=t.offsetWidth-n.clientWidth;r.forEach(l=>{o=Math.max(o,Math.min(en,Math.ceil(l.offsetWidth)+s+12))})}let i=n.querySelectorAll(".fragment.grow");if(i.length){t.style.width=o+"px";let s=t.offsetWidth-n.clientWidth;i.forEach(l=>{o=Math.max(o,Math.min(V,Math.ceil(l.offsetWidth*1.3)+s))})}t.style.width=o+"px",t.scrollWidth>o+2&&(t.style.width=(o=Math.min(V,t.scrollWidth+24))+"px"),n.scrollWidth>n.clientWidth+2&&(n.style.zoom=(n.clientWidth/n.scrollWidth).toFixed(3)),e._w=o,e._h=t.offsetHeight||ln,t.classList.remove("measuring")}function Er(){clearTimeout(Co),Co=setTimeout(()=>{d.forEach(At),nt(),oe(!0)},200)}function Mr(){let e=zt()==="light"?"light":"dark",t=Ge(e==="light"?"--accent-ring":"--accent"),n="slidetake-"+e+"-"+t.slice(1);return To.has(n)||(Or(n,Tr[e],t),To.add(n)),n}function Or(e,t,n){let o={axisLine:{lineStyle:{color:t.line}},axisTick:{lineStyle:{color:t.line}},axisLabel:{color:t.muted},splitLine:{lineStyle:{color:t.split}},nameTextStyle:{color:t.muted}};echarts.registerTheme(e,{color:[n,...t.palette],backgroundColor:"transparent",textStyle:{color:t.text,fontFamily:"'IBM Plex Sans', sans-serif"},title:{textStyle:{color:t.text},subtextStyle:{color:t.muted}},legend:{textStyle:{color:t.text}},tooltip:{backgroundColor:t.tip,borderColor:t.line,textStyle:{color:t.text}},categoryAxis:o,valueAxis:o,logAxis:o,timeAxis:o,line:{symbolSize:6,lineStyle:{width:2.5}}})}function zr(){let e=zt()==="light"?"light":"dark",t=Ge("--node-bg"),n=Ge(e==="dark"?"--accent":"--accent-line"),o=e==="dark"?[.58,.38,.25,.18,.12]:[.7,.45,.25,.15,.08],a={...Ir[e],N7:t,B1:Ge("--accent")};return o.forEach((r,i)=>{a["B"+(i+2)]=sr(n,t,r)}),a}function dn(e){return nn[e]||(nn[e]=new Promise((t,n)=>{let o=document.createElement("script");o.src=e,o.onload=t,o.onerror=()=>{delete nn[e],n(new Error("could not load "+e))},document.head.appendChild(o)}))}async function Pr(){let e=ve,t=[...W.querySelectorAll(".node pre > code.language-dot")];W.querySelectorAll(".node pre > code.language-echarts").forEach(r=>{let i=document.createElement("div");i.className="echarts-container",i.dataset.chart=r.textContent,r.parentElement.replaceWith(i)});let n=[...W.querySelectorAll(".node .echarts-container[data-chart]")],o=[...W.querySelectorAll(".node pre > code.language-d2")];if(!t.length&&!n.length&&!o.length)return;let a=[];if(t.length)try{if(await dn(Lr),on=on||await Viz.instance(),e!==ve)return;t.forEach(r=>{let i=document.createElement("div");i.className="diagram";try{i.appendChild(on.renderSVGElement(r.textContent))}catch(s){i.className="diagram err",i.textContent="Diagram error: "+s.message}r.parentElement.replaceWith(i)})}catch{a.push("diagrams")}if(o.length)try{if(!bt){let i=await import(Br);bt=new i.D2}if(e!==ve)return;let r=zr();for(let i of o){let s=document.createElement("div");s.className="diagram d2";try{let l=await bt.compile(Ar(i.textContent));s.innerHTML=await bt.render(l.diagram,{...l.renderOptions||{},themeOverrides:r,darkThemeOverrides:r})}catch(l){s.className="diagram err",s.textContent="Diagram error: "+(l.message||l)}if(e!==ve)return;i.parentElement.replaceWith(s)}}catch{a.push("D2 diagrams")}if(n.length)try{if(await dn(Cr),e!==ve)return;let r=Mr();n.forEach(i=>{let s;try{s=JSON.parse(i.dataset.chart)}catch{i.textContent="Chart data is not valid JSON.";return}echarts.init(i,r,{renderer:"svg"}).setOption(Object.assign({backgroundColor:"transparent",animation:!je},s))})}catch{a.push("charts")}e===ve&&(a.length&&(Ze.textContent="Could not load the "+a.join(" and ")+" renderer (offline?)"),d.forEach(At),nt(),oe(!0))}function Rr(){let e=[];return h.forEach(t=>{let n=et(t),o=e[e.length-1];o&&o.sec===n?o.ids.push(t):e.push({sec:n,ids:[t]})}),e}function Dr(){let n=0,o=0,a=0;Rr().forEach((r,i)=>{let s=Math.max(...r.ids.map(f=>d.get(f)._h));i&&(n+=a/2+120+s/2);let l=o,c=o;r.ids.forEach((f,N)=>{let O=d.get(f);N&&(l+=90+O._w/2),O.cx=l,O.cy=n,c=l,l+=O._w/2}),o=c,a=s})}function jr(){d.forEach(e=>{e.cx=0,e.cy=0})}function Xo(){ve++,window.echarts&&W.querySelectorAll(".echarts-container").forEach(n=>{let o=echarts.getInstanceByDom(n);o&&o.dispose()}),W.querySelectorAll("div.node").forEach(n=>n.remove());let e=Go(),t=0;d.forEach(n=>{let o=document.createElement("div");o.className="node",o.tabIndex=0,o.dataset.id=n.id;let a=n.parent?Pt(n.id).slice(0,-1).map(i=>d.get(i).title).join(" / "):"";o.innerHTML=(a?'<div class="crumb">'+C(a)+"</div>":"")+'<div class="body">'+n.html+"</div>"+(n.err?'<div class="err-badge">!</div>':"");let r=o.querySelector(".body");gr(r),xr(r),vr(o,r),r.querySelectorAll("thead").forEach(i=>{i.textContent.trim()||i.remove()}),t+=Sr(r),n.frags=wr(r),r.querySelectorAll("img").forEach(i=>{i.complete||i.addEventListener("load",Er,{once:!0})}),o.querySelectorAll("a[href]").forEach(i=>{let s=i.getAttribute("href");if(s.startsWith("#")){let l=decodeURIComponent(s.slice(1));d.has(l)&&(i.classList.add("xlink"),i.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),u.active||P(l)}))}else i.target="_blank",i.rel="noopener",i.addEventListener("click",l=>l.stopPropagation())}),o.addEventListener("click",()=>{u.active||P(n.id)}),o.addEventListener("keydown",i=>{i.key==="Enter"&&i.target===o&&P(n.id)}),W.appendChild(o),n.el=o,wn(n,n.frags.length)}),t&&!Ze.textContent&&(Ze.textContent=t+" image(s) use relative paths: add base: to the deck, or open it with ?src="),d.forEach(At),nt(e),Pr()}function nt(e){e===void 0&&(e=Go()),A==="radial"?fr(e):A==="path"?Dr():A==="focus"?jr():mr(),W.classList.toggle("focus",A==="focus"),d.forEach(t=>{let n=t.el.style;n.setProperty("--cx",t.cx),n.setProperty("--cy",t.cy)}),_r(),_e(),Ln()}function _r(){let e="";if(A==="focus"){Qt.innerHTML="";return}if(A==="path"){for(let t=1;t<h.length;t++){let n=d.get(h[t-1]),o=d.get(h[t]);e+='<path data-from="'+n.id+'" data-to="'+o.id+'" d="M '+n.cx+" "+n.cy+" L "+o.cx+" "+o.cy+'"/>'}Qt.innerHTML=e;return}d.forEach(t=>{if(!t.parent)return;let n=d.get(t.parent);if(A==="radial")e+='<path data-from="'+n.id+'" data-to="'+t.id+'" d="M '+n.cx+" "+n.cy+" L "+t.cx+" "+t.cy+'"/>';else{let o=n.cy+n._h/2,a=t.cy-t._h/2,r=o+(a-o)/2;e+='<path data-from="'+n.id+'" data-to="'+t.id+'" d="M '+n.cx+" "+o+" L "+n.cx+" "+r+" L "+t.cx+" "+r+" L "+t.cx+" "+a+'"/>'}}),Qt.innerHTML=e}function Pt(e){let t=[],n=e;for(;n;)t.unshift(n),n=d.get(n).parent;return t}function Pe(){let e=M.clientWidth,t=M.clientHeight;W.style.transform="translate("+e/2+"px,"+t/2+"px) scale("+E.zoom+") translate("+-E.x+"px,"+-E.y+"px)",aa()}function kn(){Xe&&(Xe.kill(),Xe=null)}function Jo(e,t){if(kn(),t||je||!window.gsap){Object.assign(E,e),Pe();return}let n=M.clientWidth,o=Math.hypot(e.x-E.x,e.y-E.y),a=e.zoom,r=gsap.timeline({onUpdate:Pe,onComplete:()=>{Xe=null}}),{zoom:i,...s}=e,l=o*Math.min(E.zoom,a),c=Math.max(.55,Math.min(1.3,.55+l/n*.3));if(r.to(E,{...s,duration:c,ease:"power2.inOut"},0),l>n*1.2){let f=Math.max(.06,Math.min(E.zoom,a,n*.9/(o+ze)));r.to(E,{zoom:f,duration:c/2,ease:"sine.out"},0).to(E,{zoom:a,duration:c/2,ease:"sine.in"},c/2)}else r.to(E,{zoom:a,duration:c,ease:"power2.inOut"},0);Xe=r}function Nr(){let e=M.getBoundingClientRect(),t=14,n=[];if(!de.hidden&&de.offsetWidth){let a=de.getBoundingClientRect();n.push({x0:a.left-e.left-t,y0:a.top-e.top-t,x1:a.right-e.left+t,y1:a.bottom-e.top+t})}let o=pr();return o&&n.push({x0:o.x0-t,y0:o.y0-t,x1:o.x1+t,y1:o.y1+t}),n}function Hr(){let e=M.clientWidth,t=M.clientHeight,n=[{x0:16,y0:R?20:56,x1:e-16,y1:t-(R?20:74)}];return Nr().forEach(o=>{let a=[];n.forEach(r=>{if(o.x1<=r.x0||o.x0>=r.x1||o.y1<=r.y0||o.y0>=r.y1){a.push(r);return}[{...r,x1:Math.min(r.x1,o.x0)},{...r,x0:Math.max(r.x0,o.x1)},{...r,y1:Math.min(r.y1,o.y0)},{...r,y0:Math.max(r.y0,o.y1)}].forEach(i=>{i.x1-i.x0>80&&i.y1-i.y0>80&&a.push(i)})}),a.length&&(n=a)}),n}function pn(e,t,n){let o=M.clientWidth,a=M.clientHeight,r=null;return Hr().forEach(i=>{let s=n*Math.min((i.x1-i.x0)/e,(i.y1-i.y0)/t);(!r||s>r.zoom)&&(r={zoom:s,sx:(i.x0+i.x1)/2-o/2,sy:(i.y0+i.y1)/2-a/2})}),r}function Zo(e,t,n,o){return{x:e-n.sx/o,y:t-n.sy/o}}function Le(e,t){let n=d.get(e);if(!n)return;let o=pn(n._w,n._h,Qe),a=et(e),r=h.filter(l=>et(l)===a&&!d.get(l).visual).map(l=>{let c=d.get(l);return pn(c._w,c._h,Qe).zoom}).sort((l,c)=>l-c),i=r.length?r[Math.floor((r.length-1)/2)]:o.zoom,s=Math.max(.2,Math.min(5,o.zoom,i));Jo(Object.assign(Zo(n.cx,n.cy,o,s),{zoom:s}),t)}function ot(e){let t=[...d.values()];if(!t.length)return;let n=M.clientWidth,o=M.clientHeight,a=Math.min(...t.map(f=>f.cx-f._w/2)),r=Math.max(...t.map(f=>f.cx+f._w/2)),i=Math.min(...t.map(f=>f.cy-f._h/2)),s=Math.max(...t.map(f=>f.cy+f._h/2)),l=pn(r-a,s-i,.94),c=Math.max(.05,Math.min(1,l.zoom));Jo(Object.assign(Zo((a+r)/2,(i+s)/2,l,c),{zoom:c}),e)}function oe(e){p&&d.has(p)?Le(p,e):ot(e)}function _e(){let e=p?Pt(p):[];d.forEach(t=>{let n=t.el;n.classList.toggle("current",t.id===p),n.classList.toggle("active-path",e.includes(t.id))}),W.querySelectorAll("#connectors path").forEach(t=>{let n=A==="path"?!!p&&h.indexOf(t.dataset.to)<=h.indexOf(p):e.includes(t.dataset.from)&&e.includes(t.dataset.to);t.classList.toggle("active",n)}),qr(e),ea()}function Qo(){return Vn(new URLSearchParams(location.search).get("duration")??x.duration)}function Fr(){return R&&Qo()>0&&(!u.active||/^always$/i.test(x.timer||""))}function kt(){let e=Fr()&&ue.start>0;if(we.classList.toggle("timed",e),!e){we.classList.remove("over");return}let n=(u.active&&u.t0?Ct():performance.now()-ue.start)/Qo();we.firstChild.style.width=Math.min(100,n*100)+"%",we.classList.toggle("over",n>=1)}function Wr(){ue.start=performance.now(),clearInterval(ue.timer),ue.timer=setInterval(kt,1e3),kt()}function Ur(){clearInterval(ue.timer),ue.timer=null,ue.start=0,kt()}function ea(){let e=R&&h.length>1&&!/^(off|no|false)$/i.test(x.progress||"");if(we.classList.toggle("show",e),!e)return;kt();let t=h.indexOf(p),n=0,o=0;h.forEach((a,r)=>{let i=Ce(d.get(a)).length;n+=i,r<t?o+=i:r===t&&(o+=Math.min(ne,i-1)+1)}),we.lastChild.style.width=(n?o/n*100:0)+"%"}function qr(e){ko.innerHTML=e.map((t,n)=>(n>0?'<span class="sep">\u203A</span>':"")+'<button class="crumb-btn'+(t===p?" here":"")+'" data-id="'+C(t)+'">'+C(d.get(t).title)+"</button>").join(""),ko.querySelectorAll(".crumb-btn").forEach(t=>t.addEventListener("click",()=>{u.active||P(t.dataset.id)}))}function at(e){let t=d.get(p);t&&(wn(t,$o().frag,e),xn(),(I.hidden||!Ae||!Ae.full)&&Gr(t),En(t))}function Yr(e){return!h.length||e.id!==h[0]&&e.id!==h[h.length-1]||e.el.querySelector("[data-gsap], .title-scramble")?null:[...e.el.querySelector(".body").children].filter(t=>!t.classList.contains("fragment"))}function Gr(e){if(e._played||!window.gsap||je)return;e._played=!0;let t=Yr(e);if(t&&t.length){e._auto=t;let[n,...o]=t;/^H[1-3]$/.test(n.tagName)&&!n.children.length?(n.classList.add("auto-scramble"),Mo(n)):o.unshift(n),gsap.from(o,{opacity:0,y:24,duration:.7,ease:"power2.out",delay:.5,stagger:.45})}e.el.querySelectorAll("[data-gsap]").forEach(n=>{let o;try{o=JSON.parse(n.dataset.gsap)}catch{return}let a={duration:o.duration??1,delay:o.delay??0,ease:o.ease||"power2.out"};o.to?gsap.fromTo(n,o.from||{},Object.assign({},o.to,a)):o.from&&gsap.from(n,Object.assign({},o.from,a))}),e.el.querySelectorAll(".title-scramble").forEach(Mo)}function Sn(e){!e||!e._played||(e._played=!1,window.gsap&&(e._auto&&(e._auto.forEach(t=>{gsap.killTweensOf(t),gsap.set(t,{clearProps:"opacity,transform"})}),e._auto=null),e.el.querySelectorAll("[data-gsap]").forEach(t=>{gsap.killTweensOf(t);let n={};try{n=JSON.parse(t.dataset.gsap)}catch{}let o=new Set(Object.keys(Object.assign({},n.from,n.to)).map(a=>$r.includes(a)?"transform":a));o.size&&gsap.set(t,{clearProps:[...o].join(",")})}),e.el.querySelectorAll(".title-scramble, .auto-scramble").forEach(t=>{t._scramble&&t._scramble.kill(),t.dataset.text&&(t.textContent=t.dataset.text)})))}function Mo(e){let t=e.dataset.text||(e.dataset.text=e.textContent),n=Array.from(t),o="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#%&*+=?",a={p:0};e._scramble=gsap.to(a,{p:1,duration:1.4,ease:"none",onUpdate(){let r=Math.floor(a.p*n.length);e.textContent=n.map((i,s)=>s<r||/\s/.test(i)?i:o[Math.random()*o.length|0]).join("")},onComplete(){e.textContent=t}})}function En(e){clearTimeout(Re),!(!R||!e||!e.autoslide||u.active&&(!u.t0||u.paused))&&(Re=setTimeout(()=>{p===e.id&&De(1)},e.autoslide))}function ta(e){let t=e&&e!==h[0]?e:"";try{y&&y.kind==="share"?history.replaceState(null,"",location.pathname+location.search+Xt(y.data,t)):history.replaceState(null,"",e?"#"+encodeURIComponent(e):location.pathname+location.search)}catch{}}function P(e,t,n){if(!d.has(e))return;if(e!==p){J=null,pe=-1,ne=n?Ce(d.get(e)).length-1:0;let r=d.get(p);r&&A==="focus"&&!t&&(r.el.classList.add("leaving"),setTimeout(()=>r.el.classList.remove("leaving"),600)),na()}let o=e!==p;if(p=e,clearTimeout(X),X=null,o&&A==="focus"&&!t&&!je){let r=d.get(e).el;r.classList.add("entering"),r.offsetWidth,r.classList.remove("entering")}at(o),o&&Bn("slide",e);let a=d.get(e);o&&a.mapFirst&&!n&&!t&&A!=="focus"?(ot(),X=setTimeout(()=>{X=null,p===e&&Le(e)},1900)):Le(e,t),_e(),Ln(),ta(e)}function na(){let e=d.get(p);e&&(e.el.querySelectorAll("figure.yt").forEach(t=>Vo(t,"pauseVideo")),wn(e,e.frags.length,!0),Sn(e))}function Kr(){if(!p&&ke&&d.has(ke)){oa();return}p&&(ke=p),A==="focus"&&Se("path"),na(),clearTimeout(Re),p=null,_e(),Ln(),ot(),ta(null)}function oa(){if(X)return clearTimeout(X),X=null,Le(p),!0;if(!p&&ke&&d.has(ke)){let e=ke;return ke=null,P(e),!0}return!1}function De(e){if(!p){h.length&&P(h[e>0?0:h.length-1]);return}if(X&&e>0){clearTimeout(X),X=null,Le(p);return}let t=Ce(d.get(p)),n=Math.min(ne,t.length-1)+e;if(n>=0&&n<t.length){ne=n,J=null,pe=-1,at(),!U&&!I.hidden&&Ae.used?it():oe(),_e();return}let o=h.indexOf(p)+e;o>=0&&o<h.length&&P(h[o],!1,e<0)}function Vr(){let e=d.get(p);e&&e.parent&&P(e.parent)}function Xr(){let e=d.get(p);e&&e.children.length?P(e.children[0]):!p&&h.length&&P(h[0])}function Ln(){let e=[...d.values()];if(!e.length){sn.innerHTML="",ie=null;return}Va.textContent="map";let t=g=>g.cx,n=g=>g.cy,o=Math.min(...e.map(t))-ze/2,a=Math.max(...e.map(t))+ze/2,r=Math.min(...e.map(n))-ln/2,i=Math.max(...e.map(n))+ln/2,s=16,l=180,c=130,f=Math.min((l-2*s)/Math.max(1,a-o),(c-2*s-6)/Math.max(1,i-r)),N=l/2-(o+a)/2*f,O=c/2+5-(r+i)/2*f,b=p?Pt(p):[],S="";e.forEach(g=>{if(!g.parent)return;let B=d.get(g.parent);S+='<line x1="'+(t(B)*f+N)+'" y1="'+(n(B)*f+O)+'" x2="'+(t(g)*f+N)+'" y2="'+(n(g)*f+O)+'" stroke="var(--panel-line)" stroke-width="1"/>'}),e.forEach(g=>{let B=g.id===p?"var(--accent)":b.includes(g.id)?"var(--accent-teal)":"var(--node-border)";S+='<circle data-id="'+C(g.id)+'" cx="'+(t(g)*f+N)+'" cy="'+(n(g)*f+O)+'" r="'+(g.id===p?4:3)+'" fill="'+B+'"><title>'+C(g.title)+"</title></circle>"}),S+='<rect id="mm-viewport" fill="none" stroke="var(--accent)" stroke-width="1" opacity="0.7"/>',sn.innerHTML=S,ie={s:f,ox:N,oy:O},aa()}function aa(){let e=document.getElementById("mm-viewport");if(!e||!ie)return;let t=M.clientWidth/E.zoom,n=M.clientHeight/E.zoom;e.setAttribute("x",(E.x-t/2)*ie.s+ie.ox),e.setAttribute("y",(E.y-n/2)*ie.s+ie.oy),e.setAttribute("width",Math.max(2,t*ie.s)),e.setAttribute("height",Math.max(2,n*ie.s))}function Rt(e){Yo(Q.value),p&&!d.has(p)&&(p=null),Xo(),p?P(p,e):h.length?P(h[0],e):(p=null,ot(!0))}function Se(e,t){A=e,te("slidetake:layout",e),document.querySelectorAll("#layout-toggle .seg-btn").forEach(n=>n.classList.toggle("active",n.dataset.mode===e)),d.size&&(!t&&!je&&(W.classList.add("morph"),setTimeout(()=>W.classList.remove("morph"),700)),nt(),Pe(),p?Le(p,t):ot(t))}function ra(e){return Math.max(.04,Math.min(5,e))}function Jr(e){Qe=Math.round(Math.max(tr,Math.min(nr,e))*100)/100,te("slidetake:slideSize",Qe),p&&Le(p)}function Bo(e){p?Jr(Qe+e*.1):ia(e>0?1.2:1/1.2)}function ia(e,t,n){kn();let o=ra(E.zoom*e);if(t!==void 0){let a=M.getBoundingClientRect(),r=t-a.left-a.width/2,i=n-a.top-a.height/2;E.x+=r/E.zoom-r/o,E.y+=i/E.zoom-i/o}E.zoom=o,Pe()}function Dt(){T||(fe.classList.toggle("collapsed"),document.getElementById("btn-edit-toggle").classList.toggle("active",!fe.classList.contains("collapsed")))}function ge(e){R=e,document.body.classList.toggle("presenting",e),Sa();let t=document.documentElement;e&&t.requestFullscreen&&!document.fullscreenElement&&t.requestFullscreen().catch(()=>{}),!e&&document.fullscreenElement&&document.exitFullscreen&&document.exitFullscreen().catch(()=>{}),e&&!p&&h.length&&P(h[0]);let n=x.camera||[...d.values()].some(o=>o.camera);e&&n&&!U&&!q&&it(),e?En(d.get(p)):clearTimeout(Re),e?Wr():Ur(),ea()}function Ct(){return(u.paused?u.pauseAt:performance.now())-u.t0-u.pausedMs}function jt(e){e.classList.add("open")}function Mn(){document.querySelectorAll(".modal.open").forEach(e=>e.classList.remove("open"))}function ti(){let e=new URLSearchParams(location.search).get("obs");if(e){let[t,n,...o]=e.split(":");return St.value=t||"localhost",Et.value=n||"4455",Lt.value=o.join(":"),!0}try{let t=JSON.parse(ee("slidetake:obs")||"null");t&&(St.value=t.host||"localhost",Et.value=t.port||"4455",Lt.value=t.password||"",Cn.checked=!0)}catch{}return!1}function ca(){if(Cn.checked)te("slidetake:obs",JSON.stringify({host:St.value.trim(),port:Et.value.trim(),password:Lt.value}));else try{localStorage.removeItem("slidetake:obs")}catch{}}function Ye(e,t){Ro.textContent=e,Ro.className=t||""}function oi(e){return location.protocol==="https:"&&!ni(e)}async function da(){let e=St.value.trim()||"localhost",t="ws://"+e+":"+(Et.value.trim()||"4455");if(oi(e)){xe=!1,Je.disabled=!0,Ye(ai,"err");return}Ye("Connecting to "+t+"\u2026");try{await dn(Zr);let n=window.OBSWebSocket&&(window.OBSWebSocket.default||window.OBSWebSocket);if(F)try{await F.disconnect()}catch{}F=new n,F.on("ConnectionClosed",()=>{xe=!1,Ye("Disconnected from OBS","err"),Je.disabled=!0}),F.on("RecordStateChanged",a=>{a.outputState==="OBS_WEBSOCKET_OUTPUT_STARTED"&&Ee&&(Ee(),Ee=null),a.outputState==="OBS_WEBSOCKET_OUTPUT_STOPPED"&&u.active&&u.withObs&&!u.finishing&&_t("Stopped in OBS")});let o=await F.connect(t,Lt.value||void 0);xe=!0;try{let a=await F.call("GetVideoSettings");a&&a.fpsNumerator&&a.fpsDenominator&&(sa=a.fpsNumerator/a.fpsDenominator)}catch{}Ye("Connected"+(o&&o.obsWebSocketVersion?" \xB7 OBS WebSocket "+o.obsWebSocketVersion:""),"ok"),ca()}catch(n){xe=!1,Ye("Could not connect ("+(n&&n.message||n)+"). Is OBS running with its WebSocket server on, and is the password right?","err")}Je.disabled=!xe}function ri(){let e=document.getElementById("rec-screen"),t=screen.width,n=screen.height;if(Math.abs(t/n-16/9)<.02){e.innerHTML='<span class="ok">This screen is 16:9 ('+t+"\xD7"+n+"), right for YouTube.</span>";return}let o=[["16:10",1.6],["3:2",1.5],["4:3",4/3],["21:9",21/9],["16:9",16/9]],[a,r]=o.reduce((s,l)=>Math.abs(l[1]-t/n)<Math.abs(s[1]-t/n)?l:s),i=Math.abs(r-t/n)<.005?a:"about "+a;e.innerHTML='<span class="warn">This screen is '+i+" ("+t+"\xD7"+n+"), not 16:9, so the video will have bars or be cropped. Move this window to a 16:9 screen, physical or virtual (say 1920\xD71080), then press F there.</span>"}function hn(){if(!tt)return;let e=h.reduce((n,o)=>n+Ce(d.get(o)).length,0),t=x.camera||[...d.values()].some(n=>n.camera);document.getElementById("rec-deck-info").innerHTML=C(x.title||(le[0]?d.get(le[0]).title:"This deck"))+" \xB7 "+h.length+" slides \xB7 "+e+" presses"+(t&&q?'<br><span class="warn">The camera is off. Press C first if this take should include your webcam.</span>':""),Je.disabled=!xe,di(),ri(),jt(Qr)}async function pa(e){if(u.active||!h.length)return;Mn(),Object.assign(u,{active:!0,withObs:e,counting:!0,paused:!1,finishing:!1,t0:0,pausedMs:0,events:[],outputPath:null}),document.body.classList.add("recording"),wa();let t=document.getElementById("rec-layout").value;t!=="current"&&t!==A&&Se(t,!0),R||ge(!0),p===h[0]&&(ne=0,J=null,pe=-1),P(h[0],!0);for(let o=3;o>0;o--)if(yt.querySelector(".num").textContent=o,yt.classList.add("show"),await Tn(1e3),!u.active)return;if(yt.classList.remove("show"),await la(),e){let o=new Promise(a=>{Ee=a,setTimeout(()=>{Ee&&(Ee(),Ee=null)},2500)});try{await F.call("StartRecord")}catch(a){On("OBS could not start recording: "+(a&&a.message||a));return}if(await o,!u.active)return}u.counting=!1,u.t0=performance.now();let n=d.get(p);Sn(n),at(!0),Bn("slide",p)}function On(e){u.active=!1,u.counting=!1,yt.classList.remove("show"),document.body.classList.remove("recording"),R&&ge(!1),Be(e)}function Bn(e,t){if(!u.active||!u.t0||u.finishing)return;let n=d.get(t),o={id:t,title:n?n.title:t,retake:e==="retake",t:Math.round(Ct()),obsT:null};u.events.push(o),u.withObs&&xe&&(F.call("GetRecordStatus").then(a=>{a&&typeof a.outputDuration=="number"&&(o.obsT=a.outputDuration)}).catch(()=>{}),n&&F.call("CreateRecordChapter",{chapterName:(o.retake?"RETAKE \xB7 ":"")+n.title}).catch(()=>{}))}function ii(e){let t=e.key;if((zo.includes(t)||Ao.includes(t)||Po.includes(t)||t==="Escape")&&e.preventDefault(),t==="Escape"){u.counting?On("Take cancelled"):_t("Stopped early");return}if(!(u.counting||u.finishing)){if(Po.includes(t)){ci();return}u.paused||(zo.includes(t)?si():Ao.includes(t)&&li())}}function si(){let e=Ce(d.get(p));Math.min(ne,e.length-1)>=e.length-1&&h.indexOf(p)===h.length-1?_t():De(1)}function li(){let e=d.get(p);e&&(Bn("retake",p),ne=0,J=null,pe=-1,Sn(e),at(!0),!U&&!I.hidden&&Ae.used?it():oe(),_e())}async function ci(){u.t0&&(u.paused?(un.classList.remove("show"),await la(),u.withObs&&await F.call("ResumeRecord").catch(()=>{}),u.pausedMs+=performance.now()-u.pauseAt,u.paused=!1,En(d.get(p))):(u.paused=!0,u.pauseAt=performance.now(),clearTimeout(Re),u.withObs&&await F.call("PauseRecord").catch(()=>{}),un.classList.add("show")))}async function _t(e){if(!u.active||u.finishing)return;if(u.counting){On("Take cancelled");return}u.finishing=!0,clearTimeout(Re),u.paused&&(u.pausedMs+=performance.now()-u.pauseAt,u.paused=!1,un.classList.remove("show"));let t=Math.round(Ct()),n=null;if(u.withObs){await Tn(1200),t=Math.round(Ct());try{let a=await F.call("GetRecordStatus");a&&typeof a.outputDuration=="number"&&(n=a.outputDuration)}catch{}try{let a=await F.call("StopRecord");u.outputPath=a&&a.outputPath}catch(a){e=(e?e+". ":"")+"OBS did not confirm the stop ("+(a&&a.message||a)+")"}}u.active=!1,u.finishing=!1,document.body.classList.remove("recording"),R&&ge(!1);let o={key:Nt(),deckTitle:x.title||d.get(h[0]).title,date:new Date().toISOString(),withObs:u.withObs,outputPath:u.outputPath,reason:e||"",total:t,totalObs:n,fps:sa,events:u.events.map(a=>({id:a.id,title:a.title,retake:a.retake,t:a.t,obsT:a.obsT})),picks:{}};In(o),ya(o)}function Nt(){return Te(x.title||(h[0]?d.get(h[0]).title:"deck"))}function ua(){try{return JSON.parse(ee("slidetake:sessions")||"[]")}catch{return[]}}function In(e){let t=ua().filter(n=>n.date!==e.date);t.unshift(e),te("slidetake:sessions",JSON.stringify(t.slice(0,12)))}function di(){let e=document.getElementById("rec-sessions"),t=ua().filter(n=>n.key===Nt());e.innerHTML=t.length?"<h3>Earlier takes of this deck</h3>"+t.map((n,o)=>'<div class="row"><button class="btn small" data-session="'+o+'">Review</button><span>'+C(new Date(n.date).toLocaleString())+" \xB7 "+K(n.totalObs??n.total)+(n.withObs?"":" \xB7 rehearsal")+(n.outputPath?" \xB7 "+C(Me(n.outputPath)):"")+"</span></div>").join(""):"",e.querySelectorAll("[data-session]").forEach(n=>n.onclick=()=>{Mn(),ya(t[+n.dataset.session])})}function et(e){let t=d.has(e)?Pt(e):[e];return t[Math.min(1,t.length-1)]}function ha(e,t){let n=et(e);return{sec:n,title:d.has(n)?d.get(n).title:t}}function ga(){let e=Object.keys(x).filter(t=>t==="tags"||/_tags$/.test(t)).flatMap(t=>[].concat(x[t])).filter(t=>typeof t=="string");return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function pi(){return[].concat(x.related||[]).map(e=>{let t=String(e).match(/^\[([^\]]+)\]\(([^)]+)\)$/),n=String(e).split("|");return t?t[1]+": "+t[2]:n.length===2?n[0].trim()+": "+n[1].trim():String(e)})}function ui(){if(x.permalink||x.url)return x.permalink||x.url;let e=x.site||ee("slidetake:site");if(!e||!Z)return"";try{let t=new URL(Z).pathname.replace(/\/index\.md$/i,"/").replace(/\.md$/i,"/");return new URL(t,e).href}catch{return""}}function ba(e){let t=ma(e),n=document.getElementById("rv-link").value.trim(),o=pi(),a=ga(),r=[];x.summary&&r.push(x.summary),n&&r.push("\u{1F4D1} Slides: "+n),t.lines.length>=3&&r.push(`Chapters
852
+ `+_+"ffmpeg -f concat -safe 0 -i /tmp/slidetake-cuts.txt -i /tmp/slidetake-chapters.txt"+O+" -c copy -movflags +faststart "+yt(i)}let y=vt(e),S=m=>(m/y).toFixed(6),g=m=>((m-.5)/y).toFixed(6),B=r.map(m=>"gte(t,"+g(m.f0)+")*lt(t,"+g(m.f1)+")").join("+"),V=r.map(m=>"gte(t,"+S(m.f0)+")*lt(t,"+S(m.f1)+")").join("+"),x=t==="mac"?"-c:v h264_videotoolbox -b:v 12M":"-c:v libx264 -crf 18 -preset medium";return _+"ffmpeg -i "+yt(a)+" -i /tmp/slidetake-chapters.txt"+O+` -vf "select='`+B+`',setpts=N/FRAME_RATE/TB" -af "asetnsamples=n=48:p=0,aselect='`+V+`',asetpts=N/SR/TB" `+x+" -c:a aac -b:a 192k -movflags +faststart "+yt(i)}var Co,vt,Lo,Me,sr,yt,To,Ao=R(()=>{"use strict";ht();Co=e=>e.obsT??e.t,vt=e=>e.fps||60,Lo=(e,t)=>Math.round(e*t/1e3);Me=e=>String(e||"").split(/[\\/]/).pop()||"",sr=e=>{let t=Math.max(String(e).lastIndexOf("/"),String(e).lastIndexOf("\\"));return t>=0?String(e).slice(0,t+1):""},yt=e=>"'"+String(e).replace(/'/g,"'\\''")+"'",To=e=>(e/1e3).toFixed(3)});var Ui={};function Q(e){try{let t=localStorage.getItem(e);if(t!==null||!e.startsWith("slidetake:"))return t;let a=e.slice(10);return localStorage.getItem("slidetake:"+a)??localStorage.getItem("traverse:"+a)}catch{return null}}function Z(e,t){try{localStorage.setItem(e,t)}catch{}}function yr(e){try{return{html:window.marked?window.marked.parse(e):"<pre>"+T(e)+"</pre>",err:null}}catch{return{html:"<p>(could not render)</p>",err:"render error"}}}function Lt(){let e=w.brand||"",t=w.logo||"",a=/^chip$/i.test(w.brand_style||""),o=/^slidetake$/i.test(e)?'<span class="st-mark">'+Jo+'<span class="word">Slide<span>take</span></span></span>':(t?'<img alt="" src="'+T(t)+'">':"")+(e?"<span"+(a?' class="chip"':"")+">"+T(e)+"</span>":"");if(pe.dataset.html!==o){pe.dataset.html=o,pe.innerHTML=o;let n=pe.querySelector("img");n&&(n.onload=n.onerror=()=>ne(!0))}pe.hidden=!o,ka(),document.title=w.title||"Slidetake",wr(),Xo()}function vr(){let e=String(w.accent||"").trim();if(!e||!window.CSS||!CSS.supports("color",e))return null;if(!CSS.supports("color","oklch(from red l c h)"))return{accent:e,line:e};let t=a=>"oklch(from "+e+" "+a+" c h)";return{dark:{accent:t(.8),accentSoft:t(.87),line:t(.5)},light:{accent:t(.45),accentSoft:t(.4),line:t(.75),ring:t(.7)}}}function wr(){let e="",t=(o,n)=>{let r=Object.entries(n||{}).filter(([i,s])=>Io[i]&&s&&typeof s!="object").map(([i,s])=>Io[i]+":"+String(s).replace(/[;{}<>]/g,"")).join(";");r&&(e+=o+"{"+r+`}
853
+ `)};[A&&A.colors,vr()].filter(Boolean).forEach(o=>{["dark","light"].forEach(n=>{let r={...o,...o[n]||{}},i=n==="dark";r.accent&&typeof r.accent=="string"&&(r.accentSoft=r.accentSoft||r.accent,r.line=r.line||"color-mix(in srgb, "+r.accent+(i?" 45%, #09090b)":" 55%, #fff)"),r.ring=r.ring||(i?r.accent:r.line),r.onAccent=r.onAccent||(i?"color-mix(in srgb, "+r.accent+" 15%, #000)":"#fff")),t(i?'body:not([data-mode="light"])':'body[data-mode="light"]',r)})});let a=document.getElementById("st-colors");a||(a=document.createElement("style"),a.id="st-colors",document.head.appendChild(a)),a.textContent!==e&&(a.textContent=e),document.body.classList.toggle("st-header-color",e.includes("--header-bg"))}function Ve(e){let t=document.createElement("span");t.style.color="var("+e+")",document.body.appendChild(t);let a=getComputedStyle(t).color;return t.remove(),ve=ve||Object.assign(document.createElement("canvas"),{width:1,height:1}).getContext("2d",{willReadFrequently:!0}),ve.clearRect(0,0,1,1),ve.fillStyle="#000",ve.fillStyle=a,ve.fillRect(0,0,1,1),"#"+[...ve.getImageData(0,0,1,1).data.slice(0,3)].map(o=>o.toString(16).padStart(2,"0")).join("")}function xr(e,t,a){let o=i=>[1,3,5].map(s=>parseInt(i.slice(s,s+2),16)),n=o(e),r=o(t);return"#"+n.map((i,s)=>Math.round(i*a+r[s]*(1-a)).toString(16).padStart(2,"0")).join("")}function Dt(){if(A&&A.themeKey&&!zo){let t=Q(A.themeKey);return t==="light"||t==="dark"?t:matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return String(zo||Q("slidetake:mode")||w.mode||"dark").toLowerCase()==="light"?"light":"dark"}function Xo(){let e=Dt()==="light";e?document.body.dataset.mode="light":delete document.body.dataset.mode;let t=document.getElementById("btn-mode");t&&(t.innerHTML=e?'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>':'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="4.5"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>',t.title=(e?"Dark theme":"Light theme")+" (L)",t.setAttribute("aria-label",t.title))}function Qo(){let e=Dt()==="light"?"dark":"light";A&&A.themeKey?(Z(A.themeKey,e),document.documentElement.classList.toggle("dark",e==="dark")):Z("slidetake:mode",e),Xo(),q.querySelector(".echarts-container, .diagram.d2")&&je(!0)}function kr(){let t=(w.camera||"").replace(/^\[|\]$/g,"").split(",").map(a=>a.trim().replace(/^["']|["']$/g,"")).filter(Boolean);return t.length?t:["on","full","off"]}function pa(e){return!G&&e?po(e.camera):[]}function Le(e){return ho(pa(e),e&&e.frags?e.frags.length:0)}function Zo(){let e=Le(d.get(p));return e[Math.min(oe,e.length-1)]||{cam:0,frag:0}}function Sr(){if(!p)return null;let e=d.get(p),t=pa(e);if(t.length)return t[Math.min(Zo().cam,t.length-1)];if(e&&e.el&&e.el.classList.contains("card-full"))return"off";for(let a=u.indexOf(p)-1;a>=0;a--){let o=pa(d.get(u[a]));if(o.length)return o[o.length-1]}return null}function Er(){let e={corner:(w.pip||"none").toLowerCase(),size:Vt(parseFloat(w.pip_size)||24),circle:(w.pip_shape||"").toLowerCase()==="circle",mirror:!/^(no|false|off)$/i.test(w.pip_mirror||""),full:!1,off:!1,flip:!1,used:!1};return ut(e,Sr()),te&&!/\b(off|hide)\b/i.test(te)&&(e.off=!1),ut(e,te),!qe.includes(e.corner)&&(Y||e.used)&&(e.corner="bottom-right"),e.flip&&qe.includes(e.corner)&&(e.corner=e.corner.includes("left")?e.corner.replace("left","right"):e.corner.replace("right","left")),e}function ka(){let e=!L.hidden&&L.offsetWidth?L.getBoundingClientRect():null,t=ze=Er(),a=qe.includes(t.corner);if(L.className=a?[t.corner,t.circle&&"circle",Y&&"live",t.mirror&&"mirror",t.full&&"full",L.classList.contains("msg")&&"msg"].filter(Boolean).join(" "):"",L.style.width=t.size+"%",L.hidden=!a||G||t.off,br.dataset.pip=L.hidden||t.full?"none":t.corner,L.hidden||Fe||!L.animate)return;let o="cubic-bezier(.65,0,.35,1)";if(!e){L.animate([{opacity:0},{opacity:1}],{duration:300,easing:"ease-out"});return}let n=L.getBoundingClientRect();Math.abs(e.left-n.left)+Math.abs(e.top-n.top)+Math.abs(e.width-n.width)+Math.abs(e.height-n.height)<2||L.animate([{transformOrigin:"0 0",transform:"translate("+(e.left-n.left)+"px,"+(e.top-n.top)+"px) scale("+e.width/n.width+","+e.height/n.height+")"},{transformOrigin:"0 0",transform:"none"}],{duration:600,easing:o})}function Cr(){let e=ze;if(!e||L.hidden||e.full)return null;let t=M.clientWidth,a=M.clientHeight,o=16,n=t*e.size/100,r=e.circle?n:n*9/16,i=e.corner.includes("left")?o:t-o-n,s=e.corner.includes("top")?o:a-o-r;return{x0:i,y0:s,x1:i+n,y1:s+r}}function Lr(){if(!nt)return;if(G){ja(!0);return}let e=kr();he=(he+1)%e.length,te=e[he],ka(),D||Ae("Camera: "+te),!Y&&!L.hidden?dt():ne()}function en(e){let t=lo(e,{render:yr});w=t.deck,d=t.nodes,Lt();let a={"+++":"+++ format",reveal:"reveal.js format",headings:"headings"}[t.format];lr.textContent=d.size+(d.size===1?" card":" cards")+" \xB7 "+a,et.textContent=t.errCount?t.errCount+" card(s) had errors":""}function tn(){ce=[...d.values()].filter(o=>!o.parent).map(o=>o.id);let e=0;function t(o,n){let r=d.get(o);if(r.depth=n,r.children.length===0)r._slot=e++;else{r.children.forEach(s=>t(s,n+1));let i=r.children.map(s=>d.get(s)._slot);r._slot=(Math.min(...i)+Math.max(...i))/2}}ce.forEach(o=>t(o,0)),u=[];function a(o){u.push(o),d.get(o).children.forEach(a)}return ce.forEach(a),Math.max(1,e)}function Tr(){let e=[],t=[],a=[];return d.forEach(o=>{e[o.depth]=Math.max(e[o.depth]||0,o._h),t[o.depth]=Math.max(t[o.depth]||0,o._w),a[o.depth]=(a[o.depth]||0)+1}),{maxH:e,maxW:t,count:a,maxDepth:e.length-1}}function an(e){e.x!==null&&!isNaN(e.x)&&(e.cx=e.x+e._w/2),e.y!==null&&!isNaN(e.y)&&(e.cy=e.y+e._h/2)}function Mr(){let{maxH:e,maxDepth:t}=Tr(),a=[0];for(let l=1;l<=t;l++)a[l]=a[l-1]+e[l-1]+hr;let o=pr-Ie,n=[],r=(l,c)=>{let f=d.get(l);f.cx+=c,f.children.forEach(_=>r(_,c))},i=l=>{let c=d.get(l);n[c.depth]=Math.max(n[c.depth]??-1/0,c.cx+c._w/2),c.children.forEach(i)};function s(l){let c=d.get(l),f=n[c.depth]!==void 0?n[c.depth]+o:-1/0;c.children.length?(c.children.forEach(s),c.cx=(d.get(c.children[0]).cx+d.get(c.children[c.children.length-1]).cx)/2,c.cx-c._w/2<f&&r(l,f-(c.cx-c._w/2))):c.cx=(f===-1/0?0:f)+c._w/2,i(l)}ce.forEach(s),d.forEach(l=>{l.cy=a[l.depth]+l._h/2,an(l)})}function Or(e){let t=Math.PI*2/e,a=32,o=[],n=(s,l)=>Math.abs(s.cx-l.cx)<(s._w+l._w)/2+a&&Math.abs(s.cy-l.cy)<(s._h+l._h)/2+a,r=Math.max(0,...[...d.values()].map(s=>s.depth)),i=0;for(let s=0;s<=r;s++){let l=[...d.values()].filter(f=>f.depth===s);if(!l.length)continue;let c=s===0?ce.length>1?mr*.5:0:i+ur;for(let f=0;f<400&&(l.forEach(O=>{let y=(O._slot+.5)*t-Math.PI/2;O.cx=c*Math.cos(y),O.cy=c*Math.sin(y),an(O)}),!!l.some((O,y)=>l.some((S,g)=>g>y&&n(O,S))||o.some(S=>n(O,S))));f++)c=c*1.02+10;i=c,o.push(...l)}}function Ar(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),a=[];for(;t.nextNode();)a.push(t.currentNode);a.forEach(o=>{let n=o.data.match(/^\s*\.element:\s*([\s\S]*)$/);if(!n)return;let r=o.previousSibling;for(;r&&r.nodeType===3&&!r.data.trim();)r=r.previousSibling;let i=r&&r.nodeType===1?r:o.parentElement;i&&Object.entries(He(n[1])).forEach(([s,l])=>{s==="class"?i.classList.add(...l.split(/\s+/).filter(Boolean)):s==="style"?i.style.cssText+=";"+l:i.setAttribute(s,l)})})}function na(e){let t=document.createElement("figure");t.className="media",e.replaceWith(t),t.appendChild(e);let a=e.getAttribute("alt");return a&&t.insertAdjacentHTML("beforeend","<figcaption>"+T(a)+"</figcaption>"),t}function Br(e,t){let a=document.createElement("figure");return a.className="media yt fragment yt-play"+(e.portrait?" portrait":""),a.innerHTML='<div class="frame"><iframe src="'+So(e)+'" title="'+T(t||"YouTube video")+'" allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen loading="lazy"></iframe></div>'+(t?"<figcaption>"+T(t)+"</figcaption>":""),a}function Po(e,t){let a=t<=4?t:t<=6?3:4;e.style.setProperty("--cols",a),e.style.setProperty("--rows",Math.ceil(t/a))}function zr(e,t){t.querySelectorAll("pre > code.language-svg").forEach(r=>{let i=document.createElement("img");i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(r.textContent.trim()),i.alt="";let s=document.createElement("p");s.appendChild(i),r.parentElement.replaceWith(s)}),t.querySelectorAll(":scope > p").forEach(r=>{let i=r.children.length===1?r.children[0]:null;if(!i)return;let s=i.tagName==="A"&&r.textContent.trim()===i.textContent.trim()?i.getAttribute("href"):i.tagName==="IMG"?i.getAttribute("src"):null,l=s&&ko(s);l&&r.replaceWith(Br(l,i.tagName==="IMG"?i.getAttribute("alt"):""))}),t.querySelectorAll(":scope > ul, :scope > ol").forEach(r=>{let i=[...r.children];!i.length||!i.every(s=>s.querySelector("img")&&!s.textContent.trim())||(r.classList.add("gallery"),i.forEach(s=>{let l=s.querySelector("img");s.innerHTML="",s.appendChild(l),na(l)}),i.length>1&&i.every(s=>s.classList.contains("fragment"))?(r.classList.add("carousel"),i[0].classList.remove("fragment","fade-up"),i.forEach((s,l)=>{s.classList.replace("fade-up","current-visible");let c=s.querySelector("figcaption");c&&(c.dataset.count=l+1+" / "+i.length)})):Po(r,i.length))}),t.querySelectorAll(":scope > p").forEach(r=>{if(!Ir(r))return;let i=[...r.querySelectorAll("img")];if(i.length===1){r.replaceWith(i[0]),na(i[0]);return}let s=document.createElement("div");s.className="gallery grid",r.replaceWith(s),i.forEach(l=>{s.appendChild(l),na(l)}),Po(s,i.length)});let a=[...t.children].filter(r=>!/^H[1-6]$/.test(r.tagName)&&!(r.nodeType===1&&r.tagName==="HR")),o=a.filter(r=>r.matches("figure.media"));o.length===1&&a.length===1&&e.classList.add("card-media"),a.length===1&&(a[0].matches("figure.media:not(.yt)")||a[0].matches(".gallery.carousel"))&&e.classList.add("card-bleed");let n=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT);for(;n.nextNode();)if(/^\s*view\s*:\s*full\s*$/i.test(n.currentNode.data))e.classList.add("card-full");else if(o.length===1){e.classList.add("card-split",a.indexOf(o[0])===0?"media-first":"media-last");let r=document.createElement("div");r.className="split-text",a.filter(i=>i!==o[0]).forEach(i=>r.appendChild(i)),o[0].after(r),a.indexOf(o[0])!==0&&r.after(o[0])}t.querySelector(".gallery")&&e.classList.add("card-gallery")}function on(e,t){let a=e.querySelector("iframe");a&&a.contentWindow&&a.contentWindow.postMessage(JSON.stringify({event:"command",func:t,args:[]}),"*")}function Pr(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),a=[];for(;t.nextNode();)/^\s*steps\s*$/i.test(t.currentNode.data)&&a.push(t.currentNode);a.forEach(o=>{let n=o.nextSibling;for(;n&&n.nodeType!==1;)n=n.nextSibling;n&&/^(UL|OL)$/.test(n.tagName)&&n.querySelectorAll(":scope > li").forEach(r=>r.classList.add("fragment","fade-up"))})}function Rr(e){let t=[...e.querySelectorAll(".fragment")].map((n,r)=>({e:n,i:r,k:n.dataset.fragmentIndex}));if(t.every(n=>n.k===void 0))return t.map(n=>[n.e]);let a=0;t.forEach(n=>{n.k=n.k===void 0?a:parseFloat(n.k),a=Math.max(a,n.k)+1}),t.sort((n,r)=>n.k-r.k||n.i-r.i);let o=[];return t.forEach((n,r)=>{r&&t[r-1].k===n.k?o[o.length-1].push(n.e):o.push([n.e])}),o}function Sa(e,t,a){!e||!e.frags||(a&&e.el.classList.add("snap"),e.frags.forEach((o,n)=>o.forEach(r=>{let i=r.classList.contains("visible");r.classList.toggle("visible",n<t),r.classList.toggle("current-fragment",n===t-1),r.classList.contains("yt-play")&&i!==n<t&&!a&&on(r,n<t?"playVideo":"pauseVideo")})),a&&(e.el.offsetWidth,e.el.classList.remove("snap")))}function Dr(){try{return w.base?new URL(w.base,ae||location.href):ae?new URL(ae):null}catch{return null}}function jr(e){let t=Dr(),a=0;return e.querySelectorAll("img[src], source[src], video[src], iframe[src], a[href]").forEach(o=>{let n=o.hasAttribute("src")?"src":"href",r=o.getAttribute(n);if(!r||/^(#|[a-z][a-z0-9+.-]*:|\/\/)/i.test(r))return;if(!t){n==="src"&&a++;return}let i=t;try{w.site&&(i=new URL(w.site,t))}catch{}o.setAttribute(n,new URL(r,r.startsWith("/")?i:t).href)}),a}function jt(e){let t=e.el,a=t.querySelector(".body");t.classList.add("measuring"),a.style.zoom="";let o=Ie;e.visual=!!a.querySelector("iframe, .echarts-container, pre > code.language-dot, pre > code.language-d2, pre > code.language-echarts, .diagram, figure.media"),e.visual&&(o=J);let n=t.classList.contains("card-full");if(t.classList.remove("img-portrait","img-landscape","img-overlay"),n&&(o=J),t.classList.contains("card-bleed")){let s=Math.max(0,...[...a.querySelectorAll("img")].map(c=>c.naturalWidth&&c.naturalHeight?c.naturalWidth/c.naturalHeight:0))||1.7777777777777777,l=J-wt*s>=260;if(n&&l)t.classList.add("img-portrait"),t.style.setProperty("--img-w",Math.round(wt*s)+"px"),o=J;else if(n||Math.abs(s-16/9)<.08)t.classList.add("img-overlay"),o=J;else if(s<1.3){let c=Math.min(Math.round(wt*s),J-300);t.classList.add("img-portrait"),t.style.setProperty("--img-w",c+"px"),o=Math.min(J,Math.max(oa,c*2))}else t.classList.add("img-landscape"),o=Math.round(Math.max(Ie,Math.min(J,(wt-dr)*s))),t.style.setProperty("--img-h",Math.round(o/s)+"px")}else(a.querySelector('[style*="flex"], [style*="grid"], .r-hstack')||a.querySelectorAll("img").length>=4)&&(o=oa);let r=a.querySelectorAll("table");if(r.length){t.style.width=J+"px";let s=t.offsetWidth-a.clientWidth;r.forEach(l=>{o=Math.max(o,Math.min(oa,Math.ceil(l.offsetWidth)+s+12))})}let i=a.querySelectorAll(".fragment.grow");if(i.length){t.style.width=o+"px";let s=t.offsetWidth-a.clientWidth;i.forEach(l=>{o=Math.max(o,Math.min(J,Math.ceil(l.offsetWidth*1.3)+s))})}t.style.width=o+"px",t.scrollWidth>o+2&&(t.style.width=(o=Math.min(J,t.scrollWidth+24))+"px"),a.scrollWidth>a.clientWidth+2&&(a.style.zoom=(a.clientWidth/a.scrollWidth).toFixed(3)),e._w=o,e._h=t.offsetHeight||da,t.classList.remove("measuring")}function Fr(){clearTimeout(Ro),Ro=setTimeout(()=>{d.forEach(jt),rt(),ne(!0)},200)}function Hr(){let e=Dt()==="light"?"light":"dark",t=Ve(e==="light"?"--accent-ring":"--accent"),a="slidetake-"+e+"-"+t.slice(1);return Do.has(a)||(Ur(a,Wr[e],t),Do.add(a)),a}function Ur(e,t,a){let o={axisLine:{lineStyle:{color:t.line}},axisTick:{lineStyle:{color:t.line}},axisLabel:{color:t.muted},splitLine:{lineStyle:{color:t.split}},nameTextStyle:{color:t.muted}};echarts.registerTheme(e,{color:[a,...t.palette],backgroundColor:"transparent",textStyle:{color:t.text,fontFamily:"'IBM Plex Sans', sans-serif"},title:{textStyle:{color:t.text},subtextStyle:{color:t.muted}},legend:{textStyle:{color:t.text}},tooltip:{backgroundColor:t.tip,borderColor:t.line,textStyle:{color:t.text}},categoryAxis:o,valueAxis:o,logAxis:o,timeAxis:o,line:{symbolSize:6,lineStyle:{width:2.5}},pie:{label:{color:t.text,textBorderWidth:0},labelLine:{lineStyle:{color:t.muted}}},funnel:{label:{color:t.text,textBorderWidth:0}}})}function Gr(){let e=Dt()==="light"?"light":"dark",t=Ve("--node-bg"),a=Ve(e==="dark"?"--accent":"--accent-line"),o=e==="dark"?[.58,.38,.25,.18,.12]:[.7,.45,.25,.15,.08],n={...Yr[e],N7:t,B1:Ve("--accent")};return o.forEach((r,i)=>{n["B"+(i+2)]=xr(a,t,r)}),n}function ha(e){return ra[e]||(ra[e]=new Promise((t,a)=>{let o=document.createElement("script");o.src=e,o.onload=t,o.onerror=()=>{delete ra[e],a(new Error("could not load "+e))},document.head.appendChild(o)}))}async function Vr(){let e=we,t=[...q.querySelectorAll(".node pre > code.language-dot")];q.querySelectorAll(".node pre > code.language-echarts").forEach(r=>{let i=document.createElement("div");i.className="echarts-container",i.dataset.chart=r.textContent,r.parentElement.replaceWith(i)});let a=[...q.querySelectorAll(".node .echarts-container[data-chart]")],o=[...q.querySelectorAll(".node pre > code.language-d2")];if(!t.length&&!a.length&&!o.length)return;let n=[];if(t.length)try{if(await ha(Nr),ia=ia||await Viz.instance(),e!==we)return;t.forEach(r=>{let i=document.createElement("div");i.className="diagram";try{i.appendChild(ia.renderSVGElement(r.textContent))}catch(s){i.className="diagram err",i.textContent="Diagram error: "+s.message}r.parentElement.replaceWith(i)})}catch{n.push("diagrams")}if(o.length)try{if(!xt){let i=await import(qr);xt=new i.D2}if(e!==we)return;let r=Gr();for(let i of o){let s=document.createElement("div");s.className="diagram d2";try{let l=await xt.compile(Kr(i.textContent));s.innerHTML=await xt.render(l.diagram,{...l.renderOptions||{},themeOverrides:r,darkThemeOverrides:r})}catch(l){s.className="diagram err",s.textContent="Diagram error: "+(l.message||l)}if(e!==we)return;i.parentElement.replaceWith(s)}}catch{n.push("D2 diagrams")}if(a.length)try{if(await ha(_r),e!==we)return;let r=Hr();a.forEach(i=>{let s;try{s=JSON.parse(i.dataset.chart)}catch{i.textContent="Chart data is not valid JSON.";return}echarts.init(i,r,{renderer:"svg"}).setOption(Object.assign({backgroundColor:"transparent",animation:!Fe},s))})}catch{n.push("charts")}e===we&&(n.length&&(et.textContent="Could not load the "+n.join(" and ")+" renderer (offline?)"),d.forEach(jt),rt(),ne(!0))}function $r(){let e=[];return u.forEach(t=>{let a=at(t),o=e[e.length-1];o&&o.sec===a?o.ids.push(t):e.push({sec:a,ids:[t]})}),e}function Jr(){let a=0,o=0,n=0;$r().forEach((r,i)=>{let s=Math.max(...r.ids.map(f=>d.get(f)._h));i&&(a+=n/2+120+s/2);let l=o,c=o;r.ids.forEach((f,_)=>{let O=d.get(f);_&&(l+=90+O._w/2),O.cx=l,O.cy=a,c=l,l+=O._w/2}),o=c,n=s})}function Xr(){d.forEach(e=>{e.cx=0,e.cy=0})}function nn(){we++,window.echarts&&q.querySelectorAll(".echarts-container").forEach(a=>{let o=echarts.getInstanceByDom(a);o&&o.dispose()}),q.querySelectorAll("div.node").forEach(a=>a.remove());let e=tn(),t=0;d.forEach(a=>{let o=document.createElement("div");o.className="node",o.tabIndex=0,o.dataset.id=a.id;let n=a.parent?Ft(a.id).slice(0,-1).map(i=>d.get(i).title).join(" / "):"";o.innerHTML=(n?'<div class="crumb">'+T(n)+"</div>":"")+'<div class="body">'+a.html+"</div>"+(a.err?'<div class="err-badge">!</div>':"");let r=o.querySelector(".body");Ar(r),Pr(r),zr(o,r),r.querySelectorAll("thead").forEach(i=>{i.textContent.trim()||i.remove()}),t+=jr(r),a.frags=Rr(r),r.querySelectorAll("img").forEach(i=>{i.complete||i.addEventListener("load",Fr,{once:!0})}),o.querySelectorAll("a[href]").forEach(i=>{let s=i.getAttribute("href");if(s.startsWith("#")){let l=decodeURIComponent(s.slice(1));d.has(l)&&(i.classList.add("xlink"),i.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),h.active||P(l)}))}else i.target="_blank",i.rel="noopener",i.addEventListener("click",l=>l.stopPropagation())}),o.addEventListener("click",()=>{h.active||P(a.id)}),o.addEventListener("keydown",i=>{i.key==="Enter"&&i.target===o&&P(a.id)}),q.appendChild(o),a.el=o,Sa(a,a.frags.length)}),t&&!et.textContent&&(et.textContent=t+" image(s) use relative paths: add base: to the deck, or open it with ?src="),d.forEach(jt),rt(e),Vr()}function rt(e){e===void 0&&(e=tn()),z==="radial"?Or(e):z==="path"?Jr():z==="focus"?Xr():Mr(),q.classList.toggle("focus",z==="focus"),d.forEach(t=>{let a=t.el.style;a.setProperty("--cx",t.cx),a.setProperty("--cy",t.cy)}),Qr(),Ne(),Ta()}function Qr(){let e="";if(z==="focus"){aa.innerHTML="";return}if(z==="path"){for(let t=1;t<u.length;t++){let a=d.get(u[t-1]),o=d.get(u[t]);e+='<path data-from="'+a.id+'" data-to="'+o.id+'" d="M '+a.cx+" "+a.cy+" L "+o.cx+" "+o.cy+'"/>'}aa.innerHTML=e;return}d.forEach(t=>{if(!t.parent)return;let a=d.get(t.parent);if(z==="radial")e+='<path data-from="'+a.id+'" data-to="'+t.id+'" d="M '+a.cx+" "+a.cy+" L "+t.cx+" "+t.cy+'"/>';else{let o=a.cy+a._h/2,n=t.cy-t._h/2,r=o+(n-o)/2;e+='<path data-from="'+a.id+'" data-to="'+t.id+'" d="M '+a.cx+" "+o+" L "+a.cx+" "+r+" L "+t.cx+" "+r+" L "+t.cx+" "+n+'"/>'}}),aa.innerHTML=e}function Ft(e){let t=[],a=e;for(;a;)t.unshift(a),a=d.get(a).parent;return t}function Pe(){let e=M.clientWidth,t=M.clientHeight;q.style.transform="translate("+e/2+"px,"+t/2+"px) scale("+E.zoom+") translate("+-E.x+"px,"+-E.y+"px)",un()}function Ea(){Qe&&(Qe.kill(),Qe=null)}function rn(e,t){if(Ea(),t||Fe||!window.gsap){Object.assign(E,e),Pe();return}let a=M.clientWidth,o=Math.hypot(e.x-E.x,e.y-E.y),n=e.zoom,r=gsap.timeline({onUpdate:Pe,onComplete:()=>{Qe=null}}),{zoom:i,...s}=e,l=o*Math.min(E.zoom,n),c=Math.max(.55,Math.min(1.3,.55+l/a*.3));if(r.to(E,{...s,duration:c,ease:"power2.inOut"},0),l>a*1.2){let f=Math.max(.06,Math.min(E.zoom,n,a*.9/(o+Ie)));r.to(E,{zoom:f,duration:c/2,ease:"sine.out"},0).to(E,{zoom:n,duration:c/2,ease:"sine.in"},c/2)}else r.to(E,{zoom:n,duration:c,ease:"power2.inOut"},0);Qe=r}function Zr(){let e=M.getBoundingClientRect(),t=14,a=[];if(!pe.hidden&&pe.offsetWidth){let n=pe.getBoundingClientRect();a.push({x0:n.left-e.left-t,y0:n.top-e.top-t,x1:n.right-e.left+t,y1:n.bottom-e.top+t})}let o=Cr();return o&&a.push({x0:o.x0-t,y0:o.y0-t,x1:o.x1+t,y1:o.y1+t}),a}function ei(){let e=M.clientWidth,t=M.clientHeight,a=[{x0:16,y0:D?20:56,x1:e-16,y1:t-(D?20:74)}];return Zr().forEach(o=>{let n=[];a.forEach(r=>{if(o.x1<=r.x0||o.x0>=r.x1||o.y1<=r.y0||o.y0>=r.y1){n.push(r);return}[{...r,x1:Math.min(r.x1,o.x0)},{...r,x0:Math.max(r.x0,o.x1)},{...r,y1:Math.min(r.y1,o.y0)},{...r,y0:Math.max(r.y0,o.y1)}].forEach(i=>{i.x1-i.x0>80&&i.y1-i.y0>80&&n.push(i)})}),n.length&&(a=n)}),a}function ua(e,t,a){let o=M.clientWidth,n=M.clientHeight,r=null;return ei().forEach(i=>{let s=a*Math.min((i.x1-i.x0)/e,(i.y1-i.y0)/t);(!r||s>r.zoom)&&(r={zoom:s,sx:(i.x0+i.x1)/2-o/2,sy:(i.y0+i.y1)/2-n/2})}),r}function sn(e,t,a,o){return{x:e-a.sx/o,y:t-a.sy/o}}function Ce(e,t){let a=d.get(e);if(!a)return;let o=ua(a._w,a._h,tt),n=at(e),r=u.filter(l=>at(l)===n&&!d.get(l).visual).map(l=>{let c=d.get(l);return ua(c._w,c._h,tt).zoom}).sort((l,c)=>l-c),i=r.length?r[Math.floor((r.length-1)/2)]:o.zoom,s=Math.max(.2,Math.min(5,o.zoom,i));rn(Object.assign(sn(a.cx,a.cy,o,s),{zoom:s}),t)}function it(e){let t=[...d.values()];if(!t.length)return;let a=M.clientWidth,o=M.clientHeight,n=Math.min(...t.map(f=>f.cx-f._w/2)),r=Math.max(...t.map(f=>f.cx+f._w/2)),i=Math.min(...t.map(f=>f.cy-f._h/2)),s=Math.max(...t.map(f=>f.cy+f._h/2)),l=ua(r-n,s-i,.94),c=Math.max(.05,Math.min(1,l.zoom));rn(Object.assign(sn((n+r)/2,(i+s)/2,l,c),{zoom:c}),e)}function ne(e){p&&d.has(p)?Ce(p,e):it(e)}function Ne(){let e=p?Ft(p):[];d.forEach(t=>{let a=t.el;a.classList.toggle("current",t.id===p),a.classList.toggle("active-path",e.includes(t.id))}),q.querySelectorAll("#connectors path").forEach(t=>{let a=z==="path"?!!p&&u.indexOf(t.dataset.to)<=u.indexOf(p):e.includes(t.dataset.from)&&e.includes(t.dataset.to);t.classList.toggle("active",a)}),ni(e),cn()}function ln(){return no(new URLSearchParams(location.search).get("duration")??w.duration)}function ti(){return D&&ln()>0&&(!h.active||/^always$/i.test(w.timer||""))}function Tt(){let e=ti()&&ue.start>0;if(ke.classList.toggle("timed",e),!e){ke.classList.remove("over");return}let a=(h.active&&h.t0?Bt():performance.now()-ue.start)/ln();ke.firstChild.style.width=Math.min(100,a*100)+"%",ke.classList.toggle("over",a>=1)}function ai(){ue.start=performance.now(),clearInterval(ue.timer),ue.timer=setInterval(Tt,1e3),Tt()}function oi(){clearInterval(ue.timer),ue.timer=null,ue.start=0,Tt()}function cn(){let e=D&&u.length>1&&!/^(off|no|false)$/i.test(w.progress||"");if(ke.classList.toggle("show",e),!e)return;Tt();let t=u.indexOf(p),a=0,o=0;u.forEach((n,r)=>{let i=Le(d.get(n)).length;a+=i,r<t?o+=i:r===t&&(o+=Math.min(oe,i-1)+1)}),ke.lastChild.style.width=(a?o/a*100:0)+"%"}function ni(e){Bo.innerHTML=e.map((t,a)=>(a>0?'<span class="sep">\u203A</span>':"")+'<button class="crumb-btn'+(t===p?" here":"")+'" data-id="'+T(t)+'">'+T(d.get(t).title)+"</button>").join(""),Bo.querySelectorAll(".crumb-btn").forEach(t=>t.addEventListener("click",()=>{h.active||P(t.dataset.id)}))}function st(e){let t=d.get(p);t&&(Sa(t,Zo().frag,e),ka(),(L.hidden||!ze||!ze.full)&&si(t),La(t))}function ii(e){return!u.length||e.id!==u[0]&&e.id!==u[u.length-1]||e.el.querySelector("[data-gsap], .title-scramble")?null:[...e.el.querySelector(".body").children].filter(t=>!t.classList.contains("fragment"))}function si(e){if(e._played||!window.gsap||Fe)return;e._played=!0;let t=ii(e);if(t&&t.length){e._auto=t;let[a,...o]=t;/^H[1-3]$/.test(a.tagName)&&!a.children.length?(a.classList.add("auto-scramble"),jo(a)):o.unshift(a),gsap.from(o,{opacity:0,y:24,duration:.7,ease:"power2.out",delay:.5,stagger:.45})}e.el.querySelectorAll("[data-gsap]").forEach(a=>{let o;try{o=JSON.parse(a.dataset.gsap)}catch{return}let n={duration:o.duration??1,delay:o.delay??0,ease:o.ease||"power2.out"};o.to?gsap.fromTo(a,o.from||{},Object.assign({},o.to,n)):o.from&&gsap.from(a,Object.assign({},o.from,n))}),e.el.querySelectorAll(".title-scramble").forEach(jo)}function Ca(e){!e||!e._played||(e._played=!1,window.gsap&&(e._auto&&(e._auto.forEach(t=>{gsap.killTweensOf(t),gsap.set(t,{clearProps:"opacity,transform"})}),e._auto=null),e.el.querySelectorAll("[data-gsap]").forEach(t=>{gsap.killTweensOf(t);let a={};try{a=JSON.parse(t.dataset.gsap)}catch{}let o=new Set(Object.keys(Object.assign({},a.from,a.to)).map(n=>ri.includes(n)?"transform":n));o.size&&gsap.set(t,{clearProps:[...o].join(",")})}),e.el.querySelectorAll(".title-scramble, .auto-scramble").forEach(t=>{t._scramble&&t._scramble.kill(),t.dataset.text&&(t.textContent=t.dataset.text)})))}function jo(e){let t=e.dataset.text||(e.dataset.text=e.textContent),a=Array.from(t),o="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#%&*+=?",n={p:0};e._scramble=gsap.to(n,{p:1,duration:1.4,ease:"none",onUpdate(){let r=Math.floor(n.p*a.length);e.textContent=a.map((i,s)=>s<r||/\s/.test(i)?i:o[Math.random()*o.length|0]).join("")},onComplete(){e.textContent=t}})}function La(e){clearTimeout(Re),!(!D||!e||!e.autoslide||h.active&&(!h.t0||h.paused))&&(Re=setTimeout(()=>{p===e.id&&De(1)},e.autoslide))}function dn(e){let t=e&&e!==u[0]?e:"";try{b&&b.kind==="share"?history.replaceState(null,"",location.pathname+location.search+Zt(b.data,t)):history.replaceState(null,"",e?"#"+encodeURIComponent(e):location.pathname+location.search)}catch{}}function P(e,t,a){if(!d.has(e))return;if(e!==p){te=null,he=-1,oe=a?Le(d.get(e)).length-1:0;let r=d.get(p);r&&z==="focus"&&!t&&(r.el.classList.add("leaving"),setTimeout(()=>r.el.classList.remove("leaving"),600)),pn()}let o=e!==p;if(p=e,clearTimeout(ee),ee=null,o&&z==="focus"&&!t&&!Fe){let r=d.get(e).el;r.classList.add("entering"),r.offsetWidth,r.classList.remove("entering")}st(o),o&&za("slide",e);let n=d.get(e);o&&n.mapFirst&&!a&&!t&&z!=="focus"?(it(),ee=setTimeout(()=>{ee=null,p===e&&Ce(e)},1900)):Ce(e,t),Ne(),Ta(),dn(e)}function pn(){let e=d.get(p);e&&(e.el.querySelectorAll("figure.yt").forEach(t=>on(t,"pauseVideo")),Sa(e,e.frags.length,!0),Ca(e))}function li(){if(!p&&Se&&d.has(Se)){hn();return}p&&(Se=p),z==="focus"&&Nt("path"),pn(),clearTimeout(Re),p=null,Ne(),Ta(),it(),dn(null)}function hn(){if(ee)return clearTimeout(ee),ee=null,Ce(p),!0;if(!p&&Se&&d.has(Se)){let e=Se;return Se=null,P(e),!0}return!1}function De(e){if(!p){u.length&&P(u[e>0?0:u.length-1]);return}if(ee&&e>0){clearTimeout(ee),ee=null,Ce(p);return}let t=Le(d.get(p)),a=Math.min(oe,t.length-1)+e;if(a>=0&&a<t.length){oe=a,te=null,he=-1,st(),!Y&&!L.hidden&&ze.used?dt():ne(),Ne();return}let o=u.indexOf(p)+e;o>=0&&o<u.length&&P(u[o],!1,e<0)}function ci(){let e=d.get(p);e&&e.parent&&P(e.parent)}function di(){let e=d.get(p);e&&e.children.length?P(e.children[0]):!p&&u.length&&P(u[0])}function Ta(){let e=[...d.values()];if(!e.length){ca.innerHTML="",se=null;return}cr.textContent="map";let t=g=>g.cx,a=g=>g.cy,o=Math.min(...e.map(t))-Ie/2,n=Math.max(...e.map(t))+Ie/2,r=Math.min(...e.map(a))-da/2,i=Math.max(...e.map(a))+da/2,s=16,l=180,c=130,f=Math.min((l-2*s)/Math.max(1,n-o),(c-2*s-6)/Math.max(1,i-r)),_=l/2-(o+n)/2*f,O=c/2+5-(r+i)/2*f,y=p?Ft(p):[],S="";e.forEach(g=>{if(!g.parent)return;let B=d.get(g.parent);S+='<line x1="'+(t(B)*f+_)+'" y1="'+(a(B)*f+O)+'" x2="'+(t(g)*f+_)+'" y2="'+(a(g)*f+O)+'" stroke="var(--panel-line)" stroke-width="1"/>'}),e.forEach(g=>{let B=g.id===p?"var(--accent)":y.includes(g.id)?"var(--accent-teal)":"var(--node-border)";S+='<circle data-id="'+T(g.id)+'" cx="'+(t(g)*f+_)+'" cy="'+(a(g)*f+O)+'" r="'+(g.id===p?4:3)+'" fill="'+B+'"><title>'+T(g.title)+"</title></circle>"}),S+='<rect id="mm-viewport" fill="none" stroke="var(--accent)" stroke-width="1" opacity="0.7"/>',ca.innerHTML=S,se={s:f,ox:_,oy:O},un()}function un(){let e=document.getElementById("mm-viewport");if(!e||!se)return;let t=M.clientWidth/E.zoom,a=M.clientHeight/E.zoom;e.setAttribute("x",(E.x-t/2)*se.s+se.ox),e.setAttribute("y",(E.y-a/2)*se.s+se.oy),e.setAttribute("width",Math.max(2,t*se.s)),e.setAttribute("height",Math.max(2,a*se.s))}function je(e){en(U.value),p&&!d.has(p)&&(p=null),nn(),p?P(p,e):u.length?P(u[0],e):(p=null,it(!0))}function Nt(e,t){z=e,Z("slidetake:layout",e),document.querySelectorAll("#layout-toggle .seg-btn").forEach(a=>a.classList.toggle("active",a.dataset.mode===e)),d.size&&(!t&&!Fe&&(q.classList.add("morph"),setTimeout(()=>q.classList.remove("morph"),700)),rt(),Pe(),p?Ce(p,t):it(t))}function mn(e){return Math.max(.04,Math.min(5,e))}function pi(e){tt=Math.round(Math.max(fr,Math.min(gr,e))*100)/100,Z("slidetake:slideSize",tt),p&&Ce(p)}function Fo(e){p?pi(tt+e*.1):fn(e>0?1.2:1/1.2)}function fn(e,t,a){Ea();let o=mn(E.zoom*e);if(t!==void 0){let n=M.getBoundingClientRect(),r=t-n.left-n.width/2,i=a-n.top-n.height/2;E.x+=r/E.zoom-r/o,E.y+=i/E.zoom-i/o}E.zoom=o,Pe()}function _t(){A||(ge.classList.toggle("collapsed"),document.getElementById("btn-edit-toggle").classList.toggle("active",!ge.classList.contains("collapsed")))}function be(e){D=e,document.body.classList.toggle("presenting",e),Rn();let t=document.documentElement;e&&t.requestFullscreen&&!document.fullscreenElement&&t.requestFullscreen().catch(()=>{}),!e&&document.fullscreenElement&&document.exitFullscreen&&document.exitFullscreen().catch(()=>{}),e&&!p&&u.length&&P(u[0]);let a=w.camera||[...d.values()].some(o=>o.camera);e&&a&&!Y&&!G&&dt(),e?La(d.get(p)):clearTimeout(Re),e?ai():oi(),cn()}function Bt(){return(h.paused?h.pauseAt:performance.now())-h.t0-h.pausedMs}function lt(e){e.classList.add("open")}function bi(e){if(Z("slidetake:analytics",e?"on":"off"),!e){window["ga-disable-"+fi]=!0;let t=["","; Domain="+location.hostname,"; Domain=."+location.hostname.replace(/^www\./,"")];document.cookie.split(";").map(a=>a.split("=")[0].trim()).filter(a=>a==="_ga"||a.startsWith("_ga_")).forEach(a=>t.forEach(o=>{document.cookie=a+"=; Max-Age=0; Path=/"+o}))}yn()}function yn(){Aa.querySelectorAll("[data-analytics]").forEach(e=>e.setAttribute("aria-checked",String(e.dataset.analytics==="on"===gi())))}function Ba(){document.querySelectorAll(".modal.open").forEach(e=>e.classList.remove("open"))}function yi(){let e=new URLSearchParams(location.search).get("obs");if(e){let[t,a,...o]=e.split(":");return Mt.value=t||"localhost",Ot.value=a||"4455",At.value=o.join(":"),!0}try{let t=JSON.parse(Q("slidetake:obs")||"null");t&&(Mt.value=t.host||"localhost",Ot.value=t.port||"4455",At.value=t.password||"",Ma.checked=!0)}catch{}return!1}function wn(){if(Ma.checked)Z("slidetake:obs",JSON.stringify({host:Mt.value.trim(),port:Ot.value.trim(),password:At.value}));else try{localStorage.removeItem("slidetake:obs")}catch{}}function Ke(e,t){Uo.textContent=e,Uo.className=t||""}function wi(e){return location.protocol==="https:"&&!vi(e)}async function xn(){let e=Mt.value.trim()||"localhost",t="ws://"+e+":"+(Ot.value.trim()||"4455");if(wi(e)){xe=!1,Ze.disabled=!0,Ke(xi,"err");return}Ke("Connecting to "+t+"\u2026");try{await ha(hi);let a=window.OBSWebSocket&&(window.OBSWebSocket.default||window.OBSWebSocket);if(H)try{await H.disconnect()}catch{}H=new a,H.on("ConnectionClosed",()=>{xe=!1,Ke("Disconnected from OBS","err"),Ze.disabled=!0}),H.on("RecordStateChanged",n=>{n.outputState==="OBS_WEBSOCKET_OUTPUT_STARTED"&&Ee&&(Ee(),Ee=null),n.outputState==="OBS_WEBSOCKET_OUTPUT_STOPPED"&&h.active&&h.withObs&&!h.finishing&&Wt("Stopped in OBS")});let o=await H.connect(t,At.value||void 0);xe=!0;try{let n=await H.call("GetVideoSettings");n&&n.fpsNumerator&&n.fpsDenominator&&(gn=n.fpsNumerator/n.fpsDenominator)}catch{}Ke("Connected"+(o&&o.obsWebSocketVersion?" \xB7 OBS WebSocket "+o.obsWebSocketVersion:""),"ok"),wn()}catch(a){xe=!1,Ke("Could not connect ("+(a&&a.message||a)+"). Is OBS running with its WebSocket server on, and is the password right?","err")}Ze.disabled=!xe}function ki(){let e=document.getElementById("rec-screen"),t=screen.width,a=screen.height;if(Math.abs(t/a-16/9)<.02){e.innerHTML='<span class="ok">This screen is 16:9 ('+t+"\xD7"+a+"), right for YouTube.</span>";return}let o=[["16:10",1.6],["3:2",1.5],["4:3",4/3],["21:9",21/9],["16:9",16/9]],[n,r]=o.reduce((s,l)=>Math.abs(l[1]-t/a)<Math.abs(s[1]-t/a)?l:s),i=Math.abs(r-t/a)<.005?n:"about "+n;e.innerHTML='<span class="warn">This screen is '+i+" ("+t+"\xD7"+a+"), not 16:9, so the video will have bars or be cropped. Move this window to a 16:9 screen, physical or virtual (say 1920\xD71080), then press F there.</span>"}function fa(){if(!nt)return;let e=u.reduce((a,o)=>a+Le(d.get(o)).length,0),t=w.camera||[...d.values()].some(a=>a.camera);document.getElementById("rec-deck-info").innerHTML=T(w.title||(ce[0]?d.get(ce[0]).title:"This deck"))+" \xB7 "+u.length+" slides \xB7 "+e+" presses"+(t&&G?'<br><span class="warn">The camera is off. Press C first if this take should include your webcam.</span>':""),Ze.disabled=!xe,Ti(),ki(),lt(ui)}async function kn(e){if(h.active||!u.length)return;Ba(),Object.assign(h,{active:!0,withObs:e,counting:!0,paused:!1,finishing:!1,t0:0,pausedMs:0,events:[],outputPath:null}),document.body.classList.add("recording"),Ra();let t=document.getElementById("rec-layout").value;t!=="current"&&t!==z&&Nt(t,!0),D||be(!0),p===u[0]&&(oe=0,te=null,he=-1),P(u[0],!0);for(let o=3;o>0;o--)if(St.querySelector(".num").textContent=o,St.classList.add("show"),await Oa(1e3),!h.active)return;if(St.classList.remove("show"),await bn(),e){let o=new Promise(n=>{Ee=n,setTimeout(()=>{Ee&&(Ee(),Ee=null)},2500)});try{await H.call("StartRecord")}catch(n){Ia("OBS could not start recording: "+(n&&n.message||n));return}if(await o,!h.active)return}h.counting=!1,h.t0=performance.now();let a=d.get(p);Ca(a),st(!0),za("slide",p)}function Ia(e){h.active=!1,h.counting=!1,St.classList.remove("show"),document.body.classList.remove("recording"),D&&be(!1),Ae(e)}function za(e,t){if(!h.active||!h.t0||h.finishing)return;let a=d.get(t),o={id:t,title:a?a.title:t,retake:e==="retake",t:Math.round(Bt()),obsT:null};h.events.push(o),h.withObs&&xe&&(H.call("GetRecordStatus").then(n=>{n&&typeof n.outputDuration=="number"&&(o.obsT=n.outputDuration)}).catch(()=>{}),a&&H.call("CreateRecordChapter",{chapterName:(o.retake?"RETAKE \xB7 ":"")+a.title}).catch(()=>{}))}function Si(e){let t=e.key;if((_o.includes(t)||Wo.includes(t)||Ho.includes(t)||t==="Escape")&&e.preventDefault(),t==="Escape"){h.counting?Ia("Take cancelled"):Wt("Stopped early");return}if(!(h.counting||h.finishing)){if(Ho.includes(t)){Li();return}h.paused||(_o.includes(t)?Ei():Wo.includes(t)&&Ci())}}function Ei(){let e=Le(d.get(p));Math.min(oe,e.length-1)>=e.length-1&&u.indexOf(p)===u.length-1?Wt():De(1)}function Ci(){let e=d.get(p);e&&(za("retake",p),oe=0,te=null,he=-1,Ca(e),st(!0),!Y&&!L.hidden&&ze.used?dt():ne(),Ne())}async function Li(){h.t0&&(h.paused?(ma.classList.remove("show"),await bn(),h.withObs&&await H.call("ResumeRecord").catch(()=>{}),h.pausedMs+=performance.now()-h.pauseAt,h.paused=!1,La(d.get(p))):(h.paused=!0,h.pauseAt=performance.now(),clearTimeout(Re),h.withObs&&await H.call("PauseRecord").catch(()=>{}),ma.classList.add("show")))}async function Wt(e){if(!h.active||h.finishing)return;if(h.counting){Ia("Take cancelled");return}h.finishing=!0,clearTimeout(Re),h.paused&&(h.pausedMs+=performance.now()-h.pauseAt,h.paused=!1,ma.classList.remove("show"));let t=Math.round(Bt()),a=null;if(h.withObs){await Oa(1200),t=Math.round(Bt());try{let n=await H.call("GetRecordStatus");n&&typeof n.outputDuration=="number"&&(a=n.outputDuration)}catch{}try{let n=await H.call("StopRecord");h.outputPath=n&&n.outputPath}catch(n){e=(e?e+". ":"")+"OBS did not confirm the stop ("+(n&&n.message||n)+")"}}h.active=!1,h.finishing=!1,document.body.classList.remove("recording"),D&&be(!1);let o={key:Ht(),deckTitle:w.title||d.get(u[0]).title,date:new Date().toISOString(),withObs:h.withObs,outputPath:h.outputPath,reason:e||"",total:t,totalObs:a,fps:gn,events:h.events.map(n=>({id:n.id,title:n.title,retake:n.retake,t:n.t,obsT:n.obsT})),picks:{}};Pa(o),On(o)}function Ht(){return Te(w.title||(u[0]?d.get(u[0]).title:"deck"))}function Sn(){try{return JSON.parse(Q("slidetake:sessions")||"[]")}catch{return[]}}function Pa(e){let t=Sn().filter(a=>a.date!==e.date);t.unshift(e),Z("slidetake:sessions",JSON.stringify(t.slice(0,12)))}function Ti(){let e=document.getElementById("rec-sessions"),t=Sn().filter(a=>a.key===Ht());e.innerHTML=t.length?"<h3>Earlier takes of this deck</h3>"+t.map((a,o)=>'<div class="row"><button class="btn small" data-session="'+o+'">Review</button><span>'+T(new Date(a.date).toLocaleString())+" \xB7 "+$(a.totalObs??a.total)+(a.withObs?"":" \xB7 rehearsal")+(a.outputPath?" \xB7 "+T(Me(a.outputPath)):"")+"</span></div>").join(""):"",e.querySelectorAll("[data-session]").forEach(a=>a.onclick=()=>{Ba(),On(t[+a.dataset.session])})}function at(e){let t=d.has(e)?Ft(e):[e];return t[Math.min(1,t.length-1)]}function En(e,t){let a=at(e);return{sec:a,title:d.has(a)?d.get(a).title:t}}function Tn(){let e=Object.keys(w).filter(t=>t==="tags"||/_tags$/.test(t)).flatMap(t=>[].concat(w[t])).filter(t=>typeof t=="string");return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function Mi(){return[].concat(w.related||[]).map(e=>{let t=String(e).match(/^\[([^\]]+)\]\(([^)]+)\)$/),a=String(e).split("|");return t?t[1]+": "+t[2]:a.length===2?a[0].trim()+": "+a[1].trim():String(e)})}function Oi(){if(w.permalink||w.url)return w.permalink||w.url;let e=w.site||Q("slidetake:site");if(!e||!ae)return"";try{let t=new URL(ae).pathname.replace(/\/index\.md$/i,"/").replace(/\.md$/i,"/");return new URL(t,e).href}catch{return""}}function Mn(e){let t=Cn(e),a=document.getElementById("rv-link").value.trim(),o=Mi(),n=Tn(),r=[];w.summary&&r.push(w.summary),a&&r.push("\u{1F4D1} Slides: "+a),t.lines.length>=3&&r.push(`Chapters
620
854
  `+t.lines.join(`
621
855
  `)),o.length&&r.push(`Related
622
856
  `+o.map(i=>"\u2022 "+i).join(`
623
- `)),a.length&&r.push(a.slice(0,3).map(i=>"#"+i.replace(/[^\p{L}\p{N}]+/gu,"")).join(" ")),document.getElementById("rv-yt-desc").value=r.join(`
857
+ `)),n.length&&r.push(n.slice(0,3).map(i=>"#"+i.replace(/[^\p{L}\p{N}]+/gu,"")).join(" ")),document.getElementById("rv-yt-desc").value=r.join(`
624
858
 
625
- `),document.getElementById("rv-chapters-note").textContent=(t.dropped?t.dropped+" section"+(t.dropped>1?"s were":" was")+" under 10 seconds and folded into the chapter before, as YouTube requires. ":"")+(t.lines.length<3?"YouTube needs at least three chapters, so none are listed. ":"")+"Final length "+K(t.length)+"."}function ya(e){_=e,H=null;let t=qe(e),n=e.events.filter(a=>a.retake).length;document.getElementById("rv-title").textContent=(e.withObs?"Review the take \xB7 ":"Rehearsal \xB7 ")+e.deckTitle,document.getElementById("rv-info").textContent=[e.reason,new Date(e.date).toLocaleString(),(e.withObs?"recorded ":"ran ")+K(e.totalObs??e.total),t.size+" slides",n?n+" retake"+(n>1?"s":""):"no retakes",e.outputPath?"saved to "+e.outputPath:e.withObs?"":"nothing was recorded"].filter(Boolean).join(" \xB7 "),document.getElementById("rv-file").textContent=e.outputPath?" ("+Me(e.outputPath)+")":"",document.getElementById("rv-yt-title").value=e.deckTitle;let o=ft(e);Tt.value=[...Tt.options].reduce((a,r)=>Math.abs(r.value-o)<Math.abs(a.value-o)?r:a).value,document.getElementById("rv-yt-tags").value=ga().join(", "),document.getElementById("rv-link").value=ui(),z.src&&he!==Me(e.outputPath)&&e.outputPath&&(z.removeAttribute("src"),z.load(),he=""),document.getElementById("rv-novideo").hidden=!!z.src,Ht(),jt(ei),gi(e)}function Ht(){let e=_,t=document.getElementById("rv-list"),n=null;t.innerHTML=[...qe(e).values()].map(o=>{let a=e.picks[o.id]??o.takes.length,r=et(o.id),i=r!==n;n=r;let s=o.takes.map(l=>'<button class="rv-chip'+(a===l.no?" on":"")+'" data-id="'+C(o.id)+'" data-take="'+l.no+'">'+(o.takes.length>1?"Take "+l.no+" \xB7 ":"")+K(l.end-l.start)+"</button>").join("")+'<button class="rv-chip skip'+(a===0?" on":"")+'" data-id="'+C(o.id)+'" data-take="0">Leave out</button>';return'<div class="rv-row'+(i?" sec":"")+'"><div class="t">'+C(o.title)+"<small>"+K(o.takes[0].start)+'</small></div><div class="rv-chips">'+s+"</div></div>"}).join(""),t.querySelectorAll(".rv-chip").forEach(o=>o.onclick=()=>{e.picks[o.dataset.id]=+o.dataset.take,In(e),Ht();let a=qe(e).get(o.dataset.id),r=a&&a.takes[+o.dataset.take-1];r&&Ot([{start:r.start,end:r.end,title:a.title+(a.takes.length>1?" \xB7 take "+r.no:"")}])}),document.getElementById("rv-ffmpeg").value=fa(e,document.getElementById("rv-mode").value),ba(e)}function Ot(e){if(!z.src){Mt=e,$.textContent=fn?"Opening the recording\u2026 it plays when ready.":"Open the recording to preview.";return}Mt=null,H={ranges:e,i:0},$.textContent="\u25B6 "+e[0].title;let t=()=>{z.currentTime=e[0].start/1e3,z.play().catch(n=>{n&&n.name!=="AbortError"&&($.textContent="Could not play: "+n.message)})};z.readyState>=1?t():z.addEventListener("loadedmetadata",t,{once:!0})}function va(e){return new Promise((t,n)=>{let o=indexedDB.open(e||"slidetake",1);o.onupgradeneeded=()=>o.result.createObjectStore("kv"),o.onsuccess=()=>t(o.result),o.onerror=()=>n(o.error)})}async function hi(e){let t=async n=>{let o=await va(n);return await new Promise(a=>{let r=o.transaction("kv").objectStore("kv").get(e);r.onsuccess=()=>a(r.result),r.onerror=()=>a(null)})};try{return await t()??await t("markcast")??await t("traverse")??null}catch{return null}}async function mi(e,t){try{(await va()).transaction("kv","readwrite").objectStore("kv").put(t,e)}catch{}}async function Ft(e){fn=!0;try{return await fi(e)}finally{fn=!1}}async function fi(e){let t=await e.getFile();for(let n=0;n<10;n++){await new Promise(a=>setTimeout(a,1e3));let o=await e.getFile();if(o.size===t.size&&o.lastModified===t.lastModified)return o;t=o}return t}function rt(e,t,n){z.src&&URL.revokeObjectURL(z.src),Ke=t||null,n||(mn=0),z.src=URL.createObjectURL(e),he=e.name,document.getElementById("rv-novideo").hidden=!0,$.textContent="Loaded "+e.name+". Click a take to preview it.",Mt?Ot(Mt):n&&H&&Ot(H.ranges.slice(H.i)),_&&(document.getElementById("rv-ffmpeg").value=fa(_,document.getElementById("rv-mode").value))}async function gi(e){let t=Me(e.outputPath);if(!(!t||!window.showDirectoryPicker)&&!(he===t&&z.src))try{let n=await hi("obs-folder");if(!n||await n.queryPermission({mode:"read"})!=="granted")return;let o=await n.getFileHandle(t);$.textContent="Opening "+t+"\u2026",rt(await Ft(o),o)}catch{}}function Be(e,t){u.active||(vt.textContent=e,vt.classList.add("show"),clearTimeout(gn),t||(gn=setTimeout(()=>vt.classList.remove("show"),9e3)))}function wa(){clearTimeout(gn),vt.classList.remove("show")}function rn(){let e=!1;try{e=window.top!==window.self}catch{e=!0}return e?" This page is running inside a preview frame that may not allow cameras. Open Slidetake directly in Chrome (from localhost or as a file).":window.isSecureContext?" Allow camera access for this page in the browser\u2019s site settings (the icon at the left of the address bar), then try again.":" Browsers only allow cameras on secure pages. Open it from http://localhost or as a local file in Chrome."}function ka(){U&&U.getTracks().forEach(t=>t.stop()),U=null;let e=I.querySelector("video");e&&e.remove()}async function it(){if(!(U||q)){{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia){Be("Camera not available on this page."+rn());return}if(se.disabled)return;se.disabled=!0,Be("Waiting for camera permission \u2014 check the browser prompt near the address bar.",!0);try{U=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},audio:!1}),wa()}catch(t){let n=t&&t.name;Be(n==="NotAllowedError"||n==="SecurityError"?"Camera access was blocked."+rn():n==="NotFoundError"||n==="OverconstrainedError"?"No camera was found. Check that a webcam is connected.":n==="NotReadableError"?"The camera is busy \u2014 close other apps using it (Zoom, OBS, FaceTime) and try again.":"Could not start the camera"+(n?" ("+n+")":"")+"."+rn());return}finally{se.disabled=!1,zn()}U.getVideoTracks().forEach(t=>t.addEventListener("ended",()=>{ka(),wt(),oe()}));let e=document.createElement("video");e.autoplay=!0,e.muted=!0,e.playsInline=!0,e.srcObject=U,I.appendChild(e)}wt(),oe()}}function zn(){se.querySelector("svg")||(se.innerHTML=bi+'<span class="lbl"> Camera</span>'),se.classList.toggle("on",!q),se.setAttribute("aria-pressed",String(!q)),se.title=q?"Camera is off for every slide (C)":"Camera is on and follows the deck (C)"}function An(e){e&&!tt||(q=!e,q&&ka(),J=null,pe=-1,ne=Math.min(ne,Math.max(0,Ce(d.get(p)).length-1)),zn(),wt(),at(),_e(),oe(),R||Be(e?"Camera on \u2014 slides follow their camera settings.":"Camera off \u2014 camera settings are ignored and slides use the whole screen."),e&&it())}function Sa(){document.body.classList.remove("idle"),clearTimeout(Do),R&&(Do=setTimeout(()=>document.body.classList.add("idle"),2e3))}function Bt(e,t){Ie.textContent=e,Ie.classList.add("show"),clearTimeout(_o),_o=setTimeout(()=>Ie.classList.remove("show"),t||2500)}function bn(e,{keepObs:t=!0,keepEdit:n=!0,slide:o=""}={}){let a=new URL(ro(e),location.origin);return new URLSearchParams(location.search).forEach((r,i)=>{i==="src"||i==="obs"&&!t||i==="edit"&&!n||a.searchParams.set(i,r)}),o&&(a.hash=o),a.href.replace(a.pathname,a.pathname.replace(/%40/g,"@"))}async function vi(e){let t={keepObs:!1,keepEdit:!1,slide:e};if(y.kind==="source")return{link:bn(y.source,t),inside:!1};if(y.kind==="copy"&&ht(k)&&["url","gist","builtin"].includes(k.origin.kind))return{link:bn(k.origin,t),inside:!1};let o=y.kind==="share"?y.data:await so(Q.value),a=new URLSearchParams(location.search);return["src","obs","edit"].forEach(r=>a.delete(r)),{link:location.origin+"/share"+(a.toString()?"?"+a:"")+Xt(o,e),inside:!0}}function xi(){let e=ee("slidetake:draft");if(!e||e===Wt)return null;let t=pt(e,{kind:"file",name:"your earlier draft"},{exported:!0});te("slidetake:copy",JSON.stringify(t));try{localStorage.removeItem("slidetake:draft")}catch{}return t}function st(){te("slidetake:copy",JSON.stringify(k))}function Ne(){if(T)return;let e;if(y.kind==="copy")e='<span class="mine">Your copy of '+C(re(k.origin))+"</span>"+(ut(k)?' <span class="edited">\xB7 edited</span>':"");else{let n=y.kind==="share"?"a shared deck":re(y.source);e='<span class="mine">'+C(n.charAt(0).toUpperCase()+n.slice(1))+'</span> <span class="ro">\xB7 read-only, typing makes your copy</span>'}document.getElementById("doc-state").innerHTML=e,fe.classList.toggle("unsaved",y.kind==="copy"&&ut(k)),document.getElementById("btn-reset").hidden=!(y.kind==="copy"&&!ht(k));let t=document.getElementById("continue");t.hidden=y.kind==="copy"||!k,k&&(t.textContent="Your copy \u2192",t.title="Continue your copy of "+re(k.origin))}function Ea(e){return!k||!ut(k)?!0:confirm("Your copy of "+re(k.origin)+" has edits you haven't saved or shared. Replace it with "+e+"?")}function La(){let e=new URLSearchParams(location.search);return e.delete("src"),e.delete("template"),"/edit"+(e.toString()?"?"+e:"")}function wi(){let e=y.kind==="share"?{kind:"shared"}:y.source;return Ea("a copy of "+re(e))?(k=pt(y.text,e),y={kind:"copy"},history.pushState(null,"",La()+(p&&p!==h[0]?"#"+encodeURIComponent(p):"")),Bt("Editing your own copy of "+re(e)+". The original is unchanged.",4e3),!0):(Q.value=y.text,!1)}function ki(){y={kind:"copy"},history.pushState(null,"",La()),fe.classList.contains("collapsed")&&Dt(),Q.value=k.text,Rt(!0),Ne()}async function Si(e){if(e.kind==="builtin")return xt[e.id]??xt.home;if(e.kind==="gist"){let n=await fetch("https://api.github.com/gists/"+encodeURIComponent(e.id));if(!n.ok)throw new Error(n.status===404?"no such gist":n.status+" "+n.statusText);let o=Object.values((await n.json()).files||{}),a=o.find(r=>r.filename===e.file)||o.find(r=>/\.(md|markdown)$/i.test(r.filename))||o[0];if(!a)throw new Error("the gist has no files");return Z=a.raw_url,a.truncated?await(await fetch(a.raw_url)).text():a.content}let t=await fetch(e.url);if(!t.ok)throw new Error(t.status===404?"not found":t.status+" "+t.statusText);return Z=new URL(e.url,location.href).href,await t.text()}function Fo(){return y={kind:"source",source:{kind:"builtin",id:"home"},text:xt.home},y.text}async function Ei(){if(T)return Z=T.base||location.href,y={kind:"source",source:{kind:"url",url:Z},text:Zn(T.settings||{})+String(T.markdown||"")},y.text;if(Y.page==="edit"){if(k)return y={kind:"copy"},k.text;history.replaceState(null,"","/new"+location.search),Y.page="pick"}if(Y.page==="pick")return jt(document.getElementById("new-dialog")),y={kind:"source",source:{kind:"builtin",id:"template:blank"},text:xt["template:blank"]},y.text;if(Y.page==="share")try{let e=await lo(Y.data);return y={kind:"share",data:Y.data,text:e},e}catch{return Bt("This link's deck is damaged or cut short, so it could not be opened.",6e3),Fo()}try{let e=await Si(Y.source);return y={kind:"source",source:Y.source,text:e},e}catch(e){return Ze.textContent="Could not load the deck ("+e.message+")",Bt("Could not load "+re(Y.source)+": "+e.message,6e3),Fo()}}var T,Wo,tt,je,xt,Q,M,W,Qt,ko,Ka,Ze,sn,Va,fe,gt,Xa,ze,en,V,ln,Ja,Za,Qa,er,tr,nr,Qe,d,h,le,p,A,R,x,q,U,de,I,or,E,Xe,So,ye,Eo,ne,J,pe,Ae,yr,Z,Co,Lr,Cr,Tr,To,Br,bt,Ir,Ar,nn,ve,on,we,ue,$r,Re,X,ke,ie,Oo,an,Oe,Io,Zr,zo,Ao,Po,Qr,ei,yt,un,St,Et,Lt,Cn,Ro,Je,F,xe,Ee,sa,u,Tn,la,ni,ai,he,ma,fa,_,H,z,$,Tt,Mt,Ke,mn,fn,Ve,xa,se,vt,gn,bi,Do,me,jo,Ie,_o,yi,yn,vn,No,It,Y,Ho,y,k,Ca=j(()=>{"use strict";jn();_n();Hn();Wn();qn();Yn();lt();eo();oo();Kt();Jt();uo();fo();wo();T=window.SLIDETAKE||null,Wo=document.querySelector("header .mark .logo").outerHTML;document.documentElement.classList.toggle("embed",!!T);tt=!T||T.recording===!0||new URLSearchParams(location.search).has("obs");document.documentElement.classList.toggle("no-record",!tt);je=window.matchMedia("(prefers-reduced-motion: reduce)").matches,xt={home:Wt,help:Nn,showcase:Gn,"template:blank":Fn,"template:talk":Un,"template:recording":$n},Q=document.getElementById("editor"),M=document.getElementById("stage"),W=document.getElementById("world"),Qt=document.getElementById("connectors"),ko=document.getElementById("breadcrumbs"),Ka=document.getElementById("status-count"),Ze=document.getElementById("status-err"),sn=document.getElementById("mm-svg"),Va=document.getElementById("mm-label"),fe=document.getElementById("editor-pane"),gt=540,Xa=96,ze=440,en=720,V=960,ln=180,Ja=540,Za=100,Qa=110,er=420,tr=.35,nr=1,Qe=parseFloat(ee("slidetake:slideSize"))||.92,d=new Map,h=[],le=[],p=null,A="tree",R=!1,x={},q=!0,U=null,de=document.getElementById("brand"),I=document.getElementById("pip"),or=document.getElementById("stage-wrap"),E={x:0,y:0,zoom:.6},Xe=null;So={accent:"--accent",accentSoft:"--accent-teal",line:"--accent-line",ring:"--accent-ring",header:"--header-bg",headerText:"--header-ink",onAccent:"--on-accent"};ye=null;Eo=new URLSearchParams(location.search).get("mode");ne=0;J=null,pe=-1,Ae=null;yr=e=>e.querySelector("img")&&!e.textContent.trim()&&[...e.children].every(t=>/^(IMG|BR)$/.test(t.tagName));Z=null;Co=null;Lr="https://cdn.jsdelivr.net/npm/@viz-js/viz@3.4.0/lib/viz-standalone.js",Cr="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.5.0/echarts.min.js",Tr={dark:{palette:["#60a5fa","#f472b6","#a78bfa","#fb923c","#facc15","#a1a1aa"],text:"#e4e4e7",muted:"#a1a1aa",line:"#3f3f46",split:"#27272a",tip:"#18181b"},light:{palette:["#2563eb","#db2777","#7c3aed","#ea580c","#ca8a04","#71717a"],text:"#27272a",muted:"#71717a",line:"#d4d4d8",split:"#e4e4e7",tip:"#ffffff"}};To=new Set;Br="https://esm.sh/@terrastruct/d2@0.1.33",bt=null,Ir={dark:{N1:"#e4e4e7",N2:"#a1a1aa",N3:"#a1a1aa",N4:"#323238",N5:"#27272a",N6:"#18181b",N7:"#09090b"},light:{N1:"#27272a",N2:"#71717a",N3:"#71717a",N4:"#e4e4e7",N5:"#e4e4e7",N6:"#f4f4f5",N7:"#ffffff"}};Ar=e=>/d2-config\s*:/.test(e)?e:`vars: {
859
+ `),document.getElementById("rv-chapters-note").textContent=(t.dropped?t.dropped+" section"+(t.dropped>1?"s were":" was")+" under 10 seconds and folded into the chapter before, as YouTube requires. ":"")+(t.lines.length<3?"YouTube needs at least three chapters, so none are listed. ":"")+"Final length "+$(t.length)+"."}function On(e){N=e,W=null;let t=Ye(e),a=e.events.filter(n=>n.retake).length;document.getElementById("rv-title").textContent=(e.withObs?"Review the take \xB7 ":"Rehearsal \xB7 ")+e.deckTitle,document.getElementById("rv-info").textContent=[e.reason,new Date(e.date).toLocaleString(),(e.withObs?"recorded ":"ran ")+$(e.totalObs??e.total),t.size+" slides",a?a+" retake"+(a>1?"s":""):"no retakes",e.outputPath?"saved to "+e.outputPath:e.withObs?"":"nothing was recorded"].filter(Boolean).join(" \xB7 "),document.getElementById("rv-file").textContent=e.outputPath?" ("+Me(e.outputPath)+")":"",document.getElementById("rv-yt-title").value=e.deckTitle;let o=vt(e);It.value=[...It.options].reduce((n,r)=>Math.abs(r.value-o)<Math.abs(n.value-o)?r:n).value,document.getElementById("rv-yt-tags").value=Tn().join(", "),document.getElementById("rv-link").value=Oi(),I.src&&me!==Me(e.outputPath)&&e.outputPath&&(I.removeAttribute("src"),I.load(),me=""),document.getElementById("rv-novideo").hidden=!!I.src,Ut(),lt(mi),zi(e)}function Ut(){let e=N,t=document.getElementById("rv-list"),a=null;t.innerHTML=[...Ye(e).values()].map(o=>{let n=e.picks[o.id]??o.takes.length,r=at(o.id),i=r!==a;a=r;let s=o.takes.map(l=>'<button class="rv-chip'+(n===l.no?" on":"")+'" data-id="'+T(o.id)+'" data-take="'+l.no+'">'+(o.takes.length>1?"Take "+l.no+" \xB7 ":"")+$(l.end-l.start)+"</button>").join("")+'<button class="rv-chip skip'+(n===0?" on":"")+'" data-id="'+T(o.id)+'" data-take="0">Leave out</button>';return'<div class="rv-row'+(i?" sec":"")+'"><div class="t">'+T(o.title)+"<small>"+$(o.takes[0].start)+'</small></div><div class="rv-chips">'+s+"</div></div>"}).join(""),t.querySelectorAll(".rv-chip").forEach(o=>o.onclick=()=>{e.picks[o.dataset.id]=+o.dataset.take,Pa(e),Ut();let n=Ye(e).get(o.dataset.id),r=n&&n.takes[+o.dataset.take-1];r&&Pt([{start:r.start,end:r.end,title:n.title+(n.takes.length>1?" \xB7 take "+r.no:"")}])}),document.getElementById("rv-ffmpeg").value=Ln(e,document.getElementById("rv-mode").value),Mn(e)}function Pt(e){if(!I.src){zt=e,K.textContent=ba?"Opening the recording\u2026 it plays when ready.":"Open the recording to preview.";return}zt=null,W={ranges:e,i:0},K.textContent="\u25B6 "+e[0].title;let t=()=>{I.currentTime=e[0].start/1e3,I.play().catch(a=>{a&&a.name!=="AbortError"&&(K.textContent="Could not play: "+a.message)})};I.readyState>=1?t():I.addEventListener("loadedmetadata",t,{once:!0})}function An(e){return new Promise((t,a)=>{let o=indexedDB.open(e||"slidetake",1);o.onupgradeneeded=()=>o.result.createObjectStore("kv"),o.onsuccess=()=>t(o.result),o.onerror=()=>a(o.error)})}async function Ai(e){let t=async a=>{let o=await An(a);return await new Promise(n=>{let r=o.transaction("kv").objectStore("kv").get(e);r.onsuccess=()=>n(r.result),r.onerror=()=>n(null)})};try{return await t()??await t("markcast")??await t("traverse")??null}catch{return null}}async function Bi(e,t){try{(await An()).transaction("kv","readwrite").objectStore("kv").put(t,e)}catch{}}async function qt(e){ba=!0;try{return await Ii(e)}finally{ba=!1}}async function Ii(e){let t=await e.getFile();for(let a=0;a<10;a++){await new Promise(n=>setTimeout(n,1e3));let o=await e.getFile();if(o.size===t.size&&o.lastModified===t.lastModified)return o;t=o}return t}function ct(e,t,a){I.src&&URL.revokeObjectURL(I.src),$e=t||null,a||(ga=0),I.src=URL.createObjectURL(e),me=e.name,document.getElementById("rv-novideo").hidden=!0,K.textContent="Loaded "+e.name+". Click a take to preview it.",zt?Pt(zt):a&&W&&Pt(W.ranges.slice(W.i)),N&&(document.getElementById("rv-ffmpeg").value=Ln(N,document.getElementById("rv-mode").value))}async function zi(e){let t=Me(e.outputPath);if(!(!t||!window.showDirectoryPicker)&&!(me===t&&I.src))try{let a=await Ai("obs-folder");if(!a||await a.queryPermission({mode:"read"})!=="granted")return;let o=await a.getFileHandle(t);K.textContent="Opening "+t+"\u2026",ct(await qt(o),o)}catch{}}function Ae(e,t){if(!h.active){if(clearTimeout(Et),!L.hidden&&!L.classList.contains("live")){Xe.classList.remove("show"),In.textContent=e,L.classList.add("msg"),t||(Et=setTimeout(zn,9e3));return}Xe.textContent=e,Xe.classList.add("show"),t||(Et=setTimeout(()=>Xe.classList.remove("show"),9e3))}}function zn(){In.textContent="PIP camera",L.classList.remove("msg")}function Ra(){clearTimeout(Et),Xe.classList.remove("show"),zn()}function la(){let e=!1;try{e=window.top!==window.self}catch{e=!0}return e?" This page is running inside a preview frame that may not allow cameras. Open Slidetake directly in Chrome (from localhost or as a file).":window.isSecureContext?" Allow camera access for this page in the browser\u2019s site settings (the icon at the left of the address bar), then try again.":" Browsers only allow cameras on secure pages. Open it from http://localhost or as a local file in Chrome."}function Pn(){Y&&Y.getTracks().forEach(t=>t.stop()),Y=null;let e=L.querySelector("video");e&&e.remove()}async function dt(){if(!(Y||G)){{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia){Ae("Camera not available on this page."+la(),!0);return}if(le.disabled)return;le.disabled=!0,Ae("Waiting for camera permission \u2014 check the browser prompt near the address bar.",!0);try{Y=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},audio:!1}),Ra()}catch(t){let a=t&&t.name;Ae(a==="NotAllowedError"||a==="SecurityError"?"Camera access was blocked."+la():a==="NotFoundError"||a==="OverconstrainedError"?"No camera was found. Check that a webcam is connected.":a==="NotReadableError"?"The camera is busy \u2014 close other apps using it (Zoom, OBS, FaceTime) and try again.":"Could not start the camera"+(a?" ("+a+")":"")+"."+la(),!0);return}finally{le.disabled=!1,Da()}Y.getVideoTracks().forEach(t=>t.addEventListener("ended",()=>{Pn(),Lt(),ne()}));let e=document.createElement("video");e.autoplay=!0,e.muted=!0,e.playsInline=!0,e.srcObject=Y,L.appendChild(e)}Lt(),ne()}}function Da(){le.querySelector("svg")||(le.innerHTML=Pi+'<span class="lbl"> Camera</span>'),le.classList.toggle("on",!G),le.setAttribute("aria-pressed",String(!G)),le.title=G?"Camera is off for every slide (C)":"Camera is on and follows the deck (C)"}function ja(e){e&&!nt||(G=!e,G&&(Pn(),Ra()),te=null,he=-1,oe=Math.min(oe,Math.max(0,Le(d.get(p)).length-1)),Da(),Lt(),st(),Ne(),ne(),D||Ae(e?"Camera on \u2014 slides follow their camera settings.":"Camera off \u2014 camera settings are ignored and slides use the whole screen."),e&&dt())}function Rn(){document.body.classList.remove("idle"),clearTimeout(qo),D&&(qo=setTimeout(()=>document.body.classList.add("idle"),2e3))}function ot(e,t){Be.textContent=e,Be.classList.add("show"),clearTimeout(Go),Go=setTimeout(()=>Be.classList.remove("show"),t||2500)}function ya(e,{keepObs:t=!0,keepEdit:a=!0,slide:o=""}={}){let n=new URL(fo(e),location.origin);return new URLSearchParams(location.search).forEach((r,i)=>{i==="src"||i==="obs"&&!t||i==="edit"&&!a||n.searchParams.set(i,r)}),o&&(n.hash=o),n.href.replace(n.pathname,n.pathname.replace(/%40/g,"@"))}async function Di(e){let t={keepObs:!1,keepEdit:!1,slide:e};if(b.kind==="source")return{link:ya(b.source,t),inside:!1};if(b.kind==="copy"&&bt(k)&&["url","gist","builtin"].includes(k.origin.kind))return{link:ya(k.origin,t),inside:!1};let o=b.kind==="share"?b.data:await bo(U.value),n=new URLSearchParams(location.search);return["src","obs","edit"].forEach(r=>n.delete(r)),{link:location.origin+"/share"+(n.toString()?"?"+n:"")+Zt(o,e),inside:!0}}function ji(){let e=Q("slidetake:draft");if(!e||e===Yt)return null;let t=ft(e,{kind:"file",name:"your earlier draft"},{exported:!0});Z("slidetake:copy",JSON.stringify(t));try{localStorage.removeItem("slidetake:draft")}catch{}return t}function pt(){Z("slidetake:copy",JSON.stringify(k))}function _e(){if(A)return;let e;if(Fa())e='<span class="mine">'+T(X.file)+'</span> <span class="ro">\xB7 on this computer, saved as you type</span>';else if(b.kind==="copy")e='<span class="mine">Your copy of '+T(ie(k.origin))+"</span>"+(gt(k)?' <span class="edited">\xB7 edited</span>':"");else{let a=b.kind==="share"?"a shared deck":ie(b.source);e='<span class="mine">'+T(a.charAt(0).toUpperCase()+a.slice(1))+'</span> <span class="ro">\xB7 read-only, typing makes your copy</span>'}document.getElementById("doc-state").innerHTML=e,ge.classList.toggle("unsaved",b.kind==="copy"&&gt(k)),document.getElementById("btn-reset").hidden=!(b.kind==="copy"&&!bt(k));let t=document.getElementById("continue");t.hidden=b.kind==="copy"||!k,k&&(t.textContent="Your copy \u2192",t.title="Continue your copy of "+ie(k.origin))}function Dn(e){return!k||!gt(k)?!0:confirm("Your copy of "+ie(k.origin)+" has edits you haven't saved or shared. Replace it with "+e+"?")}function jn(){let e=new URLSearchParams(location.search);return e.delete("src"),e.delete("template"),"/edit"+(e.toString()?"?"+e:"")}function Fi(){let e=b.kind==="share"?{kind:"shared"}:b.source;return Dn("a copy of "+ie(e))?(k=ft(b.text,e),b={kind:"copy"},history.pushState(null,"",jn()+(p&&p!==u[0]?"#"+encodeURIComponent(p):"")),ot("Editing your own copy of "+ie(e)+". The original is unchanged.",4e3),!0):(U.value=b.text,!1)}function Ni(){b={kind:"copy"},history.pushState(null,"",jn()),ge.classList.contains("collapsed")&&_t(),U.value=k.text,je(!0),_e()}function Fa(){return!!(X&&b&&b.kind==="source"&&b.source.kind==="url"&&new URL(b.source.url,location.href).pathname===X.deck)}function _i(e){fetch(X.save,{method:"PUT",body:e}).catch(()=>ot("Could not save "+X.file+": is npx slidetake still running?",6e3))}async function Wi(e){if(e.kind==="builtin")return Ct[e.id==="help"?"docs":e.id]??Ct.home;if(e.kind==="gist"){let a=await fetch("https://api.github.com/gists/"+encodeURIComponent(e.id));if(!a.ok)throw new Error(a.status===404?"no such gist":a.status+" "+a.statusText);let o=Object.values((await a.json()).files||{}),n=o.find(r=>r.filename===e.file)||o.find(r=>/\.(md|markdown)$/i.test(r.filename))||o[0];if(!n)throw new Error("the gist has no files");return ae=n.raw_url,n.truncated?await(await fetch(n.raw_url)).text():n.content}let t=await fetch(e.url);if(!t.ok)throw new Error(t.status===404?"not found":t.status+" "+t.statusText);return ae=new URL(e.url,location.href).href,await t.text()}function $o(){return b={kind:"source",source:{kind:"builtin",id:"home"},text:Ct.home},b.text}async function Hi(){if(X&&j.page==="source"&&j.source.kind==="builtin"&&j.source.id==="home"&&location.pathname==="/"&&(j.source={kind:"url",url:X.deck}),A)return ae=A.base||location.href,b={kind:"source",source:{kind:"url",url:ae},text:so(A.settings||{})+String(A.markdown||"")},b.text;if(j.page==="edit"){if(k)return b={kind:"copy"},k.text;history.replaceState(null,"","/new"+location.search),j.page="pick"}if(j.page==="pick")return lt(document.getElementById("new-dialog")),b={kind:"source",source:{kind:"builtin",id:"template:blank"},text:Ct["template:blank"]},b.text;if(j.page==="share")try{let e=await yo(j.data);return b={kind:"share",data:j.data,text:e},e}catch{return ot("This link's deck is damaged or cut short, so it could not be opened.",6e3),$o()}try{let e=await Wi(j.source);return b={kind:"source",source:j.source,text:e},e}catch(e){return et.textContent="Could not load the deck ("+e.message+")",ot("Could not load "+ie(j.source)+": "+e.message,6e3),$o()}}var A,X,Jo,nt,Fe,Ct,U,M,q,aa,Bo,lr,et,ca,cr,ge,wt,dr,Ie,oa,J,da,pr,hr,ur,mr,fr,gr,tt,d,u,ce,p,xa,z,D,w,G,Y,pe,L,br,E,Qe,Io,ve,zo,oe,te,he,ze,Ir,ae,Ro,Nr,_r,Wr,Do,qr,xt,Yr,Kr,ra,we,ia,ke,ue,ri,Re,ee,Se,se,kt,sa,Oe,No,hi,_o,Wo,Ho,ui,mi,St,ma,Mt,Ot,At,Ma,Uo,Ze,H,xe,Ee,gn,h,Oa,bn,fi,Aa,gi,vn,vi,xi,me,Cn,Ln,N,W,I,K,It,zt,$e,ga,ba,Je,Bn,le,Xe,Et,In,Pi,qo,fe,Yo,Be,Go,Ri,va,wa,Ko,Rt,j,Vo,b,k,Fn=R(()=>{"use strict";Ha();Ua();Ya();Ka();$a();Xa();Za();to();ht();co();uo();Xt();ea();xo();Eo();Ao();A=window.SLIDETAKE||null,X=window.SLIDETAKE_LOCAL||null,Jo=document.querySelector("header .mark .logo").outerHTML;document.documentElement.classList.toggle("embed",!!A);nt=!A||A.recording===!0||new URLSearchParams(location.search).has("obs");document.documentElement.classList.toggle("no-record",!nt);Fe=window.matchMedia("(prefers-reduced-motion: reduce)").matches,Ct={home:Yt,docs:qa,features:Ga,privacy:Va,showcase:ao,"template:blank":Ja,"template:talk":Qa,"template:recording":eo},U=document.getElementById("editor"),M=document.getElementById("stage"),q=document.getElementById("world"),aa=document.getElementById("connectors"),Bo=document.getElementById("breadcrumbs"),lr=document.getElementById("status-count"),et=document.getElementById("status-err"),ca=document.getElementById("mm-svg"),cr=document.getElementById("mm-label"),ge=document.getElementById("editor-pane"),wt=540,dr=96,Ie=440,oa=720,J=960,da=180,pr=540,hr=100,ur=110,mr=420,fr=.35,gr=1,tt=parseFloat(Q("slidetake:slideSize"))||.92,d=new Map,u=[],ce=[],p=null,xa=["focus","path","radial","tree"],z="path",D=!1,w={},G=!0,Y=null,pe=document.getElementById("brand"),L=document.getElementById("pip"),br=document.getElementById("stage-wrap"),E={x:0,y:0,zoom:.6},Qe=null;Io={accent:"--accent",accentSoft:"--accent-teal",line:"--accent-line",ring:"--accent-ring",header:"--header-bg",headerText:"--header-ink",onAccent:"--on-accent"};ve=null;zo=new URLSearchParams(location.search).get("mode");oe=0;te=null,he=-1,ze=null;Ir=e=>e.querySelector("img")&&!e.textContent.trim()&&[...e.children].every(t=>/^(IMG|BR)$/.test(t.tagName));ae=null;Ro=null;Nr="https://cdn.jsdelivr.net/npm/@viz-js/viz@3.4.0/lib/viz-standalone.js",_r="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.5.0/echarts.min.js",Wr={dark:{palette:["#60a5fa","#f472b6","#a78bfa","#fb923c","#facc15","#a1a1aa"],text:"#e4e4e7",muted:"#a1a1aa",line:"#3f3f46",split:"#27272a",tip:"#18181b"},light:{palette:["#2563eb","#db2777","#7c3aed","#ea580c","#ca8a04","#71717a"],text:"#27272a",muted:"#71717a",line:"#d4d4d8",split:"#e4e4e7",tip:"#ffffff"}};Do=new Set;qr="https://esm.sh/@terrastruct/d2@0.1.33",xt=null,Yr={dark:{N1:"#e4e4e7",N2:"#a1a1aa",N3:"#a1a1aa",N4:"#323238",N5:"#27272a",N6:"#18181b",N7:"#09090b"},light:{N1:"#27272a",N2:"#71717a",N3:"#71717a",N4:"#e4e4e7",N5:"#e4e4e7",N6:"#f4f4f5",N7:"#ffffff"}};Kr=e=>/d2-config\s*:/.test(e)?e:`vars: {
626
860
  d2-config: {
627
861
  layout-engine: elk
628
862
  }
629
863
  }
630
- `+e,nn={};ve=0,on=null;we=document.getElementById("progress");we.innerHTML="<b></b><i></i>";ue={start:0,timer:null};$r=["x","y","xPercent","yPercent","scale","scaleX","scaleY","rotation","rotate","skewX","skewY"];Re=null;X=null;ke=null;ie=null;sn.addEventListener("click",e=>{let t=e.target.closest("circle");t&&!u.active&&P(t.dataset.id)});Oo=null;Q.addEventListener("input",()=>{y.kind!=="copy"&&!wi()||(k.text=Q.value,Ne(),clearTimeout(Oo),Oo=setTimeout(()=>{st(),Rt(!0)},300))});document.querySelectorAll("#layout-toggle .seg-btn").forEach(e=>{e.addEventListener("click",()=>{e.dataset.mode!==A&&Se(e.dataset.mode)})});(function(){let e=new Map,t=0,n=!1,o=null,a=()=>{let[i,s]=[...e.values()];return Math.hypot(i.x-s.x,i.y-s.y)||1};M.addEventListener("pointerdown",i=>{i.pointerType==="mouse"&&i.button!==0||u.active||i.target.closest("a, pre, code, input, textarea")||(e.set(i.pointerId,{x:i.clientX,y:i.clientY}),t=0,n=!1,e.size===2&&(o={d:a(),zoom:E.zoom}))}),window.addEventListener("pointermove",i=>{let s=e.get(i.pointerId);if(!s)return;let l=i.clientX-s.x,c=i.clientY-s.y;e.set(i.pointerId,{x:i.clientX,y:i.clientY}),t+=Math.abs(l)+Math.abs(c),!n&&t>5&&(n=!0,kn(),M.classList.add("dragging")),n&&(e.size===2&&o?E.zoom=ra(o.zoom*a()/o.d):(E.x-=l/E.zoom,E.y-=c/E.zoom),Pe())});let r=i=>{e.delete(i.pointerId),e.size<2&&(o=null),e.size||M.classList.remove("dragging")};window.addEventListener("pointerup",r),window.addEventListener("pointercancel",r),M.addEventListener("click",i=>{n&&(i.stopPropagation(),i.preventDefault(),n=!1)},!0)})();M.addEventListener("wheel",e=>{e.preventDefault(),!u.active&&ia(Math.exp(-e.deltaY*(e.ctrlKey?.01:.0015)),e.clientX,e.clientY)},{passive:!1});document.getElementById("nav-prev").onclick=()=>De(-1);document.getElementById("nav-next").onclick=()=>De(1);document.getElementById("btn-open").onclick=()=>document.getElementById("file-input").click();document.getElementById("file-input").addEventListener("change",e=>{let t=e.target.files[0];if(!t)return;let n=new FileReader;n.onload=()=>{Ea("a copy of "+t.name)&&(k=pt(String(n.result),{kind:"file",name:t.name},{exported:!0}),st(),Z=null,p=null,ki())},n.readAsText(t),e.target.value=""});document.getElementById("btn-save").onclick=()=>{let e=new Blob([Q.value],{type:"text/markdown"}),t=document.createElement("a");t.href=URL.createObjectURL(e),t.download=(le[0]?Te(d.get(le[0]).title):"deck")+".md",t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),1e3),y.kind==="copy"&&(k.exported=k.text,st(),Ne())};document.getElementById("btn-reset").onclick=()=>{y.kind!=="copy"||ht(k)||confirm("Discard your edits and go back to "+re(k.origin)+" as it was?")&&(k.text=k.originText,st(),Q.value=k.text,p=null,Rt(!0),Ne())};document.getElementById("btn-edit-toggle").onclick=Dt;an=document.querySelector("main"),Oe=document.getElementById("editor-resizer"),Io=parseFloat(ee("slidetake:editorWidth"));Io&&fe.style.setProperty("--editor-w",Io+"px");Oe.addEventListener("pointerdown",e=>{e.preventDefault(),Oe.setPointerCapture(e.pointerId),an.classList.add("resizing");let t=an.getBoundingClientRect().right,n=a=>{let r=Math.round(Math.max(280,Math.min(window.innerWidth*.75,t-a.clientX)));fe.style.setProperty("--editor-w",r+"px")},o=()=>{an.classList.remove("resizing"),Oe.removeEventListener("pointermove",n),te("slidetake:editorWidth",String(fe.getBoundingClientRect().width))};Oe.addEventListener("pointermove",n),Oe.addEventListener("pointerup",o,{once:!0})});Oe.addEventListener("dblclick",()=>{fe.style.removeProperty("--editor-w");try{localStorage.removeItem("slidetake:editorWidth")}catch{}});document.getElementById("btn-mode").onclick=qo;document.getElementById("btn-present").onclick=()=>ge(!R);Zr="https://cdn.jsdelivr.net/npm/obs-websocket-js@5.0.5/dist/obs-ws.min.js",zo=["ArrowRight","PageDown"," ","ArrowDown","Enter"],Ao=["ArrowLeft","PageUp","ArrowUp","r","R"],Po=["b","B","."],Qr=document.getElementById("rec-dialog"),ei=document.getElementById("review"),yt=document.getElementById("rec-countdown"),un=document.getElementById("rec-paused"),St=document.getElementById("obs-host"),Et=document.getElementById("obs-port"),Lt=document.getElementById("obs-pass"),Cn=document.getElementById("obs-remember"),Ro=document.getElementById("obs-status"),Je=document.getElementById("rec-start"),F=null,xe=!1,Ee=null,sa=null,u={active:!1,withObs:!1,counting:!1,paused:!1,finishing:!1,t0:0,pauseAt:0,pausedMs:0,events:[],outputPath:null},Tn=e=>new Promise(t=>setTimeout(t,e)),la=()=>Promise.race([new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e))),Tn(100)]);document.querySelectorAll(".modal").forEach(e=>{e.addEventListener("click",t=>{(t.target===e||t.target.closest("[data-close]"))&&e.classList.remove("open")})});document.querySelectorAll("[data-copy]").forEach(e=>e.addEventListener("click",()=>{let t=document.getElementById(e.dataset.copy);t.select(),(navigator.clipboard?navigator.clipboard.writeText(t.value):Promise.reject()).catch(()=>document.execCommand("copy")),e.textContent="Copied",setTimeout(()=>{e.textContent="Copy"},1500)}));ni=e=>/^(localhost|127(\.\d+){3}|\[?::1\]?)$/i.test(e);ai="This page is served over https, and browsers block it from reaching OBS on another computer (OBS only offers plain ws://). Run OBS on this computer and use localhost, or open Slidetake from a local copy: download dist/index.html from github.com/slidetake/slidetake and serve it with python3 -m http.server.";document.getElementById("obs-connect").onclick=da;Cn.addEventListener("change",ca);document.getElementById("btn-record").onclick=hn;Je.onclick=()=>pa(!0);document.getElementById("rec-rehearse").onclick=()=>pa(!1);he="";ma=e=>vo(e,ha),fa=(e,t)=>xo(e,t,{input:e.outputPath||he||"recording.mov",outputName:Nt()+"-final.mp4",sectionOf:ha});_=null,H=null,z=document.getElementById("rv-video"),$=document.getElementById("rv-now");document.getElementById("rv-mode").onchange=()=>Ht();Tt=document.getElementById("rv-fps");Tt.onchange=()=>{_&&(_.fps=parseFloat(Tt.value),In(_),Ht())};document.getElementById("rv-link").addEventListener("input",e=>{try{te("slidetake:site",new URL(e.target.value.trim()).origin)}catch{}_&&ba(_)});Mt=null;z.addEventListener("timeupdate",()=>{if(!H)return;let e=H.ranges[H.i];if(z.currentTime*1e3<e.end)return;if(H.i++,H.i>=H.ranges.length){z.pause(),H=null,$.textContent="";return}let t=H.ranges[H.i];z.currentTime=t.start/1e3,$.textContent="\u25B6 "+t.title});document.getElementById("rv-play-final").onclick=()=>{_&&Ot($e(_).map(e=>({start:e.start,end:e.end,title:e.title})))};Ke=null,mn=0,fn=!1;z.addEventListener("error",async()=>{if(z.getAttribute("src")){if(Ke&&mn<5){mn++,$.textContent="Reloading "+he+" (OBS was still finishing it)\u2026",await new Promise(e=>setTimeout(e,1500));try{rt(await Ft(Ke),Ke,!0);return}catch{}}$.textContent=Ke?"Chrome cannot play "+he+". In OBS set Recording Format to Hybrid MP4 (or MP4) with H.264 video; the ffmpeg command still works with this file.":"Could not play "+(he||"this file")+". If OBS was still finishing it when you opened it, open it again; if it still fails, set OBS to Hybrid MP4 (or MP4) with H.264 video."}});Ve=document.getElementById("rv-file-input");Ve.addEventListener("change",()=>{Ve.files[0]&&rt(Ve.files[0]),Ve.value=""});document.getElementById("rv-open").onclick=async()=>{if(!window.showOpenFilePicker)return Ve.click();try{let[e]=await window.showOpenFilePicker({id:"obs-recordings",types:[{description:"Recordings",accept:{"video/*":[".mov",".mp4",".m4v",".mkv",".webm"]}}]});$.textContent="Opening "+e.name+"\u2026",rt(await Ft(e),e)}catch(e){(!e||e.name!=="AbortError")&&($.textContent="Could not open that file.")}};xa=document.getElementById("rv-folder");xa.hidden=!window.showDirectoryPicker;xa.onclick=async()=>{let e=_&&Me(_.outputPath);try{let t=await window.showDirectoryPicker({id:"obs-recordings",mode:"read"});if(mi("obs-folder",t),!e){$.textContent="Folder remembered. This session has no file name from OBS; open the file instead.";return}let n=await t.getFileHandle(e);rt(await Ft(n),n)}catch(t){if(t&&t.name==="AbortError")return;$.textContent=(e?e+" is not in that folder":"Could not read that folder")+". Use \u201COpen the recording file\u2026\u201D instead."}};document.getElementById("rv-download").onclick=()=>{if(!_)return;let e=_,t=ma(e),n="# "+document.getElementById("rv-yt-title").value+`
864
+ `+e,ra={};we=0,ia=null;ke=document.getElementById("progress");ke.innerHTML="<b></b><i></i>";ue={start:0,timer:null};ri=["x","y","xPercent","yPercent","scale","scaleX","scaleY","rotation","rotate","skewX","skewY"];Re=null;ee=null;Se=null;se=null;ca.addEventListener("click",e=>{let t=e.target.closest("circle");t&&!h.active&&P(t.dataset.id)});kt=null;U.addEventListener("input",()=>{if(Fa()){b.text=U.value,clearTimeout(kt),kt=setTimeout(()=>{_i(U.value),je(!0)},300);return}b.kind!=="copy"&&!Fi()||(k.text=U.value,_e(),clearTimeout(kt),kt=setTimeout(()=>{pt(),je(!0)},300))});document.querySelectorAll("#layout-toggle .seg-btn").forEach(e=>{e.addEventListener("click",()=>{e.dataset.mode!==z&&Nt(e.dataset.mode)})});(function(){let e=new Map,t=0,a=!1,o=null,n=()=>{let[i,s]=[...e.values()];return Math.hypot(i.x-s.x,i.y-s.y)||1};M.addEventListener("pointerdown",i=>{i.pointerType==="mouse"&&i.button!==0||h.active||i.target.closest("a, pre, code, input, textarea")||(e.set(i.pointerId,{x:i.clientX,y:i.clientY}),t=0,a=!1,e.size===2&&(o={d:n(),zoom:E.zoom}))}),window.addEventListener("pointermove",i=>{let s=e.get(i.pointerId);if(!s)return;let l=i.clientX-s.x,c=i.clientY-s.y;e.set(i.pointerId,{x:i.clientX,y:i.clientY}),t+=Math.abs(l)+Math.abs(c),!a&&t>5&&(a=!0,Ea(),M.classList.add("dragging")),a&&(e.size===2&&o?E.zoom=mn(o.zoom*n()/o.d):(E.x-=l/E.zoom,E.y-=c/E.zoom),Pe())});let r=i=>{e.delete(i.pointerId),e.size<2&&(o=null),e.size||M.classList.remove("dragging")};window.addEventListener("pointerup",r),window.addEventListener("pointercancel",r),M.addEventListener("click",i=>{a&&(i.stopPropagation(),i.preventDefault(),a=!1)},!0)})();M.addEventListener("wheel",e=>{e.preventDefault(),!h.active&&fn(Math.exp(-e.deltaY*(e.ctrlKey?.01:.0015)),e.clientX,e.clientY)},{passive:!1});document.getElementById("nav-prev").onclick=()=>De(-1);document.getElementById("nav-next").onclick=()=>De(1);document.getElementById("btn-open").onclick=()=>document.getElementById("file-input").click();document.getElementById("file-input").addEventListener("change",e=>{let t=e.target.files[0];if(!t)return;let a=new FileReader;a.onload=()=>{Dn("a copy of "+t.name)&&(k=ft(String(a.result),{kind:"file",name:t.name},{exported:!0}),pt(),ae=null,p=null,Ni())},a.readAsText(t),e.target.value=""});document.getElementById("btn-save").onclick=()=>{let e=new Blob([U.value],{type:"text/markdown"}),t=document.createElement("a");t.href=URL.createObjectURL(e),t.download=(ce[0]?Te(d.get(ce[0]).title):"deck")+".md",t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),1e3),b.kind==="copy"&&(k.exported=k.text,pt(),_e())};document.getElementById("btn-reset").onclick=()=>{b.kind!=="copy"||bt(k)||confirm("Discard your edits and go back to "+ie(k.origin)+" as it was?")&&(k.text=k.originText,pt(),U.value=k.text,p=null,je(!0),_e())};document.getElementById("btn-edit-toggle").onclick=_t;sa=document.querySelector("main"),Oe=document.getElementById("editor-resizer"),No=parseFloat(Q("slidetake:editorWidth"));No&&ge.style.setProperty("--editor-w",No+"px");Oe.addEventListener("pointerdown",e=>{e.preventDefault(),Oe.setPointerCapture(e.pointerId),sa.classList.add("resizing");let t=sa.getBoundingClientRect().right,a=n=>{let r=Math.round(Math.max(280,Math.min(window.innerWidth*.75,t-n.clientX)));ge.style.setProperty("--editor-w",r+"px")},o=()=>{sa.classList.remove("resizing"),Oe.removeEventListener("pointermove",a),Z("slidetake:editorWidth",String(ge.getBoundingClientRect().width))};Oe.addEventListener("pointermove",a),Oe.addEventListener("pointerup",o,{once:!0})});Oe.addEventListener("dblclick",()=>{ge.style.removeProperty("--editor-w");try{localStorage.removeItem("slidetake:editorWidth")}catch{}});document.getElementById("btn-mode").onclick=Qo;document.getElementById("btn-present").onclick=()=>be(!D);hi="https://cdn.jsdelivr.net/npm/obs-websocket-js@5.0.5/dist/obs-ws.min.js",_o=["ArrowRight","PageDown"," ","ArrowDown","Enter"],Wo=["ArrowLeft","PageUp","ArrowUp","r","R"],Ho=["b","B","."],ui=document.getElementById("rec-dialog"),mi=document.getElementById("review"),St=document.getElementById("rec-countdown"),ma=document.getElementById("rec-paused"),Mt=document.getElementById("obs-host"),Ot=document.getElementById("obs-port"),At=document.getElementById("obs-pass"),Ma=document.getElementById("obs-remember"),Uo=document.getElementById("obs-status"),Ze=document.getElementById("rec-start"),H=null,xe=!1,Ee=null,gn=null,h={active:!1,withObs:!1,counting:!1,paused:!1,finishing:!1,t0:0,pauseAt:0,pausedMs:0,events:[],outputPath:null},Oa=e=>new Promise(t=>setTimeout(t,e)),bn=()=>Promise.race([new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e))),Oa(100)]);fi="G-3S9FY4MQLS",Aa=document.getElementById("analytics-dialog"),gi=()=>Q("slidetake:analytics")!=="off";Aa.querySelectorAll("[data-analytics]").forEach(e=>e.onclick=()=>bi(e.dataset.analytics==="on"));vn=document.getElementById("btn-analytics");vn.hidden=!/^(www\.)?slidetake\.com$/.test(location.hostname);vn.onclick=()=>{yn(),lt(Aa)};document.querySelectorAll(".modal").forEach(e=>{e.addEventListener("click",t=>{(t.target===e||t.target.closest("[data-close]"))&&e.classList.remove("open")})});document.querySelectorAll("[data-copy]").forEach(e=>e.addEventListener("click",()=>{let t=document.getElementById(e.dataset.copy);t.select(),(navigator.clipboard?navigator.clipboard.writeText(t.value):Promise.reject()).catch(()=>document.execCommand("copy")),e.textContent="Copied",setTimeout(()=>{e.textContent="Copy"},1500)}));vi=e=>/^(localhost|127(\.\d+){3}|\[?::1\]?)$/i.test(e);xi="This page is served over https, and browsers block it from reaching OBS on another computer (OBS only offers plain ws://). Run OBS on this computer and use localhost, or open Slidetake from a local copy: download dist/index.html from github.com/slidetake/slidetake and serve it with python3 -m http.server.";document.getElementById("obs-connect").onclick=xn;Ma.addEventListener("change",wn);document.getElementById("btn-record").onclick=fa;Ze.onclick=()=>kn(!0);document.getElementById("rec-rehearse").onclick=()=>kn(!1);me="";Cn=e=>Mo(e,En),Ln=(e,t)=>Oo(e,t,{input:e.outputPath||me||"recording.mov",outputName:Ht()+"-final.mp4",sectionOf:En});N=null,W=null,I=document.getElementById("rv-video"),K=document.getElementById("rv-now");document.getElementById("rv-mode").onchange=()=>Ut();It=document.getElementById("rv-fps");It.onchange=()=>{N&&(N.fps=parseFloat(It.value),Pa(N),Ut())};document.getElementById("rv-link").addEventListener("input",e=>{try{Z("slidetake:site",new URL(e.target.value.trim()).origin)}catch{}N&&Mn(N)});zt=null;I.addEventListener("timeupdate",()=>{if(!W)return;let e=W.ranges[W.i];if(I.currentTime*1e3<e.end)return;if(W.i++,W.i>=W.ranges.length){I.pause(),W=null,K.textContent="";return}let t=W.ranges[W.i];I.currentTime=t.start/1e3,K.textContent="\u25B6 "+t.title});document.getElementById("rv-play-final").onclick=()=>{N&&Pt(Ge(N).map(e=>({start:e.start,end:e.end,title:e.title})))};$e=null,ga=0,ba=!1;I.addEventListener("error",async()=>{if(I.getAttribute("src")){if($e&&ga<5){ga++,K.textContent="Reloading "+me+" (OBS was still finishing it)\u2026",await new Promise(e=>setTimeout(e,1500));try{ct(await qt($e),$e,!0);return}catch{}}K.textContent=$e?"Chrome cannot play "+me+". In OBS set Recording Format to Hybrid MP4 (or MP4) with H.264 video; the ffmpeg command still works with this file.":"Could not play "+(me||"this file")+". If OBS was still finishing it when you opened it, open it again; if it still fails, set OBS to Hybrid MP4 (or MP4) with H.264 video."}});Je=document.getElementById("rv-file-input");Je.addEventListener("change",()=>{Je.files[0]&&ct(Je.files[0]),Je.value=""});document.getElementById("rv-open").onclick=async()=>{if(!window.showOpenFilePicker)return Je.click();try{let[e]=await window.showOpenFilePicker({id:"obs-recordings",types:[{description:"Recordings",accept:{"video/*":[".mov",".mp4",".m4v",".mkv",".webm"]}}]});K.textContent="Opening "+e.name+"\u2026",ct(await qt(e),e)}catch(e){(!e||e.name!=="AbortError")&&(K.textContent="Could not open that file.")}};Bn=document.getElementById("rv-folder");Bn.hidden=!window.showDirectoryPicker;Bn.onclick=async()=>{let e=N&&Me(N.outputPath);try{let t=await window.showDirectoryPicker({id:"obs-recordings",mode:"read"});if(Bi("obs-folder",t),!e){K.textContent="Folder remembered. This session has no file name from OBS; open the file instead.";return}let a=await t.getFileHandle(e);ct(await qt(a),a)}catch(t){if(t&&t.name==="AbortError")return;K.textContent=(e?e+" is not in that folder":"Could not read that folder")+". Use \u201COpen the recording file\u2026\u201D instead."}};document.getElementById("rv-download").onclick=()=>{if(!N)return;let e=N,t=Cn(e),a="# "+document.getElementById("rv-yt-title").value+`
631
865
 
632
- Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath:"")+" \xB7 final length "+K(t.length)+`
866
+ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath:"")+" \xB7 final length "+$(t.length)+`
633
867
 
634
868
  ## Render
635
869
 
@@ -651,9 +885,9 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
651
885
 
652
886
  ## Picked takes
653
887
 
654
- `+$e(e).map(a=>"- "+K(a.start)+"\u2013"+K(a.end)+" "+a.title).join(`
888
+ `+Ge(e).map(n=>"- "+$(n.start)+"\u2013"+$(n.end)+" "+n.title).join(`
655
889
  `)+`
656
- `,o=document.createElement("a");o.href=URL.createObjectURL(new Blob([n],{type:"text/markdown"})),o.download=Nt()+"-publish.md",o.click(),setTimeout(()=>URL.revokeObjectURL(o.href),1e3)};ti()&&new URLSearchParams(location.search).get("obs")&&da();se=document.getElementById("btn-camera"),vt=document.getElementById("pip-msg"),gn=null;bi='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="6" width="14" height="12" rx="2"/><path d="M16 10.5 22 7v10l-6-3.5z"/></svg>';se.onclick=()=>An(q);zn();Do=null;window.addEventListener("pointermove",Sa);document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||(u.active?_t("Stopped: the browser left fullscreen"):R&&ge(!1))});me=document.getElementById("help");document.getElementById("btn-help").onclick=()=>window.open(T?"https://slidetake.com/help":"/help","_blank","noopener");document.getElementById("btn-keys").onclick=()=>me.classList.add("open");document.getElementById("help-close").onclick=()=>me.classList.remove("open");me.addEventListener("click",e=>{e.target===me&&me.classList.remove("open")});window.addEventListener("keydown",e=>{if(e.key==="F5"){e.preventDefault(),u.active||hn();return}if(u.active){ii(e);return}if(document.querySelector(".modal.open")){e.key==="Escape"&&Mn();return}let t=document.activeElement&&document.activeElement.tagName;if(t==="TEXTAREA"||t==="INPUT"||e.metaKey||e.ctrlKey||e.altKey)return;if(me.classList.contains("open")){/^(Escape|k|K|\?)$/.test(e.key)&&me.classList.remove("open");return}let n=e.key;n==="ArrowRight"||n===" "||n==="PageDown"?(e.preventDefault(),De(1)):n==="ArrowLeft"||n==="PageUp"?(e.preventDefault(),De(-1)):n==="ArrowDown"?(e.preventDefault(),Xr()):n==="ArrowUp"?(e.preventDefault(),Vr()):n==="Home"?h.length&&P(h[0]):n==="End"?h.length&&P(h[h.length-1]):n==="o"||n==="O"?Kr():n==="e"||n==="E"?Dt():n==="f"||n==="F"||n==="p"||n==="P"?ge(!R):n==="r"||n==="R"?hn():n==="1"?Se("tree"):n==="2"?Se("radial"):n==="3"?Se("path"):n==="4"?Se("focus"):n==="c"||n==="C"?An(q):n==="v"||n==="V"?ur():n==="l"||n==="L"?qo():n==="+"||n==="="?Bo(1):n==="-"||n==="_"?Bo(-1):n==="?"||n==="k"||n==="K"?me.classList.add("open"):n==="Escape"&&!oa()&&R&&ge(!1)});window.addEventListener("hashchange",()=>{let{data:e,slide:t}=dt(location.hash);if(e&&!(y&&y.kind==="share"&&e===y.data)){location.reload();return}t&&t!==p&&d.has(t)&&P(t)});jo="";new ResizeObserver(()=>{let e=M.clientWidth+"x"+M.clientHeight;e!==jo&&(jo=e,Pe(),oe(!0))}).observe(M);Ie=document.createElement("div");Ie.id="toast";Ie.setAttribute("role","status");document.body.appendChild(Ie);_o=null;yi=document.getElementById("open-dialog"),yn=document.getElementById("open-url"),vn=document.getElementById("open-error");document.getElementById("btn-load").onclick=()=>{vn.hidden=!0,jt(yi),yn.focus(),yn.select()};document.getElementById("open-form").onsubmit=e=>{e.preventDefault();let t=ao(yn.value);if(!t){vn.textContent="That doesn't look like a link.",vn.hidden=!1;return}location.href=bn(t)};document.getElementById("btn-share").onclick=async()=>{let{link:e,inside:t}=await vi(p&&p!==h[0]?p:""),n=t?"Link copied, with the whole deck inside it ("+(e.length/1024).toFixed(1)+" KB)"+(e.length>8e3?". Some chat apps cut long links short: a GitHub file or gist makes a shorter one.":"."):"Link copied.";try{await navigator.clipboard.writeText(e),Bt(n,5e3)}catch{prompt("Copy this link:",e)}y.kind==="copy"&&(k.exported=k.text,st(),Ne())};No=ee("slidetake:layout");A=["tree","radial","path","focus"].includes(No)?No:"tree";document.querySelectorAll("#layout-toggle .seg-btn").forEach(e=>e.classList.toggle("active",e.dataset.mode===A));It=new URLSearchParams(location.search);["tree","radial","path","focus"].includes(It.get("layout"))&&(A=It.get("layout"),document.querySelectorAll("#layout-toggle .seg-btn").forEach(e=>e.classList.toggle("active",e.dataset.mode===A)));if(T){let e=(Array.isArray(T.trail)?T.trail:T.back?[T.back]:[]).filter(a=>a&&a.label),t=document.querySelector("header .brand");e.length&&(t.innerHTML='<nav class="trail" aria-label="Site">'+e.map((a,r)=>(r?'<span class="sep" aria-hidden="true">|</span>':"")+(a.url?'<a href="'+C(a.url)+'">'+C(a.label)+"</a>":"<span>"+C(a.label)+"</span>")).join("")+"</nav>");let n=document.createElement("a");n.id="credit",n.href="https://slidetake.com",n.target="_blank",n.rel="noopener",n.title="Made with Slidetake",n.setAttribute("aria-label","Made with Slidetake"),n.innerHTML=Wo+'<span class="word">Slide<span>take</span></span>';let o=document.querySelector("header .hdr-actions");o.insertBefore(n,o.firstChild),tt||(o.insertAdjacentHTML("beforeend",'<button class="btn" id="hdr-keys" title="Keyboard shortcuts (K)">\u2328 Keys</button><button class="btn" id="hdr-full" title="Fullscreen (F)">\u26F6 Fullscreen</button>'),document.getElementById("hdr-keys").onclick=()=>document.getElementById("help").classList.add("open"),document.getElementById("hdr-full").onclick=()=>ge(!R))}Y=co(location.pathname,location.search,location.hash),Ho=Y.page==="pick"?"":Y.slide,y=null,k=po(ee("slidetake:copy"))||xi();window.addEventListener("popstate",()=>location.reload());(It.get("edit")==="1"||Y.page==="edit"&&k&&It.get("edit")!=="0")&&Dt();Ei().then(e=>(Q.value=e,Ne(),Yo(Q.value),Xo(),document.fonts?document.fonts.ready:null)).then(()=>{d.forEach(At),nt(),P(d.has(Ho)?Ho:h[0],!0)})});var Pn=` /* Every colour comes from these tokens. Slidetake's own is terminal green: bright on zinc in dark mode,
890
+ `,o=document.createElement("a");o.href=URL.createObjectURL(new Blob([a],{type:"text/markdown"})),o.download=Ht()+"-publish.md",o.click(),setTimeout(()=>URL.revokeObjectURL(o.href),1e3)};yi()&&new URLSearchParams(location.search).get("obs")&&xn();le=document.getElementById("btn-camera"),Xe=document.getElementById("pip-msg"),Et=null,In=L.querySelector("span");Pi='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="6" width="14" height="12" rx="2"/><path d="M16 10.5 22 7v10l-6-3.5z"/></svg>';le.onclick=()=>ja(G);Da();qo=null;window.addEventListener("pointermove",Rn);document.addEventListener("fullscreenchange",()=>{document.fullscreenElement||(h.active?Wt("Stopped: the browser left fullscreen"):D&&be(!1))});fe=document.getElementById("help");document.getElementById("btn-keys").onclick=()=>fe.classList.add("open");document.getElementById("help-close").onclick=()=>fe.classList.remove("open");fe.addEventListener("click",e=>{e.target===fe&&fe.classList.remove("open")});window.addEventListener("keydown",e=>{if(e.key==="F5"){e.preventDefault(),h.active||fa();return}if(h.active){Si(e);return}if(document.querySelector(".modal.open")){e.key==="Escape"&&Ba();return}let t=document.activeElement&&document.activeElement.tagName;if(t==="TEXTAREA"||t==="INPUT"||e.metaKey||e.ctrlKey||e.altKey)return;if(fe.classList.contains("open")){/^(Escape|k|K|\?)$/.test(e.key)&&fe.classList.remove("open");return}let a=e.key;a==="ArrowRight"||a===" "||a==="PageDown"?(e.preventDefault(),De(1)):a==="ArrowLeft"||a==="PageUp"?(e.preventDefault(),De(-1)):a==="ArrowDown"?(e.preventDefault(),di()):a==="ArrowUp"?(e.preventDefault(),ci()):a==="Home"?u.length&&P(u[0]):a==="End"?u.length&&P(u[u.length-1]):a==="o"||a==="O"?li():a==="e"||a==="E"?_t():a==="f"||a==="F"||a==="p"||a==="P"?be(!D):a==="r"||a==="R"?fa():/^[1-4]$/.test(a)?Nt(xa[+a-1]):a==="c"||a==="C"?ja(G):a==="v"||a==="V"?Lr():a==="l"||a==="L"?Qo():a==="+"||a==="="?Fo(1):a==="-"||a==="_"?Fo(-1):a==="?"||a==="k"||a==="K"?fe.classList.add("open"):a==="Escape"&&!hn()&&D&&be(!1)});window.addEventListener("hashchange",()=>{let{data:e,slide:t}=mt(location.hash);if(e&&!(b&&b.kind==="share"&&e===b.data)){location.reload();return}t&&t!==p&&d.has(t)&&P(t)});Yo="";new ResizeObserver(()=>{let e=M.clientWidth+"x"+M.clientHeight;e!==Yo&&(Yo=e,Pe(),ne(!0))}).observe(M);Be=document.createElement("div");Be.id="toast";Be.setAttribute("role","status");document.body.appendChild(Be);Go=null;Ri=document.getElementById("open-dialog"),va=document.getElementById("open-url"),wa=document.getElementById("open-error");document.getElementById("btn-load").onclick=()=>{wa.hidden=!0,lt(Ri),va.focus(),va.select()};document.getElementById("open-form").onsubmit=e=>{e.preventDefault();let t=mo(va.value);if(!t){wa.textContent="That doesn't look like a link.",wa.hidden=!1;return}location.href=ya(t)};document.getElementById("btn-share").onclick=async()=>{let{link:e,inside:t}=await Di(p&&p!==u[0]?p:""),a=t?"Link copied, with the whole deck inside it ("+(e.length/1024).toFixed(1)+" KB)"+(e.length>8e3?". Some chat apps cut long links short: a GitHub file or gist makes a shorter one.":"."):"Link copied.";try{await navigator.clipboard.writeText(e),ot(a,5e3)}catch{prompt("Copy this link:",e)}b.kind==="copy"&&(k.exported=k.text,pt(),_e())};Ko=Q("slidetake:layout");z=xa.includes(Ko)?Ko:"path";document.querySelectorAll("#layout-toggle .seg-btn").forEach(e=>e.classList.toggle("active",e.dataset.mode===z));Rt=new URLSearchParams(location.search);xa.includes(Rt.get("layout"))&&(z=Rt.get("layout"),document.querySelectorAll("#layout-toggle .seg-btn").forEach(e=>e.classList.toggle("active",e.dataset.mode===z)));if(A){let e=(Array.isArray(A.trail)?A.trail:A.back?[A.back]:[]).filter(n=>n&&n.label),t=document.querySelector("header .brand");e.length&&(t.innerHTML='<nav class="trail" aria-label="Site">'+e.map((n,r)=>(r?'<span class="sep" aria-hidden="true">|</span>':"")+(n.url?'<a href="'+T(n.url)+'">'+T(n.label)+"</a>":"<span>"+T(n.label)+"</span>")).join("")+"</nav>");let a=document.createElement("a");a.id="credit",a.href="https://slidetake.com",a.target="_blank",a.rel="noopener",a.title="Made with Slidetake",a.setAttribute("aria-label","Made with Slidetake"),a.innerHTML=Jo+'<span class="word">Slide<span>take</span></span>';let o=document.querySelector("header .hdr-actions");o.insertBefore(a,o.firstChild),nt||(o.insertAdjacentHTML("beforeend",'<button class="btn" id="hdr-keys" title="Keyboard shortcuts (K)">\u2328 Keys</button><button class="btn" id="hdr-full" title="Fullscreen (F)">\u26F6 Fullscreen</button>'),document.getElementById("hdr-keys").onclick=()=>document.getElementById("help").classList.add("open"),document.getElementById("hdr-full").onclick=()=>be(!D))}j=vo(location.pathname,location.search,location.hash),Vo=j.page==="pick"?"":j.slide,b=null,k=wo(Q("slidetake:copy"))||ji();window.addEventListener("popstate",()=>location.reload());X&&window.EventSource&&(new EventSource(X.events).onmessage=async e=>{if(!Fa())return;let t=(JSON.parse(e.data).file||"").replace(/\\/g,"/");if(t===X.file){let a=await(await fetch(X.deck,{cache:"no-store"})).text();if(a===U.value)return;U.value=b.text=a,je(!0);return}q.querySelectorAll("img").forEach(a=>{let o=new URL(a.src);decodeURIComponent(o.pathname).endsWith("/"+t)&&(o.searchParams.set("t",String(Date.now())),a.src=o.href)})});(Rt.get("edit")==="1"||j.page==="edit"&&k&&Rt.get("edit")!=="0")&&_t();Hi().then(e=>(U.value=e,_e(),en(U.value),nn(),document.fonts?document.fonts.ready:null)).then(()=>{d.forEach(jt),rt(),P(d.has(Vo)?Vo:u[0],!0)})});var Na=` /* Every colour comes from these tokens. Slidetake's own is seafoam green: bright on zinc in dark mode,
657
891
  deep on white in light mode. A host page passes its own (window.SLIDETAKE.colors) and a deck can carry
658
892
  its own (accent: in its top block); see applyColors in app.js. */
659
893
  :root{
@@ -663,14 +897,14 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
663
897
  --panel-line:#27272a;
664
898
  --node-bg:#18181b;
665
899
  --node-border:#323238;
666
- --accent:#4ade80;
667
- --accent-teal:#86efac; /* headings below h2 */
900
+ --accent:#29b685; /* 6.9:1 on the card: an accent, kept below body text so it doesn't glare */
901
+ --accent-teal:#3bc493; /* headings below h2 */
668
902
  --text:#e4e4e7;
669
903
  --text-muted:#a1a1aa;
670
904
  --danger:#e0645c;
671
905
  --code-bg:#0f0f12;
672
906
  --overlay:rgba(17,17,19,.9); /* breadcrumbs, nav bar, minimap */
673
- --on-accent:#052e16; /* text on an accent-filled button */
907
+ --on-accent:#022c22; /* text on an accent-filled button */
674
908
  --card-shadow:0 6px 24px rgba(0,0,0,.35);
675
909
  --brand-shadow:0 1px 6px rgba(0,0,0,.6);
676
910
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
@@ -680,18 +914,18 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
680
914
  /* Tokens derived from others are declared on body, not :root: a custom property resolves var() where
681
915
  it is declared, so on :root these would freeze the default palette's colours. */
682
916
  body{
683
- --accent-line:#15803d; /* borders and connector lines on the active path */
917
+ --accent-line:#047857; /* borders and connector lines on the active path */
684
918
  --accent-ring:var(--accent); /* the current slide's border, glow and the progress bar */
685
919
  --edge:var(--node-border); /* connector lines off the active path */
686
920
  --header-bg:none; /* a host's band of colour behind the header (an image layer) */
687
921
  --header-ink:var(--text); /* text on that band */
688
922
  }
689
- /* Light mode (L, mode: light, ?mode=light): #15803d carries text (5.0:1 on white); the brighter green
923
+ /* Light mode (L, mode: light, ?mode=light): #047857 carries text (5.5:1 on white); the brighter seafoam
690
924
  only rings and lines, which never need to be read. */
691
925
  body[data-mode="light"]{
692
926
  --bg:#fafaf9; --grid-dot:#e7e5e4; --panel:#ffffff; --panel-line:#e4e4e7;
693
927
  --node-bg:#ffffff; --node-border:#e4e4e7; --edge:#d4d4d8;
694
- --accent:#15803d; --accent-teal:#166534; --accent-line:#4ade80; --accent-ring:#22c55e;
928
+ --accent:#047857; --accent-teal:#065f46; --accent-line:#34d399; --accent-ring:#10b981;
695
929
  --text:#27272a; --text-muted:#71717a; --danger:#c2410c;
696
930
  --code-bg:#f4f4f5; --overlay:rgba(255,255,255,.92); --on-accent:#ffffff;
697
931
  --card-shadow:0 4px 18px rgba(24,24,27,.08); --brand-shadow:0 1px 4px rgba(255,255,255,.9);
@@ -726,10 +960,25 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
726
960
  --text:var(--header-ink);--text-muted:color-mix(in srgb, var(--header-ink) 72%, transparent);
727
961
  --node-border:color-mix(in srgb, var(--header-ink) 28%, transparent);}
728
962
  .brand{display:flex;align-items:baseline;gap:10px;}
729
- .brand .mark{font-family:var(--display);font-weight:700;font-size:17px;letter-spacing:.02em;color:inherit;text-decoration:none;display:inline-flex;align-items:center;gap:7px;align-self:center;}
730
- .brand .mark .logo{width:20px;height:20px;fill:var(--accent);flex:none;}
963
+ /* the name and the links beside it share one baseline: the mark's baseline is its word's, the logo centred beside it */
964
+ .brand .mark{font-family:var(--display);font-weight:700;font-size:17px;letter-spacing:.02em;color:inherit;text-decoration:none;display:inline-flex;align-items:center;gap:7px;}
965
+ .brand .mark .word{align-self:baseline;}
966
+ .brand .mark .logo{width:20px;height:20px;fill:var(--accent);flex:none;align-self:center;}
731
967
  .brand .mark .word > span{color:var(--accent);}
732
- .brand .tagline{font-family:var(--mono);font-size:13px;color:var(--text-muted);}
968
+ /* Slidetake's two-tone name in its own decks' titles, as in the header */
969
+ .node .body .st-take{color:var(--accent);}
970
+ /* the Record button's red, where a deck names the button; deeper on white so it reads */
971
+ .node .body .st-rec{color:#f87171;}
972
+ body[data-mode="light"] .node .body .st-rec{color:#dc2626;}
973
+ /* a heart in the deck's own colour, where an emoji would keep its fixed green */
974
+ .node .body .st-heart{display:inline-block;width:.9em;height:.9em;vertical-align:-.08em;background:var(--accent);
975
+ -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.35 10.55 20.03C5.4 15.36 2 12.27 2 8.5 2 5.41 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.08C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.41 22 8.5c0 3.77-3.4 6.86-8.55 11.54z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.35 10.55 20.03C5.4 15.36 2 12.27 2 8.5 2 5.41 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.08C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.41 22 8.5c0 3.77-3.4 6.86-8.55 11.54z'/%3E%3C/svg%3E") center/contain no-repeat;}
976
+ /* Features, Showcase, Docs and GitHub (what it is, see it, how to use it, the source) sit with the name:
977
+ they're about Slidetake, not about the deck on screen */
978
+ .brand .site-links{display:flex;align-items:center;gap:16px;align-self:center;margin-left:8px;}
979
+ .brand .site-link{font-family:var(--mono);font-size:13px;color:var(--text-muted);text-decoration:none;display:inline-flex;align-items:center;}
980
+ .brand .site-link:hover, .brand .site-link:focus-visible{color:var(--accent);}
981
+ .brand .site-link svg{width:15px;height:15px;display:block;margin-right:5px;}
733
982
  .hdr-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
734
983
  .btn{
735
984
  background:transparent;color:var(--text);
@@ -775,15 +1024,27 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
775
1024
  #doc-state .edited{color:var(--accent);}
776
1025
  #continue{color:var(--accent);border-color:var(--accent-line);}
777
1026
  #continue[hidden]{display:none;}
1027
+ #btn-analytics[hidden]{display:none;}
778
1028
  .modal ul.templates{list-style:none;padding:0;display:grid;gap:8px;margin:12px 0;}
779
1029
  .modal ul.templates a{display:flex;flex-direction:column;gap:2px;padding:10px 12px;border:1px solid var(--panel-line);border-radius:8px;text-decoration:none;color:var(--text);}
780
1030
  .modal ul.templates a:hover{border-color:var(--accent);}
781
1031
  .modal ul.templates span{font-size:12px;color:var(--text-muted);}
1032
+ /* the analytics choice: two cards, the chosen one in the accent */
1033
+ .modal .choices{display:grid;gap:8px;margin:12px 0;}
1034
+ .modal .choice{display:flex;flex-direction:column;gap:4px;text-align:left;padding:10px 12px;border:1px solid var(--panel-line);border-radius:8px;
1035
+ background:transparent;color:var(--text);font:inherit;cursor:pointer;}
1036
+ .modal .choice:hover{border-color:var(--accent-line);}
1037
+ .modal .choice[aria-checked="true"]{border-color:var(--accent);background:color-mix(in srgb, var(--accent) 8%, transparent);}
1038
+ .modal .choice strong{font-family:var(--display);font-size:14px;}
1039
+ .modal .choice span{font-size:12px;line-height:1.55;color:var(--text-muted);}
1040
+ .modal .note{font-size:12px;}
782
1041
  #editor-pane.unsaved .pane-bar{box-shadow:inset 0 -2px 0 var(--accent);}
783
1042
  #editor-pane.unsaved #btn-share, #editor-pane.unsaved #btn-save{border-color:var(--accent);color:var(--accent);}
784
1043
  .btn.small{padding:3px 9px;font-size:11px;}
785
1044
  .btn.icon{padding:4px 9px;min-width:30px;display:inline-flex;align-items:center;justify-content:center;}
786
1045
  .btn.icon svg{width:15px;height:15px;display:block;}
1046
+ /* in the header, icon buttons stand as tall as the layout switch and the text buttons beside them */
1047
+ .hdr-actions .btn.icon{height:32px;min-width:32px;padding:0 8px;}
787
1048
  .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
788
1049
  .pane-label{
789
1050
  font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;
@@ -1158,7 +1419,7 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
1158
1419
  #credit .logo{width:18px;height:18px;fill:var(--accent);}
1159
1420
  #credit .word > span{color:var(--accent);}
1160
1421
  #credit:hover{opacity:.85;}
1161
- html.embed #btn-help, html.embed #btn-github{display:none !important;}
1422
+ html.embed .site-links, html.embed #btn-github, html.embed #btn-analytics{display:none !important;}
1162
1423
  /* a reader's page (embedded, not recording): no bottom bar, except the arrows on touch screens */
1163
1424
  html.embed.no-record #navbar{display:none;}
1164
1425
  @media (pointer:coarse){
@@ -1186,6 +1447,9 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
1186
1447
  background:color-mix(in srgb, var(--accent-teal) 4%, transparent);
1187
1448
  }
1188
1449
  #pip[hidden]{display:none;}
1450
+ /* a message in the box (no camera found, waiting for permission, a layout picked with V) */
1451
+ #pip.msg span{padding:10px 14px;text-align:center;text-transform:none;letter-spacing:0;font-size:12px;line-height:1.45;color:var(--accent);
1452
+ background:color-mix(in srgb, var(--panel) 88%, transparent);border-radius:6px;max-width:92%;max-height:92%;overflow:hidden;}
1189
1453
  #pip.circle{aspect-ratio:1;border-radius:50%;}
1190
1454
  #pip.top-left{top:16px;left:16px;}
1191
1455
  #pip.top-right{top:16px;right:16px;}
@@ -1237,36 +1501,38 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
1237
1501
  #editor-resizer{display:none;}
1238
1502
  #editor-pane.collapsed{height:0;}
1239
1503
  #stage-wrap{flex:1;}
1240
- .brand .tagline{display:none;}
1241
1504
  #minimap{display:none;}
1242
1505
  #navbar .lbl{display:none;}
1243
1506
  }
1244
- `;var Rn=`
1507
+ `;var _a=`
1245
1508
  <noscript>
1246
1509
  <h1>Slidetake</h1>
1247
1510
  <p><strong>Write in markdown. Present on a spatial canvas. Record without timeline editing.</strong></p>
1248
1511
  <p>For developers and technical educators who explain things on video. Your headings become a map you move through; with OBS, every slide is a take, so a fumbled line is retaken on the spot, and Slidetake writes the frame-exact cut, YouTube chapters and description.</p>
1249
- <p>Slidetake needs JavaScript. Read the <a href="/help.md">guide</a>, the <a href="/llms.txt">summary</a>, or the source on <a href="https://github.com/slidetake/slidetake">GitHub</a>.</p>
1512
+ <p>Slidetake needs JavaScript. Read the <a href="/docs.md">docs</a>, the <a href="/llms.txt">summary</a>, or the source on <a href="https://github.com/slidetake/slidetake">GitHub</a>.</p>
1250
1513
  </noscript>
1251
1514
 
1252
1515
  <header>
1253
1516
  <div class="brand">
1254
1517
  <a class="mark" href="/" title="Slidetake home"><svg class="logo" viewBox="0 0 64 64" aria-hidden="true"><path d="M 10 8 H 38 C 41.3 8 44 10.7 44 14 V 18 H 22 C 16.5 18 12 22.5 12 28 V 36 H 10 C 6.7 36 4 33.3 4 30 V 14 C 4 10.7 6.7 8 10 8 Z" opacity="0.4"/><path fill-rule="evenodd" d="M 22 22 H 54 C 57.3 22 60 24.7 60 28 V 50 C 60 53.3 57.3 56 54 56 H 22 C 18.7 56 16 53.3 16 50 V 28 C 16 24.7 18.7 22 22 22 Z M 26 34 C 28.2 34 30 32.2 30 30 C 30 27.8 28.2 26 26 26 C 23.8 26 22 27.8 22 30 C 22 32.2 23.8 34 26 34 Z M 38 40 C 36.9 40 36 40.9 36 42 V 48 C 36 49.1 36.9 50 38 50 H 50 C 51.1 50 52 49.1 52 48 V 42 C 52 40.9 51.1 40 50 40 H 38 Z"/></svg><span class="word">Slide<span>take</span></span></a>
1255
- <div class="tagline">plain markdown \u2192 spatial deck \u2192 video</div>
1518
+ <nav class="site-links" aria-label="Slidetake">
1519
+ <a class="site-link" id="btn-features" href="/features" title="Every feature, and what it's for"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/><path d="M20 3v4"/><path d="M22 5h-4"/><path d="M4 17v2"/><path d="M5 18H3"/></svg><span>Features</span></a>
1520
+ <a class="site-link" id="btn-showcase" href="/showcase" title="Showcase: every feature in one deck"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 3h20"/><path d="M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3"/><path d="m7 21 5-5 5 5"/></svg><span>Showcase</span></a>
1521
+ <a class="site-link" id="btn-docs" href="/docs" title="Docs: step by step, itself a deck"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/></svg><span>Docs</span></a>
1522
+ <a class="site-link" id="btn-github" href="https://github.com/slidetake/slidetake" target="_blank" rel="noopener noreferrer" title="GitHub repository"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg><span>GitHub</span></a>
1523
+ </nav>
1256
1524
  </div>
1257
1525
  <div class="hdr-actions">
1258
1526
  <input type="file" id="file-input" accept=".md,.markdown,.txt,text/markdown" hidden>
1259
1527
  <div class="seg" id="layout-toggle">
1260
- <button class="seg-btn" data-mode="tree" title="Tree (1)">tree</button>
1261
- <button class="seg-btn" data-mode="radial" title="Radial (2)">radial</button>
1262
- <button class="seg-btn" data-mode="path" title="Path: slides in presenting order (3)">path</button>
1263
- <button class="seg-btn" data-mode="focus" title="Focus: one slide at a time, no travel (4)">focus</button>
1528
+ <button class="seg-btn" data-mode="focus" title="Focus: one slide at a time, no travel (1)">focus</button>
1529
+ <button class="seg-btn" data-mode="path" title="Path: slides in presenting order (2)">path</button>
1530
+ <button class="seg-btn" data-mode="radial" title="Radial: rings out from the first card (3)">radial</button>
1531
+ <button class="seg-btn" data-mode="tree" title="Tree: a top-down chart (4)">tree</button>
1264
1532
  </div>
1265
- <a class="btn" id="continue" href="/edit" hidden></a>
1266
- <button class="btn" id="btn-edit-toggle" title="Editor: write, open, share (E)">\u270E Editor</button>
1533
+ <button class="btn icon" id="btn-analytics" title="Privacy &amp; analytics" aria-label="Privacy &amp; analytics" hidden><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"/></svg></button>
1267
1534
  <button class="btn icon" id="btn-mode" title="Light / dark (L)" aria-label="Light / dark"></button>
1268
- <a class="btn icon" id="btn-github" href="https://github.com/slidetake/slidetake" target="_blank" rel="noopener noreferrer" title="GitHub repository"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/><path d="M9 18c-4.51 2-5-2-7-2"/></svg><span class="sr-only">GitHub repository</span></a>
1269
- <button class="btn icon" id="btn-help" title="Help: the full guide (? for keys)" aria-label="Help">?</button>
1535
+ <button class="btn" id="btn-edit-toggle" title="Editor: write, open, share (E)">\u270E Editor</button>
1270
1536
  </div>
1271
1537
  </header>
1272
1538
 
@@ -1298,6 +1564,7 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
1298
1564
  <div class="pane-bar">
1299
1565
  <span class="pane-label" id="doc-state" aria-live="polite"></span>
1300
1566
  <span class="pane-actions">
1567
+ <a class="btn small" id="continue" href="/edit" hidden></a>
1301
1568
  <a class="btn small" id="btn-new" href="/new" title="Start from a template">New</a>
1302
1569
  <button class="btn small" id="btn-load" title="Load a deck from a link: GitHub, a gist or any URL">\u21E3 Load</button>
1303
1570
  <button class="btn small" id="btn-open" title="Open a markdown file from this computer">Open</button>
@@ -1318,7 +1585,7 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
1318
1585
  <tr><td><kbd>\u2192</kbd> <kbd>\u2190</kbd> <kbd>Space</kbd></td><td>next / previous step</td></tr>
1319
1586
  <tr><td><kbd>\u2193</kbd> <kbd>\u2191</kbd></td><td>first child / parent</td></tr>
1320
1587
  <tr><td><kbd>O</kbd></td><td>the whole map; <kbd>O</kbd> or <kbd>Esc</kbd> goes back</td></tr>
1321
- <tr><td><kbd>1</kbd>\u2013<kbd>4</kbd></td><td>tree, radial, path, focus</td></tr>
1588
+ <tr><td><kbd>1</kbd>\u2013<kbd>4</kbd></td><td>focus, path, radial, tree</td></tr>
1322
1589
  <tr><td><kbd>F</kbd></td><td>fullscreen; <kbd>F</kbd> or <kbd>Esc</kbd> leaves</td></tr>
1323
1590
  <tr><td><kbd>+</kbd> <kbd>\u2212</kbd></td><td>bigger / smaller slides</td></tr>
1324
1591
  <tr><td><kbd>E</kbd></td><td>editor: write, open, share</td></tr>
@@ -1327,7 +1594,26 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
1327
1594
  <tr><td><kbd>K</kbd> <kbd>?</kbd></td><td>this card; again or <kbd>Esc</kbd> closes it</td></tr>
1328
1595
  </table>
1329
1596
  <p>Drag to pan, scroll or pinch to zoom, click a card to fly to it.</p>
1330
- <p><a href="/help" target="_blank" rel="noopener">The full guide \u2192</a> writing decks, sharing, recording, camera, review and cut.</p>
1597
+ <p><a href="/docs" target="_blank" rel="noopener">The docs \u2192</a> writing decks, sharing, recording, camera, review and cut.</p>
1598
+ </div>
1599
+ </div>
1600
+
1601
+ <div id="analytics-dialog" class="modal" role="dialog" aria-labelledby="analytics-title">
1602
+ <div class="panel">
1603
+ <button class="close" data-close aria-label="Close">\u2715</button>
1604
+ <h2 id="analytics-title">Privacy &amp; analytics</h2>
1605
+ <p>Your decks, copies and recordings never leave this browser. This is only about counting visits to slidetake.com.</p>
1606
+ <div class="choices" role="radiogroup" aria-label="Privacy &amp; analytics">
1607
+ <button class="choice" role="radio" data-analytics="on">
1608
+ <strong>Allow analytics</strong>
1609
+ <span>Standard Google Analytics (<code>G-3S9FY4MQLS</code>), to see which pages get read and where readers come from. Sets the <code>_ga</code> cookies. The address it records leaves out the part after <code>#</code> and <code>?obs=</code>, so never a deck or an OBS password.</span>
1610
+ </button>
1611
+ <button class="choice" role="radio" data-analytics="off">
1612
+ <strong>Turn analytics off</strong>
1613
+ <span>Nothing more is sent from this browser, and the <code>_ga</code> cookies are removed. Cloudflare, which serves the site, still sees each request the way any web server does.</span>
1614
+ </button>
1615
+ </div>
1616
+ <p class="note" id="analytics-note"><code>slidetake:analytics</code> in this browser remembers your choice. Everything else is on the <a href="/privacy">privacy page</a>.</p>
1331
1617
  </div>
1332
1618
  </div>
1333
1619
 
@@ -1340,7 +1626,7 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
1340
1626
  <li><a href="/new?template=blank"><strong>Blank</strong><span>A first card, a section and a detail.</span></a></li>
1341
1627
  <li><a href="/new?template=talk"><strong>Talk</strong><span>Why it matters, the idea, trade-offs, summary.</span></a></li>
1342
1628
  <li><a href="/new?template=recording"><strong>Recording</strong><span>Camera steps, an overview moment and a closing on camera.</span></a></li>
1343
- <li><a href="/examples"><strong>Examples</strong><span>Everything a deck can hold: diagrams, charts, images, YouTube.</span></a></li>
1629
+ <li><a href="/showcase"><strong>Showcase</strong><span>Every feature in one deck: diagrams, charts, images, YouTube, camera.</span></a></li>
1344
1630
  </ul>
1345
1631
  <p>Or <strong>\u21E3 Load</strong> a deck from a link, or <strong>Open</strong> a file from this computer.</p>
1346
1632
  </div>
@@ -1463,5 +1749,5 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
1463
1749
  <div id="rec-paused">Paused \xB7 press B to resume</div>
1464
1750
 
1465
1751
  <!-- The sample deck. Plain markdown, nothing else. -->
1466
- `;var Dn=`<link rel="preconnect" href="https://fonts.googleapis.com">
1467
- <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap" rel="stylesheet">`;var Ta=e=>new Promise((t,n)=>{let o=document.createElement("script");o.src=e,o.onload=t,o.onerror=()=>n(new Error("could not load "+e)),document.head.appendChild(o)});async function Ma(){document.head.insertAdjacentHTML("beforeend",Dn);let e=document.createElement("style");e.textContent=Pn,document.head.appendChild(e),document.body.insertAdjacentHTML("afterbegin",Rn),await Promise.all([window.gsap?null:Ta("https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"),window.marked?null:Ta("https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.2/marked.min.js")]),await Promise.resolve().then(()=>(Ca(),Li))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Ma,{once:!0}):Ma();})();
1752
+ `;var Wa=`<link rel="preconnect" href="https://fonts.googleapis.com">
1753
+ <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap" rel="stylesheet">`;var Nn=e=>new Promise((t,a)=>{let o=document.createElement("script");o.src=e,o.onload=t,o.onerror=()=>a(new Error("could not load "+e)),document.head.appendChild(o)});async function _n(){document.head.insertAdjacentHTML("beforeend",Wa);let e=document.createElement("style");e.textContent=Na,document.head.appendChild(e),document.body.insertAdjacentHTML("afterbegin",_a),await Promise.all([window.gsap?null:Nn("https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"),window.marked?null:Nn("https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.2/marked.min.js")]),await Promise.resolve().then(()=>(Fn(),Ui))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",_n,{once:!0}):_n();})();