@beff/aula-cli 0.11.0 → 0.12.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.
Files changed (40) hide show
  1. package/dist/src/{aula-voice-tts-HPJAJO2Q.js → aula-voice-tts-YOS4IQXV.js} +1 -1
  2. package/dist/src/aula.js +2 -2
  3. package/dist/src/{chunk-5ABPFV55.js → chunk-2PAZTBSE.js} +2 -2
  4. package/dist/src/{chunk-JWBPHDVP.js → chunk-4QGX7XXO.js} +1 -1
  5. package/dist/src/{chunk-5XVICDLW.js → chunk-AXQBWV7J.js} +12 -6
  6. package/dist/src/{chunk-4PZYWKO5.js → chunk-DC7A435Z.js} +1 -1
  7. package/dist/src/{chunk-Y56UHOZ2.js → chunk-DN2LVJO3.js} +1 -0
  8. package/dist/src/{chunk-3RB5T3CC.js → chunk-HD6FTA3H.js} +9 -9
  9. package/dist/src/{chunk-5TUGYMFH.js → chunk-PZXFW6ZD.js} +3 -3
  10. package/dist/src/{chunk-XCPBFMEA.js → chunk-RAGZAJKD.js} +1 -1
  11. package/dist/src/{chunk-DFXG2P7A.js → chunk-T6CAPT32.js} +11 -7
  12. package/dist/src/{chunk-KCGXC2RV.js → chunk-TDAWUJ2L.js} +1 -1
  13. package/dist/src/cli.js +9 -9
  14. package/dist/src/{commands-BUM4AG3N.js → commands-BSDNHYB3.js} +10 -10
  15. package/dist/src/problems-CGKCPETU.js +18 -0
  16. package/dist/src/project-EUFMRQXR.js +16 -0
  17. package/dist/src/{run-YLF62D3C.js → run-ER27SVTA.js} +33 -23
  18. package/dist/src/{server-ALRN2C2W.js → server-TJTMSDO2.js} +18 -9
  19. package/dist/src/{site-A2I4P4GX.js → site-RGPJOWSU.js} +32 -15
  20. package/dist/web/app/assets/{56cf58c4 → bf5dd884}/aula-method.js +1 -1
  21. package/dist/web/app/assets/{56cf58c4 → bf5dd884}/aula.js +1 -1
  22. package/dist/web/app/assets/{56cf58c4 → bf5dd884}/build-worker.js +2 -2
  23. package/dist/web/app/assets/{56cf58c4 → bf5dd884}/index.js +2 -2
  24. package/dist/web/app/assets/protocol-Dc79M9p3.js +15 -0
  25. package/dist/web/app/assets/{src-DTLT9Lbm.js → src-DWqZcp-P.js} +1 -1
  26. package/dist/web/app/assets/{tex-mathjax-8QilZX4j.js → tex-mathjax-eWNptbJg.js} +1 -1
  27. package/dist/web/app/index.html +3 -3
  28. package/dist/web/site/assets/{82624cbe → 07fb5cf0}/aula-method.js +1 -1
  29. package/dist/web/site/assets/{82624cbe → 07fb5cf0}/aula.js +1 -1
  30. package/dist/web/site/assets/{82624cbe → 07fb5cf0}/build-worker.js +2 -2
  31. package/dist/web/site/assets/{82624cbe → 07fb5cf0}/index.js +2 -2
  32. package/dist/web/site/assets/protocol-F-4tHoAW.js +15 -0
  33. package/dist/web/site/assets/{src-DpS3WA7l.js → src-DfPcHwz-.js} +1 -1
  34. package/dist/web/site/assets/{tex-mathjax-CVHS5J80.js → tex-mathjax-DrZV_cwB.js} +1 -1
  35. package/dist/web/site/index.html +3 -3
  36. package/package.json +1 -1
  37. package/dist/src/problems-2IXR6RUV.js +0 -18
  38. package/dist/src/project-36YBXKCD.js +0 -16
  39. package/dist/web/app/assets/protocol-C3Pseh4g.js +0 -15
  40. package/dist/web/site/assets/protocol-BOv1ch3F.js +0 -15
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-BLXQ4ufn.js";import{x as t}from"./src-DpS3WA7l.js";var n=e(((e,t,n)=>{var r=n&&n.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=n&&n.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},a=n&&n.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},o=n&&n.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.LiteElement=void 0,e.LiteElement=function(){function e(e,t,n){var s,c;t===void 0&&(t={}),n===void 0&&(n=[]),this.kind=e,this.attributes=r({},t),this.children=a([],i(n),!1);try{for(var l=o(this.children),u=l.next();!u.done;u=l.next()){var d=u.value;d.parent=this}}catch(e){s={error:e}}finally{try{u&&!u.done&&(c=l.return)&&c.call(l)}finally{if(s)throw s.error}}this.styles=null}return e}()})),r=e(((e,t,n)=>{var r=n&&n.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractDOMAdaptor=void 0,e.AbstractDOMAdaptor=function(){function e(e){e===void 0&&(e=null),this.document=e}return e.prototype.node=function(e,t,n,i){var a,o;t===void 0&&(t={}),n===void 0&&(n=[]);var s=this.create(e,i);this.setAttributes(s,t);try{for(var c=r(n),l=c.next();!l.done;l=c.next()){var u=l.value;this.append(s,u)}}catch(e){a={error:e}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(a)throw a.error}}return s},e.prototype.setAttributes=function(e,t){var n,i,a,o,s,c;if(t.style&&typeof t.style!=`string`)try{for(var l=r(Object.keys(t.style)),u=l.next();!u.done;u=l.next()){var d=u.value;this.setStyle(e,d.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()}),t.style[d])}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}if(t.properties)try{for(var f=r(Object.keys(t.properties)),p=f.next();!p.done;p=f.next()){var d=p.value;e[d]=t.properties[d]}}catch(e){a={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}try{for(var m=r(Object.keys(t)),h=m.next();!h.done;h=m.next()){var d=h.value;(d!==`style`||typeof t.style==`string`)&&d!==`properties`&&this.setAttribute(e,d,t[d])}}catch(e){s={error:e}}finally{try{h&&!h.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}},e.prototype.replace=function(e,t){return this.insert(e,t),this.remove(t),t},e.prototype.childNode=function(e,t){return this.childNodes(e)[t]},e.prototype.allClasses=function(e){var t=this.getAttribute(e,`class`);return t?t.replace(/ +/g,` `).replace(/^ /,``).replace(/ $/,``).split(/ /):[]},e}()})),i=e(((e,t,n)=>{var r=n&&n.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},i=n&&n.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},a=n&&n.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(e,"__esModule",{value:!0}),e.lookup=e.separateOptions=e.selectOptionsFromKeys=e.selectOptions=e.userOptions=e.defaultOptions=e.insert=e.copy=e.keys=e.makeArray=e.expandable=e.Expandable=e.OPTIONS=e.REMOVE=e.APPEND=e.isObject=void 0;var o={}.constructor;function s(e){return typeof e==`object`&&!!e&&(e.constructor===o||e.constructor===c)}e.isObject=s,e.APPEND=`[+]`,e.REMOVE=`[-]`,e.OPTIONS={invalidOption:`warn`,optionError:function(t,n){if(e.OPTIONS.invalidOption===`fatal`)throw Error(t);console.warn(`MathJax: `+t)}};var c=function(){function e(){}return e}();e.Expandable=c;function l(e){return Object.assign(Object.create(c.prototype),e)}e.expandable=l,e.makeArray=function(e){return Array.isArray(e)?e:[e]};function u(e){return e?Object.keys(e).concat(Object.getOwnPropertySymbols(e)):[]}e.keys=u;function d(e){var t,n,i={};try{for(var a=r(u(e)),o=a.next();!o.done;o=a.next()){var p=o.value,m=Object.getOwnPropertyDescriptor(e,p),h=m.value;Array.isArray(h)?m.value=f([],h,!1):s(h)&&(m.value=d(h)),m.enumerable&&(i[p]=m)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return Object.defineProperties(e.constructor===c?l({}):{},i)}e.copy=d;function f(t,n,o){var l,p;o===void 0&&(o=!0);var m=function(r){if(o&&t[r]===void 0&&t.constructor!==c)return typeof r==`symbol`&&(r=r.toString()),e.OPTIONS.optionError(`Invalid option "${r}" (no default value).`,r),`continue`;var l=n[r],p=t[r];if(s(l)&&p!==null&&(typeof p==`object`||typeof p==`function`)){var m=u(l);Array.isArray(p)&&(m.length===1&&(m[0]===e.APPEND||m[0]===e.REMOVE)&&Array.isArray(l[m[0]])||m.length===2&&m.sort().join(`,`)===e.APPEND+`,`+e.REMOVE&&Array.isArray(l[e.APPEND])&&Array.isArray(l[e.REMOVE]))?(l[e.REMOVE]&&(p=t[r]=p.filter(function(t){return l[e.REMOVE].indexOf(t)<0})),l[e.APPEND]&&(t[r]=a(a([],i(p),!1),i(l[e.APPEND]),!1))):f(p,l,o)}else Array.isArray(l)?(t[r]=[],f(t[r],l,!1)):s(l)?t[r]=d(l):t[r]=l};try{for(var h=r(u(n)),g=h.next();!g.done;g=h.next())m(g.value)}catch(e){l={error:e}}finally{try{g&&!g.done&&(p=h.return)&&p.call(h)}finally{if(l)throw l.error}}return t}e.insert=f,e.defaultOptions=function(e){return[...arguments].slice(1).forEach(function(t){return f(e,t,!1)}),e},e.userOptions=function(e){return[...arguments].slice(1).forEach(function(t){return f(e,t,!0)}),e};function p(e){var t,n,i=[...arguments].slice(1),a={};try{for(var o=r(i),s=o.next();!s.done;s=o.next()){var c=s.value;e.hasOwnProperty(c)&&(a[c]=e[c])}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a}e.selectOptions=p,e.selectOptionsFromKeys=function(e,t){return p.apply(void 0,a([e],i(Object.keys(t)),!1))},e.separateOptions=function(e){var t,n,i,a,o=[...arguments].slice(1),s=[];try{for(var c=r(o),l=c.next();!l.done;l=c.next()){var u=l.value,d={},f={};try{for(var p=(i=void 0,r(Object.keys(e||{}))),m=p.next();!m.done;m=p.next()){var h=m.value;(u[h]===void 0?f:d)[h]=e[h]}}catch(e){i={error:e}}finally{try{m&&!m.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}s.push(d),e=f}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return s.unshift(e),s},e.lookup=function(e,t,n){return n===void 0&&(n=null),t.hasOwnProperty(e)?t[e]:n}})),a=e(((e,t,n)=>{var r=n&&n.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),a=n&&n.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.NodeMixin=e.NodeMixinOptions=void 0;var o=i();e.NodeMixinOptions={badCSS:!0,badSizes:!0},e.NodeMixin=function(t,n){var i;return n===void 0&&(n={}),n=(0,o.userOptions)((0,o.defaultOptions)({},e.NodeMixinOptions),n),i=function(e){r(t,e);function t(){var t=[...arguments],n=e.call(this,t[0])||this,r=n.constructor;return n.options=(0,o.userOptions)((0,o.defaultOptions)({},r.OPTIONS),t[1]),n}return t.prototype.fontSize=function(t){return n.badCSS?this.options.fontSize:e.prototype.fontSize.call(this,t)},t.prototype.fontFamily=function(t){return n.badCSS?this.options.fontFamily:e.prototype.fontFamily.call(this,t)},t.prototype.nodeSize=function(r,i,a){if(i===void 0&&(i=1),a===void 0&&(a=null),!n.badSizes)return e.prototype.nodeSize.call(this,r,i,a);var o=this.textContent(r),s=Array.from(o.replace(t.cjkPattern,``)).length;return[(Array.from(o).length-s)*this.options.cjkCharWidth+s*this.options.unknownCharWidth,this.options.unknownCharHeight]},t.prototype.nodeBBox=function(t){return n.badSizes?{left:0,right:0,top:0,bottom:0}:e.prototype.nodeBBox.call(this,t)},t}(t),i.OPTIONS=a(a({},n.badCSS?{fontSize:16,fontFamily:`Times`}:{}),n.badSizes?{cjkCharWidth:1,unknownCharWidth:.6,unknownCharHeight:.8}:{}),i.cjkPattern=RegExp(`[ᄀ-ᅟ〈〉⺀-〾぀-㉇㉐-䶿一-꓆ꥠ-ꥼ가-힣豈-﫿︐-︙︰-﹫!-⦆¢-₩𛀀-𛀁🈀-🉑𠀀-𿿽]`,`gu`),i}})),o=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LiteDocument=void 0;var t=n();e.LiteDocument=function(){function e(){this.root=new t.LiteElement(`html`,{},[this.head=new t.LiteElement(`head`),this.body=new t.LiteElement(`body`)]),this.type=``}return Object.defineProperty(e.prototype,"kind",{get:function(){return`#document`},enumerable:!1,configurable:!0}),e}()})),s=e(((e,t,n)=>{var r=n&&n.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.LiteComment=e.LiteText=void 0;var i=function(){function e(e){e===void 0&&(e=``),this.value=e}return Object.defineProperty(e.prototype,"kind",{get:function(){return`#text`},enumerable:!1,configurable:!0}),e}();e.LiteText=i,e.LiteComment=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"kind",{get:function(){return`#comment`},enumerable:!1,configurable:!0}),t}(i)})),c=e(((e,t,n)=>{var r=n&&n.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},i=n&&n.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(e,"__esModule",{value:!0}),e.LiteList=void 0,e.LiteList=function(){function e(e){this.nodes=[],this.nodes=i([],r(e),!1)}return e.prototype.append=function(e){this.nodes.push(e)},e.prototype[Symbol.iterator]=function(){var e=0;return{next:function(){return e===this.nodes.length?{value:null,done:!0}:{value:this.nodes[e++],done:!1}}}},e}()})),l=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.retryAfter=e.handleRetriesFor=void 0,e.handleRetriesFor=function(e){return new Promise(function t(n,r){try{n(e())}catch(e){e.retry&&e.retry instanceof Promise?e.retry.then(function(){return t(n,r)}).catch(function(e){return r(e)}):e.restart&&e.restart.isCallback?MathJax.Callback.After(function(){return t(n,r)},e.restart):r(e)}})},e.retryAfter=function(e){var t=Error(`MathJax retry`);throw t.retry=e,t}})),u=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION=`3.2.2`})),d=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PrioritizedList=void 0,e.PrioritizedList=function(){function e(){this.items=[],this.items=[]}return e.prototype[Symbol.iterator]=function(){var e=0,t=this.items;return{next:function(){return{value:t[e++],done:e>t.length}}}},e.prototype.add=function(t,n){n===void 0&&(n=e.DEFAULTPRIORITY);var r=this.items.length;do r--;while(r>=0&&n<this.items[r].priority);return this.items.splice(r+1,0,{item:t,priority:n}),t},e.prototype.remove=function(e){var t=this.items.length;do t--;while(t>=0&&this.items[t].item!==e);t>=0&&this.items.splice(t,1)},e.DEFAULTPRIORITY=5,e}()})),f=e(((e,t,n)=>{var r=n&&n.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=n&&n.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.HandlerList=void 0,e.HandlerList=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.register=function(e){return this.add(e,e.priority)},t.prototype.unregister=function(e){this.remove(e)},t.prototype.handlesDocument=function(e){var t,n;try{for(var r=i(this),a=r.next();!a.done;a=r.next()){var o=a.value.item;if(o.handlesDocument(e))return o}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}throw Error(`Can't find handler for document`)},t.prototype.document=function(e,t){return t===void 0&&(t=null),this.handlesDocument(e).create(e,t)},t}(d().PrioritizedList)})),p=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mathjax=void 0;var t=u(),n=f(),r=l();e.mathjax={version:t.VERSION,handlers:new n.HandlerList,document:function(t,n){return e.mathjax.handlers.document(t,n)},handleRetriesFor:r.handleRetriesFor,retryAfter:r.retryAfter,asyncLoad:null}})),m=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.asyncLoad=void 0;var t=p();e.asyncLoad=function(e){return t.mathjax.asyncLoad?new Promise(function(n,r){var i=t.mathjax.asyncLoad(e);i instanceof Promise?i.then(function(e){return n(e)}).catch(function(e){return r(e)}):n(i)}):Promise.reject(`Can't load '${e}': No asyncLoad method specified`)}})),h=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.numeric=e.translate=e.remove=e.add=e.entities=e.options=void 0;var t=l(),n=m();e.options={loadMissingEntities:!0},e.entities={ApplyFunction:`⁡`,Backslash:`∖`,Because:`∵`,Breve:`˘`,Cap:`⋒`,CenterDot:`·`,CircleDot:`⊙`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,Congruent:`≡`,ContourIntegral:`∮`,Coproduct:`∐`,Cross:`⨯`,Cup:`⋓`,CupCap:`≍`,Dagger:`‡`,Del:`∇`,Delta:`Δ`,Diamond:`⋄`,DifferentialD:`ⅆ`,DotEqual:`≐`,DoubleDot:`¨`,DoubleRightTee:`⊨`,DoubleVerticalBar:`∥`,DownArrow:`↓`,DownLeftVector:`↽`,DownRightVector:`⇁`,DownTee:`⊤`,Downarrow:`⇓`,Element:`∈`,EqualTilde:`≂`,Equilibrium:`⇌`,Exists:`∃`,ExponentialE:`ⅇ`,FilledVerySmallSquare:`▪`,ForAll:`∀`,Gamma:`Γ`,Gg:`⋙`,GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Hacek:`ˇ`,Hat:`^`,HumpDownHump:`≎`,HumpEqual:`≏`,Im:`ℑ`,ImaginaryI:`ⅈ`,Integral:`∫`,Intersection:`⋂`,InvisibleComma:`⁣`,InvisibleTimes:`⁢`,Lambda:`Λ`,Larr:`↞`,LeftAngleBracket:`⟨`,LeftArrow:`←`,LeftArrowRightArrow:`⇆`,LeftCeiling:`⌈`,LeftDownVector:`⇃`,LeftFloor:`⌊`,LeftRightArrow:`↔`,LeftTee:`⊣`,LeftTriangle:`⊲`,LeftTriangleEqual:`⊴`,LeftUpVector:`↿`,LeftVector:`↼`,Leftarrow:`⇐`,Leftrightarrow:`⇔`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,LessSlantEqual:`⩽`,LessTilde:`≲`,Ll:`⋘`,Lleftarrow:`⇚`,LongLeftArrow:`⟵`,LongLeftRightArrow:`⟷`,LongRightArrow:`⟶`,Longleftarrow:`⟸`,Longleftrightarrow:`⟺`,Longrightarrow:`⟹`,Lsh:`↰`,MinusPlus:`∓`,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotLeftTriangle:`⋪`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotPrecedes:`⊀`,NotPrecedesSlantEqual:`⋠`,NotRightTriangle:`⋫`,NotRightTriangleEqual:`⋭`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsSlantEqual:`⋡`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotVerticalBar:`∤`,Omega:`Ω`,OverBar:`‾`,OverBrace:`⏞`,PartialD:`∂`,Phi:`Φ`,Pi:`Π`,PlusMinus:`±`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,Product:`∏`,Proportional:`∝`,Psi:`Ψ`,Rarr:`↠`,Re:`ℜ`,ReverseEquilibrium:`⇋`,RightAngleBracket:`⟩`,RightArrow:`→`,RightArrowLeftArrow:`⇄`,RightCeiling:`⌉`,RightDownVector:`⇂`,RightFloor:`⌋`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTriangle:`⊳`,RightTriangleEqual:`⊵`,RightUpVector:`↾`,RightVector:`⇀`,Rightarrow:`⇒`,Rrightarrow:`⇛`,Rsh:`↱`,Sigma:`Σ`,SmallCircle:`∘`,Sqrt:`√`,Square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,Star:`⋆`,Subset:`⋐`,SubsetEqual:`⊆`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,SuchThat:`∋`,Sum:`∑`,Superset:`⊃`,SupersetEqual:`⊇`,Supset:`⋑`,Therefore:`∴`,Theta:`Θ`,Tilde:`∼`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,UnderBar:`_`,UnderBrace:`⏟`,Union:`⋃`,UnionPlus:`⊎`,UpArrow:`↑`,UpDownArrow:`↕`,UpTee:`⊥`,Uparrow:`⇑`,Updownarrow:`⇕`,Upsilon:`Υ`,Vdash:`⊩`,Vee:`⋁`,VerticalBar:`∣`,VerticalTilde:`≀`,Vvdash:`⊪`,Wedge:`⋀`,Xi:`Ξ`,amp:`&`,acute:`´`,aleph:`ℵ`,alpha:`α`,amalg:`⨿`,and:`∧`,ang:`∠`,angmsd:`∡`,angsph:`∢`,ape:`≊`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,beta:`β`,beth:`ℶ`,between:`≬`,bigcirc:`◯`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,blacklozenge:`⧫`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,bowtie:`⋈`,boxdl:`┐`,boxdr:`┌`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxul:`┘`,boxur:`└`,bsol:`\\`,bull:`•`,cap:`∩`,check:`✓`,chi:`χ`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledR:`®`,circledS:`Ⓢ`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,clubs:`♣`,colon:`:`,comp:`∁`,ctdot:`⋯`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cup:`∪`,curarr:`↷`,curlyvee:`⋎`,curlywedge:`⋏`,dagger:`†`,daleth:`ℸ`,ddarr:`⇊`,deg:`°`,delta:`δ`,digamma:`ϝ`,div:`÷`,divideontimes:`⋇`,dot:`˙`,doteqdot:`≑`,dotplus:`∔`,dotsquare:`⊡`,dtdot:`⋱`,ecir:`≖`,efDot:`≒`,egs:`⪖`,ell:`ℓ`,els:`⪕`,empty:`∅`,epsi:`ε`,epsiv:`ϵ`,erDot:`≓`,eta:`η`,eth:`ð`,flat:`♭`,fork:`⋔`,frown:`⌢`,gEl:`⪌`,gamma:`γ`,gap:`⪆`,gimel:`ℷ`,gnE:`≩`,gnap:`⪊`,gne:`⪈`,gnsim:`⋧`,gt:`>`,gtdot:`⋗`,harrw:`↭`,hbar:`ℏ`,hellip:`…`,hookleftarrow:`↩`,hookrightarrow:`↪`,imath:`ı`,infin:`∞`,intcal:`⊺`,iota:`ι`,jmath:`ȷ`,kappa:`κ`,kappav:`ϰ`,lEg:`⪋`,lambda:`λ`,lap:`⪅`,larrlp:`↫`,larrtl:`↢`,lbrace:`{`,lbrack:`[`,le:`≤`,leftleftarrows:`⇇`,leftthreetimes:`⋋`,lessdot:`⋖`,lmoust:`⎰`,lnE:`≨`,lnap:`⪉`,lne:`⪇`,lnsim:`⋦`,longmapsto:`⟼`,looparrowright:`↬`,lowast:`∗`,loz:`◊`,lt:`<`,ltimes:`⋉`,ltri:`◃`,macr:`¯`,malt:`✠`,mho:`℧`,mu:`μ`,multimap:`⊸`,nLeftarrow:`⇍`,nLeftrightarrow:`⇎`,nRightarrow:`⇏`,nVDash:`⊯`,nVdash:`⊮`,natur:`♮`,nearr:`↗`,nharr:`↮`,nlarr:`↚`,not:`¬`,nrarr:`↛`,nu:`ν`,nvDash:`⊭`,nvdash:`⊬`,nwarr:`↖`,omega:`ω`,omicron:`ο`,or:`∨`,osol:`⊘`,period:`.`,phi:`φ`,phiv:`ϕ`,pi:`π`,piv:`ϖ`,prap:`⪷`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,prime:`′`,psi:`ψ`,quot:`"`,rarrtl:`↣`,rbrace:`}`,rbrack:`]`,rho:`ρ`,rhov:`ϱ`,rightrightarrows:`⇉`,rightthreetimes:`⋌`,ring:`˚`,rmoust:`⎱`,rtimes:`⋊`,rtri:`▹`,scap:`⪸`,scnE:`⪶`,scnap:`⪺`,scnsim:`⋩`,sdot:`⋅`,searr:`↘`,sect:`§`,sharp:`♯`,sigma:`σ`,sigmav:`ς`,simne:`≆`,smile:`⌣`,spades:`♠`,sub:`⊂`,subE:`⫅`,subnE:`⫋`,subne:`⊊`,supE:`⫆`,supnE:`⫌`,supne:`⊋`,swarr:`↙`,tau:`τ`,theta:`θ`,thetav:`ϑ`,tilde:`˜`,times:`×`,triangle:`▵`,triangleq:`≜`,upsi:`υ`,upuparrows:`⇈`,veebar:`⊻`,vellip:`⋮`,weierp:`℘`,xi:`ξ`,yen:`¥`,zeta:`ζ`,zigrarr:`⇝`,nbsp:`\xA0`,rsquo:`’`,lsquo:`‘`};var r={};e.add=function(t,n){Object.assign(e.entities,t),r[n]=!0},e.remove=function(t){delete e.entities[t]},e.translate=function(e){return e.replace(/&([a-z][a-z0-9]*|#(?:[0-9]+|x[0-9a-f]+));/gi,i)};function i(i,o){if(o.charAt(0)===`#`)return a(o.slice(1));if(e.entities[o])return e.entities[o];if(e.options.loadMissingEntities){var s=o.match(/^[a-zA-Z](fr|scr|opf)$/)?RegExp.$1:o.charAt(0).toLowerCase();r[s]||(r[s]=!0,(0,t.retryAfter)((0,n.asyncLoad)(`./util/entities/`+s+`.js`)))}return i}function a(e){var t=e.charAt(0)===`x`?parseInt(e.slice(1),16):parseInt(e);return String.fromCodePoint(t)}e.numeric=a})),g=e(((e,t,r)=>{var i=r&&r.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),a=r&&r.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),o=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return a(t,e),t},c=r&&r.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},l=r&&r.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.LiteParser=e.PATTERNS=void 0;var u=o(h()),d=n(),f=s(),p;(function(e){e.TAGNAME=`[a-z][^\\s\\n>]*`,e.ATTNAME=`[a-z][^\\s\\n>=]*`,e.VALUE=`(?:'[^']*'|"[^"]*"|[^\\s\\n]+)`,e.VALUESPLIT=`(?:'([^']*)'|"([^"]*)"|([^\\s\\n]+))`,e.SPACE=`(?:\\s|\\n)+`,e.OPTIONALSPACE=`(?:\\s|\\n)*`,e.ATTRIBUTE=e.ATTNAME+`(?:`+e.OPTIONALSPACE+`=`+e.OPTIONALSPACE+e.VALUE+`)?`,e.ATTRIBUTESPLIT=`(`+e.ATTNAME+`)(?:`+e.OPTIONALSPACE+`=`+e.OPTIONALSPACE+e.VALUESPLIT+`)?`,e.TAG=`(<(?:`+e.TAGNAME+`(?:`+e.SPACE+e.ATTRIBUTE+`)*`+e.OPTIONALSPACE+`/?|/`+e.TAGNAME+`|!--[^]*?--|![^]*?)(?:>|$))`,e.tag=new RegExp(e.TAG,`i`),e.attr=new RegExp(e.ATTRIBUTE,`i`),e.attrsplit=new RegExp(e.ATTRIBUTESPLIT,`i`)})(p=e.PATTERNS||={}),e.LiteParser=function(){function e(){}return e.prototype.parseFromString=function(e,t,n){t===void 0&&(t=`text/html`),n===void 0&&(n=null);for(var r=n.createDocument(),i=n.body(r),a=e.replace(/<\?.*?\?>/g,``).split(p.tag);a.length;){var o=a.shift(),s=a.shift();o&&this.addText(n,i,o),s&&s.charAt(s.length-1)===`>`&&(s.charAt(1)===`!`?this.addComment(n,i,s):i=s.charAt(1)===`/`?this.closeTag(n,i,s):this.openTag(n,i,s,a))}return this.checkDocument(n,r),r},e.prototype.addText=function(e,t,n){return n=u.translate(n),e.append(t,e.text(n))},e.prototype.addComment=function(e,t,n){return e.append(t,new f.LiteComment(n))},e.prototype.closeTag=function(e,t,n){for(var r=n.slice(2,n.length-1).toLowerCase();e.parent(t)&&e.kind(t)!==r;)t=e.parent(t);return e.parent(t)},e.prototype.openTag=function(e,t,n,r){var i=this.constructor.PCDATA,a=this.constructor.SELF_CLOSING,o=n.match(/<(.*?)[\s\n>\/]/)[1].toLowerCase(),s=e.node(o),c=n.replace(/^<.*?[\s\n>]/,``).split(p.attrsplit);return(c.pop().match(/>$/)||c.length<5)&&(this.addAttributes(e,s,c),e.append(t,s),!a[o]&&!n.match(/\/>$/)&&(i[o]?this.handlePCDATA(e,s,o,r):t=s)),t},e.prototype.addAttributes=function(e,t,n){for(var r=this.constructor.CDATA_ATTR;n.length;){var i=c(n.splice(0,5),5),a=i[1],o=i[2],s=i[3],l=i[4],d=o||s||l||``;r[a]||(d=u.translate(d)),e.setAttribute(t,a,d)}},e.prototype.handlePCDATA=function(e,t,n,r){for(var i=[],a=`</`+n+`>`,o=``;r.length&&o!==a;)i.push(o),i.push(r.shift()),o=r.shift();e.append(t,e.text(i.join(``)))},e.prototype.checkDocument=function(e,t){var n,r,i,a,o=this.getOnlyChild(e,e.body(t));if(o){try{for(var s=l(e.childNodes(e.body(t))),c=s.next();!c.done;c=s.next()){var u=c.value;if(u===o)break;u instanceof f.LiteComment&&u.value.match(/^<!DOCTYPE/)&&(t.type=u.value)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}switch(e.kind(o)){case`html`:try{for(var d=l(o.children),p=d.next();!p.done;p=d.next()){var u=p.value;switch(e.kind(u)){case`head`:t.head=u;break;case`body`:t.body=u}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}t.root=o,e.remove(o),e.parent(t.body)!==o&&e.append(o,t.body),e.parent(t.head)!==o&&e.insert(t.head,t.body);break;case`head`:t.head=e.replace(o,t.head);break;case`body`:t.body=e.replace(o,t.body)}}},e.prototype.getOnlyChild=function(e,t){var n,r,i=null;try{for(var a=l(e.childNodes(t)),o=a.next();!o.done;o=a.next()){var s=o.value;if(s instanceof d.LiteElement){if(i)return null;i=s}}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.prototype.serialize=function(e,t,n){var r=this;n===void 0&&(n=!1);var i=this.constructor.SELF_CLOSING,a=this.constructor.CDATA_ATTR,o=e.kind(t),s=e.allAttributes(t).map(function(e){return e.name+`="`+(a[e.name]?e.value:r.protectAttribute(e.value))+`"`}).join(` `),c=this.serializeInner(e,t,n);return`<`+o+(s?` `+s:``)+((!n||c)&&!i[o]?`>${c}</${o}>`:n?`/>`:`>`)},e.prototype.serializeInner=function(e,t,n){var r=this;return n===void 0&&(n=!1),this.constructor.PCDATA.hasOwnProperty(t.kind)?e.childNodes(t).map(function(t){return e.value(t)}).join(``):e.childNodes(t).map(function(t){var i=e.kind(t);return i===`#text`?r.protectHTML(e.value(t)):i===`#comment`?t.value:r.serialize(e,t,n)}).join(``)},e.prototype.protectAttribute=function(e){return typeof e!=`string`&&(e=String(e)),e.replace(/"/g,`&quot;`)},e.prototype.protectHTML=function(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)},e.SELF_CLOSING={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,menuitem:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},e.PCDATA={option:!0,textarea:!0,fieldset:!0,title:!0,style:!0,script:!0},e.CDATA_ATTR={style:!0,datafld:!0,datasrc:!0,href:!0,src:!0,longdesc:!0,usemap:!0,cite:!0,datetime:!0,action:!0,axis:!0,profile:!0,content:!0,scheme:!0},e}()})),_=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LiteWindow=void 0;var t=n(),r=o(),i=c(),a=g();e.LiteWindow=function(){function e(){this.DOMParser=a.LiteParser,this.NodeList=i.LiteList,this.HTMLCollection=i.LiteList,this.HTMLElement=t.LiteElement,this.DocumentFragment=i.LiteList,this.Document=r.LiteDocument,this.document=new r.LiteDocument}return e}()})),v=e(((e,t,n)=>{var r=n&&n.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},i=n&&n.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},a=n&&n.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(e,"__esModule",{value:!0}),e.Styles=void 0;var o=[`top`,`right`,`bottom`,`left`],s=[`width`,`style`,`color`];function c(e){for(var t=e.split(/((?:'[^']*'|"[^"]*"|,[\s\n]|[^\s\n])*)/g),n=[];t.length>1;)t.shift(),n.push(t.shift());return n}function l(e){var t,n,i=c(this.styles[e]);i.length===0&&i.push(``),i.length===1&&i.push(i[0]),i.length===2&&i.push(i[0]),i.length===3&&i.push(i[1]);try{for(var a=r(b.connect[e].children),o=a.next();!o.done;o=a.next()){var s=o.value;this.setStyle(this.childName(e,s),i.shift())}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}function u(e){var t,n,i=b.connect[e].children,a=[];try{for(var o=r(i),s=o.next();!s.done;s=o.next()){var c=s.value,l=this.styles[e+`-`+c];if(!l){delete this.styles[e];return}a.push(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}a[3]===a[1]&&(a.pop(),a[2]===a[0]&&(a.pop(),a[1]===a[0]&&a.pop())),this.styles[e]=a.join(` `)}function d(e){var t,n;try{for(var i=r(b.connect[e].children),a=i.next();!a.done;a=i.next()){var o=a.value;this.setStyle(this.childName(e,o),this.styles[e])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}}function f(e){var t,n,o=a([],i(b.connect[e].children),!1),s=this.styles[this.childName(e,o.shift())];try{for(var c=r(o),l=c.next();!l.done;l=c.next()){var u=l.value;if(this.styles[this.childName(e,u)]!==s){delete this.styles[e];return}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}this.styles[e]=s}var p={width:/^(?:[\d.]+(?:[a-z]+)|thin|medium|thick|inherit|initial|unset)$/,style:/^(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|inherit|initial|unset)$/};function m(e){var t,n,i,a,o={width:``,style:``,color:``};try{for(var s=r(c(this.styles[e])),l=s.next();!l.done;l=s.next()){var u=l.value;u.match(p.width)&&o.width===``?o.width=u:u.match(p.style)&&o.style===``?o.style=u:o.color=u}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}try{for(var d=r(b.connect[e].children),f=d.next();!f.done;f=d.next()){var m=f.value;this.setStyle(this.childName(e,m),o[m])}}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}}function h(e){var t,n,i=[];try{for(var a=r(b.connect[e].children),o=a.next();!o.done;o=a.next()){var s=o.value,c=this.styles[this.childName(e,s)];c&&i.push(c)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}i.length?this.styles[e]=i.join(` `):delete this.styles[e]}var g={style:/^(?:normal|italic|oblique|inherit|initial|unset)$/,variant:RegExp(`^(?:normal|none|inherit|initial|unset|common-ligatures|no-common-ligatures|discretionary-ligatures|no-discretionary-ligatures|historical-ligatures|no-historical-ligatures|contextual|no-contextual|(?:stylistic|character-variant|swash|ornaments|annotation)\\([^)]*\\)|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|ordinal|slashed-zero|jis78|jis83|jis90|jis04|simplified|traditional|full-width|proportional-width|ruby)$`),weight:/^(?:normal|bold|bolder|lighter|[1-9]00|inherit|initial|unset)$/,stretch:RegExp(`^(?:normal|(?:(?:ultra|extra|semi)-)?condensed|(?:(?:semi|extra|ulta)-)?expanded|inherit|initial|unset)$`),size:RegExp(`^(?:xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller|[d.]+%|[d.]+[a-z]+|inherit|initial|unset)(?:/(?:normal|[d.+](?:%|[a-z]+)?))?$`)};function _(e){var t,n,a,o,s=c(this.styles[e]),l={style:``,variant:[],weight:``,stretch:``,size:``,family:``,"line-height":``};try{for(var u=r(s),d=u.next();!d.done;d=u.next()){var f=d.value;l.family=f;try{for(var p=(a=void 0,r(Object.keys(g))),m=p.next();!m.done;m=p.next()){var h=m.value;if((Array.isArray(l[h])||l[h]===``)&&f.match(g[h])){if(h===`size`){var _=i(f.split(/\//),2),y=_[0],b=_[1];l[h]=y,b&&(l[`line-height`]=b)}else l.size===``&&(Array.isArray(l[h])?l[h].push(f):l[h]=f)}}}catch(e){a={error:e}}finally{try{m&&!m.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}}}catch(e){t={error:e}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}v(e,l),delete this.styles[e]}function v(e,t){var n,i;try{for(var a=r(b.connect[e].children),o=a.next();!o.done;o=a.next()){var s=o.value,c=this.childName(e,s);if(Array.isArray(t[s])){var l=t[s];l.length&&(this.styles[c]=l.join(` `))}else t[s]!==``&&(this.styles[c]=t[s])}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}}function y(e){}var b=function(){function e(e){e===void 0&&(e=``),this.parse(e)}return Object.defineProperty(e.prototype,"cssText",{get:function(){var e,t,n=[];try{for(var i=r(Object.keys(this.styles)),a=i.next();!a.done;a=i.next()){var o=a.value,s=this.parentName(o);this.styles[s]||n.push(o+`: `+this.styles[o]+`;`)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n.join(` `)},enumerable:!1,configurable:!0}),e.prototype.set=function(t,n){for(t=this.normalizeName(t),this.setStyle(t,n),e.connect[t]&&!e.connect[t].combine&&(this.combineChildren(t),delete this.styles[t]);t.match(/-/)&&(t=this.parentName(t),e.connect[t]);)e.connect[t].combine.call(this,t)},e.prototype.get=function(e){return e=this.normalizeName(e),this.styles.hasOwnProperty(e)?this.styles[e]:``},e.prototype.setStyle=function(t,n){this.styles[t]=n,e.connect[t]&&e.connect[t].children&&e.connect[t].split.call(this,t),n===``&&delete this.styles[t]},e.prototype.combineChildren=function(t){var n,i,a=this.parentName(t);try{for(var o=r(e.connect[t].children),s=o.next();!s.done;s=o.next()){var c=s.value,l=this.childName(a,c);e.connect[l].combine.call(this,l)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.prototype.parentName=function(e){var t=e.replace(/-[^-]*$/,``);return e===t?``:t},e.prototype.childName=function(t,n){return n.match(/-/)?n:(e.connect[t]&&!e.connect[t].combine&&(n+=t.replace(/.*-/,`-`),t=this.parentName(t)),t+`-`+n)},e.prototype.normalizeName=function(e){return e.replace(/[A-Z]/g,function(e){return`-`+e.toLowerCase()})},e.prototype.parse=function(e){e===void 0&&(e=``);var t=this.constructor.pattern;this.styles={};for(var n=e.replace(t.comment,``).split(t.style);n.length>1;){var r=i(n.splice(0,3),3),a=r[0],o=r[1],s=r[2];if(a.match(/[^\s\n]/))return;this.set(o,s)}},e.pattern={style:/([-a-z]+)[\s\n]*:[\s\n]*((?:'[^']*'|"[^"]*"|\n|.)*?)[\s\n]*(?:;|$)/g,comment:/\/\*[^]*?\*\//g},e.connect={padding:{children:o,split:l,combine:u},border:{children:o,split:d,combine:f},"border-top":{children:s,split:m,combine:h},"border-right":{children:s,split:m,combine:h},"border-bottom":{children:s,split:m,combine:h},"border-left":{children:s,split:m,combine:h},"border-width":{children:o,split:l,combine:null},"border-style":{children:o,split:l,combine:null},"border-color":{children:o,split:l,combine:null},font:{children:[`style`,`variant`,`weight`,`stretch`,`line-height`,`size`,`family`],split:_,combine:y}},e}();e.Styles=b})),y=e(((e,t,i)=>{var c=i&&i.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),l=i&&i.__assign||function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},l.apply(this,arguments)},u=i&&i.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},d=i&&i.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},f=i&&i.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(e,"__esModule",{value:!0}),e.liteAdaptor=e.LiteAdaptor=e.LiteBase=void 0;var p=r(),m=a(),h=o(),y=n(),b=s(),x=_(),S=g(),C=v(),w=function(e){c(t,e);function t(){var t=e.call(this)||this;return t.parser=new S.LiteParser,t.window=new x.LiteWindow,t}return t.prototype.parse=function(e,t){return this.parser.parseFromString(e,t,this)},t.prototype.create=function(e,t){return t===void 0&&(t=null),new y.LiteElement(e)},t.prototype.text=function(e){return new b.LiteText(e)},t.prototype.comment=function(e){return new b.LiteComment(e)},t.prototype.createDocument=function(){return new h.LiteDocument},t.prototype.head=function(e){return e.head},t.prototype.body=function(e){return e.body},t.prototype.root=function(e){return e.root},t.prototype.doctype=function(e){return e.type},t.prototype.tags=function(e,t,n){n===void 0&&(n=null);var r=[],i=[];if(n)return i;for(var a=e;a;){var o=a.kind;o!==`#text`&&o!==`#comment`&&(a=a,o===t&&i.push(a),a.children.length&&(r=a.children.concat(r))),a=r.shift()}return i},t.prototype.elementById=function(e,t){for(var n=[],r=e;r;){if(r.kind!==`#text`&&r.kind!==`#comment`){if(r=r,r.attributes.id===t)return r;r.children.length&&(n=r.children.concat(n))}r=n.shift()}return null},t.prototype.elementsByClass=function(e,t){for(var n=[],r=[],i=e;i;)i.kind!==`#text`&&i.kind!==`#comment`&&(i=i,(i.attributes.class||``).trim().split(/ +/).includes(t)&&r.push(i),i.children.length&&(n=i.children.concat(n))),i=n.shift();return r},t.prototype.getElements=function(e,t){var n,r,i=[],a=this.body(t);try{for(var o=u(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(typeof c==`string`){if(c.charAt(0)===`#`){var l=this.elementById(a,c.slice(1));l&&i.push(l)}else c.charAt(0)===`.`?i=i.concat(this.elementsByClass(a,c.slice(1))):c.match(/^[-a-z][-a-z0-9]*$/i)&&(i=i.concat(this.tags(a,c)))}else Array.isArray(c)?i=i.concat(c):c instanceof this.window.NodeList||c instanceof this.window.HTMLCollection?i=i.concat(c.nodes):i.push(c)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},t.prototype.contains=function(e,t){for(;t&&t!==e;)t=this.parent(t);return!!t},t.prototype.parent=function(e){return e.parent},t.prototype.childIndex=function(e){return e.parent?e.parent.children.findIndex(function(t){return t===e}):-1},t.prototype.append=function(e,t){return t.parent&&this.remove(t),e.children.push(t),t.parent=e,t},t.prototype.insert=function(e,t){if(e.parent&&this.remove(e),t&&t.parent){var n=this.childIndex(t);t.parent.children.splice(n,0,e),e.parent=t.parent}},t.prototype.remove=function(e){var t=this.childIndex(e);return t>=0&&e.parent.children.splice(t,1),e.parent=null,e},t.prototype.replace=function(e,t){var n=this.childIndex(t);return n>=0&&(t.parent.children[n]=e,e.parent=t.parent,t.parent=null),t},t.prototype.clone=function(e){var t=this,n=new y.LiteElement(e.kind);return n.attributes=l({},e.attributes),n.children=e.children.map(function(e){if(e.kind===`#text`)return new b.LiteText(e.value);if(e.kind===`#comment`)return new b.LiteComment(e.value);var r=t.clone(e);return r.parent=n,r}),n},t.prototype.split=function(e,t){var n=new b.LiteText(e.value.slice(t));return e.value=e.value.slice(0,t),e.parent.children.splice(this.childIndex(e)+1,0,n),n.parent=e.parent,n},t.prototype.next=function(e){var t=e.parent;if(!t)return null;var n=this.childIndex(e)+1;return n>=0&&n<t.children.length?t.children[n]:null},t.prototype.previous=function(e){var t=e.parent;if(!t)return null;var n=this.childIndex(e)-1;return n>=0?t.children[n]:null},t.prototype.firstChild=function(e){return e.children[0]},t.prototype.lastChild=function(e){return e.children[e.children.length-1]},t.prototype.childNodes=function(e){return f([],d(e.children),!1)},t.prototype.childNode=function(e,t){return e.children[t]},t.prototype.kind=function(e){return e.kind},t.prototype.value=function(e){return e.kind===`#text`?e.value:e.kind===`#comment`?e.value.replace(/^<!(--)?((?:.|\n)*)\1>$/,`$2`):``},t.prototype.textContent=function(e){var t=this;return e.children.reduce(function(e,n){return e+(n.kind===`#text`?n.value:n.kind===`#comment`?``:t.textContent(n))},``)},t.prototype.innerHTML=function(e){return this.parser.serializeInner(this,e)},t.prototype.outerHTML=function(e){return this.parser.serialize(this,e)},t.prototype.serializeXML=function(e){return this.parser.serialize(this,e,!0)},t.prototype.setAttribute=function(e,t,n,r){r===void 0&&(r=null),typeof n!=`string`&&(n=String(n)),r&&(t=r.replace(/.*\//,``)+`:`+t.replace(/^.*:/,``)),e.attributes[t]=n,t===`style`&&(e.styles=null)},t.prototype.getAttribute=function(e,t){return e.attributes[t]},t.prototype.removeAttribute=function(e,t){delete e.attributes[t]},t.prototype.hasAttribute=function(e,t){return e.attributes.hasOwnProperty(t)},t.prototype.allAttributes=function(e){var t,n,r=e.attributes,i=[];try{for(var a=u(Object.keys(r)),o=a.next();!o.done;o=a.next()){var s=o.value;i.push({name:s,value:r[s]})}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i},t.prototype.addClass=function(e,t){var n=(e.attributes.class||``).split(/ /);n.find(function(e){return e===t})||(n.push(t),e.attributes.class=n.join(` `))},t.prototype.removeClass=function(e,t){var n=(e.attributes.class||``).split(/ /),r=n.findIndex(function(e){return e===t});r>=0&&(n.splice(r,1),e.attributes.class=n.join(` `))},t.prototype.hasClass=function(e,t){return!!(e.attributes.class||``).split(/ /).find(function(e){return e===t})},t.prototype.setStyle=function(e,t,n){e.styles||=new C.Styles(this.getAttribute(e,`style`)),e.styles.set(t,n),e.attributes.style=e.styles.cssText},t.prototype.getStyle=function(e,t){if(!e.styles){var n=this.getAttribute(e,`style`);if(!n)return``;e.styles=new C.Styles(n)}return e.styles.get(t)},t.prototype.allStyles=function(e){return this.getAttribute(e,`style`)},t.prototype.insertRules=function(e,t){e.children=[this.text(t.join(`
1
+ import{t as e}from"./rolldown-runtime-BLXQ4ufn.js";import{x as t}from"./src-DfPcHwz-.js";var n=e(((e,t,n)=>{var r=n&&n.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=n&&n.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},a=n&&n.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},o=n&&n.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.LiteElement=void 0,e.LiteElement=function(){function e(e,t,n){var s,c;t===void 0&&(t={}),n===void 0&&(n=[]),this.kind=e,this.attributes=r({},t),this.children=a([],i(n),!1);try{for(var l=o(this.children),u=l.next();!u.done;u=l.next()){var d=u.value;d.parent=this}}catch(e){s={error:e}}finally{try{u&&!u.done&&(c=l.return)&&c.call(l)}finally{if(s)throw s.error}}this.styles=null}return e}()})),r=e(((e,t,n)=>{var r=n&&n.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractDOMAdaptor=void 0,e.AbstractDOMAdaptor=function(){function e(e){e===void 0&&(e=null),this.document=e}return e.prototype.node=function(e,t,n,i){var a,o;t===void 0&&(t={}),n===void 0&&(n=[]);var s=this.create(e,i);this.setAttributes(s,t);try{for(var c=r(n),l=c.next();!l.done;l=c.next()){var u=l.value;this.append(s,u)}}catch(e){a={error:e}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(a)throw a.error}}return s},e.prototype.setAttributes=function(e,t){var n,i,a,o,s,c;if(t.style&&typeof t.style!=`string`)try{for(var l=r(Object.keys(t.style)),u=l.next();!u.done;u=l.next()){var d=u.value;this.setStyle(e,d.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()}),t.style[d])}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}if(t.properties)try{for(var f=r(Object.keys(t.properties)),p=f.next();!p.done;p=f.next()){var d=p.value;e[d]=t.properties[d]}}catch(e){a={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}try{for(var m=r(Object.keys(t)),h=m.next();!h.done;h=m.next()){var d=h.value;(d!==`style`||typeof t.style==`string`)&&d!==`properties`&&this.setAttribute(e,d,t[d])}}catch(e){s={error:e}}finally{try{h&&!h.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}},e.prototype.replace=function(e,t){return this.insert(e,t),this.remove(t),t},e.prototype.childNode=function(e,t){return this.childNodes(e)[t]},e.prototype.allClasses=function(e){var t=this.getAttribute(e,`class`);return t?t.replace(/ +/g,` `).replace(/^ /,``).replace(/ $/,``).split(/ /):[]},e}()})),i=e(((e,t,n)=>{var r=n&&n.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},i=n&&n.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},a=n&&n.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(e,"__esModule",{value:!0}),e.lookup=e.separateOptions=e.selectOptionsFromKeys=e.selectOptions=e.userOptions=e.defaultOptions=e.insert=e.copy=e.keys=e.makeArray=e.expandable=e.Expandable=e.OPTIONS=e.REMOVE=e.APPEND=e.isObject=void 0;var o={}.constructor;function s(e){return typeof e==`object`&&!!e&&(e.constructor===o||e.constructor===c)}e.isObject=s,e.APPEND=`[+]`,e.REMOVE=`[-]`,e.OPTIONS={invalidOption:`warn`,optionError:function(t,n){if(e.OPTIONS.invalidOption===`fatal`)throw Error(t);console.warn(`MathJax: `+t)}};var c=function(){function e(){}return e}();e.Expandable=c;function l(e){return Object.assign(Object.create(c.prototype),e)}e.expandable=l,e.makeArray=function(e){return Array.isArray(e)?e:[e]};function u(e){return e?Object.keys(e).concat(Object.getOwnPropertySymbols(e)):[]}e.keys=u;function d(e){var t,n,i={};try{for(var a=r(u(e)),o=a.next();!o.done;o=a.next()){var p=o.value,m=Object.getOwnPropertyDescriptor(e,p),h=m.value;Array.isArray(h)?m.value=f([],h,!1):s(h)&&(m.value=d(h)),m.enumerable&&(i[p]=m)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return Object.defineProperties(e.constructor===c?l({}):{},i)}e.copy=d;function f(t,n,o){var l,p;o===void 0&&(o=!0);var m=function(r){if(o&&t[r]===void 0&&t.constructor!==c)return typeof r==`symbol`&&(r=r.toString()),e.OPTIONS.optionError(`Invalid option "${r}" (no default value).`,r),`continue`;var l=n[r],p=t[r];if(s(l)&&p!==null&&(typeof p==`object`||typeof p==`function`)){var m=u(l);Array.isArray(p)&&(m.length===1&&(m[0]===e.APPEND||m[0]===e.REMOVE)&&Array.isArray(l[m[0]])||m.length===2&&m.sort().join(`,`)===e.APPEND+`,`+e.REMOVE&&Array.isArray(l[e.APPEND])&&Array.isArray(l[e.REMOVE]))?(l[e.REMOVE]&&(p=t[r]=p.filter(function(t){return l[e.REMOVE].indexOf(t)<0})),l[e.APPEND]&&(t[r]=a(a([],i(p),!1),i(l[e.APPEND]),!1))):f(p,l,o)}else Array.isArray(l)?(t[r]=[],f(t[r],l,!1)):s(l)?t[r]=d(l):t[r]=l};try{for(var h=r(u(n)),g=h.next();!g.done;g=h.next())m(g.value)}catch(e){l={error:e}}finally{try{g&&!g.done&&(p=h.return)&&p.call(h)}finally{if(l)throw l.error}}return t}e.insert=f,e.defaultOptions=function(e){return[...arguments].slice(1).forEach(function(t){return f(e,t,!1)}),e},e.userOptions=function(e){return[...arguments].slice(1).forEach(function(t){return f(e,t,!0)}),e};function p(e){var t,n,i=[...arguments].slice(1),a={};try{for(var o=r(i),s=o.next();!s.done;s=o.next()){var c=s.value;e.hasOwnProperty(c)&&(a[c]=e[c])}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a}e.selectOptions=p,e.selectOptionsFromKeys=function(e,t){return p.apply(void 0,a([e],i(Object.keys(t)),!1))},e.separateOptions=function(e){var t,n,i,a,o=[...arguments].slice(1),s=[];try{for(var c=r(o),l=c.next();!l.done;l=c.next()){var u=l.value,d={},f={};try{for(var p=(i=void 0,r(Object.keys(e||{}))),m=p.next();!m.done;m=p.next()){var h=m.value;(u[h]===void 0?f:d)[h]=e[h]}}catch(e){i={error:e}}finally{try{m&&!m.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}s.push(d),e=f}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return s.unshift(e),s},e.lookup=function(e,t,n){return n===void 0&&(n=null),t.hasOwnProperty(e)?t[e]:n}})),a=e(((e,t,n)=>{var r=n&&n.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),a=n&&n.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.NodeMixin=e.NodeMixinOptions=void 0;var o=i();e.NodeMixinOptions={badCSS:!0,badSizes:!0},e.NodeMixin=function(t,n){var i;return n===void 0&&(n={}),n=(0,o.userOptions)((0,o.defaultOptions)({},e.NodeMixinOptions),n),i=function(e){r(t,e);function t(){var t=[...arguments],n=e.call(this,t[0])||this,r=n.constructor;return n.options=(0,o.userOptions)((0,o.defaultOptions)({},r.OPTIONS),t[1]),n}return t.prototype.fontSize=function(t){return n.badCSS?this.options.fontSize:e.prototype.fontSize.call(this,t)},t.prototype.fontFamily=function(t){return n.badCSS?this.options.fontFamily:e.prototype.fontFamily.call(this,t)},t.prototype.nodeSize=function(r,i,a){if(i===void 0&&(i=1),a===void 0&&(a=null),!n.badSizes)return e.prototype.nodeSize.call(this,r,i,a);var o=this.textContent(r),s=Array.from(o.replace(t.cjkPattern,``)).length;return[(Array.from(o).length-s)*this.options.cjkCharWidth+s*this.options.unknownCharWidth,this.options.unknownCharHeight]},t.prototype.nodeBBox=function(t){return n.badSizes?{left:0,right:0,top:0,bottom:0}:e.prototype.nodeBBox.call(this,t)},t}(t),i.OPTIONS=a(a({},n.badCSS?{fontSize:16,fontFamily:`Times`}:{}),n.badSizes?{cjkCharWidth:1,unknownCharWidth:.6,unknownCharHeight:.8}:{}),i.cjkPattern=RegExp(`[ᄀ-ᅟ〈〉⺀-〾぀-㉇㉐-䶿一-꓆ꥠ-ꥼ가-힣豈-﫿︐-︙︰-﹫!-⦆¢-₩𛀀-𛀁🈀-🉑𠀀-𿿽]`,`gu`),i}})),o=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LiteDocument=void 0;var t=n();e.LiteDocument=function(){function e(){this.root=new t.LiteElement(`html`,{},[this.head=new t.LiteElement(`head`),this.body=new t.LiteElement(`body`)]),this.type=``}return Object.defineProperty(e.prototype,"kind",{get:function(){return`#document`},enumerable:!1,configurable:!0}),e}()})),s=e(((e,t,n)=>{var r=n&&n.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.LiteComment=e.LiteText=void 0;var i=function(){function e(e){e===void 0&&(e=``),this.value=e}return Object.defineProperty(e.prototype,"kind",{get:function(){return`#text`},enumerable:!1,configurable:!0}),e}();e.LiteText=i,e.LiteComment=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"kind",{get:function(){return`#comment`},enumerable:!1,configurable:!0}),t}(i)})),c=e(((e,t,n)=>{var r=n&&n.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},i=n&&n.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(e,"__esModule",{value:!0}),e.LiteList=void 0,e.LiteList=function(){function e(e){this.nodes=[],this.nodes=i([],r(e),!1)}return e.prototype.append=function(e){this.nodes.push(e)},e.prototype[Symbol.iterator]=function(){var e=0;return{next:function(){return e===this.nodes.length?{value:null,done:!0}:{value:this.nodes[e++],done:!1}}}},e}()})),l=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.retryAfter=e.handleRetriesFor=void 0,e.handleRetriesFor=function(e){return new Promise(function t(n,r){try{n(e())}catch(e){e.retry&&e.retry instanceof Promise?e.retry.then(function(){return t(n,r)}).catch(function(e){return r(e)}):e.restart&&e.restart.isCallback?MathJax.Callback.After(function(){return t(n,r)},e.restart):r(e)}})},e.retryAfter=function(e){var t=Error(`MathJax retry`);throw t.retry=e,t}})),u=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION=`3.2.2`})),d=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PrioritizedList=void 0,e.PrioritizedList=function(){function e(){this.items=[],this.items=[]}return e.prototype[Symbol.iterator]=function(){var e=0,t=this.items;return{next:function(){return{value:t[e++],done:e>t.length}}}},e.prototype.add=function(t,n){n===void 0&&(n=e.DEFAULTPRIORITY);var r=this.items.length;do r--;while(r>=0&&n<this.items[r].priority);return this.items.splice(r+1,0,{item:t,priority:n}),t},e.prototype.remove=function(e){var t=this.items.length;do t--;while(t>=0&&this.items[t].item!==e);t>=0&&this.items.splice(t,1)},e.DEFAULTPRIORITY=5,e}()})),f=e(((e,t,n)=>{var r=n&&n.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=n&&n.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.HandlerList=void 0,e.HandlerList=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.register=function(e){return this.add(e,e.priority)},t.prototype.unregister=function(e){this.remove(e)},t.prototype.handlesDocument=function(e){var t,n;try{for(var r=i(this),a=r.next();!a.done;a=r.next()){var o=a.value.item;if(o.handlesDocument(e))return o}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}throw Error(`Can't find handler for document`)},t.prototype.document=function(e,t){return t===void 0&&(t=null),this.handlesDocument(e).create(e,t)},t}(d().PrioritizedList)})),p=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mathjax=void 0;var t=u(),n=f(),r=l();e.mathjax={version:t.VERSION,handlers:new n.HandlerList,document:function(t,n){return e.mathjax.handlers.document(t,n)},handleRetriesFor:r.handleRetriesFor,retryAfter:r.retryAfter,asyncLoad:null}})),m=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.asyncLoad=void 0;var t=p();e.asyncLoad=function(e){return t.mathjax.asyncLoad?new Promise(function(n,r){var i=t.mathjax.asyncLoad(e);i instanceof Promise?i.then(function(e){return n(e)}).catch(function(e){return r(e)}):n(i)}):Promise.reject(`Can't load '${e}': No asyncLoad method specified`)}})),h=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.numeric=e.translate=e.remove=e.add=e.entities=e.options=void 0;var t=l(),n=m();e.options={loadMissingEntities:!0},e.entities={ApplyFunction:`⁡`,Backslash:`∖`,Because:`∵`,Breve:`˘`,Cap:`⋒`,CenterDot:`·`,CircleDot:`⊙`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,Congruent:`≡`,ContourIntegral:`∮`,Coproduct:`∐`,Cross:`⨯`,Cup:`⋓`,CupCap:`≍`,Dagger:`‡`,Del:`∇`,Delta:`Δ`,Diamond:`⋄`,DifferentialD:`ⅆ`,DotEqual:`≐`,DoubleDot:`¨`,DoubleRightTee:`⊨`,DoubleVerticalBar:`∥`,DownArrow:`↓`,DownLeftVector:`↽`,DownRightVector:`⇁`,DownTee:`⊤`,Downarrow:`⇓`,Element:`∈`,EqualTilde:`≂`,Equilibrium:`⇌`,Exists:`∃`,ExponentialE:`ⅇ`,FilledVerySmallSquare:`▪`,ForAll:`∀`,Gamma:`Γ`,Gg:`⋙`,GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Hacek:`ˇ`,Hat:`^`,HumpDownHump:`≎`,HumpEqual:`≏`,Im:`ℑ`,ImaginaryI:`ⅈ`,Integral:`∫`,Intersection:`⋂`,InvisibleComma:`⁣`,InvisibleTimes:`⁢`,Lambda:`Λ`,Larr:`↞`,LeftAngleBracket:`⟨`,LeftArrow:`←`,LeftArrowRightArrow:`⇆`,LeftCeiling:`⌈`,LeftDownVector:`⇃`,LeftFloor:`⌊`,LeftRightArrow:`↔`,LeftTee:`⊣`,LeftTriangle:`⊲`,LeftTriangleEqual:`⊴`,LeftUpVector:`↿`,LeftVector:`↼`,Leftarrow:`⇐`,Leftrightarrow:`⇔`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,LessSlantEqual:`⩽`,LessTilde:`≲`,Ll:`⋘`,Lleftarrow:`⇚`,LongLeftArrow:`⟵`,LongLeftRightArrow:`⟷`,LongRightArrow:`⟶`,Longleftarrow:`⟸`,Longleftrightarrow:`⟺`,Longrightarrow:`⟹`,Lsh:`↰`,MinusPlus:`∓`,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotLeftTriangle:`⋪`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotPrecedes:`⊀`,NotPrecedesSlantEqual:`⋠`,NotRightTriangle:`⋫`,NotRightTriangleEqual:`⋭`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsSlantEqual:`⋡`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotVerticalBar:`∤`,Omega:`Ω`,OverBar:`‾`,OverBrace:`⏞`,PartialD:`∂`,Phi:`Φ`,Pi:`Π`,PlusMinus:`±`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,Product:`∏`,Proportional:`∝`,Psi:`Ψ`,Rarr:`↠`,Re:`ℜ`,ReverseEquilibrium:`⇋`,RightAngleBracket:`⟩`,RightArrow:`→`,RightArrowLeftArrow:`⇄`,RightCeiling:`⌉`,RightDownVector:`⇂`,RightFloor:`⌋`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTriangle:`⊳`,RightTriangleEqual:`⊵`,RightUpVector:`↾`,RightVector:`⇀`,Rightarrow:`⇒`,Rrightarrow:`⇛`,Rsh:`↱`,Sigma:`Σ`,SmallCircle:`∘`,Sqrt:`√`,Square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,Star:`⋆`,Subset:`⋐`,SubsetEqual:`⊆`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,SuchThat:`∋`,Sum:`∑`,Superset:`⊃`,SupersetEqual:`⊇`,Supset:`⋑`,Therefore:`∴`,Theta:`Θ`,Tilde:`∼`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,UnderBar:`_`,UnderBrace:`⏟`,Union:`⋃`,UnionPlus:`⊎`,UpArrow:`↑`,UpDownArrow:`↕`,UpTee:`⊥`,Uparrow:`⇑`,Updownarrow:`⇕`,Upsilon:`Υ`,Vdash:`⊩`,Vee:`⋁`,VerticalBar:`∣`,VerticalTilde:`≀`,Vvdash:`⊪`,Wedge:`⋀`,Xi:`Ξ`,amp:`&`,acute:`´`,aleph:`ℵ`,alpha:`α`,amalg:`⨿`,and:`∧`,ang:`∠`,angmsd:`∡`,angsph:`∢`,ape:`≊`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,beta:`β`,beth:`ℶ`,between:`≬`,bigcirc:`◯`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,blacklozenge:`⧫`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,bowtie:`⋈`,boxdl:`┐`,boxdr:`┌`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxul:`┘`,boxur:`└`,bsol:`\\`,bull:`•`,cap:`∩`,check:`✓`,chi:`χ`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledR:`®`,circledS:`Ⓢ`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,clubs:`♣`,colon:`:`,comp:`∁`,ctdot:`⋯`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cup:`∪`,curarr:`↷`,curlyvee:`⋎`,curlywedge:`⋏`,dagger:`†`,daleth:`ℸ`,ddarr:`⇊`,deg:`°`,delta:`δ`,digamma:`ϝ`,div:`÷`,divideontimes:`⋇`,dot:`˙`,doteqdot:`≑`,dotplus:`∔`,dotsquare:`⊡`,dtdot:`⋱`,ecir:`≖`,efDot:`≒`,egs:`⪖`,ell:`ℓ`,els:`⪕`,empty:`∅`,epsi:`ε`,epsiv:`ϵ`,erDot:`≓`,eta:`η`,eth:`ð`,flat:`♭`,fork:`⋔`,frown:`⌢`,gEl:`⪌`,gamma:`γ`,gap:`⪆`,gimel:`ℷ`,gnE:`≩`,gnap:`⪊`,gne:`⪈`,gnsim:`⋧`,gt:`>`,gtdot:`⋗`,harrw:`↭`,hbar:`ℏ`,hellip:`…`,hookleftarrow:`↩`,hookrightarrow:`↪`,imath:`ı`,infin:`∞`,intcal:`⊺`,iota:`ι`,jmath:`ȷ`,kappa:`κ`,kappav:`ϰ`,lEg:`⪋`,lambda:`λ`,lap:`⪅`,larrlp:`↫`,larrtl:`↢`,lbrace:`{`,lbrack:`[`,le:`≤`,leftleftarrows:`⇇`,leftthreetimes:`⋋`,lessdot:`⋖`,lmoust:`⎰`,lnE:`≨`,lnap:`⪉`,lne:`⪇`,lnsim:`⋦`,longmapsto:`⟼`,looparrowright:`↬`,lowast:`∗`,loz:`◊`,lt:`<`,ltimes:`⋉`,ltri:`◃`,macr:`¯`,malt:`✠`,mho:`℧`,mu:`μ`,multimap:`⊸`,nLeftarrow:`⇍`,nLeftrightarrow:`⇎`,nRightarrow:`⇏`,nVDash:`⊯`,nVdash:`⊮`,natur:`♮`,nearr:`↗`,nharr:`↮`,nlarr:`↚`,not:`¬`,nrarr:`↛`,nu:`ν`,nvDash:`⊭`,nvdash:`⊬`,nwarr:`↖`,omega:`ω`,omicron:`ο`,or:`∨`,osol:`⊘`,period:`.`,phi:`φ`,phiv:`ϕ`,pi:`π`,piv:`ϖ`,prap:`⪷`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,prime:`′`,psi:`ψ`,quot:`"`,rarrtl:`↣`,rbrace:`}`,rbrack:`]`,rho:`ρ`,rhov:`ϱ`,rightrightarrows:`⇉`,rightthreetimes:`⋌`,ring:`˚`,rmoust:`⎱`,rtimes:`⋊`,rtri:`▹`,scap:`⪸`,scnE:`⪶`,scnap:`⪺`,scnsim:`⋩`,sdot:`⋅`,searr:`↘`,sect:`§`,sharp:`♯`,sigma:`σ`,sigmav:`ς`,simne:`≆`,smile:`⌣`,spades:`♠`,sub:`⊂`,subE:`⫅`,subnE:`⫋`,subne:`⊊`,supE:`⫆`,supnE:`⫌`,supne:`⊋`,swarr:`↙`,tau:`τ`,theta:`θ`,thetav:`ϑ`,tilde:`˜`,times:`×`,triangle:`▵`,triangleq:`≜`,upsi:`υ`,upuparrows:`⇈`,veebar:`⊻`,vellip:`⋮`,weierp:`℘`,xi:`ξ`,yen:`¥`,zeta:`ζ`,zigrarr:`⇝`,nbsp:`\xA0`,rsquo:`’`,lsquo:`‘`};var r={};e.add=function(t,n){Object.assign(e.entities,t),r[n]=!0},e.remove=function(t){delete e.entities[t]},e.translate=function(e){return e.replace(/&([a-z][a-z0-9]*|#(?:[0-9]+|x[0-9a-f]+));/gi,i)};function i(i,o){if(o.charAt(0)===`#`)return a(o.slice(1));if(e.entities[o])return e.entities[o];if(e.options.loadMissingEntities){var s=o.match(/^[a-zA-Z](fr|scr|opf)$/)?RegExp.$1:o.charAt(0).toLowerCase();r[s]||(r[s]=!0,(0,t.retryAfter)((0,n.asyncLoad)(`./util/entities/`+s+`.js`)))}return i}function a(e){var t=e.charAt(0)===`x`?parseInt(e.slice(1),16):parseInt(e);return String.fromCodePoint(t)}e.numeric=a})),g=e(((e,t,r)=>{var i=r&&r.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),a=r&&r.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),o=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return a(t,e),t},c=r&&r.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},l=r&&r.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};Object.defineProperty(e,"__esModule",{value:!0}),e.LiteParser=e.PATTERNS=void 0;var u=o(h()),d=n(),f=s(),p;(function(e){e.TAGNAME=`[a-z][^\\s\\n>]*`,e.ATTNAME=`[a-z][^\\s\\n>=]*`,e.VALUE=`(?:'[^']*'|"[^"]*"|[^\\s\\n]+)`,e.VALUESPLIT=`(?:'([^']*)'|"([^"]*)"|([^\\s\\n]+))`,e.SPACE=`(?:\\s|\\n)+`,e.OPTIONALSPACE=`(?:\\s|\\n)*`,e.ATTRIBUTE=e.ATTNAME+`(?:`+e.OPTIONALSPACE+`=`+e.OPTIONALSPACE+e.VALUE+`)?`,e.ATTRIBUTESPLIT=`(`+e.ATTNAME+`)(?:`+e.OPTIONALSPACE+`=`+e.OPTIONALSPACE+e.VALUESPLIT+`)?`,e.TAG=`(<(?:`+e.TAGNAME+`(?:`+e.SPACE+e.ATTRIBUTE+`)*`+e.OPTIONALSPACE+`/?|/`+e.TAGNAME+`|!--[^]*?--|![^]*?)(?:>|$))`,e.tag=new RegExp(e.TAG,`i`),e.attr=new RegExp(e.ATTRIBUTE,`i`),e.attrsplit=new RegExp(e.ATTRIBUTESPLIT,`i`)})(p=e.PATTERNS||={}),e.LiteParser=function(){function e(){}return e.prototype.parseFromString=function(e,t,n){t===void 0&&(t=`text/html`),n===void 0&&(n=null);for(var r=n.createDocument(),i=n.body(r),a=e.replace(/<\?.*?\?>/g,``).split(p.tag);a.length;){var o=a.shift(),s=a.shift();o&&this.addText(n,i,o),s&&s.charAt(s.length-1)===`>`&&(s.charAt(1)===`!`?this.addComment(n,i,s):i=s.charAt(1)===`/`?this.closeTag(n,i,s):this.openTag(n,i,s,a))}return this.checkDocument(n,r),r},e.prototype.addText=function(e,t,n){return n=u.translate(n),e.append(t,e.text(n))},e.prototype.addComment=function(e,t,n){return e.append(t,new f.LiteComment(n))},e.prototype.closeTag=function(e,t,n){for(var r=n.slice(2,n.length-1).toLowerCase();e.parent(t)&&e.kind(t)!==r;)t=e.parent(t);return e.parent(t)},e.prototype.openTag=function(e,t,n,r){var i=this.constructor.PCDATA,a=this.constructor.SELF_CLOSING,o=n.match(/<(.*?)[\s\n>\/]/)[1].toLowerCase(),s=e.node(o),c=n.replace(/^<.*?[\s\n>]/,``).split(p.attrsplit);return(c.pop().match(/>$/)||c.length<5)&&(this.addAttributes(e,s,c),e.append(t,s),!a[o]&&!n.match(/\/>$/)&&(i[o]?this.handlePCDATA(e,s,o,r):t=s)),t},e.prototype.addAttributes=function(e,t,n){for(var r=this.constructor.CDATA_ATTR;n.length;){var i=c(n.splice(0,5),5),a=i[1],o=i[2],s=i[3],l=i[4],d=o||s||l||``;r[a]||(d=u.translate(d)),e.setAttribute(t,a,d)}},e.prototype.handlePCDATA=function(e,t,n,r){for(var i=[],a=`</`+n+`>`,o=``;r.length&&o!==a;)i.push(o),i.push(r.shift()),o=r.shift();e.append(t,e.text(i.join(``)))},e.prototype.checkDocument=function(e,t){var n,r,i,a,o=this.getOnlyChild(e,e.body(t));if(o){try{for(var s=l(e.childNodes(e.body(t))),c=s.next();!c.done;c=s.next()){var u=c.value;if(u===o)break;u instanceof f.LiteComment&&u.value.match(/^<!DOCTYPE/)&&(t.type=u.value)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}switch(e.kind(o)){case`html`:try{for(var d=l(o.children),p=d.next();!p.done;p=d.next()){var u=p.value;switch(e.kind(u)){case`head`:t.head=u;break;case`body`:t.body=u}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}t.root=o,e.remove(o),e.parent(t.body)!==o&&e.append(o,t.body),e.parent(t.head)!==o&&e.insert(t.head,t.body);break;case`head`:t.head=e.replace(o,t.head);break;case`body`:t.body=e.replace(o,t.body)}}},e.prototype.getOnlyChild=function(e,t){var n,r,i=null;try{for(var a=l(e.childNodes(t)),o=a.next();!o.done;o=a.next()){var s=o.value;if(s instanceof d.LiteElement){if(i)return null;i=s}}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.prototype.serialize=function(e,t,n){var r=this;n===void 0&&(n=!1);var i=this.constructor.SELF_CLOSING,a=this.constructor.CDATA_ATTR,o=e.kind(t),s=e.allAttributes(t).map(function(e){return e.name+`="`+(a[e.name]?e.value:r.protectAttribute(e.value))+`"`}).join(` `),c=this.serializeInner(e,t,n);return`<`+o+(s?` `+s:``)+((!n||c)&&!i[o]?`>${c}</${o}>`:n?`/>`:`>`)},e.prototype.serializeInner=function(e,t,n){var r=this;return n===void 0&&(n=!1),this.constructor.PCDATA.hasOwnProperty(t.kind)?e.childNodes(t).map(function(t){return e.value(t)}).join(``):e.childNodes(t).map(function(t){var i=e.kind(t);return i===`#text`?r.protectHTML(e.value(t)):i===`#comment`?t.value:r.serialize(e,t,n)}).join(``)},e.prototype.protectAttribute=function(e){return typeof e!=`string`&&(e=String(e)),e.replace(/"/g,`&quot;`)},e.prototype.protectHTML=function(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)},e.SELF_CLOSING={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,menuitem:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},e.PCDATA={option:!0,textarea:!0,fieldset:!0,title:!0,style:!0,script:!0},e.CDATA_ATTR={style:!0,datafld:!0,datasrc:!0,href:!0,src:!0,longdesc:!0,usemap:!0,cite:!0,datetime:!0,action:!0,axis:!0,profile:!0,content:!0,scheme:!0},e}()})),_=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LiteWindow=void 0;var t=n(),r=o(),i=c(),a=g();e.LiteWindow=function(){function e(){this.DOMParser=a.LiteParser,this.NodeList=i.LiteList,this.HTMLCollection=i.LiteList,this.HTMLElement=t.LiteElement,this.DocumentFragment=i.LiteList,this.Document=r.LiteDocument,this.document=new r.LiteDocument}return e}()})),v=e(((e,t,n)=>{var r=n&&n.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},i=n&&n.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},a=n&&n.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(e,"__esModule",{value:!0}),e.Styles=void 0;var o=[`top`,`right`,`bottom`,`left`],s=[`width`,`style`,`color`];function c(e){for(var t=e.split(/((?:'[^']*'|"[^"]*"|,[\s\n]|[^\s\n])*)/g),n=[];t.length>1;)t.shift(),n.push(t.shift());return n}function l(e){var t,n,i=c(this.styles[e]);i.length===0&&i.push(``),i.length===1&&i.push(i[0]),i.length===2&&i.push(i[0]),i.length===3&&i.push(i[1]);try{for(var a=r(b.connect[e].children),o=a.next();!o.done;o=a.next()){var s=o.value;this.setStyle(this.childName(e,s),i.shift())}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}function u(e){var t,n,i=b.connect[e].children,a=[];try{for(var o=r(i),s=o.next();!s.done;s=o.next()){var c=s.value,l=this.styles[e+`-`+c];if(!l){delete this.styles[e];return}a.push(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}a[3]===a[1]&&(a.pop(),a[2]===a[0]&&(a.pop(),a[1]===a[0]&&a.pop())),this.styles[e]=a.join(` `)}function d(e){var t,n;try{for(var i=r(b.connect[e].children),a=i.next();!a.done;a=i.next()){var o=a.value;this.setStyle(this.childName(e,o),this.styles[e])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}}function f(e){var t,n,o=a([],i(b.connect[e].children),!1),s=this.styles[this.childName(e,o.shift())];try{for(var c=r(o),l=c.next();!l.done;l=c.next()){var u=l.value;if(this.styles[this.childName(e,u)]!==s){delete this.styles[e];return}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}this.styles[e]=s}var p={width:/^(?:[\d.]+(?:[a-z]+)|thin|medium|thick|inherit|initial|unset)$/,style:/^(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|inherit|initial|unset)$/};function m(e){var t,n,i,a,o={width:``,style:``,color:``};try{for(var s=r(c(this.styles[e])),l=s.next();!l.done;l=s.next()){var u=l.value;u.match(p.width)&&o.width===``?o.width=u:u.match(p.style)&&o.style===``?o.style=u:o.color=u}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}try{for(var d=r(b.connect[e].children),f=d.next();!f.done;f=d.next()){var m=f.value;this.setStyle(this.childName(e,m),o[m])}}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}}function h(e){var t,n,i=[];try{for(var a=r(b.connect[e].children),o=a.next();!o.done;o=a.next()){var s=o.value,c=this.styles[this.childName(e,s)];c&&i.push(c)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}i.length?this.styles[e]=i.join(` `):delete this.styles[e]}var g={style:/^(?:normal|italic|oblique|inherit|initial|unset)$/,variant:RegExp(`^(?:normal|none|inherit|initial|unset|common-ligatures|no-common-ligatures|discretionary-ligatures|no-discretionary-ligatures|historical-ligatures|no-historical-ligatures|contextual|no-contextual|(?:stylistic|character-variant|swash|ornaments|annotation)\\([^)]*\\)|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|ordinal|slashed-zero|jis78|jis83|jis90|jis04|simplified|traditional|full-width|proportional-width|ruby)$`),weight:/^(?:normal|bold|bolder|lighter|[1-9]00|inherit|initial|unset)$/,stretch:RegExp(`^(?:normal|(?:(?:ultra|extra|semi)-)?condensed|(?:(?:semi|extra|ulta)-)?expanded|inherit|initial|unset)$`),size:RegExp(`^(?:xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller|[d.]+%|[d.]+[a-z]+|inherit|initial|unset)(?:/(?:normal|[d.+](?:%|[a-z]+)?))?$`)};function _(e){var t,n,a,o,s=c(this.styles[e]),l={style:``,variant:[],weight:``,stretch:``,size:``,family:``,"line-height":``};try{for(var u=r(s),d=u.next();!d.done;d=u.next()){var f=d.value;l.family=f;try{for(var p=(a=void 0,r(Object.keys(g))),m=p.next();!m.done;m=p.next()){var h=m.value;if((Array.isArray(l[h])||l[h]===``)&&f.match(g[h])){if(h===`size`){var _=i(f.split(/\//),2),y=_[0],b=_[1];l[h]=y,b&&(l[`line-height`]=b)}else l.size===``&&(Array.isArray(l[h])?l[h].push(f):l[h]=f)}}}catch(e){a={error:e}}finally{try{m&&!m.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}}}catch(e){t={error:e}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}v(e,l),delete this.styles[e]}function v(e,t){var n,i;try{for(var a=r(b.connect[e].children),o=a.next();!o.done;o=a.next()){var s=o.value,c=this.childName(e,s);if(Array.isArray(t[s])){var l=t[s];l.length&&(this.styles[c]=l.join(` `))}else t[s]!==``&&(this.styles[c]=t[s])}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}}function y(e){}var b=function(){function e(e){e===void 0&&(e=``),this.parse(e)}return Object.defineProperty(e.prototype,"cssText",{get:function(){var e,t,n=[];try{for(var i=r(Object.keys(this.styles)),a=i.next();!a.done;a=i.next()){var o=a.value,s=this.parentName(o);this.styles[s]||n.push(o+`: `+this.styles[o]+`;`)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n.join(` `)},enumerable:!1,configurable:!0}),e.prototype.set=function(t,n){for(t=this.normalizeName(t),this.setStyle(t,n),e.connect[t]&&!e.connect[t].combine&&(this.combineChildren(t),delete this.styles[t]);t.match(/-/)&&(t=this.parentName(t),e.connect[t]);)e.connect[t].combine.call(this,t)},e.prototype.get=function(e){return e=this.normalizeName(e),this.styles.hasOwnProperty(e)?this.styles[e]:``},e.prototype.setStyle=function(t,n){this.styles[t]=n,e.connect[t]&&e.connect[t].children&&e.connect[t].split.call(this,t),n===``&&delete this.styles[t]},e.prototype.combineChildren=function(t){var n,i,a=this.parentName(t);try{for(var o=r(e.connect[t].children),s=o.next();!s.done;s=o.next()){var c=s.value,l=this.childName(a,c);e.connect[l].combine.call(this,l)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.prototype.parentName=function(e){var t=e.replace(/-[^-]*$/,``);return e===t?``:t},e.prototype.childName=function(t,n){return n.match(/-/)?n:(e.connect[t]&&!e.connect[t].combine&&(n+=t.replace(/.*-/,`-`),t=this.parentName(t)),t+`-`+n)},e.prototype.normalizeName=function(e){return e.replace(/[A-Z]/g,function(e){return`-`+e.toLowerCase()})},e.prototype.parse=function(e){e===void 0&&(e=``);var t=this.constructor.pattern;this.styles={};for(var n=e.replace(t.comment,``).split(t.style);n.length>1;){var r=i(n.splice(0,3),3),a=r[0],o=r[1],s=r[2];if(a.match(/[^\s\n]/))return;this.set(o,s)}},e.pattern={style:/([-a-z]+)[\s\n]*:[\s\n]*((?:'[^']*'|"[^"]*"|\n|.)*?)[\s\n]*(?:;|$)/g,comment:/\/\*[^]*?\*\//g},e.connect={padding:{children:o,split:l,combine:u},border:{children:o,split:d,combine:f},"border-top":{children:s,split:m,combine:h},"border-right":{children:s,split:m,combine:h},"border-bottom":{children:s,split:m,combine:h},"border-left":{children:s,split:m,combine:h},"border-width":{children:o,split:l,combine:null},"border-style":{children:o,split:l,combine:null},"border-color":{children:o,split:l,combine:null},font:{children:[`style`,`variant`,`weight`,`stretch`,`line-height`,`size`,`family`],split:_,combine:y}},e}();e.Styles=b})),y=e(((e,t,i)=>{var c=i&&i.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),l=i&&i.__assign||function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},l.apply(this,arguments)},u=i&&i.__values||function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},d=i&&i.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},f=i&&i.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(e,"__esModule",{value:!0}),e.liteAdaptor=e.LiteAdaptor=e.LiteBase=void 0;var p=r(),m=a(),h=o(),y=n(),b=s(),x=_(),S=g(),C=v(),w=function(e){c(t,e);function t(){var t=e.call(this)||this;return t.parser=new S.LiteParser,t.window=new x.LiteWindow,t}return t.prototype.parse=function(e,t){return this.parser.parseFromString(e,t,this)},t.prototype.create=function(e,t){return t===void 0&&(t=null),new y.LiteElement(e)},t.prototype.text=function(e){return new b.LiteText(e)},t.prototype.comment=function(e){return new b.LiteComment(e)},t.prototype.createDocument=function(){return new h.LiteDocument},t.prototype.head=function(e){return e.head},t.prototype.body=function(e){return e.body},t.prototype.root=function(e){return e.root},t.prototype.doctype=function(e){return e.type},t.prototype.tags=function(e,t,n){n===void 0&&(n=null);var r=[],i=[];if(n)return i;for(var a=e;a;){var o=a.kind;o!==`#text`&&o!==`#comment`&&(a=a,o===t&&i.push(a),a.children.length&&(r=a.children.concat(r))),a=r.shift()}return i},t.prototype.elementById=function(e,t){for(var n=[],r=e;r;){if(r.kind!==`#text`&&r.kind!==`#comment`){if(r=r,r.attributes.id===t)return r;r.children.length&&(n=r.children.concat(n))}r=n.shift()}return null},t.prototype.elementsByClass=function(e,t){for(var n=[],r=[],i=e;i;)i.kind!==`#text`&&i.kind!==`#comment`&&(i=i,(i.attributes.class||``).trim().split(/ +/).includes(t)&&r.push(i),i.children.length&&(n=i.children.concat(n))),i=n.shift();return r},t.prototype.getElements=function(e,t){var n,r,i=[],a=this.body(t);try{for(var o=u(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(typeof c==`string`){if(c.charAt(0)===`#`){var l=this.elementById(a,c.slice(1));l&&i.push(l)}else c.charAt(0)===`.`?i=i.concat(this.elementsByClass(a,c.slice(1))):c.match(/^[-a-z][-a-z0-9]*$/i)&&(i=i.concat(this.tags(a,c)))}else Array.isArray(c)?i=i.concat(c):c instanceof this.window.NodeList||c instanceof this.window.HTMLCollection?i=i.concat(c.nodes):i.push(c)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},t.prototype.contains=function(e,t){for(;t&&t!==e;)t=this.parent(t);return!!t},t.prototype.parent=function(e){return e.parent},t.prototype.childIndex=function(e){return e.parent?e.parent.children.findIndex(function(t){return t===e}):-1},t.prototype.append=function(e,t){return t.parent&&this.remove(t),e.children.push(t),t.parent=e,t},t.prototype.insert=function(e,t){if(e.parent&&this.remove(e),t&&t.parent){var n=this.childIndex(t);t.parent.children.splice(n,0,e),e.parent=t.parent}},t.prototype.remove=function(e){var t=this.childIndex(e);return t>=0&&e.parent.children.splice(t,1),e.parent=null,e},t.prototype.replace=function(e,t){var n=this.childIndex(t);return n>=0&&(t.parent.children[n]=e,e.parent=t.parent,t.parent=null),t},t.prototype.clone=function(e){var t=this,n=new y.LiteElement(e.kind);return n.attributes=l({},e.attributes),n.children=e.children.map(function(e){if(e.kind===`#text`)return new b.LiteText(e.value);if(e.kind===`#comment`)return new b.LiteComment(e.value);var r=t.clone(e);return r.parent=n,r}),n},t.prototype.split=function(e,t){var n=new b.LiteText(e.value.slice(t));return e.value=e.value.slice(0,t),e.parent.children.splice(this.childIndex(e)+1,0,n),n.parent=e.parent,n},t.prototype.next=function(e){var t=e.parent;if(!t)return null;var n=this.childIndex(e)+1;return n>=0&&n<t.children.length?t.children[n]:null},t.prototype.previous=function(e){var t=e.parent;if(!t)return null;var n=this.childIndex(e)-1;return n>=0?t.children[n]:null},t.prototype.firstChild=function(e){return e.children[0]},t.prototype.lastChild=function(e){return e.children[e.children.length-1]},t.prototype.childNodes=function(e){return f([],d(e.children),!1)},t.prototype.childNode=function(e,t){return e.children[t]},t.prototype.kind=function(e){return e.kind},t.prototype.value=function(e){return e.kind===`#text`?e.value:e.kind===`#comment`?e.value.replace(/^<!(--)?((?:.|\n)*)\1>$/,`$2`):``},t.prototype.textContent=function(e){var t=this;return e.children.reduce(function(e,n){return e+(n.kind===`#text`?n.value:n.kind===`#comment`?``:t.textContent(n))},``)},t.prototype.innerHTML=function(e){return this.parser.serializeInner(this,e)},t.prototype.outerHTML=function(e){return this.parser.serialize(this,e)},t.prototype.serializeXML=function(e){return this.parser.serialize(this,e,!0)},t.prototype.setAttribute=function(e,t,n,r){r===void 0&&(r=null),typeof n!=`string`&&(n=String(n)),r&&(t=r.replace(/.*\//,``)+`:`+t.replace(/^.*:/,``)),e.attributes[t]=n,t===`style`&&(e.styles=null)},t.prototype.getAttribute=function(e,t){return e.attributes[t]},t.prototype.removeAttribute=function(e,t){delete e.attributes[t]},t.prototype.hasAttribute=function(e,t){return e.attributes.hasOwnProperty(t)},t.prototype.allAttributes=function(e){var t,n,r=e.attributes,i=[];try{for(var a=u(Object.keys(r)),o=a.next();!o.done;o=a.next()){var s=o.value;i.push({name:s,value:r[s]})}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i},t.prototype.addClass=function(e,t){var n=(e.attributes.class||``).split(/ /);n.find(function(e){return e===t})||(n.push(t),e.attributes.class=n.join(` `))},t.prototype.removeClass=function(e,t){var n=(e.attributes.class||``).split(/ /),r=n.findIndex(function(e){return e===t});r>=0&&(n.splice(r,1),e.attributes.class=n.join(` `))},t.prototype.hasClass=function(e,t){return!!(e.attributes.class||``).split(/ /).find(function(e){return e===t})},t.prototype.setStyle=function(e,t,n){e.styles||=new C.Styles(this.getAttribute(e,`style`)),e.styles.set(t,n),e.attributes.style=e.styles.cssText},t.prototype.getStyle=function(e,t){if(!e.styles){var n=this.getAttribute(e,`style`);if(!n)return``;e.styles=new C.Styles(n)}return e.styles.get(t)},t.prototype.allStyles=function(e){return this.getAttribute(e,`style`)},t.prototype.insertRules=function(e,t){e.children=[this.text(t.join(`
2
2
 
3
3
  `)+`
4
4
 
@@ -27,10 +27,10 @@
27
27
  <meta name="viewport" content="width=device-width, initial-scale=1" />
28
28
  <link rel="icon" href="data:," />
29
29
  <title>Aula videos</title>
30
- <script type="module" crossorigin src="./assets/82624cbe/index.js"></script>
30
+ <script type="module" crossorigin src="./assets/07fb5cf0/index.js"></script>
31
31
  <link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-BLXQ4ufn.js">
32
- <link rel="modulepreload" crossorigin href="./assets/src-DpS3WA7l.js">
33
- <link rel="modulepreload" crossorigin href="./assets/protocol-BOv1ch3F.js">
32
+ <link rel="modulepreload" crossorigin href="./assets/src-DfPcHwz-.js">
33
+ <link rel="modulepreload" crossorigin href="./assets/protocol-F-4tHoAW.js">
34
34
  <link rel="stylesheet" crossorigin href="./assets/index-qn44kZJM.css">
35
35
  </head>
36
36
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beff/aula-cli",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "description": "The aula command: runs chapter modules on the inlined engine, checks and lints them, writes PNG pictures for review, makes project zips, and serves the web player with narration.",
6
6
  "license": "MIT AND GPL-3.0-or-later",
@@ -1,18 +0,0 @@
1
- import {
2
- printDiagnostics
3
- } from "./chunk-5TUGYMFH.js";
4
- import "./chunk-5XVICDLW.js";
5
- import "./chunk-JWBPHDVP.js";
6
- import "./chunk-KCGXC2RV.js";
7
- import "./chunk-5ABPFV55.js";
8
- import {
9
- diagnosticsOf
10
- } from "./chunk-DFXG2P7A.js";
11
- import "./chunk-XCPBFMEA.js";
12
- import "./chunk-Y56UHOZ2.js";
13
- import "./chunk-VX7UVLQW.js";
14
- import "./chunk-CZ7CSFO4.js";
15
- export {
16
- diagnosticsOf,
17
- printDiagnostics
18
- };
@@ -1,16 +0,0 @@
1
- import {
2
- exists,
3
- host,
4
- loadProject
5
- } from "./chunk-4PZYWKO5.js";
6
- import "./chunk-5ABPFV55.js";
7
- import "./chunk-DFXG2P7A.js";
8
- import "./chunk-XCPBFMEA.js";
9
- import "./chunk-Y56UHOZ2.js";
10
- import "./chunk-VX7UVLQW.js";
11
- import "./chunk-CZ7CSFO4.js";
12
- export {
13
- exists,
14
- host,
15
- loadProject
16
- };
@@ -1,15 +0,0 @@
1
- import{_ as e,a as t,b as n,d as r,i,n as a,r as o,s,t as c,v as l,y as u}from"./src-DTLT9Lbm.js";function d(n,r){let i=n.titleParts??[{text:n.title}];return e.narrationScript([...i],t(n.lexicon??{}),[...r])}function f(t,n,r){return e.chapterNarration([...t],[...n],r)}function p(t){return e.estimateNarration([...t])}function m(t){return e.renderDiagnostic(t)}var h=`.!?…`,g=`,;:`,_=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);RegExp(`(?<=[${_(h)}])\\s+`),RegExp(`(?<=[${_(g)}])\\s+`);var v=`cdf77eccfdc734e7a4ee74708e9be9fb3b9d14b0134ce84e5794c27ef1c76706`;`${{path:`aula-voice-${v.slice(0,12)}.avw`,bytes:21474688,sha256:v}.path}`;var ee=e=>Float64Array.from(e,e=>e.start);function te(e,t){if(t.length===0)return e;let n=new Float32Array(e.length+t.reduce((e,t)=>e+t.samples,0)),r=0,i=0;for(let a of t.toSorted((e,t)=>e.sample-t.sample)){let t=Math.min(a.sample,e.length);n.set(e.subarray(r,t),i),i+=t-r+a.samples,r=t}return n.set(e.subarray(r),i),n}function ne(e,t){let n=t.toSorted((e,t)=>e.sample-t.sample);return e.cues.map(e=>{let t=e.speechStartFrame,r=e.endFrame,i=n.filter(e=>e.sample<=t).reduce((e,t)=>e+t.samples,0),a=n.filter(e=>e.sample>t&&e.sample<r).map(e=>({sample:e.sample-t,samples:e.samples})),o=r-t+a.reduce((e,t)=>e+t.samples,0);return{at:t+i,length:o,waits:a}})}function re(e,t){let n=e.samples.length+t.waits.reduce((e,t)=>e+t.samples,0);if(n!==t.length)throw Error(`a speech of ${String(n)} samples with its waits, at a place of ${String(t.length)}`);return te(new Float32Array(e.samples),t.waits)}function ie(e,t){let n=t[0]?.sampleRate??0;if(t.some(e=>e.sampleRate!==n))throw Error(`the narrator changed its sample rate`);return f(e,t.map(e=>e.words?{samples:e.samples,starts:ee(e.words)}:{samples:e.samples}),n)}function ae(e){let t=e.trim(),n=``,r;if(t.startsWith(`at `)){let e=t.slice(3),i=/^(.*) \((.*)\)$/.exec(e);n=i?.[1]??``,r=i?.[2]??e}else{let e=t.lastIndexOf(`@`,t.search(/:\d+:\d+$/));if(e<0)return null;n=t.slice(0,e),r=t.slice(e+1)}let i=/^(.*):(\d+):(\d+)$/.exec(r);return i?.[1]===void 0||i[2]===void 0||i[3]===void 0?null:{functionName:n.replace(/^(async |new )/,``),url:i[1],line:Number(i[2]),column:Number(i[3])}}var oe=e=>t=>{let n=[];for(let r of(t.stack??``).split(`
2
- `)){let t=ae(r);if(!t)continue;let i=e(t.url,t.line,t.column);n.push({function:t.functionName,file:i.file,line:i.line,col:i.column})}return n},y=e=>JSON.stringify(e.words);function se(e){let t=0xdeadbeef,n=0x41c6ce57;for(let r of e){for(let e=0;e<r.length;e++){let i=r.charCodeAt(e);t=Math.imul(t^i,0x9e3779b1),n=Math.imul(n^i,0x5f356495)}t=Math.imul(t^r.length^0x9e3779b9,0x9e3779b1),n=Math.imul(n^r.length^0x85ebca6b,0x5f356495)}return t=Math.imul(t^t>>>16,0x85ebca6b)^Math.imul(n^n>>>13,0xc2b2ae35),n=Math.imul(n^n>>>16,0x85ebca6b)^Math.imul(t^t>>>13,0xc2b2ae35),(n>>>0).toString(16).padStart(8,`0`)+(t>>>0).toString(16).padStart(8,`0`)}var ce=(e,t)=>e===``?t:`${e}/${t}`;function le(e,t,n){let r=t=>{throw Error(`the speech of ${JSON.stringify(e.text)} is not on its clock: ${t}`)};(t.sampleRate!==n.sampleRate||t.samples.length!==n.samples)&&r(`${String(t.samples.length)} samples, and the clock has ${String(n.samples)}`);let i=n.words??[];t.words.length!==i.length&&r(`${String(t.words.length)} words, and the clock has ${String(i.length)}`),t.words.forEach((e,t)=>{let n=i[t]?.start;e.start!==n&&r(`word ${String(t+1)} starts at ${String(e.start)} s, and at ${String(n)} s on the clock`)})}var ue=class{name;constructor(e){this.name=e}project=null;titles=[];script=[];estimates=[];knownRate=void 0;lengths=[];warnings=[];drawings=[];drawn=[];kept=new Map;place={chapter:0,seconds:0};stale=!1;halted=!1;running=!1;errors=[];watcher=null;done=Promise.resolve();changed(){this.watcher?.changed(this.state())}window(){if(this.script.length===0)return[];let e=Math.min(Math.max(this.place.chapter,0),this.script.length-1);return e+1<this.script.length?[e,e+1]:[e]}prune(){let e=this.window(),t=!1;for(let n=0;n<this.drawings.length;n++)e.includes(n)||(this.drawings[n]!==void 0&&(this.drawings[n]=void 0,t=!0),this.drawn[n]=!1);return t}rate(){return this.knownRate??this.drawings.find(e=>e!==void 0)?.chapter.rate??this.estimates[0]?.sampleRate??1}samples(e){let t=[0];return this.script.forEach((n,r)=>{let i=this.drawings[r]?.chapter.length??this.lengths[r],a=this.estimates[r],o=i===void 0?a?Math.round(a.endFrame*e/a.sampleRate):0:i;t.push((t[r]??0)+o)}),t}seconds(){let e=this.rate();return this.samples(e).map(t=>t/e)}order(){let e=this.window(),t=e[0];if(t===void 0)return[];let n=this.script[t]??[],r=this.drawn[t]?this.drawings[t]:void 0,i=0;if(r){let e=this.place.seconds*r.chapter.rate,t=r.places.findIndex(t=>t.at+t.length>e);i=t===-1?r.places.length:t}let a=n.map((e,n)=>[t,n]),o=e[1],s=o===void 0?[]:(this.script[o]??[]).map((e,t)=>[o,t]);return[...a.slice(i),...s,...a.slice(0,i)]}next(){for(let[e,t]of this.order()){let n=this.script[e]??[];if(!this.drawn[e]){let t=n.find(e=>!this.kept.has(y(e)));return t?{kind:`time`,cue:t}:{kind:`draw`,chapter:e}}let r=n[t];if(r&&!this.kept.get(y(r))?.speech)return{kind:`speak`,cue:r}}return null}sound(e,t){let n=this.kept.get(e);if(!n?.speech)return;let r=JSON.stringify(t.waits),i=n.sounds.get(r);return i||(i=re(n.speech,t),n.sounds.set(r,i)),i}draw(e,t){let n=this.script[t]??[],r=n.map(y),i=ie(n,r.map(e=>{let t=this.kept.get(e);if(!t)throw Error(`no clock of the cue ${e}`);return t.timing})),a=e.render(t,i);if(a._tag===`Left`)return a;let{lottie:o,waits:s,embeds:c,background:l,warnings:u}=a.right;this.drawn[t]=!0;let d=i.endFrame+s.reduce((e,t)=>e+t.samples,0);this.knownRate=i.sampleRate,this.lengths[t]=d,this.warnings[t]=u;let f=se([JSON.stringify([r,i,s,c,l]),o]);if(this.drawings[t]?.made===f)return{_tag:`Right`,right:void 0};let p=ne(i,s),m={animation:JSON.parse(o),rate:i.sampleRate,length:d,cues:p.map((e,t)=>({at:e.at,length:e.length,samples:this.sound(r[t]??``,e)})),embeds:c.map(({path:t,image:n,kind:r,start:i,frames:a})=>({path:ce(e.folder,t),...n===void 0?{}:{image:ce(e.folder,n)},kind:r,background:l,at:i,seconds:a/60}))};return this.drawings[t]={made:f,chapter:m,keys:r,places:p},this.changed(),{_tag:`Right`,right:void 0}}spoken(e){let t=!1;this.drawings.forEach((n,r)=>{if(!n?.keys.includes(e))return;let i=n.chapter.cues.map((t,r)=>{let i=n.places[r];return n.keys[r]===e&&i?{...t,samples:this.sound(e,i)}:t});this.drawings[r]={...n,chapter:{...n.chapter,cues:i}},t=!0}),t&&this.changed()}forget(){let e=new Set(this.script.flat().map(y));for(let t of this.kept.keys())e.has(t)||this.kept.delete(t)}state(){let e=this.seconds(),t=e.pop()??0;return{building:this.running,timeline:this.script.map((t,n)=>({title:this.titles[n]??``,start:e[n]??0})),duration:t,errors:this.errors,warnings:this.warnings.flat(),chapters:this.drawings.map(e=>e?.chapter)}}};function de(e){let t=null,n=!1,r=null,i=()=>(r=e.workspace.projects(),r),a=async t=>{if(!t.project){let e=await(r??i());if(t.stale||t.halted)return{_tag:`Right`,right:void 0};if(e._tag===`Left`)return e;let n=e.right.find(e=>e.name===t.name);if(!n)throw Error(`the workspace has no project ${t.name}`);let a=await(n.readScript?.()??n.script());if(t.stale||t.halted)return{_tag:`Right`,right:void 0};if(a._tag===`Left`)return a;let{script:o}=a.right;t.project=n,t.titles=n.titles,t.script=o,t.estimates=o.map(e=>p(e)),t.drawings.length!==o.length&&(t.drawings=Array.from({length:o.length},()=>void 0),t.lengths=Array.from({length:o.length},()=>void 0)),t.warnings=Array.from({length:o.length},()=>[]),t.drawn=Array.from({length:o.length},()=>!1),t.prune(),t.changed()}let n=t.project;for(let r=t.next();r&&!t.stale&&!t.halted;r=t.next()){if(r.kind===`draw`){if(await n.readChapter?.(r.chapter),t.stale||t.halted)break;let e=t.draw(n,r.chapter);if(e._tag===`Left`)return e;continue}let{cue:i}=r,a=y(i);if(r.kind===`time`){let n=await e.voice.time(i.words);t.kept.set(a,{timing:n,sounds:new Map});continue}let o=await e.voice.speak(i.words),s=t.kept.get(a);if(!s)throw Error(`no clock of the cue ${a}`);le(i,o,s.timing),s.speech=o,t.spoken(a)}return!t.stale&&!t.halted&&t.forget(),{_tag:`Right`,right:void 0}},o=e=>{e.running=!0,e.done=(async()=>{try{for(;;){e.stale=!1;let t=await a(e);if(e.errors=t._tag===`Left`?t.left:[],!e.stale||e.halted)break}}finally{e.running=!1,e.changed()}})()};return{refresh:e=>{r=null;let i=t;!n&&i&&(i.place=e,i.project=null,i.running?i.stale=!0:o(i))},halt:()=>{r=null,t&&=(t.halted=!0,t.watcher=null,null)},stop:()=>{n=!0,t&&(t.halted=!0,t.watcher=null)},idle:()=>t?.done??Promise.resolve(),build:{list:async()=>{let e=await i();return e._tag===`Left`?e:{_tag:`Right`,right:e.right.map(({name:e,title:t,section:n})=>({name:e,title:t,...n===void 0?{}:{section:n}}))}},watch:(e,r)=>{n||(t?.name!==e&&(t&&(t.halted=!0,t.watcher=null),t=new ue(e),o(t)),t.watcher=r,t.changed())},seek:(e,r)=>{t?.name===e&&(t.place=r,t.prune()&&t.changed(),!n&&!t.running&&t.project&&t.errors.length===0&&t.next()!==null&&o(t))}}}}var fe=e=>{if(typeof e==`boolean`)return null;let t=e.anyOf==null?e.oneOf==null?null:`oneOf`:`anyOf`;if(t==null)return null;let n=e[t];if(n==null)return null;let r=n.filter(e=>!pe(e));if(r.length===n.length||r.length===0)return null;let i=r.map(e=>fe(e)??e);return i.length===1?i[0]:{...e,[t]:i}},pe=e=>typeof e!=`boolean`&&e.type===`null`,me=e=>typeof e==`string`?`"${e}"`:typeof e==`number`||typeof e==`boolean`?`${e}`:typeof e==`bigint`?`${e}n`:e===null?`null`:Array.isArray(e)?`Array`:typeof e==`object`?`Object`:JSON.stringify(e),he=e=>{if(e.length===0)return``;let t=e[0];for(let n of e.slice(1))n.startsWith(`[`)?t+=n:t+=`.`+n;return t},b=(e,t)=>{let n=[...e,...t];return n.length>0?`(${he(n)})`:``},x=e=>e.filter(e=>e.length>0).join(` `),ge=(e,t,n)=>x([b(t,e.path),[e.message,n?`received: ${me(e.received)}`:``].filter(e=>e.length>0).join(`, `)]),_e=(e,t)=>{let n=b(t,e.path),r=S(e.errors,[],!1);return x([n,[`Failed to decode one of (${r.length>5?r.slice(0,5).join(` OR `)+` and more...`:r.join(` | `)})`,`received: ${me(e.received)}`].filter(e=>e.length>0).join(`, `)])},S=(e,t,n)=>e.map(e=>`isUnionError`in e?_e(e,t):ge(e,t,n)),ve=(e,t=[])=>S(e,t,!0).map((e,t,n)=>n.length==1?x([e]):x([`#${t}`,e])).join(` | `),C=Object.getPrototypeOf({});function ye(e){function t(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0,configurable:!0}):e[t]=n}function n(e){let t=0,n=e.length,r=Array(n);for(;t<n;++t)r[t]=p(e[t]);return r}function r(e){let n={};if(c&&Object.getPrototypeOf(e)!==C)return c(e);let r=s(e),i,a,o;for(i=0,a=r.length;i<a;++i)o=r[i],t(n,o,p(e[o]));return n}function i(e,t){let n=e.length,r=t.length,i=0,a=Array(n+r);for(;i<n;++i)a[i]=p(e[i]);for(i=0;i<r;++i)a[i+n]=p(t[i]);return a}let a=Object.prototype.propertyIsEnumerable;function o(e){let t=Object.keys(e),n=Object.getOwnPropertySymbols(e);for(let r=0,i=n.length;r<i;++r)a.call(e,n[r])&&t.push(n[r]);return t}let s=e?.symbols?o:Object.keys,c=typeof e?.cloneProtoObject==`function`?e.cloneProtoObject:void 0;function l(e){return typeof e==`object`&&!!e&&!(e instanceof RegExp)&&!(e instanceof Date)&&!(e instanceof Map)&&!(e instanceof Set)&&!ArrayBuffer.isView(e)}function u(e){return typeof e!=`object`||!e}let d=typeof Buffer<`u`?e=>typeof e!=`object`||!e||e instanceof RegExp||e instanceof Date||ArrayBuffer.isView(e)||e instanceof Buffer:e=>typeof e!=`object`||!e||e instanceof RegExp||e instanceof Date||ArrayBuffer.isView(e),f=e&&typeof e.mergeArray==`function`?e.mergeArray({clone:p,deepmerge:h,getKeys:s,isMergeableObject:l}):i;function p(e){return l(e)?Array.isArray(e)?n(e):r(e):e}function m(e,n){let r={},i=s(e),a=s(n),o,u,d;for(o=0,u=i.length;o<u;++o)d=i[o],a.indexOf(d)===-1&&t(r,d,p(e[d]));for(o=0,u=a.length;o<u;++o)d=a[o],i.indexOf(d)===-1?t(r,d,p(n[d])):c&&l(n[d])&&Object.getPrototypeOf(n[d])!==C?t(r,d,c(n[d])):t(r,d,h(e[d],n[d]));return r}function h(e,t){let n=Array.isArray(t),r=Array.isArray(e);return u(t)||t instanceof Map||t instanceof Set?t:d(e)?p(t):n&&r?f(e,t):n===r?m(e,t):p(t)}function g(){switch(arguments.length){case 0:return{};case 1:return p(arguments[0]);case 2:return h(arguments[0],arguments[1])}let e;for(let t=0,n=arguments.length;t<n;++t)e=h(e,arguments[t]);return e}return g}function be(e){let t=e.deepmerge,n=e.clone;return function(e,r){let i=0,a=r.length,o=Math.max(e.length,r.length),s=Array(o);for(i=0;i<o;++i)i<a?s[i]=t(e[i],r[i]):s[i]=n(e[i]);return s}}ye({mergeArray:be});function w(e,t,n){return[{message:t,path:[...e.path],received:n}]}function xe(e,t){let n=[];for(let r=0;r<=e.length;r++){n.push([r]);for(let i=1;i<=t.length;i++)n[r][i]=r===0?i:Math.min(n[r-1][i]+1,n[r][i-1]+1,n[r-1][i-1]+(e[r-1]===t[i-1]?0:1)),r>1&&i>1&&e[r-1]===t[i-2]&&e[r-2]===t[i-1]&&(n[r][i]=Math.min(n[r][i],n[r-2][i-2]+1))}return n[e.length][t.length]}function Se(e,t,n,r){if(n==null){T(e,t);let n=w(e,`extra property`,r);return E(e),n}let i=null,a=Math.max(1,Math.floor(t.length/3));for(let e of n){let n=xe(t,e);n<=a&&n<t.length&&(i==null||n<a)&&(i=e,a=n)}let o=i==null?``:` Did you mean ${JSON.stringify(i)}?`,s=n.length===0?`none`:n.map(e=>JSON.stringify(e)).join(`, `);T(e,t);let c=w(e,`extra property.${o} Allowed: ${s}`,r);return E(e),c}function Ce(e,t,n,r,i){r.validate(e,i)||(T(e,n),t.push(...r.reportDecodeError(e,i)),E(e))}function T(e,t){e.path.push(t)}function E(e){e.path.pop()}function we(e,t,n){e[t]=typeof n==`function`?{validator:n}:n}function Te(e,t,n){e[t]=typeof n==`function`?{validator:n}:n}function D(e,t){return e?.description==null?t:{...t,description:e.description}}function O(e){let t=e.replace(/\*\//g,`* /`).split(`
3
- `);return t.length===1?`/** ${t[0]} */`:[`/**`,...t.map(e=>` * ${e}`),` */`].join(`
4
- `)}function k(e,t){return t==null?{typeExpr:e}:{typeExpr:e,docText:t}}var A=class{metadata;constructor(e){this.metadata=e}describe(e){return k(this.describeTypeExpr(e),this.metadata?.description)}describeChildren(){return[]}};function j(e,t){return t.describe(e).typeExpr}function Ee(e){return e.docText==null?e.typeExpr:`${O(e.docText)}\n${e.typeExpr}`}function M(e,t){let n=`type ${e} = ${t.typeExpr};`;return t.docText==null?n:`${O(t.docText)}\n${n}`}function De(e){return/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)||/^(0|[1-9][0-9]*)$/.test(e)?e:JSON.stringify(e)}function N(e,t,n){let r=n instanceof F?`?`:``,i=n.describe(e);return{docText:i.docText,member:`${t}${r}: ${i.typeExpr}`}}function Oe(e,t,n){return N(e,`[K in ${j(e,t)}]`,n)}function ke(e){let t=`${e.member};`;return e.docText==null?t:`${O(e.docText)}\n${t}`}function P(e,t){if(e instanceof Fe)e.collectDescribeRefs(t);else for(let n of e.describeChildren())P(n,t)}var Ae=class extends A{typeName;constructor(e,t){super(e),this.typeName=t}describeTypeExpr(e){return this.typeName}schema(e){return D(this.metadata,{type:this.typeName})}validate(e,t){return typeof t===this.typeName}parseAfterValidation(e,t){return t}reportDecodeError(e,t){return w(e,`expected `+this.typeName,t)}},je=class extends A{constructor(e){super(e)}describeTypeExpr(e){return`any`}schema(e){return D(this.metadata,{})}validate(e,t){return!0}parseAfterValidation(e,t){return t}reportDecodeError(e,t){return w(e,`expected any`,t)}},Me=class extends A{constructor(e){super(e)}describeTypeExpr(e){return`never`}schema(e){return D(this.metadata,{anyOf:[]})}validate(e,t){return!1}parseAfterValidation(e,t){throw Error(`unreachable`)}reportDecodeError(e,t){return w(e,`expected never`,t)}},Ne=class extends A{itemParser;constructor(e,t){super(e),this.itemParser=t}schema(e){T(e,`[]`);let t=this.itemParser.schema(e);return E(e),D(this.metadata,{type:`array`,items:t})}validate(e,t){if(Array.isArray(t)){for(let n=0;n<t.length;n++){let r=t[n];if(!this.itemParser.validate(e,r))return!1}return!0}return!1}parseAfterValidation(e,t){return t.map(t=>this.itemParser.parseAfterValidation(e,t))}reportDecodeError(e,t){if(!Array.isArray(t))return w(e,`expected array`,t);let n=[];for(let r=0;r<t.length;r++)Ce(e,n,`[${r}]`,this.itemParser,t[r]);return n}describeTypeExpr(e){return`Array<${j(e,this.itemParser)}>`}describeChildren(){return[this.itemParser]}},F=class{t;constructor(e){this.t=e}schema(e){return{anyOf:[this.t.schema(e),{type:`null`}]}}validate(e,t){return t==null||this.t.validate(e,t)}parseAfterValidation(e,t){return t==null?t:this.t.parseAfterValidation(e,t)}reportDecodeError(e,t){return this.t.reportDecodeError(e,t)}describe(e){return this.t.describe(e)}describeChildren(){return[this.t]}},I=Object.prototype.hasOwnProperty;function L(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0,configurable:!0}):e[t]=n}var Pe=class extends A{properties;indexedPropertiesParser;constructor(e,t,n){super(e),this.properties=t,this.indexedPropertiesParser=n}describeTypeExpr(e){let t=Object.keys(this.properties).sort().map(t=>{let n=this.properties[t];return N(e,De(t),n)}),n=this.indexedPropertiesParser.map(({key:t,value:n})=>Oe(e,t,n)),r=[...t,...n];return r.some(e=>e.docText!=null)?r.length===0?`{}`:`{\n${r.map(ke).join(`
5
- `)}\n}`:`{ ${r.map(e=>e.member).join(`, `)} }`}describeChildren(){return[...Object.values(this.properties),...this.indexedPropertiesParser.flatMap(({key:e,value:t})=>[e,t])]}schema(e){let t={},n=new Set;for(let r in this.properties){T(e,r);let i=this.properties[r].schema(e),a=fe(i);a==null?t[r]=i:(t[r]=a,n.add(r)),E(e)}let r=Object.keys(this.properties).filter(e=>!n.has(e)),i={type:`object`,properties:t,...r.length>0?{required:r}:{}},a=this.indexedPropertiesParser.map(({key:t,value:n})=>{T(e,`[key]`);let r=t.schema(e);E(e),T(e,`[value]`);let i=n.schema(e);return E(e),{type:`object`,additionalProperties:i,propertyNames:r}});if(a.length===0)return D(this.metadata,{...i,additionalProperties:!1});if(Object.keys(t).length===0&&a.length===1){let e=this.indexedPropertiesParser[0].value;return e instanceof Me?D(this.metadata,{type:`object`,additionalProperties:!1}):e instanceof je?D(this.metadata,{...a[0],additionalProperties:!0}):D(this.metadata,a[0])}return D(this.metadata,{allOf:[i,...a]})}validate(e,t){if(typeof t==`object`&&!Array.isArray(t)&&t!==null){let n=Object.keys(this.properties);for(let r of n)if(!this.properties[r].validate(e,t[r]))return!1;if(this.indexedPropertiesParser.length>0){let n=Object.keys(t).filter(e=>!I.call(this.properties,e));for(let r of n){let n=!1;for(let i of this.indexedPropertiesParser){if(!i.key.validate(e,r))continue;let a=t[r];if(i.value.validate(e,a)){n=!0;break}}if(!n&&!this.leavesKeyToIntersection(e,t,r))return!1}}else if(e.disallowExtraProperties&&e.intersectionInput!==t&&Object.keys(t).filter(e=>!I.call(this.properties,e)).length>0)return!1;return!0}return!1}parseAfterValidation(e,t){let n={},r=Object.keys(t);if(e.objectKeyOrder===`input`)for(let i of r)if(I.call(this.properties,i))L(n,i,this.properties[i].parseAfterValidation(e,t[i]));else for(let r of this.indexedPropertiesParser){let a=t[i];if(r.key.validate(e,i)&&r.value.validate(e,a)){let t=r.value.parseAfterValidation(e,a);L(n,r.key.parseAfterValidation(e,i),t)}}else{let i=Object.keys(this.properties).sort();for(let r of i){if(!I.call(t,r))continue;let i=t[r];L(n,r,this.properties[r].parseAfterValidation(e,i))}if(this.indexedPropertiesParser.length>0){let i=r.filter(e=>!I.call(this.properties,e)).sort();for(let r of i){let i=t[r];for(let t of this.indexedPropertiesParser)if(t.key.validate(e,r)&&t.value.validate(e,i)){let a=t.value.parseAfterValidation(e,i);L(n,t.key.parseAfterValidation(e,r),a)}}}}return n}reportDecodeError(e,t){if(typeof t!=`object`||Array.isArray(t)||t===null)return w(e,`expected object`,t);let n=[],r=Object.keys(this.properties);for(let i of r)Ce(e,n,i,this.properties[i],t[i]);if(this.indexedPropertiesParser.length>0){let r=Object.keys(t).filter(e=>!I.call(this.properties,e));for(let i of r)if(!this.leavesKeyToIntersection(e,t,i))for(let r of this.indexedPropertiesParser){let a=r.key.validate(e,i),o=r.value.validate(e,t[i]);if(!(a&&o)){if(T(e,i),!a){let t=r.key.reportDecodeError(e,i);n.push(...t)}if(!o){let a=r.value.reportDecodeError(e,t[i]);n.push(...a)}E(e)}}}else if(e.disallowExtraProperties&&e.intersectionInput!==t){let n=Object.keys(t).filter(e=>!I.call(this.properties,e));if(n.length>0)return n.flatMap(n=>Se(e,n,r,t[n]))}return n}allowedKeys(){return this.indexedPropertiesParser.length>0?null:Object.keys(this.properties)}leavesKeyToIntersection(e,t,n){return e.intersectionInput===t&&!this.indexedPropertiesParser.some(t=>t.key.validate(e,n))}},Fe=class extends A{refName;namedRuntypes;constructor(e,t,n){super(e),this.refName=t,this.namedRuntypes=n}getNamedRuntypes(){return this.namedRuntypes}describeTypeExpr(e){return this.refName}collectDescribeRefs(e){let t=this.refName;e.refCounts[t]=(e.refCounts[t]||0)+1,e.activeRefs.has(t)||e.visitedRefs.has(t)||(e.visitedRefs.add(t),e.activeRefs.add(t),P(this.getNamedRuntypes()[t],e),e.activeRefs.delete(t))}describe(e){let t=this.refName,n=this.getNamedRuntypes()[this.refName],r=()=>k(t,this.metadata?.description);if(e.refCounts[t]>1)return e.activeRefs.has(t)||(e.definitions[t]??(e.activeRefs.add(t),e.definitions[t]=n.describe(e),e.activeRefs.delete(t))),r();let i=n.describe(e);return this.metadata?.description==null?i:k(i.typeExpr,this.metadata.description)}schema(e){let t=this.refName,n=this.getNamedRuntypes()[this.refName];if(e.mode===`contextual`){let r=e.printingContext;if(r==null)throw Error(`INTERNAL ERROR: Missing SchemaPrintingContext`);if(!r.hasDefinition(t)&&!r.isDefinitionInProgress(t)){r.markDefinitionInProgress(t);let i=(r.getNamedTypeSchemaOverride(t)??n).schema(e);r.storeDefinition(t,i)}return D(this.metadata,{$ref:r.getRef(t)})}if(e.seen[t])return D(this.metadata,{});e.seen[t]=!0;var r=n.schema(e);return delete e.seen[t],D(this.metadata,r)}validate(e,t){return this.getNamedRuntypes()[this.refName].validate(e,t)}parseAfterValidation(e,t){return this.getNamedRuntypes()[this.refName].parseAfterValidation(e,t)}reportDecodeError(e,t){return this.getNamedRuntypes()[this.refName].reportDecodeError(e,t)}},Ie=class{_runtype;name;hideTypeNameInDescribe;constructor(e,t,n){this._runtype=e,this.name=t,this.hideTypeNameInDescribe=n}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;let r=ve(n.errors,[]);throw Error(`Failed to parse ${this.name} - ${r}`)}safeParse(e,t){let n=t?.disallowExtraProperties??!1,r=t?.objectKeyOrder??`input`;if(this.validate(e,t)){let t={disallowExtraProperties:n,objectKeyOrder:r};return{success:!0,data:this._runtype.parseAfterValidation(t,e)}}let i={path:[],disallowExtraProperties:n};return{success:!1,errors:this._runtype.reportDecodeError(i,e).slice(0,10)}}validate(e,t){let n={disallowExtraProperties:t?.disallowExtraProperties??!1},r=this._runtype.validate(n,e);if(typeof r!=`boolean`)throw Error(`INTERNAL ERROR: Expected boolean`);return r}schema(){return this._runtype.schema({path:[],seen:{},mode:`flat`})}schemaWithContext(e){let t={path:[],seen:{},mode:`contextual`,printingContext:e};return this._runtype.schema(t)}describe(){let e={activeRefs:new Set,definitions:{},refCounts:{},visitedRefs:new Set};P(this._runtype,e);let t=this._runtype.describe(e),n=Object.keys(e.definitions).sort().map(t=>[t,e.definitions[t]]).map(([e,t])=>M(e,t)).join(`
6
-
7
- `);return this.hideTypeNameInDescribe?[n,Ee(t)].filter(e=>e!=null&&e.length>0).join(`
8
-
9
- `):[n,M(`Codec${this.name}`,t)].filter(e=>e!=null&&e.length>0).join(`
10
-
11
- `)}},Le=(e,t,n)=>new Ie(e,t,n),Re=(e,t)=>{let n=t?.stringFormats??{};for(let t of e.requiredStringFormats)if(n[t]==null)throw Error(`Missing custom format ${t}`);Object.keys(n).forEach(t=>{let r=n[t];we(e.stringFormatters,t,r)});let r=t?.numberFormats??{};for(let t of e.requiredNumberFormats)if(r[t]==null)throw Error(`Missing custom format ${t}`);Object.keys(r).forEach(t=>{let n=r[t];Te(e.numberFormatters,t,n)});let i={};for(let t of Object.keys(e.parsers))i[t]=Le(e.parsers[t],t,!1);return i},ze=[],Be=[],R={},Ve={},He={},Ue=new Fe(void 0,`PackageJson`,R),We=new je(void 0),z=new Ae(void 0,`string`),Ge=new Ne(void 0,z),Ke=new Pe({description:`The part of a package.json that aula reads: how a package names its module and its
12
- workspace packages, and its version when the CLI compares it to the project's.`},{exports:new F(We),main:new F(z),module:new F(z),name:new F(z),version:new F(z),workspaces:new F(Ge)},[]);Object.assign(R,{PackageJson:Ke});var qe={PackageJson:Ue},Je={buildParsers:e=>Re({parsers:qe,stringFormatters:Ve,numberFormatters:He,requiredStringFormats:ze,requiredNumberFormats:Be},e)}.buildParsers();function Ye(e,t){let n=[...e];return{read:t,list:e=>{let t=e===``?``:`${e}/`,r=new Set;for(let e of n){if(!e.startsWith(t))continue;let[n,...i]=e.slice(t.length).split(`/`);n!==void 0&&i.length>0&&r.add(n)}return Promise.resolve([...r].toSorted())}}}var B=Object.fromEntries([`@beff/aula`,`@beff/aula-method`].map(e=>[e,`aula-provide:${e}`])),V=`aula-projects.ts`;function Xe(e,t){let n=e;for(let[e,r]of Object.entries(B)){let i=t[e];i!==void 0&&(n=n.replaceAll(JSON.stringify(r),JSON.stringify(i)))}return n}var H=`tree:`;function U(e){let t=e.lastIndexOf(`/`);return t<0?``:e.slice(0,t)}function W(e,t){let n=e===``?[]:e.split(`/`);for(let e of t.split(`/`))if(e!==``&&e!==`.`){if(e===`..`){if(!n.length)return null;n.pop()}else n.push(e)}return n.join(`/`)}var Ze=new Map([[`ts`,`ts`],[`mts`,`ts`],[`js`,`js`],[`mjs`,`js`],[`json`,`json`]]),Qe=e=>Ze.get(e.slice(e.lastIndexOf(`.`)+1))??`ts`;function $e(e,t){return{name:`aula-tree`,setup(n){n.onResolve({filter:/.*/},async n=>{let r=t[n.path];if(r!==void 0)return{path:r,external:!0};if(n.kind===`entry-point`)return{path:W(``,n.path)??n.path,namespace:`tree`};if(!n.path.startsWith(`./`)&&!n.path.startsWith(`../`)){let t=await at(e,n.path,n.importer);return t===null?{errors:[{text:`cannot find the package "${n.path}" in node_modules or the workspace packages`}]}:{path:t,namespace:`tree`}}let i=W(U(n.importer),n.path);if(i===null)return{errors:[{text:`"${n.path}" is outside the folder you opened`}]};for(let t of[i,`${i}.ts`,`${i}/index.ts`])if(await e.read(t)!==null)return{path:t,namespace:`tree`};return{errors:[{text:`cannot find "${n.path}" (${i})`}]}}),n.onLoad({filter:/.*/,namespace:`tree`},async t=>{let n=await e.read(t.path);return n===null?{errors:[{text:`cannot read ${t.path}`}]}:{contents:n,loader:Qe(t.path)}})}}}function et(e){return typeof e==`object`&&!!e&&typeof Reflect.get(e,`text`)==`string`}var tt=({text:e,location:t})=>({severity:`error`,code:`bundle-error`,message:e,...t?{location:{file:t.file.replace(H,``),line:t.line,col:t.column+1}}:{},stack:[],related:[]});async function nt(e,t,n,r){let i;try{i=await e.build({entryPoints:[n],bundle:!0,write:!1,format:`esm`,platform:`browser`,target:`es2024`,outfile:`bundle.js`,sourcemap:`both`,sourcesContent:!1,metafile:!0,logLevel:`silent`,plugins:[$e(t,r)]})}catch(e){let t=typeof e==`object`&&e?Reflect.get(e,`errors`):void 0;if(Array.isArray(t)&&t.every(et))return{_tag:`Left`,left:t.map(tt)};throw e}let a=i.outputFiles.find(e=>e.path.endsWith(`.js`))?.text,o=i.outputFiles.find(e=>e.path.endsWith(`.js.map`))?.text;if(a===void 0||o===void 0)throw Error(`esbuild wrote no bundle`);return{_tag:`Right`,right:{code:a,map:o,inputs:Object.keys(i.metafile?.inputs??{}).filter(e=>e.startsWith(H)).map(e=>e.slice(5))}}}function G(e,t){if(typeof e==`string`)return t===`.`?e:null;if(typeof e!=`object`||!e)return null;if(Object.keys(e).some(e=>e.startsWith(`.`)))return t in e?G(Reflect.get(e,t),`.`):null;for(let t of[`browser`,`import`,`default`])if(t in e)return G(Reflect.get(e,t),`.`);return null}function K(e){let t=e.split(`/`),n=e.startsWith(`@`)?2:1,r=t.slice(n).join(`/`);return{name:t.slice(0,n).join(`/`),subpath:r===``?`.`:`./${r}`}}async function q(e,t,n){let r=J(`${t}/package.json`,await e.read(`${t}/package.json`));return r?W(t,G(r.exports,n)??(n===`.`?r.module??r.main??`index.js`:n)):null}async function rt(e,t,n){let{name:r,subpath:i}=K(t);for(let t=U(n);;t=U(t)){let n=await q(e,t===``?`node_modules/${r}`:`${t}/node_modules/${r}`,i);if(n!==null)return n;if(t===``)return null}}function J(e,t){if(t===null)return null;let n=Je.PackageJson.safeParse(JSON.parse(t));return n.success?n.data:null}async function it(e){let t=[],n=await e.read(`pnpm-workspace.yaml`);if(n!==null){let e=!1;for(let r of n.split(`
13
- `))if(/^packages:\s*$/.test(r))e=!0;else if(/^\S/.test(r))e=!1;else if(e){let e=/^\s*-\s*["']?([^"'#]+?)["']?\s*(#.*)?$/.exec(r)?.[1];e!==void 0&&t.push(e)}}t.push(...J(`package.json`,await e.read(`package.json`))?.workspaces??[]);let r=[];for(let n of t){let t=n.replace(/^\.\//,``).replace(/\/$/,``);if(t.endsWith(`/*`)){let n=t.slice(0,-2);r.push(...(await e.list(n)).map(e=>`${n}/${e}`))}else t.includes(`*`)||r.push(t)}return r}async function at(e,t,n){let r=await rt(e,t,n);if(r!==null)return r;let{name:i,subpath:a}=K(t);for(let t of await it(e))if(J(`${t}/package.json`,await e.read(`${t}/package.json`))?.name===i)return q(e,t,a);return null}var Y=/^(\d+)-/,X=e=>e.replace(Y,``);function ot(e){let t=X(e).replaceAll(`-`,` `);return t.charAt(0).toUpperCase()+t.slice(1)}var Z=(e,t)=>e<t?-1:+(e>t);function st(e,t){let n=Y.exec(e)?.[1],r=Y.exec(t)?.[1];if(n===void 0||r===void 0){if(n!==r)return n===void 0?1:-1}else{let[e,t]=[n.replace(/^0+/,``),r.replace(/^0+/,``)],i=e.length-t.length||Z(e,t);if(i!==0)return i}return Z(X(e),X(t))||Z(e,t)}async function ct(e,t){return(await e.list(t)).filter(e=>e!==`node_modules`&&!e.startsWith(`.`)).toSorted(st)}var Q=async(e,t)=>await e.read(t)!==null;async function lt(e,t){if(await Q(e,`index.ts`))return{_tag:`Right`,right:[{module:`index.ts`,name:X(t)}]};let n=[];for(let t of await ct(e,``))if(await Q(e,`${t}/index.ts`))n.push({module:`${t}/index.ts`,name:X(t)});else for(let r of await ct(e,t)){let i=`${t}/${r}/index.ts`;await Q(e,i)&&n.push({module:i,name:X(r),section:ot(t)})}let r=[];return n.forEach((e,t)=>{let i=n.findIndex(t=>t.name===e.name);if(i===t)return;let a=[n[i],e].map(e=>(e?.module??``).slice(0,-9));r.push({severity:`error`,code:`duplicate-project-name`,message:`two projects have the name ${e.name}: ${a.join(` and `)}`,hint:`the name of a project is its folder name without the order prefix: rename one of the folders`,stack:[],related:[]})}),r.length>0?{_tag:`Left`,left:r}:{_tag:`Right`,right:n}}async function ut(e,t,n){let r=await lt(t,n);if(r._tag===`Left`)return r;let i=r.right;if(i.length===0)throw Error(`no project here: open a folder that has index.ts, or whose subfolders have index.ts`);let a=[...i.map((e,t)=>`import p${String(t)} from ${JSON.stringify(`./${e.module}`)};`),`export default [${i.map((e,t)=>`p${String(t)}`).join(`, `)}];`].join(`
14
- `),o=await nt(e,{read:e=>e===`aula-projects.ts`?Promise.resolve(a):t.read(e),list:e=>t.list(e)},V,B);return o._tag===`Left`?o:{_tag:`Right`,right:{bundle:{name:n,projects:i,code:o.right.code,map:o.right.map},inputs:o.right.inputs}}}var dt=(e,t)=>({frames:e,name:e=>/^[a-z][a-z0-9+.-]*:/.test(e)?void 0:e,exists:()=>!0,...t?{media:t}:{}}),ft=(e,t)=>typeof e==`object`&&e?Reflect.get(e,t):void 0;async function pt(e,t,i,o,s){await u(),await l(),s?.();let c=Xe(e.code,o),d=await n(()=>i.load({code:c,map:e.map}));if(d._tag===`Left`)return{_tag:`Left`,left:[a(d.left,V,t)]};let f=ft(d.right.exports,`default`);if(!Array.isArray(f))throw Error(`${V} has no list of projects`);return{_tag:`Right`,right:f.map((n,i)=>{let a=e.projects[i];if(!r(n))throw Error(`the default export of ${a?.module??``} is not made by defineProject: write \`export default defineProject({ title, theme, chapters: [ … ] })\``);return gt(a?.name??``,ht(a?.module??`index.ts`),a?.section,n,t)})}}async function mt(e,t,n,r,i,a){let o=await e.name(),[s]=await Promise.all([ut(r,e,o),u().then(async()=>{await l(),a?.()})]);return s._tag===`Left`?s:pt(s.right.bundle,t,n,i)}var ht=e=>e.slice(0,Math.max(0,e.lastIndexOf(`/`)));function gt(e,t,n,r,a){let l=r.chapters.length+1;return{name:e,folder:t,...n===void 0?{}:{section:n},title:r.title,chapters:l,titles:[r.title,...r.chapters.map(e=>e.heading)],script:()=>{let e=[];for(let t of r.chapters.keys()){let n=o(r,t+1,{host:a});if(n.value===void 0)return{_tag:`Left`,left:n.diagnostics};e.push(n.value)}return{_tag:`Right`,right:{script:d(r,e)}}},walk:e=>{e>0&&c(r,e,{host:a})},render:(e,t)=>{let n=i(r,e,{host:a,narration:t});if(!n.ok||n.value===void 0)return{_tag:`Left`,left:n.diagnostics};let{lottie:o,waits:c,embeds:l,diagnostics:u}=n.value;return{_tag:`Right`,right:{lottie:o,waits:c,embeds:l,background:(r.theme??s).background,warnings:u}}}}}function _t(e){return e}function vt(e,t){return Object.assign({},e,t)}function yt(e,t){return{...e,...t}}function bt(...e){return Object.assign({},...e)}var xt={create:_t,extend:vt,merge:bt,override:yt},St=class extends Error{constructor(e,t){super(e),this.stack=t}};function Ct(e,t,n){return e===``?``:` at ${e}:${String(t)}:${String(n)}`}var $=e=>`${e.file}:${String(e.line)}:${String(e.col)}`;function wt(e,t){if(!(e instanceof Error))return{message:String(e),place:null,stack:[]};let n=t(e),[r]=n;return{message:e.name===`Error`||e.name===``?e.message:`${e.name}: ${e.message}`,place:r?$(r):null,stack:n.map(e=>e.function===``?`at ${$(e)}`:`at ${e.function} (${$(e)})`)}}function Tt(e,t,n){let r=(t,n,r)=>{let i=e.createElement(t);return i.className=n,i.textContent=r,i},i=r(`div`,`crash`,``);i.setAttribute(`role`,`alert`),i.append(r(`h1`,``,`The app stopped because of an error.`),r(`p`,`message`,t.message)),t.place!==null&&i.append(r(`p`,`place`,`at ${t.place}`)),t.stack.length>0&&i.append(r(`pre`,`stack`,t.stack.join(`
15
- `)));let a=r(`button`,`reload`,`Reload`);a.addEventListener(`click`,n),i.append(a),e.body.replaceChildren(i)}var Et=2e5;function Dt(e){let{layers:t,...n}=e,r=[JSON.stringify({...n,layers:[]})],i=[],a=0;for(let e of t){let t=JSON.stringify(e);a>0&&a+t.length>Et&&(r.push(`[${i.join(`,`)}]`),i=[],a=0),i.push(t),a+=t.length+1}return i.length>0&&r.push(`[${i.join(`,`)}]`),r}async function Ot(e,t){let[n,...r]=e;if(n===void 0)throw Error(`a Lottie animation with no parts`);let i=JSON.parse(n);for(let e of r){await t();let n=JSON.parse(e);i.layers.push(...n)}return i}var kt=e=>e.map(e=>({...e,text:m(e)}));function At(e){let t=Reflect.get(e,`text`);if(typeof t!=`string`)throw Error(`a diagnostic with no text: ${e.message}`);return t}export{St as a,Tt as c,mt as d,dt as f,oe as g,de as h,Dt as i,xt as l,Ye as m,kt as n,wt as o,H as p,Ot as r,Ct as s,At as t,pt as u};
@@ -1,15 +0,0 @@
1
- import{_ as e,a as t,b as n,d as r,i,n as a,r as o,s,t as c,v as l,y as u}from"./src-DpS3WA7l.js";function d(n,r){let i=n.titleParts??[{text:n.title}];return e.narrationScript([...i],t(n.lexicon??{}),[...r])}function f(t,n,r){return e.chapterNarration([...t],[...n],r)}function p(t){return e.estimateNarration([...t])}function m(t){return e.renderDiagnostic(t)}var h=`.!?…`,g=`,;:`,_=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);RegExp(`(?<=[${_(h)}])\\s+`),RegExp(`(?<=[${_(g)}])\\s+`);var v=`cdf77eccfdc734e7a4ee74708e9be9fb3b9d14b0134ce84e5794c27ef1c76706`;`${{path:`aula-voice-${v.slice(0,12)}.avw`,bytes:21474688,sha256:v}.path}`;var ee=e=>Float64Array.from(e,e=>e.start);function te(e,t){if(t.length===0)return e;let n=new Float32Array(e.length+t.reduce((e,t)=>e+t.samples,0)),r=0,i=0;for(let a of t.toSorted((e,t)=>e.sample-t.sample)){let t=Math.min(a.sample,e.length);n.set(e.subarray(r,t),i),i+=t-r+a.samples,r=t}return n.set(e.subarray(r),i),n}function ne(e,t){let n=t.toSorted((e,t)=>e.sample-t.sample);return e.cues.map(e=>{let t=e.speechStartFrame,r=e.endFrame,i=n.filter(e=>e.sample<=t).reduce((e,t)=>e+t.samples,0),a=n.filter(e=>e.sample>t&&e.sample<r).map(e=>({sample:e.sample-t,samples:e.samples})),o=r-t+a.reduce((e,t)=>e+t.samples,0);return{at:t+i,length:o,waits:a}})}function re(e,t){let n=e.samples.length+t.waits.reduce((e,t)=>e+t.samples,0);if(n!==t.length)throw Error(`a speech of ${String(n)} samples with its waits, at a place of ${String(t.length)}`);return te(new Float32Array(e.samples),t.waits)}function ie(e,t){let n=t[0]?.sampleRate??0;if(t.some(e=>e.sampleRate!==n))throw Error(`the narrator changed its sample rate`);return f(e,t.map(e=>e.words?{samples:e.samples,starts:ee(e.words)}:{samples:e.samples}),n)}function ae(e){let t=e.trim(),n=``,r;if(t.startsWith(`at `)){let e=t.slice(3),i=/^(.*) \((.*)\)$/.exec(e);n=i?.[1]??``,r=i?.[2]??e}else{let e=t.lastIndexOf(`@`,t.search(/:\d+:\d+$/));if(e<0)return null;n=t.slice(0,e),r=t.slice(e+1)}let i=/^(.*):(\d+):(\d+)$/.exec(r);return i?.[1]===void 0||i[2]===void 0||i[3]===void 0?null:{functionName:n.replace(/^(async |new )/,``),url:i[1],line:Number(i[2]),column:Number(i[3])}}var oe=e=>t=>{let n=[];for(let r of(t.stack??``).split(`
2
- `)){let t=ae(r);if(!t)continue;let i=e(t.url,t.line,t.column);n.push({function:t.functionName,file:i.file,line:i.line,col:i.column})}return n},y=e=>JSON.stringify(e.words);function se(e){let t=0xdeadbeef,n=0x41c6ce57;for(let r of e){for(let e=0;e<r.length;e++){let i=r.charCodeAt(e);t=Math.imul(t^i,0x9e3779b1),n=Math.imul(n^i,0x5f356495)}t=Math.imul(t^r.length^0x9e3779b9,0x9e3779b1),n=Math.imul(n^r.length^0x85ebca6b,0x5f356495)}return t=Math.imul(t^t>>>16,0x85ebca6b)^Math.imul(n^n>>>13,0xc2b2ae35),n=Math.imul(n^n>>>16,0x85ebca6b)^Math.imul(t^t>>>13,0xc2b2ae35),(n>>>0).toString(16).padStart(8,`0`)+(t>>>0).toString(16).padStart(8,`0`)}var ce=(e,t)=>e===``?t:`${e}/${t}`;function le(e,t,n){let r=t=>{throw Error(`the speech of ${JSON.stringify(e.text)} is not on its clock: ${t}`)};(t.sampleRate!==n.sampleRate||t.samples.length!==n.samples)&&r(`${String(t.samples.length)} samples, and the clock has ${String(n.samples)}`);let i=n.words??[];t.words.length!==i.length&&r(`${String(t.words.length)} words, and the clock has ${String(i.length)}`),t.words.forEach((e,t)=>{let n=i[t]?.start;e.start!==n&&r(`word ${String(t+1)} starts at ${String(e.start)} s, and at ${String(n)} s on the clock`)})}var ue=class{name;constructor(e){this.name=e}project=null;titles=[];script=[];estimates=[];knownRate=void 0;lengths=[];warnings=[];drawings=[];drawn=[];kept=new Map;place={chapter:0,seconds:0};stale=!1;halted=!1;running=!1;errors=[];watcher=null;done=Promise.resolve();changed(){this.watcher?.changed(this.state())}window(){if(this.script.length===0)return[];let e=Math.min(Math.max(this.place.chapter,0),this.script.length-1);return e+1<this.script.length?[e,e+1]:[e]}prune(){let e=this.window(),t=!1;for(let n=0;n<this.drawings.length;n++)e.includes(n)||(this.drawings[n]!==void 0&&(this.drawings[n]=void 0,t=!0),this.drawn[n]=!1);return t}rate(){return this.knownRate??this.drawings.find(e=>e!==void 0)?.chapter.rate??this.estimates[0]?.sampleRate??1}samples(e){let t=[0];return this.script.forEach((n,r)=>{let i=this.drawings[r]?.chapter.length??this.lengths[r],a=this.estimates[r],o=i===void 0?a?Math.round(a.endFrame*e/a.sampleRate):0:i;t.push((t[r]??0)+o)}),t}seconds(){let e=this.rate();return this.samples(e).map(t=>t/e)}order(){let e=this.window(),t=e[0];if(t===void 0)return[];let n=this.script[t]??[],r=this.drawn[t]?this.drawings[t]:void 0,i=0;if(r){let e=this.place.seconds*r.chapter.rate,t=r.places.findIndex(t=>t.at+t.length>e);i=t===-1?r.places.length:t}let a=n.map((e,n)=>[t,n]),o=e[1],s=o===void 0?[]:(this.script[o]??[]).map((e,t)=>[o,t]);return[...a.slice(i),...s,...a.slice(0,i)]}next(){for(let[e,t]of this.order()){let n=this.script[e]??[];if(!this.drawn[e]){let t=n.find(e=>!this.kept.has(y(e)));return t?{kind:`time`,cue:t}:{kind:`draw`,chapter:e}}let r=n[t];if(r&&!this.kept.get(y(r))?.speech)return{kind:`speak`,cue:r}}return null}sound(e,t){let n=this.kept.get(e);if(!n?.speech)return;let r=JSON.stringify(t.waits),i=n.sounds.get(r);return i||(i=re(n.speech,t),n.sounds.set(r,i)),i}draw(e,t){let n=this.script[t]??[],r=n.map(y),i=ie(n,r.map(e=>{let t=this.kept.get(e);if(!t)throw Error(`no clock of the cue ${e}`);return t.timing})),a=e.render(t,i);if(a._tag===`Left`)return a;let{lottie:o,waits:s,embeds:c,background:l,warnings:u}=a.right;this.drawn[t]=!0;let d=i.endFrame+s.reduce((e,t)=>e+t.samples,0);this.knownRate=i.sampleRate,this.lengths[t]=d,this.warnings[t]=u;let f=se([JSON.stringify([r,i,s,c,l]),o]);if(this.drawings[t]?.made===f)return{_tag:`Right`,right:void 0};let p=ne(i,s),m={animation:JSON.parse(o),rate:i.sampleRate,length:d,cues:p.map((e,t)=>({at:e.at,length:e.length,samples:this.sound(r[t]??``,e)})),embeds:c.map(({path:t,image:n,kind:r,start:i,frames:a})=>({path:ce(e.folder,t),...n===void 0?{}:{image:ce(e.folder,n)},kind:r,background:l,at:i,seconds:a/60}))};return this.drawings[t]={made:f,chapter:m,keys:r,places:p},this.changed(),{_tag:`Right`,right:void 0}}spoken(e){let t=!1;this.drawings.forEach((n,r)=>{if(!n?.keys.includes(e))return;let i=n.chapter.cues.map((t,r)=>{let i=n.places[r];return n.keys[r]===e&&i?{...t,samples:this.sound(e,i)}:t});this.drawings[r]={...n,chapter:{...n.chapter,cues:i}},t=!0}),t&&this.changed()}forget(){let e=new Set(this.script.flat().map(y));for(let t of this.kept.keys())e.has(t)||this.kept.delete(t)}state(){let e=this.seconds(),t=e.pop()??0;return{building:this.running,timeline:this.script.map((t,n)=>({title:this.titles[n]??``,start:e[n]??0})),duration:t,errors:this.errors,warnings:this.warnings.flat(),chapters:this.drawings.map(e=>e?.chapter)}}};function de(e){let t=null,n=!1,r=null,i=()=>(r=e.workspace.projects(),r),a=async t=>{if(!t.project){let e=await(r??i());if(t.stale||t.halted)return{_tag:`Right`,right:void 0};if(e._tag===`Left`)return e;let n=e.right.find(e=>e.name===t.name);if(!n)throw Error(`the workspace has no project ${t.name}`);let a=await(n.readScript?.()??n.script());if(t.stale||t.halted)return{_tag:`Right`,right:void 0};if(a._tag===`Left`)return a;let{script:o}=a.right;t.project=n,t.titles=n.titles,t.script=o,t.estimates=o.map(e=>p(e)),t.drawings.length!==o.length&&(t.drawings=Array.from({length:o.length},()=>void 0),t.lengths=Array.from({length:o.length},()=>void 0)),t.warnings=Array.from({length:o.length},()=>[]),t.drawn=Array.from({length:o.length},()=>!1),t.prune(),t.changed()}let n=t.project;for(let r=t.next();r&&!t.stale&&!t.halted;r=t.next()){if(r.kind===`draw`){if(await n.readChapter?.(r.chapter),t.stale||t.halted)break;let e=t.draw(n,r.chapter);if(e._tag===`Left`)return e;continue}let{cue:i}=r,a=y(i);if(r.kind===`time`){let n=await e.voice.time(i.words);t.kept.set(a,{timing:n,sounds:new Map});continue}let o=await e.voice.speak(i.words),s=t.kept.get(a);if(!s)throw Error(`no clock of the cue ${a}`);le(i,o,s.timing),s.speech=o,t.spoken(a)}return!t.stale&&!t.halted&&t.forget(),{_tag:`Right`,right:void 0}},o=e=>{e.running=!0,e.done=(async()=>{try{for(;;){e.stale=!1;let t=await a(e);if(e.errors=t._tag===`Left`?t.left:[],!e.stale||e.halted)break}}finally{e.running=!1,e.changed()}})()};return{refresh:e=>{r=null;let i=t;!n&&i&&(i.place=e,i.project=null,i.running?i.stale=!0:o(i))},halt:()=>{r=null,t&&=(t.halted=!0,t.watcher=null,null)},stop:()=>{n=!0,t&&(t.halted=!0,t.watcher=null)},idle:()=>t?.done??Promise.resolve(),build:{list:async()=>{let e=await i();return e._tag===`Left`?e:{_tag:`Right`,right:e.right.map(({name:e,title:t,section:n})=>({name:e,title:t,...n===void 0?{}:{section:n}}))}},watch:(e,r)=>{n||(t?.name!==e&&(t&&(t.halted=!0,t.watcher=null),t=new ue(e),o(t)),t.watcher=r,t.changed())},seek:(e,r)=>{t?.name===e&&(t.place=r,t.prune()&&t.changed(),!n&&!t.running&&t.project&&t.errors.length===0&&t.next()!==null&&o(t))}}}}var fe=e=>{if(typeof e==`boolean`)return null;let t=e.anyOf==null?e.oneOf==null?null:`oneOf`:`anyOf`;if(t==null)return null;let n=e[t];if(n==null)return null;let r=n.filter(e=>!pe(e));if(r.length===n.length||r.length===0)return null;let i=r.map(e=>fe(e)??e);return i.length===1?i[0]:{...e,[t]:i}},pe=e=>typeof e!=`boolean`&&e.type===`null`,me=e=>typeof e==`string`?`"${e}"`:typeof e==`number`||typeof e==`boolean`?`${e}`:typeof e==`bigint`?`${e}n`:e===null?`null`:Array.isArray(e)?`Array`:typeof e==`object`?`Object`:JSON.stringify(e),he=e=>{if(e.length===0)return``;let t=e[0];for(let n of e.slice(1))n.startsWith(`[`)?t+=n:t+=`.`+n;return t},b=(e,t)=>{let n=[...e,...t];return n.length>0?`(${he(n)})`:``},x=e=>e.filter(e=>e.length>0).join(` `),ge=(e,t,n)=>x([b(t,e.path),[e.message,n?`received: ${me(e.received)}`:``].filter(e=>e.length>0).join(`, `)]),_e=(e,t)=>{let n=b(t,e.path),r=S(e.errors,[],!1);return x([n,[`Failed to decode one of (${r.length>5?r.slice(0,5).join(` OR `)+` and more...`:r.join(` | `)})`,`received: ${me(e.received)}`].filter(e=>e.length>0).join(`, `)])},S=(e,t,n)=>e.map(e=>`isUnionError`in e?_e(e,t):ge(e,t,n)),ve=(e,t=[])=>S(e,t,!0).map((e,t,n)=>n.length==1?x([e]):x([`#${t}`,e])).join(` | `),C=Object.getPrototypeOf({});function ye(e){function t(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0,configurable:!0}):e[t]=n}function n(e){let t=0,n=e.length,r=Array(n);for(;t<n;++t)r[t]=p(e[t]);return r}function r(e){let n={};if(c&&Object.getPrototypeOf(e)!==C)return c(e);let r=s(e),i,a,o;for(i=0,a=r.length;i<a;++i)o=r[i],t(n,o,p(e[o]));return n}function i(e,t){let n=e.length,r=t.length,i=0,a=Array(n+r);for(;i<n;++i)a[i]=p(e[i]);for(i=0;i<r;++i)a[i+n]=p(t[i]);return a}let a=Object.prototype.propertyIsEnumerable;function o(e){let t=Object.keys(e),n=Object.getOwnPropertySymbols(e);for(let r=0,i=n.length;r<i;++r)a.call(e,n[r])&&t.push(n[r]);return t}let s=e?.symbols?o:Object.keys,c=typeof e?.cloneProtoObject==`function`?e.cloneProtoObject:void 0;function l(e){return typeof e==`object`&&!!e&&!(e instanceof RegExp)&&!(e instanceof Date)&&!(e instanceof Map)&&!(e instanceof Set)&&!ArrayBuffer.isView(e)}function u(e){return typeof e!=`object`||!e}let d=typeof Buffer<`u`?e=>typeof e!=`object`||!e||e instanceof RegExp||e instanceof Date||ArrayBuffer.isView(e)||e instanceof Buffer:e=>typeof e!=`object`||!e||e instanceof RegExp||e instanceof Date||ArrayBuffer.isView(e),f=e&&typeof e.mergeArray==`function`?e.mergeArray({clone:p,deepmerge:h,getKeys:s,isMergeableObject:l}):i;function p(e){return l(e)?Array.isArray(e)?n(e):r(e):e}function m(e,n){let r={},i=s(e),a=s(n),o,u,d;for(o=0,u=i.length;o<u;++o)d=i[o],a.indexOf(d)===-1&&t(r,d,p(e[d]));for(o=0,u=a.length;o<u;++o)d=a[o],i.indexOf(d)===-1?t(r,d,p(n[d])):c&&l(n[d])&&Object.getPrototypeOf(n[d])!==C?t(r,d,c(n[d])):t(r,d,h(e[d],n[d]));return r}function h(e,t){let n=Array.isArray(t),r=Array.isArray(e);return u(t)||t instanceof Map||t instanceof Set?t:d(e)?p(t):n&&r?f(e,t):n===r?m(e,t):p(t)}function g(){switch(arguments.length){case 0:return{};case 1:return p(arguments[0]);case 2:return h(arguments[0],arguments[1])}let e;for(let t=0,n=arguments.length;t<n;++t)e=h(e,arguments[t]);return e}return g}function be(e){let t=e.deepmerge,n=e.clone;return function(e,r){let i=0,a=r.length,o=Math.max(e.length,r.length),s=Array(o);for(i=0;i<o;++i)i<a?s[i]=t(e[i],r[i]):s[i]=n(e[i]);return s}}ye({mergeArray:be});function w(e,t,n){return[{message:t,path:[...e.path],received:n}]}function xe(e,t){let n=[];for(let r=0;r<=e.length;r++){n.push([r]);for(let i=1;i<=t.length;i++)n[r][i]=r===0?i:Math.min(n[r-1][i]+1,n[r][i-1]+1,n[r-1][i-1]+(e[r-1]===t[i-1]?0:1)),r>1&&i>1&&e[r-1]===t[i-2]&&e[r-2]===t[i-1]&&(n[r][i]=Math.min(n[r][i],n[r-2][i-2]+1))}return n[e.length][t.length]}function Se(e,t,n,r){if(n==null){T(e,t);let n=w(e,`extra property`,r);return E(e),n}let i=null,a=Math.max(1,Math.floor(t.length/3));for(let e of n){let n=xe(t,e);n<=a&&n<t.length&&(i==null||n<a)&&(i=e,a=n)}let o=i==null?``:` Did you mean ${JSON.stringify(i)}?`,s=n.length===0?`none`:n.map(e=>JSON.stringify(e)).join(`, `);T(e,t);let c=w(e,`extra property.${o} Allowed: ${s}`,r);return E(e),c}function Ce(e,t,n,r,i){r.validate(e,i)||(T(e,n),t.push(...r.reportDecodeError(e,i)),E(e))}function T(e,t){e.path.push(t)}function E(e){e.path.pop()}function we(e,t,n){e[t]=typeof n==`function`?{validator:n}:n}function Te(e,t,n){e[t]=typeof n==`function`?{validator:n}:n}function D(e,t){return e?.description==null?t:{...t,description:e.description}}function O(e){let t=e.replace(/\*\//g,`* /`).split(`
3
- `);return t.length===1?`/** ${t[0]} */`:[`/**`,...t.map(e=>` * ${e}`),` */`].join(`
4
- `)}function k(e,t){return t==null?{typeExpr:e}:{typeExpr:e,docText:t}}var A=class{metadata;constructor(e){this.metadata=e}describe(e){return k(this.describeTypeExpr(e),this.metadata?.description)}describeChildren(){return[]}};function j(e,t){return t.describe(e).typeExpr}function Ee(e){return e.docText==null?e.typeExpr:`${O(e.docText)}\n${e.typeExpr}`}function M(e,t){let n=`type ${e} = ${t.typeExpr};`;return t.docText==null?n:`${O(t.docText)}\n${n}`}function De(e){return/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)||/^(0|[1-9][0-9]*)$/.test(e)?e:JSON.stringify(e)}function N(e,t,n){let r=n instanceof F?`?`:``,i=n.describe(e);return{docText:i.docText,member:`${t}${r}: ${i.typeExpr}`}}function Oe(e,t,n){return N(e,`[K in ${j(e,t)}]`,n)}function ke(e){let t=`${e.member};`;return e.docText==null?t:`${O(e.docText)}\n${t}`}function P(e,t){if(e instanceof Fe)e.collectDescribeRefs(t);else for(let n of e.describeChildren())P(n,t)}var Ae=class extends A{typeName;constructor(e,t){super(e),this.typeName=t}describeTypeExpr(e){return this.typeName}schema(e){return D(this.metadata,{type:this.typeName})}validate(e,t){return typeof t===this.typeName}parseAfterValidation(e,t){return t}reportDecodeError(e,t){return w(e,`expected `+this.typeName,t)}},je=class extends A{constructor(e){super(e)}describeTypeExpr(e){return`any`}schema(e){return D(this.metadata,{})}validate(e,t){return!0}parseAfterValidation(e,t){return t}reportDecodeError(e,t){return w(e,`expected any`,t)}},Me=class extends A{constructor(e){super(e)}describeTypeExpr(e){return`never`}schema(e){return D(this.metadata,{anyOf:[]})}validate(e,t){return!1}parseAfterValidation(e,t){throw Error(`unreachable`)}reportDecodeError(e,t){return w(e,`expected never`,t)}},Ne=class extends A{itemParser;constructor(e,t){super(e),this.itemParser=t}schema(e){T(e,`[]`);let t=this.itemParser.schema(e);return E(e),D(this.metadata,{type:`array`,items:t})}validate(e,t){if(Array.isArray(t)){for(let n=0;n<t.length;n++){let r=t[n];if(!this.itemParser.validate(e,r))return!1}return!0}return!1}parseAfterValidation(e,t){return t.map(t=>this.itemParser.parseAfterValidation(e,t))}reportDecodeError(e,t){if(!Array.isArray(t))return w(e,`expected array`,t);let n=[];for(let r=0;r<t.length;r++)Ce(e,n,`[${r}]`,this.itemParser,t[r]);return n}describeTypeExpr(e){return`Array<${j(e,this.itemParser)}>`}describeChildren(){return[this.itemParser]}},F=class{t;constructor(e){this.t=e}schema(e){return{anyOf:[this.t.schema(e),{type:`null`}]}}validate(e,t){return t==null||this.t.validate(e,t)}parseAfterValidation(e,t){return t==null?t:this.t.parseAfterValidation(e,t)}reportDecodeError(e,t){return this.t.reportDecodeError(e,t)}describe(e){return this.t.describe(e)}describeChildren(){return[this.t]}},I=Object.prototype.hasOwnProperty;function L(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0,configurable:!0}):e[t]=n}var Pe=class extends A{properties;indexedPropertiesParser;constructor(e,t,n){super(e),this.properties=t,this.indexedPropertiesParser=n}describeTypeExpr(e){let t=Object.keys(this.properties).sort().map(t=>{let n=this.properties[t];return N(e,De(t),n)}),n=this.indexedPropertiesParser.map(({key:t,value:n})=>Oe(e,t,n)),r=[...t,...n];return r.some(e=>e.docText!=null)?r.length===0?`{}`:`{\n${r.map(ke).join(`
5
- `)}\n}`:`{ ${r.map(e=>e.member).join(`, `)} }`}describeChildren(){return[...Object.values(this.properties),...this.indexedPropertiesParser.flatMap(({key:e,value:t})=>[e,t])]}schema(e){let t={},n=new Set;for(let r in this.properties){T(e,r);let i=this.properties[r].schema(e),a=fe(i);a==null?t[r]=i:(t[r]=a,n.add(r)),E(e)}let r=Object.keys(this.properties).filter(e=>!n.has(e)),i={type:`object`,properties:t,...r.length>0?{required:r}:{}},a=this.indexedPropertiesParser.map(({key:t,value:n})=>{T(e,`[key]`);let r=t.schema(e);E(e),T(e,`[value]`);let i=n.schema(e);return E(e),{type:`object`,additionalProperties:i,propertyNames:r}});if(a.length===0)return D(this.metadata,{...i,additionalProperties:!1});if(Object.keys(t).length===0&&a.length===1){let e=this.indexedPropertiesParser[0].value;return e instanceof Me?D(this.metadata,{type:`object`,additionalProperties:!1}):e instanceof je?D(this.metadata,{...a[0],additionalProperties:!0}):D(this.metadata,a[0])}return D(this.metadata,{allOf:[i,...a]})}validate(e,t){if(typeof t==`object`&&!Array.isArray(t)&&t!==null){let n=Object.keys(this.properties);for(let r of n)if(!this.properties[r].validate(e,t[r]))return!1;if(this.indexedPropertiesParser.length>0){let n=Object.keys(t).filter(e=>!I.call(this.properties,e));for(let r of n){let n=!1;for(let i of this.indexedPropertiesParser){if(!i.key.validate(e,r))continue;let a=t[r];if(i.value.validate(e,a)){n=!0;break}}if(!n&&!this.leavesKeyToIntersection(e,t,r))return!1}}else if(e.disallowExtraProperties&&e.intersectionInput!==t&&Object.keys(t).filter(e=>!I.call(this.properties,e)).length>0)return!1;return!0}return!1}parseAfterValidation(e,t){let n={},r=Object.keys(t);if(e.objectKeyOrder===`input`)for(let i of r)if(I.call(this.properties,i))L(n,i,this.properties[i].parseAfterValidation(e,t[i]));else for(let r of this.indexedPropertiesParser){let a=t[i];if(r.key.validate(e,i)&&r.value.validate(e,a)){let t=r.value.parseAfterValidation(e,a);L(n,r.key.parseAfterValidation(e,i),t)}}else{let i=Object.keys(this.properties).sort();for(let r of i){if(!I.call(t,r))continue;let i=t[r];L(n,r,this.properties[r].parseAfterValidation(e,i))}if(this.indexedPropertiesParser.length>0){let i=r.filter(e=>!I.call(this.properties,e)).sort();for(let r of i){let i=t[r];for(let t of this.indexedPropertiesParser)if(t.key.validate(e,r)&&t.value.validate(e,i)){let a=t.value.parseAfterValidation(e,i);L(n,t.key.parseAfterValidation(e,r),a)}}}}return n}reportDecodeError(e,t){if(typeof t!=`object`||Array.isArray(t)||t===null)return w(e,`expected object`,t);let n=[],r=Object.keys(this.properties);for(let i of r)Ce(e,n,i,this.properties[i],t[i]);if(this.indexedPropertiesParser.length>0){let r=Object.keys(t).filter(e=>!I.call(this.properties,e));for(let i of r)if(!this.leavesKeyToIntersection(e,t,i))for(let r of this.indexedPropertiesParser){let a=r.key.validate(e,i),o=r.value.validate(e,t[i]);if(!(a&&o)){if(T(e,i),!a){let t=r.key.reportDecodeError(e,i);n.push(...t)}if(!o){let a=r.value.reportDecodeError(e,t[i]);n.push(...a)}E(e)}}}else if(e.disallowExtraProperties&&e.intersectionInput!==t){let n=Object.keys(t).filter(e=>!I.call(this.properties,e));if(n.length>0)return n.flatMap(n=>Se(e,n,r,t[n]))}return n}allowedKeys(){return this.indexedPropertiesParser.length>0?null:Object.keys(this.properties)}leavesKeyToIntersection(e,t,n){return e.intersectionInput===t&&!this.indexedPropertiesParser.some(t=>t.key.validate(e,n))}},Fe=class extends A{refName;namedRuntypes;constructor(e,t,n){super(e),this.refName=t,this.namedRuntypes=n}getNamedRuntypes(){return this.namedRuntypes}describeTypeExpr(e){return this.refName}collectDescribeRefs(e){let t=this.refName;e.refCounts[t]=(e.refCounts[t]||0)+1,e.activeRefs.has(t)||e.visitedRefs.has(t)||(e.visitedRefs.add(t),e.activeRefs.add(t),P(this.getNamedRuntypes()[t],e),e.activeRefs.delete(t))}describe(e){let t=this.refName,n=this.getNamedRuntypes()[this.refName],r=()=>k(t,this.metadata?.description);if(e.refCounts[t]>1)return e.activeRefs.has(t)||(e.definitions[t]??(e.activeRefs.add(t),e.definitions[t]=n.describe(e),e.activeRefs.delete(t))),r();let i=n.describe(e);return this.metadata?.description==null?i:k(i.typeExpr,this.metadata.description)}schema(e){let t=this.refName,n=this.getNamedRuntypes()[this.refName];if(e.mode===`contextual`){let r=e.printingContext;if(r==null)throw Error(`INTERNAL ERROR: Missing SchemaPrintingContext`);if(!r.hasDefinition(t)&&!r.isDefinitionInProgress(t)){r.markDefinitionInProgress(t);let i=(r.getNamedTypeSchemaOverride(t)??n).schema(e);r.storeDefinition(t,i)}return D(this.metadata,{$ref:r.getRef(t)})}if(e.seen[t])return D(this.metadata,{});e.seen[t]=!0;var r=n.schema(e);return delete e.seen[t],D(this.metadata,r)}validate(e,t){return this.getNamedRuntypes()[this.refName].validate(e,t)}parseAfterValidation(e,t){return this.getNamedRuntypes()[this.refName].parseAfterValidation(e,t)}reportDecodeError(e,t){return this.getNamedRuntypes()[this.refName].reportDecodeError(e,t)}},Ie=class{_runtype;name;hideTypeNameInDescribe;constructor(e,t,n){this._runtype=e,this.name=t,this.hideTypeNameInDescribe=n}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;let r=ve(n.errors,[]);throw Error(`Failed to parse ${this.name} - ${r}`)}safeParse(e,t){let n=t?.disallowExtraProperties??!1,r=t?.objectKeyOrder??`input`;if(this.validate(e,t)){let t={disallowExtraProperties:n,objectKeyOrder:r};return{success:!0,data:this._runtype.parseAfterValidation(t,e)}}let i={path:[],disallowExtraProperties:n};return{success:!1,errors:this._runtype.reportDecodeError(i,e).slice(0,10)}}validate(e,t){let n={disallowExtraProperties:t?.disallowExtraProperties??!1},r=this._runtype.validate(n,e);if(typeof r!=`boolean`)throw Error(`INTERNAL ERROR: Expected boolean`);return r}schema(){return this._runtype.schema({path:[],seen:{},mode:`flat`})}schemaWithContext(e){let t={path:[],seen:{},mode:`contextual`,printingContext:e};return this._runtype.schema(t)}describe(){let e={activeRefs:new Set,definitions:{},refCounts:{},visitedRefs:new Set};P(this._runtype,e);let t=this._runtype.describe(e),n=Object.keys(e.definitions).sort().map(t=>[t,e.definitions[t]]).map(([e,t])=>M(e,t)).join(`
6
-
7
- `);return this.hideTypeNameInDescribe?[n,Ee(t)].filter(e=>e!=null&&e.length>0).join(`
8
-
9
- `):[n,M(`Codec${this.name}`,t)].filter(e=>e!=null&&e.length>0).join(`
10
-
11
- `)}},Le=(e,t,n)=>new Ie(e,t,n),Re=(e,t)=>{let n=t?.stringFormats??{};for(let t of e.requiredStringFormats)if(n[t]==null)throw Error(`Missing custom format ${t}`);Object.keys(n).forEach(t=>{let r=n[t];we(e.stringFormatters,t,r)});let r=t?.numberFormats??{};for(let t of e.requiredNumberFormats)if(r[t]==null)throw Error(`Missing custom format ${t}`);Object.keys(r).forEach(t=>{let n=r[t];Te(e.numberFormatters,t,n)});let i={};for(let t of Object.keys(e.parsers))i[t]=Le(e.parsers[t],t,!1);return i},ze=[],Be=[],R={},Ve={},He={},Ue=new Fe(void 0,`PackageJson`,R),We=new je(void 0),z=new Ae(void 0,`string`),Ge=new Ne(void 0,z),Ke=new Pe({description:`The part of a package.json that aula reads: how a package names its module and its
12
- workspace packages, and its version when the CLI compares it to the project's.`},{exports:new F(We),main:new F(z),module:new F(z),name:new F(z),version:new F(z),workspaces:new F(Ge)},[]);Object.assign(R,{PackageJson:Ke});var qe={PackageJson:Ue},Je={buildParsers:e=>Re({parsers:qe,stringFormatters:Ve,numberFormatters:He,requiredStringFormats:ze,requiredNumberFormats:Be},e)}.buildParsers();function Ye(e,t){let n=[...e];return{read:t,list:e=>{let t=e===``?``:`${e}/`,r=new Set;for(let e of n){if(!e.startsWith(t))continue;let[n,...i]=e.slice(t.length).split(`/`);n!==void 0&&i.length>0&&r.add(n)}return Promise.resolve([...r].toSorted())}}}var B=Object.fromEntries([`@beff/aula`,`@beff/aula-method`].map(e=>[e,`aula-provide:${e}`])),V=`aula-projects.ts`;function Xe(e,t){let n=e;for(let[e,r]of Object.entries(B)){let i=t[e];i!==void 0&&(n=n.replaceAll(JSON.stringify(r),JSON.stringify(i)))}return n}var H=`tree:`;function U(e){let t=e.lastIndexOf(`/`);return t<0?``:e.slice(0,t)}function W(e,t){let n=e===``?[]:e.split(`/`);for(let e of t.split(`/`))if(e!==``&&e!==`.`){if(e===`..`){if(!n.length)return null;n.pop()}else n.push(e)}return n.join(`/`)}var Ze=new Map([[`ts`,`ts`],[`mts`,`ts`],[`js`,`js`],[`mjs`,`js`],[`json`,`json`]]),Qe=e=>Ze.get(e.slice(e.lastIndexOf(`.`)+1))??`ts`;function $e(e,t){return{name:`aula-tree`,setup(n){n.onResolve({filter:/.*/},async n=>{let r=t[n.path];if(r!==void 0)return{path:r,external:!0};if(n.kind===`entry-point`)return{path:W(``,n.path)??n.path,namespace:`tree`};if(!n.path.startsWith(`./`)&&!n.path.startsWith(`../`)){let t=await at(e,n.path,n.importer);return t===null?{errors:[{text:`cannot find the package "${n.path}" in node_modules or the workspace packages`}]}:{path:t,namespace:`tree`}}let i=W(U(n.importer),n.path);if(i===null)return{errors:[{text:`"${n.path}" is outside the folder you opened`}]};for(let t of[i,`${i}.ts`,`${i}/index.ts`])if(await e.read(t)!==null)return{path:t,namespace:`tree`};return{errors:[{text:`cannot find "${n.path}" (${i})`}]}}),n.onLoad({filter:/.*/,namespace:`tree`},async t=>{let n=await e.read(t.path);return n===null?{errors:[{text:`cannot read ${t.path}`}]}:{contents:n,loader:Qe(t.path)}})}}}function et(e){return typeof e==`object`&&!!e&&typeof Reflect.get(e,`text`)==`string`}var tt=({text:e,location:t})=>({severity:`error`,code:`bundle-error`,message:e,...t?{location:{file:t.file.replace(H,``),line:t.line,col:t.column+1}}:{},stack:[],related:[]});async function nt(e,t,n,r){let i;try{i=await e.build({entryPoints:[n],bundle:!0,write:!1,format:`esm`,platform:`browser`,target:`es2024`,outfile:`bundle.js`,sourcemap:`both`,sourcesContent:!1,metafile:!0,logLevel:`silent`,plugins:[$e(t,r)]})}catch(e){let t=typeof e==`object`&&e?Reflect.get(e,`errors`):void 0;if(Array.isArray(t)&&t.every(et))return{_tag:`Left`,left:t.map(tt)};throw e}let a=i.outputFiles.find(e=>e.path.endsWith(`.js`))?.text,o=i.outputFiles.find(e=>e.path.endsWith(`.js.map`))?.text;if(a===void 0||o===void 0)throw Error(`esbuild wrote no bundle`);return{_tag:`Right`,right:{code:a,map:o,inputs:Object.keys(i.metafile?.inputs??{}).filter(e=>e.startsWith(H)).map(e=>e.slice(5))}}}function G(e,t){if(typeof e==`string`)return t===`.`?e:null;if(typeof e!=`object`||!e)return null;if(Object.keys(e).some(e=>e.startsWith(`.`)))return t in e?G(Reflect.get(e,t),`.`):null;for(let t of[`browser`,`import`,`default`])if(t in e)return G(Reflect.get(e,t),`.`);return null}function K(e){let t=e.split(`/`),n=e.startsWith(`@`)?2:1,r=t.slice(n).join(`/`);return{name:t.slice(0,n).join(`/`),subpath:r===``?`.`:`./${r}`}}async function q(e,t,n){let r=J(`${t}/package.json`,await e.read(`${t}/package.json`));return r?W(t,G(r.exports,n)??(n===`.`?r.module??r.main??`index.js`:n)):null}async function rt(e,t,n){let{name:r,subpath:i}=K(t);for(let t=U(n);;t=U(t)){let n=await q(e,t===``?`node_modules/${r}`:`${t}/node_modules/${r}`,i);if(n!==null)return n;if(t===``)return null}}function J(e,t){if(t===null)return null;let n=Je.PackageJson.safeParse(JSON.parse(t));return n.success?n.data:null}async function it(e){let t=[],n=await e.read(`pnpm-workspace.yaml`);if(n!==null){let e=!1;for(let r of n.split(`
13
- `))if(/^packages:\s*$/.test(r))e=!0;else if(/^\S/.test(r))e=!1;else if(e){let e=/^\s*-\s*["']?([^"'#]+?)["']?\s*(#.*)?$/.exec(r)?.[1];e!==void 0&&t.push(e)}}t.push(...J(`package.json`,await e.read(`package.json`))?.workspaces??[]);let r=[];for(let n of t){let t=n.replace(/^\.\//,``).replace(/\/$/,``);if(t.endsWith(`/*`)){let n=t.slice(0,-2);r.push(...(await e.list(n)).map(e=>`${n}/${e}`))}else t.includes(`*`)||r.push(t)}return r}async function at(e,t,n){let r=await rt(e,t,n);if(r!==null)return r;let{name:i,subpath:a}=K(t);for(let t of await it(e))if(J(`${t}/package.json`,await e.read(`${t}/package.json`))?.name===i)return q(e,t,a);return null}var Y=/^(\d+)-/,X=e=>e.replace(Y,``);function ot(e){let t=X(e).replaceAll(`-`,` `);return t.charAt(0).toUpperCase()+t.slice(1)}var Z=(e,t)=>e<t?-1:+(e>t);function st(e,t){let n=Y.exec(e)?.[1],r=Y.exec(t)?.[1];if(n===void 0||r===void 0){if(n!==r)return n===void 0?1:-1}else{let[e,t]=[n.replace(/^0+/,``),r.replace(/^0+/,``)],i=e.length-t.length||Z(e,t);if(i!==0)return i}return Z(X(e),X(t))||Z(e,t)}async function ct(e,t){return(await e.list(t)).filter(e=>e!==`node_modules`&&!e.startsWith(`.`)).toSorted(st)}var Q=async(e,t)=>await e.read(t)!==null;async function lt(e,t){if(await Q(e,`index.ts`))return{_tag:`Right`,right:[{module:`index.ts`,name:X(t)}]};let n=[];for(let t of await ct(e,``))if(await Q(e,`${t}/index.ts`))n.push({module:`${t}/index.ts`,name:X(t)});else for(let r of await ct(e,t)){let i=`${t}/${r}/index.ts`;await Q(e,i)&&n.push({module:i,name:X(r),section:ot(t)})}let r=[];return n.forEach((e,t)=>{let i=n.findIndex(t=>t.name===e.name);if(i===t)return;let a=[n[i],e].map(e=>(e?.module??``).slice(0,-9));r.push({severity:`error`,code:`duplicate-project-name`,message:`two projects have the name ${e.name}: ${a.join(` and `)}`,hint:`the name of a project is its folder name without the order prefix: rename one of the folders`,stack:[],related:[]})}),r.length>0?{_tag:`Left`,left:r}:{_tag:`Right`,right:n}}async function ut(e,t,n){let r=await lt(t,n);if(r._tag===`Left`)return r;let i=r.right;if(i.length===0)throw Error(`no project here: open a folder that has index.ts, or whose subfolders have index.ts`);let a=[...i.map((e,t)=>`import p${String(t)} from ${JSON.stringify(`./${e.module}`)};`),`export default [${i.map((e,t)=>`p${String(t)}`).join(`, `)}];`].join(`
14
- `),o=await nt(e,{read:e=>e===`aula-projects.ts`?Promise.resolve(a):t.read(e),list:e=>t.list(e)},V,B);return o._tag===`Left`?o:{_tag:`Right`,right:{bundle:{name:n,projects:i,code:o.right.code,map:o.right.map},inputs:o.right.inputs}}}var dt=(e,t)=>({frames:e,name:e=>/^[a-z][a-z0-9+.-]*:/.test(e)?void 0:e,exists:()=>!0,...t?{media:t}:{}}),ft=(e,t)=>typeof e==`object`&&e?Reflect.get(e,t):void 0;async function pt(e,t,i,o,s){await u(),await l(),s?.();let c=Xe(e.code,o),d=await n(()=>i.load({code:c,map:e.map}));if(d._tag===`Left`)return{_tag:`Left`,left:[a(d.left,V,t)]};let f=ft(d.right.exports,`default`);if(!Array.isArray(f))throw Error(`${V} has no list of projects`);return{_tag:`Right`,right:f.map((n,i)=>{let a=e.projects[i];if(!r(n))throw Error(`the default export of ${a?.module??``} is not made by defineProject: write \`export default defineProject({ title, theme, chapters: [ … ] })\``);return gt(a?.name??``,ht(a?.module??`index.ts`),a?.section,n,t)})}}async function mt(e,t,n,r,i,a){let o=await e.name(),[s]=await Promise.all([ut(r,e,o),u().then(async()=>{await l(),a?.()})]);return s._tag===`Left`?s:pt(s.right.bundle,t,n,i)}var ht=e=>e.slice(0,Math.max(0,e.lastIndexOf(`/`)));function gt(e,t,n,r,a){let l=r.chapters.length+1;return{name:e,folder:t,...n===void 0?{}:{section:n},title:r.title,chapters:l,titles:[r.title,...r.chapters.map(e=>e.heading)],script:()=>{let e=[];for(let t of r.chapters.keys()){let n=o(r,t+1,{host:a});if(n.value===void 0)return{_tag:`Left`,left:n.diagnostics};e.push(n.value)}return{_tag:`Right`,right:{script:d(r,e)}}},walk:e=>{e>0&&c(r,e,{host:a})},render:(e,t)=>{let n=i(r,e,{host:a,narration:t});if(!n.ok||n.value===void 0)return{_tag:`Left`,left:n.diagnostics};let{lottie:o,waits:c,embeds:l,diagnostics:u}=n.value;return{_tag:`Right`,right:{lottie:o,waits:c,embeds:l,background:(r.theme??s).background,warnings:u}}}}}function _t(e){return e}function vt(e,t){return Object.assign({},e,t)}function yt(e,t){return{...e,...t}}function bt(...e){return Object.assign({},...e)}var xt={create:_t,extend:vt,merge:bt,override:yt},St=class extends Error{constructor(e,t){super(e),this.stack=t}};function Ct(e,t,n){return e===``?``:` at ${e}:${String(t)}:${String(n)}`}var $=e=>`${e.file}:${String(e.line)}:${String(e.col)}`;function wt(e,t){if(!(e instanceof Error))return{message:String(e),place:null,stack:[]};let n=t(e),[r]=n;return{message:e.name===`Error`||e.name===``?e.message:`${e.name}: ${e.message}`,place:r?$(r):null,stack:n.map(e=>e.function===``?`at ${$(e)}`:`at ${e.function} (${$(e)})`)}}function Tt(e,t,n){let r=(t,n,r)=>{let i=e.createElement(t);return i.className=n,i.textContent=r,i},i=r(`div`,`crash`,``);i.setAttribute(`role`,`alert`),i.append(r(`h1`,``,`The app stopped because of an error.`),r(`p`,`message`,t.message)),t.place!==null&&i.append(r(`p`,`place`,`at ${t.place}`)),t.stack.length>0&&i.append(r(`pre`,`stack`,t.stack.join(`
15
- `)));let a=r(`button`,`reload`,`Reload`);a.addEventListener(`click`,n),i.append(a),e.body.replaceChildren(i)}var Et=2e5;function Dt(e){let{layers:t,...n}=e,r=[JSON.stringify({...n,layers:[]})],i=[],a=0;for(let e of t){let t=JSON.stringify(e);a>0&&a+t.length>Et&&(r.push(`[${i.join(`,`)}]`),i=[],a=0),i.push(t),a+=t.length+1}return i.length>0&&r.push(`[${i.join(`,`)}]`),r}async function Ot(e,t){let[n,...r]=e;if(n===void 0)throw Error(`a Lottie animation with no parts`);let i=JSON.parse(n);for(let e of r){await t();let n=JSON.parse(e);i.layers.push(...n)}return i}var kt=e=>e.map(e=>({...e,text:m(e)}));function At(e){let t=Reflect.get(e,`text`);if(typeof t!=`string`)throw Error(`a diagnostic with no text: ${e.message}`);return t}export{St as a,Tt as c,mt as d,dt as f,oe as g,de as h,Dt as i,xt as l,Ye as m,kt as n,wt as o,H as p,Ot as r,Ct as s,At as t,pt as u};