decklight 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +257 -0
- package/SPEC.md +372 -0
- package/cli/bundle.mjs +388 -0
- package/cli/decklight.mjs +95 -0
- package/cli/edit.mjs +142 -0
- package/cli/init.mjs +215 -0
- package/cli/rec.mjs +538 -0
- package/dist/decklight.css +1068 -0
- package/dist/decklight.js +239 -0
- package/dist/decklight.js.map +7 -0
- package/docs/architecture.svg +94 -0
- package/docs/demo.svg +124 -0
- package/package.json +54 -0
- package/themes/README.md +61 -0
- package/themes/aliens.css +84 -0
- package/themes/apple2.css +126 -0
- package/themes/aurora.css +84 -0
- package/themes/berry.css +80 -0
- package/themes/blade-runner.css +83 -0
- package/themes/c64.css +85 -0
- package/themes/carbon.css +82 -0
- package/themes/citrus.css +80 -0
- package/themes/coastal.css +80 -0
- package/themes/cosmos.css +86 -0
- package/themes/dune.css +80 -0
- package/themes/eclipse.css +82 -0
- package/themes/ember.css +80 -0
- package/themes/fjord.css +80 -0
- package/themes/friends.css +82 -0
- package/themes/gallery.html +203 -0
- package/themes/gameboy.css +118 -0
- package/themes/genesis.css +84 -0
- package/themes/glacier.css +82 -0
- package/themes/godfather.css +82 -0
- package/themes/graphite.css +80 -0
- package/themes/harvest.css +80 -0
- package/themes/ibm-modern.css +83 -0
- package/themes/ibm-oldschool.css +84 -0
- package/themes/ink.css +82 -0
- package/themes/latte.css +80 -0
- package/themes/linen.css +80 -0
- package/themes/meadow.css +80 -0
- package/themes/metropolis.css +85 -0
- package/themes/miami-vice.css +84 -0
- package/themes/midnight.css +80 -0
- package/themes/mint.css +82 -0
- package/themes/moss.css +82 -0
- package/themes/obsidian.css +82 -0
- package/themes/orchid.css +82 -0
- package/themes/packs.json +89 -0
- package/themes/paper.css +83 -0
- package/themes/peony.css +84 -0
- package/themes/porcelain.css +82 -0
- package/themes/pulp-fiction.css +84 -0
- package/themes/reveal-beige.css +87 -0
- package/themes/reveal-black.css +83 -0
- package/themes/reveal-blood.css +84 -0
- package/themes/reveal-dracula.css +83 -0
- package/themes/reveal-league.css +88 -0
- package/themes/reveal-moon.css +83 -0
- package/themes/reveal-night.css +86 -0
- package/themes/reveal-serif.css +82 -0
- package/themes/reveal-simple.css +84 -0
- package/themes/reveal-sky.css +85 -0
- package/themes/reveal-solarized.css +83 -0
- package/themes/reveal-white.css +82 -0
- package/themes/sepia.css +81 -0
- package/themes/seriph.css +82 -0
- package/themes/severance.css +82 -0
- package/themes/slate.css +80 -0
- package/themes/snes.css +82 -0
- package/themes/star-wars.css +85 -0
- package/themes/storm.css +80 -0
- package/themes/stranger-things.css +84 -0
- package/themes/synthwave.css +90 -0
- package/themes/terminator.css +84 -0
- package/themes/velvet.css +80 -0
- package/tools/gemini-tts.mjs +140 -0
- package/tools/publish-site-voices.mjs +71 -0
- package/tools/voiceover-server.mjs +0 -0
- package/tools/voiceover.mjs +155 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
var Decklight=(()=>{var fo=Object.create;var Gn=Object.defineProperty;var go=Object.getOwnPropertyDescriptor;var mo=Object.getOwnPropertyNames;var bo=Object.getPrototypeOf,yo=Object.prototype.hasOwnProperty;var ci=(t,e)=>()=>(t&&(e=t(t=0)),e);var ko=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),vo=(t,e)=>{for(var n in e)Gn(t,n,{get:e[n],enumerable:!0})},di=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of mo(e))!yo.call(t,r)&&r!==n&&Gn(t,r,{get:()=>e[r],enumerable:!(s=go(e,r))||s.enumerable});return t};var wo=(t,e,n)=>(n=t!=null?fo(bo(t)):{},di(e||!t||!t.__esModule?Gn(n,"default",{value:t,enumerable:!0}):n,t)),Eo=t=>di(Gn({},"__esModule",{value:!0}),t);var ee,O=ci(()=>{ee={order:["default","classics","oldmachines","tvseries","movies"],labels:{default:"Default",classics:"Classics",oldmachines:"Old Machines",tvseries:"TV Series",movies:"Movies"},packs:{default:["aurora","eclipse","midnight","fjord","cosmos","ink","storm","carbon","synthwave","obsidian","graphite","ember","moss","velvet","porcelain","paper","linen","sepia","glacier","mint","latte","dune","coastal","harvest","meadow","orchid","peony","slate","berry","citrus","ibm-modern"],classics:["reveal-black","reveal-white","reveal-league","reveal-beige","reveal-sky","reveal-night","reveal-serif","reveal-simple","reveal-solarized","reveal-moon","reveal-blood","reveal-dracula","metropolis","seriph"],oldmachines:["apple2","c64","gameboy","snes","genesis","ibm-oldschool"],tvseries:["miami-vice","friends","severance","stranger-things"],movies:["aliens","blade-runner","star-wars","terminator","godfather","pulp-fiction"]}}});var X,$=ci(()=>{X=["aliens","apple2","aurora","berry","blade-runner","c64","carbon","citrus","coastal","cosmos","dune","eclipse","ember","fjord","friends","gameboy","genesis","glacier","godfather","graphite","harvest","ibm-modern","ibm-oldschool","ink","latte","linen","meadow","metropolis","miami-vice","midnight","mint","moss","obsidian","orchid","paper","peony","porcelain","pulp-fiction","reveal-beige","reveal-black","reveal-blood","reveal-dracula","reveal-league","reveal-moon","reveal-night","reveal-serif","reveal-simple","reveal-sky","reveal-solarized","reveal-white","sepia","seriph","severance","slate","snes","star-wars","storm","stranger-things","synthwave","terminator","velvet"]});var sa=ko((Bd,na)=>{O();$();function Gi(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],s=typeof n;(s==="object"||s==="function")&&!Object.isFrozen(n)&&Gi(n)}),t}var ts=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Ki(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ft(t,...e){let n=Object.create(null);for(let s in t)n[s]=t[s];return e.forEach(function(s){for(let r in s)n[r]=s[r]}),n}var _l="</span>",Bi=t=>!!t.scope,xl=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((s,r)=>`${s}${"_".repeat(r+1)}`)].join(" ")}return`${e}${t}`},er=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=Ki(e)}openNode(e){if(!Bi(e))return;let n=xl(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){Bi(e)&&(this.buffer+=_l)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},Ui=(t={})=>{let e={children:[]};return Object.assign(e,t),e},tr=class t{constructor(){this.rootNode=Ui(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=Ui({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(s=>this._walk(e,s)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},nr=class extends tr{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let s=e.root;n&&(s.scope=`language:${n}`),this.add(s)}toHTML(){return new er(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function kn(t){return t?typeof t=="string"?t:t.source:null}function Wi(t){return Nt("(?=",t,")")}function Sl(t){return Nt("(?:",t,")*")}function Tl(t){return Nt("(?:",t,")?")}function Nt(...t){return t.map(n=>kn(n)).join("")}function Al(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function rr(...t){return"("+(Al(t).capture?"":"?:")+t.map(s=>kn(s)).join("|")+")"}function Vi(t){return new RegExp(t.toString()+"|").exec("").length-1}function Nl(t,e){let n=t&&t.exec(e);return n&&n.index===0}var Cl=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ir(t,{joinWith:e}){let n=0;return t.map(s=>{n+=1;let r=n,a=kn(s),o="";for(;a.length>0;){let c=Cl.exec(a);if(!c){o+=a;break}o+=a.substring(0,c.index),a=a.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?o+="\\"+String(Number(c[1])+r):(o+=c[0],c[0]==="("&&n++)}return o}).map(s=>`(${s})`).join(e)}var Rl=/\b\B/,Zi="[a-zA-Z]\\w*",ar="[a-zA-Z_]\\w*",ji="\\b\\d+(\\.\\d+)?",Yi="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Xi="\\b(0b[01]+)",Ml="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Ll=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=Nt(e,/.*\b/,t.binary,/\b.*/)),ft({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,s)=>{n.index!==0&&s.ignoreMatch()}},t)},vn={begin:"\\\\[\\s\\S]",relevance:0},Ol={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[vn]},$l={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[vn]},Il={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ss=function(t,e,n={}){let s=ft({scope:"comment",begin:t,end:e,contains:[]},n);s.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=rr("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return s.contains.push({begin:Nt(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s},Dl=ss("//","$"),Pl=ss("/\\*","\\*/"),Bl=ss("#","$"),Ul={scope:"number",begin:ji,relevance:0},zl={scope:"number",begin:Yi,relevance:0},Hl={scope:"number",begin:Xi,relevance:0},Fl={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[vn,{begin:/\[/,end:/\]/,relevance:0,contains:[vn]}]},ql={scope:"title",begin:Zi,relevance:0},Gl={scope:"title",begin:ar,relevance:0},Kl={begin:"\\.\\s*"+ar,relevance:0},Wl=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},es=Object.freeze({__proto__:null,APOS_STRING_MODE:Ol,BACKSLASH_ESCAPE:vn,BINARY_NUMBER_MODE:Hl,BINARY_NUMBER_RE:Xi,COMMENT:ss,C_BLOCK_COMMENT_MODE:Pl,C_LINE_COMMENT_MODE:Dl,C_NUMBER_MODE:zl,C_NUMBER_RE:Yi,END_SAME_AS_BEGIN:Wl,HASH_COMMENT_MODE:Bl,IDENT_RE:Zi,MATCH_NOTHING_RE:Rl,METHOD_GUARD:Kl,NUMBER_MODE:Ul,NUMBER_RE:ji,PHRASAL_WORDS_MODE:Il,QUOTE_STRING_MODE:$l,REGEXP_MODE:Fl,RE_STARTERS_RE:Ml,SHEBANG:Ll,TITLE_MODE:ql,UNDERSCORE_IDENT_RE:ar,UNDERSCORE_TITLE_MODE:Gl});function Vl(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function Zl(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function jl(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Vl,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Yl(t,e){Array.isArray(t.illegal)&&(t.illegal=rr(...t.illegal))}function Xl(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function Ql(t,e){t.relevance===void 0&&(t.relevance=1)}var Jl=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(s=>{delete t[s]}),t.keywords=n.keywords,t.begin=Nt(n.beforeMatch,Wi(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},ec=["of","and","for","in","not","or","if","then","parent","list","value"],tc="keyword";function Qi(t,e,n=tc){let s=Object.create(null);return typeof t=="string"?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach(function(a){Object.assign(s,Qi(t[a],e,a))}),s;function r(a,o){e&&(o=o.map(c=>c.toLowerCase())),o.forEach(function(c){let d=c.split("|");s[d[0]]=[a,nc(d[0],d[1])]})}}function nc(t,e){return e?Number(e):sc(t)?0:1}function sc(t){return ec.includes(t.toLowerCase())}var zi={},At=t=>{console.error(t)},Hi=(t,...e)=>{console.log(`WARN: ${t}`,...e)},Gt=(t,e)=>{zi[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),zi[`${t}/${e}`]=!0)},ns=new Error;function Ji(t,e,{key:n}){let s=0,r=t[n],a={},o={};for(let c=1;c<=e.length;c++)o[c+s]=r[c],a[c+s]=!0,s+=Vi(e[c-1]);t[n]=o,t[n]._emit=a,t[n]._multi=!0}function rc(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw At("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ns;if(typeof t.beginScope!="object"||t.beginScope===null)throw At("beginScope must be object"),ns;Ji(t,t.begin,{key:"beginScope"}),t.begin=ir(t.begin,{joinWith:""})}}function ic(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw At("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ns;if(typeof t.endScope!="object"||t.endScope===null)throw At("endScope must be object"),ns;Ji(t,t.end,{key:"endScope"}),t.end=ir(t.end,{joinWith:""})}}function ac(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function oc(t){ac(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),rc(t),ic(t)}function lc(t){function e(o,c){return new RegExp(kn(o),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(c?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,c]),this.matchAt+=Vi(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let c=this.regexes.map(d=>d[1]);this.matcherRe=e(ir(c,{joinWith:"|"}),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;let d=this.matcherRe.exec(c);if(!d)return null;let p=d.findIndex((E,y)=>y>0&&E!==void 0),f=this.matchIndexes[p];return d.splice(0,p),Object.assign(d,f)}}class s{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];let d=new n;return this.rules.slice(c).forEach(([p,f])=>d.addRule(p,f)),d.compile(),this.multiRegexes[c]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,d){this.rules.push([c,d]),d.type==="begin"&&this.count++}exec(c){let d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let p=d.exec(c);if(this.resumingScanAtSamePosition()&&!(p&&p.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,p=f.exec(c)}return p&&(this.regexIndex+=p.position+1,this.regexIndex===this.count&&this.considerAll()),p}}function r(o){let c=new s;return o.contains.forEach(d=>c.addRule(d.begin,{rule:d,type:"begin"})),o.terminatorEnd&&c.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&c.addRule(o.illegal,{type:"illegal"}),c}function a(o,c){let d=o;if(o.isCompiled)return d;[Zl,Xl,oc,Jl].forEach(f=>f(o,c)),t.compilerExtensions.forEach(f=>f(o,c)),o.__beforeBegin=null,[jl,Yl,Ql].forEach(f=>f(o,c)),o.isCompiled=!0;let p=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),p=o.keywords.$pattern,delete o.keywords.$pattern),p=p||/\w+/,o.keywords&&(o.keywords=Qi(o.keywords,t.case_insensitive)),d.keywordPatternRe=e(p,!0),c&&(o.begin||(o.begin=/\B|\b/),d.beginRe=e(d.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(d.endRe=e(d.end)),d.terminatorEnd=kn(d.end)||"",o.endsWithParent&&c.terminatorEnd&&(d.terminatorEnd+=(o.end?"|":"")+c.terminatorEnd)),o.illegal&&(d.illegalRe=e(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(f){return cc(f==="self"?o:f)})),o.contains.forEach(function(f){a(f,d)}),o.starts&&a(o.starts,c),d.matcher=r(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=ft(t.classNameAliases||{}),a(t)}function ea(t){return t?t.endsWithParent||ea(t.starts):!1}function cc(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return ft(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:ea(t)?ft(t,{starts:t.starts?ft(t.starts):null}):Object.isFrozen(t)?ft(t):t}var dc="11.11.1",sr=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},Js=Ki,Fi=ft,qi=Symbol("nomatch"),uc=7,ta=function(t){let e=Object.create(null),n=Object.create(null),s=[],r=!0,a="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]},c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:nr};function d(w){return c.noHighlightRe.test(w)}function p(w){let C=w.className+" ";C+=w.parentNode?w.parentNode.className:"";let x=c.languageDetectRe.exec(C);if(x){let P=G(x[1]);return P||(Hi(a.replace("{}",x[1])),Hi("Falling back to no-highlight mode for this block.",w)),P?x[1]:"no-highlight"}return C.split(/\s+/).find(P=>d(P)||G(P))}function f(w,C,x){let P="",M="";typeof C=="object"?(P=w,x=C.ignoreIllegals,M=C.language):(Gt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Gt("10.7.0",`Please use highlight(code, options) instead.
|
|
2
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),M=w,P=C),x===void 0&&(x=!0);let te={code:P,language:M};Me("before:highlight",te);let ie=te.result?te.result:E(te.language,te.code,x);return ie.code=te.code,Me("after:highlight",ie),ie}function E(w,C,x,P){let M=Object.create(null);function te(A,R){return A.keywords[R]}function ie(){if(!L.keywords){I.addText(F);return}let A=0;L.keywordPatternRe.lastIndex=0;let R=L.keywordPatternRe.exec(F),z="";for(;R;){z+=F.substring(A,R.index);let V=ce.case_insensitive?R[0].toLowerCase():R[0],fe=te(L,V);if(fe){let[Oe,qe]=fe;if(I.addText(z),z="",M[V]=(M[V]||0)+1,M[V]<=uc&&(ke+=qe),Oe.startsWith("_"))z+=R[0];else{let Jt=ce.classNameAliases[Oe]||Oe;xe(R[0],Jt)}}else z+=R[0];A=L.keywordPatternRe.lastIndex,R=L.keywordPatternRe.exec(F)}z+=F.substring(A),I.addText(z)}function be(){if(F==="")return;let A=null;if(typeof L.subLanguage=="string"){if(!e[L.subLanguage]){I.addText(F);return}A=E(L.subLanguage,F,!0,le[L.subLanguage]),le[L.subLanguage]=A._top}else A=T(F,L.subLanguage.length?L.subLanguage:null);L.relevance>0&&(ke+=A.relevance),I.__addSublanguage(A._emitter,A.language)}function he(){L.subLanguage!=null?be():ie(),F=""}function xe(A,R){A!==""&&(I.startScope(R),I.addText(A),I.endScope())}function Rt(A,R){let z=1,V=R.length-1;for(;z<=V;){if(!A._emit[z]){z++;continue}let fe=ce.classNameAliases[A[z]]||A[z],Oe=R[z];fe?xe(Oe,fe):(F=Oe,ie(),F=""),z++}}function Je(A,R){return A.scope&&typeof A.scope=="string"&&I.openNode(ce.classNameAliases[A.scope]||A.scope),A.beginScope&&(A.beginScope._wrap?(xe(F,ce.classNameAliases[A.beginScope._wrap]||A.beginScope._wrap),F=""):A.beginScope._multi&&(Rt(A.beginScope,R),F="")),L=Object.create(A,{parent:{value:L}}),L}function Le(A,R,z){let V=Nl(A.endRe,z);if(V){if(A["on:end"]){let fe=new ts(A);A["on:end"](R,fe),fe.isMatchIgnored&&(V=!1)}if(V){for(;A.endsParent&&A.parent;)A=A.parent;return A}}if(A.endsWithParent)return Le(A.parent,R,z)}function ot(A){return L.matcher.regexIndex===0?(F+=A[0],1):(bt=!0,0)}function ye(A){let R=A[0],z=A.rule,V=new ts(z),fe=[z.__beforeBegin,z["on:begin"]];for(let Oe of fe)if(Oe&&(Oe(A,V),V.isMatchIgnored))return ot(R);return z.skip?F+=R:(z.excludeBegin&&(F+=R),he(),!z.returnBegin&&!z.excludeBegin&&(F=R)),Je(z,A),z.returnBegin?0:R.length}function Xt(A){let R=A[0],z=C.substring(A.index),V=Le(L,A,z);if(!V)return qi;let fe=L;L.endScope&&L.endScope._wrap?(he(),xe(R,L.endScope._wrap)):L.endScope&&L.endScope._multi?(he(),Rt(L.endScope,A)):fe.skip?F+=R:(fe.returnEnd||fe.excludeEnd||(F+=R),he(),fe.excludeEnd&&(F=R));do L.scope&&I.closeNode(),!L.skip&&!L.subLanguage&&(ke+=L.relevance),L=L.parent;while(L!==V.parent);return V.starts&&Je(V.starts,A),fe.returnEnd?0:R.length}function lt(){let A=[];for(let R=L;R!==ce;R=R.parent)R.scope&&A.unshift(R.scope);A.forEach(R=>I.openNode(R))}let de={};function J(A,R){let z=R&&R[0];if(F+=A,z==null)return he(),0;if(de.type==="begin"&&R.type==="end"&&de.index===R.index&&z===""){if(F+=C.slice(R.index,R.index+1),!r){let V=new Error(`0 width match regex (${w})`);throw V.languageName=w,V.badRule=de.rule,V}return 1}if(de=R,R.type==="begin")return ye(R);if(R.type==="illegal"&&!x){let V=new Error('Illegal lexeme "'+z+'" for mode "'+(L.scope||"<unnamed>")+'"');throw V.mode=L,V}else if(R.type==="end"){let V=Xt(R);if(V!==qi)return V}if(R.type==="illegal"&&z==="")return F+=`
|
|
3
|
+
`,1;if(Qt>1e5&&Qt>R.index*3)throw new Error("potential infinite loop, way more iterations than matches");return F+=z,z.length}let ce=G(w);if(!ce)throw At(a.replace("{}",w)),new Error('Unknown language: "'+w+'"');let ct=lc(ce),N="",L=P||ct,le={},I=new c.__emitter(c);lt();let F="",ke=0,_e=0,Qt=0,bt=!1;try{if(ce.__emitTokens)ce.__emitTokens(C,I);else{for(L.matcher.considerAll();;){Qt++,bt?bt=!1:L.matcher.considerAll(),L.matcher.lastIndex=_e;let A=L.matcher.exec(C);if(!A)break;let R=C.substring(_e,A.index),z=J(R,A);_e=A.index+z}J(C.substring(_e))}return I.finalize(),N=I.toHTML(),{language:w,value:N,relevance:ke,illegal:!1,_emitter:I,_top:L}}catch(A){if(A.message&&A.message.includes("Illegal"))return{language:w,value:Js(C),illegal:!0,relevance:0,_illegalBy:{message:A.message,index:_e,context:C.slice(_e-100,_e+100),mode:A.mode,resultSoFar:N},_emitter:I};if(r)return{language:w,value:Js(C),illegal:!1,relevance:0,errorRaised:A,_emitter:I,_top:L};throw A}}function y(w){let C={value:Js(w),illegal:!1,relevance:0,_top:o,_emitter:new c.__emitter(c)};return C._emitter.addText(w),C}function T(w,C){C=C||c.languages||Object.keys(e);let x=y(w),P=C.filter(G).filter(Z).map(he=>E(he,w,!1));P.unshift(x);let M=P.sort((he,xe)=>{if(he.relevance!==xe.relevance)return xe.relevance-he.relevance;if(he.language&&xe.language){if(G(he.language).supersetOf===xe.language)return 1;if(G(xe.language).supersetOf===he.language)return-1}return 0}),[te,ie]=M,be=te;return be.secondBest=ie,be}function _(w,C,x){let P=C&&n[C]||x;w.classList.add("hljs"),w.classList.add(`language-${P}`)}function S(w){let C=null,x=p(w);if(d(x))return;if(Me("before:highlightElement",{el:w,language:x}),w.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",w);return}if(w.children.length>0&&(c.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(w)),c.throwUnescapedHTML))throw new sr("One of your code blocks includes unescaped HTML.",w.innerHTML);C=w;let P=C.textContent,M=x?f(P,{language:x,ignoreIllegals:!0}):T(P);w.innerHTML=M.value,w.dataset.highlighted="yes",_(w,x,M.language),w.result={language:M.language,re:M.relevance,relevance:M.relevance},M.secondBest&&(w.secondBest={language:M.secondBest.language,relevance:M.secondBest.relevance}),Me("after:highlightElement",{el:w,result:M,text:P})}function B(w){c=Fi(c,w)}let D=()=>{W(),Gt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function H(){W(),Gt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let U=!1;function W(){function w(){W()}if(document.readyState==="loading"){U||window.addEventListener("DOMContentLoaded",w,!1),U=!0;return}document.querySelectorAll(c.cssSelector).forEach(S)}function Y(w,C){let x=null;try{x=C(t)}catch(P){if(At("Language definition for '{}' could not be registered.".replace("{}",w)),r)At(P);else throw P;x=o}x.name||(x.name=w),e[w]=x,x.rawDefinition=C.bind(null,t),x.aliases&&re(x.aliases,{languageName:w})}function K(w){delete e[w];for(let C of Object.keys(n))n[C]===w&&delete n[C]}function oe(){return Object.keys(e)}function G(w){return w=(w||"").toLowerCase(),e[w]||e[n[w]]}function re(w,{languageName:C}){typeof w=="string"&&(w=[w]),w.forEach(x=>{n[x.toLowerCase()]=C})}function Z(w){let C=G(w);return C&&!C.disableAutodetect}function Pe(w){w["before:highlightBlock"]&&!w["before:highlightElement"]&&(w["before:highlightElement"]=C=>{w["before:highlightBlock"](Object.assign({block:C.el},C))}),w["after:highlightBlock"]&&!w["after:highlightElement"]&&(w["after:highlightElement"]=C=>{w["after:highlightBlock"](Object.assign({block:C.el},C))})}function Ue(w){Pe(w),s.push(w)}function Re(w){let C=s.indexOf(w);C!==-1&&s.splice(C,1)}function Me(w,C){let x=w;s.forEach(function(P){P[x]&&P[x](C)})}function Ee(w){return Gt("10.7.0","highlightBlock will be removed entirely in v12.0"),Gt("10.7.0","Please use highlightElement now."),S(w)}Object.assign(t,{highlight:f,highlightAuto:T,highlightAll:W,highlightElement:S,highlightBlock:Ee,configure:B,initHighlighting:D,initHighlightingOnLoad:H,registerLanguage:Y,unregisterLanguage:K,listLanguages:oe,getLanguage:G,registerAliases:re,autoDetection:Z,inherit:Fi,addPlugin:Ue,removePlugin:Re}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=dc,t.regex={concat:Nt,lookahead:Wi,either:rr,optional:Tl,anyNumberOfTimes:Sl};for(let w in es)typeof es[w]=="object"&&Gi(es[w]);return Object.assign(t,es),t},Kt=ta({});Kt.newInstance=()=>ta({});na.exports=Kt;Kt.HighlightJS=Kt;Kt.default=Kt});var ad={};vo(ad,{init:()=>rd,initTerminals:()=>id,registerBuildProvider:()=>wn,version:()=>sd});O();$();O();$();O();$();var So=new Set(["UL","OL","TABLE","TBODY","DL","SVG"]),To=new Set(["defs","title","desc","style","metadata"]),hi=new Map;function fi(t,e){hi.set(t,e)}function Wn(t){return[...t.children].filter(e=>{let n=e.tagName.toLowerCase();return!(To.has(n)||n==="aside"&&e.classList.contains("notes")||e.hasAttribute("data-build-stay"))})}function Ao(t){if(t.hasAttribute("data-build-self"))return!1;let e=t.tagName.toUpperCase();return So.has(e)?!0:e==="DIV"||e==="G"?Wn(t).length>=2:!1}function No(t){if(t.tagName.toUpperCase()==="TABLE"){let n=t.querySelector(":scope > tbody");return n?Wn(n):Wn(t).filter(s=>s.tagName==="TR")}return Wn(t)}function Co(t){let e=t.map((o,c)=>({...o,i:c}));e.sort((o,c)=>o.key-c.key||o.i-c.i);let n=[],s=null,r=null,a=!1;for(let o of e){if(s&&o.explicit&&a&&o.key===r){s.push(o.i);continue}s=[o.i],r=o.key,a=o.explicit,n.push(s)}return n}function ui(t,e){t.classList.add("build-step"),t.setAttribute("data-build-style",e),t.setAttribute("data-build-state","pending"),e==="draw"&&Ro(t)}var pi="path, line, polyline, polygon, circle, ellipse, rect";function Ro(t){let e=t.matches?.(pi)?[t]:[...t.querySelectorAll(pi)],n=!1;for(let r of e){let a=r.getAttribute("stroke")??getComputedStyle(r).stroke;if(!a||a==="none")continue;let o=0;try{o=r.getTotalLength()}catch{continue}if(!o)continue;n=!0;let c=r.getAttribute("stroke-dasharray")||r.style.strokeDasharray;c&&(r.dataset.drawOrig=c);for(let[d,p]of Bs){let f=r.getAttribute(d);f&&(r.dataset[p]=f)}r.classList.add("draw-stroke"),r.style.setProperty("--draw-len",String(Math.ceil(o)))}t.querySelectorAll("text, tspan").forEach(r=>r.classList.add("draw-fade")),n||t.setAttribute("data-build-style","fade")}var Bs=[["marker-start","drawMarkerStart"],["marker-mid","drawMarkerMid"],["marker-end","drawMarkerEnd"]];function Kn(t,e){for(let[n,s]of Bs)s in t.dataset&&(e?t.setAttribute(n,t.dataset[s]):t.removeAttribute(n))}function Mo(t,e){for(let n of t.querySelectorAll(".draw-stroke")){let s=n.dataset.drawOrig,r=Bs.some(([,a])=>a in n.dataset);if(!(!s&&!r))if(e==="done")s&&(n.style.strokeDasharray=s,n.style.strokeDashoffset="0"),Kn(n,!0);else if(e==="pending")n.style.removeProperty("stroke-dasharray"),n.style.removeProperty("stroke-dashoffset"),Kn(n,!1);else{n.style.removeProperty("stroke-dasharray"),n.style.removeProperty("stroke-dashoffset"),Kn(n,!1);let a=()=>{t.getAttribute("data-build-state")!=="pending"&&(s&&(n.style.strokeDasharray=s,n.style.strokeDashoffset="0"),Kn(n,!0))},o=parseFloat(getComputedStyle(n).transitionDuration)||0;o===0?a():(n.addEventListener("transitionend",a,{once:!0}),setTimeout(a,o*1e3+150))}}}function Us(t){let e=[],n=[],s=new Set,r=0,a=(f,E)=>{let y=E!=null&&E!=="",T=y?parseInt(E,10):r;e.push(f),n.push({key:Number.isFinite(T)?T:r,explicit:y}),r++},o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(let f=o.nextNode();f;f=o.nextNode()){if(s.has(f))continue;let E=hi.get(f);if(E){for(let T=0;T<E.count;T++)a({kind:"provider",provider:E,el:f,sub:T},null);f.querySelectorAll("*").forEach(T=>s.add(T));continue}if(!f.hasAttribute("data-build"))continue;let y=f.getAttribute("data-build")||"fade";if(Ao(f)){for(let T of No(f)){s.add(T),T.querySelectorAll("[data-build]").forEach(S=>s.add(S));let _=T.getAttribute("data-build")||y;ui(T,_),a({kind:"dom",el:T,container:f},T.getAttribute("data-build-order"))}f.setAttribute("data-build-container","")}else ui(f,y),a({kind:"dom",el:f,container:null},f.getAttribute("data-build-order"))}let c=Co(n),d=[],p=new Map;return e.forEach((f,E)=>{if(f.kind==="provider"){if(!p.has(f.provider)){let y={el:f.el,provider:f.provider,stepIdxs:[]};p.set(f.provider,y),d.push(y)}p.get(f.provider).stepIdxs.push(E)}}),{steps:e,groups:c,providers:d}}function ht(t,e){let n=new Set;t.groups.forEach((o,c)=>{for(let d of o)c<e&&n.add(d)});let s=e>0?t.groups[e-1]??[]:[],r=new Set(s),a=new Set;t.steps.forEach((o,c)=>{if(o.kind!=="dom")return;let d=r.has(c)?"current":n.has(c)?"done":"pending";o.el.setAttribute("data-build-state",d),o.el.getAttribute("data-build-style")==="draw"&&Mo(o.el,d),o.container&&a.add(o.container)});for(let o of a){let c=!!o.querySelector(':scope [data-build-style="highlight"][data-build-state="current"]');o.classList.toggle("has-current-highlight",c)}for(let o of t.providers){let c=o.stepIdxs.filter(d=>n.has(d)||r.has(d)).length;o._last!==c&&(o._last=c,o.provider.apply(c))}}function gi(t){return t.groups.map(e=>{let n=t.steps[e[0]];if(n.kind==="provider"){let r=n.sub;return n.provider.label?n.provider.label(r+1):"step"}return n.el.textContent.trim().replace(/\s+/g," ").slice(0,60)||n.el.tagName.toLowerCase()})}O();$();var mi="rect, circle, ellipse, polygon, polyline, path";function Lo(t){let e=5381;for(let n of String(t))e=(e*33^n.charCodeAt(0))>>>0;return 1+e%6}function Oo(t,e={}){let n=e[t];return typeof n=="number"?`var(--d-fill-${n})`:typeof n=="string"?n:`var(--d-fill-${Lo(t)})`}function bi(t,e={}){let n=new Map;t.querySelectorAll("svg [data-concept]").forEach(s=>{let r=s.getAttribute("data-concept");if(!r)return;let a=Oo(r,e),o=a.match(/--d-fill-(\d)/);if(o){let d=n.get(o[1]);d&&d!==r?console.warn(`Decklight: concepts "${d}" and "${r}" share fill slot ${o[1]} \u2014 pin one explicitly via init({ concepts: { ${r}: <1-6> } })`):n.set(o[1],r)}let c=s.matches(mi)?[s]:[...s.children].filter(d=>d.matches(mi));for(let d of c)d.style.setProperty("fill",a)})}var $o=["fill","stroke","filter","clip-path","mask","marker-start","marker-mid","marker-end","style"];function yi(t){t.querySelectorAll("svg").forEach((e,n)=>{let s=`svg${n}-`,r=new Map;if(e.querySelectorAll("[id]").forEach(o=>{let c=o.id;r.set(c,s+c),o.id=s+c}),r.size===0)return;let a=o=>o.replace(/url\(['"]?#([^'")]+)['"]?\)/g,(c,d)=>r.has(d)?`url(#${r.get(d)})`:c);e.querySelectorAll("*").forEach(o=>{for(let c of $o){let d=o.getAttribute(c);d&&d.includes("url(#")&&o.setAttribute(c,a(d))}for(let c of["href","xlink:href"]){let d=o.getAttribute(c);d&&d.startsWith("#")&&r.has(d.slice(1))&&o.setAttribute(c,"#"+r.get(d.slice(1)))}})})}O();$();var zs=["opacity","color","backgroundColor","borderRadius","fontSize"];function ki(t){let e=getComputedStyle(t),n={rect:t.getBoundingClientRect()};for(let s of zs)n[s]=e[s];return n}function Io(t,e){if(t.ownerSVGElement){let n=t.getScreenCTM?.();if(n&&n.a&&n.d)return{x:n.a,y:n.d}}return{x:e,y:e}}function vi(t,e,n){let s=getComputedStyle(e).getPropertyValue("--auto-animate-duration").trim(),r=(s.endsWith("ms")?parseFloat(s):s.endsWith("s")?parseFloat(s)*1e3:parseFloat(s))||500,a=new Map;t.querySelectorAll("[data-id]").forEach(d=>{a.set(d.getAttribute("data-id"),ki(d))});let o=[];e.querySelectorAll("[data-id]").forEach(d=>{let p=a.get(d.getAttribute("data-id"));p&&o.push({el:d,o:p})});for(let{el:d,o:p}of o){let f=ki(d),E=Io(d,n),y=(p.rect.left-f.rect.left)/E.x,T=(p.rect.top-f.rect.top)/E.y,_=d.children.length===0&&p.fontSize!==f.fontSize,S=_?1:f.rect.width?p.rect.width/f.rect.width:1,B=_?1:f.rect.height?p.rect.height/f.rect.height:1,D=d.getAttribute("style")??"";d.style.transition="none",d.ownerSVGElement&&(d.style.transformBox="fill-box"),d.style.transformOrigin="0 0",d.style.transform=`translate(${y}px, ${T}px) scale(${S}, ${B})`;for(let U of zs)d.style[U]=p[U];d.offsetWidth,d.style.transition=`transform ${r}ms ease, opacity ${r}ms ease, color ${r}ms ease, background-color ${r}ms ease, border-radius ${r}ms ease, font-size ${r}ms ease`,d.style.transform="";for(let U of zs)d.style[U]=f[U];let H=()=>{D?d.setAttribute("style",D):d.removeAttribute("style"),d.removeEventListener("transitionend",H)};d.addEventListener("transitionend",H),setTimeout(H,r+80)}let c=new Set(o.map(d=>d.el));return[...e.children].forEach(d=>{d.matches("aside.notes")||c.has(d)||[...c].some(f=>d.contains(f))||(d.classList.add("aa-fresh"),requestAnimationFrame(()=>requestAnimationFrame(()=>d.classList.add("aa-in"))),setTimeout(()=>d.classList.remove("aa-fresh","aa-in"),r+120))}),r}O();$();O();$();function Gs(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Tt=Gs();function Ti(t){Tt=t}var bn={exec:()=>null};function Q(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Ne.caret,"$1"),n=n.replace(r,o),s},getRegex:()=>new RegExp(n,e)};return s}var Ne={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ 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,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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,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:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Do=/^(?:[ \t]*(?:\n|$))+/,Po=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Bo=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,yn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Uo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ks=/(?:[*+-]|\d{1,9}[.)])/,Ai=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ni=Q(Ai).replace(/bull/g,Ks).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),zo=Q(Ai).replace(/bull/g,Ks).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ws=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ho=/^[^\n]+/,Vs=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Fo=Q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Vs).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),qo=Q(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ks).getRegex(),Qn="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",Zs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Go=Q("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Zs).replace("tag",Qn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ci=Q(Ws).replace("hr",yn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qn).getRegex(),Ko=Q(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ci).getRegex(),js={blockquote:Ko,code:Po,def:Fo,fences:Bo,heading:Uo,hr:yn,html:Go,lheading:Ni,list:qo,newline:Do,paragraph:Ci,table:bn,text:Ho},wi=Q("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",yn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qn).getRegex(),Wo={...js,lheading:zo,table:wi,paragraph:Q(Ws).replace("hr",yn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",wi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qn).getRegex()},Vo={...js,html:Q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Zs).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:bn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Q(Ws).replace("hr",yn).replace("heading",` *#{1,6} *[^
|
|
4
|
+
]`).replace("lheading",Ni).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Zo=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,jo=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ri=/^( {2,}|\\)\n(?!\s*$)/,Yo=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Jn=/[\p{P}\p{S}]/u,Ys=/[\s\p{P}\p{S}]/u,Mi=/[^\s\p{P}\p{S}]/u,Xo=Q(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ys).getRegex(),Li=/(?!~)[\p{P}\p{S}]/u,Qo=/(?!~)[\s\p{P}\p{S}]/u,Jo=/(?:[^\s\p{P}\p{S}]|~)/u,el=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Oi=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,tl=Q(Oi,"u").replace(/punct/g,Jn).getRegex(),nl=Q(Oi,"u").replace(/punct/g,Li).getRegex(),$i="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",sl=Q($i,"gu").replace(/notPunctSpace/g,Mi).replace(/punctSpace/g,Ys).replace(/punct/g,Jn).getRegex(),rl=Q($i,"gu").replace(/notPunctSpace/g,Jo).replace(/punctSpace/g,Qo).replace(/punct/g,Li).getRegex(),il=Q("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Mi).replace(/punctSpace/g,Ys).replace(/punct/g,Jn).getRegex(),al=Q(/\\(punct)/,"gu").replace(/punct/g,Jn).getRegex(),ol=Q(/^<(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(),ll=Q(Zs).replace("(?:-->|$)","-->").getRegex(),cl=Q("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ll).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,dl=Q(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",jn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ii=Q(/^!?\[(label)\]\[(ref)\]/).replace("label",jn).replace("ref",Vs).getRegex(),Di=Q(/^!?\[(ref)\](?:\[\])?/).replace("ref",Vs).getRegex(),ul=Q("reflink|nolink(?!\\()","g").replace("reflink",Ii).replace("nolink",Di).getRegex(),Xs={_backpedal:bn,anyPunctuation:al,autolink:ol,blockSkip:el,br:Ri,code:jo,del:bn,emStrongLDelim:tl,emStrongRDelimAst:sl,emStrongRDelimUnd:il,escape:Zo,link:dl,nolink:Di,punctuation:Xo,reflink:Ii,reflinkSearch:ul,tag:cl,text:Yo,url:bn},pl={...Xs,link:Q(/^!?\[(label)\]\((.*?)\)/).replace("label",jn).getRegex(),reflink:Q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",jn).getRegex()},Hs={...Xs,emStrongRDelimAst:rl,emStrongLDelim:nl,url:Q(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},hl={...Hs,br:Q(Ri).replace("{2,}","*").getRegex(),text:Q(Hs.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Vn={normal:js,gfm:Wo,pedantic:Vo},gn={normal:Xs,gfm:Hs,breaks:hl,pedantic:pl},fl={"&":"&","<":"<",">":">",'"':""","'":"'"},Ei=t=>fl[t];function Xe(t,e){if(e){if(Ne.escapeTest.test(t))return t.replace(Ne.escapeReplace,Ei)}else if(Ne.escapeTestNoEncode.test(t))return t.replace(Ne.escapeReplaceNoEncode,Ei);return t}function _i(t){try{t=encodeURI(t).replace(Ne.percentDecode,"%")}catch{return null}return t}function xi(t,e){let n=t.replace(Ne.findPipe,(a,o,c)=>{let d=!1,p=o;for(;--p>=0&&c[p]==="\\";)d=!d;return d?"|":" |"}),s=n.split(Ne.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(Ne.slashPipe,"|");return s}function mn(t,e,n){let s=t.length;if(s===0)return"";let r=0;for(;r<s;){let a=t.charAt(s-r-1);if(a===e&&!n)r++;else if(a!==e&&n)r++;else break}return t.slice(0,s-r)}function gl(t,e){if(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 Si(t,e,n,s,r){let a=e.href,o=e.title||null,c=t[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:o,text:c,tokens:s.inlineTokens(c)};return s.state.inLink=!1,d}function ml(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
|
|
5
|
+
`).map(a=>{let o=a.match(n.other.beginningSpace);if(o===null)return a;let[c]=o;return c.length>=r.length?a.slice(r.length):a}).join(`
|
|
6
|
+
`)}var Yn=class{options;rules;lexer;constructor(t){this.options=t||Tt}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=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:mn(n,`
|
|
7
|
+
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=ml(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=mn(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:e[0],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:mn(e[0],`
|
|
8
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=mn(e[0],`
|
|
9
|
+
`).split(`
|
|
10
|
+
`),s="",r="",a=[];for(;n.length>0;){let o=!1,c=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))c.push(n[d]),o=!0;else if(!o)c.push(n[d]);else break;n=n.slice(d);let p=c.join(`
|
|
11
|
+
`),f=p.replace(this.rules.other.blockquoteSetextReplace,`
|
|
12
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
13
|
+
${p}`:p,r=r?`${r}
|
|
14
|
+
${f}`:f;let E=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,a,!0),this.lexer.state.top=E,n.length===0)break;let y=a.at(-1);if(y?.type==="code")break;if(y?.type==="blockquote"){let T=y,_=T.raw+`
|
|
15
|
+
`+n.join(`
|
|
16
|
+
`),S=this.blockquote(_);a[a.length-1]=S,s=s.substring(0,s.length-T.raw.length)+S.raw,r=r.substring(0,r.length-T.text.length)+S.text;break}else if(y?.type==="list"){let T=y,_=T.raw+`
|
|
17
|
+
`+n.join(`
|
|
18
|
+
`),S=this.list(_);a[a.length-1]=S,s=s.substring(0,s.length-y.raw.length)+S.raw,r=r.substring(0,r.length-T.raw.length)+S.raw,n=_.substring(a.at(-1).raw.length).split(`
|
|
19
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:a,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let a=this.rules.other.listItemRegex(n),o=!1;for(;t;){let d=!1,p="",f="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;p=e[0],t=t.substring(p.length);let E=e[2].split(`
|
|
20
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,D=>" ".repeat(3*D.length)),y=t.split(`
|
|
21
|
+
`,1)[0],T=!E.trim(),_=0;if(this.options.pedantic?(_=2,f=E.trimStart()):T?_=e[1].length+1:(_=e[2].search(this.rules.other.nonSpaceChar),_=_>4?1:_,f=E.slice(_),_+=e[1].length),T&&this.rules.other.blankLine.test(y)&&(p+=y+`
|
|
22
|
+
`,t=t.substring(y.length+1),d=!0),!d){let D=this.rules.other.nextBulletRegex(_),H=this.rules.other.hrRegex(_),U=this.rules.other.fencesBeginRegex(_),W=this.rules.other.headingBeginRegex(_),Y=this.rules.other.htmlBeginRegex(_);for(;t;){let K=t.split(`
|
|
23
|
+
`,1)[0],oe;if(y=K,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),oe=y):oe=y.replace(this.rules.other.tabCharGlobal," "),U.test(y)||W.test(y)||Y.test(y)||D.test(y)||H.test(y))break;if(oe.search(this.rules.other.nonSpaceChar)>=_||!y.trim())f+=`
|
|
24
|
+
`+oe.slice(_);else{if(T||E.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||U.test(E)||W.test(E)||H.test(E))break;f+=`
|
|
25
|
+
`+y}!T&&!y.trim()&&(T=!0),p+=K+`
|
|
26
|
+
`,t=t.substring(K.length+1),E=oe.slice(_)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(o=!0));let S=null,B;this.options.gfm&&(S=this.rules.other.listIsTask.exec(f),S&&(B=S[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:p,task:!!S,checked:B,loose:!1,text:f,tokens:[]}),r.raw+=p}let c=r.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let d=0;d<r.items.length;d++)if(this.lexer.state.top=!1,r.items[d].tokens=this.lexer.blockTokens(r.items[d].text,[]),!r.loose){let p=r.items[d].tokens.filter(E=>E.type==="space"),f=p.length>0&&p.some(E=>this.rules.other.anyLine.test(E.raw));r.loose=f}if(r.loose)for(let d=0;d<r.items.length;d++)r.items[d].loose=!0;return r}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().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:e[0],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=xi(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
27
|
+
`):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?a.align.push("right"):this.rules.other.tableAlignCenter.test(o)?a.align.push("center"):this.rules.other.tableAlignLeft.test(o)?a.align.push("left"):a.align.push(null);for(let o=0;o<n.length;o++)a.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:a.align[o]});for(let o of r)a.rows.push(xi(o,a.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:a.align[d]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
28
|
+
`?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){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=mn(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=gl(e[2],"()");if(a===-2)return;if(a>-1){let c=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,c).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],r=a[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),Si(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.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[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return Si(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let a=[...s[0]].length-1,o,c,d=a,p=0,f=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,e=e.slice(-1*t.length+a);(s=f.exec(e))!=null;){if(o=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!o)continue;if(c=[...o].length,s[3]||s[4]){d+=c;continue}else if((s[5]||s[6])&&a%3&&!((a+c)%3)){p+=c;continue}if(d-=c,d>0)continue;c=Math.min(c,c+d+p);let E=[...s[0]][0].length,y=t.slice(0,a+s.index+E+c);if(Math.min(a,c)%2){let _=y.slice(1,-1);return{type:"em",raw:y,text:_,tokens:this.lexer.inlineTokens(_)}}let T=y.slice(2,-2);return{type:"strong",raw:y,text:T,tokens:this.lexer.inlineTokens(T)}}}}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){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}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,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,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:e[0],escaped:n}}}},rt=class Fs{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Tt,this.options.tokenizer=this.options.tokenizer||new Yn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Ne,block:Vn.normal,inline:gn.normal};this.options.pedantic?(n.block=Vn.pedantic,n.inline=gn.pedantic):this.options.gfm&&(n.block=Vn.gfm,this.options.breaks?n.inline=gn.breaks:n.inline=gn.gfm),this.tokenizer.rules=n}static get rules(){return{block:Vn,inline:gn}}static lex(e,n){return new Fs(n).lex(e)}static lexInline(e,n){return new Fs(n).inlineTokens(e)}lex(e){e=e.replace(Ne.carriageReturn,`
|
|
29
|
+
`),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){for(this.options.pedantic&&(e=e.replace(Ne.tabCharGlobal," ").replace(Ne.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(o=>(r=o.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let o=n.at(-1);r.raw.length===1&&o!==void 0?o.raw+=`
|
|
30
|
+
`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
|
31
|
+
`+r.raw,o.text+=`
|
|
32
|
+
`+r.text,this.inlineQueue.at(-1).src=o.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
|
33
|
+
`+r.raw,o.text+=`
|
|
34
|
+
`+r.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let a=e;if(this.options.extensions?.startBlock){let o=1/0,c=e.slice(1),d;this.options.extensions.startBlock.forEach(p=>{d=p.call({lexer:this},c),typeof d=="number"&&d>=0&&(o=Math.min(o,d))}),o<1/0&&o>=0&&(a=e.substring(0,o+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){let o=n.at(-1);s&&o?.type==="paragraph"?(o.raw+=`
|
|
35
|
+
`+r.raw,o.text+=`
|
|
36
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(r),s=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=`
|
|
37
|
+
`+r.raw,o.text+=`
|
|
38
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(r);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let s=e,r=null;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)c.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let a=!1,o="";for(;e;){a||(o=""),a=!1;let c;if(this.options.extensions?.inline?.some(p=>(c=p.call({lexer:this},e,n))?(e=e.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.escape(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.tag(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.link(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(c.raw.length);let p=n.at(-1);c.type==="text"&&p?.type==="text"?(p.raw+=c.raw,p.text+=c.text):n.push(c);continue}if(c=this.tokenizer.emStrong(e,s,o)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.codespan(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.br(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.del(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.autolink(e)){e=e.substring(c.raw.length),n.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(e))){e=e.substring(c.raw.length),n.push(c);continue}let d=e;if(this.options.extensions?.startInline){let p=1/0,f=e.slice(1),E;this.options.extensions.startInline.forEach(y=>{E=y.call({lexer:this},f),typeof E=="number"&&E>=0&&(p=Math.min(p,E))}),p<1/0&&p>=0&&(d=e.substring(0,p+1))}if(c=this.tokenizer.inlineText(d)){e=e.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(o=c.raw.slice(-1)),a=!0;let p=n.at(-1);p?.type==="text"?(p.raw+=c.raw,p.text+=c.text):n.push(c);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},Xn=class{options;parser;constructor(t){this.options=t||Tt}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(Ne.notSpaceStart)?.[0],r=t.replace(Ne.endingNewline,"")+`
|
|
39
|
+
`;return s?'<pre><code class="language-'+Xe(s)+'">'+(n?r:Xe(r,!0))+`</code></pre>
|
|
40
|
+
`:"<pre><code>"+(n?r:Xe(r,!0))+`</code></pre>
|
|
41
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
42
|
+
${this.parser.parse(t)}</blockquote>
|
|
43
|
+
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
44
|
+
`}hr(t){return`<hr>
|
|
45
|
+
`}list(t){let e=t.ordered,n=t.start,s="";for(let o=0;o<t.items.length;o++){let c=t.items[o];s+=this.listitem(c)}let r=e?"ol":"ul",a=e&&n!==1?' start="'+n+'"':"";return"<"+r+a+`>
|
|
46
|
+
`+s+"</"+r+`>
|
|
47
|
+
`}listitem(t){let e="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+Xe(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
|
|
48
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
49
|
+
`}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 a=t.rows[r];n="";for(let o=0;o<a.length;o++)n+=this.tablecell(a[o]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
50
|
+
<thead>
|
|
51
|
+
`+e+`</thead>
|
|
52
|
+
`+s+`</table>
|
|
53
|
+
`}tablerow({text:t}){return`<tr>
|
|
54
|
+
${t}</tr>
|
|
55
|
+
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
56
|
+
`}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>${Xe(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let s=this.parser.parseInline(n),r=_i(t);if(r===null)return s;t=r;let a='<a href="'+t+'"';return e&&(a+=' title="'+Xe(e)+'"'),a+=">"+s+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=_i(t);if(r===null)return Xe(n);t=r;let a=`<img src="${t}" alt="${n}"`;return e&&(a+=` title="${Xe(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Xe(t.text)}},Qs=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""}},it=class qs{options;renderer;textRenderer;constructor(e){this.options=e||Tt,this.options.renderer=this.options.renderer||new Xn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Qs}static parse(e,n){return new qs(n).parse(e)}static parseInline(e,n){return new qs(n).parseInline(e)}parse(e,n=!0){let s="";for(let r=0;r<e.length;r++){let a=e[r];if(this.options.extensions?.renderers?.[a.type]){let c=a,d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){s+=d||"";continue}}let o=a;switch(o.type){case"space":{s+=this.renderer.space(o);continue}case"hr":{s+=this.renderer.hr(o);continue}case"heading":{s+=this.renderer.heading(o);continue}case"code":{s+=this.renderer.code(o);continue}case"table":{s+=this.renderer.table(o);continue}case"blockquote":{s+=this.renderer.blockquote(o);continue}case"list":{s+=this.renderer.list(o);continue}case"html":{s+=this.renderer.html(o);continue}case"paragraph":{s+=this.renderer.paragraph(o);continue}case"text":{let c=o,d=this.renderer.text(c);for(;r+1<e.length&&e[r+1].type==="text";)c=e[++r],d+=`
|
|
57
|
+
`+this.renderer.text(c);n?s+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):s+=d;continue}default:{let c='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}parseInline(e,n=this.renderer){let s="";for(let r=0;r<e.length;r++){let a=e[r];if(this.options.extensions?.renderers?.[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=c||"";continue}}let o=a;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let c='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}},Zn=class{options;block;constructor(t){this.options=t||Tt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?rt.lex:rt.lexInline}provideParser(){return this.block?it.parse:it.parseInline}},bl=class{defaults=Gs();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=it;Renderer=Xn;TextRenderer=Qs;Lexer=rt;Tokenizer=Yn;Hooks=Zn;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let r=s;for(let a of r.header)n=n.concat(this.walkTokens(a.tokens,e));for(let a of r.rows)for(let o of a)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let r=s;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(a=>{let o=r[a].flat(1/0);n=n.concat(this.walkTokens(o,e))}):r.tokens&&(n=n.concat(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 a=e.renderers[r.name];a?e.renderers[r.name]=function(...o){let c=r.renderer.apply(this,o);return c===!1&&(c=a.apply(this,o)),c}: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 a=e[r.level];a?a.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 Xn(this.defaults);for(let a in n.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,c=n.renderer[o],d=r[o];r[o]=(...p)=>{let f=c.apply(r,p);return f===!1&&(f=d.apply(r,p)),f||""}}s.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Yn(this.defaults);for(let a in n.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,c=n.tokenizer[o],d=r[o];r[o]=(...p)=>{let f=c.apply(r,p);return f===!1&&(f=d.apply(r,p)),f}}s.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new Zn;for(let a in n.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,c=n.hooks[o],d=r[o];Zn.passThroughHooks.has(a)?r[o]=p=>{if(this.defaults.async)return Promise.resolve(c.call(r,p)).then(E=>d.call(r,E));let f=c.call(r,p);return d.call(r,f)}:r[o]=(...p)=>{let f=c.apply(r,p);return f===!1&&(f=d.apply(r,p)),f}}s.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,a=n.walkTokens;s.walkTokens=function(o){let c=[];return c.push(a.call(this,o)),r&&(c=c.concat(r.call(this,o))),c}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return rt.lex(t,e??this.defaults)}parser(t,e){return it.parse(t,e??this.defaults)}parseMarkdown(t){return(n,s)=>{let r={...s},a={...this.defaults,...r},o=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&r.async===!1)return o(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 n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));a.hooks&&(a.hooks.options=a,a.hooks.block=t);let c=a.hooks?a.hooks.provideLexer():t?rt.lex:rt.lexInline,d=a.hooks?a.hooks.provideParser():t?it.parse:it.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(p=>c(p,a)).then(p=>a.hooks?a.hooks.processAllTokens(p):p).then(p=>a.walkTokens?Promise.all(this.walkTokens(p,a.walkTokens)).then(()=>p):p).then(p=>d(p,a)).then(p=>a.hooks?a.hooks.postprocess(p):p).catch(o);try{a.hooks&&(n=a.hooks.preprocess(n));let p=c(n,a);a.hooks&&(p=a.hooks.processAllTokens(p)),a.walkTokens&&this.walkTokens(p,a.walkTokens);let f=d(p,a);return a.hooks&&(f=a.hooks.postprocess(f)),f}catch(p){return o(p)}}}onError(t,e){return n=>{if(n.message+=`
|
|
58
|
+
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+Xe(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},St=new bl;function j(t,e){return St.parse(t,e)}j.options=j.setOptions=function(t){return St.setOptions(t),j.defaults=St.defaults,Ti(j.defaults),j};j.getDefaults=Gs;j.defaults=Tt;j.use=function(...t){return St.use(...t),j.defaults=St.defaults,Ti(j.defaults),j};j.walkTokens=function(t,e){return St.walkTokens(t,e)};j.parseInline=St.parseInline;j.Parser=it;j.parser=it.parse;j.Renderer=Xn;j.TextRenderer=Qs;j.Lexer=rt;j.lexer=rt.lex;j.Tokenizer=Yn;j.Hooks=Zn;j.parse=j;var kd=j.options,vd=j.setOptions,wd=j.use,Ed=j.walkTokens,_d=j.parseInline;var xd=it.parse,Sd=rt.lex;j.setOptions({gfm:!0,breaks:!1});function yl(t){let e=t.replace(/^\n+/,"").replace(/\s+$/,"").split(`
|
|
59
|
+
`),n=1/0;for(let s of e)s.trim()&&(n=Math.min(n,s.match(/^[ \t]*/)[0].length));return!Number.isFinite(n)||n===0?e.join(`
|
|
60
|
+
`):e.map(s=>s.slice(n)).join(`
|
|
61
|
+
`)}function kl(t){let e=t.match(/^Note:\s*$/m);if(!e)return{body:t,notes:null,rehearse:null};let n=t.slice(0,e.index).replace(/\s+$/,""),s=t.slice(e.index+e[0].length).replace(/^\n/,""),r=null,a=s.match(/^Rehearse:\s*$/m);return a&&(r=s.slice(a.index+a[0].length).replace(/^\n/,""),s=s.slice(0,a.index).replace(/\s+$/,"")),{body:n,notes:s,rehearse:r}}function vl(t){return t.replace(/^:::[ \t]*build[ \t]*([\w-]*)[ \t]*$/gm,(e,n)=>n?`<div data-build="${n}">
|
|
62
|
+
`:`<div data-build>
|
|
63
|
+
`).replace(/^:::[ \t]*$/gm,`
|
|
64
|
+
</div>`)}function wl(t){t.querySelectorAll("div[data-build]").forEach(e=>{let n=[...e.children];if(n.length!==1)return;let s=n[0];if(!/^(UL|OL|TABLE|DL)$/.test(s.tagName))return;let r=e.getAttribute("data-build");s.hasAttribute("data-build")||s.setAttribute("data-build",r||""),e.removeAttribute("data-build")})}function El(t){let{body:e,notes:n,rehearse:s}=kl(yl(t)),r=j.parse(vl(e)),a=n?j.parse(n):null,o=s?j.parse(s):null;return{html:r,notesHtml:a,rehearseHtml:o}}function Pi(t){t.querySelectorAll("section[data-markdown]").forEach(e=>{let n=e.querySelector('script[type="text/template"]'),s=n?n.textContent:e.textContent,{html:r,notesHtml:a,rehearseHtml:o}=El(s);e.innerHTML=r,wl(e);for(let[c,d]of[["notes",a],["rehearse",o]]){if(!d)continue;let p=document.createElement("aside");p.className=c,p.innerHTML=d,e.appendChild(p)}e.removeAttribute("data-markdown"),e.setAttribute("data-was-markdown","")})}O();$();O();$();var ra=wo(sa(),1);var ue=ra.default;O();$();function ia(t){let e=t.regex,n=t.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],c=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],E=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],T=f,_=[...p,...d].filter(Y=>!f.includes(Y)),S={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},B={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},D={match:e.concat(/\b/,e.either(...T),/\s*\(/),relevance:0,keywords:{built_in:T}};function H(Y){return e.concat(/\b/,e.either(...Y.map(K=>K.replace(/\s+/,"\\s+"))),/\b/)}let U={scope:"keyword",match:H(y),relevance:0};function W(Y,{exceptions:K,when:oe}={}){let G=oe;return K=K||[],Y.map(re=>re.match(/\|\d+$/)||K.includes(re)?re:G(re)?`${re}|0`:re)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:W(_,{when:Y=>Y.length<3}),literal:a,type:c,built_in:E},contains:[{scope:"type",match:H(o)},U,D,S,s,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,B]}}O();$();var aa="[A-Za-z$_][0-9A-Za-z$_]*",pc=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],hc=["true","false","null","undefined","NaN","Infinity"],oa=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],la=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ca=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],fc=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],gc=[].concat(ca,oa,la);function da(t){let e=t.regex,n=(x,{after:P})=>{let M="</"+x[0].slice(1);return x.input.indexOf(M,P)!==-1},s=aa,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(x,P)=>{let M=x[0].length+x.index,te=x.input[M];if(te==="<"||te===","){P.ignoreMatch();return}te===">"&&(n(x,{after:M})||P.ignoreMatch());let ie,be=x.input.substring(M);if(ie=be.match(/^\s*=/)){P.ignoreMatch();return}if((ie=be.match(/^\s+extends\s+/))&&ie.index===0){P.ignoreMatch();return}}},c={$pattern:aa,keyword:pc,literal:hc,built_in:gc,"variable.language":fc},d="[0-9](_?[0-9])*",p=`\\.(${d})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",E={className:"number",variants:[{begin:`(\\b(${f})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${f})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},T={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},H={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},U=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,T,_,S,B,{match:/\$\d+/},E];y.contains=U.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(U)});let W=[].concat(H,y.contains),Y=W.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(W)}]),K={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:Y},oe={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,e.concat(s,"(",e.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},G={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...oa,...la]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Z={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[K],illegal:/%/},Pe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Ue(x){return e.concat("(?!",x.join("|"),")")}let Re={match:e.concat(/\b/,Ue([...ca,"super","import"].map(x=>`${x}\\s*\\(`)),s,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Me={begin:e.concat(/\./,e.lookahead(e.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ee={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},K]},w="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(w)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[K]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:Y,CLASS_REFERENCE:G},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,T,_,S,B,H,{match:/\$\d+/},E,G,{scope:"attr",match:s+e.lookahead(":"),relevance:0},C,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[H,t.REGEXP_MODE,{className:"function",begin:w,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:Y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},Z,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[K,t.inherit(t.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},Me,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[K]},Re,Pe,oe,Ee,{match:/\$[(.]/}]}}O();$();var rs="[A-Za-z$_][0-9A-Za-z$_]*",ua=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],pa=["true","false","null","undefined","NaN","Infinity"],ha=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],fa=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ga=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ma=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ba=[].concat(ga,ha,fa);function mc(t){let e=t.regex,n=(x,{after:P})=>{let M="</"+x[0].slice(1);return x.input.indexOf(M,P)!==-1},s=rs,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(x,P)=>{let M=x[0].length+x.index,te=x.input[M];if(te==="<"||te===","){P.ignoreMatch();return}te===">"&&(n(x,{after:M})||P.ignoreMatch());let ie,be=x.input.substring(M);if(ie=be.match(/^\s*=/)){P.ignoreMatch();return}if((ie=be.match(/^\s+extends\s+/))&&ie.index===0){P.ignoreMatch();return}}},c={$pattern:rs,keyword:ua,literal:pa,built_in:ba,"variable.language":ma},d="[0-9](_?[0-9])*",p=`\\.(${d})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",E={className:"number",variants:[{begin:`(\\b(${f})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${f})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},T={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},H={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},U=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,T,_,S,B,{match:/\$\d+/},E];y.contains=U.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(U)});let W=[].concat(H,y.contains),Y=W.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(W)}]),K={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:Y},oe={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,e.concat(s,"(",e.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},G={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...ha,...fa]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Z={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[K],illegal:/%/},Pe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Ue(x){return e.concat("(?!",x.join("|"),")")}let Re={match:e.concat(/\b/,Ue([...ga,"super","import"].map(x=>`${x}\\s*\\(`)),s,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Me={begin:e.concat(/\./,e.lookahead(e.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ee={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},K]},w="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(w)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[K]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:Y,CLASS_REFERENCE:G},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,T,_,S,B,H,{match:/\$\d+/},E,G,{scope:"attr",match:s+e.lookahead(":"),relevance:0},C,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[H,t.REGEXP_MODE,{className:"function",begin:w,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:Y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},Z,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[K,t.inherit(t.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},Me,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[K]},Re,Pe,oe,Ee,{match:/\$[(.]/}]}}function ya(t){let e=t.regex,n=mc(t),s=rs,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:rs,keyword:ua.concat(d),literal:pa,built_in:ba.concat(r),"variable.language":ma},f={className:"meta",begin:"@"+s},E=(S,B,D)=>{let H=S.contains.findIndex(U=>U.label===B);if(H===-1)throw new Error("can not find mode to replace");S.contains.splice(H,1,D)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(f);let y=n.contains.find(S=>S.scope==="attr"),T=Object.assign({},y,{match:e.concat(s,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,T]),n.contains=n.contains.concat([f,a,o,T]),E(n,"shebang",t.SHEBANG()),E(n,"use_strict",c);let _=n.contains.find(S=>S.label==="func.def");return _.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}O();$();function ka(t){let e=t.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},f={begin:/\{\{/,relevance:0},E={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,f,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,f,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,f,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,f,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",T=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,_=`\\b|${s.join("|")}`,S={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${T}))[eE][+-]?(${y})[jJ]?(?=${_})`},{begin:`(${T})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${y})[jJ](?=${_})`}]},B={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},D={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",d,S,E,t.HASH_COMMENT_MODE]}]};return p.contains=[E,S,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[d,S,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},E,B,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[D]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[S,D,E]}]}}O();$();function va(t){let e=t.regex,n={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});let r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},a=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,r]};r.contains.push(c);let d={match:/\\"/},p={className:"string",begin:/'/,end:/'/},f={match:/\\'/},E={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],T=t.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),_={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},S=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],B=["true","false"],D={match:/(\/[a-z._-]+)+/},H=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],U=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],W=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],Y=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:S,literal:B,built_in:[...H,...U,"set","shopt",...W,...Y]},contains:[T,t.SHEBANG(),_,E,a,o,D,c,d,p,f,n]}}O();$();function wa(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},c=t.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},T={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},_={begin:/\{/,end:/\}/,contains:[T],illegal:"\\n",relevance:0},S={begin:"\\[",end:"\\]",contains:[T],illegal:"\\n",relevance:0},B=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},y,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},_,S,a,o],D=[...B];return D.pop(),D.push(c),T.contains=D,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:B}}O();$();function Ea(t){let e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],r={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[e,n,t.QUOTE_STRING_MODE,r,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}O();$();var Wt="[0-9](_*[0-9])*",is=`\\.(${Wt})`,as="[0-9a-fA-F](_*[0-9a-fA-F])*",_a={className:"number",variants:[{begin:`(\\b(${Wt})((${is})|\\.)?|(${is}))[eE][+-]?(${Wt})[fFdD]?\\b`},{begin:`\\b(${Wt})((${is})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${is})[fFdD]?\\b`},{begin:`\\b(${Wt})[fFdD]\\b`},{begin:`\\b0[xX]((${as})\\.?|(${as})?\\.(${as}))[pP][+-]?(${Wt})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${as})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function xa(t,e,n){return n===-1?"":t.replace(e,s=>xa(t,e,n-1))}function Sa(t){let e=t.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",s=n+xa("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},p={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},f={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[f,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+s+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[p,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,_a,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},_a,p]}}O();$();function Ta(t){let a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}O();$();function Aa(t){let e=t.regex,n=/(r#)?/,s=e.concat(n,t.UNDERSCORE_IDENT_RE),r=e.concat(n,t.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,e.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",c=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],f=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:f,keyword:c,literal:d,built_in:p},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,s],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,s],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,s,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:f}},{className:"punctuation",begin:"->"},a]}}O();$();function Na(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=t.inherit(a,{begin:/\(/,end:/\)/}),c=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,d,c,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,d,c]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:p}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}O();$();var bc=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),yc=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],kc=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],vc=[...yc,...kc],wc=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Ec=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),_c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),xc=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Ca(t){let e=t.regex,n=bc(t),s={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",a=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",c=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,s,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Ec.join("|")+")"},{begin:":(:)?("+_c.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+xc.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:wc.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+vc.join("|")+")\\b"}]}}O();$();function Ra(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}ue.registerLanguage("sql",ia);ue.registerLanguage("javascript",da);ue.registerLanguage("typescript",ya);ue.registerLanguage("python",ka);ue.registerLanguage("bash",va);ue.registerLanguage("yaml",wa);ue.registerLanguage("json",Ea);ue.registerLanguage("java",Sa);ue.registerLanguage("go",Ta);ue.registerLanguage("rust",Aa);ue.registerLanguage("xml",Na);ue.registerLanguage("css",Ca);ue.registerLanguage("plaintext",Ra);ue.registerAliases(["js"],{languageName:"javascript"});ue.registerAliases(["ts"],{languageName:"typescript"});ue.registerAliases(["shell","sh","zsh"],{languageName:"bash"});ue.registerAliases(["html"],{languageName:"xml"});ue.registerAliases(["text","plain"],{languageName:"plaintext"});function Sc(t,e){return t.split("|").map(n=>{if(n=n.trim(),n===""||n==="all")return Array.from({length:e},(r,a)=>a+1);let s=[];for(let r of n.split(",")){let a=r.trim().match(/^(\d+)(?:-(\d+))?$/);if(!a)continue;let o=parseInt(a[1],10),c=a[2]?parseInt(a[2],10):o;for(let d=o;d<=Math.min(c,e);d++)s.push(d)}return s})}function Tc(t){let e=[[]];for(function n(s,r){for(let a of s.childNodes)a.nodeType===Node.TEXT_NODE?a.nodeValue.split(`
|
|
65
|
+
`).forEach((c,d)=>{d>0&&e.push([]),c&&e[e.length-1].push({path:r,text:c})}):a.nodeType===Node.ELEMENT_NODE&&n(a,[...r,a])}(t,[]);e.length&&e[e.length-1].length===0;)e.pop();t.textContent="";for(let n of e){let s=document.createElement("span");s.className="code-line";for(let{path:r,text:a}of n){let o=s;for(let c of r){let d=o.lastChild;d&&d.__orig===c||(d=c.cloneNode(!1),d.__orig=c,o.appendChild(d)),o=d}o.appendChild(document.createTextNode(a))}t.appendChild(s)}return t.querySelectorAll(":scope > .code-line")}function Ac(t,e){if(t.length===e)return"all lines";let n=[...t],s=[],r=n[0],a=n[0];for(let o of n.slice(1)){if(o===a+1){a=o;continue}s.push(r===a?`${r}`:`${r}-${a}`),r=a=o}return s.push(r===a?`${r}`:`${r}-${a}`),`lines ${s.join(",")}`}function Ma(t,e){t.querySelectorAll("pre > code").forEach(n=>{let s=[...n.classList].find(f=>f.startsWith("language-")),r=s?s.slice(9):null,a=n.textContent.replace(/^\n/,"").replace(/\s+$/,"");r&&ue.getLanguage(r)?n.innerHTML=ue.highlight(a,{language:r}).value:n.textContent=a,n.classList.add("hljs");let o=n.parentElement,c=Tc(n);o.hasAttribute("data-lines-numbers")&&o.classList.add("line-numbers");let d=o.getAttribute("data-lines");if(!d)return;let p=Sc(d,c.length);o.classList.add("stepping"),e(o,{count:p.length,label:f=>f===0?"code":Ac(p[f-1],c.length),apply(f){if(c.forEach(T=>T.classList.remove("line-hl","line-dim")),f===0)return;let E=new Set(p[f-1]),y=E.size===c.length;c.forEach((T,_)=>{E.has(_+1)?T.classList.add("line-hl"):y||T.classList.add("line-dim")})}})})}O();$();var Nc=/⟨CLICK⟩|<CLICK>|<click(?:\s[^>]*)?>(?:<\/click>)?/gi;function La(t){return(t||"").split(Nc)}function or(t){let e="width=1100,height=700",n=window.open("","decklight-speaker",e);if(!n)return null;let s=!1;try{s=n.document.body?n.document.body.childNodes.length>0:!1}catch{s=!0}if(s){try{n.close()}catch{}if(n=window.open("","decklight-speaker",e),!n)return null;try{n.document}catch{return null}}let r=()=>{let o=new URL(location.href);return o.searchParams.set("embedded",""),o.hash="",o.href};window.__decklightBridge={subscribe(o){t.__speakerCb=o},getState:()=>Oa(t,r()),next:()=>t.next(),prev:()=>t.prev()},t.__notifySpeaker=()=>{t.__speakerCb&&!n.closed&&t.__speakerCb(Oa(t,r()))};let a=`${t.config.width} / ${t.config.height}`;return n.document.write(`<!doctype html><html><head><meta charset="utf-8">
|
|
66
|
+
<title>Decklight \u2014 speaker view</title>
|
|
67
|
+
<style>
|
|
68
|
+
body { margin:0; background:#111; color:#eee; font:14px/1.5 -apple-system, system-ui, sans-serif;
|
|
69
|
+
display:grid; grid-template-columns: 1.4fr 1fr; grid-template-rows:auto auto 1fr auto; gap:10px; padding:10px; height:100vh; box-sizing:border-box; }
|
|
70
|
+
header { grid-column:1/3; display:flex; gap:16px; align-items:center; }
|
|
71
|
+
#timer { font-size:22px; font-variant-numeric:tabular-nums; }
|
|
72
|
+
#pos { color:#999; }
|
|
73
|
+
button { background:#333; color:#eee; border:0; border-radius:6px; padding:6px 12px; cursor:pointer; }
|
|
74
|
+
#mode { margin-left:auto; text-transform:uppercase; font-size:11px; letter-spacing:.09em; }
|
|
75
|
+
#mode.on { background:#5c4d00; color:#ffe38a; }
|
|
76
|
+
/* rehearse mode: cue cards, not prose \u2014 one cue per line, same type size */
|
|
77
|
+
body.rehearse aside { font-weight:600; }
|
|
78
|
+
body.rehearse aside .seg { display:block; margin:.35em 0; }
|
|
79
|
+
.thumbs { display:flex; flex-direction:column; gap:10px; min-height:0; align-items:start; }
|
|
80
|
+
/* Panes keep the presentation's aspect ratio: width-driven, capped so a
|
|
81
|
+
short window can't push the notes off screen. */
|
|
82
|
+
.thumb { width:min(100%, calc(42vh * (${a}))); aspect-ratio:${a}; border:1px solid #333; border-radius:8px; overflow:hidden; position:relative; }
|
|
83
|
+
.thumb .tag { position:absolute; top:6px; left:8px; z-index:2; background:#0009; padding:1px 8px; border-radius:4px; font-size:11px; }
|
|
84
|
+
iframe { width:100%; height:100%; border:0; background:#000; }
|
|
85
|
+
aside { grid-column:1/3; overflow:auto; background:#1b1b1b; border-radius:8px; padding:14px 16px; font-size:16px; line-height:1.65; }
|
|
86
|
+
aside .seg { opacity:.45; }
|
|
87
|
+
aside .seg.now { opacity:1; background:#2d2d00; outline:2px solid #665; border-radius:4px; }
|
|
88
|
+
aside .seg.said { opacity:.8; }
|
|
89
|
+
.cue { display:inline-block; background:#553; color:#ffc; font-size:11px; border-radius:4px; padding:0 6px; margin:0 4px; }
|
|
90
|
+
footer { grid-column:1/3; color:#888; font-size:12px; display:flex; gap:14px; overflow:auto; white-space:nowrap; }
|
|
91
|
+
footer .step.now { color:#ffc; }
|
|
92
|
+
</style></head><body>
|
|
93
|
+
<header>
|
|
94
|
+
<span id="timer">00:00</span>
|
|
95
|
+
<button id="resetTimer">reset</button>
|
|
96
|
+
<span id="pos"></span>
|
|
97
|
+
<button id="prev">\u25C0 prev</button>
|
|
98
|
+
<button id="next">next \u25B6</button>
|
|
99
|
+
<button id="mode" title="S toggles rehearse mode (cue cards instead of prose)">speak</button>
|
|
100
|
+
</header>
|
|
101
|
+
<div class="thumbs">
|
|
102
|
+
<div class="thumb"><span class="tag">current</span><iframe id="cur"></iframe></div>
|
|
103
|
+
</div>
|
|
104
|
+
<div class="thumbs">
|
|
105
|
+
<div class="thumb"><span class="tag">next</span><iframe id="nxt"></iframe></div>
|
|
106
|
+
</div>
|
|
107
|
+
<aside id="notes"></aside>
|
|
108
|
+
<footer id="steps"></footer>
|
|
109
|
+
<script>
|
|
110
|
+
const opener = window.opener;
|
|
111
|
+
let api = null;
|
|
112
|
+
const $ = (s) => document.querySelector(s);
|
|
113
|
+
const start = Date.now();
|
|
114
|
+
let t0 = start;
|
|
115
|
+
setInterval(() => {
|
|
116
|
+
const s = Math.floor((Date.now() - t0) / 1000);
|
|
117
|
+
$('#timer').textContent = String(Math.floor(s/60)).padStart(2,'0') + ':' + String(s%60).padStart(2,'0');
|
|
118
|
+
}, 500);
|
|
119
|
+
$('#resetTimer').onclick = () => { t0 = Date.now(); };
|
|
120
|
+
$('#prev').onclick = () => api && api.prev();
|
|
121
|
+
$('#next').onclick = () => api && api.next();
|
|
122
|
+
// speak = full prose notes; rehearse = the deck's aside.rehearse cue cards
|
|
123
|
+
// (same \u27E8CLICK\u27E9 segmentation, a few words per segment). S toggles \u2014 from
|
|
124
|
+
// this window or remotely via window.__decklightSpeakerToggle (deck's S).
|
|
125
|
+
let mode = 'speak', lastSt = null;
|
|
126
|
+
window.__decklightSpeakerToggle = () => {
|
|
127
|
+
mode = mode === 'speak' ? 'rehearse' : 'speak';
|
|
128
|
+
document.body.classList.toggle('rehearse', mode === 'rehearse');
|
|
129
|
+
$('#mode').textContent = mode;
|
|
130
|
+
$('#mode').classList.toggle('on', mode === 'rehearse');
|
|
131
|
+
if (lastSt) render(lastSt);
|
|
132
|
+
};
|
|
133
|
+
$('#mode').onclick = window.__decklightSpeakerToggle;
|
|
134
|
+
document.addEventListener('keydown', (e) => {
|
|
135
|
+
if (e.key === 'ArrowRight' || e.key === ' ') api && api.next();
|
|
136
|
+
if (e.key === 'ArrowLeft') api && api.prev();
|
|
137
|
+
if (e.key === 's' || e.key === 'S') window.__decklightSpeakerToggle();
|
|
138
|
+
});
|
|
139
|
+
let last = { slide: -1, nextHash: '' };
|
|
140
|
+
function render(st) {
|
|
141
|
+
lastSt = st;
|
|
142
|
+
$('#pos').textContent = 'slide ' + st.slide + ' / ' + st.totalSlides + ' \xB7 step ' + st.step + ' / ' + st.totalSteps;
|
|
143
|
+
if (st.slide !== last.slide) $('#cur').src = st.url + '#/' + st.slide + '/999';
|
|
144
|
+
if (st.nextHash !== last.nextHash) $('#nxt').src = st.url + '#' + st.nextHash;
|
|
145
|
+
last = { slide: st.slide, nextHash: st.nextHash };
|
|
146
|
+
const segs = (mode === 'rehearse' && st.rehearseSegments) ? st.rehearseSegments : st.notesSegments;
|
|
147
|
+
// Splitting on \u27E8CLICK\u27E9 can cut through a paragraph, leaving fragments
|
|
148
|
+
// with dangling open tags that would swallow the following segments \u2014
|
|
149
|
+
// re-serialize each fragment so every segment is balanced markup.
|
|
150
|
+
const bal = (h) => { const d = document.createElement('div'); d.innerHTML = h; return d.innerHTML; };
|
|
151
|
+
$('#notes').innerHTML = segs.map((s, i) => {
|
|
152
|
+
const cls = i < st.step ? 'said' : i === st.step ? 'now' : '';
|
|
153
|
+
return '<span class="seg ' + cls + '">' + bal(s) + '</span>' + (i < segs.length - 1 ? '<span class="cue">CLICK</span>' : '');
|
|
154
|
+
}).join('');
|
|
155
|
+
// Keep the live segment on screen as builds land: rehearse mode centers
|
|
156
|
+
// the current cue; prose just scrolls when the segment would otherwise
|
|
157
|
+
// be out of view.
|
|
158
|
+
const now = $('#notes .seg.now');
|
|
159
|
+
if (now) now.scrollIntoView({ block: mode === 'rehearse' ? 'center' : 'nearest', behavior: 'smooth' });
|
|
160
|
+
$('#steps').innerHTML = st.labels.map((l, i) =>
|
|
161
|
+
'<span class="step ' + (i === st.step - 1 ? 'now' : '') + '">' + (i + 1) + '. ' + l + '</span>').join('');
|
|
162
|
+
}
|
|
163
|
+
// The opener assigns the bridge around the same moment this script runs
|
|
164
|
+
// (document.write parsing is synchronous) \u2014 poll briefly instead of
|
|
165
|
+
// deciding on a single racy read.
|
|
166
|
+
function connect(tries) {
|
|
167
|
+
api = opener && !opener.closed && opener.__decklightBridge;
|
|
168
|
+
if (api) { api.subscribe(render); render(api.getState()); return; }
|
|
169
|
+
if (tries > 0) return setTimeout(() => connect(tries - 1), 100);
|
|
170
|
+
document.body.innerHTML = '<p style="padding:2em">Lost connection to the deck window.</p>';
|
|
171
|
+
}
|
|
172
|
+
connect(30);
|
|
173
|
+
<\/script>
|
|
174
|
+
</body></html>`),n.document.close(),n}function Oa(t,e){let{slide:n,step:s,totalSlides:r}=t.state,a=t._records[n-1],o=a?a.groups.length:0,c=s<o?`/${n}/${s+1}`:n<r?`/${n+1}/0`:`/${n}/${s}`,d=t._sections[n-1]?.querySelector("aside.notes"),p=t._sections[n-1]?.querySelector("aside.rehearse");return{slide:n,step:s,totalSlides:r,totalSteps:o,url:e,nextHash:c,notesSegments:La(d?d.innerHTML:""),rehearseSegments:p?La(p.innerHTML):null,labels:t._stepLabels(n-1)}}O();$();function Cc(t){return function(){t|=0,t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function Qe(t,e,n){t=(t%360+360)%360,e=Math.max(0,Math.min(100,e))/100,n=Math.max(0,Math.min(100,n))/100;let s=(1-Math.abs(2*n-1))*e,r=s*(1-Math.abs(t/60%2-1)),a=n-s/2,o=Math.floor(t/60)%6;return[[s,r,0],[r,s,0],[0,s,r],[0,r,s],[r,0,s],[s,0,r]][o].map(d=>Math.round((d+a)*255))}function gt([t,e,n]){return"#"+[t,e,n].map(s=>s.toString(16).padStart(2,"0")).join("")}function Zt([t,e,n]){let s=[t,e,n].map(r=>(r/=255,r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)));return .2126*s[0]+.7152*s[1]+.0722*s[2]}function Rc(t,e){let[n,s]=[Zt(t),Zt(e)].sort((r,a)=>a-r);return(n+.05)/(s+.05)}var Vt=(t,e)=>Math.min(...e.map(n=>Rc(t,n)));function pe(t,e,n,s,r){let o=s.reduce((f,E)=>f+Zt(E),0)/s.length<.5?1:-1,c=[];for(let f=e;f>0;f-=15)c.push(f);c.push(0);for(let f of[o,-o])for(let E of c)for(let y=n;y>=2&&y<=98;y+=f){let T=Qe(t,E,y);if(Vt(T,s)>=r)return T}let d=[253,253,254],p=[8,9,10];return Vt(d,s)>=Vt(p,s)?d:p}var Mc=["amber","boreal","cinder","coral","drift","ember","fable","fjord","gale","harbor","iris","juniper","kelp","lumen","mesa","nectar","onyx","pluma","quartz","reef","sable","tundra","umbra","verdant","wisp","yonder","zephyr"],lr='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',Lc='ui-rounded, "SF Pro Rounded", "Segoe UI", Roboto, Helvetica, Arial, sans-serif',Oc='"Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif',$c='"SF Mono", SFMono-Regular, ui-monospace, "Cascadia Code", Menlo, Consolas, monospace',Ic=[lr,lr,Lc,Oc],Dc=[600,650,700,750,800],Pc=["4px","6px","8px","10px","12px","14px","18px"],$a={analogous:[30,-30,60,15,-15],complementary:[180,150,210,30,-30],split:[150,210,30,180,-30],triadic:[120,240,60,180,300]},Ct={bgSatMax:{dark:18,light:12},accentSat:[42,68],hlSat:[36,58],ansiSat:[46,66],gradientChance:.15,gradientHueDrift:[8,20]};function os(t){t=(t??Math.floor(Math.random()*4294967295))>>>0;let e=Cc(t),n=le=>le[Math.floor(e()*le.length)],s=(le,I)=>le+e()*(I-le),r=e()<.5,a=Math.floor(e()*360),o=n(Object.keys($a)),c=$a[o],d=a+c[0],p=e()*e(),f=(le,I)=>le+p*(I-le),E=f(5,Ct.bgSatMax[r?"dark":"light"]),y=r?s(6,13):s(94,97.5),T=Qe(a,E,y),_=gt(T),S=[T];if(e()<Ct.gradientChance){let le=Qe(a+s(...Ct.gradientHueDrift),E+s(0,8),y+(r?s(2.5,5):-s(2,4)));_=`linear-gradient(${Math.round(s(120,210))}deg, ${gt(T)} 0%, ${gt(le)} 100%)`,S=[T,le]}let B=Qe(a,Math.min(E+4,35),r?y+4:y-4),D=pe(a,12,r?86:18,S,4.6),H=pe(a,10,r?64:44,S,3.1),W=e()<.5?pe(d,f(20,55),r?80:26,S,3.2):pe(a,8,r?92:12,S,4.6),Y=f(...Ct.accentSat),K=r?s(55,68):s(34,48),oe=Qe(d,Y,K);for(;Math.max(Vt([253,253,254],[oe]),Vt([8,9,10],[oe]))<4.7;)K+=r?1:-1,oe=Qe(d,Y,K);let G=pe(d,18,Zt(oe)<.4?96:10,[oe],4.6),re=pe(e()<.5?d:a+(c[1]??30),f(35,60),r?70:34,S,3.2),Z=gt(B),Pe=`1px solid ${gt(Qe(a,Math.min(E+6,40),r?y+10:y-10))}`,Ue=n(Pc),Re=r?`0 ${Math.round(s(4,10))}px ${Math.round(s(18,30))}px rgba(0, 0, 0, 0.${Math.round(s(35,55))})`:`0 ${Math.round(s(3,6))}px ${Math.round(s(12,20))}px rgba(30, 30, 40, 0.${String(Math.round(s(8,14))).padStart(2,"0")})`,Me=Qe(a,Math.min(E+2,28),r?Math.max(y-3,3):Math.min(y-3,93)),Ee=[Me],w=pe(a,8,r?85:20,Ee,4.6),C={keyword:c[0],string:c[3]??120,number:c[2]??60,function:c[1]??210,type:c[4]??280},x=f(...Ct.hlSat),P=r?68:36,M={};for(let[le,I]of Object.entries(C))M[le]=pe(a+I,x,P,Ee,4.6);M.comment=pe(a,12,r?60:46,Ee,3.2),M.punct=pe(a,10,r?74:32,Ee,4.6);let ie=[0,c[0],c[1]??40,c[2]??90,c[3]??160,c[4]??230].map((le,I)=>Qe(a+le,f(14,34),r?y+8+I%3*2:y-6-I%3*2)),be=[...S,...ie],he=pe(a,14,r?60:42,S,2.2),xe=pe(a,10,r?84:20,be,3.4),Rt=pe(a,10,r?62:46,be,2.7),Je=pe(d,Y,r?68:38,be,2.7),Le=ie.map(gt),ot=Qe(a,Math.min(E+4,30),r?Math.max(y-4,3):s(12,18)),ye=[ot],Xt=pe(a,8,82,ye,4.6),lt=pe(d,f(...Ct.ansiSat),66,ye,3.2),de={red:8,green:125,yellow:45,blue:215,magenta:290,cyan:175},J={black:pe(a,10,58,ye,3.1),white:pe(a,6,88,ye,4.6)};for(let[le,I]of Object.entries(de))J[le]=pe(I+a%16-8,f(...Ct.ansiSat),66,ye,3.1);let ce=le=>{let[I,F,ke]=le.map(_e=>Math.min(255,Math.round(_e+(255-_e)*.35)));return Vt([I,F,ke],ye)>=3?[I,F,ke]:pe(a,8,90,ye,3.1)},ct=`gen-${n(Mc)}-${(t%65535).toString(16).padStart(4,"0")}`,N=gt,L={"--bg":_,"--bg-accent":gt(B),"--fg":N(D),"--muted":N(H),"--font-body":lr,"--font-heading":n(Ic),"--font-mono":$c,"--heading-color":N(W),"--heading-weight":String(n(Dc)),"--link":N(re),"--accent":N(oe),"--accent-contrast":N(G),"--block-bg":Z,"--block-border":Pe,"--block-radius":Ue,"--shadow":Re,"--code-bg":N(Me),"--code-fg":N(w),"--hl-keyword":N(M.keyword),"--hl-string":N(M.string),"--hl-number":N(M.number),"--hl-comment":N(M.comment),"--hl-function":N(M.function),"--hl-type":N(M.type),"--hl-punct":N(M.punct),"--d-stroke":N(he),"--d-text":N(xe),"--d-muted":N(Rt),"--d-accent":N(Je),"--d-fill-1":Le[0],"--d-fill-2":Le[1],"--d-fill-3":Le[2],"--d-fill-4":Le[3],"--d-fill-5":Le[4],"--d-fill-6":Le[5],"--term-bg":N(ot),"--term-fg":N(Xt),"--term-prompt":N(lt),"--term-cursor":N(lt),"--term-selection":`rgba(${oe[0]}, ${oe[1]}, ${oe[2]}, 0.30)`,"--ansi-black":N(J.black),"--ansi-red":N(J.red),"--ansi-green":N(J.green),"--ansi-yellow":N(J.yellow),"--ansi-blue":N(J.blue),"--ansi-magenta":N(J.magenta),"--ansi-cyan":N(J.cyan),"--ansi-white":N(J.white),"--ansi-bright-black":N(ce(J.black)),"--ansi-bright-red":N(ce(J.red)),"--ansi-bright-green":N(ce(J.green)),"--ansi-bright-yellow":N(ce(J.yellow)),"--ansi-bright-blue":N(ce(J.blue)),"--ansi-bright-magenta":N(ce(J.magenta)),"--ansi-bright-cyan":N(ce(J.cyan)),"--ansi-bright-white":N(pe(a,6,97,ye,3.1)),"--dim-opacity":(.25+Math.round(e()*15)/100).toFixed(2)};return{name:ct,seed:t,dark:r,harmony:o,tokens:L}}var Ia=[["canvas",["--bg","--bg-accent","--fg","--muted"]],["type",["--font-body","--font-heading","--font-mono","--heading-color","--heading-weight","--link"]],["accent",["--accent","--accent-contrast"]],["blocks",["--block-bg","--block-border","--block-radius","--shadow"]],["code",["--code-bg","--code-fg","--hl-keyword","--hl-string","--hl-number","--hl-comment","--hl-function","--hl-type","--hl-punct"]],["diagram",["--d-stroke","--d-text","--d-muted","--d-accent","--d-fill-1","--d-fill-2","--d-fill-3","--d-fill-4","--d-fill-5","--d-fill-6"]],["terminal",["--term-bg","--term-fg","--term-prompt","--term-cursor","--term-selection","--ansi-black","--ansi-red","--ansi-green","--ansi-yellow","--ansi-blue","--ansi-magenta","--ansi-cyan","--ansi-white","--ansi-bright-black","--ansi-bright-red","--ansi-bright-green","--ansi-bright-yellow","--ansi-bright-blue","--ansi-bright-magenta","--ansi-bright-cyan","--ansi-bright-white"]],["builds",["--dim-opacity"]]];function cr(t,e){let n=`/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
|
|
175
|
+
Decklight theme \xB7 ${t}
|
|
176
|
+
generated by Decklight (\u2303T) \u2014 token contract: SPEC.md \xA75
|
|
177
|
+
All values derived with WCAG luminance math; passes test/contrast.mjs
|
|
178
|
+
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 */
|
|
179
|
+
|
|
180
|
+
.decklight {
|
|
181
|
+
`;for(let[r,a]of Ia){let o=a.filter(c=>e[c]!==void 0);if(o.length){n+=` /* \u2500\u2500 ${r} ${"\u2500".repeat(Math.max(1,26-r.length))} */
|
|
182
|
+
`;for(let c of o)n+=` ${c}: ${e[c]};
|
|
183
|
+
`;n+=`
|
|
184
|
+
`}}let s=new Set(Ia.flatMap(([,r])=>r));for(let[r,a]of Object.entries(e))s.has(r)||(n+=` ${r}: ${a};
|
|
185
|
+
`);return n.replace(/\n$/,"")+`}
|
|
186
|
+
`}var Bc={transition:"fade",hash:!0,controls:!0,slideNumber:!1,width:1280,height:720,pinTitles:!1},dr=99,Uc=18,Da=6,zc="ul, ol, svg, pre, table, .terminal, img, .columns",jt=null;function wn(t,e){fi(t,e),jt&&jt._rescanFor(t)}function Hc(t){for(let e of t.children)if(!e.matches("aside, script, style, .decklight-hero-logo"))return e.matches("h1, h2")?e:null;return null}function Fc(t,e){if(!e||t.getAttribute("data-subtitle")==="none")return null;let n=e.nextElementSibling;return n&&n.matches("p")&&!n.hasAttribute("data-build")?(n.classList.add("subtitle"),n):t.querySelector(":scope > p.subtitle")}function ur(t,e){let n=e.pinTitles===!0?dr:typeof e.pinTitles=="number"&&isFinite(e.pinTitles)?e.pinTitles:null;t.forEach(s=>{let r=Hc(s),a=s.getAttribute("data-pin"),o=null;if(a==="none")o=null;else if(a!==null&&a!==""){let f=parseFloat(a);o=isFinite(f)?f:n??dr}else a===""?o=n??dr:n!==null&&[...s.querySelectorAll(zc)].some(E=>!E.closest("aside")&&!E.closest(".decklight-hero-logo"))&&(o=n);let c=Fc(s,r);if(s.querySelector(":scope > .pin-title")?.classList.remove("pin-title"),s.querySelector(":scope > .pin-subtitle")?.classList.remove("pin-subtitle"),o===null||!r){s.removeAttribute("data-pinned"),s.style.removeProperty("--pin-y"),s.style.removeProperty("--pin-sub-y"),s.style.removeProperty("--pin-space");return}r.classList.add("pin-title"),s.setAttribute("data-pinned",""),s.style.setProperty("--pin-y",o+"px"),s.classList.add("pin-measure");let d=r.offsetHeight||0,p=o+d;c&&(c.classList.add("pin-subtitle"),s.style.setProperty("--pin-sub-y",Math.round(p+Da)+"px"),p+=Da+(c.offsetHeight||0)),s.classList.remove("pin-measure"),s.style.setProperty("--pin-space",Math.round(p+Uc)+"px")})}function pr(t,e){if(!t)return;let n=[t,...t.querySelectorAll("pre, table, svg, ul, ol, blockquote")].some(s=>s.scrollHeight>s.clientHeight+2&&getComputedStyle(s).overflowY!=="visible"&&!s.closest(".terminal")&&!s.hasAttribute("data-scroll-ok"));t.toggleAttribute("data-overflow",n),n&&console.warn(`Decklight: slide ${e} content overflows and is clipped \u2014 reduce content or font size`)}function Pa(t={}){let e=new URLSearchParams(location.search),n={...Bc,...t};e.has("embedded")&&(n.controls=!1);let s=e.has("print"),r=Date.now(),a=[],o=null,c=0;function d(i,l){if(a.push({t:((Date.now()-r)/1e3).toFixed(3),kind:i,msg:l}),a.length>200&&a.shift(),o){Nr(a[a.length-1]),Bt();let u=o.querySelector(".dbg-log");u.scrollTop=u.scrollHeight}}let p=document.querySelector(".decklight");if(!p)throw new Error("Decklight: no .decklight element found");let f=!e.has("embedded")&&n.playlist?.modules?.length?n.playlist:null,E=f?f.index??0:0;function y(i){if(!f)return!1;let l=f.modules[E+i];return l?(location.href=l.href+(i>0?"#/1/0":"#/999/999"),!0):!1}function T(i){let l=f?.modules[i];l&&(location.href=l.href+"#/1/0")}let _=!!p.querySelector("section[data-module]");function S(){let i=[];return(k._sections||[]).forEach((l,u)=>{l.hasAttribute("data-module")&&i.push({title:l.getAttribute("data-module"),slide:u+1})}),i}function B(i){let l=-1;return i.forEach((u,h)=>{u.slide<=k.state.slide&&(l=h)}),l}let D=[...document.querySelectorAll("style[data-theme]")],H=D.length>0,U=H?null:document.querySelector('link[rel="stylesheet"][href*="themes/"]');if(H){let i=D.find(l=>!l.hasAttribute("disabled")&&l.media!=="not all");i=i||D[0],D.forEach(l=>{l.removeAttribute("disabled"),l.media=l===i?"all":"not all"})}let W=H||!!U,Y=i=>(i.match(/themes\/([\w-]+)\.css/)||[])[1],K="decklight-theme:"+location.pathname,oe="decklight-custom-themes",G={};try{G=JSON.parse(localStorage.getItem(oe)||"{}")||{}}catch{}let re=null,Z=null,Pe={};function Ue(i,l,u){let h=u==="generated"?re:Pe[i];return h||(h=document.createElement("style"),h.media="not all",u==="generated"?h.dataset.generated="":h.dataset.custom=""),h.dataset.theme=i,h.textContent=cr(i,l),document.head.appendChild(h),u==="generated"?re=h:Pe[i]=h,h}function Re(i){for(let l of[re,...Object.values(Pe)])l&&l!==i&&(l.media="not all")}let Me=()=>[re,...Object.values(Pe)].find(i=>i&&i.media!=="not all")||null,Ee=()=>{let i=Me();return i?i.dataset.theme:H?D.find(l=>l.media!=="not all")?.dataset.theme:U?Y(U.href):void 0},w,C;function x(i,l=1200){s||(w||(w=document.createElement("div"),w.className="decklight-toast",p.appendChild(w)),w.textContent=i,w.classList.add("show"),clearTimeout(C),C=setTimeout(()=>w.classList.remove("show"),l))}function P(i,l=!1){if(!i||!/^[\w-]+$/.test(i))return;let u=!1;if(Z&&re&&i===Z.name)re.media="all",Re(re),u=!G[i];else if(G[i]){let h=Ue(i,G[i],"custom");h.media="all",Re(h)}else{if(!W)return;if(Re(null),H){let h=D.find(g=>g.dataset.theme===i);if(!h)return;D.forEach(g=>{g.media=g===h?"all":"not all"})}else U.href=U.href.replace(/themes\/[\w-]+\.css(\?.*)?$/,`themes/${i}.css`)}if(!e.has("embedded")&&!u)try{localStorage.setItem(K,i)}catch{}l||x(i),d("theme",i),Mn()}let M=typeof ee<"u"?ee:null,te=i=>M?.labels?.[i]??i;function ie(i){if(G[i])return"custom";if(Z&&i===Z.name)return"generated";if(M){for(let[l,u]of Object.entries(M.packs))if(u.includes(i))return l}return"other"}let be=()=>{let i;if(H){let u=D.map(h=>h.dataset.theme);i=n.themes?.length?n.themes.filter(h=>u.includes(h)):u}else i=n.themes?.length?n.themes:typeof X<"u"?X:[];let l=Object.keys(G);if(Z&&!G[Z.name]&&l.push(Z.name),i=[...i,...l.filter(u=>!i.includes(u))],M){let u=new Map,h=0;for(let g of M.order)for(let m of M.packs[g]??[])u.set(m,h++);i=[...i].sort((g,m)=>(u.get(g)??1e9)-(u.get(m)??1e9))}return i};function he(i){let l=[];for(let u of M.order){let h=(M.packs[u]??[]).filter(g=>i.includes(g));h.length&&l.push([u,h])}for(let u of["custom","generated"]){let h=i.filter(g=>ie(g)===u);h.length&&l.push([u,h])}return l}let xe=i=>btoa(unescape(encodeURIComponent(JSON.stringify(i)))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),Rt=i=>JSON.parse(decodeURIComponent(escape(atob(i.replace(/-/g,"+").replace(/_/g,"/")))));function Je(i,l=!1){Z={name:i.name,tokens:i.tokens};let u=Ue(i.name,i.tokens,"generated");return u.media="all",Re(u),l||x(`\u2728 ${i.name} \u2014 \u2303T re-roll \xB7 \u2303\u21E7T save`,2800),Mn(),i.name}function Le(){return Je(os())}function ot(i){if(!Z||!re||re.media==="not all")return x("no generated theme to save \u2014 \u2303T to generate one"),null;let l=i??(window.prompt?.("Save theme as:",Z.name.replace(/^gen-/,""))||"");if(l=String(l).toLowerCase().replace(/[^a-z0-9-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40),!l)return null;((typeof X<"u"?X:[]).includes(l)||D.some(g=>g.dataset.theme===l))&&(l="custom-"+l),G[l]=Z.tokens;try{localStorage.setItem(oe,JSON.stringify(G))}catch{}let h=Ue(l,G[l],"custom");if(h.media="all",re?.remove(),re=null,Z=null,Re(h),!e.has("embedded"))try{localStorage.setItem(K,l)}catch{}try{let g=new Blob([cr(l,G[l])],{type:"text/css"}),m=document.createElement("a");m.href=URL.createObjectURL(g),m.download=`${l}.css`,m.click(),setTimeout(()=>URL.revokeObjectURL(m.href),5e3)}catch{}return x(`saved ${l} \u2014 ${l}.css downloaded`,2200),l}let ye=null;function Xt(i=!1){return ye?(clearTimeout(ye.timer),ye=null,i||x("theme cycle cancelled"),!0):!1}function lt(i){let l=be();if(!W||l.length<2)return;if(ye){let m=ye;clearTimeout(m.timer),ye=null,m.dir===i?P(m.name):x("theme cycle cancelled");return}let u=Ee(),h=Math.max(0,l.indexOf(u)),g=l[(h+i+l.length)%l.length];if(M&&ie(g)!==ie(u)){let m=i>0?".":",",v=i>0?",":".";ye={dir:i,name:g,timer:setTimeout(()=>{ye=null},4e3)},x(`\u2933 ${te(ie(g))} pack next (${g}) \u2014 ${m} confirms \xB7 ${v} or Esc cancels`,4e3);return}P(g)}e.has("embedded")&&window.addEventListener("message",i=>{let l=i.data&&i.data.__decklightPreview;!l||i.source!==window.parent||(l.gen?Je(l.gen,!0):l.theme?P(l.theme,!0):l.goto&&k.goto(l.goto[0],l.goto[1]??0))});let de="\0generate",J="pack:",ce="back",ct="all",N=null,L=0,le,I=[],F=null,ke="",_e="packs";function Qt(i){let l=k.state,u="#/"+l.slide+"/"+l.step;if(i===de||G[i]||Z&&i===Z.name){let h=i===de?F:G[i]?{name:i,tokens:G[i]}:Z;return location.pathname+"?embedded&gen="+xe(h)+u}return location.pathname+"?embedded&theme="+encodeURIComponent(i)+u}function bt(i){i.textContent=F?`\u2728 ${F.name} \u2014 \u2303T re-rolls`:"\u2728 Generate new\u2026"}function A(){F=os();let i=I.indexOf(de);i<0||(bt(N.querySelectorAll(".tp-row")[i]),qe(i,!0))}function R(){let i=N.querySelector(".tp-list"),l=Ee(),u=be();if(ke)I=u.filter(m=>m.includes(ke));else if(!M||_e==="all")I=M?[de,ce,...u]:[de,...u];else if(_e==="packs")I=[de,...he(u).map(([m])=>J+m),ct];else{let m=_e.slice(5);I=[ce,...he(u).find(([v])=>v===m)?.[1]??[]]}i.textContent="";let h=(m,v)=>{let b=document.createElement("span");b.className="tp-tag",b.textContent=v,m.appendChild(b)};if(I.forEach((m,v)=>{let b=document.createElement("div");if(b.setAttribute("role","option"),m===de)b.className="tp-row tp-gen",bt(b);else if(m===ce)b.className="tp-row tp-back",b.textContent="\u2190 packs";else if(m===ct)b.className="tp-row tp-all",b.textContent="\u2733 all themes",h(b,String(u.length));else if(m.startsWith(J)){let q=m.slice(J.length),ae=he(u).find(([qt])=>qt===q)?.[1]??[];b.className="tp-row tp-pack"+(ae.includes(l)?" tp-current":""),b.textContent=`\u25B8 ${te(q)}`,h(b,String(ae.length))}else{b.className="tp-row"+(m===l?" tp-current":""),b.textContent=m;let q=G[m]?"custom":Z&&m===Z.name?"generated":ke&&M?te(ie(m)):null;q&&h(b,q)}b.addEventListener("mouseenter",()=>qe(v,!1)),b.addEventListener("click",()=>{qe(v,!0),yr()}),i.appendChild(b)}),!I.length){let m=document.createElement("div");m.className="tp-none",m.textContent="no themes match",i.appendChild(m)}let g=N.querySelector(".tp-filter");g.textContent=ke||"type to filter\u2026",g.classList.toggle("tp-active",!!ke)}function z(){let i=Ee(),l=I.indexOf(i);if(l>=0)return l;let u=I.indexOf(J+ie(i));return u>=0?u:Math.min(1,I.length-1)}function V(i,l=!1){_e=i,R(),I.length&&qe(z(),l)}function fe(i){ke=i.toLowerCase(),R(),I.length?qe(ke?0:z(),!1):N.querySelector(".tp-caption").textContent="no match"}function Oe(){if(N)return yt();let i=be();if(!W&&!i.length)return;ke="",_e=M?"packs":"all",N=document.createElement("div"),N.className="decklight-theme-picker",N.innerHTML='<div class="tp-panel"><div class="tp-side"><div class="tp-filter"></div><div class="tp-list" role="listbox" aria-label="Themes"></div></div><div class="tp-preview"><iframe title="Theme preview"></iframe><div class="tp-caption"></div></div></div>',R(),N.addEventListener("click",u=>{u.target===N&&yt()}),p.appendChild(N);let l=Ee();l&&Tn(N.querySelector("iframe"),l),qe(z(),!l)}function qe(i,l){if(!I.length)return;L=(i+I.length)%I.length;let u=I[L];u===de&&!F&&(F=os(),bt(N.querySelectorAll(".tp-row")[L]));let h=N.querySelectorAll(".tp-row");h.forEach((b,q)=>b.classList.toggle("tp-selected",q===L)),h[L]?.scrollIntoView({block:"nearest"});let g=be(),m=u===de?F?`\u2728 ${F.name}`:"generate new":u===ce?"back to packs":u===ct?`all ${g.length} themes, flattened`:u.startsWith(J)?`${te(u.slice(J.length))} \xB7 ${he(g).find(([b])=>b===u.slice(J.length))?.[1].length??0} themes`:M?`${te(ie(u))} \xB7 ${u}`:u;if(N.querySelector(".tp-caption").textContent=m,clearTimeout(le),u!==de&&u.charCodeAt(0)===1)return;let v=N.querySelector("iframe");l?Tn(v,u):le=setTimeout(()=>Tn(v,u),60)}let Jt=!1,Sn=null;function Ka(i){return i===de||G[i]||Z&&i===Z.name?{gen:i===de?F:G[i]?{name:i,tokens:G[i]}:Z}:{theme:i}}function Tn(i,l){if(!i.dataset.booted){i.dataset.booted="1",Jt=!1,i.addEventListener("load",()=>{if(Jt=!0,Sn!==null&&N){let u=Sn;Sn=null,Tn(i,u)}},{once:!0}),i.src=Qt(l);return}if(!Jt){Sn=l;return}i.contentWindow?.postMessage({__decklightPreview:Ka(l)},"*")}function yr(){let i=I[L];if(i!==void 0){if(i===de){F&&Je(F),yt();return}if(i===ce){V("packs");return}if(i===ct){V("all");return}if(i.startsWith(J)){V("pack:"+i.slice(J.length),!0);return}P(i),yt()}}function yt(){clearTimeout(le),N?.remove(),N=null}let ge=null,kt=0,dt="",Ge=[],ps,hs=!1,An=null;function Wa(){return k._sections.map((i,l)=>{let u=[...i.children].filter(v=>!v.matches("aside, script, style")),h=i.querySelector("h1, h2, h3"),g=u.map(v=>v.textContent).join(" ").replace(/\s+/g," ").trim(),m=(h?.textContent||"").replace(/\s+/g," ").trim()||g.slice(0,60)||`slide ${l+1}`;return{slide:l+1,title:m,haystack:g.toLowerCase()}})}function kr(){let i=ge.querySelector(".tp-list"),l=dt.split(/\s+/).filter(Boolean),u=[],h=[];for(let m of ge.__index){let v=m.title.toLowerCase();l.every(b=>v.includes(b))?u.push(m):l.every(b=>m.haystack.includes(b))&&h.push(m)}if(Ge=[...u,...h],i.textContent="",Ge.forEach((m,v)=>{let b=document.createElement("div");b.className="tp-row"+(m.slide===k.state.slide?" tp-current":""),b.textContent=`${m.slide} \xB7 ${m.title}`,b.addEventListener("mouseenter",()=>Mt(v,!1)),b.addEventListener("click",()=>{Mt(v,!0),vr()}),i.appendChild(b)}),!Ge.length){let m=document.createElement("div");m.className="tp-none",m.textContent="no slides match",i.appendChild(m)}let g=ge.querySelector(".tp-filter");g.textContent=dt||"type to find a slide\u2026",g.classList.toggle("tp-active",!!dt)}function fs(i,l){if(!i.dataset.booted){i.dataset.booted="1",hs=!1,i.addEventListener("load",()=>{if(hs=!0,An!==null&&ge){let m=An;An=null,fs(i,m)}},{once:!0});let u=Ee(),h="#/"+l+"/0",g=G[u]?{name:u,tokens:G[u]}:Z&&u===Z.name?Z:null;i.src=location.pathname+(g?"?embedded&gen="+xe(g):u?"?embedded&theme="+encodeURIComponent(u):"?embedded")+h;return}if(!hs){An=l;return}i.contentWindow?.postMessage({__decklightPreview:{goto:[l,0]}},"*")}function Mt(i,l){if(!Ge.length)return;kt=(i+Ge.length)%Ge.length;let u=ge.querySelectorAll(".tp-row");u.forEach((m,v)=>m.classList.toggle("tp-selected",v===kt)),u[kt]?.scrollIntoView({block:"nearest"});let h=Ge[kt];ge.querySelector(".tp-caption").textContent=`slide ${h.slide} \u2014 ${h.title}`,clearTimeout(ps);let g=ge.querySelector("iframe");l?fs(g,h.slide):ps=setTimeout(()=>fs(g,h.slide),60)}function en(i){dt=i,kr(),Ge.length?Mt(0,!1):ge.querySelector(".tp-caption").textContent="no match"}function vr(){let i=Ge[kt];tn(),i&&k.goto(i.slide,0)}function gs(){if(ge)return tn();N&&yt(),dt="",ge=document.createElement("div"),ge.className="decklight-theme-picker decklight-finder",ge.innerHTML='<div class="tp-panel"><div class="tp-side"><div class="tp-filter"></div><div class="tp-list" role="listbox" aria-label="Slides"></div></div><div class="tp-preview"><iframe title="Slide preview"></iframe><div class="tp-caption"></div></div></div>',ge.__index=Wa(),kr(),ge.addEventListener("click",i=>{i.target===ge&&tn()}),p.appendChild(ge),Mt(Math.max(0,Ge.findIndex(i=>i.slide===k.state.slide)),!0)}function tn(){clearTimeout(ps),ge?.remove(),ge=null}let $e=null,Lt=0,Se="",Ke=[];function Va(){let i=u=>typeof u=="function";return[{label:"Find slide\u2026",hint:"G",alias:"search grep goto",run:()=>{gs(),Se&&en(Se)}},{label:"Go to slide\u2026",hint:"#",alias:"goto",keepOpen:!0,run:()=>{Se="goto ",nn()}},{label:"Theme\u2026",hint:"T",run:Oe},{label:"Cycle theme",hint:", \xB7 .",run:()=>lt(1)},{label:"Generate a theme",hint:"\u2303T",run:Le},Z&&{label:"Save the generated theme\u2026",hint:"\u2303\u21E7T",run:()=>ot()},{label:"Font\u2026",hint:"[ \xB7 ]",run:ja},{label:`Narration ${me?"off":"on"}`,hint:"V",run:cn},{label:"Narration track\u2026",hint:"N",alias:"voice audio",run:()=>Fn("tracks")},{label:"Live voice\u2026",alias:"tts synthesize tone gemini",run:()=>Fn("voices")},{label:"Record offline narration\u2026",hint:"\u21E7V",alias:"export download batch wav tts",run:oi},{label:"Voice faster",hint:">",alias:"speed rate playback",run:()=>Dn(.25)},{label:"Voice slower",hint:"<",alias:"speed rate playback",run:()=>Dn(-.25)},{label:"Speaker view",hint:"S",run:()=>{let u=k.__speakerWin;u&&!u.closed?u.__decklightSpeakerToggle?.():k.__speakerWin=or(k)}},{label:"Overview",hint:"O",run:It},(f||_)&&{label:"Module\u2026",hint:"M",run:vt},{label:"Blackout",hint:"B",run:Ar},{label:"Debug log",hint:"D",alias:"console events state",run:Cr},{label:`Captions ${st?"off":"on"}`,hint:"C",alias:"cc subtitles closed caption",run:Gr},{label:"Transcript\u2026",alias:"notes script export text markdown spoken",run:dn},{label:`Narration ${Ve?"resume":"pause"}`,hint:"P",alias:"pause resume voice",run:zr},{label:"Edit speaker notes\u2026",hint:"E",alias:"edit mode notes write",run:un},{label:"Fullscreen",hint:"F",run:()=>vs()},{label:"Print view (all slides, new tab)",hint:"",run:()=>window.open(location.pathname+"?print")},{label:"First slide",hint:"Home",run:()=>k.goto(1,0)},{label:"Last slide",hint:"End",run:()=>k.goto(k.state.totalSlides,0)},{label:"Keyboard help",hint:"?",run:Es}].filter(Boolean).filter(u=>i(u.run))}function nn(){let i=$e.querySelector(".narr-card");i.textContent="";let l=Se.toLowerCase();Ke=Va().filter(g=>!l||(g.label+" "+(g.alias??"")).toLowerCase().includes(l));let u=Se.trim().match(/^(?:goto\s*)?(\d+)$/i);if(u){let g=Math.max(1,Math.min(parseInt(u[1],10),k.state.totalSlides));Ke.unshift({label:`Go to slide ${g} / ${k.state.totalSlides}`,hint:"\u23CE",run:()=>k.goto(g,0)})}l&&!u&&!Ke.some(g=>g.label.toLowerCase().startsWith(l))&&Ke.push({label:`Search slides for \u201C${Se}\u201D`,hint:"",run:()=>{gs(),en(Se)}});let h=document.createElement("div");if(h.className="pal-input"+(Se?" tp-active":""),h.textContent=Se||"type a command\u2026",i.appendChild(h),Ke.forEach((g,m)=>{let v=document.createElement("div");v.className="narr-row pal-row";let b=document.createElement("span");if(b.textContent=g.label,v.appendChild(b),g.hint){let q=document.createElement("span");q.className="pal-kbd",q.textContent=g.hint,v.appendChild(q)}v.addEventListener("mouseenter",()=>sn(m)),v.addEventListener("click",()=>{sn(m),wr()}),i.appendChild(v)}),!Ke.length){let g=document.createElement("div");g.className="tp-none",g.textContent="no matching command",i.appendChild(g)}sn(0)}function sn(i){Ke.length&&(Lt=(i+Ke.length)%Ke.length,$e.querySelectorAll(".pal-row").forEach((l,u)=>l.classList.toggle("narr-sel",u===Lt)),$e.querySelectorAll(".pal-row")[Lt]?.scrollIntoView({block:"nearest"}))}function wr(){let i=Ke[Lt];i&&(i.keepOpen||Nn(),i.run())}function Za(){if($e)return Nn();ge&&tn(),Se="",$e=document.createElement("div"),$e.className="decklight-narr decklight-palette",$e.innerHTML='<div class="narr-card" role="listbox" aria-label="Commands"></div>',$e.addEventListener("click",i=>{i.target===$e&&Nn()}),p.appendChild($e),nn()}function Nn(){$e?.remove(),$e=null}let Ie=null,Ot=0;function ja(){if(Ie)return rn();Ie=document.createElement("div"),Ie.className="decklight-narr decklight-font-picker",Ie.innerHTML='<div class="narr-card" role="listbox" aria-label="Fonts"></div>';let i=Ie.querySelector(".narr-card");et.forEach(([l],u)=>{let h=document.createElement("div");h.className="narr-row"+(u===$t?" narr-cur":""),h.textContent=l,u>0&&(h.style.fontFamily=et[u][1]),h.addEventListener("mouseenter",()=>Cn(u)),h.addEventListener("click",()=>{Rn(u),rn()}),i.appendChild(h)}),Ie.addEventListener("click",l=>{l.target===Ie&&rn()}),p.appendChild(Ie),Cn($t)}function Cn(i){Ot=(i+et.length)%et.length,Ie.querySelectorAll(".narr-row").forEach((l,u)=>l.classList.toggle("narr-sel",u===Ot)),Ie.querySelectorAll(".narr-row")[Ot]?.scrollIntoView({block:"nearest"})}function rn(){Ie?.remove(),Ie=null}{let i=e.get("gen"),l=!1;if(i)try{let u=Rt(i);u&&u.tokens&&(Je({name:u.name||"gen-preview",tokens:u.tokens},!0),l=!0)}catch{}if(!l){let u=null;try{u=localStorage.getItem(K)}catch{}let h=e.get("theme")||u;h&&P(h,!0)}}let et=[["theme default",null],["system sans","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"],["rounded","ui-rounded, 'SF Pro Rounded', 'Hiragino Maru Gothic ProN', Quicksand, Comfortaa, 'Arial Rounded MT Bold', Calibri, sans-serif"],["humanist","Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro, sans-serif"],["geometric","'Avenir Next', Avenir, Montserrat, Corbel, 'URW Gothic', source-sans-pro, sans-serif"],["classical serif","'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif"],["transitional serif","Charter, 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif"],["slab serif","Rockwell, 'Rockwell Nova', 'Roboto Slab', 'DejaVu Serif', 'Sitka Small', serif"],["monospace","'SF Mono', SFMono-Regular, ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace"]],ms="decklight-font:"+location.pathname,$t=0;function Rn(i,{silent:l=!1,remeasure:u=!0}={}){$t=(i%et.length+et.length)%et.length;let[h,g]=et[$t];if(g?(p.style.setProperty("--font-body",g),p.style.setProperty("--font-heading",g)):(p.style.removeProperty("--font-body"),p.style.removeProperty("--font-heading")),!e.has("embedded"))try{g?localStorage.setItem(ms,String($t)):localStorage.removeItem(ms)}catch{}u&&(ur(k._sections,n),pr(k._sections[k.state.slide-1],k.state.slide)),l||x(`font: ${h}`),d("font",h)}function bs(i){Rn($t+i)}try{let i=parseInt(localStorage.getItem(ms),10);i>0&&i<et.length&&Rn(i,{silent:!0,remeasure:!1})}catch{}function Ya(i){if(!i)return null;if(i.startsWith("#")){let u=document.querySelector(i);if(!u)return null;let h=u.cloneNode(!0);return h.removeAttribute("id"),h.style.removeProperty("display"),h}if(i.trim().startsWith("<")){let u=document.createElement("div");return u.innerHTML=i,u.firstElementChild}let l=document.createElement("img");return l.src=i,l.alt="",l}let ze=null;function Mn(){let i=getComputedStyle(p),l=g=>g?.match(/rgba?\(([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[\s,/]+([\d.]+))?\)/),u=l(i.backgroundColor);(!u||u[4]!==void 0&&+u[4]==0)&&(u=l(i.backgroundImage));let h=u?Zt([+u[1],+u[2],+u[3]])<.5:!1;p.setAttribute("data-canvas",h?"dark":"light")}Mn(),U?.addEventListener("load",Mn);let Ce=p.querySelector(":scope > .decklight-stage");if(!Ce){for(Ce=document.createElement("div"),Ce.className="decklight-stage";p.firstChild;)Ce.appendChild(p.firstChild);p.appendChild(Ce)}if(Ce.style.width=n.width+"px",Ce.style.height=n.height+"px",n.logo&&(n.logo.src||n.logo.onLight||n.logo.onDark)){ze=document.createElement("div"),ze.className="decklight-logo",ze.setAttribute("data-pos",n.logo.position||"bottom-left"),n.logo.height&&ze.style.setProperty("--logo-h",n.logo.height+"px");for(let[i,l]of[["src","on-any"],["onLight","on-light"],["onDark","on-dark"]]){let u=Ya(n.logo[i]);if(!u)continue;let h=document.createElement("span");h.className=l,h.appendChild(u),ze.appendChild(h)}p.appendChild(ze)}function Xa(i){ze&&i.forEach(l=>{if(!l.hasAttribute("data-logo")||l.querySelector(":scope > .decklight-hero-logo"))return;let u=document.createElement("div");u.className="decklight-hero-logo";let h=parseFloat(l.getAttribute("data-logo"));h&&u.style.setProperty("--hero-logo-h",h+"px"),u.innerHTML=ze.innerHTML,l.prepend(u)})}Pi(Ce),yi(Ce),Ma(Ce,wn);let k={root:p,stage:Ce,config:n,_sections:[],_records:[],state:{slide:1,step:0,totalSlides:0},_listeners:new Map,_scale:1,on(i,l){return this._listeners.has(i)||this._listeners.set(i,new Set),this._listeners.get(i).add(l),this},_emit(i,l){(this._listeners.get(i)||[]).forEach(u=>u(l)),p.dispatchEvent(new CustomEvent("decklight:"+i,{detail:l}))},sync(){this._sections=[...Ce.querySelectorAll(":scope > section")],this._sections.forEach((l,u)=>l.setAttribute("data-slide-index",String(u+1))),bi(Ce,n.concepts),Xa(this._sections),ur(this._sections,n),this._records=this._sections.map(l=>Us(l)),this.state.totalSlides=this._sections.length,this.state.slide=Math.min(this.state.slide,this.state.totalSlides||1);let i=this._records[this.state.slide-1];i&&(this.state.step=Math.min(this.state.step,i.groups.length))},_rescanFor(i){let l=i.closest("section"),u=this._sections.indexOf(l);if(u!==-1){if(this._records[u]=Us(l),s){ht(this._records[u],this._records[u].groups.length);return}u===this.state.slide-1?(this.state.step=Math.min(this._requestedStep??this.state.step,this._records[u].groups.length),this._requestedStep=null,ys(()=>ht(this._records[u],this.state.step)),this._updateHash(!1)):ys(()=>ht(this._records[u],0)),this._notify()}},_stepLabels(i){let l=this._records[i];return l?gi(l):[]},next(){let i=this._records[this.state.slide-1];i&&this.state.step<i.groups.length?this.goto(this.state.slide,this.state.step+1,{direction:"fwd"}):this.state.slide<this.state.totalSlides?this.goto(this.state.slide+1,0,{direction:"fwd"}):y(1)},prev(){if(this.state.step>0)this.goto(this.state.slide,this.state.step-1,{direction:"back"});else if(this.state.slide>1){let i=this._records[this.state.slide-2];this.goto(this.state.slide-1,i.groups.length,{direction:"back"})}else y(-1)},goto(i,l=0,u={}){i=Math.max(1,Math.min(i,this.state.totalSlides));let h=this._records[i-1];this._requestedStep=l,l=Math.max(0,Math.min(l,h?h.groups.length:0));let g=i===this.state.slide;if(g&&l===this.state.step&&!u.force)return;let m=u.direction||(i>this.state.slide||g&&l>this.state.step?"fwd":"back");!g||u.force?(this._activateSlide(i,m,u),this.state.slide=i,this.state.step=l,ys(()=>ht(h,l)),this._emit("slide",{slide:i,total:this.state.totalSlides,direction:m}),requestAnimationFrame(()=>pr(this._sections[i-1],i))):(this.state.step=l,ht(h,l),this._emit("build",{slide:i,index:l,total:h.groups.length,direction:m})),this._updateChrome(),this._updateHash(!g),this._notify()},_activateSlide(i,l,u={}){let h=this._sections[this.state.slide-1],g=this._sections[i-1];if(p.classList.toggle("has-hero-logo",g?.hasAttribute("data-logo")??!1),h===g){g.classList.add("active");return}let m=!h||!h.classList.contains("active"),v=h&&g&&!m&&h.hasAttribute("data-auto-animate")&&g.hasAttribute("data-auto-animate")&&Math.abs(this._sections.indexOf(g)-this._sections.indexOf(h))===1;if(this._sections.forEach(qt=>qt.classList.remove("active","entering","leaving","dir-fwd","dir-back","tr-none","tr-fade","tr-slide","tr-scale","tr-flip")),g.classList.add("active"),m||s)return;if(v){h.classList.add("leaving"),h.style.visibility="hidden",g.style.visibility="hidden",g.offsetWidth,g.style.visibility="",vi(h,g,this._scale),h.classList.remove("leaving"),h.style.visibility="";return}let b=g.getAttribute("data-transition")||this.config.transition;if(b==="none")return;let q="dir-"+l;g.classList.add("entering","tr-"+b,q),h.classList.add("leaving","tr-"+b,q,"active-out");let ae=parseFloat(getComputedStyle(g).getPropertyValue("--transition-duration"))*1e3||350;setTimeout(()=>{h.classList.remove("leaving","tr-"+b,q,"active-out"),g.classList.remove("entering","tr-"+b,q)},ae+60)},_updateChrome(){if(ks){let i=this._records[this.state.slide-1],l=i?i.groups.length:0,u=this.state.totalSlides<=1?1:(this.state.slide-1+(l?this.state.step/(l+1):0))/(this.state.totalSlides-1);ks.style.width=(Math.min(u,1)*100).toFixed(2)+"%"}if(tt){let i=this.config.slideNumber?this.config.slideNumber==="n/N"?`${this.state.slide} / ${this.state.totalSlides}`:String(this.state.slide):"";if(tt.textContent=i,_||f){let l=_?S():null,u=l?l[B(l)]?.title||"":f.modules[E]?.title||"",h=document.createElement("span");h.className="mod",h.textContent=u,tt.prepend(h)}}},_updateHash(i){if(!this.config.hash||s)return;let l=`#/${this.state.slide}/${this.state.step}`;"#"+Er(location.hash)!==l&&(_s=!0,i?history.pushState(null,"",l):history.replaceState(null,"",l),setTimeout(()=>{_s=!1}))},_notify(){this.__notifySpeaker&&this.__notifySpeaker()}};function ys(i){p.classList.add("decklight-no-anim"),i(),p.offsetWidth,p.classList.remove("decklight-no-anim")}function Er(i){return(i||"").replace(/^#/,"")}function _r(){let i=Er(location.hash).match(/^\/(\d+)(?:\/(\d+))?/);return i?{slide:parseInt(i[1],10),step:i[2]?parseInt(i[2],10):0}:null}let ks=null,tt=null;if(n.controls&&!s){let i=document.createElement("div");i.className="decklight-controls",i.innerHTML=`
|
|
187
|
+
<button class="decklight-arrow prev" aria-label="Previous">\u2039</button>
|
|
188
|
+
<button class="decklight-arrow next" aria-label="Next">\u203A</button>`,p.appendChild(i),i.querySelector(".prev").addEventListener("click",()=>k.prev()),i.querySelector(".next").addEventListener("click",()=>k.next());let l=document.createElement("div");l.className="decklight-progress",l.innerHTML='<div class="bar"></div>',p.appendChild(l),ks=l.querySelector(".bar")}let an={full:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5"/></svg>',unfull:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4v5H4M15 4v5h5M9 20v-5H4M15 20v-5h5"/></svg>',sound:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 5 6 9H3v6h3l5 4z"/><path d="M15.5 8.5a5 5 0 0 1 0 7"/><path d="M18.5 5.5a9 9 0 0 1 0 13"/></svg>',mute:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 5 6 9H3v6h3l5 4z"/><path d="M17 10l5 4M22 10l-5 4"/></svg>'},nt=null,We=null;function vs(){let i=p||document.documentElement;document.fullscreenElement?document.exitFullscreen?.():i.requestFullscreen?.()?.catch?.(()=>{})}document.addEventListener("fullscreenchange",()=>{nt&&(nt.innerHTML=document.fullscreenElement?an.unfull:an.full)});function xr(){We&&(We.innerHTML=me?an.sound:an.mute,We.setAttribute("aria-label",me?"Mute narration":"Play narration"),We.setAttribute("aria-pressed",String(me)))}(n.slideNumber||f||_)&&!s&&(tt=document.createElement("div"),tt.className="decklight-slide-number",(f||_)&&(tt.title="M \u2014 module menu",tt.style.cursor="pointer",tt.addEventListener("click",()=>vt())),p.appendChild(tt));let Te=null,ut=0;function Sr(){return getComputedStyle(Te).gridTemplateColumns.split(" ").length||1}function on(i){let l=Te.querySelectorAll(".ov-cell");ut=Math.max(0,Math.min(i,l.length-1)),l.forEach((u,h)=>u.classList.toggle("ov-selected",h===ut)),l[ut]?.scrollIntoView({block:"nearest"})}function Qa(){let i=ut+1;It(),k.goto(i,0,{force:!0})}function ws(){if(!Te)return;let i=Te.querySelector(".ov-cell");if(!i)return;Te.style.gridAutoRows=Math.round(i.clientWidth*n.height/n.width)+"px";let l=i.clientWidth/n.width;Te.querySelectorAll(".ov-frame").forEach(u=>{u.style.transform=`scale(${l})`})}function It(){if(Te){window.removeEventListener("resize",ws),Te.remove(),Te=null,p.classList.remove("decklight-overview");return}Te=document.createElement("div"),Te.className="decklight-overview-grid",k._sections.forEach((i,l)=>{let u=document.createElement("div");u.className="ov-cell"+(l===k.state.slide-1?" ov-current":"");let h=document.createElement("div");h.className="ov-frame",h.style.width=n.width+"px",h.style.height=n.height+"px";let g=i.cloneNode(!0);g.classList.add("active","ov-clone"),g.querySelectorAll("aside.notes, aside.rehearse").forEach(v=>v.remove()),g.querySelectorAll("input, button, select, textarea").forEach(v=>{v.removeAttribute("name"),v.disabled=!0}),h.appendChild(g),u.appendChild(h);let m=document.createElement("span");m.className="ov-num",m.textContent=String(l+1),u.appendChild(m),u.addEventListener("click",()=>{It(),k.goto(l+1,0,{force:!0})}),Te.appendChild(u)}),p.classList.add("decklight-overview"),p.appendChild(Te),ws(),on(k.state.slide-1),window.addEventListener("resize",ws)}let Be=null,Dt=0,Ln=null;function On(i){let l=Be.querySelectorAll(".mm-row");Dt=Math.max(0,Math.min(i,l.length-1)),l.forEach((u,h)=>u.classList.toggle("mm-selected",h===Dt)),l[Dt]?.scrollIntoView({block:"nearest"})}function Tr(i){if(Ln.useMarkers){let l=Ln.markers[i];vt(),l&&k.goto(l.slide,0,{force:!0})}else i===E?vt():T(i)}function vt(){if(Be){Be.remove(),Be=null,Ln=null;return}let i=S(),l=i.length>0;if(!l&&!f)return;Ln={useMarkers:l,markers:i};let u=l?i:f.modules,h=l?Math.max(0,B(i)):E;Be=document.createElement("div"),Be.className="decklight-module-menu",Be.innerHTML='<div class="mm-panel"><div class="mm-title">Modules</div><div class="mm-list" role="listbox" aria-label="Modules"></div></div>';let g=Be.querySelector(".mm-list");u.forEach((m,v)=>{let b=document.createElement("div");b.className="mm-row"+(v===h?" mm-current":""),b.setAttribute("role","option"),b.textContent=m.title,b.addEventListener("mouseenter",()=>On(v)),b.addEventListener("click",()=>Tr(v)),g.appendChild(b)}),Be.addEventListener("click",m=>{m.target===Be&&vt()}),p.appendChild(Be),On(h)}let Pt=null;function Ar(){if(Pt){Pt.remove(),Pt=null;return}Pt=document.createElement("div"),Pt.className="decklight-blackout",p.appendChild(Pt)}let pt=null;function Ja(){let i=k._records?.[k.state.slide-1],l=se?.live?`\u26A1 ${ne.voice} \xB7 ${ne.tone}`:se?`\u{1F50A} ${se.label}`:"none";return`slide ${k.state.slide}/${k.state.totalSlides} \xB7 step ${k.state.step}/${i?i.groups.length:0} \xB7 theme ${Ee()??"\u2014"} \xB7 narration ${me?Ve?"paused":"on":"off"} (${l})`+(He!==1?` \xB7 ${He}\xD7`:"")+(c>0?` \xB7 tts ~$${c.toFixed(4)}`:"")}function Nr(i){let l=document.createElement("div");l.className="dbg-row dbg-"+i.kind;for(let[u,h]of[["dbg-t",i.t],["dbg-k",i.kind],["dbg-m",i.msg]]){let g=document.createElement("span");g.className=u,g.textContent=h,l.appendChild(g)}o.querySelector(".dbg-log").appendChild(l)}function Bt(){let i=o?.querySelector(".dbg-state");i&&(i.textContent=Ja())}function Cr(){if(o){o.remove(),o=null;return}o=document.createElement("div"),o.className="decklight-debug",o.innerHTML='<div class="dbg-head">debug log \u2014 D closes</div><div class="dbg-state"></div><div class="dbg-log"></div>',p.appendChild(o),a.forEach(Nr),Bt();let i=o.querySelector(".dbg-log");i.scrollTop=i.scrollHeight}k.on("ready",i=>d("ready",`${i.slides} slides${i.print?" \xB7 print":""}`)),k.on("slide",i=>{d("slide",`\u2192 ${i.slide}/${i.total} (${i.direction})`),Bt()}),k.on("build",i=>{d("build",`slide ${i.slide} step ${i.index}/${i.total} (${i.direction})`),Bt()}),window.addEventListener("error",i=>d("error",String(i.message)));function Es(){if(pt){pt.remove(),pt=null;return}pt=document.createElement("div"),pt.className="decklight-help",pt.innerHTML=`<div class="help-card"><h3>Keyboard</h3><table>
|
|
189
|
+
<tr><td>\u2192 / Space</td><td>next build / slide</td></tr>
|
|
190
|
+
<tr><td>\u2190</td><td>previous</td></tr>
|
|
191
|
+
<tr><td>Home / End</td><td>first / last slide</td></tr>
|
|
192
|
+
<tr><td>O</td><td>overview</td></tr>
|
|
193
|
+
<tr><td>S</td><td>speaker view (again: rehearse mode)</td></tr>
|
|
194
|
+
<tr><td>V</td><td>narration on/off</td></tr>
|
|
195
|
+
<tr><td>N</td><td>narration track</td></tr>
|
|
196
|
+
<tr><td>\u21E7V</td><td>record offline narration (live voice)</td></tr>
|
|
197
|
+
<tr><td>< / ></td><td>voice speed (0.25\xD7 steps)</td></tr>
|
|
198
|
+
<tr><td>B</td><td>blackout</td></tr>
|
|
199
|
+
<tr><td>D</td><td>debug log</td></tr>
|
|
200
|
+
<tr><td>C</td><td>captions (follow the voice)</td></tr>
|
|
201
|
+
<tr><td>P</td><td>pause / resume narration</td></tr>
|
|
202
|
+
<tr><td>F</td><td>fullscreen</td></tr>
|
|
203
|
+
<tr><td>T</td><td>theme picker (type to filter)</td></tr>
|
|
204
|
+
<tr><td>/</td><td>command palette (find, themes, everything)</td></tr>
|
|
205
|
+
<tr><td>G</td><td>slide finder (live preview)</td></tr>
|
|
206
|
+
<tr><td>E</td><td>edit speaker notes (decklight edit server)</td></tr>
|
|
207
|
+
<tr><td>, / .</td><td>cycle theme</td></tr>
|
|
208
|
+
<tr><td>[ / ]</td><td>cycle font</td></tr>
|
|
209
|
+
<tr><td>\u2303T</td><td>generate a theme (repeat to re-roll)</td></tr>
|
|
210
|
+
<tr><td>\u2303\u21E7T</td><td>save the generated theme</td></tr>
|
|
211
|
+
${f||_?"<tr><td>M</td><td>module menu</td></tr>":""}
|
|
212
|
+
<tr><td>?</td><td>this help</td></tr></table></div>`,pt.addEventListener("click",Es),p.appendChild(pt)}function eo(i){if(!/^(input|textarea|select)$/i.test(i.target.tagName)){if(i.ctrlKey&&!i.metaKey&&!i.altKey&&(i.key==="T"||i.key==="t")){i.shiftKey?ot():N&&I[L]===de?A():Le(),i.preventDefault();return}if(!(i.metaKey||i.ctrlKey||i.altKey)){if(N){switch(i.key){case"ArrowDown":qe(L+1,!1);break;case"ArrowUp":qe(L-1,!1);break;case"Enter":yr();break;case"Backspace":fe(ke.slice(0,-1));break;case"Escape":ke?fe(""):M&&_e!=="packs"?V("packs"):yt();break;default:if(i.key.length===1&&/[a-z0-9-]/i.test(i.key)){fe(ke+i.key);break}return}i.preventDefault();return}if($e){switch(i.key){case"ArrowDown":sn(Lt+1);break;case"ArrowUp":sn(Lt-1);break;case"Enter":wr();break;case"Backspace":Se=Se.slice(0,-1),nn();break;case"Escape":Se?(Se="",nn()):Nn();break;default:if(i.key.length===1){Se+=i.key,nn();break}return}i.preventDefault();return}if(Ie){switch(i.key){case"ArrowDown":Cn(Ot+1);break;case"ArrowUp":Cn(Ot-1);break;case"Enter":Rn(Ot),rn();break;case"Escape":rn();break;default:return}i.preventDefault();return}if(je){i.key==="Escape"&&(dn(),i.preventDefault());return}if(Ye){i.key==="Escape"&&(un(),i.preventDefault());return}if(Fe){if(i.key==="Escape")Ds();else if(i.key==="Enter")Is==="confirm"?ai():Is!=="progress"&&Ds();else return;i.preventDefault();return}if(Ae){if(pn==="custom"){i.key==="Enter"?(ni(),i.preventDefault()):i.key==="Escape"&&(Un(),i.preventDefault());return}switch(i.key){case"ArrowDown":hn(zt+1);break;case"ArrowUp":hn(zt-1);break;case"Enter":Yr();break;case"Escape":Un();break;case"n":case"N":Ft();break;default:return}i.preventDefault();return}if(ge){switch(i.key){case"ArrowDown":Mt(kt+1,!1);break;case"ArrowUp":Mt(kt-1,!1);break;case"Enter":vr();break;case"Backspace":en(dt.slice(0,-1));break;case"Escape":dt?en(""):tn();break;default:if(i.key.length===1){en(dt+i.key);break}return}i.preventDefault();return}if(Be){switch(i.key){case"ArrowDown":On(Dt+1);break;case"ArrowUp":On(Dt-1);break;case"Enter":Tr(Dt);break;case"Escape":case"m":case"M":vt();break;default:return}i.preventDefault();return}if(Te){switch(i.key){case"ArrowRight":on(ut+1);break;case"ArrowLeft":on(ut-1);break;case"ArrowDown":on(ut+Sr());break;case"ArrowUp":on(ut-Sr());break;case"Enter":case" ":Qa();break;case"o":case"O":case"Escape":It();break;default:return}i.preventDefault();return}switch(i.key){case"ArrowRight":case" ":case"PageDown":k.next();break;case"ArrowLeft":case"PageUp":k.prev();break;case"Home":k.goto(1,0);break;case"End":k.goto(k.state.totalSlides,0);break;case"o":case"O":It();break;case"b":case"B":Ar();break;case"d":case"D":Cr();break;case"c":case"C":Gr();break;case"p":case"P":zr();break;case"g":case"G":gs();break;case"e":case"E":un();break;case"f":case"F":vs();break;case"v":case"V":i.shiftKey?oi():cn();break;case"n":case"N":Fn();break;case"s":case"S":{let l=k.__speakerWin;l&&!l.closed?l.__decklightSpeakerToggle?.():k.__speakerWin=or(k);break}case"t":case"T":Oe();break;case"/":Za();break;case".":lt(1);break;case",":lt(-1);break;case">":Dn(.25);break;case"<":Dn(-.25);break;case"]":bs(1);break;case"[":bs(-1);break;case"m":case"M":if(!f&&!_)return;vt();break;case"?":Es();break;case"Escape":if(Xt())break;Te&&It();break;default:return}i.preventDefault()}}}s||document.addEventListener("keydown",eo);let $n=null;p.addEventListener("touchstart",i=>{$n=i.touches[0].clientX},{passive:!0}),p.addEventListener("touchend",i=>{if($n==null)return;let l=i.changedTouches[0].clientX-$n;Math.abs(l)>40&&(l<0?k.next():k.prev()),$n=null},{passive:!0});function Rr(){let i=p.getBoundingClientRect(),l=Math.min(i.width/n.width,i.height/n.height)||1;k._scale=l,Ce.style.transform=`translate(-50%, -50%) scale(${l})`}s||(new ResizeObserver(Rr).observe(p),Rr());let _s=!1;n.hash&&!s&&window.addEventListener("hashchange",()=>{if(_s)return;let i=_r();i&&k.goto(i.slide,i.step,{force:!0})}),k.sync(),s&&ze&&(k._sections.forEach(i=>{i.hasAttribute("data-logo")||i.appendChild(ze.cloneNode(!0))}),ze.remove()),document.fonts?.ready?.then(()=>{(jt===k||!jt)&&ur(k._sections,n)}),k.theme=i=>P(i),k.themePicker={open:Oe,close:yt},k.generateTheme=Le,k.cycleFont=bs,k.toggleNarration=cn;let Mr="decklight-narration:"+location.pathname,Lr=n.narration?.liveUrl??"http://127.0.0.1:8787/tts",Or=[["Zephyr","bright"],["Puck","upbeat"],["Charon","informative"],["Kore","firm"],["Fenrir","excitable"],["Leda","youthful"],["Orus","firm"],["Aoede","breezy"],["Callirrhoe","easy-going"],["Autonoe","bright"],["Enceladus","breathy"],["Iapetus","clear"],["Umbriel","easy-going"],["Algieba","smooth"],["Despina","smooth"],["Erinome","clear"],["Algenib","gravelly"],["Rasalgethi","informative"],["Laomedeia","upbeat"],["Achernar","soft"],["Alnilam","firm"],["Schedar","even"],["Gacrux","mature"],["Pulcherrima","forward"],["Achird","friendly"],["Zubenelgenubi","casual"],["Vindemiatrix","gentle"],["Sadachbia","lively"],["Sadaltager","knowledgeable"],["Sulafat","warm"]],In=[["Warm senior engineer","Read in a warm, welcoming tone, like a friendly battle-hardened senior engineer who is still curious about new technology."],["Professional","Read in a clear, professional tone \u2014 measured, confident, and articulate."],["Too serious","Read in an extremely grave, deadly serious tone, as if announcing news of the utmost importance."],["Joyful","Read in a joyful, light-hearted tone, smiling through every sentence."],["Super excited","Read in a super-excited, high-energy tone, barely containing your enthusiasm."],["Sad","Read in a somber, melancholic tone, on the verge of a sigh."]],wt=(()=>{let i=n.narration?.files;return i?Array.isArray(i)?i:[{label:"Narration",dir:i}]:[]})(),$r={live:!0},ne={voice:"Alnilam",tone:In[0][0],style:In[0][1]},se=wt[0]??null;try{let i=JSON.parse(localStorage.getItem(Mr));if(i?.live?.voice)ne=i.live,se=$r;else{let l=wt.find(u=>u.dir===i?.dir);l&&(se=l)}}catch{}let me=!1,ve=null,xs=!1,Ir="decklight-narr-rate:"+location.pathname,He=1;try{let i=parseFloat(localStorage.getItem(Ir)??"");i>=.25&&i<=2&&(He=i)}catch{}function Dn(i){He=Math.round(Math.min(2,Math.max(.25,He+i))*100)/100;try{localStorage.setItem(Ir,String(He))}catch{}ve&&(ve.playbackRate=He),x(`voice speed ${He}\xD7`),d("narr",`rate ${He}\xD7`),Bt()}let Ut=new Map;function Dr(i){return(k._sections?.[i-1]?.querySelector("aside.notes")?.textContent??"").replace(/⟨CLICK⟩/g," ").replace(/\s+/g," ").trim()}function Et(i){return(k._sections?.[i-1]?.querySelector("aside.notes")?.textContent??"").split("\u27E8CLICK\u27E9").map(u=>u.replace(/\s+/g," ").trim())}function to(i,l,u){if(!i)return Promise.resolve(null);if(!Ut.has(l)){let h=(async()=>{let g=Date.now();try{let m=await fetch(Lr,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:i,voice:ne.voice,style:ne.style})});if(!m.ok)throw new Error(String(m.status));let v=await m.blob(),b=parseFloat(m.headers?.get?.("x-tts-cost")??"")||0;return b&&(c+=b),d("tts",`${u} \xB7 ${ne.voice} \xB7 ${i.length} chars \u2192 ${((Date.now()-g)/1e3).toFixed(1)}s`+(b?` \xB7 ~$${b.toFixed(4)}`:"")),{url:URL.createObjectURL(v),blob:v}}catch(m){throw d("tts",`${u} \xB7 ${ne.voice} FAILED after ${((Date.now()-g)/1e3).toFixed(1)}s (${String(m.message||m)})`),m}})();h.catch(()=>{Ut.get(l)===h&&Ut.delete(l)}),Ut.set(l,h)}return Ut.get(l)}function Pn(i){return((i??"").match(/[^.!?…]+[.!?…]+[”’"')\]]*|[^.!?…]+$/g)??[]).map(l=>l.trim()).filter(Boolean)}let Pr=(i,l,u)=>`${i}|s${l}|n${u}|${ne.voice}|${ne.style}`;function Ss(i,l,u){let h=Pn(Et(i)[l])[u]??"";return to(h,Pr(i,l,u),`slide ${i} seg ${l} #${u+1}`)}let Br=i=>k._sections[i-1]?.dataset.narration==="hold",no=10,so=3,Ts=0;function ro(i){let l=[],u=k.state.slide,h=k.state.step;for(;l.length<i&&u<=k.state.totalSlides;){let g=Et(u),m=k._records[u-1]?k._records[u-1].groups.length:0;for(;h<=m&&l.length<i;h++){let v=Pn(g[h]).length;for(let b=0;b<v&&l.length<i;b++)l.push([u,h,b])}u+=1,h=0}return l}async function io(){let i=++Ts,l=async()=>{for(;i===Ts&&me&&se?.live;){let u=ro(no).find(([h,g,m])=>!Ut.has(Pr(h,g,m)));if(!u)return;try{await Ss(u[0],u[1],u[2])}catch{return}await new Promise(h=>setTimeout(h,30))}};await Promise.all(Array.from({length:so},l))}let ln=0,Ve=!1,As=!1,Ur=0;function zr(){if(!me){x("narration is off \u2014 V starts it");return}Ve=!Ve,Ve?ve?.pause():ve?.src&&ve.paused&&!ve.ended&&ve.currentTime>0?ve.play().catch(()=>{}):As||Ns(),x(Ve?"\u23F8 narration paused \u2014 P resumes":"\u25B6 narration resumed"),d("narr",Ve?"paused":"resumed"),Bt()}function Hr(i,l){if(!me||Ve||!se?.live||k.state.slide!==i||k.state.step!==l)return;let u=k._records[i-1];l<(u?u.groups.length:0)?k.next():!Br(i)&&i<k.state.totalSlides&&k.goto(i+1,0)}async function Ns(){let i=k.state.slide,l=k.state.step,u=++ln;if(io(),!Dr(i)){if(Br(i)){d("narr",`hold on slide ${i} \u2014 manual advance`);return}setTimeout(()=>{u!==ln||!me||!se?.live||k.state.slide===i&&i<k.state.totalSlides&&k.goto(i+1,0)},400);return}let h=Et(i);if(!h[l]){setTimeout(()=>{u===ln&&Hr(i,l)},600);return}let g=Pn(h[l]),m=()=>u!==ln||!me||k.state.slide!==i||k.state.step!==l;Ur=u,As=!0;try{for(let v=0;v<g.length;v++){for(;Ve;){if(m())return;await new Promise(ae=>setTimeout(ae,150))}if(m())return;let b=await Ss(i,l,v);if(m())return;if(!b)continue;Cs(g[v]),ve??=new Audio,ve.src=b.url,ve.playbackRate=He;let q=!1;if(await new Promise(ae=>{ve.onended=ae,ve.play().catch(()=>{q=!0,ae()})}),q)return}m()||Hr(i,l)}catch{xs||(x("live voice bridge unreachable \u2014 run: decklight tts"),xs=!0),d("narr",`live synth failed (slide ${i} step ${l})`)}finally{Ur===u&&(As=!1)}}function Bn(){if(se){if(se.live)return Ns();ve??=new Audio,ve.src=`${se.dir}/slide-${String(k.state.slide).padStart(2,"0")}.${se.ext??"m4a"}`,ve.playbackRate=He,ve.play().catch(()=>{})}}function cn(){if(!se){Fn(wt.length?"tracks":"voices");return}if(me=!me,me){let i=se.live?`\u26A1 ${ne.voice} \xB7 ${ne.tone}`:se.label;x(`\u{1F50A} ${i} \u2014 V stops \xB7 N picks`),d("narr",`on \u2014 ${i}`),Bn()}else ln++,Ts++,Ve=!1,ve?.pause(),x("narration off"),d("narr","off");xr()}k.on("slide",()=>{me&&Bn()}),k.on("build",()=>{me&&se?.live&&Ns()});let Fr="decklight-captions:"+location.pathname,st=!1;try{st=localStorage.getItem(Fr)==="1"}catch{}let Ze=null;function Cs(i){Ze&&(Ze.textContent=i,Ze.classList.toggle("show",!!i))}function Rs(){if(Ze){if(me&&se?.live){Cs("");return}Cs(Et(k.state.slide)[k.state.step]??"")}}function qr(){Ze=document.createElement("div"),Ze.className="decklight-captions",Ze.setAttribute("aria-live","polite"),p.appendChild(Ze),Rs()}function Gr(){st=!st;try{localStorage.setItem(Fr,st?"1":"0")}catch{}st?qr():(Ze?.remove(),Ze=null),x(`captions ${st?"on":"off"}`),d("narr",`captions ${st?"on":"off"}`)}k.on("slide",Rs),k.on("build",Rs),st&&!s&&qr();function Kr(){return(k._sections||[]).map((i,l)=>({n:l+1,title:i.querySelector("h1, h2, h3")?.textContent.trim()||`Slide ${l+1}`,segs:Et(l+1).filter(Boolean)}))}function Ms(i){let l=(document.title||"Deck").trim(),u=i?[`# ${l} \u2014 transcript`,""]:[`${l} \u2014 transcript`,""];for(let{n:h,title:g,segs:m}of Kr())if(m.length){u.push(i?`## ${h}. ${g}`:`${h}. ${g}`,"");for(let v of m)u.push(v,"")}return u.join(`
|
|
213
|
+
`)}function ao(i){let l=i==="md",u=URL.createObjectURL(new Blob([Ms(l)],{type:l?"text/markdown":"text/plain"})),h=(location.pathname.split("/").pop()||"deck").replace(/\.html?$/i,"");ii(u,`${h}-transcript.${l?"md":"txt"}`),setTimeout(()=>URL.revokeObjectURL(u),5e3),d("narr",`transcript exported (.${l?"md":"txt"})`)}let je=null;function dn(){if(je){je.remove(),je=null;return}je=document.createElement("div"),je.className="decklight-narr decklight-transcript";let i=document.createElement("div");i.className="narr-card";let l=document.createElement("div");l.className="narr-head",l.textContent="transcript \u2014 the deck\u2019s spoken notes \xB7 Esc closes";let u=document.createElement("div");u.className="tr-actions";for(let[h,g]of[["\u2B07 export .txt","txt"],["\u2B07 export .md","md"]]){let m=document.createElement("button");m.type="button",m.className="narr-prev-btn",m.textContent=h,m.addEventListener("click",()=>ao(g)),u.appendChild(m)}i.append(l,u);for(let{n:h,title:g,segs:m}of Kr()){if(!m.length)continue;let v=document.createElement("div");v.className="tr-slide";let b=document.createElement("div");b.className="tr-title",b.textContent=`${h} \xB7 ${g}`,b.title="jump to this slide",b.addEventListener("click",()=>{dn(),k.goto(h,0,{force:!0})}),v.appendChild(b);for(let q of m){let ae=document.createElement("p");ae.className="tr-seg",ae.textContent=q,v.appendChild(ae)}i.appendChild(v)}je.appendChild(i),je.addEventListener("click",h=>{h.target===je&&dn()}),p.appendChild(je)}k.transcript={open:dn,text:()=>Ms(!1),markdown:()=>Ms(!0)};let Wr=!1,Vr="";if(!s&&!e.has("embedded")){let i=n.edit?.url?[n.edit.url]:/^https?:$/.test(location.protocol)?[""]:["http://127.0.0.1:8788"];(async()=>{for(let l of i)try{let u=await fetch(l+"/edit/ping");if(!u.ok)continue;let h=await u.json();if(!h?.ok)continue;let g=decodeURIComponent(location.pathname.split("/").pop()||"");if(g&&h.name&&g!==h.name){d("edit",`server edits ${h.name}, this deck is ${g} \u2014 not wiring up`);continue}Vr=l,Wr=!0;let m=new EventSource(l+"/edit/events");m.onmessage=()=>location.reload(),d("edit",`live reload connected${l?` (${l})`:""}`);return}catch{}})()}let Ye=null;function un(){if(Ye){Ye.remove(),Ye=null;return}let i=k.state.slide;if(!Wr){x("edit mode needs the server \u2014 run: decklight edit <deck.html>",2200);return}if(k._sections[i-1]?.hasAttribute("data-was-markdown")){x("markdown-authored slide \u2014 its notes live in the template; edit the file",2200);return}Ye=document.createElement("div"),Ye.className="decklight-narr decklight-editor";let l=document.createElement("div");l.className="narr-card";let u=document.createElement("div");u.className="narr-head",u.textContent=`edit notes \u2014 slide ${i} \xB7 \u2318\u23CE saves \xB7 Esc closes`;let h=document.createElement("textarea");h.className="narr-input edit-notes",h.value=Et(i).filter((b,q,ae)=>b||q<ae.length).join(`
|
|
214
|
+
|
|
215
|
+
\u27E8CLICK\u27E9
|
|
216
|
+
|
|
217
|
+
`),h.spellcheck=!1;let g=async()=>{try{let b=await fetch(Vr+"/edit/notes",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({slide:i,text:h.value})});if(!b.ok)throw new Error(await b.text());d("edit",`notes saved \u2014 slide ${i}`),x("notes saved \u2014 reloading")}catch(b){x(`save failed: ${String(b.message||b).slice(0,60)}`)}};h.addEventListener("keydown",b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)?(g(),b.preventDefault()):b.key==="Escape"&&(un(),b.preventDefault()),b.stopPropagation()});let m=document.createElement("div");m.className="tr-actions";let v=document.createElement("button");v.type="button",v.className="narr-prev-btn",v.textContent="\u{1F4BE} save to file",v.addEventListener("click",g),m.appendChild(v),l.append(u,h,m),Ye.appendChild(l),Ye.addEventListener("click",b=>{b.target===Ye&&un()}),p.appendChild(Ye),setTimeout(()=>h.focus(),0)}if(e.has("voiceover")&&se&&!s){let i=()=>{window.removeEventListener("pointerdown",i),window.removeEventListener("keydown",i),me||cn()};window.addEventListener("pointerdown",i,{once:!0}),window.addEventListener("keydown",i,{once:!0})}if(!s){let i=document.createElement("div");i.className="decklight-touch-controls",nt=document.createElement("button"),nt.type="button",nt.className="decklight-touch-btn",nt.setAttribute("aria-label","Fullscreen"),nt.innerHTML=an.full,nt.addEventListener("click",vs),i.appendChild(nt),wt.length&&(We=document.createElement("button"),We.type="button",We.className="decklight-touch-btn",We.addEventListener("pointerdown",l=>l.stopPropagation()),We.addEventListener("click",()=>cn()),i.appendChild(We),xr()),p.appendChild(i)}let Ae=null,zt=0,pn="tracks",De=[],Ht=null;function Zr(){try{localStorage.setItem(Mr,JSON.stringify(se?.live?{live:ne}:{dir:se?.dir}))}catch{}}function jr(i,l){ne={voice:Ht??ne.voice,tone:i,style:l},se=$r,xs=!1,Zr(),Ft(),me||(me=!0),x(`\u26A1 live voice: ${ne.voice} \xB7 ${ne.tone} \u2014 V stops`),d("narr",`live config \u2014 ${ne.voice} \xB7 ${ne.tone}`),Bn()}function hn(i){De.length&&(zt=(i+De.length)%De.length,Ae.querySelectorAll(".narr-row").forEach((l,u)=>l.classList.toggle("narr-sel",u===zt)))}function Yr(){De[zt]?.commit()}function Un(){pn==="custom"?_t("tones"):pn==="tones"?_t("voices"):pn==="voices"&&wt.length?_t("tracks"):Ft()}let fn="Hey, this is Decklight",zn=fn,Ls=null,Xr=new Map,Hn=new Map,Os=null,$s=new Set;function oo(i){if(i===fn)return Xr;if(i!==Os){for(let l of Hn.values())l.then(u=>URL.revokeObjectURL(u)).catch(()=>{});Hn=new Map,Os=i}return Hn}let Qr=(i,l)=>`${i}|${l||""}`;function Jr(i,l,u,h=""){let g=Qr(l,h);if(!i.has(g)){let m=(async()=>{let v=Date.now(),b=await fetch(Lr,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:u,voice:l,style:h})});if(!b.ok)throw new Error(String(b.status));let q=await b.blob(),ae=parseFloat(b.headers?.get?.("x-tts-cost")??"")||0;return ae&&(c+=ae),d("tts",`preview ${l}${h?" (styled)":""} \xB7 ${((Date.now()-v)/1e3).toFixed(1)}s`+(ae?` \xB7 ~$${ae.toFixed(4)}`:"")),URL.createObjectURL(q)})();m.catch(()=>{i.get(g)===m&&i.delete(g)}),i.set(g,m)}return i.get(g)}async function ei(i,l,u){let h=`${u}|${i}`;if($s.has(h))return;$s.add(h);let g=i===fn,m=g?Xr:Hn;try{d("narr",`preview prefetch ${u} (${g?"default":"custom"} sentence)`);for(let{voice:v,style:b}of l){if(!g&&Os!==i)return;m.has(Qr(v,b))||await Jr(m,v,i,b).catch(()=>{})}d("narr",`preview prefetch ${u} complete`)}finally{$s.delete(h)}}function ti({voice:i,style:l="",prefetch:u},h){let g=zn.trim();if(!g)return;let m=oo(g);h&&(h.textContent="\u2026"),Jr(m,i,g,l).then(v=>{h?.isConnected&&(h.textContent="\u25B6"),Ls??=new Audio,Ls.src=v,Ls.play().catch(()=>{}),d("narr",`preview ${i}${l?" \xB7 styled":""}`),u==="voices"?ei(g,Or.map(([b])=>({voice:b,style:""})),"voices"):u==="tones"&&ei(g,In.map(([,b])=>({voice:i,style:b})),`tones:${i}`)}).catch(()=>{h?.isConnected&&(h.textContent="\u25B6"),x("live voice bridge unreachable \u2014 run: decklight tts"),d("narr",`preview ${i} failed`)})}function _t(i){pn=i;let l=Ae.querySelector(".narr-card");l.innerHTML="";let u=document.createElement("div");if(u.className="narr-head",l.appendChild(u),De=[],i==="tracks")u.textContent="narration",wt.forEach(g=>De.push({text:`\u{1F50A} ${g.label} (${g.dir}/)`,cur:g===se,commit:()=>{se=g,Zr(),Ft(),x(`\u{1F50A} track: ${g.label}`),me&&Bn()}})),De.push({text:"\u26A1 Live voice \u2014 synthesize on the fly\u2026",cur:se?.live,commit:()=>_t("voices")});else if(i==="voices"){u.textContent="live voice \u2014 pick a voice \xB7 \u25B6 previews";let g=document.createElement("div");g.className="narr-preview-row";let m=document.createElement("input");m.className="narr-input narr-preview-text",m.value=zn,m.placeholder="Preview sentence",m.setAttribute("aria-label","Preview sentence"),m.addEventListener("input",()=>{zn=m.value}),m.addEventListener("keydown",b=>{b.key==="Escape"&&(Un(),b.preventDefault()),b.stopPropagation()});let v=document.createElement("button");v.type="button",v.className="narr-prev-btn narr-reset-btn",v.textContent="\u21BA",v.title="restore the default sentence",v.setAttribute("aria-label","restore the default preview sentence"),v.addEventListener("click",b=>{b.stopPropagation(),zn=fn,m.value=fn}),g.append(m,v),l.appendChild(g),Or.forEach(([b,q])=>De.push({text:`${b} <span class="narr-flavor">${q}</span>`,html:!0,preview:{voice:b,style:"",prefetch:"voices"},cur:se?.live&&ne.voice===b,commit:()=>{Ht=b,_t("tones")}}))}else if(i==="tones")u.textContent=`live voice \xB7 ${Ht??ne.voice} \u2014 pick a tone \xB7 \u25B6 previews`,In.forEach(([g,m])=>De.push({text:g,preview:{voice:Ht??ne.voice,style:m,prefetch:"tones"},cur:se?.live&&ne.tone===g,commit:()=>jr(g,m)})),De.push({text:"Custom\u2026",cur:se?.live&&ne.tone==="Custom",commit:()=>_t("custom")});else{u.textContent=`live voice \xB7 ${Ht??ne.voice} \u2014 type the delivery instruction \xB7 \u25B6 previews`;let g=document.createElement("div");g.className="narr-preview-row";let m=document.createElement("input");m.className="narr-input",m.value=ne.style,m.placeholder="Read in a \u2026",m.addEventListener("keydown",b=>{b.key==="Enter"?(ni(),b.preventDefault()):b.key==="Escape"&&(Un(),b.preventDefault()),b.stopPropagation()});let v=document.createElement("button");v.type="button",v.className="narr-prev-btn narr-reset-btn",v.textContent="\u25B6",v.title="preview this delivery instruction",v.setAttribute("aria-label","preview this delivery instruction"),v.addEventListener("click",b=>{b.stopPropagation();let q=m.value.trim();q&&ti({voice:Ht??ne.voice,style:q},v)}),g.append(m,v),l.appendChild(g),setTimeout(()=>{m.focus(),m.select()},0),De=[],zt=0;return}De.forEach((g,m)=>{let v=document.createElement("div");v.className="narr-row"+(g.cur?" narr-cur":"");let b=document.createElement("span");if(b.className="narr-row-label",g.html?b.innerHTML=g.text:b.textContent=g.text,v.appendChild(b),g.preview){let q=document.createElement("button");q.type="button",q.className="narr-prev-btn",q.textContent="\u25B6",q.title=`preview ${g.preview.voice}`,q.setAttribute("aria-label",`preview ${g.preview.voice}`),q.addEventListener("click",ae=>{ae.stopPropagation(),ti(g.preview,q)}),v.appendChild(q)}v.addEventListener("mouseenter",()=>hn(m)),v.addEventListener("click",()=>{hn(m),Yr()}),l.appendChild(v)});let h=De.findIndex(g=>g.cur);hn(Math.max(0,h)),Ae.querySelector(".narr-sel")?.scrollIntoView({block:"nearest"})}function ni(){let i=Ae?.querySelector(".narr-input")?.value.trim();i&&jr("Custom",i)}function Fn(i){if(Ae&&i===void 0)return Ft();Ae||(Ae=document.createElement("div"),Ae.className="decklight-narr",Ae.innerHTML='<div class="narr-card" role="listbox" aria-label="Narration"></div>',Ae.addEventListener("click",l=>{l.target===Ae&&Ft()}),p.appendChild(Ae)),_t(i??(wt.length?"tracks":"voices"))}function Ft(){Ae?.remove(),Ae=null}let Fe=null,Is="confirm",xt=0;function si(){let i=[];for(let l=1;l<=k.state.totalSlides;l++)Dr(l)&&i.push(l);return i}function ri(i){let l=Math.round(i/1e3);return l<60?`${l}s`:`${Math.floor(l/60)}m${String(l%60).padStart(2,"0")}s`}function ii(i,l){let u=document.createElement("a");u.href=i,u.download=l,document.body.appendChild(u),u.click(),u.remove()}function qn(i,l={}){Is=i;let u=Fe.querySelector(".narr-card");if(i==="confirm"){let h=l.total;u.innerHTML=`<div class="narr-head">record offline narration</div>
|
|
218
|
+
<div class="rec-line">\u26A1 ${ne.voice} \xB7 ${ne.tone}</div>
|
|
219
|
+
<div class="rec-line">${h} slide${h===1?"":"s"} stitched from the sentence cache \u2014 only unheard sentences synthesize</div>
|
|
220
|
+
<div class="narr-row narr-sel">Start recording</div>
|
|
221
|
+
<div class="rec-hint">Enter to start \xB7 Esc to cancel</div>`,u.querySelector(".narr-row").addEventListener("click",ai)}else if(i==="progress"){let{done:h,total:g,elapsedMs:m}=l,v=g?Math.round(h/g*100):0,b=h?ri(m/h*(g-h)):"\u2026";u.innerHTML=`<div class="narr-head">recording\u2026</div>
|
|
222
|
+
<div class="rec-bar"><div class="rec-bar-fill" style="width:${v}%"></div></div>
|
|
223
|
+
<div class="rec-line">${h} / ${g} slides \xB7 ${ri(m)} elapsed \xB7 ~${b} left</div>
|
|
224
|
+
<div class="rec-hint">Esc to cancel</div>`}else{let{saved:h,total:g,cancelled:m}=l;u.innerHTML=`<div class="narr-head">${m?"recording cancelled":"recording done"}</div>
|
|
225
|
+
<div class="rec-line">${h} / ${g} slide${g===1?"":"s"} saved as slide-NN.wav to your downloads</div>
|
|
226
|
+
<div class="rec-line">Point <code>narration.files</code> at that folder with <code>ext: 'wav'</code> to play them back without the bridge.</div>
|
|
227
|
+
<div class="rec-hint">Enter or Esc to close</div>`}}let lo=.15,co=.35;function uo(i,l){let u=i.reduce((m,v)=>m+v.length,0),h=new DataView(new ArrayBuffer(44)),g=(m,v)=>{for(let b=0;b<v.length;b++)h.setUint8(m+b,v.charCodeAt(b))};return g(0,"RIFF"),h.setUint32(4,36+u,!0),g(8,"WAVE"),g(12,"fmt "),h.setUint32(16,16,!0),h.setUint16(20,1,!0),h.setUint16(22,1,!0),h.setUint32(24,l,!0),h.setUint32(28,l*2,!0),h.setUint16(32,2,!0),h.setUint16(34,16,!0),g(36,"data"),h.setUint32(40,u,!0),new Blob([h.buffer,...i],{type:"audio/wav"})}let po=(i,l)=>new Uint8Array(2*Math.round(i*l));async function ho(i,l){let u=k._records[i-1],h=u?u.groups.length:0,g=Et(i),m=[],v=24e3;for(let b=0;b<=h;b++){let q=Pn(g[b]);for(let ae=0;ae<q.length;ae++){let qt=await Ss(i,b,ae);if(l!==xt)return null;if(!qt)continue;let li=await qt.blob.arrayBuffer();m.length===0?v=new DataView(li).getUint32(24,!0)||24e3:m.push(po(v,ae===0?co:lo)),m.push(new Uint8Array(li.slice(44)))}}return m.length?uo(m,v):null}async function ai(){let i=si(),l=++xt,u=Date.now(),h=0,g=0;qn("progress",{done:h,total:i.length,elapsedMs:0});for(let m of i){if(l!==xt)return;try{let v=await ho(m,l);if(l!==xt)return;if(v){let b=URL.createObjectURL(v);ii(b,`slide-${String(m).padStart(2,"0")}.wav`),setTimeout(()=>URL.revokeObjectURL(b),5e3),g++}}catch{x(`slide ${m}: recording failed`)}h++,l===xt&&qn("progress",{done:h,total:i.length,elapsedMs:Date.now()-u})}l===xt&&qn("done",{saved:g,total:i.length})}function oi(){if(!se?.live){x("live voice only \u2014 pick a voice with N first");return}Fe||(Fe=document.createElement("div"),Fe.className="decklight-narr decklight-record",Fe.innerHTML='<div class="narr-card" role="dialog" aria-label="Record offline narration"></div>',Fe.addEventListener("click",i=>{i.target===Fe&&Ds()}),p.appendChild(Fe),qn("confirm",{total:si().length}))}function Ds(){xt++,Fe?.remove(),Fe=null}if(k.saveGeneratedTheme=i=>ot(i),s)return p.classList.add("decklight-print"),k._sections.forEach((i,l)=>{i.classList.add("active"),ht(k._records[l],k._records[l].groups.length)}),requestAnimationFrame(()=>k._sections.forEach((i,l)=>pr(i,l+1))),p.__decklight=k,jt=k,k._emit("ready",{slides:k.state.totalSlides,print:!0}),k;let Ps=n.hash&&_r()||{slide:1,step:0};return k._sections.forEach((i,l)=>{l!==Ps.slide-1&&ht(k._records[l],0)}),k.goto(Ps.slide,Ps.step,{force:!0}),p.__decklight=k,jt=k,k._emit("ready",{slides:k.state.totalSlides}),k}O();$();O();$();var hr="\x1B",ls=Object.freeze({fg:null,bg:null,bold:!1,dim:!1,italic:!1,underline:!1,inverse:!1});function qc(t){if(t<16)return null;if(t>=16&&t<=231){let n=t-16,s=[0,95,135,175,215,255];return[s[Math.floor(n/36)%6],s[Math.floor(n/6)%6],s[n%6]]}let e=8+(t-232)*10;return[e,e,e]}function at(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var Yt=class{constructor(){this.rows=[[]],this.row=0,this.col=0,this.style={...ls},this._pending=""}write(e){let n=this._pending+e;this._pending="";let s=0;for(;s<n.length;){let r=n[s];if(r===hr){let a=this._consumeEscape(n,s);if(a===0){this._pending=n.slice(s);return}s+=a;continue}if(s+=1,r===`
|
|
228
|
+
`){this._lineFeed();continue}if(r==="\r"){this.col=0;continue}if(r==="\b"){this.col=Math.max(0,this.col-1);continue}if(r===" "){this.col=(Math.floor(this.col/8)+1)*8;continue}r!=="\x07"&&(r<" "&&r!==" "||this._putChar(r))}}_lineFeed(){this.row+=1,this.rows[this.row]||(this.rows[this.row]=[])}_putChar(e){let n=this.rows[this.row];for(;n.length<this.col;)n.push({ch:" ",style:ls});n[this.col]={ch:e,style:{...this.style}},this.col+=1}_consumeEscape(e,n){if(n+1>=e.length)return 0;let s=e[n+1];if(s==="["){let r=n+2;for(;r<e.length;){let a=e.charCodeAt(r);if(a>=64&&a<=126)return this._handleCsi(e.slice(n+2,r),e[r]),r-n+1;r+=1}return 0}if(s==="]"){let r=n+2;for(;r<e.length;){if(e[r]==="\x07")return r-n+1;if(e[r]===hr&&e[r+1]==="\\")return r-n+2;if(e[r]===hr&&r+1>=e.length)return 0;r+=1}return 0}return s==="("||s===")"?n+2<e.length?3:0:2}_handleCsi(e,n){if(!e.startsWith("?"))switch(n){case"m":this._sgr(e);return;case"K":this._eraseLine(e);return;case"C":this.col+=Math.max(1,parseInt(e||"1",10)||1);return;case"D":this.col=Math.max(0,this.col-Math.max(1,parseInt(e||"1",10)||1));return;default:return}}_eraseLine(e){let n=parseInt(e||"0",10)||0,s=this.rows[this.row];if(n===0){s.length=Math.min(s.length,this.col);return}if(n===1){for(let r=0;r<=Math.min(this.col,s.length-1);r++)s[r]={ch:" ",style:ls};return}if(n===2){s.length=0;return}}_sgr(e){let n=e===""?[0]:e.split(";").map(r=>parseInt(r,10)||0),s=0;for(;s<n.length;){let r=n[s];if(r===0)this.style={...ls};else if(r===1)this.style.bold=!0;else if(r===2)this.style.dim=!0;else if(r===3)this.style.italic=!0;else if(r===4)this.style.underline=!0;else if(r===7)this.style.inverse=!0;else if(r===22)this.style.bold=!1,this.style.dim=!1;else if(r===23)this.style.italic=!1;else if(r===24)this.style.underline=!1;else if(r===27)this.style.inverse=!1;else if(r>=30&&r<=37)this.style.fg={type:"ansi",idx:r-30};else if(r>=90&&r<=97)this.style.fg={type:"ansi",idx:r-90+8};else if(r===39)this.style.fg=null;else if(r>=40&&r<=47)this.style.bg={type:"ansi",idx:r-40};else if(r>=100&&r<=107)this.style.bg={type:"ansi",idx:r-100+8};else if(r===49)this.style.bg=null;else if(r===38||r===48){let a=r===38?"fg":"bg";n[s+1]===5&&n.length>s+2?(this.style[a]={type:"256",idx:n[s+2]},s+=2):n[s+1]===2&&n.length>s+4&&(this.style[a]={type:"rgb",r:n[s+2],g:n[s+3],b:n[s+4]},s+=4)}s+=1}}get lines(){return this.rows.map(e=>{let n=[];for(let s of e){let r=n[n.length-1];r&&Gc(r.style,s.style)?r.text+=s.ch:n.push({text:s.ch,style:s.style})}return n})}toHtml(){return this.lines.map(e=>Wc(e)).join(`
|
|
229
|
+
`)}};function Gc(t,e){return t.bold===e.bold&&t.dim===e.dim&&t.italic===e.italic&&t.underline===e.underline&&t.inverse===e.inverse&&Ba(t.fg,e.fg)&&Ba(t.bg,e.bg)}function Ba(t,e){return t===e?!0:!t||!e?!1:t.type===e.type&&t.idx===e.idx&&t.r===e.r&&t.g===e.g&&t.b===e.b}function Kc(t){if(t.type==="256"){if(t.idx<16)return null;let[e,n,s]=qc(t.idx);return`rgb(${e},${n},${s})`}return t.type==="rgb"?`rgb(${t.r},${t.g},${t.b})`:null}function Wc(t){return t.map(({text:e,style:n})=>{let s=[],r=[],{fg:a,bg:o}=n;n.inverse&&([a,o]=[o??{type:"inv-default-bg"},a??{type:"inv-default-fg"}]);for(let[f,E]of[[a,"fg"],[o,"bg"]])if(f)if(f.type==="ansi"||f.type==="256"&&f.idx<16)s.push(`ansi-${E}-${f.idx}`);else if(f.type==="inv-default-bg")s.push("ansi-inv-fg");else if(f.type==="inv-default-fg")s.push("ansi-inv-bg");else{let y=Kc(f);y&&r.push(`${E==="fg"?"color":"background-color"}:${y}`)}n.bold&&s.push("ansi-bold"),n.dim&&s.push("ansi-dim"),n.italic&&s.push("ansi-italic"),n.underline&&s.push("ansi-underline");let c=at(e);if(!s.length&&!r.length)return c;let d=s.length?` class="${s.join(" ")}"`:"",p=r.length?` style="${r.join(";")}"`:"";return`<span${d}${p}>${c}</span>`}).join("")}var Ua=24,Vc=t=>Math.max(1,Math.min(10,t)),Zc=t=>2**((t-5)/2.5),fr=55,xn=[30,45,55,70,90,120,160],za="decklight-term-wpm:"+location.pathname,jc=t=>xn.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e),En=["creamy","clacky","thocky","off"],Ha="decklight-term-typesound:"+location.pathname,Fa="decklight-term-fontsize:"+location.pathname,_n=[.75,.9,1,1.15,1.35,1.6],qa={thocky:{click:.17,clickF:[680,1250],clickQ:.9,lp:1800,clickDecay:[.012,.017],thump:.008,thumpF:[130,185],thumpF2:[58,85],thumpF2Prob:.22,ring:[.005,.009]},creamy:{click:.3,clickF:[1400,2850],clickQ:.95,lp:3800,clickDecay:[.007,.011],thump:.0056,thumpF:[60,110],ring:[.065,.095]},clacky:{click:.34,clickF:[2300,3900],clickQ:1.1,lp:6800,clickDecay:[.005,.008],thump:.003,thumpF:[90,140],ring:[.035,.055]}};function gr(t){let e=90+Math.random()*120;return Math.random()<.15&&(e+=Math.random()*240),t===" "?e+=70+Math.random()*220:".,:;/|&>-_=\"'`()".includes(t)&&(e+=40+Math.random()*140),Math.random()<.035&&(e+=300+Math.random()*440),e}var we=null,cs=null;function ds(t="",e="creamy",n=.12){try{let s=window.AudioContext||window.webkitAudioContext;if(!s)return;if(we??=new s,we.state==="suspended"&&we.resume(),!cs){let S=Math.floor(we.sampleRate*.06);cs=we.createBuffer(1,S,we.sampleRate);let B=cs.getChannelData(0);for(let D=0;D<S;D++)B[D]=Math.random()*2-1}let r=qa[e]??qa.creamy,a=(S,B)=>S+Math.random()*(B-S),o=we.currentTime,c=t===" ",d=a(.45,1.3)*(c?1.25:1),p=a(...r.clickF)*(c?.7:1),f=a(...r.ring)*(c?1.5:1),E=(S,B,D,H)=>{let U=we.createBufferSource();U.buffer=cs;let W=we.createBiquadFilter();W.type="bandpass",W.frequency.value=D,W.Q.value=r.clickQ;let Y=we.createBiquadFilter();Y.type="lowpass",Y.frequency.value=r.lp;let K=we.createGain();K.gain.setValueAtTime(1e-4,S),K.gain.exponentialRampToValueAtTime(B,S+7e-4),K.gain.exponentialRampToValueAtTime(1e-4,S+H),U.connect(W),W.connect(Y),Y.connect(K),K.connect(we.destination),U.start(S),U.stop(S+H+.01)},y=(S,B,D,H)=>{let U=we.createOscillator();U.type="sine",U.frequency.setValueAtTime(D,S),U.frequency.exponentialRampToValueAtTime(D*.6,S+H*.6);let W=we.createGain();W.gain.setValueAtTime(1e-4,S),W.gain.exponentialRampToValueAtTime(B,S+a(.003,.011)),W.gain.exponentialRampToValueAtTime(B*.25,S+H),W.gain.exponentialRampToValueAtTime(1e-4,S+H*2),U.connect(W),W.connect(we.destination),U.start(S),U.stop(S+H*2+.01)},T=r.thumpF2&&Math.random()<(r.thumpF2Prob??.4)?r.thumpF2:r.thumpF;E(o,r.click*d*(c?.82:1),p,a(...r.clickDecay)*(c?1.2:1)),y(o,r.thump*d*(c?2.4:1),a(...T)*(c?.7:1),f);let _=o+Math.max(.01,Math.min(a(.035,.08),n*.55));E(_,r.click*d*a(.35,.55),p*1.15,a(...r.clickDecay)*.8),y(_,r.thump*d*(c?.5:.25),a(...T)*(c?.7:1),f*.6)}catch{}}function Yc(){try{let t=window.AudioContext||window.webkitAudioContext;if(!t)return;we??=new t,we.state==="suspended"&&we.resume()}catch{}}var Ga=!1;function Xc(){if(Ga||typeof document>"u")return;Ga=!0;let t=()=>{Yc(),document.removeEventListener("pointerdown",t,!0),document.removeEventListener("keydown",t,!0)};document.addEventListener("pointerdown",t,!0),document.addEventListener("keydown",t,!0)}function br(t,e=document){let n=[...e.querySelectorAll(".terminal[data-cast], .terminal[data-cast-inline]")];return n.length&&Xc(),Promise.all(n.map(s=>Qc(s,t).catch(r=>{nd(s,r)})))}async function Qc(t,e){if(t.dataset.decklightTerminal)return;t.dataset.decklightTerminal="1";let n,s,r=t.dataset.castInline;if(r){s=r;let d=document.querySelector(r);if(!d&&document.readyState==="loading"&&(await new Promise(p=>document.addEventListener("DOMContentLoaded",p,{once:!0})),d=document.querySelector(r)),!d)throw new Error(`inline cast not found: ${r}`);n=d.textContent}else{s=t.dataset.cast;let d=await fetch(s);if(!d.ok)throw new Error(`failed to load cast: ${s} (${d.status})`);n=await d.text()}let a=Jc(n,s),o=new mr(t,a),c=t.dataset.mode||"step";a.imported&&c==="step"&&!a.hasMarkers&&(c="play"),c==="play"?o.mountPlayMode():o.mountStepMode(e)}function Jc(t,e){let n=null;try{n=JSON.parse(t)}catch{}if(n){if(n.decklightCast===1&&Array.isArray(n.steps))return n;throw new Error(`not a decklight cast (v1): ${e}`)}return ed(t,e)}function ed(t,e){let n=t.split(`
|
|
230
|
+
`).filter(d=>d.trim()),s;try{s=JSON.parse(n[0])}catch{s=null}if(!s||s.version!==2)throw new Error(`not a decklight cast or asciicast v2: ${e}`);let r=[],a={cmd:"",raw:!0,output:[]},o=0,c=!1;for(let d of n.slice(1)){let p;try{p=JSON.parse(d)}catch{continue}if(!Array.isArray(p)||p.length<3)continue;let[f,E,y]=p;E==="m"?(c=!0,a.output.length&&r.push(a),a={cmd:String(y||""),raw:!0,output:[]},o=f):E==="o"&&a.output.push([Math.max(0,td(f-o)),y])}if(a.output.length&&r.push(a),!r.length)throw new Error(`asciicast has no output events: ${e}`);return{decklightCast:1,imported:!0,hasMarkers:c,meta:{cols:s.width||100,rows:s.height||28,prompt:""},steps:r}}function td(t){return Math.round(t*1e3)/1e3}function nd(t,e){t.innerHTML=`<div class="terminal-window terminal-broken"><div class="terminal-titlebar"><span class="terminal-dot"></span><span class="terminal-dot"></span><span class="terminal-dot"></span><span class="terminal-title">terminal</span></div><div class="terminal-screen"><pre class="terminal-lines">\u26A0 ${at(String(e.message||e))}</pre></div></div>`}var mr=class{constructor(e,n){this.el=e,this.cast=n,this.prompt=n.meta.prompt??"$ ";let s=Vc(parseInt(e.dataset.typeSpeed??"5",10)||5);this.typeWpm=jc(fr*Zc(s));try{let a=parseInt(localStorage.getItem(za)??"",10);xn.includes(a)&&(this.typeWpm=a)}catch{}e.dataset.typeWpm=String(this.typeWpm),this.fontIdx=_n.indexOf(1);try{let a=parseInt(localStorage.getItem(Fa)??"",10);a>=0&&a<_n.length&&(this.fontIdx=a)}catch{}this._applyFont();let r=(e.dataset.typeSound||"creamy").toLowerCase();this.soundName=En.includes(r)?r:"creamy";try{let a=localStorage.getItem(Ha);a&&En.includes(a)&&(this.soundName=a)}catch{}this.typeSound=this.soundName==="off"?null:this.soundName,this.maxStep=(parseFloat(e.dataset.maxStep||"2.5")||2.5)*1e3,this.visibleRows=parseInt(e.dataset.rows||"",10)||Math.min(n.meta.rows||Ua,Ua),this.epoch=0,this.applied=0,this.playable=n.steps.filter(a=>!a.hidden&&a.sleep==null),this._mountChrome()}_mountChrome(){let e=this.el.dataset.title||"Terminal";this.el.innerHTML=`<div class="terminal-window"><div class="terminal-titlebar"><span class="terminal-dot"></span><span class="terminal-dot"></span><span class="terminal-dot"></span><span class="terminal-title">${at(e)}</span><span class="terminal-controls"></span></div><div class="terminal-screen"><pre class="terminal-lines"></pre></div></div>`,this.linesEl=this.el.querySelector(".terminal-lines"),this.screenEl=this.el.querySelector(".terminal-screen"),this.controlsEl=this.el.querySelector(".terminal-controls"),this.screenEl.style.maxHeight=`calc(${this.visibleRows} * var(--term-line-height, 1.45em))`}_renderComplete(e,{withCursor:n=!0}={}){let s=[];for(let r=0;r<e;r++)s.push(this._stepHtml(this.playable[r]));n&&!this.cast.imported&&s.push(this._promptHtml()+'<span class="terminal-cursor"></span>'),this.linesEl.innerHTML=s.join(`
|
|
231
|
+
`),this._scrollToEnd()}_stepEvents(e){return[...(e.output||[]).map(([n,s])=>({t:n,kind:"o",d:s})),...(e.input||[]).map(([n,s])=>({t:n,kind:"i",d:s.replace(/\r?\n$/,"")}))].sort((n,s)=>n.t-s.t)}_stepHtml(e){let n=new Yt;for(let r of this._stepEvents(e))n.write(r.d);let s=n.toHtml();return e.raw?s:this._promptHtml()+`<span class="terminal-cmd">${at(e.cmd)}</span>`+(s?`
|
|
232
|
+
`+s:"")}_promptHtml(){return`<span class="terminal-prompt">${at(this.prompt)}</span>`}_scrollToEnd(){this.screenEl.scrollTop=this.screenEl.scrollHeight}_applyFont(){let e=_n[this.fontIdx];this.el.style.fontSize=e===1?"":`${e}em`}_mountFontButton(){let e=document.createElement("button");e.className="terminal-btn terminal-fontsize",e.title="font size: click cycles 75% to 160%",e.setAttribute("aria-label","font size");let n=()=>{e.textContent=`A ${Math.round(_n[this.fontIdx]*100)}%`};n(),e.addEventListener("click",()=>{this.fontIdx=(this.fontIdx+1)%_n.length,this._applyFont();try{localStorage.setItem(Fa,String(this.fontIdx))}catch{}n()}),this.controlsEl.appendChild(e)}_mountSpeedButton(){let e=document.createElement("button");e.className="terminal-btn terminal-typespeed",e.title="typing speed: click cycles words per minute",e.setAttribute("aria-label","typing speed");let n=()=>{e.textContent=`\u2328 ${this.typeWpm} wpm`};n(),e.addEventListener("click",()=>{let s=(xn.indexOf(this.typeWpm)+1)%xn.length;this.typeWpm=xn[s],this.el.dataset.typeWpm=String(this.typeWpm);try{localStorage.setItem(za,String(this.typeWpm))}catch{}n()}),this.controlsEl.appendChild(e)}_mountSoundButton(){let e=document.createElement("button");e.className="terminal-btn terminal-typesound",e.title="key sound: click cycles creamy, clacky, thocky, off",e.setAttribute("aria-label","key sound");let n=()=>{e.textContent=`\u266A ${this.soundName}`};n(),e.addEventListener("click",()=>{let s=(En.indexOf(this.soundName)+1)%En.length;this.soundName=En[s],this.typeSound=this.soundName==="off"?null:this.soundName,this.el.dataset.typeSound=this.soundName;try{localStorage.setItem(Ha,this.soundName)}catch{}this.typeSound&&ds("a",this.typeSound,.12),n()}),this.controlsEl.appendChild(e)}async _typeCmd(e,n,s,r){for(let a=1;a<=e.length;a++){if(this.epoch!==r)return!1;let o=e[a-1],c=gr(o)/s;this.typeSound&&ds(o,this.typeSound,c/1e3),this.linesEl.innerHTML=n+this._promptHtml()+`<span class="terminal-cmd">${at(e.slice(0,a))}</span><span class="terminal-cursor"></span>`,this._scrollToEnd(),await mt(c)}return!0}mountStepMode(e){this.controlsEl.innerHTML="",this._mountSpeedButton(),this._mountSoundButton(),this._mountFontButton();let n=this.playable,s=Math.min(Math.max(parseInt(this.el.dataset.poster||"0",10)||0,0),n.length);if(this.poster=s,this.applied=s,this._renderComplete(s),!e||typeof e.registerBuildProvider!="function"){this._renderComplete(n.length,{withCursor:!1});return}e.registerBuildProvider(this.el,{count:n.length-s,label:r=>n[s+r]?`${this.prompt}${n[s+r].cmd||"\u25B6 recording"}`:"",apply:r=>this.applyStep(s+Math.max(0,Math.min(r,n.length-s)))})}applyStep(e){this.epoch+=1;let n=e===this.applied+1;if(this.applied=e,!n){this._renderComplete(e);return}this._animateStep(e-1,this.epoch)}async _animateStep(e,n){let s=this.playable[e],r=this.typeWpm/fr*(s.typeSpeed||1),a=[];for(let _=0;_<e;_++)a.push(this._stepHtml(this.playable[_]));let o=a.length?a.join(`
|
|
233
|
+
`)+`
|
|
234
|
+
`:"",c=s.cmd||"";if(!s.raw){if(!await this._typeCmd(c,o,r,n))return;await mt(120/r)}let d=this._stepEvents(s),p=d.length?d[d.length-1].t*1e3:0,f=p>this.maxStep?this.maxStep/p:1,E=new Yt,y=()=>{let _=E.toHtml();this.linesEl.innerHTML=s.raw?o+_:o+this._promptHtml()+`<span class="terminal-cmd">${at(c)}</span>`+(_?`
|
|
235
|
+
`+_:""),this._scrollToEnd()},T=0;for(let _ of d){let S=Math.min((_.t-T)*1e3*f,400);if(T=_.t,S>8&&await mt(S),this.epoch!==n)return;if(_.kind==="i")for(let B of _.d){if(this.epoch!==n)return;let D=gr(B)/r;this.typeSound&&ds(B,this.typeSound,D/1e3),E.write(B),y(),await mt(D)}else E.write(_.d),y()}this.epoch===n&&this._renderComplete(e+1)}mountPlayMode(){let e=[1,2,4],n=parseFloat(this.el.dataset.speed);this.speed=e.includes(n)?n:1,this.playing=!1,this.controlsEl.innerHTML=`<button class="terminal-btn terminal-play" aria-label="play">\u25B6</button><button class="terminal-btn terminal-speed" aria-label="speed">${this.speed}\xD7</button><button class="terminal-btn terminal-restart" aria-label="restart">\u21BA</button>`,this._mountSoundButton(),this._mountFontButton();let s=this.controlsEl.querySelector(".terminal-play"),r=this.controlsEl.querySelector(".terminal-speed");this.controlsEl.querySelector(".terminal-restart").addEventListener("click",()=>this._restart(s)),r.addEventListener("click",()=>{this.speed=this.speed>=4?1:this.speed*2,r.textContent=`${this.speed}\xD7`}),s.addEventListener("click",()=>{this.playing?(this.playing=!1,this.epoch+=1,s.textContent="\u25B6"):(s.textContent="\u23F8",this._playAll(s))}),this._renderComplete(0)}_restart(e){this.epoch+=1,this.playing=!1,e.textContent="\u25B6",this._playedUpTo=0,this._renderComplete(0)}async _playAll(e){this.playing=!0;let n=++this.epoch,s=this._playedUpTo||0;for(let r=s;r<this.cast.steps.length;r++){let a=this.cast.steps[r];if(a.hidden){this._playedUpTo=r+1;continue}if(a.sleep!=null){if(await mt(a.sleep*1e3/this.speed),this.epoch!==n){this._playedUpTo=r;return}this._playedUpTo=r+1;continue}let c=this.cast.steps.slice(0,r).filter(_=>!_.hidden&&_.sleep==null).map(_=>this._stepHtml(_)),d=c.length?c.join(`
|
|
236
|
+
`)+`
|
|
237
|
+
`:"",p=this.speed*(a.typeSpeed||1)*(this.typeWpm/fr),f=a.cmd||"";if(!a.raw&&!await this._typeCmd(f,d,p,n)){this._playedUpTo=r;return}let E=new Yt,y=()=>{let _=E.toHtml();this.linesEl.innerHTML=a.raw?d+_:d+this._promptHtml()+`<span class="terminal-cmd">${at(f)}</span>`+(_?`
|
|
238
|
+
`+_:""),this._scrollToEnd()},T=0;for(let _ of this._stepEvents(a)){let S=(_.t-T)*1e3/this.speed;if(T=_.t,S>4&&await mt(S),this.epoch!==n){this._playedUpTo=r;return}if(_.kind==="i")for(let B of _.d){if(this.epoch!==n){this._playedUpTo=r;return}let D=gr(B)/p;this.typeSound&&ds(B,this.typeSound,D/1e3),E.write(B),y(),await mt(D)}else E.write(_.d),y()}await mt(350/this.speed),this._playedUpTo=r+1}this.playing=!1,e.textContent="\u25B6",this._playedUpTo=0,this._renderComplete(this.playable.length,{withCursor:!0})}};function mt(t){return new Promise(e=>setTimeout(e,t))}var sd="0.1.0";function rd(t={}){let e=Pa(t),n=br||(void 0)?.registerTerminals;return typeof n=="function"&&Promise.resolve(n({registerBuildProvider:wn},document)).catch(s=>console.error("Decklight: terminal subsystem failed to initialize",s)),e}function id(t=document){let e=br||(void 0)?.registerTerminals;return typeof e=="function"?Promise.resolve(e({registerBuildProvider:wn},t)):Promise.resolve()}return Eo(ad);})();
|
|
239
|
+
//# sourceMappingURL=decklight.js.map
|