mancha 0.8.2 → 0.8.3

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.
@@ -462,49 +462,49 @@ function tblr(props) {
462
462
  return Object.entries(props)
463
463
  .flatMap(([prop, klass]) => [
464
464
  // Auto top.
465
- [`.${klass}t-auto`, `${prop}-top: auto`],
465
+ [`${klass}t-auto`, `${prop}-top: auto`],
466
466
  // Auto bottom.
467
- [`.${klass}b-auto`, `${prop}-bottom: auto`],
467
+ [`${klass}b-auto`, `${prop}-bottom: auto`],
468
468
  // Auto left.
469
- [`.${klass}l-auto`, `${prop}-left: auto`],
469
+ [`${klass}l-auto`, `${prop}-left: auto`],
470
470
  // Auto right.
471
- [`.${klass}r-auto`, `${prop}-right: auto`],
471
+ [`${klass}r-auto`, `${prop}-right: auto`],
472
472
  // Positive REM units top.
473
473
  ...UNITS_ALL.map((v) => [v, v * REM_UNIT]).map(([k, v]) => [
474
- `.${klass}t-${k}`,
474
+ `${klass}t-${k}`,
475
475
  `${prop}-top: ${v}rem`,
476
476
  ]),
477
477
  // Positive REM units bottom.
478
478
  ...UNITS_ALL.map((v) => [v, v * REM_UNIT]).map(([k, v]) => [
479
- `.${klass}b-${k}`,
479
+ `${klass}b-${k}`,
480
480
  `${prop}-bottom: ${v}rem`,
481
481
  ]),
482
482
  // Positive REM units left.
483
483
  ...UNITS_ALL.map((v) => [v, v * REM_UNIT]).map(([k, v]) => [
484
- `.${klass}l-${k}`,
484
+ `${klass}l-${k}`,
485
485
  `${prop}-left: ${v}rem`,
486
486
  ]),
487
487
  // Positive REM units right.
488
488
  ...UNITS_ALL.map((v) => [v, v * REM_UNIT]).map(([k, v]) => [
489
- `.${klass}r-${k}`,
489
+ `${klass}r-${k}`,
490
490
  `${prop}-right: ${v}rem`,
491
491
  ]),
492
492
  // Positive PX units top.
493
- ...UNITS_ALL.map((v) => [`.${klass}t-${v}px`, `${prop}-top: ${v}px`]),
493
+ ...UNITS_ALL.map((v) => [`${klass}t-${v}px`, `${prop}-top: ${v}px`]),
494
494
  // Positive PX units bottom.
495
- ...UNITS_ALL.map((v) => [`.${klass}t-${v}px`, `${prop}-bottom: ${v}px`]),
495
+ ...UNITS_ALL.map((v) => [`${klass}t-${v}px`, `${prop}-bottom: ${v}px`]),
496
496
  // Positive PX units left.
497
- ...UNITS_ALL.map((v) => [`.${klass}t-${v}px`, `${prop}-left: ${v}px`]),
497
+ ...UNITS_ALL.map((v) => [`${klass}t-${v}px`, `${prop}-left: ${v}px`]),
498
498
  // Positive PX units right.
499
- ...UNITS_ALL.map((v) => [`.${klass}t-${v}px`, `${prop}-right: ${v}px`]),
499
+ ...UNITS_ALL.map((v) => [`${klass}t-${v}px`, `${prop}-right: ${v}px`]),
500
500
  // Positive percent units top.
501
- ...PERCENTS.map((v) => [`.${klass}y-${v}%`, `${prop}-top: ${v}%`]),
501
+ ...PERCENTS.map((v) => [`${klass}y-${v}%`, `${prop}-top: ${v}%`]),
502
502
  // Positive percent units bottom.
503
- ...PERCENTS.map((v) => [`.${klass}y-${v}%`, `${prop}-bottom: ${v}%;`]),
503
+ ...PERCENTS.map((v) => [`${klass}y-${v}%`, `${prop}-bottom: ${v}%;`]),
504
504
  // Positive percent units left.
505
- ...PERCENTS.map((v) => [`.${klass}x-${v}%`, `${prop}-left: ${v}%`]),
505
+ ...PERCENTS.map((v) => [`${klass}x-${v}%`, `${prop}-left: ${v}%`]),
506
506
  // Positive percent units right.
507
- ...PERCENTS.map((v) => [`.${klass}x-${v}%`, `${prop}-right: ${v}%`]),
507
+ ...PERCENTS.map((v) => [`${klass}x-${v}%`, `${prop}-right: ${v}%`]),
508
508
  ])
509
509
  .flatMap(([klass, rule]) => [
510
510
  `.${klass} { ${rule} }`,
@@ -515,7 +515,7 @@ function tblr(props) {
515
515
  function border() {
516
516
  return [
517
517
  // Pixel units for border width.
518
- ...UNITS_SM.map((v) => `.border-${v} { border-width: ${v}px; }`),
518
+ ...UNITS_SM.map((v) => `border-${v} { border-width: ${v}px; }`),
519
519
  ].flatMap(([klass, rule]) => [
520
520
  `.${klass} { ${rule} }`,
521
521
  `${wrapPseudoStates(klass).join(",")} { ${rule} }`,
package/dist/mancha.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var t={654:(t,e,n)=>{n.d(e,{A:()=>a});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([t.id,"html{max-width:70ch;padding:2em 1em;margin:auto;line-height:1.75;font-size:1.25em;font-family:sans-serif}h1,h2,h3,h4,h5,h6{margin:1em 0 .5em}ol,p,ul{margin-bottom:1em;color:#1d1d1d}",""]);const a=s},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,i,o){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(s[c]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);r&&s[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),e.push(u))}},e}},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{class t{iterable;constructor(t){this.iterable=t}filter(e){return new t(t.filterGenerator(e,this.iterable))}map(e){return new t(t.mapGenerator(e,this.iterable))}find(t){for(const e of this.iterable)if(t(e))return e}array(){return Array.from(this.iterable)}*generator(){for(const t of this.iterable)yield t}static*filterGenerator(t,e){for(const n of e)t(n)&&(yield n)}static*mapGenerator(t,e){for(const n of e)yield t(n)}static equals(t,e){const n=t[Symbol.iterator](),r=e[Symbol.iterator]();let i=n.next(),o=r.next();for(;!i.done&&!o.done;){if(i.value!==o.value)return!1;i=n.next(),o=r.next()}return i.done===o.done}}var e,r;(r=e||(e={})).Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype",e.Root,e.Text,e.Directive,e.Comment,e.Script,e.Style,e.Tag,e.CDATA,e.Doctype;class i{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(t){this.parent=t}get previousSibling(){return this.prev}set previousSibling(t){this.prev=t}get nextSibling(){return this.next}set nextSibling(t){this.next=t}cloneNode(t=!1){return p(this,t)}}class o extends i{constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}}class s extends o{constructor(){super(...arguments),this.type=e.Text}get nodeType(){return 3}}class a extends o{constructor(){super(...arguments),this.type=e.Comment}get nodeType(){return 8}}class c extends o{constructor(t,n){super(n),this.name=t,this.type=e.Directive}get nodeType(){return 1}}class l extends i{constructor(t){super(),this.children=t}get firstChild(){var t;return null!==(t=this.children[0])&&void 0!==t?t:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(t){this.children=t}}class u extends l{constructor(){super(...arguments),this.type=e.CDATA}get nodeType(){return 4}}class d extends l{constructor(){super(...arguments),this.type=e.Root}get nodeType(){return 9}}class h extends l{constructor(t,n,r=[],i=("script"===t?e.Script:"style"===t?e.Style:e.Tag)){super(r),this.name=t,this.attribs=n,this.type=i}get nodeType(){return 1}get tagName(){return this.name}set tagName(t){this.name=t}get attributes(){return Object.keys(this.attribs).map((t=>{var e,n;return{name:t,value:this.attribs[t],namespace:null===(e=this["x-attribsNamespace"])||void 0===e?void 0:e[t],prefix:null===(n=this["x-attribsPrefix"])||void 0===n?void 0:n[t]}}))}}function p(t,n=!1){let r;if(function(t){return t.type===e.Text}(t))r=new s(t.data);else if(function(t){return t.type===e.Comment}(t))r=new a(t.data);else if(function(t){return(n=t).type===e.Tag||n.type===e.Script||n.type===e.Style;var n}(t)){const e=n?f(t.children):[],i=new h(t.name,{...t.attribs},e);e.forEach((t=>t.parent=i)),null!=t.namespace&&(i.namespace=t.namespace),t["x-attribsNamespace"]&&(i["x-attribsNamespace"]={...t["x-attribsNamespace"]}),t["x-attribsPrefix"]&&(i["x-attribsPrefix"]={...t["x-attribsPrefix"]}),r=i}else if(function(t){return t.type===e.CDATA}(t)){const e=n?f(t.children):[],i=new u(e);e.forEach((t=>t.parent=i)),r=i}else if(function(t){return t.type===e.Root}(t)){const e=n?f(t.children):[],i=new d(e);e.forEach((t=>t.parent=i)),t["x-mode"]&&(i["x-mode"]=t["x-mode"]),r=i}else{if(!function(t){return t.type===e.Directive}(t))throw new Error(`Not implemented yet: ${t.type}`);{const e=new c(t.name,t.data);null!=t["x-name"]&&(e["x-name"]=t["x-name"],e["x-publicId"]=t["x-publicId"],e["x-systemId"]=t["x-systemId"]),r=e}}return r.startIndex=t.startIndex,r.endIndex=t.endIndex,null!=t.sourceCodeLocation&&(r.sourceCodeLocation=t.sourceCodeLocation),r}function f(t){const e=t.map((t=>p(t,!0)));for(let t=1;t<e.length;t++)e[t].prev=e[t-1],e[t-1].next=e[t];return e}function*m(t,e=new Set){const n=new Set,r=Array.from(t.childNodes).filter((t=>!e.has(t)));for(yield t;r.length;){const t=r.shift();n.has(t)||(n.add(t),yield t),t.childNodes&&Array.from(t.childNodes).filter((t=>!e.has(t))).forEach((t=>r.push(t)))}}function $(t,e){return"function"==typeof t?.[e]}function g(t,e){return t instanceof h?t.attribs?.[e]:t.getAttribute?.(e)}function b(t,e,n){t instanceof h?t.attribs[e]=n:t.setAttribute?.(e,n)}function x(t,e){t instanceof h?delete t.attribs[e]:t.removeAttribute?.(e)}function y(t,e,n){if(t instanceof h&&e instanceof h)e.attribs[n]=t.attribs[n];else{const r=t?.getAttributeNode?.(n);e?.setAttributeNode?.(r?.cloneNode(!0))}}function v(t,...e){if($(t,"replaceWith"))return t.replaceWith(...e);{const n=t,r=n.parentNode,i=Array.from(r.childNodes).indexOf(n);e.forEach((t=>t.parentNode=r)),r.childNodes=[].concat(Array.from(r.childNodes).slice(0,i)).concat(e).concat(Array.from(r.childNodes).slice(i+1))}}function w(t,e){return $(e,"appendChild")?t.appendChild(e):(t.childNodes.push(e),e.parentNode=t,e)}function N(t,e){if($(e,"removeChild"))return t.removeChild(e);{const n=e;return t.childNodes=t.children.filter((t=>t!==n)),n}}function A(t,e,n){return n?$(t,"insertBefore")?t.insertBefore(e,n):(v(n,e,n),e):w(t,e)}function j(t){return t instanceof i?t.data:t.nodeValue}function k(t,e=0){return t?t.length<=e?t:t.slice(0,e-1)+"…":""}function S(t,e=0){return k(t.outerHTML||j(t)||String(t),e)}window.htmlparser2;class C{timeouts=new Map;debounce(t,e){return new Promise(((n,r)=>{const i=this.timeouts.get(e);i&&clearTimeout(i),this.timeouts.set(e,setTimeout((()=>{try{n(e()),this.timeouts.delete(e)}catch(t){r(t)}}),t))}))}}class _ extends C{evalkeys=["$elem","$event"];expressionCache=new Map;store=new Map;observers=new Map;_observer=null;_lock=Promise.resolve();constructor(t){super();for(let[e,n]of Object.entries(t||{}))this.set(e,n)}wrapFunction(t){return(...e)=>t.call(this.$,...e)}wrapObject(t,e){return null==t||(n=t)instanceof _||n.__is_proxy__||t.constructor!==Object&&!Array.isArray(t)?t:new Proxy(t,{deleteProperty:(t,n)=>n in t&&(delete t[n],e(),!0),set:(n,r,i,o)=>{"object"==typeof i&&null!=t&&(i=this.wrapObject(i,e));const s=Reflect.set(n,r,i,o);return e(),s},get:(t,e,n)=>"__is_proxy__"===e||Reflect.get(t,e,n)});var n}watch(t,e){this.observers.has(t)||this.observers.set(t,new Set),this.observers.get(t)?.has(e)||this.observers.get(t)?.add(e)}async notify(t){const e=Array.from(this.observers.get(t)||[]);await this.debounce(10,(()=>Promise.all(e.map((t=>t.call(this.proxify(t)))))))}get(t,e){return e&&this.watch(t,e),this.store.get(t)}async set(t,e){if(e===this.store.get(t))return;const n=()=>this.notify(t);e&&"function"==typeof e&&(e=this.wrapFunction(e)),e&&"object"==typeof e&&(e=this.wrapObject(e,n)),this.store.set(t,e),await n()}del(t){this.store.delete(t),this.observers.delete(t)}has(t){return this.store.has(t)}effect(t){return t.call(this.proxify(t))}proxify(t){const e=Array.from(this.store.entries()).map((([t])=>t)),n=Object.fromEntries(e.map((t=>[t,void 0])));return new Proxy(n,{get:(e,n,r)=>"string"==typeof n&&this.store.has(n)?this.get(n,t):"$"===n?this.proxify(t):Reflect.get(this,n,r),set:(t,e,n,r)=>("string"!=typeof e||e in this?Reflect.set(this,e,n,r):this.set(e,n),!0)})}get $(){return this.proxify()}cachedExpressionFunction(t){return this.expressionCache.has(t)||this.expressionCache.set(t,function(t,e=[]){return new Function(...e,`with (this) { return (${t}); }`)}(t,this.evalkeys)),this.expressionCache.get(t)}eval(t,e={}){const n=this._observer?this:this.$;if(this.store.has(t))return n[t];{const r=this.cachedExpressionFunction(t),i=this.evalkeys.map((t=>e[t]));if(Object.keys(e).some((t=>!this.evalkeys.includes(t))))throw new Error(`Invalid argument key, must be one of: ${this.evalkeys.join(", ")}`);return r.call(n,...i)}}}const E=new Set([":bind",":bind-events",":data",":for",":show","@watch","$html"]);var T;function M(t){return t.includes("/")?t.split("/").slice(0,-1).join("/"):""}function P(t){return!(t.includes("://")||t.startsWith("/")||t.startsWith("#")||t.startsWith("data:"))}!function(e){e.resolveIncludes=async function(t,e){const n=t;if("include"!==n.tagName?.toLocaleLowerCase())return;this.log("<include> tag found in:\n",S(t,128)),this.log("<include> params:",e);const r=g(n,"src");if(!r)throw new Error(`"src" attribute missing from ${t}.`);const i=e=>{const r=e.firstChild;for(const t of Array.from(n.attributes))r&&"src"!==t.name&&y(n,r,t.name);v(t,...e.childNodes)},o={...e,rootDocument:!1,maxdepth:e?.maxdepth-1};if(0===o.maxdepth)throw new Error("Maximum recursion depth reached.");if(r.includes("://")||r.startsWith("//"))this.log("Including remote file from absolute path:",r),await this.preprocessRemote(r,o).then(i);else if(e?.dirpath?.includes("://")||e?.dirpath?.startsWith("//")){const t=r.startsWith("/")?r:`${e.dirpath}/${r}`;this.log("Including remote file from relative path:",t),await this.preprocessRemote(t,o).then(i)}else if("/"===r.charAt(0))this.log("Including local file from absolute path:",r),await this.preprocessLocal(r,o).then(i);else{const t=e?.dirpath&&"."!==e?.dirpath?`${e?.dirpath}/${r}`:r;this.log("Including local file from relative path:",t),await this.preprocessLocal(t,o).then(i)}},e.rebaseRelativePaths=async function(t,e){const n=t,r=n.tagName?.toLowerCase();if(!e?.dirpath)return;const i=g(n,"src"),o=g(n,"href"),s=g(n,"data"),a=i||o||s;a&&(a&&P(a)&&this.log("Rebasing relative path as:",e.dirpath,"/",a),"img"===r&&i&&P(i)?b(n,"src",`${e.dirpath}/${i}`):"a"===r&&o&&P(o)||"link"===r&&o&&P(o)?b(n,"href",`${e.dirpath}/${o}`):"script"===r&&i&&P(i)||"source"===r&&i&&P(i)||"audio"===r&&i&&P(i)||"video"===r&&i&&P(i)||"track"===r&&i&&P(i)||"iframe"===r&&i&&P(i)?b(n,"src",`${e.dirpath}/${i}`):"object"===r&&s&&P(s)?b(n,"data",`${e.dirpath}/${s}`):"input"===r&&i&&P(i)?b(n,"src",`${e.dirpath}/${i}`):("area"===r&&o&&P(o)||"base"===r&&o&&P(o))&&b(n,"href",`${e.dirpath}/${o}`))},e.registerCustomElements=async function(t,e){const n=t;if("template"===n.tagName?.toLowerCase()&&g(n,"is")){const t=g(n,"is")?.toLowerCase();this._customElements.has(t)||(this.log(`Registering custom element: ${t}\n`,S(n,128)),this._customElements.set(t,n.cloneNode(!0)),N(n.parentNode,n))}},e.resolveCustomElements=async function(e,n){const r=e,i=r.tagName?.toLowerCase();if(this._customElements.has(i)){this.log(`Processing custom element: ${i}\n`,S(r,128));const n=this._customElements.get(i),o=(n.content||n).cloneNode(!0),s=function(t){return t instanceof h?t.children.find((t=>t instanceof h)):t.firstElementChild}(o);for(const t of Array.from(r.attributes))s&&y(r,s,t.name);const a=new t(m(o)).find((t=>"slot"===t.tagName?.toLowerCase()));a&&v(a,...r.childNodes),v(e,...o.childNodes)}},e.resolveTextNodeExpressions=async function(t,e){const n=j(t)||"";if(3!==t.nodeType||!n?.trim())return;this.log("Processing node content value:\n",k(n,128));const r=new RegExp(/{{ ([^}]+) }}/gm),o=Array.from(n.matchAll(r)).map((t=>t[1]));return this.effect((function(){let e=n;for(const n of o){const r=this.eval(n,{$elem:t});e=e.replace(`{{ ${n} }}`,String(r))}!function(t,e){t instanceof i?t.data=e:t.nodeValue=e}(t,e)}))},e.resolveDataAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,":data");if(r){this.log(":data attribute found in:\n",S(t,128)),x(n,":data");const i=e?.rootNode===t?this:this.clone();t.renderer=i;const o=function(t,e=[]){return new Function(...e,`with (this) { return (async () => (${t}))(); }`)}(r,this.evalkeys),s=await o.call(i.$,{$elem:t});if(await Promise.all(Object.entries(s).map((([t,e])=>i.set(t,e)))),i!==this)for(const e of m(t,this._skipNodes))this._skipNodes.add(e);await i.mount(t,e)}},e.resolveWatchAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,"@watch");r&&(this.log("@watch attribute found in:\n",S(t,128)),x(n,"@watch"),await this.effect((function(){return this.eval(r,{$elem:t})})))},e.resolveTextAttributes=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,"$text");return r?(this.log("$text attribute found in:\n",S(t,128)),x(n,"$text"),this.effect((function(){!function(t,e){t instanceof h?t.children=[new s(e)]:t.textContent=e}(t,this.eval(r,{$elem:t}))}))):void 0},e.resolveHtmlAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,"$html");return r?(this.log("$html attribute found in:\n",S(t,128)),x(n,"$html"),this.effect((function(){const i=this.eval(r,{$elem:t});return new Promise((async t=>{const r=await this.preprocessString(i,e);await this.renderNode(r),function(t,...e){$(t,"replaceChildren")?t.replaceChildren(...e):(t.childNodes=e,e.forEach((e=>e.parentNode=t)))}(n,r),t()}))}))):void 0},e.resolvePropAttributes=async function(t,e){if(this._skipNodes.has(t))return;const n=t;for(const e of Array.from(n.attributes||[]))if(e.name.startsWith("$")&&!E.has(e.name)){this.log(e.name,"attribute found in:\n",S(t,128)),x(n,e.name);const r=e.name.slice(1).replace(/-./g,(t=>t[1].toUpperCase()));await this.effect((function(){t[r]=this.eval(e.value,{$elem:t})}))}},e.resolveAttrAttributes=async function(t,e){if(this._skipNodes.has(t))return;const n=t;for(const e of Array.from(n.attributes||[]))if(e.name.startsWith(":")&&!E.has(e.name)){this.log(e.name,"attribute found in:\n",S(t,128)),x(n,e.name);const r=e.name.slice(1);this.effect((function(){b(n,r,this.eval(e.value,{$elem:t}))}))}},e.resolveEventAttributes=async function(t,e){if(this._skipNodes.has(t))return;const n=t;for(const e of Array.from(n.attributes||[]))e.name.startsWith("@")&&!E.has(e.name)&&(this.log(e.name,"attribute found in:\n",S(t,128)),x(n,e.name),t.addEventListener?.(e.name.substring(1),(n=>this.eval(e.value,{$elem:t,$event:n}))))},e.resolveForAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,":for")?.trim();if(r){this.log(":for attribute found in:\n",S(t,128)),x(n,":for");for(const e of m(t,this._skipNodes))this._skipNodes.add(e);const i=t.parentNode,o=function(t,e){return e?e.createElement(t):new h(t,{})}("template",t.ownerDocument);A(i,o,t),N(i,t),w(o,t),this.log(":for template:\n",S(o,128));const s=r.split(" in ",2);if(2!==s.length)throw new Error(`Invalid :for format: \`${r}\`. Expected "{key} in {expression}".`);const a=[],[c,l]=s;await this.effect((function(){const n=this.eval(l,{$elem:t});if(this.log(":for list items:",n),a.splice(0,a.length).forEach((t=>{N(i,t),this._skipNodes.delete(t)})),!Array.isArray(n))return console.error(`Expression did not yield a list: \`${l}\` => \`${n}\``),Promise.resolve();const r=[];for(const i of n){const n=this.clone();n.set(c,i);const o=t.cloneNode(!0);a.push(o),this._skipNodes.add(o),r.push(n.mount(o,e)),this.log("Rendered list child:\n",S(o,128))}const s=o.nextSibling;for(const t of a)A(i,t,s);return Promise.all(r)}))}},e.resolveBindAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,":bind");if(r){this.log(":bind attribute found in:\n",S(t,128));const e=["change","input"],i=g(n,":bind-events")?.split(",")||e;x(n,":bind"),x(n,":bind-events");const o="checkbox"===g(n,"type")?"checked":"value",s=`$elem.${o} = ${r}`;this.effect((function(){const e=this.eval(s,{$elem:t});n[o]=e}));const a=`${r} = $elem.${o}`;for(const e of i)t.addEventListener(e,(()=>this.eval(a,{$elem:t})))}},e.resolveShowAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,":show");if(r){this.log(":show attribute found in:\n",S(t,128)),x(n,":show");const e="none"===n.style?.display?"":n.style?.display??g(n,"style")?.split(";")?.find((t=>"display"===t.split(":")[0]))?.split(":")?.at(1)?.trim();this.effect((function(){const i=this.eval(r,{$elem:t});n.style?n.style.display=i?e:"none":b(n,"style",`display: ${i?e:"none"};`)}))}}}(T||(T={}));class O extends _{debugging=!1;dirpath="";_skipNodes=new Set;_customElements=new Map;debug(t){return this.debugging=t,this}async fetchRemote(t,e){return fetch(t,{cache:e?.cache??"default"}).then((t=>t.text()))}async fetchLocal(t,e){return this.fetchRemote(t,e)}async preprocessString(t,e){this.log("Preprocessing string content with params:\n",e);const n=this.parseHTML(t,e);return await this.preprocessNode(n,e),n}async preprocessRemote(t,e){const n={};e?.cache&&(n.cache=e.cache);const r=await fetch(t,n).then((t=>t.text()));return this.preprocessString(r,{...e,dirpath:M(t),rootDocument:e?.rootDocument??!t.endsWith(".tpl.html")})}async preprocessLocal(t,e){const n=await this.fetchLocal(t,e);return this.preprocessString(n,{...e,dirpath:M(t),rootDocument:e?.rootDocument??!t.endsWith(".tpl.html")})}clone(){const t=new this.constructor(Object.fromEntries(this.store.entries()));return t._customElements=this._customElements,t.debug(this.debugging)}log(...t){this.debugging&&console.debug(...t)}async preprocessNode(e,n){n={dirpath:this.dirpath,maxdepth:10,...n};const r=new t(m(e,this._skipNodes)).map((async t=>{this.log("Preprocessing node:\n",S(t,128)),await T.resolveIncludes.call(this,t,n),await T.rebaseRelativePaths.call(this,t,n),await T.registerCustomElements.call(this,t,n),await T.resolveCustomElements.call(this,t,n)}));return await Promise.all(r.generator()),e}async renderNode(t,e){for(const n of m(t,this._skipNodes))this.log("Rendering node:\n",S(n,128)),await T.resolveDataAttribute.call(this,n,e),await T.resolveForAttribute.call(this,n,e),await T.resolveTextAttributes.call(this,n,e),await T.resolveHtmlAttribute.call(this,n,e),await T.resolveShowAttribute.call(this,n,e),await T.resolveWatchAttribute.call(this,n,e),await T.resolveBindAttribute.call(this,n,e),await T.resolvePropAttributes.call(this,n,e),await T.resolveAttrAttributes.call(this,n,e),await T.resolveEventAttributes.call(this,n,e),await T.resolveTextNodeExpressions.call(this,n,e);return t}async mount(t,e){e={...e,rootNode:t},await this.preprocessNode(t,e),await this.renderNode(t,e),t.renderer=this}}var z=n(654);const L={sm:640,md:768,lg:1024,xl:1280},R=.25,D=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],I=[...D,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96,112,128,144,160,192,224,256,288,320,384,448,512,...Object.values(L)],W=[1,2,5,10,20,25,30,40,50,60,70,75,80,90,95,98,99,100],F=["hover","focus","disabled","focus","active"],H={margin:"m",padding:"p"},B={width:"w",height:"h"},G={top:"top",right:"right",bottom:"bottom",left:"left"},V={"min-width":"min-w","min-height":"min-h","max-width":"max-w","max-height":"max-h"},q={bold:{"font-weight":"bold"},semibold:{"font-weight":600},italic:{"font-style":"italic"},underline:{"text-decoration":"underline"},"no-underline":{"text-decoration":"none"},"decoration-none":{"text-decoration":"none"},"line-through":{"text-decoration":"line-through"},uppercase:{"text-transform":"uppercase"},lowercase:{"text-transform":"lowercase"},capitalize:{"text-transform":"capitalize"},"font-mono":{"font-family":"ui-monospace, monospace"},"font-sans":{"font-family":"ui-sans-serif, system-ui, sans-serif"},"font-serif":{"font-family":"ui-serif, serif"},"text-left":{"text-align":"left"},"text-right":{"text-align":"right"},"text-center":{"text-align":"center"},"text-justify":{"text-align":"justify"},"text-xs":{"font-size":".75rem"},"text-sm":{"font-size":".875rem"},"text-base":{"font-size":"1rem"},"text-lg":{"font-size":"1.125rem"},"text-xl":{"font-size":"1.25rem"},relative:{position:"relative"},fixed:{position:"fixed"},absolute:{position:"absolute"},sticky:{position:"sticky"},"object-contain":{"object-fit":"contain"},"object-cover":{"object-fit":"cover"},"object-fill":{"object-fit":"fill"},"object-none":{"object-fit":"none"},block:{display:"block"},contents:{display:"contents"},hidden:{display:"none"},inline:{display:"inline"},"inline-block":{display:"inline-block"},flex:{display:"flex"},"flex-1":{flex:"1 1 0%"},"flex-inline":{display:"inline-flex"},"flex-row":{"flex-direction":"row"},"flex-col":{"flex-direction":"column"},"flex-row-reverse":{"flex-direction":"row-reverse"},"flex-col-reverse":{"flex-direction":"column-reverse"},"flex-wrap":{"flex-wrap":"wrap"},"flex-wrap-reverse":{"flex-wrap":"wrap-reverse"},"flex-nowrap":{"flex-wrap":"nowrap"},"justify-start":{"justify-content":"flex-start"},"justify-end":{"justify-content":"flex-end"},"justify-center":{"justify-content":"center"},"justify-between":{"justify-content":"space-between"},"justify-around":{"justify-content":"space-around"},"justify-evenly":{"justify-content":"space-evenly"},"justify-stretch":{"justify-content":"stretch"},"items-start":{"align-items":"flex-start"},"items-end":{"align-items":"flex-end"},"items-center":{"align-items":"center"},"items-stretch":{"align-items":"stretch"},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"overflow-auto":{overflow:"auto"},"overflow-x-auto":{"overflow-x":"auto"},"overflow-y-auto":{"overflow-y":"auto"},"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"cursor-pointer":{cursor:"pointer"},"cursor-wait":{cursor:"wait"},"cursor-not-allowed":{cursor:"not-allowed"},"select-none":{"user-select":"none"},"select-all":{"user-select":"all"},"pointer-events-auto":{"pointer-events":"auto"},"pointer-events-none":{"pointer-events":"none"},"box-border":{"box-sizing":"border-box"},"box-content":{"box-sizing":"content-box"},resize:{resize:"both"},"resize-x":{resize:"horizontal"},"resize-y":{resize:"vertical"},"resize-none":{resize:"none"},border:{border:"1px solid"},"border-none":{border:"none"},"border-solid":{"border-style":"solid"},"border-dashed":{"border-style":"dashed"},"border-dotted":{"border-style":"dotted"},"rounded-none":{"border-radius":"0"},rounded:{"border-radius":".25rem"},"rounded-sm":{"border-radius":".125rem"},"rounded-md":{"border-radius":".375rem"},"rounded-lg":{"border-radius":".5rem"},"rounded-xl":{"border-radius":".75rem"},"rounded-full":{"border-radius":"9999px"},"transition-none":{transition:"none"},transition:{transition:"all 150ms"},"animate-none":{animation:"none"},"animate-spin":{animation:"spin 1s linear infinite"},"animate-ping":{animation:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite"},"animate-pulse":{animation:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"}},U=["@keyframes spin {\n from { transform: rotate(0deg) }\n to { transform: rotate(360deg) }\n }","@keyframes ping {\n 75%, 100% {\n transform: scale(2);\n opacity: 0;\n }\n }","@keyframes pulse {\n 0%, 100% { opacity: 1 }\n 50% { opacity: .5 }\n }"],X={red:{50:16772078,100:16764370,200:15702682,300:15037299,400:15684432,500:16007990,600:15022389,700:13840175,800:12986408,900:12000284},pink:{50:16573676,100:16301008,200:16027569,300:15753874,400:15483002,500:15277667,600:14162784,700:12720219,800:11342935,900:8916559},purple:{50:15984117,100:14794471,200:13538264,300:12216520,400:11225020,500:10233776,600:9315498,700:8069026,800:6953882,900:4854924},"deep-purple":{50:15591414,100:13747433,200:11771355,300:9795021,400:8280002,500:6765239,600:6174129,700:5320104,800:4532128,900:3218322},indigo:{50:15264502,100:12962537,200:10463450,300:7964363,400:6056896,500:4149685,600:3754411,700:3162015,800:2635155,900:1713022},blue:{50:14938877,100:12312315,200:9489145,300:6600182,400:4367861,500:2201331,600:2001125,700:1668818,800:1402304,900:870305},"light-blue":{50:14808574,100:11789820,200:8508666,300:5227511,400:2733814,500:240116,600:236517,700:166097,800:161725,900:87963},cyan:{50:14743546,100:11725810,200:8445674,300:5099745,400:2541274,500:48340,600:44225,700:38823,800:33679,900:24676},teal:{50:14742257,100:11722715,200:8440772,300:5093036,400:2533018,500:38536,600:35195,700:31083,800:26972,900:19776},green:{50:15267305,100:13166281,200:10868391,300:8505220,400:6732650,500:5025616,600:4431943,700:3706428,800:3046706,900:1793568},"light-green":{50:15857897,100:14478792,200:12968357,300:11457921,400:10275941,500:9159498,600:8172354,700:6856504,800:5606191,900:3369246},lime:{50:16382951,100:15791299,200:15134364,300:14477173,400:13951319,500:13491257,600:12634675,700:11514923,800:10394916,900:8550167},yellow:{50:16776679,100:16775620,200:16774557,300:16773494,400:16772696,500:16771899,600:16635957,700:16498733,800:16361509,900:16088855},amber:{50:16775393,100:16772275,200:16769154,300:16766287,400:16763432,500:16761095,600:16757504,700:16752640,800:16748288,900:16740096},orange:{50:16774112,100:16769202,200:16764032,300:16758605,400:16754470,500:16750592,600:16485376,700:16088064,800:15690752,900:15094016},"deep-orange":{50:16509415,100:16764092,200:16755601,300:16747109,400:16740419,500:16733986,600:16011550,700:15092249,800:14172949,900:12531212},brown:{50:15723497,100:14142664,200:12364452,300:10586239,400:9268835,500:7951688,600:7162945,700:6111287,800:5125166,900:4073251},gray:{50:16448250,100:16119285,200:15658734,300:14737632,400:12434877,500:10395294,600:7697781,700:6381921,800:4342338,900:2171169},"blue-gray":{50:15527921,100:13621468,200:11583173,300:9479342,400:7901340,500:6323595,600:5533306,700:4545124,800:3622735,900:2503224}};function J(t){return F.map((e=>`.${e}\\:${t}:${e}`))}function K(t,e){return Object.entries(L).map((([n,r])=>`@media (min-width: ${r}px) { .${n}\\:${t} { ${e} } }`))}function Q(t,e){return t.includes("@media")&&!e.includes("@media")?1:!t.includes("@media")&&e.includes("@media")?-1:t.localeCompare(e)}function Y(t){return Object.entries(t).flatMap((([t,e])=>[[`${e}-0`,`${t}: 0`],[`${e}-screen`,`${t}: 100vw`],[`${e}-full`,`${t}: 100%`],...I.map((n=>[`${e}-${n}`,`${t}: ${n*R}rem`])),...I.map((n=>[`-${e}-${n}`,`${t}: -${n*R}rem`])),...I.map((n=>[`${e}-${n}px`,`${t}: ${n}px`])),...I.map((n=>[`-${e}-${n}px`,`${t}: -${n}px`])),...W.map((n=>[`${e}-${n}%`,`${t}: ${n}%`])),...W.map((n=>[`-${e}-${n}%`,` ${t}: -${n}%`]))])).flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)]))}function Z(t){return Object.entries(t).flatMap((([t,e])=>[`.${e}-auto { ${t}: auto; }`,`.${e}x-auto { ${t}-left: auto; ${t}-right: auto; }`,`.${e}y-auto { ${t}-top: auto; ${t}-bottom: auto; }`,...I.map((t=>[t,t*R])).map((([n,r])=>`.${e}x-${n} { ${t}-left: ${r}rem; ${t}-right: ${r}rem; }`)),...I.map((t=>[t,t*R])).map((([n,r])=>`.${e}y-${n} { ${t}-top: ${r}rem; ${t}-bottom: ${r}rem; }`)),...I.map((n=>`.${e}x-${n}px { ${t}-left: ${n}px; ${t}-right: ${n}px; }`)),...I.map((n=>`.${e}y-${n}px { ${t}-top: ${n}px; ${t}-bottom: ${n}px; }`)),...W.map((n=>`.${e}x-${n}% { ${t}-left: ${n}%; ${t}-right: ${n}%; }`)),...W.map((n=>`.${e}y-${n}% { ${t}-top: ${n}%; ${t}-bottom: ${n}%; }`))]))}function tt(){const t=[["white","#fff"],["black","#000"],["transparent","transparent"]].flatMap((([t,e])=>[[`text-${t}`,`color: ${e}`],[`fill-${t}`,`fill: ${e}`],[`bg-${t}`,`background-color: ${e}`],[`border-${t}`,`border-color: ${e}`]])),e=Object.entries(X).flatMap((([t,e])=>[[`text-${t}`,`color: #${e[500].toString(16)}`],[`fill-${t}`,`fill: #${e[500].toString(16)}`],[`bg-${t}`,`background-color: #${e[500].toString(16)}`],[`border-${t}`,`border-color: #${e[500].toString(16)}`]])),n=Object.entries(X).flatMap((([t,e])=>Object.entries(e).flatMap((([e,n])=>[[`text-${t}-${e}`,`color: #${n.toString(16)}`],[`fill-${t}-${e}`,`fill: #${n.toString(16)}`],[`bg-${t}-${e}`,`background-color: #${n.toString(16)}`],[`border-${t}-${e}`,`border-color: #${n.toString(16)}`]]))));return[].concat(t).concat(e).concat(n).flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)]))}const et=new class extends O{dirpath=M(self.location.href);parseHTML(t,e={rootDocument:!1}){if(e.rootDocument)return(new DOMParser).parseFromString(t,"text/html");{const e=document.createRange();return e.selectNodeContents(document.body),e.createContextualFragment(t)}}serializeHTML(t){return(new XMLSerializer).serializeToString(t).replace(/\s?xmlns="[^"]+"/gm,"")}preprocessLocal(t,e){return this.preprocessRemote(t,e)}};self.Mancha=et;const nt=self.document?.currentScript;if(self.document?.currentScript?.hasAttribute("init")){const t=nt?.hasAttribute("debug"),e=nt?.getAttribute("cache"),n=nt?.getAttribute("target")?.split("+")||["body"];window.addEventListener("load",(()=>{n.map((async n=>{const r=self.document.querySelector(n);await et.debug(t).mount(r,{cache:e})}))}))}if(self.document?.currentScript?.hasAttribute("css")){const t=nt?.getAttribute("css")?.split("+");for(const e of t){const t=document.createElement("style");switch(e){case"basic":t.textContent=z.A;break;case"utils":t.textContent=(void 0,[...U,...Object.entries(q).flatMap((([t,e])=>Object.entries(e).flatMap((([e,n])=>[`.${t} { ${e}: ${n} }`,`${J(t).join(",")} { ${e}: ${n} }`,...K(t,`${e}: ${n}`)])))),...tt(),...[[".opacity-0","opacity: 0"],...W.map((t=>[`.opacity-${t}`,"opacity: "+t/100]))].flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)])),...Y(B),...Z(B),...Y(G),...Z(G),...(rt=H,Object.entries(rt).flatMap((([t,e])=>[[`.${e}t-auto`,`${t}-top: auto`],[`.${e}b-auto`,`${t}-bottom: auto`],[`.${e}l-auto`,`${t}-left: auto`],[`.${e}r-auto`,`${t}-right: auto`],...I.map((t=>[t,t*R])).map((([n,r])=>[`.${e}t-${n}`,`${t}-top: ${r}rem`])),...I.map((t=>[t,t*R])).map((([n,r])=>[`.${e}b-${n}`,`${t}-bottom: ${r}rem`])),...I.map((t=>[t,t*R])).map((([n,r])=>[`.${e}l-${n}`,`${t}-left: ${r}rem`])),...I.map((t=>[t,t*R])).map((([n,r])=>[`.${e}r-${n}`,`${t}-right: ${r}rem`])),...I.map((n=>[`.${e}t-${n}px`,`${t}-top: ${n}px`])),...I.map((n=>[`.${e}t-${n}px`,`${t}-bottom: ${n}px`])),...I.map((n=>[`.${e}t-${n}px`,`${t}-left: ${n}px`])),...I.map((n=>[`.${e}t-${n}px`,`${t}-right: ${n}px`])),...W.map((n=>[`.${e}y-${n}%`,`${t}-top: ${n}%`])),...W.map((n=>[`.${e}y-${n}%`,`${t}-bottom: ${n}%;`])),...W.map((n=>[`.${e}x-${n}%`,`${t}-left: ${n}%`])),...W.map((n=>[`.${e}x-${n}%`,`${t}-right: ${n}%`]))])).flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)]))),...Y(H),...Z(H),".space-x-0 > * { margin-left: 0; }",".space-y-0 > * { margin-top: 0; }",...I.map((t=>`.space-x-${t} > :not(:first-child) { margin-left: ${t*R}rem; }`)),...I.map((t=>`.space-y-${t} > :not(:first-child) { margin-top: ${t*R}rem; }`)),...I.map((t=>`.space-x-${t}px > :not(:first-child) { margin-left: ${t}px; }`)),...I.map((t=>`.space-y-${t}px > :not(:first-child) { margin-top: ${t}px; }`)),".gap-0 { gap: 0; }",...I.map((t=>`.gap-${t} { gap: ${t*R}rem; }`)),...I.map((t=>`.gap-${t}px { gap: ${t}px; }`)),...I.map((t=>`.gap-x-${t} { column-gap: ${t*R}rem; }`)),...I.map((t=>`.gap-y-${t} { row-gap: ${t*R}rem; }`)),...I.map((t=>`.gap-x-${t}px { column-gap: ${t}px; }`)),...I.map((t=>`.gap-y-${t}px { row-gap: ${t}px; }`)),...Y(V),...[...D.map((t=>`.border-${t} { border-width: ${t}px; }`))].flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)]))].sort(Q).join("\n"));break;default:console.error(`Unknown style name: "${e}"`)}self.document.head.appendChild(t)}}var rt})()})();
1
+ (()=>{"use strict";var t={654:(t,e,n)=>{n.d(e,{A:()=>a});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([t.id,"html{max-width:70ch;padding:2em 1em;margin:auto;line-height:1.75;font-size:1.25em;font-family:sans-serif}h1,h2,h3,h4,h5,h6{margin:1em 0 .5em}ol,p,ul{margin-bottom:1em;color:#1d1d1d}",""]);const a=s},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,i,o){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(s[c]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);r&&s[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),e.push(u))}},e}},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{class t{iterable;constructor(t){this.iterable=t}filter(e){return new t(t.filterGenerator(e,this.iterable))}map(e){return new t(t.mapGenerator(e,this.iterable))}find(t){for(const e of this.iterable)if(t(e))return e}array(){return Array.from(this.iterable)}*generator(){for(const t of this.iterable)yield t}static*filterGenerator(t,e){for(const n of e)t(n)&&(yield n)}static*mapGenerator(t,e){for(const n of e)yield t(n)}static equals(t,e){const n=t[Symbol.iterator](),r=e[Symbol.iterator]();let i=n.next(),o=r.next();for(;!i.done&&!o.done;){if(i.value!==o.value)return!1;i=n.next(),o=r.next()}return i.done===o.done}}var e,r;(r=e||(e={})).Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype",e.Root,e.Text,e.Directive,e.Comment,e.Script,e.Style,e.Tag,e.CDATA,e.Doctype;class i{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(t){this.parent=t}get previousSibling(){return this.prev}set previousSibling(t){this.prev=t}get nextSibling(){return this.next}set nextSibling(t){this.next=t}cloneNode(t=!1){return p(this,t)}}class o extends i{constructor(t){super(),this.data=t}get nodeValue(){return this.data}set nodeValue(t){this.data=t}}class s extends o{constructor(){super(...arguments),this.type=e.Text}get nodeType(){return 3}}class a extends o{constructor(){super(...arguments),this.type=e.Comment}get nodeType(){return 8}}class c extends o{constructor(t,n){super(n),this.name=t,this.type=e.Directive}get nodeType(){return 1}}class l extends i{constructor(t){super(),this.children=t}get firstChild(){var t;return null!==(t=this.children[0])&&void 0!==t?t:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(t){this.children=t}}class u extends l{constructor(){super(...arguments),this.type=e.CDATA}get nodeType(){return 4}}class d extends l{constructor(){super(...arguments),this.type=e.Root}get nodeType(){return 9}}class h extends l{constructor(t,n,r=[],i=("script"===t?e.Script:"style"===t?e.Style:e.Tag)){super(r),this.name=t,this.attribs=n,this.type=i}get nodeType(){return 1}get tagName(){return this.name}set tagName(t){this.name=t}get attributes(){return Object.keys(this.attribs).map((t=>{var e,n;return{name:t,value:this.attribs[t],namespace:null===(e=this["x-attribsNamespace"])||void 0===e?void 0:e[t],prefix:null===(n=this["x-attribsPrefix"])||void 0===n?void 0:n[t]}}))}}function p(t,n=!1){let r;if(function(t){return t.type===e.Text}(t))r=new s(t.data);else if(function(t){return t.type===e.Comment}(t))r=new a(t.data);else if(function(t){return(n=t).type===e.Tag||n.type===e.Script||n.type===e.Style;var n}(t)){const e=n?f(t.children):[],i=new h(t.name,{...t.attribs},e);e.forEach((t=>t.parent=i)),null!=t.namespace&&(i.namespace=t.namespace),t["x-attribsNamespace"]&&(i["x-attribsNamespace"]={...t["x-attribsNamespace"]}),t["x-attribsPrefix"]&&(i["x-attribsPrefix"]={...t["x-attribsPrefix"]}),r=i}else if(function(t){return t.type===e.CDATA}(t)){const e=n?f(t.children):[],i=new u(e);e.forEach((t=>t.parent=i)),r=i}else if(function(t){return t.type===e.Root}(t)){const e=n?f(t.children):[],i=new d(e);e.forEach((t=>t.parent=i)),t["x-mode"]&&(i["x-mode"]=t["x-mode"]),r=i}else{if(!function(t){return t.type===e.Directive}(t))throw new Error(`Not implemented yet: ${t.type}`);{const e=new c(t.name,t.data);null!=t["x-name"]&&(e["x-name"]=t["x-name"],e["x-publicId"]=t["x-publicId"],e["x-systemId"]=t["x-systemId"]),r=e}}return r.startIndex=t.startIndex,r.endIndex=t.endIndex,null!=t.sourceCodeLocation&&(r.sourceCodeLocation=t.sourceCodeLocation),r}function f(t){const e=t.map((t=>p(t,!0)));for(let t=1;t<e.length;t++)e[t].prev=e[t-1],e[t-1].next=e[t];return e}function*m(t,e=new Set){const n=new Set,r=Array.from(t.childNodes).filter((t=>!e.has(t)));for(yield t;r.length;){const t=r.shift();n.has(t)||(n.add(t),yield t),t.childNodes&&Array.from(t.childNodes).filter((t=>!e.has(t))).forEach((t=>r.push(t)))}}function $(t,e){return"function"==typeof t?.[e]}function g(t,e){return t instanceof h?t.attribs?.[e]:t.getAttribute?.(e)}function b(t,e,n){t instanceof h?t.attribs[e]=n:t.setAttribute?.(e,n)}function x(t,e){t instanceof h?delete t.attribs[e]:t.removeAttribute?.(e)}function y(t,e,n){if(t instanceof h&&e instanceof h)e.attribs[n]=t.attribs[n];else{const r=t?.getAttributeNode?.(n);e?.setAttributeNode?.(r?.cloneNode(!0))}}function v(t,...e){if($(t,"replaceWith"))return t.replaceWith(...e);{const n=t,r=n.parentNode,i=Array.from(r.childNodes).indexOf(n);e.forEach((t=>t.parentNode=r)),r.childNodes=[].concat(Array.from(r.childNodes).slice(0,i)).concat(e).concat(Array.from(r.childNodes).slice(i+1))}}function w(t,e){return $(e,"appendChild")?t.appendChild(e):(t.childNodes.push(e),e.parentNode=t,e)}function N(t,e){if($(e,"removeChild"))return t.removeChild(e);{const n=e;return t.childNodes=t.children.filter((t=>t!==n)),n}}function A(t,e,n){return n?$(t,"insertBefore")?t.insertBefore(e,n):(v(n,e,n),e):w(t,e)}function j(t){return t instanceof i?t.data:t.nodeValue}function k(t,e=0){return t?t.length<=e?t:t.slice(0,e-1)+"…":""}function S(t,e=0){return k(t.outerHTML||j(t)||String(t),e)}window.htmlparser2;class C{timeouts=new Map;debounce(t,e){return new Promise(((n,r)=>{const i=this.timeouts.get(e);i&&clearTimeout(i),this.timeouts.set(e,setTimeout((()=>{try{n(e()),this.timeouts.delete(e)}catch(t){r(t)}}),t))}))}}class _ extends C{evalkeys=["$elem","$event"];expressionCache=new Map;store=new Map;observers=new Map;_observer=null;_lock=Promise.resolve();constructor(t){super();for(let[e,n]of Object.entries(t||{}))this.set(e,n)}wrapFunction(t){return(...e)=>t.call(this.$,...e)}wrapObject(t,e){return null==t||(n=t)instanceof _||n.__is_proxy__||t.constructor!==Object&&!Array.isArray(t)?t:new Proxy(t,{deleteProperty:(t,n)=>n in t&&(delete t[n],e(),!0),set:(n,r,i,o)=>{"object"==typeof i&&null!=t&&(i=this.wrapObject(i,e));const s=Reflect.set(n,r,i,o);return e(),s},get:(t,e,n)=>"__is_proxy__"===e||Reflect.get(t,e,n)});var n}watch(t,e){this.observers.has(t)||this.observers.set(t,new Set),this.observers.get(t)?.has(e)||this.observers.get(t)?.add(e)}async notify(t){const e=Array.from(this.observers.get(t)||[]);await this.debounce(10,(()=>Promise.all(e.map((t=>t.call(this.proxify(t)))))))}get(t,e){return e&&this.watch(t,e),this.store.get(t)}async set(t,e){if(e===this.store.get(t))return;const n=()=>this.notify(t);e&&"function"==typeof e&&(e=this.wrapFunction(e)),e&&"object"==typeof e&&(e=this.wrapObject(e,n)),this.store.set(t,e),await n()}del(t){this.store.delete(t),this.observers.delete(t)}has(t){return this.store.has(t)}effect(t){return t.call(this.proxify(t))}proxify(t){const e=Array.from(this.store.entries()).map((([t])=>t)),n=Object.fromEntries(e.map((t=>[t,void 0])));return new Proxy(n,{get:(e,n,r)=>"string"==typeof n&&this.store.has(n)?this.get(n,t):"$"===n?this.proxify(t):Reflect.get(this,n,r),set:(t,e,n,r)=>("string"!=typeof e||e in this?Reflect.set(this,e,n,r):this.set(e,n),!0)})}get $(){return this.proxify()}cachedExpressionFunction(t){return this.expressionCache.has(t)||this.expressionCache.set(t,function(t,e=[]){return new Function(...e,`with (this) { return (${t}); }`)}(t,this.evalkeys)),this.expressionCache.get(t)}eval(t,e={}){const n=this._observer?this:this.$;if(this.store.has(t))return n[t];{const r=this.cachedExpressionFunction(t),i=this.evalkeys.map((t=>e[t]));if(Object.keys(e).some((t=>!this.evalkeys.includes(t))))throw new Error(`Invalid argument key, must be one of: ${this.evalkeys.join(", ")}`);return r.call(n,...i)}}}const E=new Set([":bind",":bind-events",":data",":for",":show","@watch","$html"]);var T;function M(t){return t.includes("/")?t.split("/").slice(0,-1).join("/"):""}function P(t){return!(t.includes("://")||t.startsWith("/")||t.startsWith("#")||t.startsWith("data:"))}!function(e){e.resolveIncludes=async function(t,e){const n=t;if("include"!==n.tagName?.toLocaleLowerCase())return;this.log("<include> tag found in:\n",S(t,128)),this.log("<include> params:",e);const r=g(n,"src");if(!r)throw new Error(`"src" attribute missing from ${t}.`);const i=e=>{const r=e.firstChild;for(const t of Array.from(n.attributes))r&&"src"!==t.name&&y(n,r,t.name);v(t,...e.childNodes)},o={...e,rootDocument:!1,maxdepth:e?.maxdepth-1};if(0===o.maxdepth)throw new Error("Maximum recursion depth reached.");if(r.includes("://")||r.startsWith("//"))this.log("Including remote file from absolute path:",r),await this.preprocessRemote(r,o).then(i);else if(e?.dirpath?.includes("://")||e?.dirpath?.startsWith("//")){const t=r.startsWith("/")?r:`${e.dirpath}/${r}`;this.log("Including remote file from relative path:",t),await this.preprocessRemote(t,o).then(i)}else if("/"===r.charAt(0))this.log("Including local file from absolute path:",r),await this.preprocessLocal(r,o).then(i);else{const t=e?.dirpath&&"."!==e?.dirpath?`${e?.dirpath}/${r}`:r;this.log("Including local file from relative path:",t),await this.preprocessLocal(t,o).then(i)}},e.rebaseRelativePaths=async function(t,e){const n=t,r=n.tagName?.toLowerCase();if(!e?.dirpath)return;const i=g(n,"src"),o=g(n,"href"),s=g(n,"data"),a=i||o||s;a&&(a&&P(a)&&this.log("Rebasing relative path as:",e.dirpath,"/",a),"img"===r&&i&&P(i)?b(n,"src",`${e.dirpath}/${i}`):"a"===r&&o&&P(o)||"link"===r&&o&&P(o)?b(n,"href",`${e.dirpath}/${o}`):"script"===r&&i&&P(i)||"source"===r&&i&&P(i)||"audio"===r&&i&&P(i)||"video"===r&&i&&P(i)||"track"===r&&i&&P(i)||"iframe"===r&&i&&P(i)?b(n,"src",`${e.dirpath}/${i}`):"object"===r&&s&&P(s)?b(n,"data",`${e.dirpath}/${s}`):"input"===r&&i&&P(i)?b(n,"src",`${e.dirpath}/${i}`):("area"===r&&o&&P(o)||"base"===r&&o&&P(o))&&b(n,"href",`${e.dirpath}/${o}`))},e.registerCustomElements=async function(t,e){const n=t;if("template"===n.tagName?.toLowerCase()&&g(n,"is")){const t=g(n,"is")?.toLowerCase();this._customElements.has(t)||(this.log(`Registering custom element: ${t}\n`,S(n,128)),this._customElements.set(t,n.cloneNode(!0)),N(n.parentNode,n))}},e.resolveCustomElements=async function(e,n){const r=e,i=r.tagName?.toLowerCase();if(this._customElements.has(i)){this.log(`Processing custom element: ${i}\n`,S(r,128));const n=this._customElements.get(i),o=(n.content||n).cloneNode(!0),s=function(t){return t instanceof h?t.children.find((t=>t instanceof h)):t.firstElementChild}(o);for(const t of Array.from(r.attributes))s&&y(r,s,t.name);const a=new t(m(o)).find((t=>"slot"===t.tagName?.toLowerCase()));a&&v(a,...r.childNodes),v(e,...o.childNodes)}},e.resolveTextNodeExpressions=async function(t,e){const n=j(t)||"";if(3!==t.nodeType||!n?.trim())return;this.log("Processing node content value:\n",k(n,128));const r=new RegExp(/{{ ([^}]+) }}/gm),o=Array.from(n.matchAll(r)).map((t=>t[1]));return this.effect((function(){let e=n;for(const n of o){const r=this.eval(n,{$elem:t});e=e.replace(`{{ ${n} }}`,String(r))}!function(t,e){t instanceof i?t.data=e:t.nodeValue=e}(t,e)}))},e.resolveDataAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,":data");if(r){this.log(":data attribute found in:\n",S(t,128)),x(n,":data");const i=e?.rootNode===t?this:this.clone();t.renderer=i;const o=function(t,e=[]){return new Function(...e,`with (this) { return (async () => (${t}))(); }`)}(r,this.evalkeys),s=await o.call(i.$,{$elem:t});if(await Promise.all(Object.entries(s).map((([t,e])=>i.set(t,e)))),i!==this)for(const e of m(t,this._skipNodes))this._skipNodes.add(e);await i.mount(t,e)}},e.resolveWatchAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,"@watch");r&&(this.log("@watch attribute found in:\n",S(t,128)),x(n,"@watch"),await this.effect((function(){return this.eval(r,{$elem:t})})))},e.resolveTextAttributes=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,"$text");return r?(this.log("$text attribute found in:\n",S(t,128)),x(n,"$text"),this.effect((function(){!function(t,e){t instanceof h?t.children=[new s(e)]:t.textContent=e}(t,this.eval(r,{$elem:t}))}))):void 0},e.resolveHtmlAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,"$html");return r?(this.log("$html attribute found in:\n",S(t,128)),x(n,"$html"),this.effect((function(){const i=this.eval(r,{$elem:t});return new Promise((async t=>{const r=await this.preprocessString(i,e);await this.renderNode(r),function(t,...e){$(t,"replaceChildren")?t.replaceChildren(...e):(t.childNodes=e,e.forEach((e=>e.parentNode=t)))}(n,r),t()}))}))):void 0},e.resolvePropAttributes=async function(t,e){if(this._skipNodes.has(t))return;const n=t;for(const e of Array.from(n.attributes||[]))if(e.name.startsWith("$")&&!E.has(e.name)){this.log(e.name,"attribute found in:\n",S(t,128)),x(n,e.name);const r=e.name.slice(1).replace(/-./g,(t=>t[1].toUpperCase()));await this.effect((function(){t[r]=this.eval(e.value,{$elem:t})}))}},e.resolveAttrAttributes=async function(t,e){if(this._skipNodes.has(t))return;const n=t;for(const e of Array.from(n.attributes||[]))if(e.name.startsWith(":")&&!E.has(e.name)){this.log(e.name,"attribute found in:\n",S(t,128)),x(n,e.name);const r=e.name.slice(1);this.effect((function(){b(n,r,this.eval(e.value,{$elem:t}))}))}},e.resolveEventAttributes=async function(t,e){if(this._skipNodes.has(t))return;const n=t;for(const e of Array.from(n.attributes||[]))e.name.startsWith("@")&&!E.has(e.name)&&(this.log(e.name,"attribute found in:\n",S(t,128)),x(n,e.name),t.addEventListener?.(e.name.substring(1),(n=>this.eval(e.value,{$elem:t,$event:n}))))},e.resolveForAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,":for")?.trim();if(r){this.log(":for attribute found in:\n",S(t,128)),x(n,":for");for(const e of m(t,this._skipNodes))this._skipNodes.add(e);const i=t.parentNode,o=function(t,e){return e?e.createElement(t):new h(t,{})}("template",t.ownerDocument);A(i,o,t),N(i,t),w(o,t),this.log(":for template:\n",S(o,128));const s=r.split(" in ",2);if(2!==s.length)throw new Error(`Invalid :for format: \`${r}\`. Expected "{key} in {expression}".`);const a=[],[c,l]=s;await this.effect((function(){const n=this.eval(l,{$elem:t});if(this.log(":for list items:",n),a.splice(0,a.length).forEach((t=>{N(i,t),this._skipNodes.delete(t)})),!Array.isArray(n))return console.error(`Expression did not yield a list: \`${l}\` => \`${n}\``),Promise.resolve();const r=[];for(const i of n){const n=this.clone();n.set(c,i);const o=t.cloneNode(!0);a.push(o),this._skipNodes.add(o),r.push(n.mount(o,e)),this.log("Rendered list child:\n",S(o,128))}const s=o.nextSibling;for(const t of a)A(i,t,s);return Promise.all(r)}))}},e.resolveBindAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,":bind");if(r){this.log(":bind attribute found in:\n",S(t,128));const e=["change","input"],i=g(n,":bind-events")?.split(",")||e;x(n,":bind"),x(n,":bind-events");const o="checkbox"===g(n,"type")?"checked":"value",s=`$elem.${o} = ${r}`;this.effect((function(){const e=this.eval(s,{$elem:t});n[o]=e}));const a=`${r} = $elem.${o}`;for(const e of i)t.addEventListener(e,(()=>this.eval(a,{$elem:t})))}},e.resolveShowAttribute=async function(t,e){if(this._skipNodes.has(t))return;const n=t,r=g(n,":show");if(r){this.log(":show attribute found in:\n",S(t,128)),x(n,":show");const e="none"===n.style?.display?"":n.style?.display??g(n,"style")?.split(";")?.find((t=>"display"===t.split(":")[0]))?.split(":")?.at(1)?.trim();this.effect((function(){const i=this.eval(r,{$elem:t});n.style?n.style.display=i?e:"none":b(n,"style",`display: ${i?e:"none"};`)}))}}}(T||(T={}));class O extends _{debugging=!1;dirpath="";_skipNodes=new Set;_customElements=new Map;debug(t){return this.debugging=t,this}async fetchRemote(t,e){return fetch(t,{cache:e?.cache??"default"}).then((t=>t.text()))}async fetchLocal(t,e){return this.fetchRemote(t,e)}async preprocessString(t,e){this.log("Preprocessing string content with params:\n",e);const n=this.parseHTML(t,e);return await this.preprocessNode(n,e),n}async preprocessRemote(t,e){const n={};e?.cache&&(n.cache=e.cache);const r=await fetch(t,n).then((t=>t.text()));return this.preprocessString(r,{...e,dirpath:M(t),rootDocument:e?.rootDocument??!t.endsWith(".tpl.html")})}async preprocessLocal(t,e){const n=await this.fetchLocal(t,e);return this.preprocessString(n,{...e,dirpath:M(t),rootDocument:e?.rootDocument??!t.endsWith(".tpl.html")})}clone(){const t=new this.constructor(Object.fromEntries(this.store.entries()));return t._customElements=this._customElements,t.debug(this.debugging)}log(...t){this.debugging&&console.debug(...t)}async preprocessNode(e,n){n={dirpath:this.dirpath,maxdepth:10,...n};const r=new t(m(e,this._skipNodes)).map((async t=>{this.log("Preprocessing node:\n",S(t,128)),await T.resolveIncludes.call(this,t,n),await T.rebaseRelativePaths.call(this,t,n),await T.registerCustomElements.call(this,t,n),await T.resolveCustomElements.call(this,t,n)}));return await Promise.all(r.generator()),e}async renderNode(t,e){for(const n of m(t,this._skipNodes))this.log("Rendering node:\n",S(n,128)),await T.resolveDataAttribute.call(this,n,e),await T.resolveForAttribute.call(this,n,e),await T.resolveTextAttributes.call(this,n,e),await T.resolveHtmlAttribute.call(this,n,e),await T.resolveShowAttribute.call(this,n,e),await T.resolveWatchAttribute.call(this,n,e),await T.resolveBindAttribute.call(this,n,e),await T.resolvePropAttributes.call(this,n,e),await T.resolveAttrAttributes.call(this,n,e),await T.resolveEventAttributes.call(this,n,e),await T.resolveTextNodeExpressions.call(this,n,e);return t}async mount(t,e){e={...e,rootNode:t},await this.preprocessNode(t,e),await this.renderNode(t,e),t.renderer=this}}var z=n(654);const L={sm:640,md:768,lg:1024,xl:1280},R=.25,D=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],I=[...D,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96,112,128,144,160,192,224,256,288,320,384,448,512,...Object.values(L)],W=[1,2,5,10,20,25,30,40,50,60,70,75,80,90,95,98,99,100],F=["hover","focus","disabled","focus","active"],H={margin:"m",padding:"p"},B={width:"w",height:"h"},G={top:"top",right:"right",bottom:"bottom",left:"left"},V={"min-width":"min-w","min-height":"min-h","max-width":"max-w","max-height":"max-h"},q={bold:{"font-weight":"bold"},semibold:{"font-weight":600},italic:{"font-style":"italic"},underline:{"text-decoration":"underline"},"no-underline":{"text-decoration":"none"},"decoration-none":{"text-decoration":"none"},"line-through":{"text-decoration":"line-through"},uppercase:{"text-transform":"uppercase"},lowercase:{"text-transform":"lowercase"},capitalize:{"text-transform":"capitalize"},"font-mono":{"font-family":"ui-monospace, monospace"},"font-sans":{"font-family":"ui-sans-serif, system-ui, sans-serif"},"font-serif":{"font-family":"ui-serif, serif"},"text-left":{"text-align":"left"},"text-right":{"text-align":"right"},"text-center":{"text-align":"center"},"text-justify":{"text-align":"justify"},"text-xs":{"font-size":".75rem"},"text-sm":{"font-size":".875rem"},"text-base":{"font-size":"1rem"},"text-lg":{"font-size":"1.125rem"},"text-xl":{"font-size":"1.25rem"},relative:{position:"relative"},fixed:{position:"fixed"},absolute:{position:"absolute"},sticky:{position:"sticky"},"object-contain":{"object-fit":"contain"},"object-cover":{"object-fit":"cover"},"object-fill":{"object-fit":"fill"},"object-none":{"object-fit":"none"},block:{display:"block"},contents:{display:"contents"},hidden:{display:"none"},inline:{display:"inline"},"inline-block":{display:"inline-block"},flex:{display:"flex"},"flex-1":{flex:"1 1 0%"},"flex-inline":{display:"inline-flex"},"flex-row":{"flex-direction":"row"},"flex-col":{"flex-direction":"column"},"flex-row-reverse":{"flex-direction":"row-reverse"},"flex-col-reverse":{"flex-direction":"column-reverse"},"flex-wrap":{"flex-wrap":"wrap"},"flex-wrap-reverse":{"flex-wrap":"wrap-reverse"},"flex-nowrap":{"flex-wrap":"nowrap"},"justify-start":{"justify-content":"flex-start"},"justify-end":{"justify-content":"flex-end"},"justify-center":{"justify-content":"center"},"justify-between":{"justify-content":"space-between"},"justify-around":{"justify-content":"space-around"},"justify-evenly":{"justify-content":"space-evenly"},"justify-stretch":{"justify-content":"stretch"},"items-start":{"align-items":"flex-start"},"items-end":{"align-items":"flex-end"},"items-center":{"align-items":"center"},"items-stretch":{"align-items":"stretch"},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"overflow-auto":{overflow:"auto"},"overflow-x-auto":{"overflow-x":"auto"},"overflow-y-auto":{"overflow-y":"auto"},"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"cursor-pointer":{cursor:"pointer"},"cursor-wait":{cursor:"wait"},"cursor-not-allowed":{cursor:"not-allowed"},"select-none":{"user-select":"none"},"select-all":{"user-select":"all"},"pointer-events-auto":{"pointer-events":"auto"},"pointer-events-none":{"pointer-events":"none"},"box-border":{"box-sizing":"border-box"},"box-content":{"box-sizing":"content-box"},resize:{resize:"both"},"resize-x":{resize:"horizontal"},"resize-y":{resize:"vertical"},"resize-none":{resize:"none"},border:{border:"1px solid"},"border-none":{border:"none"},"border-solid":{"border-style":"solid"},"border-dashed":{"border-style":"dashed"},"border-dotted":{"border-style":"dotted"},"rounded-none":{"border-radius":"0"},rounded:{"border-radius":".25rem"},"rounded-sm":{"border-radius":".125rem"},"rounded-md":{"border-radius":".375rem"},"rounded-lg":{"border-radius":".5rem"},"rounded-xl":{"border-radius":".75rem"},"rounded-full":{"border-radius":"9999px"},"transition-none":{transition:"none"},transition:{transition:"all 150ms"},"animate-none":{animation:"none"},"animate-spin":{animation:"spin 1s linear infinite"},"animate-ping":{animation:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite"},"animate-pulse":{animation:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"}},U=["@keyframes spin {\n from { transform: rotate(0deg) }\n to { transform: rotate(360deg) }\n }","@keyframes ping {\n 75%, 100% {\n transform: scale(2);\n opacity: 0;\n }\n }","@keyframes pulse {\n 0%, 100% { opacity: 1 }\n 50% { opacity: .5 }\n }"],X={red:{50:16772078,100:16764370,200:15702682,300:15037299,400:15684432,500:16007990,600:15022389,700:13840175,800:12986408,900:12000284},pink:{50:16573676,100:16301008,200:16027569,300:15753874,400:15483002,500:15277667,600:14162784,700:12720219,800:11342935,900:8916559},purple:{50:15984117,100:14794471,200:13538264,300:12216520,400:11225020,500:10233776,600:9315498,700:8069026,800:6953882,900:4854924},"deep-purple":{50:15591414,100:13747433,200:11771355,300:9795021,400:8280002,500:6765239,600:6174129,700:5320104,800:4532128,900:3218322},indigo:{50:15264502,100:12962537,200:10463450,300:7964363,400:6056896,500:4149685,600:3754411,700:3162015,800:2635155,900:1713022},blue:{50:14938877,100:12312315,200:9489145,300:6600182,400:4367861,500:2201331,600:2001125,700:1668818,800:1402304,900:870305},"light-blue":{50:14808574,100:11789820,200:8508666,300:5227511,400:2733814,500:240116,600:236517,700:166097,800:161725,900:87963},cyan:{50:14743546,100:11725810,200:8445674,300:5099745,400:2541274,500:48340,600:44225,700:38823,800:33679,900:24676},teal:{50:14742257,100:11722715,200:8440772,300:5093036,400:2533018,500:38536,600:35195,700:31083,800:26972,900:19776},green:{50:15267305,100:13166281,200:10868391,300:8505220,400:6732650,500:5025616,600:4431943,700:3706428,800:3046706,900:1793568},"light-green":{50:15857897,100:14478792,200:12968357,300:11457921,400:10275941,500:9159498,600:8172354,700:6856504,800:5606191,900:3369246},lime:{50:16382951,100:15791299,200:15134364,300:14477173,400:13951319,500:13491257,600:12634675,700:11514923,800:10394916,900:8550167},yellow:{50:16776679,100:16775620,200:16774557,300:16773494,400:16772696,500:16771899,600:16635957,700:16498733,800:16361509,900:16088855},amber:{50:16775393,100:16772275,200:16769154,300:16766287,400:16763432,500:16761095,600:16757504,700:16752640,800:16748288,900:16740096},orange:{50:16774112,100:16769202,200:16764032,300:16758605,400:16754470,500:16750592,600:16485376,700:16088064,800:15690752,900:15094016},"deep-orange":{50:16509415,100:16764092,200:16755601,300:16747109,400:16740419,500:16733986,600:16011550,700:15092249,800:14172949,900:12531212},brown:{50:15723497,100:14142664,200:12364452,300:10586239,400:9268835,500:7951688,600:7162945,700:6111287,800:5125166,900:4073251},gray:{50:16448250,100:16119285,200:15658734,300:14737632,400:12434877,500:10395294,600:7697781,700:6381921,800:4342338,900:2171169},"blue-gray":{50:15527921,100:13621468,200:11583173,300:9479342,400:7901340,500:6323595,600:5533306,700:4545124,800:3622735,900:2503224}};function J(t){return F.map((e=>`.${e}\\:${t}:${e}`))}function K(t,e){return Object.entries(L).map((([n,r])=>`@media (min-width: ${r}px) { .${n}\\:${t} { ${e} } }`))}function Q(t,e){return t.includes("@media")&&!e.includes("@media")?1:!t.includes("@media")&&e.includes("@media")?-1:t.localeCompare(e)}function Y(t){return Object.entries(t).flatMap((([t,e])=>[[`${e}-0`,`${t}: 0`],[`${e}-screen`,`${t}: 100vw`],[`${e}-full`,`${t}: 100%`],...I.map((n=>[`${e}-${n}`,`${t}: ${n*R}rem`])),...I.map((n=>[`-${e}-${n}`,`${t}: -${n*R}rem`])),...I.map((n=>[`${e}-${n}px`,`${t}: ${n}px`])),...I.map((n=>[`-${e}-${n}px`,`${t}: -${n}px`])),...W.map((n=>[`${e}-${n}%`,`${t}: ${n}%`])),...W.map((n=>[`-${e}-${n}%`,` ${t}: -${n}%`]))])).flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)]))}function Z(t){return Object.entries(t).flatMap((([t,e])=>[`.${e}-auto { ${t}: auto; }`,`.${e}x-auto { ${t}-left: auto; ${t}-right: auto; }`,`.${e}y-auto { ${t}-top: auto; ${t}-bottom: auto; }`,...I.map((t=>[t,t*R])).map((([n,r])=>`.${e}x-${n} { ${t}-left: ${r}rem; ${t}-right: ${r}rem; }`)),...I.map((t=>[t,t*R])).map((([n,r])=>`.${e}y-${n} { ${t}-top: ${r}rem; ${t}-bottom: ${r}rem; }`)),...I.map((n=>`.${e}x-${n}px { ${t}-left: ${n}px; ${t}-right: ${n}px; }`)),...I.map((n=>`.${e}y-${n}px { ${t}-top: ${n}px; ${t}-bottom: ${n}px; }`)),...W.map((n=>`.${e}x-${n}% { ${t}-left: ${n}%; ${t}-right: ${n}%; }`)),...W.map((n=>`.${e}y-${n}% { ${t}-top: ${n}%; ${t}-bottom: ${n}%; }`))]))}function tt(){const t=[["white","#fff"],["black","#000"],["transparent","transparent"]].flatMap((([t,e])=>[[`text-${t}`,`color: ${e}`],[`fill-${t}`,`fill: ${e}`],[`bg-${t}`,`background-color: ${e}`],[`border-${t}`,`border-color: ${e}`]])),e=Object.entries(X).flatMap((([t,e])=>[[`text-${t}`,`color: #${e[500].toString(16)}`],[`fill-${t}`,`fill: #${e[500].toString(16)}`],[`bg-${t}`,`background-color: #${e[500].toString(16)}`],[`border-${t}`,`border-color: #${e[500].toString(16)}`]])),n=Object.entries(X).flatMap((([t,e])=>Object.entries(e).flatMap((([e,n])=>[[`text-${t}-${e}`,`color: #${n.toString(16)}`],[`fill-${t}-${e}`,`fill: #${n.toString(16)}`],[`bg-${t}-${e}`,`background-color: #${n.toString(16)}`],[`border-${t}-${e}`,`border-color: #${n.toString(16)}`]]))));return[].concat(t).concat(e).concat(n).flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)]))}const et=new class extends O{dirpath=M(self.location.href);parseHTML(t,e={rootDocument:!1}){if(e.rootDocument)return(new DOMParser).parseFromString(t,"text/html");{const e=document.createRange();return e.selectNodeContents(document.body),e.createContextualFragment(t)}}serializeHTML(t){return(new XMLSerializer).serializeToString(t).replace(/\s?xmlns="[^"]+"/gm,"")}preprocessLocal(t,e){return this.preprocessRemote(t,e)}};self.Mancha=et;const nt=self.document?.currentScript;if(self.document?.currentScript?.hasAttribute("init")){const t=nt?.hasAttribute("debug"),e=nt?.getAttribute("cache"),n=nt?.getAttribute("target")?.split("+")||["body"];window.addEventListener("load",(()=>{n.map((async n=>{const r=self.document.querySelector(n);await et.debug(t).mount(r,{cache:e})}))}))}if(self.document?.currentScript?.hasAttribute("css")){const t=nt?.getAttribute("css")?.split("+");for(const e of t){const t=document.createElement("style");switch(e){case"basic":t.textContent=z.A;break;case"utils":t.textContent=(void 0,[...U,...Object.entries(q).flatMap((([t,e])=>Object.entries(e).flatMap((([e,n])=>[`.${t} { ${e}: ${n} }`,`${J(t).join(",")} { ${e}: ${n} }`,...K(t,`${e}: ${n}`)])))),...tt(),...[[".opacity-0","opacity: 0"],...W.map((t=>[`.opacity-${t}`,"opacity: "+t/100]))].flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)])),...Y(B),...Z(B),...Y(G),...Z(G),...(rt=H,Object.entries(rt).flatMap((([t,e])=>[[`${e}t-auto`,`${t}-top: auto`],[`${e}b-auto`,`${t}-bottom: auto`],[`${e}l-auto`,`${t}-left: auto`],[`${e}r-auto`,`${t}-right: auto`],...I.map((t=>[t,t*R])).map((([n,r])=>[`${e}t-${n}`,`${t}-top: ${r}rem`])),...I.map((t=>[t,t*R])).map((([n,r])=>[`${e}b-${n}`,`${t}-bottom: ${r}rem`])),...I.map((t=>[t,t*R])).map((([n,r])=>[`${e}l-${n}`,`${t}-left: ${r}rem`])),...I.map((t=>[t,t*R])).map((([n,r])=>[`${e}r-${n}`,`${t}-right: ${r}rem`])),...I.map((n=>[`${e}t-${n}px`,`${t}-top: ${n}px`])),...I.map((n=>[`${e}t-${n}px`,`${t}-bottom: ${n}px`])),...I.map((n=>[`${e}t-${n}px`,`${t}-left: ${n}px`])),...I.map((n=>[`${e}t-${n}px`,`${t}-right: ${n}px`])),...W.map((n=>[`${e}y-${n}%`,`${t}-top: ${n}%`])),...W.map((n=>[`${e}y-${n}%`,`${t}-bottom: ${n}%;`])),...W.map((n=>[`${e}x-${n}%`,`${t}-left: ${n}%`])),...W.map((n=>[`${e}x-${n}%`,`${t}-right: ${n}%`]))])).flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)]))),...Y(H),...Z(H),".space-x-0 > * { margin-left: 0; }",".space-y-0 > * { margin-top: 0; }",...I.map((t=>`.space-x-${t} > :not(:first-child) { margin-left: ${t*R}rem; }`)),...I.map((t=>`.space-y-${t} > :not(:first-child) { margin-top: ${t*R}rem; }`)),...I.map((t=>`.space-x-${t}px > :not(:first-child) { margin-left: ${t}px; }`)),...I.map((t=>`.space-y-${t}px > :not(:first-child) { margin-top: ${t}px; }`)),".gap-0 { gap: 0; }",...I.map((t=>`.gap-${t} { gap: ${t*R}rem; }`)),...I.map((t=>`.gap-${t}px { gap: ${t}px; }`)),...I.map((t=>`.gap-x-${t} { column-gap: ${t*R}rem; }`)),...I.map((t=>`.gap-y-${t} { row-gap: ${t*R}rem; }`)),...I.map((t=>`.gap-x-${t}px { column-gap: ${t}px; }`)),...I.map((t=>`.gap-y-${t}px { row-gap: ${t}px; }`)),...Y(V),...[...D.map((t=>`border-${t} { border-width: ${t}px; }`))].flatMap((([t,e])=>[`.${t} { ${e} }`,`${J(t).join(",")} { ${e} }`,...K(t,e)]))].sort(Q).join("\n"));break;default:console.error(`Unknown style name: "${e}"`)}self.document.head.appendChild(t)}}var rt})()})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mancha",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Javscript HTML rendering engine",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",