@codename/deck 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Warehouse SAS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,97 @@
1
- # Temporary Holding Version
1
+ # deck
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Slide decks as one web page. A deck is a `.deck.html` file: its Markdown, in Slidev's form, sits whole inside it, and a small renderer draws and presents it in any browser. Opened with scripts off, the same file shows its Markdown as plain text. The renderer also runs inside a host application (Jean is the first), changes a deck live as Markdown or on the slide, and saves it as a PowerPoint whose words, tables and charts stay editable.
4
+
5
+ ````html
6
+ <!doctype html>
7
+ <html lang="en" dir="ltr">
8
+ <meta charset="utf-8">
9
+ <title>A second oven</title>
10
+ <style>#deck{display:block;white-space:pre-wrap;…}</style>
11
+ <body>
12
+ <script type="text/markdown" id="deck">
13
+ ---
14
+ title: A second oven
15
+ layout: cover
16
+ ---
17
+
18
+ # A second oven
19
+
20
+ Plan for 2027 · Martin's bakery
21
+
22
+ ---
23
+ layout: two-cols
24
+ ---
25
+
26
+ ## Where we are
27
+
28
+ - 120 croissants a day, sold out by 10
29
+
30
+ ::right::
31
+
32
+ ```echarts
33
+ {"xAxis": {"type": "category", "data": ["Jan", "Feb"]}, "yAxis": {}, "series": [{"type": "bar", "data": [96, 104]}]}
34
+ ```
35
+ </script>
36
+ <script src="https://cdn.jsdelivr.net/npm/@codename/deck@0.1.0/dist/deck.js"></script>
37
+ </html>
38
+ ````
39
+
40
+ ## What it does
41
+
42
+ - **Layouts and looks as kits.** Seventeen layouts come with deck, Slidev's names and PowerPoint's usual ones. A kit adds others and a design system (DTCG tokens or a few flat ones) as data, never CSS. A slide that names no layout gets the one its content suits. See [docs/kits.md](docs/kits.md).
43
+ - **Light and dark** from the same tokens, every colour held at WCAG AA on its paper.
44
+ - **Presenting:** full screen, a clicker's keys, steps (`<v-clicks>`), Slidev's transitions and a Morph that needs nothing written, the presenter's view with notes and a timer, all slides at once.
45
+ - **Charts and diagrams:** ` ```echarts ` blocks drawn by ECharts, ` ```mermaid ` blocks drawn by [Pele](https://github.com/obsidianmd/pele) (every kind Mermaid has, from 17 KB a kind), each loaded the first time a slide needs it.
46
+ - **Changed three ways on one source:** as Markdown beside the slides, in place on a slide (a double click), or by a host's own means; each change goes back into the Markdown.
47
+ - **PowerPoint out, from the browser:** a layout per deck layout with placeholders, lists as lists, tables, native charts with their numbers, notes, transitions, the kit's colours as the theme. PowerPoint opens it without a repair. Keynote is not a target.
48
+ - **Every language:** right to left (layouts, charts and tables mirrored), CJK, upright scripts kept upright.
49
+ - **Read liberally:** what brains write in other dialects' habits (Pandoc's fenced divs, remark's and reveal.js's notes, headings as slides) is read without being rewritten. See [docs/format.md](docs/format.md).
50
+ - **Safe in a strict page:** the renderer builds with the DOM's own calls, sets no style attribute and needs no Trusted Types policy.
51
+
52
+ ## Use it
53
+
54
+ Open a `.deck.html` file in a browser. Write one with `writeDeckFile(markdown, options)`; read one with `readDeckFile(html)`, which never runs the page. Draw a deck in your own page with `createDeck(element, options)`. The API is in [docs/host.md](docs/host.md).
55
+
56
+ | Entry | What it is |
57
+ |---|---|
58
+ | `@codename/deck` (`dist/deck.mjs`) | The module for a host that brings its own `marked` (through an import map) |
59
+ | `@codename/deck/bundle` | The same with `marked` inside |
60
+ | `@codename/deck/file` (`dist/deck.js`) | The classic script a `.deck.html` links to or holds |
61
+ | `@codename/deck/css` | The stylesheet, for a host that loads its own |
62
+
63
+ A file links to its renderer by default, at this package's version on jsDelivr. A host can name another address, or hold the renderer whole (about 113 KB) for a file meant to work offline. On its way out of a host, a deck holds its pictures inside it as `data:` addresses (`inlinePictures`).
64
+
65
+ ## Commands
66
+
67
+ ```bash
68
+ npm install
69
+ npm run build # dist/: deck.js, deck.mjs, deck.bundle.mjs, deck.css
70
+ npm test # node --test: reading, files, kits, looks, pictures, Pele
71
+ npm run typecheck # tsc --noEmit, strict, over src/
72
+ npm run test:browsers # the examples in Chromium and WebKit from disk, offline; PowerPoint export; a strict host
73
+ npm run check # all three
74
+ npm run eval # ask brains for decks (LM Studio on localhost:1234), see eval/
75
+ ```
76
+
77
+ Browser tests need Playwright's browsers once: `npx playwright install chromium webkit`.
78
+
79
+ Commits carry no Co-Authored-By or Claude-Session trailer: `.claude/settings.json` turns Claude Code's attribution off for this repository, and `.githooks/commit-msg` refuses such a trailer whatever makes the commit (`npm install` points git at `.githooks`).
80
+
81
+ ## In this repository
82
+
83
+ | Path | What it is |
84
+ |---|---|
85
+ | `src/` | The renderer, its reader, kits, looks, the file, PowerPoint, repairs, pictures; JavaScript with JSDoc, checked by `tsc` |
86
+ | `test/` | Unit tests (`node --test`), browser tests, a strict host page, Mermaid samples |
87
+ | `examples/` | Decks in English, Arabic, Japanese, one with its own kit, one full of escapes; `make.mjs` writes their `.deck.html` |
88
+ | `eval/` | The brain evaluations: a draft skill, requests in four languages, replies, scores |
89
+ | `docs/` | The format, kits, the host API, and what phase 0 measured |
90
+
91
+ ## Status
92
+
93
+ 0.1.1, on npm as `@codename/deck`. It grew from Jean's phase 0 spike (October 2026); [docs/findings.md](docs/findings.md) says what was measured.
94
+
95
+ ## Licence
96
+
97
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,114 @@
1
+ function Be(t){let e=t.replace(/\r\n?/g,`
2
+ `).split(`
3
+ `).map(r=>({indent:r.length-r.trimStart().length,text:cn(r).trimEnd(),raw:r})),s=Te(e,{i:0},0);return s&&typeof s=="object"&&!Array.isArray(s)?s:{}}function cn(t){let e="";for(let n=0;n<t.length;n++){let s=t[n];if(e)s===e&&(e="");else if(s==='"'||s==="'")e=s;else if(s==="#"&&(n===0||/\s/.test(t[n-1])))return t.slice(0,n)}return t}function Te(t,e,n){for(;e.i<t.length&&!t[e.i].text.trim();)e.i++;if(e.i>=t.length||t[e.i].indent<n)return null;let s=t[e.i].indent;if(/^-(\s|$)/.test(t[e.i].text.trim())){let i=[];for(;e.i<t.length;){let l=t[e.i];if(!l.text.trim()){e.i++;continue}if(l.indent!==s||!/^-(\s|$)/.test(l.text.trim()))break;let a=l.text.trim().slice(1).trim();if(e.i++,!a)i.push(Te(t,e,s+1));else if(/^[^'"[{][^:]*:(\s|$)/.test(a)){let o=l.raw.indexOf(a);t.splice(e.i,0,{indent:o,text:" ".repeat(o)+a,raw:" ".repeat(o)+a}),i.push(Te(t,e,o))}else i.push(Re(a))}return i}let r={};for(;e.i<t.length;){let i=t[e.i];if(!i.text.trim()){e.i++;continue}if(i.indent!==s)break;let l=/^("(?:[^"\\]|\\.)*"|'(?:[^']|'')*'|[^:]+?)\s*:(?:\s+(.*))?$/.exec(i.text.trim());if(e.i++,!l)continue;let a=String(Re(l[1])),o=(l[2]??"").trim();o==="|"||o===">"||/^[|>][+-]$/.test(o)?r[a]=pn(t,e,s,o[0]===">"):o?r[a]=Re(o):r[a]=Te(t,e,s+1)}return r}function pn(t,e,n,s){let r=[];for(;e.i<t.length&&(!t[e.i].raw.trim()||t[e.i].indent>n);)r.push(t[e.i++].raw);for(;r.length&&!r.at(-1)?.trim();)r.pop();let i=Math.min(...r.filter(a=>a.trim()).map(a=>a.length-a.trimStart().length)),l=r.map(a=>a.slice(i)).join(`
4
+ `);return s?l.replace(/([^\n])\n(?=[^\n])/g,"$1 "):l}function Re(t){let e=t.trim();if(e.startsWith("[")||e.startsWith("{")){let n=$t(e,{i:0});if(n!==void 0)return n}if(/^"(?:[^"\\]|\\.)*"$/.test(e))try{return JSON.parse(e)}catch{return e.slice(1,-1)}return/^'(?:[^']|'')*'$/.test(e)?e.slice(1,-1).replace(/''/g,"'"):/^(true|yes|on)$/i.test(e)?!0:/^(false|no|off)$/i.test(e)?!1:/^(null|~)$/i.test(e)||e===""?null:/^[-+]?(\d+\.?\d*|\.\d+)(e[-+]?\d+)?$/i.test(e)?Number(e):e}function $t(t,e){let n=()=>{for(;/\s/.test(t[e.i]??"");)e.i++},s=()=>{if(n(),t[e.i]==="["||t[e.i]==="{")return $t(t,e);let l=e.i;if(t[e.i]==='"'||t[e.i]==="'"){let a=t[e.i++];for(;e.i<t.length&&!(t[e.i]===a&&t[e.i-1]!=="\\");)e.i++;e.i++}else for(;e.i<t.length&&!/[,\]}]/.test(t[e.i])&&!(t[e.i]===":"&&/^[\s,\]}]?$/.test(t[e.i+1]??""));)e.i++;return Re(t.slice(l,e.i))},r=t[e.i++];if(n(),r==="["){let l=[];for(;e.i<t.length&&t[e.i]!=="]";){if(l.push(s()),n(),t[e.i]===",")e.i++;else if(t[e.i]!=="]")return;n()}return e.i++,l}let i={};for(;e.i<t.length&&t[e.i]!=="}";){let l=s();if(n(),t[e.i]!==":")return;if(e.i++,i[String(l)]=s(),n(),t[e.i]===",")e.i++;else if(t[e.i]!=="}")return;n()}return e.i++,i}var un=/^::([\w-]+)::\s*$/;function Ee(t){let n=t.replace(/\r\n?/g,`
5
+ `).split(`
6
+ `),s=[0];for(let u of n)s.push(s.at(-1)+u.length+1);let r=[],i=0,l=null,a=!1;for(let u=0;u<n.length;u++){let c=n[u].trimEnd();if(a){a=At(c,!0);continue}if(c.startsWith("---")&&!/^---\s*-/.test(c)){if((u>i||l)&&r.push({start:i,end:u,matter:l}),l=null,i=u+1,c[3]!=="-"&&n[u+1]?.trim()&&/^\s*([\w-]+\s*:|#\s)/.test(n[u+1])&&!/^#{1,6}\s/.test(n[u+1])){let h=u+1;for(;h<n.length&&n[h].trimEnd()!=="---";)h++;l=[u+1,h],u=h,i=h+1}}else if(/^\s*(`{3,}|~{3,})/.test(c)){let h=/^\s*(`{3,}|~{3,})/.exec(c)[1],d=u+1;for(;d<n.length&&!n[d].trimStart().startsWith(h);)d++;d<n.length&&(u=d)}else a=At(c,!1)}(i<n.length||l)&&r.push({start:i,end:n.length,matter:l});let o=r.at(-1);if(r.length===1&&o){let u="",c=[];for(let h=o.start;h<o.end;h++){let d=/^\s*(`{3,}|~{3,})/.exec(n[h])?.[1];u?d&&n[h].trimStart().startsWith(u)&&(u=""):d?u=d:/^#{1,2}\s+\S/.test(n[h])&&c.push(h)}if(c.length>=2){r.pop();let h=c[0]>o.start&&!n.slice(o.start,c[0]).some(d=>d.trim())?c:[o.start,...c.slice(c[0]===o.start?1:0)];h.forEach((d,f)=>r.push({start:f===0?o.start:d,end:h[f+1]??o.end,matter:f===0?o.matter:null}))}}let p=r.map(({start:u,end:c,matter:h},d)=>dn(n,s,u,c,h,d)).filter((u,c)=>c===0||u.slots.some(h=>h.text.trim())||Object.keys(u.settings).length);return p.forEach((u,c)=>{u.index=c}),{settings:p[0]?.settings??{},slides:p}}function hn(t){let e=new Map,n=t.findIndex(a=>/^:{3,}[ \t]*\{?[ \t]*\.?columns\b/.test(a));if(n<0)return e;let s=/^:+/.exec(t[n])[0],r=t.findIndex((a,o)=>o>n&&a.trim()===s),i=t.map((a,o)=>[a,o]).filter(([a,o])=>Number(o)>n&&(r<0||Number(o)<r)&&/^:{3,}[ \t]*\{?[ \t]*\.?col(umn)?\b/.test(String(a))).map(([,a])=>Number(a));if(i.length<2)return e;let l=i.length===2?["left","right"]:["left","middle","right",...i.slice(3).map((a,o)=>`col-${o+4}`)];return i.forEach((a,o)=>e.set(a,l[o])),r>0&&t.slice(r+1).some(a=>a.trim())&&e.set(r,"bottom"),e}function At(t,e){let n=0;for(;;)if(e){let s=t.indexOf("-->",n);if(s<0)return!0;e=!1,n=s+3}else{let s=t.indexOf("<!--",n);if(s<0)return!1;let r=t.indexOf("-->",s+4);if(r<0)return!0;n=r+3}}function dn(t,e,n,s,r,i){let l=r?Be(t.slice(r[0],r[1]).join(`
7
+ `)):{},a=n;for(;a<s&&!t[a].trim();)a++;if(!r&&/^```ya?ml\s*$/.test(t[a]??"")){let P=a+1;for(;P<s&&!t[P].startsWith("```");)P++;l=Be(t.slice(a+1,P).join(`
8
+ `)),n=P+1}let o=t.slice(n,s).join(`
9
+ `),p="",u=/^(\?\?\?|Notes?:)[ \t]*(.*)$/m.exec(o);u&&u.index!==void 0&&!/^```/m.test(o.slice(u.index))&&(p=[u[2],o.slice(u.index+u[0].length)].join(`
10
+ `).trim(),o=o.slice(0,u.index)),o=o.replace(/<aside\b[^>]*class=["']?notes["']?[^>]*>([\s\S]*?)<\/aside>/gi,(P,T)=>(p+=(p?`
11
+ `:"")+T.replace(/<[^>]*>/g," ").replace(/[ \t]+/g," ").trim(),P.replace(/[^\n]/g," "))),o=o.replace(/^(:{3,})[ \t]*\{?[ \t]*\.?notes[ \t]*\}?[ \t]*\n([\s\S]*?)\n\1[ \t]*$/gm,(P,T,F)=>(p+=(p?`
12
+ `:"")+F.trim(),P.replace(/[^\n]/g," ")));let h=[...o.matchAll(/<!--([\s\S]*?)-->/g)].at(-1);h&&h.index!==void 0&&!o.slice(h.index+h[0].length).trim()&&(p=[h[1].trim(),p].filter(Boolean).join(`
13
+ `),o=o.slice(0,h.index));let d=[],f="default",k=n,m="",w=[],y=()=>d.push({name:f,text:w.join(`
14
+ `),start:e[k]}),O=hn(o.split(`
15
+ `));for(let[P,T]of o.split(`
16
+ `).entries()){let F=/^\s*(`{3,}|~{3,})/.exec(T)?.[1],X=un.exec(T)??(O.has(P)?[T,O.get(P)]:null);if(m)F&&T.trimStart().startsWith(m)&&(m="");else if(F)m=F;else if(X){y(),f=X[1],w=[],k=n+P+1;continue}w.push(T)}y();let U=d.filter((P,T)=>T>0||P.text.trim()||d.length===1),N=/^#{1,6}\s+(.+)$/m.exec(o.replace(/^```[\s\S]*?^```/gm,""));return{index:i,start:e[r?r[0]-1:n],end:e[s]-1,settings:l,slots:U,notes:p,title:String(l.title??N?.[1]??"").trim()}}var vt=/^[a-z][a-z0-9-]{0,31}$/,fn=/^(auto|min-content|max-content|\d{1,2}(\.\d)?fr|\d{1,3}%)$/,gn=["Title Slide","Title and Content","Section Header","Two Content","Comparison","Title Only","Blank","Content with Caption","Picture with Caption"],Ct={align:["start","center","end"],justify:["start","center","end"],paper:["paper","fill","ink","soft"],title:["normal","large","huge"]},Fe={title:"cover","title-slide":"cover","two-columns":"two-cols","two-column":"two-cols",columns:"two-cols",comparison:"two-cols-header","three-columns":"three-cols","section-header":"section",divider:"section",big:"fact",number:"fact","image-text":"image-right",closing:"end",thanks:"end"},Pe={name:"standard",tokens:{},layouts:Object.fromEntries(Object.entries({default:{label:{en:"Title and content",fr:"Titre et contenu"},pptx:"Title and Content"},cover:{label:{en:"Cover",fr:"Couverture"},justify:"center",paper:"fill",title:"huge",pptx:"Title Slide",numbered:!1},intro:{label:{en:"Introduction",fr:"Introduction"},justify:"center",paper:"fill",title:"large",pptx:"Title Slide",numbered:!1},section:{label:{en:"Section",fr:"Section"},justify:"center",paper:"ink",title:"huge",pptx:"Section Header",numbered:!1},center:{label:{en:"Centred",fr:"Centré"},justify:"center",align:"center",pptx:"Title Only"},statement:{label:{en:"Statement",fr:"Affirmation"},justify:"center",align:"center",title:"large",pptx:"Title Only"},fact:{label:{en:"Big number",fr:"Grand chiffre"},justify:"center",align:"center",title:"huge",pptx:"Title Only"},quote:{label:{en:"Quote",fr:"Citation"},justify:"center",pptx:"Title Only"},end:{label:{en:"Closing",fr:"Clôture"},justify:"center",align:"center",paper:"fill",title:"large",pptx:"Title Slide",numbered:!1},full:{label:{en:"Full",fr:"Plein cadre"},pptx:"Blank",numbered:!1},none:{label:{en:"Blank",fr:"Vide"},pptx:"Blank",numbered:!1},"two-cols":{label:{en:"Two columns",fr:"Deux colonnes"},slots:["default","right"],areas:"default right",columns:"1fr 1fr",pptx:"Two Content"},"two-cols-header":{label:{en:"Comparison",fr:"Comparaison"},slots:["default","left","right","bottom"],areas:"default default | left right | bottom bottom",columns:"1fr 1fr",rows:"auto 1fr auto",pptx:"Comparison"},"three-cols":{label:{en:"Three columns",fr:"Trois colonnes"},slots:["default","left","middle","right"],areas:"default default default | left middle right",columns:"1fr 1fr 1fr",rows:"auto 1fr",pptx:"Comparison"},"image-left":{label:{en:"Picture left",fr:"Image à gauche"},pptx:"Picture with Caption",justify:"center"},"image-right":{label:{en:"Picture right",fr:"Image à droite"},pptx:"Picture with Caption",justify:"center"},image:{label:{en:"Picture",fr:"Image"},pptx:"Blank",numbered:!1}}).map(([t,e])=>[t,Ze(e).layout]))};function Ze(t){let e=[];if(!t||typeof t!="object")return{layout:null,problems:["not a layout"]};let n={},s=Array.isArray(t.slots)||typeof t.slots=="string"?[t.slots].flat().map(String):t.slots&&typeof t.slots=="object"?Object.entries(t.slots).map(([f,k])=>(k&&typeof k=="object"&&(n[f]=mn(k)),f==="title"?"default":f)):["default"],r=[...new Set(s)];if(!r.every(f=>vt.test(f)))return{layout:null,problems:["a slot name is not a-z, 0-9 and -"]};r.includes("default")||r.unshift("default");let l=(Array.isArray(t.areas)?t.areas.map(f=>[f].flat().join(" ")):String(t.areas??r.join(" ")).split(/\||\n/)).map(f=>f.trim().replace(/^"|"$/g,"").split(/\s+/)).filter(f=>f.length&&f[0]),a=l[0]?.length??0;if(!l.length||l.some(f=>f.length!==a)||l.flat().some(f=>f!=="."&&!r.includes(f)))return{layout:null,problems:["areas are not a rectangle of its slots"]};for(let f of r){let k=l.flatMap((y,O)=>y.map((U,N)=>[U,N,O])).filter(([y])=>y===f);if(!k.length){f!=="default"&&e.push(`slot ${f} has no area`);continue}let m=k.map(y=>y[1]),w=k.map(y=>y[2]);if(k.length!==(Math.max(...m)-Math.min(...m)+1)*(Math.max(...w)-Math.min(...w)+1))return{layout:null,problems:[`slot ${f} is not a rectangle`]}}let o=(f,k)=>{let m=f===void 0?Array(k).fill("1fr"):(Array.isArray(f)?f:String(f).split(/\s+/)).map(String);return m.length===k&&m.every(w=>fn.test(w))?m:null},p=o(t.columns,a),u=o(t.rows,l.length);if(!p||!u)return{layout:null,problems:["columns or rows are not tracks deck knows (auto, 1fr, 40%…), one per column or row"]};let c=(f,k)=>{let m=String(t[f]??k);return Ct[f].includes(m)?m:(e.push(`${f} ${m} is not one of ${Ct[f].join(", ")}`),k)},h=typeof t.label=="string"||t.label&&typeof t.label=="object"?t.label:void 0,d=f=>typeof f=="string"?f.slice(0,300):void 0;return{layout:{label:h,intent:d(t.intent),use_when:d(t.use_when),avoid_when:d(t.avoid_when),slots:r,budgets:n,areas:l,columns:p,rows:u,align:c("align","start"),justify:c("justify","start"),paper:c("paper","paper"),title:c("title","normal"),pptx:gn.includes(t.pptx)?t.pptx:r.length>1?"Comparison":"Title and Content",numbered:t.numbered!==!1},problems:e}}function mn(t){let e={};for(let n of["max_words","max_chars","item_max_words","heading_max_words"])Number.isInteger(t[n])&&t[n]>0&&(e[n]=t[n]);return Array.isArray(t.items)&&t.items.length===2&&t.items.every(Number.isInteger)&&(e.items=t.items),typeof t.required=="boolean"&&(e.required=t.required),typeof t.kind=="string"&&/^[a-z-]{1,20}$/.test(t.kind)&&(e.kind=t.kind),e}function Tt(t){if(!t||typeof t!="object")return{};if(!JSON.stringify(t).includes('"$value"'))return t;let e=h=>h&&typeof h=="object"&&"$value"in h?h.$value:h,n=h=>{let d=e(h);return typeof d=="string"?d:typeof d?.hex=="string"?d.hex:void 0},s=h=>{let d=e(h);return Array.isArray(d)?d.map(String):typeof d=="string"?[d]:void 0},r={bg:"paper",background:"paper",paper:"paper",fg:"ink",text:"ink",ink:"ink",accent:"primary",primary:"primary",muted:"muted",surface:"soft",soft:"soft"},i=h=>Object.fromEntries(Object.entries(h??{}).filter(([d])=>d in r).map(([d,f])=>[r[d],n(f)]).filter(([,d])=>d)),l=t.color??t.colour??{},a={...i(l),...i(l.light)},o=i(l.dark);Object.keys(o).length&&(a.dark=o);let p=t.font??t.fontFamily??{},u=s(p.heading??p.display??p.sans),c=s(p.body??p.text??p.sans);return(u||c)&&(a.fonts={heading:u??c,body:c??u}),a}function ze(...t){let e={name:"standard",tokens:{},layouts:{...Pe.layouts}},n=[];for(let s of t)if(!(!s||typeof s!="object")){typeof s.name=="string"&&(e.name=s.name),s.tokens&&typeof s.tokens=="object"&&(e.tokens={...e.tokens,...Tt(s.tokens)});for(let[r,i]of Object.entries(s.layouts??s.types??{})){if(!vt.test(r)){n.push(`layout ${r}: not a-z, 0-9 and -`);continue}let{layout:l,problems:a}=Ze(i);n.push(...a.map(o=>`layout ${r}: ${o}`)),l&&(e.layouts[r]=l)}}return{kit:e,problems:n}}function He(t,e,n){return typeof t.label=="string"?t.label:t.label?.[n]??t.label?.[n.split("-")[0]]??t.label?.en??e}function Ue(t){let e=t.slots.map(r=>r.name);if(e.includes("middle"))return"three-cols";if(e.includes("left"))return"two-cols-header";if(e.includes("right"))return"two-cols";if(t.index===0)return"cover";let s=t.slots.map(r=>r.text).join(`
17
+ `).trim().split(`
18
+ `).filter(r=>r.trim());return s.length===1&&/^#{1,2}\s+\S/.test(s[0])?"section":/^#\s+[^\s]*\d[\d\s.,%€$£¥]*\S*\s*$/u.test(s[0]??"")&&s.length<=3&&!/^\s*[-*\d]+[.)]?\s/m.test(s.slice(1).join(`
19
+ `))?"fact":s.length&&s.every((r,i)=>r.startsWith(">")||i===s.length-1&&!r.startsWith("#"))&&s[0].startsWith(">")?"quote":"default"}function x(t,e={},n=[]){let s=document.createElement(t);for(let[r,i]of Object.entries(e))i!==void 0&&i!==!1&&s.setAttribute(r,i===!0?"":String(i));for(let r of n)(r||r==="")&&s.append(r);return s}function kn(t){let e=String(t??"").trim();return/^(https?:|mailto:|blob:|#)/i.test(e)||/^data:image\/(png|jpe?g|gif|webp|avif|svg\+xml);/i.test(e)?e:/^[a-z][\w+.-]*:/i.test(e)?null:e}function Le(t,e){let n=String(t.settings.layout??"").trim().toLowerCase(),s=e.kit.layouts[n]?n:e.kit.layouts[Fe[n]]?Fe[n]:Ue(t),r=e.kit.layouts[s]??Pe.layouts.default,i=String(t.settings.class??"").split(/\s+/).filter(h=>["invert","text-center","text-left"].includes(h)),l={step:0},a=new Map(t.slots.map(h=>[h.name,h])),o=r.slots,p=x("section",{class:["deck-slide",`deck-layout-${s}`,...i.map(h=>`deck-class-${h}`)].join(" "),"data-index":t.index,"data-layout":s,"data-paper":r.paper,"data-align":r.align,"data-justify":r.justify,"data-title":r.title,"aria-roledescription":e.slide,role:"group"}),u=x("div",{class:"deck-canvas"});u.style.setProperty("grid-template-areas",r.areas.map(h=>`"${h.map(d=>d==="."?".":`s-${d}`).join(" ")}"`).join(" ")),u.style.setProperty("grid-template-columns",r.columns.join(" ")),u.style.setProperty("grid-template-rows",r.rows.join(" ")),p.append(u);let c=t.settings.image??t.settings.background;if(typeof c=="string"&&["image-left","image-right","image","cover"].includes(s)){let h=e.resolve(c);if(h){let d=x("div",{class:"deck-image",role:"img","aria-label":String(t.settings.alt??"")||void 0});d.style.setProperty("--deck-image",`url("${h.replace(/["\\\n]/g,encodeURIComponent)}")`),u.append(d),p.classList.add("has-image")}}for(let h of o){let d=a.get(h),f=x("div",{class:"deck-slot","data-slot":h},d?Rt(d,e,l):[]);f.style.setProperty("grid-area",`s-${h}`),u.append(f)}for(let h of t.slots)o.includes(h.name)||u.append(x("div",{class:"deck-slot","data-slot":h.name},Rt(h,e,l)));return r.numbered&&t.settings.paginate!==!1&&p.append(x("span",{class:"deck-number","aria-hidden":"true"},[e.number(t.index+1)])),{element:p,steps:l.step}}function Rt(t,e,n){let s=e.lex(t.text),r=[],i=t.start,l="";for(let a of s){let o=i;i+=a.raw.length;let p=a.type==="paragraph"?a.raw.trim().split(`
20
+ `).map(c=>c.trim()):[];if(p.length&&p.every(c=>/^:{3,}/.test(c))){for(let c of p)/^:{3,}[ \t]*\{?[ \t]*\.?incremental\b/.test(c)?l="clicks":/^:{3,}\s*$/.test(c)&&l==="clicks"&&(l="");continue}if(a.type==="html"){let c=/^\s*<(\/?)(v-clicks?|br)\b[^>]*>\s*$/i.exec(a.raw);if(c&&c[2]==="br")r.push(x("br"));else if(c)l=c[1]?"":c[2].toLowerCase()==="v-clicks"?"clicks":"click";else if(/<li\b/i.test(a.raw)){let h=x(/<ol\b/i.test(a.raw)?"ol":"ul",{dir:"auto"});for(let[,d,f]of a.raw.matchAll(/<li\b([^>]*)>([\s\S]*?)(?=<\/li>|<li\b|<\/[ou]l>|$)/gi)){let k=f.replace(/<!--[\s\S]*?-->/g,"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();if(!k)continue;let m=x("li",{dir:"auto"},[k]);(/\bv-click\b/.test(d)||l==="clicks")&&Ge(m,++n.step),h.append(m)}h.childElementCount&&r.push(h)}else{let h=a.raw.replace(/<!--[\s\S]*?-->/g,"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();h&&r.push(x("p",{},[h]))}continue}let u=Qe(a,o,e,l==="clicks"?n:null);u&&((l==="click"||l==="clicks"&&a.type!=="list")&&Ge(u,++n.step),r.push(u))}return r}var Ge=(t,e)=>{t.classList.add("deck-step"),t.setAttribute("data-step",String(e))};function Qe(t,e,n,s){switch(t.type){case"heading":{let r=/^\s*#{1,6}[ \t]+/.exec(t.raw),i=r?We(e+r[0].length,e+t.raw.replace(/\s*#*\s*$/,"").length):void 0;return n.headings==="real"?x(`h${t.depth}`,{dir:"auto","data-edit":i},W(t.tokens,n)):x("p",{class:`deck-h deck-h${t.depth}`,role:"heading","aria-level":Math.min(6,t.depth+2),dir:"auto","data-edit":i},W(t.tokens,n))}case"paragraph":{let r=t.tokens.length===1&&t.tokens[0].type==="image";return x("p",{dir:"auto",class:r?"deck-picture":void 0,"data-edit":r?void 0:We(e,e+t.raw.trimEnd().length)},W(t.tokens,n))}case"text":return x("p",{dir:"auto"},W(t.tokens??[{type:"text",text:t.text}],n));case"blockquote":return x("blockquote",{},bn(t.tokens,e,t.raw,n));case"list":{let r=0,i=x(t.ordered?"ol":"ul",{start:t.ordered&&t.start!==1?t.start:void 0,class:t.items.some(l=>l.task)?"deck-tasks":void 0});for(let l of t.items){let a=t.raw.indexOf(l.raw,r);r=a+l.raw.length;let o=e+Math.max(0,a),p=/^\s*(?:[-*+]|\d+[.)])\s+(?:\[[ xX]\]\s+)?/.exec(l.raw),u=l.tokens.length===1&&l.tokens[0].type==="text"&&!/\n\s*\S/.test(l.raw.trim().split(`
21
+ `).slice(1).join(`
22
+ `)),c=x("li",{dir:"auto","data-edit":u&&p?We(o+p[0].length,o+l.raw.trimEnd().length):void 0},[l.task?x("input",{type:"checkbox",checked:l.checked,disabled:!0,"aria-label":l.text}):null,...l.tokens.flatMap(h=>h.type==="text"?W(h.tokens??[{type:"text",text:h.text}],n):[Qe(h,o+Math.max(0,l.raw.indexOf(h.raw)),n,null)])]);s&&Ge(c,++s.step),i.append(c)}return i}case"code":{let r=/^(\S*)\s*(?:\{([^}]*)\})?/.exec(t.lang??"")??[],i=(r[1]??"").toLowerCase(),l=n.blocks[i];if(l){let p=x("div",{class:`deck-block deck-${i}`,"data-source":t.text});return p.append(x("pre",{class:"deck-block-source",dir:"ltr"},[x("code",{},[t.text])])),queueMicrotask(()=>Promise.resolve(l(p,t.text)).catch(()=>p.classList.add("is-failed"))),p}let a=xn(r[2]??""),o=x("code",{class:i?`language-${i}`:void 0});for(let[p,u]of t.text.split(`
23
+ `).entries())o.append(x("span",{class:a.has(p+1)?"deck-line is-marked":"deck-line"},[u,`
24
+ `]));return x("pre",{dir:"ltr",class:a.size?"has-marks":void 0,tabindex:0},[o])}case"table":{let r=i=>i??void 0;return x("div",{class:"deck-table"},[x("table",{},[x("thead",{},[x("tr",{},t.header.map((i,l)=>x("th",{"data-align":r(t.align[l]),dir:"auto"},W(i.tokens,n))))]),x("tbody",{},t.rows.map(i=>x("tr",{},i.map((l,a)=>x("td",{"data-align":r(t.align[a]),dir:"auto"},W(l.tokens,n))))))])])}default:return null}}function bn(t,e,n,s){let r=0;return t.map(i=>{let l=n.indexOf(i.raw,r);return r=Math.max(r,l+i.raw.length),Qe(i,e+Math.max(0,l),s,null)})}function xn(t){let e=new Set;for(let n of t.split(/[,|]/)){let[s,r]=n.split("-").map(i=>parseInt(i,10));if(Number.isFinite(s))for(let i=s;i<=(Number.isFinite(r)?r:s);i++)e.add(i)}return e}var We=(t,e)=>e>t?`${t}-${e}`:void 0;function W(t=[],e){return t.flatMap(n=>{switch(n.type){case"text":case"escape":return n.tokens?W(n.tokens,e):[n.text.replace(/&(amp|lt|gt|quot|#39);/g,(s,r)=>({amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"})[r])];case"strong":return[x("strong",{},W(n.tokens,e))];case"em":return[x("em",{},W(n.tokens,e))];case"del":return[x("del",{},W(n.tokens,e))];case"codespan":return[x("code",{},[n.text.replace(/&(amp|lt|gt|quot|#39);/g,(s,r)=>({amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"})[r])])];case"br":return[x("br")];case"link":{let s=kn(n.href);return s?[x("a",{href:s,rel:"noopener noreferrer",target:s.startsWith("#")?void 0:"_blank"},W(n.tokens,e))]:W(n.tokens,e)}case"image":{let s=e.resolve(n.href);return s?[x("img",{src:s,alt:n.text,loading:"lazy"})]:[n.text]}case"html":return/^<br\s*\/?>$/i.test(n.raw)?[x("br")]:[];default:return n.text?[n.text]:[]}})}var Ve={default:{paper:"#fffdf8",ink:"#1d1b16",primary:"#f7c531",voice:"calm",radius:10},ocean:{paper:"#f6fafb",ink:"#0d2530",primary:"#0f766e",voice:"calm",radius:6},ember:{paper:"#fff8f3",ink:"#2a160c",primary:"#d9480f",voice:"bold",radius:2},ink:{paper:"#ffffff",ink:"#111111",primary:"#3b5bdb",voice:"elegant",radius:0}},Ke={calm:{heading:'ui-sans-serif, system-ui, "Segoe UI", Roboto, "Noto Sans", sans-serif',body:'ui-sans-serif, system-ui, "Segoe UI", Roboto, "Noto Sans", sans-serif'},elegant:{heading:'ui-serif, "Iowan Old Style", Georgia, "Noto Serif", serif',body:'ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif'},bold:{heading:'"Avenir Next Condensed", "Arial Narrow", ui-sans-serif, system-ui, sans-serif',body:'ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif'},friendly:{heading:'ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif',body:'ui-rounded, "SF Pro Rounded", system-ui, sans-serif'}};function Ye(t,e={}){let n=Ve[String(t.theme??"")]??Ve.default,s=typeof t.themeConfig=="object"&&t.themeConfig?t.themeConfig:{},r={...n,...Et(e),...Et(s)};return Ke[r.voice]||(r.voice="calm"),r}function Et(t){let e={};for(let n of["paper","ink","primary","muted","soft"])typeof t[n]=="string"&&ne(t[n])&&(e[n]=t[n]);return t.dark&&typeof t.dark=="object"&&(e.dark=Object.fromEntries(Object.entries(t.dark).filter(([,n])=>typeof n=="string"&&ne(n)))),t.fonts&&Array.isArray(t.fonts.heading)&&Array.isArray(t.fonts.body)&&(e.fonts={heading:t.fonts.heading.map(String),body:t.fonts.body.map(String)}),typeof t.voice=="string"&&(e.voice=t.voice),typeof t.radius=="number"&&(e.radius=t.radius),e}function Je(t,e){let n=ne(t.paper)??[255,253,248],s=ne(t.ink)??[29,27,22],r=e==="dark"?t.dark??{}:{},i=ke(ne(r.paper??"")??(e==="dark"?de(s,[0,0,0],.35):n)),l=ke(ne(r.ink??"")??(e==="dark"?de(n,[255,255,255],.2):s)),a=ne(r.primary??t.primary)??[247,197,49],o=Me(a,i,4.5),p=_e(l,a)>=_e(i,a)?l:i,u=[0,1,2,3,4,5].map(c=>Me(yn(a,c*57),i,3));return{paper:ie(i),ink:ie(l),muted:ie(Me(ke(ne(r.muted??(e==="light"?t.muted??"":""))??de(l,i,.38)),i,4.5)),line:ie(de(l,i,.82)),primary:ie(o),onPrimary:ie(p),soft:ie(ne(r.soft??(e==="light"?t.soft??"":""))??de(a,i,.78)),series:u.map(ie)}}function ne(t){let e=/^#?([\da-f]{3}|[\da-f]{6})$/i.exec(String(t).trim());if(!e)return null;let n=e[1].length===3?[...e[1]].map(s=>s+s).join(""):e[1];return[0,2,4].map(s=>parseInt(n.slice(s,s+2),16))}var ie=t=>`#${t.map(e=>Math.round(Math.max(0,Math.min(255,e))).toString(16).padStart(2,"0")).join("")}`,ke=t=>t.map(e=>Math.round(Math.max(0,Math.min(255,e)))),de=(t,e,n)=>t.map((s,r)=>s+(e[r]-s)*n);function Xe(t){let[e,n,s]=t.map(r=>{let i=r/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4});return .2126*e+.7152*n+.0722*s}function _e(t,e){let[n,s]=[Xe(t),Xe(e)].sort((r,i)=>i-r);return(n+.05)/(s+.05)}function Me(t,e,n){let s=Xe(e)>.18?[0,0,0]:[255,255,255],r=0,i=ke(t);for(;_e(i,e)<n&&r<1;)i=ke(de(t,s,r=Math.min(1,r+.02)));return i}function yn(t,e){let[n,s,r]=t.map(w=>w/255),i=Math.max(n,s,r),l=Math.min(n,s,r),a=(i+l)/2,o=i-l,p=o===0?0:o/(1-Math.abs(2*a-1)),u=o===0?0:i===n?(s-r)/o%6:i===s?(r-n)/o+2:(n-s)/o+4;u=(u*60+e+360)%360;let c=(1-Math.abs(2*a-1))*Math.max(p,.55),h=c*(1-Math.abs(u/60%2-1)),d=a-c/2,[f,k,m]=u<60?[c,h,0]:u<120?[h,c,0]:u<180?[0,c,h]:u<240?[0,h,c]:u<300?[h,0,c]:[c,0,h];return[f+d,k+d,m+d].map(w=>w*255)}var Pt={en:{deck:"Slides",slide:"slide",carousel:"carousel",previous:"Previous",next:"Next",present:"Present full screen",presenter:"Presenter view",overview:"All slides",edit:"Change",scheme:"Light or dark",export:"Save as PowerPoint",source:"The deck as text",notes:"Notes",noNotes:"No notes for this slide.",upNext:"Next",last:"Last slide",where:"Slide {n} of {count}",saved:"Saved"},fr:{deck:"Diapositives",slide:"diapositive",carousel:"carrousel",previous:"Précédente",next:"Suivante",present:"Présenter en plein écran",presenter:"Vue présentateur",overview:"Toutes les diapositives",edit:"Modifier",scheme:"Clair ou sombre",export:"Enregistrer en PowerPoint",source:"La présentation en texte",notes:"Notes",noNotes:"Pas de notes pour cette diapositive.",upNext:"Ensuite",last:"Dernière diapositive",where:"Diapositive {n} sur {count}",saved:"Enregistré"},ar:{deck:"الشرائح",slide:"شريحة",carousel:"عرض شرائح",previous:"السابقة",next:"التالية",present:"العرض بملء الشاشة",presenter:"عرض المقدّم",overview:"كل الشرائح",edit:"تعديل",scheme:"فاتح أو داكن",export:"الحفظ بصيغة PowerPoint",source:"العرض كنص",notes:"الملاحظات",noNotes:"لا ملاحظات لهذه الشريحة.",upNext:"التالية",last:"الشريحة الأخيرة",where:"الشريحة {n} من {count}",saved:"تم الحفظ"},ja:{deck:"スライド",slide:"スライド",carousel:"カルーセル",previous:"前へ",next:"次へ",present:"全画面で発表",presenter:"発表者ビュー",overview:"すべてのスライド",edit:"編集",scheme:"ライトまたはダーク",export:"PowerPoint で保存",source:"テキストとしてのスライド",notes:"メモ",noNotes:"このスライドにメモはありません。",upNext:"次",last:"最後のスライド",where:"スライド {n} / {count}",saved:"保存しました"}},zt=t=>Pt[t.split("-")[0].toLowerCase()]??Pt.en;function st(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var pe=st();function Ft(t){pe=t}var oe={exec:()=>null};function fe(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),r=e[s];return r||(r=t(s),e[s]=r),r}}function S(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(_.caret,"$1"),n=n.replace(r,l),s},getRegex:()=>new RegExp(n,e)};return s}var wn=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),_={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:fe(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:fe(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:fe(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:fe(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:fe(t=>new RegExp(`^ {0,${t}}(?:</?(?:${we})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:fe(t=>new RegExp(`^ {0,${t}}>`))},Sn=/^(?:[ \t]*(?:\n|$))+/,$n=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,An=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ye=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Cn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,it=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Zt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ht=S(Zt).replace(/bull/g,it).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),vn=S(Zt).replace(/bull/g,it).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),lt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Tn=/^[^\n]+/,at=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Rn=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",at).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),En=S(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,it).getRegex(),we="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ot=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pn=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ot).replace("tag",we).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ut=t=>S(lt).replace("hr",ye).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",we).getRegex(),zn=Ut(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Ln=Ut(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Mn=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ln).getRegex(),ct={blockquote:Mn,code:$n,def:Rn,fences:An,heading:Cn,hr:ye,html:Pn,lheading:Ht,list:En,newline:Sn,paragraph:zn,table:oe,text:Tn},Lt=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ye).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",we).getRegex(),_n={...ct,lheading:vn,table:Lt,paragraph:S(lt).replace("hr",ye).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Lt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",we).getRegex()},On={...ct,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ot).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:oe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(lt).replace("hr",ye).replace("heading",` *#{1,6} *[^
25
+ ]`).replace("lheading",Ht).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},In=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,jn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Wt=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Nn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ee=/[\p{P}\p{S}]/u,ge=/[\s\p{P}\p{S}]/u,Se=/[^\s\p{P}\p{S}]/u,Dn=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ge).getRegex(),qn=/[\p{Pi}\p{Ps}"']/u,Gt=/(?!~)[\p{P}\p{S}]/u,Bn=/(?!~)[\s\p{P}\p{S}]/u,Fn=/(?:[^\s\p{P}\p{S}]|~)/u,Zn=S(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",wn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Qt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Hn=S(Qt,"u").replace(/punct/g,ee).getRegex(),Un=S(Qt,"u").replace(/punct/g,Gt).getRegex(),Wn=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Gn=S(Wn,"u").replace(/openQuote/g,qn).replace(/punct/g,ee).getRegex(),Vt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Qn=S(Vt,"gu").replace(/notPunctSpace/g,Se).replace(/punctSpace/g,ge).replace(/punct/g,ee).getRegex(),Vn=S(Vt,"gu").replace(/notPunctSpace/g,Fn).replace(/punctSpace/g,Bn).replace(/punct/g,Gt).getRegex(),Xn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Kn=S(Xn,"gu").replace(/notPunctSpace/g,Se).replace(/punctSpace/g,ge).replace(/punct/g,ee).getRegex(),Yn=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Se).replace(/punctSpace/g,ge).replace(/punct/g,ee).getRegex(),Jn="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",er=S(Jn,"gu").replace(/notPunctSpace/g,Se).replace(/punctSpace/g,ge).replace(/punct/g,ee).getRegex(),tr=S(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ee).getRegex(),nr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",rr=S(nr,"gu").replace(/notPunctSpace/g,Se).replace(/punctSpace/g,ge).replace(/punct/g,ee).getRegex(),sr=S(/\\(punct)/,"gu").replace(/punct/g,ee).getRegex(),ir=S(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,ee).getRegex(),lr=S(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ar=S(ot).replace("(?:-->|$)","-->").getRegex(),or=S("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ar).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xt=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Ie=S(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Xt).getRegex(),cr=S(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Ie).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pr=S(/^!?\[(label)\]\[(ref)\]/).replace("label",Ie).replace("ref",at).getRegex(),ur=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",at).getRegex(),Mt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,hr=S(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Xt).getRegex(),dr=S("reflink|nolink(?!\\()","g").replace("reflink",S(/^!?\[(label)\]\[(ref)\]/).replace("label",hr).replace("ref",Mt).getRegex()).replace("nolink",S(/^!?\[(ref)\](?:\[\])?/).replace("ref",Mt).getRegex()).getRegex(),_t=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,fr=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,gr=S(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,fr).getRegex(),pt={_backpedal:oe,anyPunctuation:sr,anyPunctuationOutsideCode:ir,autolink:lr,blockSkip:Zn,br:Wt,code:jn,del:oe,delLDelim:oe,delRDelim:oe,emStrongLDelim:Hn,emStrongRDelimAst:Qn,emStrongRDelimUnd:Yn,escape:In,link:cr,nolink:ur,punctuation:Dn,reflink:pr,reflinkSearch:dr,tag:or,text:Nn,url:oe},mr={...pt,emStrongLDelim:Gn,emStrongRDelimAst:Kn,emStrongRDelimUnd:er,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",Ie).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ie).getRegex()},tt={...pt,emStrongRDelimAst:Vn,emStrongLDelim:Un,delLDelim:tr,delRDelim:rr,url:S(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",gr).replace("protocol",_t).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:S(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",_t).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},kr={...tt,br:S(Wt).replace("{2,}","*").getRegex(),text:S(tt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Oe={normal:ct,gfm:_n,pedantic:On},be={normal:pt,gfm:tt,breaks:kr,pedantic:mr},br={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ot=t=>br[t];function G(t,e){if(e){if(_.escapeTest.test(t))return t.replace(_.escapeReplace,Ot)}else if(_.escapeTestNoEncode.test(t))return t.replace(_.escapeReplaceNoEncode,Ot);return t}function xr(t){return _.numericCharacterReference.test(t)?t.replace(_.numericCharacterReferenceOrAmpersand,(e,n,s)=>{if(n===void 0&&s===void 0)return"&amp;";let r=n===void 0?Number.parseInt(s,16):Number.parseInt(n,10);return r===0||r>1114111||r>=55296&&r<=57343?"�":r===38?"&amp;":String.fromCodePoint(r)}):t}function It(t){try{t=encodeURI(t).replace(_.percentDecode,"%")}catch{return null}return t}function jt(t,e){let n=t.replace(_.findPipe,(i,l,a)=>{let o=!1,p=l;for(;--p>=0&&a[p]==="\\";)o=!o;return o?"|":" |"}),s=n.split(_.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(_.slashPipe,"|");return s}function le(t,e,n){let s=t.length;if(s===0)return"";let r=0;for(;r<s;){let i=t.charAt(s-r-1);if(i===e&&!n)r++;else if(i!==e&&n)r++;else break}return t.slice(0,s-r)}function Nt(t){let e=t.split(`
26
+ `),n=e.length-1;for(;n>=0&&_.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
27
+ `)}function je(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function Dt(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function et(t,e=0){let n=e,s="";for(let r of t)if(r===" "){let i=4-n%4;s+=" ".repeat(i),n+=i}else s+=r,n++;return s}function qt(t,e,n,s,r){let i=e.href,l=e.title||null,a=t[1].replace(r.other.outputLinkReplace,"$1"),o=t[0].charAt(0)==="!",p=s.state.inLink,u=s.state.linkEmitted,c=s.state.inRawBlock;s.state.inLink=!0,s.state.linkEmitted=!1;let h=s.inlineTokens(a),d=s.state.linkEmitted;if(s.state.linkEmitted=u,s.state.inLink=p,!o){if(d){s.state.inRawBlock=c;return}s.state.linkEmitted=!0}return{type:o?"image":"link",raw:n,href:i,title:l,text:a,tokens:h}}function yr(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
28
+ `).map(i=>{let l=i.match(n.other.beginningSpace);if(l===null)return i;let[a]=l;return i.slice(Math.min(a.length,r.length))}).join(`
29
+ `)}function Bt(t,e,n,s){if(!e.includes("<"))return!1;for(let r=0;r<e.length;r++){if(e[r]==="\\"){r++;continue}if(e[r]==="`"){let a=s.inline.code.exec(e.slice(r));if(a){r+=a[0].length-1;continue}}if(e[r]!=="<")continue;let i=t.slice(n+r),l=s.inline.tag.exec(i)||s.inline.autolink.exec(i);if(l){if(l[0].length>e.length-r)return!0;r+=l[0].length-1}}return!1}var Ne=class{options;rules;lexer;constructor(t){this.options=t||pe}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:Nt(e[0]),s=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=yr(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=le(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(n=s.trim())}return{type:"heading",raw:le(e[0],`
30
+ `),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:le(e[0],`
31
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=le(e[0],`
32
+ `).split(`
33
+ `),s="",r="",i=[];for(;n.length>0;){let l=!1,a=[],o;for(o=0;o<n.length;o++)if(this.rules.other.blockquoteStart.test(n[o]))a.push(n[o]),l=!0;else if(!l)a.push(n[o]);else break;n=n.slice(o);let p=a.join(`
34
+ `),u=p.replace(this.rules.other.blockquoteSetextReplace,`
35
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
36
+ ${p}`:p,r=r?`${r}
37
+ ${u}`:u;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=c,n.length===0)break;let h=i.at(-1);if(h?.type==="code"||h?.type==="heading"||h?.type==="hr"||h?.type==="html")break;if(h?.type==="blockquote"){let d=h,f=n.join(`
38
+ `),k=d.raw+`
39
+ `+f.replace(this.rules.other.blockquoteSetextReplace2,""),m=this.blockquote(k);i[i.length-1]=m;let w=k.substring(m.raw.length).replace(/^\n/,""),y=w?w.split(`
40
+ `).length:0,O=y?n.slice(0,-y):n;O.length>0&&(s=`${s}
41
+ ${O.join(`
42
+ `)}`),r=r.substring(0,r.length-d.text.length)+m.text;break}else if(h?.type==="list"){let d=h,f=d.raw+`
43
+ `+n.join(`
44
+ `),k=this.list(f);i[i.length-1]=k,s=s.substring(0,s.length-h.raw.length)+k.raw,r=r.substring(0,r.length-d.raw.length)+k.raw,n=f.substring(i.at(-1).raw.length).split(`
45
+ `);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=t,s=()=>n.length-t.length,r=e[1].trim(),i=r.length>1,l={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");let a=this.rules.other.listItemRegex(r),o=!1;for(;t;){let u=!1,c="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;let h=s();t=t.substring(e[0].length);let d=e[2].split(`
46
+ `,1)[0],f=e[1].length,k=this.options.pedantic?et(d,f):d.replace(this.rules.other.leadingSpaceTab,U=>et(U,f)),m=t.split(`
47
+ `,1)[0],w=!k.trim(),y=0;if(this.options.pedantic?(y=2,c=k.trimStart()):w?y=f+1:(y=k.search(this.rules.other.nonSpaceChar),y=y>4?1:y,c=k.slice(y),y+=f),w&&this.rules.other.blankLine.test(m)&&(t=t.substring(m.length+1),u=!0),!u){let U=this.rules.other.nextBulletRegex(y),N=this.rules.other.hrRegex(y),P=this.rules.other.fencesBeginRegex(y),T=this.rules.other.headingBeginRegex(y),F=this.rules.other.htmlBeginRegex(y),X=this.rules.other.blockquoteBeginRegex(y);for(;t;){let D=t.split(`
48
+ `,1)[0],K;if(m=D,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),K=m):K=m.replace(this.rules.other.leadingSpaceTab,J=>et(J)),P.test(m)||T.test(m)||F.test(m)||X.test(m)||U.test(m)||N.test(m))break;if(K.search(this.rules.other.nonSpaceChar)>=y||!m.trim())c+=`
49
+ `+K.slice(y);else{if(w||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||P.test(k)||T.test(k)||N.test(k))break;c+=`
50
+ `+m}w=!m.trim(),t=t.substring(D.length+1),k=K.slice(y)}}let O=n.slice(h,s());l.loose||(o?l.loose=!0:this.rules.other.doubleBlankLine.test(O)&&(o=!0)),l.items.push({type:"list_item",raw:O,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]})}let p=l.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;l.raw=n.slice(0,s()).trimEnd();for(let u of l.items)if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),!l.loose){let c=u.tokens.filter(d=>d.type==="space"),h=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));l.loose=h}for(let u of l.items){let c=u.tokens[0];if(u.task&&(c?.type==="text"||c?.type==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(u.raw);if(h){let d={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};u.checked=d.checked,l.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=d.raw+u.tokens[0].raw,u.tokens[0].text=d.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(d)):u.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):u.tokens.unshift(d)}}else u.task&&(u.task=!1)}if(l.loose)for(let u of l.items){u.loose=!0;for(let c of u.tokens)c.type==="text"&&(c.type="paragraph")}return l}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=Nt(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&Dt(e[2],"()")!==-1)return;let n=je(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:le(e[0],`
51
+ `),href:s,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=jt(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
52
+ `):[],i={type:"table",raw:le(e[0],`
53
+ `),header:[],align:[],rows:[]};if(n.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<n.length;l++)i.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:i.align[l]});for(let l of r)i.rows.push(jt(l,i.header.length).map((a,o)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[o]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:le(e[0],`
54
+ `),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
55
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Bt(t,e[1],n,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let l=le(s.slice(0,-1),"\\");if((s.length-l.length)%2===0)return}else{let l=Dt(e[2],"()");if(l===-2)return;if(l>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],i=l[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?r=r.slice(1):r=r.slice(1,-1)),qt(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Bt(t,n[1],s,this.rules))return;let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[je(r)];if(!i){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return qt(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let r=[...s[0]].length-1,i,l,a=r,o=0,p=s[0][0],u=n===p,c=p==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+r);(s=c.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(l=[...i].length,s[3]||s[4]){a+=l;continue}else if(s[5]||s[6]){if(r%3&&!((r+l)%3)){o+=l;continue}if(u)break}if(a-=l,a>0)continue;l=Math.min(l,l+a+o);let h=[...s[0]][0].length,d=t.slice(0,r+s.index+h+l);if(Math.min(r,l)%2){let k=d.slice(1,-1);return{type:"em",raw:d,text:k,tokens:this.lexer.inlineTokens(k)}}let f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...s[0]].length-1,i,l,a=r,o=this.rules.inline.delRDelim;for(o.lastIndex=0,e=e.slice(-1*t.length+r);(s=o.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(l=[...i].length,l!==r))continue;if(s[3]||s[4]){a+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a);let p=[...s[0]][0].length,u=t.slice(0,r+s.index+p+l),c=u.slice(r,-r);return{type:"del",raw:u,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:n?e[0]:xr(e[0]),escaped:n}}}},Q=class nt{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||pe,this.options.tokenizer=this.options.tokenizer||new Ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:_,block:Oe.normal,inline:be.normal};this.options.pedantic?(n.block=Oe.pedantic,n.inline=be.pedantic):this.options.gfm&&(n.block=Oe.gfm,this.options.breaks?n.inline=be.breaks:n.inline=be.gfm),this.tokenizer.rules=n}static get rules(){return{block:Oe,inline:be}}static lex(e,n){return new nt(n).lex(e)}static lexInline(e,n){return new nt(n).inlineTokens(e)}lex(e){e=e.replace(_.carriageReturn,`
56
+ `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(_.tabCharGlobal," ").replace(_.spaceLine,""));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
57
+ `:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
58
+ `)?"":`
59
+ `)+i.raw,a.text+=`
60
+ `+i.text,this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
61
+ `)?"":`
62
+ `)+i.raw,a.text+=`
63
+ `+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),n.push(i);continue}let l=e;if(this.options.extensions?.startBlock){let a=1/0,o=e.slice(1),p;this.options.extensions.startBlock.forEach(u=>{p=u.call({lexer:this},o),typeof p=="number"&&p>=0&&(a=Math.min(a,p))}),a<1/0&&a>=0&&(l=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(l))){let a=n.at(-1);s&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
64
+ `)?"":`
65
+ `)+i.raw,a.text+=`
66
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i),s=l.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
67
+ `)?"":`
68
+ `)+i.raw,a.text+=`
69
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=s[0],i=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,je(r.slice(i+1,-1))))&&!(i>1&&this.linkInText(r.slice(1,i-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,n)}finally{this.state.linkParenPossible=s}}#e(e,n){let s=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,o=p=>{let u=p.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,je(p.slice(u+1,-1))))return p;if(u>1&&p.charAt(0)!=="!"){let c=p.slice(1,u-1);if(this.linkInText(c))return"["+c.replace(a,o)+"]["+"a".repeat(p.length-u-2)+"]"}return"["+"a".repeat(p.length-2)+"]"};s=s.replace(a,o)}s=s.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(a,o,p)=>p?"+".repeat(a.length):o?o+a.slice(o.length,-o.length).replace(/`/g,"+")+o:a),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,o,p)=>{let u=p?p.length:0;return a.slice(0,u)+"["+"a".repeat(a.length-u-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let r=!1,i="",l=1/0;for(;e;){if(e.length<l)l=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=""),r=!1;let a;if(this.options.extensions?.inline?.some(p=>(a=p.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let p=n.at(-1);a.type==="text"&&p?.type==="text"?(p.raw+=a.raw,p.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,i)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,s,i)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let o=e;if(this.options.extensions?.startInline){let p=1/0,u=e.slice(1),c;this.options.extensions.startInline.forEach(h=>{c=h.call({lexer:this},u),typeof c=="number"&&c>=0&&(p=Math.min(p,c))}),p<1/0&&p>=0&&(o=e.substring(0,p+1))}if(a=this.tokenizer.inlineText(o)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(i=a.raw.slice(-1)),r=!0;let p=n.at(-1);p?.type==="text"?(p.raw+=a.raw,p.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},De=class{options;parser;constructor(t){this.options=t||pe}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(_.notSpaceStart)?.[0],r=t?t.replace(_.endingNewline,"")+`
70
+ `:"";return s?'<pre><code class="language-'+G(s)+'">'+(n?r:G(r,!0))+`</code></pre>
71
+ `:"<pre><code>"+(n?r:G(r,!0))+`</code></pre>
72
+ `}blockquote({tokens:t}){return`<blockquote>
73
+ ${this.parser.parse(t)}</blockquote>
74
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
75
+ `}hr(t){return`<hr>
76
+ `}list(t){let e=t.ordered,n=t.start,s="";for(let l=0;l<t.items.length;l++){let a=t.items[l];s+=this.listitem(a)}let r=e?"ol":"ul",i=e&&n!==1?' start="'+n+'"':"";return"<"+r+i+`>
77
+ `+s+"</"+r+`>
78
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
79
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
80
+ `}table(t){let e="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);e+=this.tablerow({text:n});let s="";for(let r=0;r<t.rows.length;r++){let i=t.rows[r];n="";for(let l=0;l<i.length;l++)n+=this.tablecell(i[l]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
81
+ <thead>
82
+ `+e+`</thead>
83
+ `+s+`</table>
84
+ `}tablerow({text:t}){return`<tr>
85
+ ${t}</tr>
86
+ `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
87
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${G(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:s,autolink:r}){let i=r?G(n,!0):this.parser.parseInline(s),l=It(t);if(l===null)return i;t=G(l,r);let a='<a href="'+t+'"';return e&&(a+=' title="'+G(e)+'"'),a+=">"+i+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=It(t);if(r===null)return G(n);t=r;let i=`<img src="${G(t)}" alt="${G(n)}"`;return e&&(i+=` title="${G(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:G(t.text)}},ut=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Y=class rt{options;renderer;textRenderer;constructor(e){this.options=e||pe,this.options.renderer=this.options.renderer||new De,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ut}static parse(e,n){return new rt(n).parse(e)}static parseInline(e,n){return new rt(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let l=r,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(l.type)){n+=a||"";continue}}let i=r;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){s+=a||"";continue}}let l=i;switch(l.type){case"escape":{s+=n.text(l);break}case"html":{s+=n.html(l);break}case"link":{s+=n.link(l);break}case"image":{s+=n.image(l);break}case"checkbox":{s+=n.checkbox(l);break}case"strong":{s+=n.strong(l);break}case"em":{s+=n.em(l);break}case"codespan":{s+=n.codespan(l);break}case"br":{s+=n.br(l);break}case"del":{s+=n.del(l);break}case"text":{s+=n.text(l);break}default:{let a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},xe=class{options;block;constructor(t){this.options=t||pe}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Q.lex:Q.lexInline}provideParser(t=this.block){return t?Y.parse:Y.parseInline}};function ae(t,e){if(Array.isArray(e))for(let n=0;n<e.length;n++)t.push(e[n]);else t.push(e)}var wr=class{defaults=st();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Y;Renderer=De;TextRenderer=ut;Lexer=Q;Tokenizer=Ne;Hooks=xe;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(ae(n,e.call(this,s)),s.type){case"table":{let r=s;for(let i of r.header)ae(n,this.walkTokens(i.tokens,e));for(let i of r.rows)for(let l of i)ae(n,this.walkTokens(l.tokens,e));break}case"list":{let r=s;ae(n,this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let l=r[i].flat(1/0);ae(n,this.walkTokens(l,e))}):r.tokens&&ae(n,this.walkTokens(r.tokens,e))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...l){let a=r.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),n.renderer){let r=this.defaults.renderer||new De(this.defaults);for(let i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,a=n.renderer[l],o=r[l];r[l]=(...p)=>{let u=a.apply(r,p);return u===!1&&(u=o.apply(r,p)),u||""}}s.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Ne(this.defaults);for(let i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,a=n.tokenizer[l],o=r[l];r[l]=(...p)=>{let u=a.apply(r,p);return u===!1&&(u=o.apply(r,p)),u}}s.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new xe;for(let i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,a=n.hooks[l],o=r[l];xe.passThroughHooks.has(i)?r[l]=p=>{if(this.defaults.async&&xe.passThroughHooksRespectAsync.has(i))return(async()=>{let c=await a.call(r,p);return o.call(r,c)})();let u=a.call(r,p);return o.call(r,u)}:r[l]=(...p)=>{if(this.defaults.async)return(async()=>{let c=await a.apply(r,p);return c===!1&&(c=await o.apply(r,p)),c})();let u=a.apply(r,p);return u===!1&&(u=o.apply(r,p)),u}}s.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,i=n.walkTokens;s.walkTokens=function(l){let a=[];return a.push(i.call(this,l)),r&&ae(a,r.call(this,l)),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Q.lex(t,e??this.defaults)}parser(t,e){return Y.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},r={...this.defaults,...s},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let l=r.hooks?await r.hooks.preprocess(e):e,a=await(r.hooks?await r.hooks.provideLexer(t):t?Q.lex:Q.lexInline)(l,r),o=r.hooks?await r.hooks.processAllTokens(a):a;r.walkTokens&&await Promise.all(this.walkTokens(o,r.walkTokens));let p=await(r.hooks?await r.hooks.provideParser(t):t?Y.parse:Y.parseInline)(o,r);return r.hooks?await r.hooks.postprocess(p):p})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let l=(r.hooks?r.hooks.provideLexer(t):t?Q.lex:Q.lexInline)(e,r);r.hooks&&(l=r.hooks.processAllTokens(l)),r.walkTokens&&this.walkTokens(l,r.walkTokens);let a=(r.hooks?r.hooks.provideParser(t):t?Y.parse:Y.parseInline)(l,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(l){return i(l)}}}onError(t,e){return n=>{if(n.message+=`
88
+ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+G(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},ce=new wr;function R(t,e){return ce.parse(t,e)}R.options=R.setOptions=function(t){return ce.setOptions(t),R.defaults=ce.defaults,Ft(R.defaults),R};R.getDefaults=st;R.defaults=pe;function Sr(...t){return ce.use(...t),R.defaults=ce.defaults,Ft(R.defaults),R}R.use=Sr;R.walkTokens=function(t,e){return ce.walkTokens(t,e)};R.parseInline=ce.parseInline;R.Parser=Y;R.parser=Y.parse;R.Renderer=De;R.TextRenderer=ut;R.Lexer=Q;R.lexer=Q.lex;R.Tokenizer=Ne;R.Hooks=xe;R.parse=R;var es=R.options,ts=R.setOptions,ns=R.walkTokens,rs=R.parseInline;var ss=Y.parse,is=Q.lex;var $r=/^(ar|he|fa|ur|ps|sd|ug|yi|dv|ckb)\b/i,Ar={back:"M15 5l-7 7 7 7",next:"M9 5l7 7-7 7",present:"M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5",presenter:"M3 5h12v9H3zM18 8h3M18 12h3M6 19h6",grid:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z",edit:"M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4",scheme:"M12 3a9 9 0 1 0 9 9 7 7 0 0 1-9-9z",export:"M12 4v11M7 10l5 5 5-5M5 20h14"};function Cr(t){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("aria-hidden","true"),(t==="back"||t==="next")&&e.setAttribute("class","deck-flip");let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",Ar[t]),e.append(n),e}function vr(t,e){let n=e.source.replace(/\r\n?/g,`
89
+ `),s=Ee(n),r=0,i=0,l=[],a=String(e.lang??s.settings.lang??document.documentElement.lang??"en")||"en",o=String(e.dir??s.settings.dir??($r.test(a)?"rtl":"ltr")),p={...zt(a),...e.strings},u=new Intl.NumberFormat(a).format,c=matchMedia("(prefers-color-scheme: dark)"),h="light",d=Date.now();t.classList.add("deck"),t.lang=a,t.dir=o;let f=x("div",{class:"deck-stage",tabindex:0,role:"region","aria-roledescription":p.carousel,"aria-label":p.deck}),k=x("span",{class:"deck-where","aria-live":"polite"}),m=(g,b,A)=>{let L=x("button",{type:"button","aria-label":b,"data-act":g},[Cr(g)]);return L.addEventListener("click",A),L},w=m("back",p.previous,()=>$(-1)),y=m("next",p.next,()=>$(1)),O=m("edit",p.edit,()=>H("is-editing")),U=m("presenter",p.presenter,()=>H("is-presenting")),N=m("grid",p.overview,()=>H("is-overview")),P=x("div",{class:"deck-bar"},[w,k,y,x("span",{class:"deck-gap"}),N,U,e.editable===!1?null:O,m("scheme",p.scheme,()=>{h=h==="dark"?"light":"dark",q()}),e.onExport?m("export",p.export,()=>e.onExport?.(wt)):null,document.fullscreenEnabled?m("present",p.present,()=>ue()):null]),T=x("textarea",{class:"deck-source",spellcheck:"false","aria-label":p.source,dir:"auto"}),F=x("div",{class:"deck-next"}),X=x("div",{class:"deck-notes",dir:"auto","aria-label":p.notes}),D=x("span",{class:"deck-clock"}),K=x("div",{class:"deck-presenter"},[F,X]);t.replaceChildren(T,f,K,P),P.insertBefore(D,P.querySelector(".deck-gap"));let J=[],Ae=()=>{let g=ze(e.kit,s.settings.kit);return J=g.problems,g.kit};function q(){te.kit=Ae();let g=Ye(s.settings,te.kit.tokens),b=Je(g,h),A=E=>E.map(M=>/^[\w-]+$/.test(M)?M:`"${M.replace(/["\\]/g,"")}"`).join(", "),L=g.fonts?{heading:A(g.fonts.heading),body:A(g.fonts.body)}:Ke[g.voice];for(let[E,M]of Object.entries({paper:b.paper,ink:b.ink,muted:b.muted,line:b.line,primary:b.primary,fill:g.primary,"on-fill":b.onPrimary,soft:b.soft,heading:L.heading,body:L.body,radius:`${g.radius}px`,...Object.fromEntries(b.series.map((j,z)=>[`series-${z+1}`,j]))}))t.style.setProperty(`--deck-${E}`,M);t.dataset.scheme=h,t.dispatchEvent(new CustomEvent("deck-scheme",{detail:{scheme:h,colours:b,tokens:g}}))}let re=()=>{let g=e.scheme??s.settings.colorSchema??"auto";h=g==="dark"||g==="auto"&&c.matches?"dark":"light"},te={blocks:e.blocks??{},resolve:e.resolve??(g=>g),headings:e.headings??"real",number:g=>u(g),total:0,kit:ze().kit,lex:e.lex??(g=>new Q({gfm:!0}).lex(g)),slide:p.slide};function me(){te.total=s.slides.length,l=s.slides.map(g=>Le(g,te));for(let[g,{element:b}]of l.entries())b.setAttribute("aria-label",p.where.replace("{n}",u(g+1)).replace("{count}",u(l.length))),b.addEventListener("click",()=>{t.classList.contains("is-overview")&&(H("is-overview"),I(g,0))});f.replaceChildren(...l.map(({element:g})=>g)),r=Math.min(r,l.length-1),B(),requestAnimationFrame(()=>C())}function C(){for(let{element:g}of l)v(g)}function v(g){let b=!1;for(let A of g.querySelectorAll(".deck-slot")){let L=1;for(A.style.setProperty("--deck-fit","1");A.scrollHeight>A.clientHeight+1&&L>.6;)A.style.setProperty("--deck-fit",String(L=Math.round((L-.05)*100)/100));A.scrollHeight>A.clientHeight+1&&(b=!0)}b?g.dataset.overflow="true":delete g.dataset.overflow}function B(){for(let[b,{element:A,steps:L}]of l.entries()){A.classList.toggle("is-shown",b===r),A.inert=b!==r&&!t.classList.contains("is-overview");for(let E of A.querySelectorAll(".deck-step"))E.classList.toggle("is-on",b<r||b===r&&Number(E.getAttribute("data-step"))<=i||L===0)}k.textContent=`${u(r+1)} / ${u(l.length)}`,w.toggleAttribute("disabled",r===0&&i===0),y.toggleAttribute("disabled",r>=l.length-1&&i>=(l[r]?.steps??0)),X.textContent=s.slides[r]?.notes||p.noNotes;let g=s.slides[r+1];F.replaceChildren(x("span",{},[g?p.upNext:p.last]),...g?[Le(g,te).element]:[]),t.dispatchEvent(new CustomEvent("deck-move",{detail:{at:r,step:i}}))}function $(g){let b=l[r]?.steps??0;if(g>0&&i<b){i++,B();return}if(g<0&&i>0){i--,B();return}let A=r+g;A<0||A>=l.length||I(A,g>0?0:l[A].steps)}function I(g,b=0){if(g===r){i=b,B();return}let A=g>r,L=s.slides[A?g:r]?.settings??{},E=String(L.transition??s.settings.transition??"none"),[M,j]=E.split("|").map(Ce=>Ce.trim()),z=A?M:j??M;o==="rtl"&&(z=z.replace(/-(left|right)$/,(Ce,ve)=>ve==="left"?"-right":"-left")),z==="view-transition"&&(z="morph");let se=()=>{r=g,i=b,z==="morph"&&Z(l[g].element),B()},on=matchMedia("(prefers-reduced-motion: reduce)").matches;if(!document.startViewTransition||z==="none"||on||t.classList.contains("is-overview"))return se();z==="morph"&&Z(l[r].element,l[g].element),document.documentElement.dataset.deckTransition=z;let St=document.startViewTransition(se);St.ready.catch(()=>{}),St.finished.finally(()=>{delete document.documentElement.dataset.deckTransition;for(let{element:Ce}of l)for(let ve of Ce.querySelectorAll("[data-morph]"))ve.style.removeProperty("view-transition-name"),ve.removeAttribute("data-morph")})}function Z(g,b){let A=E=>`${E.tagName}:${E.tagName==="IMG"?E.getAttribute("src"):(E.textContent??"").trim().slice(0,80)}`,L=E=>[...E.querySelectorAll("h1, h2, h3, h4, .deck-h, li, p, img, .deck-block, blockquote, .deck-image")];if(b){let E=new Map(L(b).map(j=>[A(j),j])),M=0;for(let j of L(g)){let z=E.get(A(j));if(!z||z.dataset.morph||j.closest("[data-morph]"))continue;let se=`deck-m${M++}`;j.dataset.morph=z.dataset.morph=se,j.style.setProperty("view-transition-name",se)}return}for(let E of g.querySelectorAll("[data-morph]")){let M=E.dataset.morph;for(let j of f.querySelectorAll(`[data-morph="${M}"]`))j!==E&&j.style.removeProperty("view-transition-name");E.style.setProperty("view-transition-name",M)}}function H(g){for(let b of["is-editing","is-presenting","is-overview"])b!==g&&t.classList.remove(b);t.classList.toggle(g),O.setAttribute("aria-pressed",String(t.classList.contains("is-editing"))),U.setAttribute("aria-pressed",String(t.classList.contains("is-presenting"))),N.setAttribute("aria-pressed",String(t.classList.contains("is-overview"))),t.classList.contains("is-editing")&&(T.value=n,T.focus()),B(),requestAnimationFrame(()=>C())}function ue(){f.requestFullscreen?.().then(()=>f.focus(),()=>{})}function he(g){n=g.replace(/\r\n?/g,`
90
+ `),s=Ee(n),q(),me(),e.onChange?.(n)}let bt=0;T.addEventListener("input",g=>{g.isComposing||(clearTimeout(bt),bt=setTimeout(()=>he(T.value),120))});let xt=()=>{let g=T.selectionStart,b=s.slides.findIndex(A=>g>=A.start&&g<=A.end+1);b>=0&&b!==r&&(r=b,i=l[b]?.steps??0,B())};T.addEventListener("keyup",xt),T.addEventListener("click",xt),f.addEventListener("dblclick",g=>{if(e.editable===!1||document.fullscreenElement)return;let b=g.target.closest("[data-edit]");if(!b)return;let[A,L]=b.dataset.edit.split("-").map(Number);b.contentEditable="true",b.focus();let E=z=>{b.removeEventListener("keydown",M),b.removeEventListener("blur",j),b.contentEditable="false";let se=ht(b);z&&se!==n.slice(A,L)?he(n.slice(0,A)+se+n.slice(L)):me()},M=z=>{z.isComposing||(z.key==="Enter"&&!z.shiftKey&&(z.preventDefault(),E(!0)),z.key==="Escape"&&(z.preventDefault(),E(!1)))},j=()=>E(!0);b.addEventListener("keydown",M),b.addEventListener("blur",j)}),t.addEventListener("keydown",g=>{let b=g.target;if(b.isContentEditable||b===T||b.tagName==="BUTTON"&&(g.key===" "||g.key==="Enter")){(g.metaKey||g.ctrlKey)&&g.key==="s"&&(g.preventDefault(),e.onSave?.(n));return}let A=o==="rtl"?"ArrowLeft":"ArrowRight",L=o==="rtl"?"ArrowRight":"ArrowLeft";if(g.altKey||g.ctrlKey||g.metaKey){(g.metaKey||g.ctrlKey)&&g.key==="s"&&(g.preventDefault(),e.onSave?.(n));return}let M={[A]:()=>$(1),[L]:()=>$(-1),ArrowDown:()=>$(1),ArrowUp:()=>$(-1),PageDown:()=>$(1),PageUp:()=>$(-1)," ":()=>$(1),Home:()=>I(0),End:()=>I(l.length-1,l.at(-1)?.steps??0),f:ue,p:()=>H("is-presenting"),o:()=>H("is-overview"),e:()=>H("is-editing")}[g.key];M&&(g.preventDefault(),M())}),f.addEventListener("click",g=>{document.fullscreenElement&&!g.target.closest("a, button, input")&&$(1)});let yt=0;f.addEventListener("touchstart",g=>{yt=g.touches[0].clientX},{passive:!0}),f.addEventListener("touchend",g=>{let b=g.changedTouches[0].clientX-yt;Math.abs(b)>50&&$(b<0==(o!=="rtl")?1:-1)}),c.addEventListener("change",()=>{re(),q()});let an=setInterval(()=>{let g=Math.floor((Date.now()-d)/1e3);D.textContent=t.classList.contains("is-presenting")?`${String(Math.floor(g/60)).padStart(2,"0")}:${String(g%60).padStart(2,"0")}`:""},1e3);re(),q(),me(),document.fonts?.ready.then(()=>C());let wt={root:t,stage:f,get source(){return n},get deck(){return s},get at(){return r},get scheme(){return h},get kit(){return te.kit},get kitProblems(){return J},lang:a,dir:o,slides:()=>l.map(({element:g})=>g),setSource:he,go:I,toggle:H,present:ue,fitAll:C,setScheme:g=>{h=g,q()},destroy:()=>clearInterval(an)};return wt}function ht(t){let e="";for(let n of t.childNodes)if(n.nodeType===Node.TEXT_NODE)e+=(n.textContent??"").replace(/([*_`[\]\\])/g,"\\$1");else if(n instanceof HTMLElement){let s=ht(n);e+={STRONG:`**${s}**`,B:`**${s}**`,EM:`*${s}*`,I:`*${s}*`,CODE:`\`${n.textContent}\``,DEL:`~~${s}~~`,BR:`
91
+ `,A:`[${s}](${n.getAttribute("href")??""})`}[n.tagName]??s}return e.replace(/ /g," ").replace(/\n+$/,"")}var qe="0.1.1";var dt='<script type="text/markdown" id="deck">',Tr="<\/script>",Kt=t=>t.replace(/<(\\*)(\/?script)/gi,"<\\$1$2"),Yt=t=>t.replace(/<\\(\\*)(\/?script)/gi,"<$1$2"),$e=t=>t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;"),Rr=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function Er(t){if(/\\<(!--|\/?script)/i.test(t))throw new Error("This code cannot be held in a page as it is.");return t.replace(/<(!--|\/?script)/gi,"\\x3C$1")}function Pr(t){let e=t.indexOf(dt);if(e<0)return null;let n=e+dt.length,s=t.slice(n).search(/<\/script/i);return s<0?null:Yt(t.slice(n,n+s).replace(/^\n/,"").replace(/\n$/,""))}var Jt=(t=qe)=>`https://cdn.jsdelivr.net/npm/@codename/deck@${t}/dist/deck.js`;function zr(t,{title:e="",lang:n="en",dir:s="auto",renderer:r={src:Jt()},base:i,generator:l=`deck ${qe}`}={}){let a=i?` data-base="${$e(i)}"`:"",o="src"in r?`<script src="${$e(r.src)}"${a}><\/script>`:`<script${a}>${Er(r.code)}<\/script>`;return`<!doctype html>
92
+ <html lang="${$e(n)}" dir="${$e(s)}">
93
+ <meta charset="utf-8">
94
+ <meta name="viewport" content="width=device-width, initial-scale=1">
95
+ <meta name="generator" content="${$e(l)}">
96
+ <title>${Rr(e)}</title>
97
+ <style>#deck{display:block;white-space:pre-wrap;overflow-wrap:anywhere;font:1rem/1.6 ui-monospace,Menlo,Consolas,monospace;max-width:72ch;margin:2rem auto;padding:0 1rem}</style>
98
+ <body>
99
+ ${dt}
100
+ ${Kt(t)}
101
+ ${Tr}
102
+ ${o}
103
+ </html>
104
+ `}var en=13.333,Lr=7.5,tn="h1, h2, h3, h4, h5, h6, .deck-h, p, ul, ol, blockquote";function V(t){let e=/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/.exec(t);return e?[e[1],e[2],e[3]].map(n=>Math.round(Number(n)).toString(16).padStart(2,"0")).join("").toUpperCase():t.replace("#","").toUpperCase().slice(0,6)||"000000"}async function Mr(t,{PptxGenJS:e,JSZip:n}){let s=new e;s.layout="LAYOUT_WIDE",s.title=t.deck.slides[0]?.title??"",s.rtlMode=t.dir==="rtl";let r=getComputedStyle(t.root),i=f=>f.split(",").map(k=>k.trim().replace(/^["']|["']$/g,"")).find(k=>!/^(ui-|system-ui|-apple|sans-serif|serif|monospace)/.test(k))??"Arial";s.theme={headFontFace:i(r.getPropertyValue("--deck-heading")),bodyFontFace:i(r.getPropertyValue("--deck-body"))};let l={slides:0,charts:0,pictures:0,tables:0,placeholders:0},a=t.dir==="rtl",o=t.slides(),p=new Map,u=[];for(let[f,k]of o.entries()){let m=k.getBoundingClientRect(),w=en/m.width,y=C=>{let v=C.getBoundingClientRect();return{x:(v.left-m.left)*w,y:(v.top-m.top)*w,w:v.width*w,h:v.height*w}},O=C=>{let v=C.closest(".deck-slot")??C,{x:B,w:$}=y(v),{y:I,h:Z}=y(C),H=getComputedStyle(v),ue=parseFloat(H.paddingInlineStart)*w,he=parseFloat(H.paddingInlineEnd)*w;return{x:B+(a?he:ue),y:I,w:$-ue-he,h:Z*1.08}},U=C=>getComputedStyle(C).justifyContent==="center"?"middle":"top",N=C=>Math.round(C*w*72*10)/10,P=getComputedStyle(k),T=k.dataset.layout??"default",F=[...k.querySelectorAll(".deck-slot")],X=F[0]?.firstElementChild,D=X&&X.matches("h1, h2, h3, .deck-h")?X:null,K=t.kit.layouts[T],J=`${K?He(K,T,t.lang):T}${k.classList.contains("deck-class-invert")?" (dark)":""}`;if(!p.has(J)){let C=[];D&&C.push({placeholder:{options:{name:"title",type:"title",...O(D),valign:"bottom",margin:0,fontFace:s.theme.headFontFace,color:V(getComputedStyle(D).color),align:a?"right":"left"},text:""}});for(let v of F){let B=y(v),$=D&&v===F[0]?y(D).y+y(D).h:B.y,I=v.firstElementChild&&v.firstElementChild!==D?O(v.firstElementChild):{x:B.x,w:B.w};C.push({placeholder:{options:{name:`body-${v.dataset.slot}`,type:"body",x:I.x,y:$+.08,w:I.w,h:Math.max(.3,B.y+B.h-$-.08),margin:0,valign:U(v),color:V(getComputedStyle(v).color)},text:""}})}s.defineSlideMaster({title:J,background:{color:V(P.backgroundColor)},objects:C,slideNumber:K?.numbered!==!1?{x:a?.3:en-.9,y:Lr-.55,w:.6,h:.3,fontSize:10,color:V(r.getPropertyValue("--deck-muted").trim()||"#666666")}:void 0}),p.set(J,new Set(C.map(v=>v.placeholder.options.name)))}let Ae=p.get(J),q=s.addSlide({masterName:J});l.slides++;let re=k.querySelector(".deck-image");if(re){let C=/url\("?(.*?)"?\)/.exec(getComputedStyle(re).backgroundImage)?.[1],v=C&&await gt(C,re.clientWidth*2,re.clientHeight*2,!0);v&&(q.addImage({data:v,...y(re)}),l.pictures++)}D&&Ae.has("title")&&(q.addText(ft(D,{pt:N,rtl:a,lang:t.lang}),{placeholder:"title"}),l.placeholders++);for(let C of F){let v=[...C.children].filter($=>$!==D);if(v.length>0&&v.every($=>$.matches(tn))&&Ae.has(`body-${C.dataset.slot}`)){q.addText(v.flatMap($=>ft($,{pt:N,rtl:a,lang:t.lang})),{placeholder:`body-${C.dataset.slot}`,valign:U(C),...nn(C)}),l.placeholders++;continue}for(let $ of v){let I=y($);if($.matches(tn))q.addText(ft($,{pt:N,rtl:a,lang:t.lang}),{...O($),valign:"top",margin:0,...nn(C)});else if($.matches("pre"))q.addText($.textContent?.replace(/\n$/,"")??"",{...I,fontFace:"Consolas",fontSize:N(parseFloat(getComputedStyle($).fontSize)),color:V(getComputedStyle($).color),fill:{color:V(getComputedStyle($).backgroundColor)},valign:"top",margin:6,rtlMode:!1,align:"left"});else if($.matches(".deck-table"))Or(q,$,I,{pt:N,rtl:a,lang:t.lang}),l.tables++;else if($.matches(".deck-echarts")&&$.chart){let Z=$.chart;Ir(s,q,Z,I,{pt:N,rtl:a,lang:t.lang,ink:V(P.color)})?l.charts++:(q.addImage({data:await gt(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(Z.renderToSVGString())}`,I.w/w*2,I.h/w*2),...I}),l.pictures++)}else{let Z=$.querySelector("img");if(Z){let H=await gt(Z.src,Z.clientWidth*2,Z.clientHeight*2);H&&(q.addImage({data:H,...y(Z),altText:Z.alt}),l.pictures++)}}}}let te=t.deck.slides[f]?.notes;te&&q.addNotes(te);let me=t.deck.slides[f]?.settings??{};u.push(String(me.transition??t.deck.settings.transition??"none").split("|")[0].trim())}let c=await n.loadAsync(await s.write({outputType:"arraybuffer",compression:!0}));for(let[f,k]of u.entries()){let m=`ppt/slides/slide${f+1}.xml`,w=await c.file(m)?.async("string");!w||k==="none"||c.file(m,w.replace(/<\/p:clrMapOvr>|(?=<p:timing|<\/p:sld>)/,y=>`${y}${jr(k,a)}`))}let h=await c.file("ppt/theme/theme1.xml")?.async("string");if(h){let f=w=>V(r.getPropertyValue(`--deck-${w}`).trim()),k=[f("fill"),...[2,3,4,5,6].map(w=>f(`series-${w}`))],m=`<a:clrScheme name="Deck"><a:dk1><a:srgbClr val="${f("ink")}"/></a:dk1><a:lt1><a:srgbClr val="${f("paper")}"/></a:lt1><a:dk2><a:srgbClr val="${f("ink")}"/></a:dk2><a:lt2><a:srgbClr val="${f("soft")}"/></a:lt2>${k.map((w,y)=>`<a:accent${y+1}><a:srgbClr val="${w}"/></a:accent${y+1}>`).join("")}<a:hlink><a:srgbClr val="${f("primary")}"/></a:hlink><a:folHlink><a:srgbClr val="${f("primary")}"/></a:folHlink></a:clrScheme>`;c.file("ppt/theme/theme1.xml",h.replace(/<a:clrScheme[\s\S]*?<\/a:clrScheme>/,m))}return{blob:await c.generateAsync({type:"blob",compression:"DEFLATE",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}),report:l}}function nn(t){let e=t.firstElementChild,n=e?parseFloat(getComputedStyle(e).marginBlockEnd):0;return{paraSpaceAfter:Math.round(n*.5)}}function ft(t,e){let n=[],s=(i,l)=>{let a=getComputedStyle(i),o={fontSize:e.pt(parseFloat(a.fontSize)),color:V(a.color),bold:Number(a.fontWeight)>=600,lang:e.lang,rtlMode:e.rtl,align:a.textAlign==="center"?"center":e.rtl?"right":"left",...l},p=_r(i,o);p.length&&(p[p.length-1].options.breakLine=!0,n.push(...p))},r=(i,l)=>{let a=0;for(let o of i.children){a++;let p=[...o.children].filter(c=>c.matches("ul, ol")),u=o.cloneNode(!0);for(let c of[...u.children])c.matches("ul, ol, input")&&c.remove();o.after(u),s(u,{bullet:i.tagName==="OL"?{type:"number",startAt:a===1?Number(i.getAttribute("start")??1):void 0}:!0,indentLevel:l}),u.remove();for(let c of p)r(c,l+1)}};if(t.matches("ul, ol"))r(t,0);else if(t.matches("blockquote"))for(let i of t.children)s(i,{italic:getComputedStyle(i).fontStyle==="italic"});else s(t,{});return n}function _r(t,e){let n=[],s=(r,i)=>{if(r.nodeType===Node.TEXT_NODE){let a=(r.textContent??"").replace(/\s+/g," ");a&&n.push({text:a,options:{...i}});return}if(!(r instanceof HTMLElement))return;if(r.tagName==="BR"){n.length&&(n[n.length-1].options.breakLine=!0);return}let l={...i};r.matches("strong, b")&&(l.bold=!0,l.color=V(getComputedStyle(r).color)),r.matches("em, i")&&(l.italic=!0),r.matches("del, s")&&(l.strike="sngStrike"),r.matches("code")&&(l.fontFace="Consolas"),r.matches("a[href]")&&(l.hyperlink={url:r.getAttribute("href")});for(let a of r.childNodes)s(a,l)};for(let r of t.childNodes)s(r,e);return n.length&&(n[0].text=n[0].text.trimStart(),n[n.length-1].text=n[n.length-1].text.trimEnd()),n.filter(r=>r.text)}function Or(t,e,n,s){let r=[...e.querySelectorAll("tr")].map(a=>[...a.children].map(o=>{let p=getComputedStyle(o),u=o.getAttribute("data-align");return{text:o.textContent?.trim()??"",options:{bold:o.tagName==="TH",fontSize:s.pt(parseFloat(p.fontSize)),color:V(p.color),lang:s.lang,rtlMode:s.rtl,align:u==="center"?"center":u==="right"!==s.rtl?"right":"left",border:[{type:"none"},{type:"none"},{type:"solid",pt:o.tagName==="TH"?1.5:.75,color:V(p.borderBlockEndColor)},{type:"none"}]}}})),i=[...e.querySelector("tr")?.children??[]].map(a=>a.getBoundingClientRect().width),l=i.reduce((a,o)=>a+o,0)||1;t.addTable(s.rtl?r.map(a=>a.reverse()):r,{...n,colW:(s.rtl?i.reverse():i).map(a=>a/l*n.w),margin:.06})}function Ir(t,e,n,s,r){let i=n.getOption(),l=i.series??[];if(!l.length)return!1;let a=new Set(l.map(c=>c.type)),o=(i.color??[]).map(V),p=c=>Array.isArray(c)?Number(c.at(-1)):Number(typeof c=="object"&&c!==null?c.value:c),u={...s,showLegend:l.length>1||a.has("pie"),legendPos:"b",legendFontSize:12,legendColor:r.ink,chartColors:o,showTitle:!!i.title?.[0]?.text,title:i.title?.[0]?.text,titleFontSize:16,titleColor:r.ink,catAxisLabelColor:r.ink,valAxisLabelColor:r.ink,dataLabelColor:r.ink,lang:r.lang};if(a.size===1&&a.has("pie")){let c=l[0],h=Array.isArray(c.radius)&&parseFloat(c.radius[0])>0;return e.addChart(h?t.charts.DOUGHNUT:t.charts.PIE,[{name:c.name??"",labels:c.data.map(d=>d.name),values:c.data.map(p)}],{...u,showPercent:!0,showLegend:!0,holeSize:h?55:void 0}),!0}if([...a].every(c=>c==="bar"||c==="line")){let c=i.yAxis?.[0]?.type==="category",h=(c?i.yAxis:i.xAxis)?.[0]?.data??[],d=m=>[{name:m.name??"",labels:h.map(String),values:m.data.map(p)}],f=m=>m.type==="bar"?t.charts.BAR:m.areaStyle?t.charts.AREA:t.charts.LINE,k={catAxisLabelFontSize:11,valAxisLabelFontSize:11,valGridLine:{color:"D9D9D9",size:.5},catAxisOrientation:r.rtl&&!c?"maxMin":"minMax",valAxisLabelFormatCode:"#,##0"};if(a.size===1){let m=l.flatMap(d);e.addChart(f(l[0]),m,{...u,...k,barDir:c?"bar":"col",barGrouping:l.some(w=>w.stack)?"stacked":"clustered",lineDataSymbol:"circle",lineSize:2})}else e.addChart(l.map(m=>({type:f(m),data:d(m),options:{barDir:c?"bar":"col",chartColors:[o[l.indexOf(m)%o.length]]}})),{...u,...k});return!0}if(a.size===1&&a.has("scatter")){let c=l[0].data.map(h=>Array.isArray(h)?h:[h.value?.[0],h.value?.[1]]);return e.addChart(t.charts.SCATTER,[{name:"X",values:c.map(h=>h[0])},{name:l[0].name??"Y",values:c.map(h=>h[1])}],{...u,lineSize:0,lineDataSymbolSize:8}),!0}if(a.size===1&&a.has("radar")){let c=i.radar?.[0]?.indicator??[];return e.addChart(t.charts.RADAR,l[0].data.map(h=>({name:h.name??"",labels:c.map(d=>d.name),values:h.value})),{...u,showLegend:!0,radarStyle:"standard"}),!0}return!1}function jr(t,e){let n=s=>`<p:transition spd="med"><p:push dir="${s}"/></p:transition>`;return t==="view-transition"||t==="morph"?'<mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice xmlns:p159="http://schemas.microsoft.com/office/powerpoint/2015/09/main" Requires="p159"><p:transition spd="slow"><p159:morph option="byObject"/></p:transition></mc:Choice><mc:Fallback><p:transition spd="slow"><p:fade/></p:transition></mc:Fallback></mc:AlternateContent>':t==="slide-left"?n(e?"r":"l"):t==="slide-right"?n(e?"l":"r"):t==="slide-up"?n("u"):t==="slide-down"?n("d"):'<p:transition spd="med"><p:fade/></p:transition>'}async function gt(t,e,n,s=!1){try{let r=new Image;r.crossOrigin="anonymous",r.src=t,await r.decode();let i=document.createElement("canvas");i.width=Math.max(1,Math.round(e)),i.height=Math.max(1,Math.round(n));let l=i.getContext("2d"),a=r.naturalWidth||e,o=r.naturalHeight||n,p=s?Math.max(i.width/a,i.height/o):Math.min(i.width/a,i.height/o);return l.drawImage(r,(i.width-a*p)/2,(i.height-o*p)/2,a*p,o*p),i.toDataURL("image/png")}catch{return null}}var mt=new Map;function rn(t,e){return mt.has(t)||mt.set(t,new Promise((n,s)=>{let r=document.createElement("script");r.src=t,r.onload=()=>n(globalThis[e]),r.onerror=s,document.head.append(r)})),mt.get(t)}var kt=(t,e,n,s)=>/node_modules\/$/.test(t)?`${t}${e}/${s}`:`${t}${e}@${n}/${s}`;function Nr({base:t,root:e,versions:n={}}){let{echarts:s="6.1.0",pele:r="1.10.0"}=n,i=new Set,l=null;e.addEventListener("deck-scheme",o=>{l=o.detail.colours;for(let p of i)p.chart.setOption(a(p.option,p.box),!0)});let a=(o,p)=>{let u=parseFloat(getComputedStyle(p).fontSize)||16,c=getComputedStyle(p).direction==="rtl",h=Math.round(u*.6),d=(f,k)=>f===void 0?void 0:[f].flat().map(m=>({axisLabel:{color:l?.muted,fontSize:h},axisLine:{lineStyle:{color:l?.line}},splitLine:{lineStyle:{color:l?.line}},nameTextStyle:{color:l?.muted,fontSize:h},...c&&k&&m.type==="category"?{inverse:!0}:{},...c&&!k?{position:"right"}:{},...m}));return{color:l?.series,backgroundColor:"transparent",animation:!matchMedia("(prefers-reduced-motion: reduce)").matches,textStyle:{fontFamily:getComputedStyle(e).getPropertyValue("--deck-body")||"system-ui",color:l?.ink,fontSize:h},...o,title:o.title?{...o.title,textStyle:{color:l?.ink,fontSize:Math.round(u*.8),...o.title?.textStyle}}:void 0,legend:o.legend?{itemWidth:h*1.6,itemHeight:h,...o.legend,textStyle:{color:l?.ink,fontSize:h,...o.legend?.textStyle}}:void 0,grid:{containLabel:!0,left:h,right:h,top:o.title?u*1.8:h,bottom:o.legend?u*1.6:h,...o.grid},xAxis:d(o.xAxis,!0),yAxis:d(o.yAxis,!1),toolbox:void 0,series:[o.series??[]].flat().map(f=>f.type==="pie"?{label:{color:l?.ink,fontSize:h},...f}:f)}};return{async echarts(o,p){let u=JSON.parse(p),c=await rn(kt(t,"echarts",s,"dist/echarts.min.js"),"echarts"),h=document.createElement("div");h.className="deck-chart",h.setAttribute("role","img"),h.setAttribute("aria-label",String(u.title?.text??"")),o.append(h);let d=c.init(h,null,{renderer:"svg",locale:document.documentElement.lang?.startsWith("ja")?"JA":"EN"}),f={chart:d,option:u,box:o};i.add(f),d.setOption(a(u,o)),new ResizeObserver(()=>{d.resize(),d.setOption(a(u,o),!0)}).observe(h),Object.assign(o,{chart:d})},async mermaid(o,p){let u=await rn(kt(t,"pele",r,"dist/pele.global.js"),"pele"),c=getComputedStyle(e).getPropertyValue("--deck-body")||"system-ui, sans-serif",{svg:h}=u.render(p,{fontFamily:c,links:!1,images:!1,autoDirection:!0,maxWidth:Math.max(320,o.clientWidth*1.4)}),d=`--pele-bg:transparent;--pele-fg:${l?.ink};--pele-muted:${l?.muted};--pele-line:${l?.muted};--pele-surface:${l?.soft};--pele-surface-alt:${l?.line};--pele-border:${l?.primary};--pele-accent:${l?.primary};--pele-font:${c.replace(/[<>"]/g,"")}`,f=document.createElement("img");f.alt=p,f.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(h.replace(/^(<svg\b[^>]*>)/,`$1<style>svg{${d}}</style>`))}`;let k=document.createElement("div");k.className="deck-diagram",k.append(f),o.append(k)}}}var sn=/^(\s*(?:image|background|backgroundImage)\s*:\s*)(['"]?)([^'"\n#]+?)\2(\s*(?:#.*)?)$/gm,ln=/(!\[[^\]\n]*\]\()(<[^>\n]+>|[^\s)\n]+)((?:\s+(?:"[^"\n]*"|'[^'\n]*'))?\))/g,Dr=t=>/^data:/i.test(t),qr=t=>/^(https?:)?\/\//i.test(t);function Br(t){let e="";for(let n=0;n<t.length;n+=32768)e+=String.fromCharCode(...t.subarray(n,n+32768));return btoa(e)}async function Fr(t,e,{web:n=!1,largest:s=8*1024*1024}={}){let r=new Map,i=[...t.matchAll(ln)].map(c=>c[2].replace(/^<|>$/g,"")).concat([...t.matchAll(sn)].map(c=>c[3].trim())),l=[],a=[],o=[];for(let c of new Set(i)){if(Dr(c)||qr(c)&&!n||/^(#|mailto:|javascript:)/i.test(c))continue;let h=await e(c).catch(()=>null);if(!h||!/^image\/(png|jpeg|gif|webp|avif|svg\+xml)$/.test(h.type)){a.push(c),r.set(c,null);continue}if(h.bytes.length>s){o.push(c),r.set(c,null);continue}r.set(c,`data:${h.type};base64,${Br(h.bytes)}`),l.push(c)}let p=c=>r.get(c)??null;return{source:t.replace(ln,(c,h,d,f)=>{let k=p(d.replace(/^<|>$/g,""));return k?`${h}${k}${f}`:c}).replace(sn,(c,h,d,f,k)=>{let m=p(f.trim());return m?`${h}${d}${m}${d}${k}`:c}),inlined:l,missing:a,kept:o}}var Zr=/^(`{3,}|~{3,})[ \t]*(deck|slidev|markdown|md)?[ \t]*$/,Hr="layout|transition|class|image|background|clicks|title|level|hide|zoom|theme|colorSchema|lang|themeConfig|paginate|alt";function Ur(t){let e=t.replace(/\r\n?/g,`
105
+ `).split(`
106
+ `),n=[];for(let o=0;o<e.length;o++){let p=Zr.exec(e[o]);if(!p)continue;let u=p[1],c=o+1,h=!1,d=[];for(;c<e.length;c++){let f=e[c].trimEnd();if(!h&&f===u)break;/^(`{3,}|~{3,})\s*\S/.test(f)&&!h?h=!0:h&&/^(`{3,}|~{3,})\s*$/.test(f)&&(h=!1),d.push(e[c])}n.push({tag:p[2]??"",body:d}),o=c}let s=n.find(o=>o.tag==="deck")??n.find(o=>o.body.filter(p=>/^---\s*$/.test(p)).length>=2);if(!s)return null;let r=[];s.tag!=="deck"&&r.push(`fenced as ${s.tag||"nothing"}`);let i=s.body.join(`
107
+ `),l=(o,p,u)=>{let c=i.replace(p,u);c!==i&&(r.push(o),i=c)};l("settings after an empty line",new RegExp(`^---[ \\t]*\\n\\s*\\n((?:(?:${Hr})\\s*:.*\\n(?:[ \\t]+\\S.*\\n)*)+)---[ \\t]*$`,"gm"),`---
108
+ $1---`),l("steps without empty lines",/^[ \t]*(<\/?v-clicks?>)[ \t]*$/gm,`
109
+ $1
110
+ `);let a=i.replace(/^```json[ \t]*\n([\s\S]*?)^```/gm,(o,p)=>p.includes('"series"')?`\`\`\`echarts
111
+ ${p}\`\`\``:o);return a!==i&&(r.push("a chart fenced as json"),i=a),l("words after a slot marker",/^::([\w-]+)::[ \t]+(\S.*)$/gm,`::$1::
112
+
113
+ $2`),{source:i,mended:r}}export{Ve as LOOKS,Pe as STANDARD,qe as VERSION,_e as contrast,vr as createDeck,Ur as deckIn,Nr as defaultBlocks,Kt as escape,Ue as inferLayout,Fr as inlinePictures,He as labelOf,Ze as layoutOf,kt as libraryAt,ht as markdownOf,ze as mergeKits,Ee as parseDeck,Pr as readDeckFile,Me as readable,Le as renderSlide,Jt as rendererUrl,Je as schemeOf,Mr as toPptx,Tt as tokensFrom,Ye as tokensOf,Yt as unescape,zr as writeDeckFile};
114
+ //# sourceMappingURL=deck.bundle.mjs.map