vde-open 0.1.17 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +0,0 @@
1
- (function(){function e(e){return e.replace(/^\uFEFF/,``).replace(/\r\n?/g,`
2
- `)}function t(e){return/^\s*$/.test(e)}function n(e,t){let n=0;for(;n<e.length&&n<t&&e[n]===` `;)n++;return e.slice(n)}function r(e){let t=``;for(let n of e)n.type===`text`||n.type===`inlineCode`?t+=n.value:`children`in n?t+=r(n.children):n.type===`image`&&(t+=n.alt);return t}function i(e=a){let t=/* @__PURE__ */ new Map;return n=>{let r=e(n),i=t.get(r)??1,a=r;for(;t.has(a);)a=`${r}-${++i}`;return t.set(r,i),t.set(a,1),a}}function a(e){return e.toLowerCase().normalize(`NFKD`).replace(/[\u0300-\u036f]/g,``).replace(/&[a-z0-9#]+;/gi,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`section`}function o(e){let t=e.replace(/[\u0000-\u001F\u007F\s]+/g,``);return/^(?!https?:|mailto:|tel:)[a-z][a-z0-9+.-]*:/i.test(t)?``:t}function s(e){let t=e.match(/^(?:<([^<>\n]*)>|([^<>\s]*?))(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?$/);if(!t)return;let n=t[1]??t[2],r=t[3]??t[4]??t[5];return{href:n.replace(/\\([!-/:-@\[-`{-~])/g,`$1`),...r?{title:r}:{}}}function c(e){return e.trim().replace(/\s+/g,` `).toLowerCase()}function l(e){return c(e).replace(/[^a-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``)||`footnote`}function u(e,t={}){let n=t.extensions?.flatMap(e=>e.inlineParser?[e.inlineParser]:[])??[],r=n.length?RegExp(p.source+`|[`+n.map(e=>e.markers).join(``).replace(/[\\\]\[\-^]/g,`\\$&`)+`]`,`g`):p,i=m(e,t,{scans:Math.max(e.length*f,1024),depth:0,links:0,parsers:n,marker:r});for(let e of t.extensions??[])i=e.transformInline?.(i,{options:t})??i;return i}function d(e){return e.type===`link`||`children`in e&&e.children.some(d)}let f=16,p=/[\\`!\[_*~<]/g;function m(e,t,n,i=!1){if(n.depth>=32)return e?[{type:`text`,value:e}]:[];n.depth++;let a=t.extensions?n.parsers:[],s=a.length?n.marker:p,c=[],l=0,u=``,f=()=>{u&&=(c.push({type:`text`,value:u}),``)};scan:for(;l<e.length;){let p=e[l],v=e[l+1];if(p===`\\`){if(v===`
3
- `){f(),c.push({type:`break`}),l+=2;continue}if(v&&/[!-/:-@\[-`{-~]/.test(v)){u+=v,l+=2;continue}}if(p==="`"){let t=y(e,l,"`"),r=b(e,l+t,"`",t,n);if(r!==-1){f(),c.push({type:`inlineCode`,value:e.slice(l+t,r).replace(/\n/g,` `).replace(/^ (?! *$)(.*) $/s,`$1`)}),l=r+t;continue}u+=e.slice(l,l+t),l+=t;continue}for(let r of a){if(!r.markers.includes(p)||n.scans--<=0)continue;let a=r.parse({source:e,index:l,options:t,inLink:i,parseInline:e=>m(e,t,n,i)});if(a){if(!Number.isInteger(a.length)||a.length<=0||a.length>e.length-l)throw RangeError(`Inline parser must consume a positive length within the source`);f(),c.push(a.node),d(a.node)&&n.links++,l+=a.length;continue scan}}if(p===`[`||p===`!`&&v===`[`){let i=p===`!`,a=v===`^`&&h(e,l,t,n);if(a){f(),c.push(a.node),n.links++,l=a.end;continue}let s=g(e,l+Number(i),t,n);if(s){let e=n.links,a=m(s.label,i?t.references?{references:t.references}:{}:t,n,!i),d=!i&&n.links!==e,p=o(s.href),h=t.urlTransform?t.urlTransform(s.href,i?`image`:`link`,p):p;if(h!==null&&(i||!d&&(h||!s.href)))f(),c.push({...i?{type:`image`,src:h,alt:r(a)}:{type:`link`,href:h,children:a},...s.title?{title:s.title}:{}});else{d&&(u+=`[`);for(let e of a)e.type===`text`?u+=e.value:(f(),c.push(e))}n.links=i?e:n.links+1,l=d?l+s.label.length+1:s.end;continue}}if(p===`*`&&v===`*`&&e[l+2]===`*`){let r=x(e,l+3,`***`,n);if(r!==-1){f(),c.push({type:`emphasis`,children:m(e.slice(l+1,r+2),t,n,i)}),l=r+3;continue}}if(p===`~`&&v===`~`&&e[l+2]===`~`){let t=y(e,l,`~`);u+=e.slice(l,l+t),l+=t;continue}if(p===`*`||p===`_`||p===`~`){let r=v===p?2:1,a=p===`_`&&!C(e,l,r,!0)?-1:x(e,l+r,p.repeat(r),n);a===-1?(u+=p.repeat(r),l+=r):(f(),c.push({type:p===`~`?`strike`:r===2?`strong`:`emphasis`,children:m(e.slice(l+r,a),t,n,i)}),l=a+r);continue}if(p===`<`&&t.allowHtml){let t=S(e,l+1,`>`,n);if(t!==-1&&_(e.slice(l,t+1))){f(),c.push({type:`inlineHtml`,value:e.slice(l,t+1)}),l=t+1;continue}}s.lastIndex=l+1;let w=n.scans>0?s.exec(e)?.index??e.length:e.indexOf(`\\`,l+1);u+=e.slice(l,w<0?e.length:w),l=w<0?e.length:w}return f(),n.depth--,c}function h(e,t,n,r){let i=S(e,t+2,`]`,r);if(i===-1)return;let a=c(e.slice(t+2,i)),o=n.footnotes?.[a];if(!o||!n.footnoteOrder)return;let s=n.footnoteOrder.indexOf(a)+1;s||=n.footnoteOrder.push(a);let u=(n.footnoteCounts?.[a]??0)+1;return n.footnoteCounts&&(n.footnoteCounts[a]=u),{node:{type:`footnoteReference`,id:o.id??l(o.label),number:s,...u>1?{referenceIndex:u}:{}},end:i+1}}function g(e,t,n,r){let i=v(e,t,`[`,`]`,r);if(i===-1)return;let a=e.slice(t+1,i),o=i+1,l;if(e[o]===`(`){let t=v(e,o,`(`,`)`,r);if(t===-1)return;l=s(e.slice(o+1,t).trim()),o=t+1}else if(e[o]===`[`){let t=v(e,o,`[`,`]`,r);if(t===-1)return;l=n.references?.[c(e.slice(o+1,t)||a)],o=t+1}else l=n.references?.[c(a)];if(l)return{...l,label:a,end:o}}function _(e){return/^<(?:!--(?:[\s\S]*--|-?)|\?[\s\S]*\?|![A-Z][\s\S]*|!\[CDATA\[[\s\S]*\]\]|\/[A-Za-z][\w:-]*\s*|[A-Za-z][\w:-]*(?:\s+[A-Za-z_:][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*\s*\/?)>$/.test(e)}function v(e,t,n,r,i){if(S(e,t+1,r,i)===-1)return-1;let a=0;for(let o=t;o<e.length;o++){if(--i.scans<0)return-1;if(e[o]===`\\`){o++;continue}if(e[o]===n&&a++,e[o]===r&&(a--,a===0))return o}return-1}function y(e,t,n,r){let i=0;for(;e[t+i]===n&&!(r&&--r.scans<0);)i++;return i}function b(e,t,n,r,i){let a=t;for(;(a=S(e,a,n,i))!==-1;){let t=y(e,a,n,i);if(t===r)return a;a+=t}return-1}function x(e,t,n,r){if(n===`~`&&/[\s\d]/.test(e[t]??``))return-1;for(let i=t;i<e.length;i++){if(--r.scans<0)return-1;if(e[i]===`\\`){i++;continue}if(e.startsWith(n,i)){if(n[0]===`~`){if(e[i-1]===`~`||e[i+n.length]===`~`)continue;if(n===`~`&&/\s/.test(e[i-1]??``))return-1}else if(e[i+1]===n){let t=y(e,i,n,r),a=x(e,i+t,n.repeat(t),r);if(a>i+t){i=a+t-1;continue}}if(n[0]!==`_`||C(e,i,n.length,!1))return i}}return-1}function S(e,t,n,r){if(r.scans<=0)return-1;let i=e.indexOf(n,t);return r.scans-=(i<0?e.length:i+1)-t,r.scans<0?-1:i}function C(e,t,n,r){let i=e[r?t+n:t-1],a=e[r?t-1:t+n];return i!==void 0&&!/\s/.test(i)&&(a===void 0||/[^\p{L}\p{N}]/u.test(a))}function w(t,n={}){let r=e(t),a=n.frontmatter!==!1,o=r.split(`
4
- `),s;if(a&&o[0]===`---`){let e=o.findIndex((e,t)=>t>0&&e===`---`);e>0&&(s=o.slice(1,e).join(`
5
- `),o=o.slice(e+1))}let c=D(o);o=c.lines;let l=[],u=Object.create(null),d=Object.keys(c.references).length>0,f=Object.keys(c.footnotes).length>0,p=d||f?{...n,...d&&{references:c.references},...f&&{footnotes:c.footnotes,footnoteOrder:l,footnoteCounts:u}}:n,m=i(),h=T(o,p,m).parse();f&&l.length>0&&h.push(ee(c.footnotes,l,p,m));let g=s===void 0?{type:`root`,children:h}:{type:`root`,frontmatter:s,children:h};for(let e of p.extensions??[])g=e.transformDocument?.(g,{options:p})??g;return g}function T(i,a,o,s={depth:0}){let c=0,l=!1;return{parse:d,get loose(){return l}};function d(){if(s.depth>=64){let e=i.slice(c).join(`
6
- `);return c=i.length,e?[{type:`paragraph`,children:u(e,a)}]:[]}s.depth++;let e=[];for(;c<i.length;){if(t(S())){e.length&&(l=!0),c++;continue}let n=f();if(n){e.push(n);continue}let r=(/^[a-z]/i.test(S())?void 0:p()??m()??h()??g()??_())??v()??y()??b();e.push(r)}return s.depth--,e}function f(){for(let t of a.extensions??[]){let n=0,r=t.parseBlock?.({lines:i,index:c,options:a,parseInline:e=>u(e,a),parseBlocks:t=>T(e(t).split(`
7
- `),a,o,s).parse(),consume:e=>{n=e}});if(r)return c+=Math.max(n,1),r}}function p(){let e=S().match(/^( {0,3})(`{3,}|~{3,})(.*)$/);if(!e)return;let t=e[2],r=e[3].trim(),a=[];for(c++;c<i.length;){let r=S();if(r.includes(t)&&/^ {0,3}(?:`+|~+)\s*$/.test(r)){c++;break}a.push(n(r,e[1].length)),c++}return{type:`code`,value:a.join(`
8
- `),...E(r)}}function m(){let e=S().match(/^ {0,3}(#{1,6})(?:[ \t]+(.*)|[ \t]*)$/);if(!e)return;let t=e[1].length,n=e[2]??``,r=u((/^#+[ \t]*$/.test(n)?``:n.replace(/[ \t]+#+[ \t]*$/,``)).trim(),a),i=x(r);return c++,i?{type:`heading`,depth:t,id:i,children:r}:{type:`heading`,depth:t,children:r}}function h(){if(/^ {0,3}([-*_])(?:\s*\1){2,}\s*$/.test(S()))return c++,{type:`thematicBreak`}}function g(){if(!/^ {0,3}>\s?/.test(S()))return;let e=[];for(;c<i.length;){let n=S(),r=n.match(/^ {0,3}>\s?(.*)$/);if(!r){if(!t(n))break;l=!0}e.push(r?.[1]??``),c++}return{type:`blockquote`,children:T(e,a,o,s).parse()}}function _(){let e=k(S());if(!e)return;let r=[],l=e.ordered,u=e.indent,d=!1;for(;c<i.length;){let l=k(S());if(!l||l.marker!==e.marker||l.indent!==u)break;let f=l.content,p=f.match(/^\[([ xX])\]\s+(.*)$/),m=p?p[1].toLowerCase()===`x`:void 0;p&&(f=p[2]);let h=[f];for(c++;c<i.length;){let r=S(),a=k(r);if(a&&a.indent===u)break;if(t(r)){let r=c;for(;r<i.length&&t(i[r]);)r++;let a=i[r];if(a===void 0)break;let o=k(a);if(o?.indent===u){if(o.marker!==e.marker)break;d=!0,c=r;break}if(A(a)<l.contentIndent)break;for(;c<r;)h.push(n(i[c++],l.contentIndent));continue}if(A(r)>=l.contentIndent){h.push(n(r,l.contentIndent)),c++;continue}if(j(r,C()))break;h.push(r.trimStart()),c++}let g=T(h,a,o,s),_=g.parse();d||=g.loose;let v={type:`listItem`,children:_};m!==void 0&&(v.checked=m),r.push(v)}return{type:`list`,ordered:l,...l&&{start:e.number},...d&&{loose:!0},items:r}}function v(){let e=S(),n=C();if(!n||!M(e,n))return;let r=N(e),o=N(n).map(te),s=r.length,l=[];for(c+=2;c<i.length;){let e=S();if(t(e)||j(e,C()))break;let n=N(e);l.push(Array.from({length:s},(e,t)=>P(n[t]??``,a))),c++}return{type:`table`,align:o,header:r.map(e=>P(e,a)),rows:l}}function y(){if(!a.allowHtml||!/^ {0,3}<([A-Za-z][\w:-]*|!--|\/[A-Za-z])/.test(S()))return;let e=[];if(/^ {0,3}<!--/.test(S())){for(;c<i.length;){let t=S();if(e.push(t),c++,t.includes(`-->`))break}return{type:`html`,value:e.join(`
9
- `)}}for(;c<i.length&&!t(S());)e.push(S()),c++;return{type:`html`,value:e.join(`
10
- `)}}function b(){let e=[];for(;c<i.length;){let n=S();if(t(n)||e.length>0&&j(n,C()))break;e.push(n.trim()),c++}return{type:`paragraph`,children:u(e.join(`
11
- `),a)}}function x(e){if(a.headingIds===!1)return;let t=r(e);return typeof a.headingIds==`function`?a.headingIds(t,c):o(t)}function S(){return i[c]??``}function C(){return i[c+1]}}function E(e){let t=e.match(/^([A-Za-z0-9_+.#-]+)/)?.[1],n=t?e.slice(t.length).trim():e,r=n.match(/(?:^|\s)(?:title|file)=(?:"([^"]+)"|'([^']+)'|([^\s}]+))/)?.slice(1).find(Boolean),i=n.match(/(?:^|\s)framework=(?:"([^"]+)"|'([^']+)'|([^\s}]+))/)?.slice(1).find(Boolean),a=n.match(/\{([^}]+)\}|(?:^|\s)lines=([^\s]+)/),o=a?O(a[1]??a[2]):[];return{...t&&{lang:t},...n&&{meta:n},...r&&{title:r,file:r},...i&&{framework:i.toLowerCase()},...o.length&&{highlightLines:o}}}function D(e){let n=Object.create(null),r=Object.create(null),a=i(l),o=[],u=``,d=0;for(;d<e.length;){let i=e[d],l=(!u||i.includes(u))&&i.match(/^ {0,3}(`{3,}|~{3,})(.*)$/);if(l)u?l[1].startsWith(u)&&t(l[2])&&(u=``):u=l[1];else if(!u){let t=i.match(/^ {0,3}\[\^([^\]\n]+)\]:[ \t]*(.*)$/);if(t){let n=t[1],i=[t[2]??``];for(d++;d<e.length;){let t=e[d];if(!/^(?: {4,}|\t)/.test(t))break;i.push(t.replace(/^(?: {4}|\t)/,``)),d++}let o=c(n);r[o]||(r[o]={label:n,content:i.join(`
12
- `),id:a(n)});continue}let o=i.match(/^ {0,3}\[([^\]\n]+)\]:[ \t]*(\S.*)$/),l=o&&s(o[2].trimEnd());if(l){n[c(o[1])]??=l,d++;continue}}o.push(i),d++}return{lines:o,references:n,footnotes:r}}function ee(t,n,r,i){let a=[];for(let o=0;o<n.length;o++){let s=t[n[o]];s&&a.push({id:s.id??l(s.label),number:o+1,children:T(e(s.content).split(`
13
- `),r,i).parse()})}for(let e of a){let t=r.footnoteCounts?.[n[e.number-1]]??1;t>1&&(e.referenceCount=t)}return{type:`footnotes`,items:a}}function O(e){let t=/* @__PURE__ */ new Set;for(let n of e.split(`,`)){let e=n.trim().match(/^(\d+)(?:-(\d+))?$/);if(!e)continue;let r=Number(e[1]),i=Number(e[2]??e[1]);if(!(i>2**53-1))for(let e=r;e<=i&&e<r+1e3;e++)t.add(e)}return[...t].sort((e,t)=>e-t)}function k(e){let t=e.match(/^(\s{0,8})([-+*]|\d{1,9}[.)])(?:([ \t]+)(.*))?$/);if(!t)return;let n=t[2],r=/\d/.test(n[0]);return{ordered:r,...r&&{number:Number.parseInt(n,10)},indent:t[1].length,marker:r?n.at(-1):n,contentIndent:t[1].length+n.length+(t[3]?.length??1),content:t[4]??``}}function A(e){return e.match(/^ */)?.[0].length??0}function j(e,t){let n=k(e);return/^ {0,3}(?:`{3,}|~{3,}|#{1,6}(?:\s|$)|([-*_])(?:\s*\1){2,}\s*$|>)/.test(e)||n!==void 0&&(!n.ordered||n.number===1)||!!t&&M(e,t)}function M(e,t){if(!e.includes(`|`))return!1;let n=N(t);return n.length===N(e).length&&n.every(e=>/^:?-+:?$/.test(e.trim()))}function N(e){let t=e.trim(),n=[],r=``;for(let e=+!!t.startsWith(`|`);e<t.length;e++){let i=t[e];if(i===`\\`&&t[e+1]===`|`){r+=`|`,e++;continue}if(i===`|`){n.push(r.trim()),r=``;continue}r+=i}return(r||!t.endsWith(`|`)||!n.length)&&n.push(r.trim()),n}function te(e){let t=e.trim();if(t.startsWith(`:`)&&t.endsWith(`:`))return`center`;if(t.endsWith(`:`))return`right`;if(t.startsWith(`:`))return`left`}function P(e,t){return{type:`tableCell`,children:u(e,t)}}var ne;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(ne||={});var re;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(re||={});var F;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(F||={});var I;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(I||={});var L;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(L||={});var R;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(R||={});var z;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(z||={});var B;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(B||={}),z.A,B.A,z.ADDRESS,B.ADDRESS,z.ANNOTATION_XML,B.ANNOTATION_XML,z.APPLET,B.APPLET,z.AREA,B.AREA,z.ARTICLE,B.ARTICLE,z.ASIDE,B.ASIDE,z.B,B.B,z.BASE,B.BASE,z.BASEFONT,B.BASEFONT,z.BGSOUND,B.BGSOUND,z.BIG,B.BIG,z.BLOCKQUOTE,B.BLOCKQUOTE,z.BODY,B.BODY,z.BR,B.BR,z.BUTTON,B.BUTTON,z.CAPTION,B.CAPTION,z.CENTER,B.CENTER,z.CODE,B.CODE,z.COL,B.COL,z.COLGROUP,B.COLGROUP,z.DD,B.DD,z.DESC,B.DESC,z.DETAILS,B.DETAILS,z.DIALOG,B.DIALOG,z.DIR,B.DIR,z.DIV,B.DIV,z.DL,B.DL,z.DT,B.DT,z.EM,B.EM,z.EMBED,B.EMBED,z.FIELDSET,B.FIELDSET,z.FIGCAPTION,B.FIGCAPTION,z.FIGURE,B.FIGURE,z.FONT,B.FONT,z.FOOTER,B.FOOTER,z.FOREIGN_OBJECT,B.FOREIGN_OBJECT,z.FORM,B.FORM,z.FRAME,B.FRAME,z.FRAMESET,B.FRAMESET,z.H1,B.H1,z.H2,B.H2,z.H3,B.H3,z.H4,B.H4,z.H5,B.H5,z.H6,B.H6,z.HEAD,B.HEAD,z.HEADER,B.HEADER,z.HGROUP,B.HGROUP,z.HR,B.HR,z.HTML,B.HTML,z.I,B.I,z.IMG,B.IMG,z.IMAGE,B.IMAGE,z.INPUT,B.INPUT,z.IFRAME,B.IFRAME,z.KEYGEN,B.KEYGEN,z.LABEL,B.LABEL,z.LI,B.LI,z.LINK,B.LINK,z.LISTING,B.LISTING,z.MAIN,B.MAIN,z.MALIGNMARK,B.MALIGNMARK,z.MARQUEE,B.MARQUEE,z.MATH,B.MATH,z.MENU,B.MENU,z.META,B.META,z.MGLYPH,B.MGLYPH,z.MI,B.MI,z.MO,B.MO,z.MN,B.MN,z.MS,B.MS,z.MTEXT,B.MTEXT,z.NAV,B.NAV,z.NOBR,B.NOBR,z.NOFRAMES,B.NOFRAMES,z.NOEMBED,B.NOEMBED,z.NOSCRIPT,B.NOSCRIPT,z.OBJECT,B.OBJECT,z.OL,B.OL,z.OPTGROUP,B.OPTGROUP,z.OPTION,B.OPTION,z.P,B.P,z.PARAM,B.PARAM,z.PLAINTEXT,B.PLAINTEXT,z.PRE,B.PRE,z.RB,B.RB,z.RP,B.RP,z.RT,B.RT,z.RTC,B.RTC,z.RUBY,B.RUBY,z.S,B.S,z.SCRIPT,B.SCRIPT,z.SEARCH,B.SEARCH,z.SECTION,B.SECTION,z.SELECT,B.SELECT,z.SOURCE,B.SOURCE,z.SMALL,B.SMALL,z.SPAN,B.SPAN,z.STRIKE,B.STRIKE,z.STRONG,B.STRONG,z.STYLE,B.STYLE,z.SUB,B.SUB,z.SUMMARY,B.SUMMARY,z.SUP,B.SUP,z.TABLE,B.TABLE,z.TBODY,B.TBODY,z.TEMPLATE,B.TEMPLATE,z.TEXTAREA,B.TEXTAREA,z.TFOOT,B.TFOOT,z.TD,B.TD,z.TH,B.TH,z.THEAD,B.THEAD,z.TITLE,B.TITLE,z.TR,B.TR,z.TRACK,B.TRACK,z.TT,B.TT,z.U,B.U,z.UL,B.UL,z.SVG,B.SVG,z.VAR,B.VAR,z.WBR,B.WBR,z.XMP,B.XMP;let V=B;I.HTML,V.ADDRESS,V.APPLET,V.AREA,V.ARTICLE,V.ASIDE,V.BASE,V.BASEFONT,V.BGSOUND,V.BLOCKQUOTE,V.BODY,V.BR,V.BUTTON,V.CAPTION,V.CENTER,V.COL,V.COLGROUP,V.DD,V.DETAILS,V.DIR,V.DIV,V.DL,V.DT,V.EMBED,V.FIELDSET,V.FIGCAPTION,V.FIGURE,V.FOOTER,V.FORM,V.FRAME,V.FRAMESET,V.H1,V.H2,V.H3,V.H4,V.H5,V.H6,V.HEAD,V.HEADER,V.HGROUP,V.HR,V.HTML,V.IFRAME,V.IMG,V.INPUT,V.LI,V.LINK,V.LISTING,V.MAIN,V.MARQUEE,V.MENU,V.META,V.NAV,V.NOEMBED,V.NOFRAMES,V.NOSCRIPT,V.OBJECT,V.OL,V.P,V.PARAM,V.PLAINTEXT,V.PRE,V.SCRIPT,V.SECTION,V.SELECT,V.SOURCE,V.STYLE,V.SUMMARY,V.TABLE,V.TBODY,V.TD,V.TEMPLATE,V.TEXTAREA,V.TFOOT,V.TH,V.THEAD,V.TITLE,V.TR,V.TRACK,V.UL,V.WBR,V.XMP,I.MATHML,V.MI,V.MO,V.MN,V.MS,V.MTEXT,V.ANNOTATION_XML,I.SVG,V.TITLE,V.FOREIGN_OBJECT,V.DESC,I.XLINK,I.XML,I.XMLNS,V.H1,V.H2,V.H3,V.H4,V.H5,V.H6,z.STYLE,z.SCRIPT,z.XMP,z.IFRAME,z.NOEMBED,z.NOFRAMES,z.PLAINTEXT;var H;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(H||={}),H.DATA,H.RCDATA,H.RAWTEXT,H.SCRIPT_DATA,H.PLAINTEXT,H.CDATA_SECTION,[.../* @__PURE__ */ new Set([B.DD,B.DT,B.LI,B.OPTGROUP,B.OPTION,B.P,B.RB,B.RP,B.RT,B.RTC]),B.CAPTION,B.COLGROUP,B.TBODY,B.TD,B.TFOOT,B.TH,B.THEAD,B.TR];let U=/* @__PURE__ */ new Set([B.APPLET,B.CAPTION,B.HTML,B.MARQUEE,B.OBJECT,B.TABLE,B.TD,B.TEMPLATE,B.TH]);[...U,B.OL,B.UL],[...U,B.BUTTON],B.ANNOTATION_XML,B.MI,B.MN,B.MO,B.MS,B.MTEXT,B.DESC,B.FOREIGN_OBJECT,B.TITLE,B.TR,B.TEMPLATE,B.HTML,B.TBODY,B.TFOOT,B.THEAD,B.TEMPLATE,B.HTML,B.TABLE,B.TEMPLATE,B.HTML,B.TD,B.TH;var W;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(W||={}),W.Marker,[.../* @__PURE__ */ `+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`)],new Map((/* @__PURE__ */ `attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`)).map(e=>[e.toLowerCase(),e])),I.XLINK,I.XLINK,I.XLINK,I.XLINK,I.XLINK,I.XLINK,I.XLINK,I.XML,I.XML,I.XMLNS,I.XMLNS,new Map((/* @__PURE__ */ `altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`)).map(e=>[e.toLowerCase(),e])),B.B,B.BIG,B.BLOCKQUOTE,B.BODY,B.BR,B.CENTER,B.CODE,B.DD,B.DIV,B.DL,B.DT,B.EM,B.EMBED,B.H1,B.H2,B.H3,B.H4,B.H5,B.H6,B.HEAD,B.HR,B.I,B.IMG,B.LI,B.LISTING,B.MENU,B.META,B.NOBR,B.OL,B.P,B.PRE,B.RUBY,B.S,B.SMALL,B.SPAN,B.STRONG,B.STRIKE,B.SUB,B.SUP,B.TABLE,B.TT,B.U,B.UL,B.VAR;var G;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(G||={}),B.TABLE,B.TBODY,B.TFOOT,B.THEAD,B.TR,B.CAPTION,B.COL,B.COLGROUP,B.TBODY,B.TD,B.TFOOT,B.TH,B.THEAD,B.TR,z.AREA,z.BASE,z.BASEFONT,z.BGSOUND,z.BR,z.COL,z.EMBED,z.FRAME,z.HR,z.IMG,z.INPUT,z.KEYGEN,z.LINK,z.META,z.PARAM,z.SOURCE,z.TRACK,z.WBR;function K(e,t){for(let n=0;n<e.length;n+=1)if(e.charCodeAt(n)===t)return!0;return!1}function q(e){let t=``;for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);r!==9&&r!==10&&r!==13&&(t+=e[n])}let n=0,r=t.length;for(;n<r&&t.charCodeAt(n)<=32;)n+=1;for(;r>n&&t.charCodeAt(r-1)<=32;)--r;return t.slice(n,r)}let J=/^([a-zA-Z][a-zA-Z0-9+.-]*):/,Y=/%(2f|5c|00)/i,ie=/%[0-9a-f]{2}/i;function ae(e){let t=q(e);return t===``||t.startsWith(`#`)||t.startsWith(`//`)||K(t,0)||t.includes(`\\`)?!1:!J.test(t)}let oe=/* @__PURE__ */ new Set([`md`,`markdown`,`html`,`htm`]);function se(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n>0&&oe.has(t.slice(n+1).toLowerCase())}function ce(e){let t=q(e);if(t.startsWith(`#`))return{kind:`fragment`};if(t===``||K(t,0)||t.includes(`\\`))return{kind:`other`};let n=J.exec(t)?.[1]?.toLowerCase();if(n!==void 0)return n===`http`||n===`https`||n===`mailto`?{kind:`external`,url:t}:{kind:`other`};if(t.startsWith(`//`))return{kind:`other`};let r=(t.split(`#`,1)[0]??``).split(`?`,1)[0]??``;if(r===``||Y.test(r))return{kind:`other`};let i=[];for(let e of r.split(`/`)){let t;try{t=decodeURIComponent(e)}catch{return{kind:`other`}}if(K(t,0)||t.includes(`/`)||t.includes(`\\`)||ie.test(t))return{kind:`other`};t!==``&&t!==`.`&&i.push(t)}let a=i.at(-1);return a===void 0||a===`..`||!se(a)?{kind:`other`}:{kind:`document`,fromRoot:r.startsWith(`/`),segments:i}}let X={maxNodes:1e5,maxDepth:64};var Z=class extends Error{limit;constructor(e){super(`The document structure exceeds the limit: ${e}.`),this.name=`ParseLimitError`,this.limit=e}};let le=(e,t)=>`h${String(t+1)}`,ue=/^(https?:|mailto:)/i;function de(e){return e.startsWith(`#`)||ue.test(e)}let fe={allowHtml:!1,frontmatter:!0,headingIds:le,urlTransform:(e,t)=>t===`image`?ae(e)?e:null:de(e)||ce(e).kind===`document`?e:null};function pe(e){let t=w(e,fe);return me(t),t}function Q(e,t,n){if(t>X.maxDepth)throw new Z(`depth`);for(let r of e){if(n.nodes+=1,n.nodes>X.maxNodes)throw new Z(`nodes`);`children`in r&&Q(r.children,t+1,n)}}function $(e,t,n){if(t>X.maxDepth)throw new Z(`depth`);for(let r of e){if(n.nodes+=1,n.nodes>X.maxNodes)throw new Z(`nodes`);switch(r.type){case`heading`:case`paragraph`:Q(r.children,t+1,n);break;case`blockquote`:case`callout`:case`component`:$(r.children,t+1,n);break;case`list`:for(let e of r.items)$(e.children,t+1,n);break;case`table`:for(let e of r.header)Q(e.children,t+1,n);for(let e of r.rows)for(let r of e)Q(r.children,t+1,n);break;case`footnotes`:for(let e of r.items)$(e.children,t+1,n)}}}function me(e){$(e.children,1,{nodes:0})}self.addEventListener(`message`,e=>{let{id:t,source:n}=e.data;try{self.postMessage({id:t,ok:!0,document:pe(n)})}catch(e){self.postMessage({id:t,ok:!1,reason:e instanceof Z?`limit-${e.limit}`:`parse-error`})}})})();
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-CbXtAM7H.js";import{A as t,D as n,O as r,S as i,Sn as a,W as o,Wt as s,_n as c,a as l,d as u,h as d,i as f,mn as p,n as m,p as h,r as g,s as _,t as v,w as y,wn as b,x,xn as S}from"./src--PpHwH7V.js";var C={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};C.node;var w=S(C),T=a(),E=e(b(),1),D=s(),O=`Open this document on the PC to read it here.`,k=`That document is no longer open on the PC.`,A=`document`,j=`mobile-drawer-toggle`,M=`mobile-document-list`,N=()=>new URLSearchParams(window.location.search).get(A),P=e=>{let t=new URL(window.location.href);return e===null?t.searchParams.delete(A):t.searchParams.set(A,e),`${t.pathname}${t.search}${t.hash}`};function F({api:e}){let[t,n]=(0,E.useState)(null),[r,i]=(0,E.useState)(`connecting`),[a,s]=(0,E.useState)(N),[c,l]=(0,E.useState)(null),[u,d]=(0,E.useState)(!1),f=(0,E.useRef)(!1),p=(0,E.useCallback)(()=>{f.current=document.getElementById(M)?.contains(document.activeElement)===!0,d(!1)},[]);(0,E.useEffect)(()=>{!u&&f.current&&(f.current=!1,document.getElementById(j)?.focus())},[u]),(0,E.useEffect)(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&p()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u,p]);let[h,_]=(0,E.useState)(!1),[y,b]=(0,E.useState)(()=>document.visibilityState===`visible`),[x,S]=(0,E.useState)(0),[C,T]=(0,E.useState)(0),[O,A]=(0,E.useState)(!1),F=(0,E.useMemo)(()=>v(async()=>{try{let t=await e.documents();n(t),i(`ready`)}catch(e){throw i(e=>e===`ready`?e:`failed`),e}}),[e]),R=(0,E.useCallback)(()=>{T(e=>e+1),F().then(e=>{A(e),e&&S(e=>e+1),T(e=>e-1)})},[F]),B=(0,E.useEffectEvent)(e=>{e.type===`daemon-stopping`?_(!1):e.type===`changed`&&e.documentId!==void 0&&e.documentId!==a?F():R()});(0,E.useEffect)(()=>{let t=e.events({onConnect:()=>{_(!0),R()},onEvent:e=>B(e),onDisconnect:()=>_(!1)}),n=()=>{let e=document.visibilityState===`visible`;b(e),e&&R()},r=()=>R();return document.addEventListener(`visibilitychange`,n),window.addEventListener(`pageshow`,r),()=>{t.close(),document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`pageshow`,r)}},[e,R]),(0,E.useEffect)(()=>{let e=()=>{d(!1),l(null),s(N())};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let V=(0,E.useCallback)(e=>{if(l(null),a===e)return;let t=window.history.state,n=a===null?{depth:1,fromList:!0}:{depth:(t?.depth??0)+1,fromList:t?.fromList===!0};window.history.pushState(n,``,P(e)),s(e)},[a]),H=t?.documents.find(e=>e.documentId===a)??null;H===null&&u&&d(!1),t!==null&&a!==null&&H===null&&(s(null),l(k)),(0,E.useEffect)(()=>{a===null&&N()!==null&&window.history.replaceState(null,``,P(null))},[a]),(0,E.useEffect)(()=>{document.title=H===null?`vo`:`vo - ${H.title}`},[H]);let U=h&&y&&C===0&&O;return(0,D.jsxs)(`div`,{className:`flex h-svh flex-col bg-background text-foreground`,children:[(0,D.jsxs)(`header`,{className:`flex h-11 shrink-0 items-center gap-1 border-b bg-chrome px-2`,children:[H===null?(0,D.jsx)(`h1`,{className:`flex-1 px-2 text-sm font-medium`,children:`Open documents`}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(o,{variant:`ghost`,size:`sm`,onClick:()=>{let e=window.history.state;if(e?.fromList===!0&&e.depth>0){window.history.go(-e.depth);return}window.history.pushState(null,``,P(null)),l(null),s(null)},"aria-label":`Back to the documents`,children:[(0,D.jsx)(w,{"aria-hidden":`true`}),`Documents`]}),(0,D.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:H.title}),(0,D.jsx)(g,{id:j,open:u,controls:M,onToggle:()=>d(e=>!e),label:`Switch document`,iconOnly:!0})]}),!h&&r===`ready`&&(0,D.jsx)(`span`,{role:`status`,className:`shrink-0 px-2 text-xs text-muted-foreground`,children:`Reconnecting…`})]}),c!==null&&(0,D.jsx)(`p`,{role:`status`,className:`border-b bg-muted px-3 py-2 text-sm`,children:c}),H!==null&&t!==null?(0,D.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,D.jsx)(m,{id:M,open:u,children:(0,D.jsx)(`div`,{className:`h-full overflow-y-auto`,children:(0,D.jsx)(L,{documents:t.documents,current:H.documentId,onOpen:e=>{p(),V(e)}})})}),(0,D.jsx)(z,{api:e,row:H,live:U,revalidation:x,onOpen:V,onNotice:l,onStale:R},`${t.daemonId}\n${H.documentId}`)]}):(0,D.jsx)(I,{catalog:t,phase:r,onOpen:V,onRetry:()=>{i(`connecting`),R()}})]})}function I({catalog:e,phase:t,onOpen:n,onRetry:r}){return e===null?t===`failed`?(0,D.jsxs)(`main`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-6 text-sm`,children:[(0,D.jsx)(`p`,{role:`alert`,children:`Could not load the documents from the PC.`}),(0,D.jsxs)(o,{variant:`outline`,onClick:r,children:[(0,D.jsx)(p,{"aria-hidden":`true`}),`Try again`]})]}):(0,D.jsxs)(`main`,{className:`flex flex-1 items-center justify-center gap-2 p-6 text-sm text-muted-foreground`,children:[(0,D.jsx)(c,{className:`size-4 animate-spin`,"aria-hidden":`true`}),`Connecting to the PC…`]}):e.documents.length===0?(0,D.jsx)(`main`,{className:`flex flex-1 items-center justify-center p-6 text-center text-sm text-muted-foreground`,children:`No documents are open on the PC.`}):(0,D.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,D.jsx)(L,{documents:e.documents,current:null,onOpen:n})})}function L({documents:e,current:t,onOpen:n}){return(0,D.jsx)(`nav`,{"aria-label":`Open documents`,children:(0,D.jsx)(`ul`,{children:e.map(e=>(0,D.jsx)(`li`,{className:`border-b`,children:(0,D.jsxs)(`button`,{type:`button`,className:`flex min-h-12 w-full items-center gap-3 px-4 py-3 text-left active:bg-muted aria-[current=page]:bg-muted aria-[current=page]:font-medium`,"aria-current":e.documentId===t?`page`:void 0,onClick:()=>n(e.documentId),children:[(0,D.jsx)(x,{format:e.format}),(0,D.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:e.title})]})},e.documentId))})})}function R(e,t,n){let[r,i]=e.viewEpoch.split(`.`).map(Number),[a,o]=t.viewEpoch.split(`.`).map(Number);return e.nonce===n&&e.effectiveMode===t.effectiveMode&&e.revision!==t.revision&&r===a&&o===(i??NaN)+1}function z({api:e,row:t,live:n,revalidation:i,onOpen:a,onNotice:o,onStale:s}){let[l,u]=(0,E.useState)(0),[d,f]=(0,E.useState)(null),[p,m]=(0,E.useState)(null),[h,g]=(0,E.useState)(null),_=(0,E.useRef)(new Set),v=`${t.revision??``}\n${t.viewEpoch}\n${String(l)}`,y=d!==null&&d.revision===t.revision&&d.viewEpoch===t.viewEpoch&&d.nonce===l,b=d!==null&&(y||R(d,t,l))?d:null,x=b?.grant.grant??null,S=y?d.grant.grant:null,{documentId:C,revision:w,viewEpoch:T,format:k,effectiveMode:A}=t,j=(0,E.useRef)(i);(0,E.useEffect)(()=>{j.current=i});let M=(0,E.useEffectEvent)(()=>s());(0,E.useEffect)(()=>{if(w===null)return;let t=!1,n={documentId:C,revision:w,viewEpoch:T},i=`${w}\n${T}\n${String(l)}`,a=null,o=()=>{a!==null&&e.release([a]).catch(()=>void 0),a=null};return(async()=>{let r=await e.grant(n);if(a=r.grant,t){o();return}let i=k===`markdown`?await e.content(n):null;if(t){o();return}_.current.add(r.grant),a=null,f({revision:w,viewEpoch:T,effectiveMode:A,nonce:l,grant:r,text:i,checkedAt:j.current}),m(null)})().catch(e=>{o(),!t&&(e instanceof r&&(e.status===409||e.status===404)?M():m({key:i,message:e instanceof Error?e.message:`Could not load.`}))}),()=>{t=!0,o()}},[e,C,w,T,k,A,l]),(0,E.useEffect)(()=>{let t=[..._.current].filter(e=>e!==x);if(t.length!==0){for(let e of t)_.current.delete(e);e.release(t).catch(()=>void 0)}}),(0,E.useEffect)(()=>()=>{let t=[..._.current];_.current.clear(),e.release(t).catch(()=>void 0)},[e]),(0,E.useEffect)(()=>{if(S===null)return;let t=!1;return e.check(S).then(e=>{t||(e?g({grant:S,revalidation:i}):u(e=>e+1))},()=>void 0),()=>{t=!0}},[e,S,i]),(0,E.useEffect)(()=>{let t=!1,n=()=>{let n=[..._.current];n.length!==0&&(_.current.clear(),t=!0,e.release(n,!0).catch(()=>void 0))},r=()=>{t&&(t=!1,u(e=>e+1))};return window.addEventListener(`pagehide`,n),window.addEventListener(`pageshow`,r),()=>{window.removeEventListener(`pagehide`,n),window.removeEventListener(`pageshow`,r)}},[e]);let N=(0,E.useRef)(null);(0,E.useEffect)(()=>(N.current=S,()=>{N.current=null}),[S]);let P=(0,E.useCallback)(async(t,n)=>{try{let r=await e.resolveLink(t,n);if(N.current!==t)return;r.status===`open`?a(r.documentId):o(O)}catch{N.current===t&&s()}},[e,a,o,s]),F=n&&b!==null&&S!==null&&(b.checkedAt===i||h?.grant===b.grant.grant&&h.revalidation===i);if(b===null){let e=p?.key===v?p.message:null;return(0,D.jsx)(`main`,{className:`flex flex-1 items-center justify-center gap-2 p-6 text-sm text-muted-foreground`,children:e===null?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(c,{className:`size-4 animate-spin`,"aria-hidden":`true`}),`Preparing the view…`]}):(0,D.jsxs)(`span`,{role:`alert`,children:[`Could not show the document (`,e,`).`]})})}return t.format===`markdown`?(0,D.jsx)(B,{shown:b,onOpenLink:P}):t.format===`image`?(0,D.jsx)(V,{shown:b,title:t.title}):(0,D.jsx)(H,{shown:b,interactive:F,onOpenLink:P})}function B({shown:e,onOpenLink:t}){let r=f(e.text),{grant:a}=e,o=(0,E.useMemo)(()=>{let e=new Set(a.assets.filter(e=>e.role===`image`||e.role===`svg`).map(e=>e.logicalPath));return t=>{let r=y(t,a.documentLogicalPath);return r===null||!e.has(r)?null:`${a.filesBaseUrl}${n(r)}`}},[a]),s=(0,E.useCallback)(e=>{let n=a.links.find(t=>t.href===e&&t.kind===`document`);n&&t(a.grant,n.linkId)},[a,t]),c;return c=r.status===`ready`?(0,D.jsx)(`article`,{className:`markdown-body mx-auto max-w-3xl px-4 py-4`,"data-testid":`markdown-body`,children:(0,D.jsx)(i,{document:r.document,resolveImage:o,onOpenLink:s})}):r.status===`parsing`?(0,D.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:`Preparing the view…`}):(0,D.jsx)(`pre`,{className:`p-4 font-mono text-sm break-words whitespace-pre-wrap`,children:e.text}),(0,D.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto`,children:c})}function V({shown:e,title:t}){let[n,r]=(0,E.useState)(null);return(0,D.jsx)(`main`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,D.jsx)(d,{url:e.grant.documentUrl,title:t,actualSize:!1,result:n,failure:null,onResult:r})})}function H({shown:e,interactive:t,onOpenLink:n}){let{grant:r}=e,i=(0,E.useRef)(null),a=r.links.some(e=>e.kind===`document`),o=!t&&r.mode===`interactive`,s=(0,E.useEffectEvent)(e=>{if(!t)return;let i=r.links.find(t=>t.kind===`document`&&t.linkId===e);i&&n(r.grant,i.linkId)});return(0,E.useEffect)(()=>{let e=i.current;if(!e||!a)return;let t,n=({data:e})=>{typeof e==`string`&&s(e)},o=i=>{if(i.source===null||i.source!==e.contentWindow||i.origin!==`null`||i.data!==`vde-open:document-links`||i.ports.length!==1)return;let[a]=i.ports;if(a){if(t&&r.mode===`interactive`){a.close();return}t?.(),a.addEventListener(`message`,n),a.start(),t=()=>{a.removeEventListener(`message`,n),a.close()}}};return window.addEventListener(`message`,o),()=>{window.removeEventListener(`message`,o),t?.()}},[r,a]),(0,D.jsxs)(`main`,{className:`relative min-h-0 flex-1`,children:[(0,D.jsx)(`iframe`,{ref:i,title:`View of ${r.documentLogicalPath}`,src:r.documentUrl??void 0,sandbox:r.mode===`interactive`||a?`allow-scripts`:``,referrerPolicy:`no-referrer`,className:`size-full border-0 bg-white`,"data-testid":`document-frame`,"data-mode":r.mode,inert:o},r.grant),o&&(0,D.jsx)(`div`,{className:`absolute inset-0`,"data-testid":`frame-paused`,"aria-hidden":`true`})]})}var U=`/_/mobile/v1`,W=1e4,G=35e3;async function K(e){let t=await e.json().catch(()=>null);if(!e.ok||!t?.ok)throw new r(t?.error?.code??`E_INTERNAL`,t?.error?.message??`The request failed.`,e.status,{});return t.data}function q(e){return e.toSorted((e,t)=>e.openedAt===t.openedAt?t.documentId.localeCompare(e.documentId):t.openedAt.localeCompare(e.openedAt))}function J(){let e=async e=>K(await fetch(`${U}${e}`,{cache:`no-store`})),n=async(e,t,n=!1)=>K(await fetch(`${U}${e}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),keepalive:n}));return{async documents(){for(let t=0;;t+=1)try{let t=await e(`/documents`),n=[...t.documents],i=t.nextCursor;for(;i!==null;){let a=await e(`/documents?cursor=${encodeURIComponent(i)}`);if(a.daemonId!==t.daemonId||a.catalogVersion!==t.catalogVersion)throw new r(`E_CURSOR_STALE`,`The list changed.`,409,{});n.push(...a.documents),i=a.nextCursor}return{daemonId:t.daemonId,documents:q(n)}}catch(e){if(!(e instanceof r&&e.status===409)||t>=3)throw e}},async content(t){let n=``,r=await e(`/documents/${t.documentId}/content?revision=${t.revision??``}&viewEpoch=${t.viewEpoch}`);for(n+=r.content;r.nextCursor!==null;)r=await e(`/documents/${t.documentId}/content?cursor=${encodeURIComponent(r.nextCursor)}`),n+=r.content;return n},grant(e){return n(`/documents/${e.documentId}/render-grants`,{revision:e.revision,viewEpoch:e.viewEpoch})},async check(e){return(await n(`/render-grants/check`,{grant:e})).valid},async release(e,t=!1){e.length>0&&await n(`/render-grants/release`,{grants:e},t)},resolveLink(e,t){return n(`/links/resolve`,{grant:e,linkId:t})},events({onEvent:e,onConnect:n,onDisconnect:r}){let i=new AbortController,a=0;return(async()=>{for(;!i.signal.aborted;){let o=new AbortController,s=()=>o.abort();i.signal.addEventListener(`abort`,s);let c,l=()=>{clearTimeout(c),c=setTimeout(s,G)};try{let r=await fetch(`${U}/events`,{cache:`no-store`,signal:o.signal});if(!r.ok||!r.body)throw Error(`events unavailable`);a=0,l(),n();let i=t(t=>{try{e(JSON.parse(t.data))}catch{}}),s=r.body.getReader();for(;;){let{done:e,value:t}=await s.read();if(e)break;l(),i.push(t)}}catch{}finally{clearTimeout(c),i.signal.removeEventListener(`abort`,s)}if(i.signal.aborted)return;r(),a+=1;let u=Math.min(W,250*2**a)*(.5+Math.random()/2);await new Promise(e=>setTimeout(e,u))}})(),{close:()=>i.abort()}}}}l(h(`theme`,`system`,u),h(`color-palette`,`standard`,_));function Y(){let[e]=(0,E.useState)(J);return(0,D.jsx)(F,{api:e})}var X=document.getElementById(`root`);if(!X)throw Error(`#root not found`);(0,T.createRoot)(X).render((0,D.jsx)(E.StrictMode,{children:(0,D.jsx)(Y,{})}));
@@ -1 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));export{c as n,o as t};