mancha
Version:
Javscript HTML rendering engine
45 lines • 63.2 kB
JavaScript
var Mancha=(function(){let e=/^\s*(?!javascript:)(?:[\w+.-]+:|[^:/?#]*(?:[/?#]|$))/i;function t(t){return!e.test(t)}function n(e){if(!t(e))return e}function r(e){return n(e)}
/**
* @license
* SPDX-License-Identifier: Apache-2.0
*/
function i(e,t){let n=r(t);n!==void 0&&(e.href=n)}
/**
* @license
* SPDX-License-Identifier: Apache-2.0
*/
function a(e,t){let n=r(t);n!==void 0&&(e.href=n)}let o={};var s=class{constructor(e,t){this.privateDoNotAccessOrElseWrappedAttributePrefix=t}toString(){return this.privateDoNotAccessOrElseWrappedAttributePrefix}};let c=s;function l(e){return new c(o,e)}function u(e){return e instanceof s}function ee(e){if(u(e))return e.privateDoNotAccessOrElseWrappedAttributePrefix;throw Error(``)}function te(e,t,n,r){if(e.length===0)throw Error(``);let i=e.map(e=>ee(e)),a=n.toLowerCase();if(i.every(e=>a.indexOf(e)!==0))throw Error(`Attribute "${n}" does not match any of the allowed prefixes.`);t.setAttribute(n,r)}var ne=class{},re=class extends ne{constructor(e,t){super(),this.privateDoNotAccessOrElseWrappedStyleSheet=e}toString(){return this.privateDoNotAccessOrElseWrappedStyleSheet}};function ie(e){return new re(e,o)}function ae(e){if(e instanceof re)return e.privateDoNotAccessOrElseWrappedStyleSheet;throw Error(``)}
/**
* @license
* SPDX-License-Identifier: Apache-2.0
*/
function d(e,t){e.textContent=ae(t)}function f(e){return l(e[0].toLowerCase())}function p(e){let t=e[0];return ie(t)}function oe(e){return ie(e.map(ae).join(``))}let se=[f`:`,f`style`,f`class`];function*m(e,t=new Set){let n=new Set,r=Array.from(e.childNodes).filter(e=>!t.has(e));for(yield e;r.length;){let e=r.shift();n.has(e)||(n.add(e),yield e),e.childNodes&&Array.from(e.childNodes).filter(e=>!t.has(e)).forEach(e=>{r.push(e)})}}function h(e,t){return e?.[t]!==void 0}function g(e,t){return typeof e?.[t]==`function`}function _(e){return e.replace(/-./g,e=>e[1].toUpperCase())}function v(e,t){return e.attribs?e.attribs[t]??null:e.getAttribute?.(t)??null}function ce(e,t){return e.attribs?t in e.attribs:e.hasAttribute?.(t)??!1}function y(e,t,n=``){return v(e,n+t)||v(e,`data-${t}`)||(e.dataset?.[_(t)]??null)}function b(e,t,n){e.attribs?e.attribs[t]=n:e.setAttribute?.(t,n)}function x(e,t,n){e.attribs?e.attribs[t]=n:te(se,e,t,n)}function S(e,t,n){switch(t){case`disabled`:e.disabled=n;return;case`selected`:e.selected=n;return;case`checked`:e.checked=n;return;default:e[t]=n}}function C(e,t){e.attribs?delete e.attribs[t]:e.removeAttribute?.(t)}function le(e,t,n,r=``){ce(e,`${r}${t}`)?b(e,`${r}${t}`,n):ce(e,`data-${t}`)?b(e,`data-${t}`,n):b(e,`${r}${t}`,n)}function w(e,t,n=``){C(e,`${n}${t}`),C(e,`data-${t}`)}function ue(e,t,n){if(e.attribs&&t.attribs)t.attribs[n]=e.attribs[n];else if(n.startsWith(`data-`)){let r=_(n.slice(5));t.dataset&&e.dataset&&(t.dataset[r]=e.dataset[r])}else{let r=e?.getAttribute?.(n);x(t,n,r||``)}}function de(e){return h(e,`firstElementChild`)?e.firstElementChild:Array.from(e.children).find(e=>e.nodeType===1)}function T(e,...t){if(g(e,`replaceWith`)){e.replaceWith(...t);return}else{let n=e,r=n.parentNode;if(!r)return;let i=Array.from(r.childNodes).indexOf(n);n.parentNode=null,t.forEach(e=>{e.parentNode=r}),r.childNodes=[].concat(Array.from(r.childNodes).slice(0,i),t,Array.from(r.childNodes).slice(i+1))}}function fe(e,...t){g(e,`replaceChildren`)?e.replaceChildren(...t):(e.childNodes=t,t.forEach(t=>{t.parentNode=e}))}function E(e,t){return g(t,`appendChild`)?e.appendChild(t):(e.childNodes.push(t),t.parentNode=e,t)}function D(e,t){return g(t,`removeChild`)?e.removeChild(t):(fe(e,...Array.from(e.childNodes).filter(e=>e!==t)),t)}function pe(e,t,n){return n?g(e,`insertBefore`)?e.insertBefore(t,n):(T(n,t,n),t):E(e,t)}function me(e,t=0){return e?e.length<=t?e:`${e.slice(0,t-1)}…`:``}function O(e,t=0){return globalThis.DocumentFragment&&e instanceof DocumentFragment?Array.from(e.childNodes).map(e=>O(e,t)).join(``):me(e.outerHTML||e.nodeValue||String(e),t)}function k(e){return e.includes(`/`)?e.split(`/`).slice(0,-1).join(`/`):``}function he(e){return!e.includes(`://`)&&!e.startsWith(`/`)&&!e.startsWith(`#`)&&!e.startsWith(`data:`)}var A=class e{iterable;constructor(e){this.iterable=e}filter(t){return new e(e.filterGenerator(t,this.iterable))}map(t){return new e(e.mapGenerator(t,this.iterable))}find(e){for(let t of this.iterable)if(e(t))return t}array(){return Array.from(this.iterable)}*generator(){for(let e of this.iterable)yield e}static*filterGenerator(e,t){for(let n of t)e(n)&&(yield n)}static*mapGenerator(e,t){for(let n of t)yield e(n)}static equals(e,t){let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(i.value!==a.value)return!1;i=n.next(),a=r.next()}return i.done===a.done}};let j;(function(e){e.resolveIncludes=async function(e,t){let n=e,r=n.tagName?.toLowerCase();if(![`include`,`link`].includes(r)||r===`link`&&v(n,`rel`)!==`subresource`)return;this.log(`include directive found in:
`,O(e,128)),this.log(`include params:`,t);let i=n.tagName.toLocaleLowerCase()===`link`?`href`:`src`,a=v(n,i);if(!a)throw Error(`"${i}" attribute missing from ${O(e,128)}.`);let o=[];r===`include`&&o.push(`src`),r===`link`&&o.push(`rel`,`href`);let s=t=>{let r=de(t);for(let e of Array.from(n.attributes))r&&!o.includes(e.name)&&ue(n,r,e.name);T(e,...t.childNodes)},c={...t,rootDocument:!1,maxdepth:(t?.maxdepth??100)-1};if(c.maxdepth===0)throw Error(`Maximum recursion depth reached.`);if(a.includes(`://`)||a.startsWith(`//`))this.log(`Including remote file from absolute path:`,a),await this.preprocessRemote(a,c).then(s);else if(t?.dirpath?.includes(`://`)||t?.dirpath?.startsWith(`//`)){let e=a.startsWith(`/`)?a:`${t.dirpath}/${a}`;this.log(`Including remote file from relative path:`,e),await this.preprocessRemote(e,c).then(s)}else if(a.charAt(0)===`/`)this.log(`Including local file from absolute path:`,a),await this.preprocessLocal(a,c).then(s);else{let e=t?.dirpath&&t?.dirpath!==`.`?`${t?.dirpath}/${a}`:a;this.log(`Including local file from relative path:`,e),await this.preprocessLocal(e,c).then(s)}},e.rebaseRelativePaths=function(e,t){let n=e,r=n.tagName?.toLowerCase();if(!t?.dirpath)return;let o=v(n,`src`),s=v(n,`href`),c=y(n,`render`,`:`),l=o||s||c;if(!l||!he(l))return;let u=`${t.dirpath}/${l}`;this.log(`Rebasing relative path as:`,u),c?le(n,`render`,u,`:`):h(n,`attribs`)?x(n,o?`src`:`href`,u):r===`img`?n.src=u:r===`a`?i(n,u):r===`source`||r===`audio`||r===`video`||r===`track`||r===`input`?n.src=u:r===`area`?a(n,u):this.log(`Unable to rebase relative path for element:`,r)},e.registerCustomElements=function(e,t){let n=e,r=n.tagName?.toLowerCase(),i=(v(n,`is`)||v(n,`alt`))?.toLowerCase();if([`template`,`div`].includes(r)&&i){if(r===`div`&&v(n,`role`)!==`template`)return;if(!this._customElements.has(i)){this.log(`Registering custom element: ${i}\n`,O(n,128));let e=n.content||n,r=Array.from(m(e));for(let e=1;e<r.length;e++)j.rebaseRelativePaths.call(this,r[e],t);this._customElements.set(i,n),n?.parentNode&&D(n.parentNode,n)}}},e.resolveCustomElements=function(e,t){let n=e,r=n.tagName?.toLowerCase(),i=r;if(i===`div`&&(i=v(n,`role`)?.toLowerCase()||i),i&&this._customElements.has(i)){this.log(`Processing custom element: ${i}\n`,O(n,128));let t=this._customElements.get(i),a=(t.content||t).cloneNode(!0),o=de(a);if(o)for(let e of Array.from(n.attributes))(r!==`div`||e.name!==`role`)&&ue(n,o,e.name);let s=new A(m(a)).find(e=>e.tagName?.toLowerCase()===`slot`);s&&T(s,...n.childNodes),T(e,...a.childNodes)}},e.resolveTextNodeExpressions=function(e,t){let n=e.nodeValue||``;if(e.nodeType!==3||!n?.trim())return;this.log(`Processing node content value:
`,me(n,128));let r=new RegExp(/{{ ([^}]+) }}/gm),i=Array.from(n.matchAll(r)).map(e=>e[1]);return this.effect(function(){let t=n;for(let n of i){let r=this.eval(n,{$elem:e});t=t.replace(`{{ ${n} }}`,String(r))}e.nodeValue=t})},e.resolveDataAttribute=async function(e,t){if(this._skipNodes.has(e))return;let n=e,r=y(n,`data`,`:`);if(r){this.log(`:data attribute found in:
`,O(e,128)),w(n,`data`,`:`);let i;h(e,`renderer`)?(i=e.renderer,this.log(`Reusing existing subrenderer for node:`,O(e,64))):(i=this.subrenderer(),S(e,`renderer`,i),this.log(`Created and attached new subrenderer for node:`,O(e,64)));let a=i.eval(r,{$elem:e});if(await Promise.all(Object.entries(a).map(([e,t])=>e.startsWith(`$$`)?(i._store.get(`$rootRenderer`)||i).set(e,t):i._store.set(e,t))),i===this)return;for(let t of m(e,this._skipNodes))this._skipNodes.add(t);await i.mount(e,t)}},e.resolveClassAttribute=function(e,t){if(this._skipNodes.has(e))return;let n=e,r=y(n,`class`,`:`);if(r){this.log(`:class attribute found in:
`,O(e,128)),w(n,`class`,`:`);let t=v(n,`class`)||``;return this.effect(function(){let i=this.eval(r,{$elem:e});x(n,`class`,(i?`${t} ${i}`:t).trim())})}},e.resolveTextAttributes=function(e,t){if(this._skipNodes.has(e))return;let n=e,r=y(n,`text`,`:`);if(r){this.log(`:text attribute found in:
`,O(e,128)),w(n,`text`,`:`);let t=t=>this.textContent(e,t);return this.effect(function(){t(this.eval(r,{$elem:e}))})}},e.resolveHtmlAttribute=async function(e,t){if(this._skipNodes.has(e))return;let n=e,r=y(n,`html`,`:`);if(r)return this.log(`:html attribute found in:
`,O(e,128)),w(n,`html`,`:`),this.effect(function(){let i=this.eval(r,{$elem:e});return new Promise(e=>{(async()=>{let r=await this.preprocessString(i,t);await this.renderNode(r),fe(n,r),e()})()})})},e.resolveEventAttributes=function(e,t){if(this._skipNodes.has(e))return;let n=e;for(let t of Array.from(n.attributes||[]))if(t.name.startsWith(`:on:`)||t.name.startsWith(`data-on-`)){let r=``,i=[];if(t.name.startsWith(`:on:`)?[r,...i]=t.name.substring(4).split(`.`):t.name.startsWith(`data-on-`)&&([r,...i]=t.name.substring(8).split(`.`)),!r)throw Error(`Invalid event attribute: ${t.name}`);this.log(t.name,`attribute found in:
`,O(e,128)),w(n,t.name);let a=r===`submit`&&n.tagName.toUpperCase()===`FORM`;e.addEventListener?.(r,n=>((i.includes(`prevent`)||a)&&n.preventDefault(),this.eval(t.value,{$elem:e,$event:n})))}},e.resolveForAttribute=async function(e,t){if(this._skipNodes.has(e))return;let n=e,r=y(n,`for`,`:`)?.trim();if(r){this.log(`:for attribute found in:
`,O(e,128)),w(n,`for`,`:`);for(let t of m(e,this._skipNodes))this._skipNodes.add(t);let i=v(n,`style`)||``;b(n,`style`,`display: none;`);let a=e.parentNode;if(!a)return;let o=this.createElement(`template`,e.ownerDocument);pe(a,o,e),D(a,e),`content`in o?E(o.content,e):E(o,e),this.log(`:for template:
`,O(o,128));let s=r.split(` in `,2);if(s.length!==2)throw Error(`Invalid :for format: \`${r}\`. Expected "{key} in {expression}".`);let c=[],[l,u]=s;await this.effect(function(){let n=this.eval(u,{$elem:e});if(this.log(`:for list items:`,n),c.splice(0,c.length).forEach(e=>{e.parentNode===a&&D(a,e),this._skipNodes.delete(e)}),!Array.isArray(n))return console.error(`Expression did not yield a list: \`${u}\` => \`${n}\``),Promise.resolve();let r=[];for(let a of n){let n=this.subrenderer();n._store.set(l,a);let o=e.cloneNode(!0);b(o,`style`,i),c.push(o),this._skipNodes.add(o),r.push(n.mount(o,t)),this.log(`Rendered list child:
`,O(o,128))}let s=o.nextSibling;for(let e of c)pe(a,e,s);return Promise.all(r)})}},e.resolveBindAttribute=function(e,t){if(this._skipNodes.has(e))return;let n=e,r=y(n,`bind`,`:`);if(r){this.log(`:bind attribute found in:
`,O(e,128));let t=v(n,`:bind:on`)?.split(`,`)||n.dataset?.bindOn?.split(`,`)||[`change`,`input`];w(n,`bind`,`:`),C(n,`:bind:on`),C(n,`data-bind-on`);let i=v(n,`type`)===`checkbox`?`checked`:`value`;!r.includes(`.`)&&!this.has(r)&&this.set(r,``),this.effect(function(){let t=this.eval(r,{$elem:e});i===`checked`?n.checked=!!t:n.value=t});let a=`${r} = $elem.${i}`;for(let n of t)e.addEventListener(n,()=>this.eval(a,{$elem:e}))}},e.resolveIfAttribute=function(e,t){if(this._skipNodes.has(e))return;let n=e,r=y(n,`if`,`:`);if(r){this.log(`:if attribute found in:
`,O(e,128)),w(n,`if`,`:`);let t=this.createComment(` :if placeholder `,e.ownerDocument);this.effect(function(){this.eval(r,{$elem:e})?!n.parentNode&&t.parentNode&&T(t,n):n.parentNode&&T(n,t)})}},e.resolveShowAttribute=function(e,t){if(this._skipNodes.has(e))return;let n=e,r=y(n,`show`,`:`);if(r){this.log(`:show attribute found in:
`,O(e,128)),w(n,`show`,`:`);let t=n.style?.display===`none`?``:n.style?.display??v(n,`style`)?.split(`;`)?.find(e=>e.split(`:`)[0]===`display`)?.split(`:`)?.at(1)?.trim();this.effect(function(){let i=this.eval(r,{$elem:e});n.style?n.style.display=i?t:`none`:x(n,`style`,`display: ${i?t:`none`};`)})}},e.resolveCustomAttribute=function(e,t){if(this._skipNodes.has(e))return;let n=e;for(let t of Array.from(n.attributes||[])){let r=`:attr:`,i=`data-attr-`;if(t.name.startsWith(r)||t.name.startsWith(i)){this.log(t.name,`attribute found in:
`,O(e,128)),C(n,t.name);let a=(t.name.split(r,2).at(-1)||``).split(i,2).at(-1)??``;this.effect(function(){b(n,a,this.eval(t.value,{$elem:e}))})}}},e.resolveCustomProperty=function(e,t){if(this._skipNodes.has(e))return;let n=e;for(let t of Array.from(n.attributes||[])){let r=`:prop:`,i=`data-prop-`;if(t.name.startsWith(r)||t.name.startsWith(i)){this.log(t.name,`property found in:
`,O(e,128)),C(n,t.name);let a=_((t.name.split(r,2).at(-1)||``).split(i,2).at(-1)??``);this.effect(function(){S(n,a,this.eval(t.value,{$elem:e}))})}}},e.stripTypes=(e,t)=>{let n=e;v(n,`:types`)&&C(n,`:types`),v(n,`data-types`)&&C(n,`data-types`)},e.resolveRenderAttribute=async function(e,t){if(this._skipNodes.has(e))return;let n=e,r=y(n,`render`,`:`);if(!r)return;this.log(`:render attribute found: ${r}`),w(n,`render`,`:`);let i;h(e,`renderer`)?(i=e.renderer,this.log(`Reusing existing subrenderer for :render:`,O(e,64))):(i=this.subrenderer(),S(n,`renderer`,i)),await i.mount(e,t);for(let t of m(e,this._skipNodes))this._skipNodes.add(t);try{let e=await import(r);typeof e.default==`function`?await e.default(n,i):e.default!==void 0&&console.warn(`Module ${r} default export is not a function`)}catch(e){console.error(`Failed to execute render init from ${r}:`,e)}}})(j||={});function M(){return new URL(globalThis.window?.location?.href||`http://localhost/`)}function ge(e){return e.substring(2)}function _e(e){return`\$\$${e}`}function ve(e){return e.keys().filter(e=>e.startsWith(`$$`))}async function ye(e,t){for(let[n,r]of t.searchParams.entries()){let t=_e(n);e.get(t)!==r&&await e.set(t,r)}}function be(e,t,n){let r=ge(t),i=!1;if(!n)e.searchParams.has(r)&&(e.searchParams.delete(r),i=!0);else{let t=String(n);e.searchParams.get(r)!==t&&(e.searchParams.set(r,t),i=!0)}return i}function xe(e,t){let n=!1;for(let r of ve(t))be(e,r,t.get(r))&&(n=!0);n&&globalThis.window?.history?.replaceState({},``,e.toString())}function Se(e){return async()=>{let t=M(),n=new Set;for(let[r,i]of t.searchParams.entries()){let t=_e(r);n.add(t),e.get(t)!==i&&e.set(t,i)}let r=ve(e);for(let t of r)n.has(t)||e.del(t)}}async function Ce(e){let t=M();await ye(e,t),xe(t,e),e.addKeyHandler(/^\$\$/,(e,t)=>{let n=M();be(n,e,t)&&globalThis.window?.history?.replaceState({},``,n.toString())}),globalThis.window?.addEventListener(`popstate`,Se(e))}
/*
* @license
* Portions Copyright (c) 2013, the Dart project authors.
*/
let we=new Set([`this`,`typeof`]),Te=new Set([`in`]),Ee=new Set([`+`,`-`,`!`,`typeof`]),De=new Set([`=`,`+`,`-`,`*`,`/`,`%`,`^`,`==`,`!=`,`>`,`<`,`>=`,`<=`,`||`,`&&`,`??`,`&`,`===`,`!==`,`|`,`in`]),N={"!":0,":":0,",":0,")":0,"]":0,"}":0,"?":2,"??":3,"||":4,"&&":5,"|":6,"^":7,"&":8,"!=":9,"==":9,"!==":9,"===":9,">=":10,">":10,"<=":10,"<":10,in:10,"+":11,"-":11,"%":12,"/":12,"*":12,"(":13,"[":13,".":13,"?.":13,"{":13},Oe={"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,"||":(e,t)=>e||t,"&&":(e,t)=>e&&t,"??":(e,t)=>e??t,"|":(e,t)=>t(e),in:(e,t)=>e in t},ke={"+":e=>e,"-":e=>-e,"!":e=>!e,typeof:e=>typeof e};var Ae=class{empty(){return{type:`Empty`,evaluate(e){return e},getIds(e){return e}}}literal(e){return{type:`Literal`,value:e,evaluate(e){return this.value},getIds(e){return e}}}id(e){return{type:`ID`,value:e,evaluate(e){return this.value===`this`?e:e?.[this.value]},getIds(e){return e.push(this.value),e}}}unary(e,t){let n=ke[e];return{type:`Unary`,operator:e,child:t,evaluate(e){return n(this.child.evaluate(e))},getIds(e){return this.child.getIds(e)}}}binary(e,t,n){let r=Oe[t];return{type:`Binary`,operator:t,left:e,right:n,evaluate(e){if(this.operator===`=`){if(this.left.type!==`ID`&&this.left.type!==`Getter`&&this.left.type!==`Index`)throw Error(`Invalid assignment target: ${this.left}`);let t=this.right.evaluate(e),n,r;return this.left.type===`Getter`?(n=this.left.receiver.evaluate(e),r=this.left.name):this.left.type===`Index`?(n=this.left.receiver.evaluate(e),r=String(this.left.argument.evaluate(e))):this.left.type===`ID`&&(n=e,r=this.left.value),n===void 0?void 0:(n[r]=t,t)}return r(this.left.evaluate(e),this.right.evaluate(e))},getIds(e){return this.left.getIds(e),this.right.getIds(e),e}}}getter(e,t,n){return{type:`Getter`,receiver:e,name:t,optional:n,evaluate(e){let t=this.receiver.evaluate(e);if(!(this.optional&&t==null))return t?.[this.name]},getIds(e){return this.receiver.getIds(e),e}}}invoke(e,t,n,r){if(t!=null&&typeof t!=`string`)throw Error(`method not a string`);return{type:`Invoke`,receiver:e,method:t,arguments:n,optional:r,evaluate(e){let t=this.receiver.evaluate(e);if(this.optional&&t==null)return;let n=this.method?t:e?.this??e,r=this.method?t?.[this.method]:t,i=this.arguments??[],a=[];for(let t of i)if(t?.type===`SpreadElement`){let n=t.evaluate(e);n&&typeof n[Symbol.iterator]==`function`&&a.push(...n)}else a.push(t?.evaluate(e));return r?.apply?.(n,a)},getIds(e){return this.receiver.getIds(e),this.arguments?.forEach(t=>{t?.getIds(e)}),e}}}paren(e){return e}index(e,t,n){return{type:`Index`,receiver:e,argument:t,optional:n,evaluate(e){let t=this.receiver.evaluate(e);if(this.optional&&t==null)return;let n=this.argument.evaluate(e);return t?.[n]},getIds(e){return this.receiver.getIds(e),e}}}ternary(e,t,n){return{type:`Ternary`,condition:e,trueExpr:t,falseExpr:n,evaluate(e){return this.condition.evaluate(e)?this.trueExpr.evaluate(e):this.falseExpr.evaluate(e)},getIds(e){return this.condition.getIds(e),this.trueExpr.getIds(e),this.falseExpr.getIds(e),e}}}map(e){return{type:`Map`,properties:e,evaluate(t){let n={};if(e&&this.properties)for(let e of this.properties)e.type===`SpreadProperty`?Object.assign(n,e.evaluate(t)):n[e.key]=e.value.evaluate(t);return n},getIds(t){if(e&&this.properties)for(let e of this.properties)e.type===`SpreadProperty`?e.expression.getIds(t):e.value.getIds(t);return t}}}property(e,t){return{type:`Property`,key:e,value:t,evaluate(e){return this.value.evaluate(e)},getIds(e){return this.value.getIds(e)}}}list(e){return{type:`List`,items:e,evaluate(e){if(!this.items)return[];let t=[];for(let n of this.items)if(n?.type===`SpreadElement`){let r=n.evaluate(e);r&&typeof r[Symbol.iterator]==`function`&&t.push(...r)}else t.push(n?.evaluate(e));return t},getIds(e){return this.items?.forEach(t=>{t?.getIds(e)}),e}}}arrowFunction(e,t){return{type:`ArrowFunction`,params:e,body:t,evaluate(e){let t=this.params,n=this.body;return(...r)=>{let i=Object.fromEntries(t.map((e,t)=>[e,r[t]])),a=new Proxy(e??{},{set(e,t,n){return Object.hasOwn(i,t)&&(i[t]=n),e[t]=n,n},get(e,t){return Object.hasOwn(i,t)?i[t]:e[t]}});return n.evaluate(a)}},getIds(e){return this.body.getIds(e).filter(e=>!this.params.includes(e))}}}spreadProperty(e){return{type:`SpreadProperty`,expression:e,evaluate(e){return this.expression.evaluate(e)},getIds(e){return this.expression.getIds(e)}}}spreadElement(e){return{type:`SpreadElement`,expression:e,evaluate(e){return this.expression.evaluate(e)},getIds(e){return this.expression.getIds(e)}}}};
/*
* @license
* Portions Copyright (c) 2013, the Dart project authors.
*/
let je=new Set([`==`,`!=`,`<=`,`>=`,`||`,`&&`,`??`,`?.`]),Me=new Set([`===`,`!==`]),P=function(e){return e[e.STRING=1]=`STRING`,e[e.IDENTIFIER=2]=`IDENTIFIER`,e[e.DOT=3]=`DOT`,e[e.COMMA=4]=`COMMA`,e[e.COLON=5]=`COLON`,e[e.INTEGER=6]=`INTEGER`,e[e.DECIMAL=7]=`DECIMAL`,e[e.OPERATOR=8]=`OPERATOR`,e[e.GROUPER=9]=`GROUPER`,e[e.KEYWORD=10]=`KEYWORD`,e[e.ARROW=11]=`ARROW`,e[e.OPTIONAL_DOT=12]=`OPTIONAL_DOT`,e[e.SPREAD=13]=`SPREAD`,e}({}),F=(e,t,n=0)=>({kind:e,value:t,precedence:n}),Ne=e=>e===9||e===10||e===13||e===32,Pe=e=>{if(e===95||e===36)return!0;let t=e&-33;return 65<=t&&t<=90},Fe=e=>Pe(e)||I(e),Ie=e=>we.has(e),Le=e=>e===34||e===39,I=e=>48<=e&&e<=57,Re=e=>e===43||e===45||e===42||e===47||e===33||e===38||e===37||e===60||e===61||e===62||e===63||e===94||e===124,ze=e=>e===40||e===41||e===91||e===93||e===123||e===125,Be=e=>e.replace(/\\(.)/g,(e,t)=>{switch(t){case`n`:return`
`;case`r`:return`\r`;case`t`:return` `;case`b`:return`\b`;case`f`:return`\f`;default:return t}});var Ve=class{_input;_index=-1;_tokenStart=0;_next;constructor(e){this._input=e,this._advance()}nextToken(){for(;Ne(this._next??-1);)this._advance(!0);if(Le(this._next??-1))return this._tokenizeString();if(Pe(this._next??-1))return this._tokenizeIdentOrKeyword();if(I(this._next??-1))return this._tokenizeNumber();if(this._next===46)return this._tokenizeDot();if(this._next===44)return this._tokenizeComma();if(this._next===58)return this._tokenizeColon();if(Re(this._next??-1))return this._tokenizeOperator();if(ze(this._next??-1))return this._tokenizeGrouper();if(this._advance(),this._next!==void 0)throw Error(`Expected end of input, got ${this._next}`)}_advance(e){this._index++,this._index<this._input.length?(this._next=this._input.charCodeAt(this._index),e===!0&&(this._tokenStart=this._index)):this._next=void 0}_getValue(e=0){let t=this._input.substring(this._tokenStart,this._index+e);return e===0&&this._clearValue(),t}_clearValue(){this._tokenStart=this._index}_tokenizeString(){let e=this._next;for(this._advance(!0);this._next!==e;){if(this._next===void 0||this._next===92&&(this._advance(),this._next===void 0))throw Error(`unterminated string`);this._advance()}let t=F(P.STRING,Be(this._getValue()));return this._advance(),t}_tokenizeIdentOrKeyword(){do this._advance();while(Fe(this._next??-1));let e=this._getValue();return F(Ie(e)?P.KEYWORD:Te.has(e)?P.OPERATOR:P.IDENTIFIER,e,N[e]??0)}_tokenizeNumber(){do this._advance();while(I(this._next??-1));return this._next===46?this._tokenizeDot():F(P.INTEGER,this._getValue())}_tokenizeDot(){if(this._advance(),I(this._next??-1))return this._tokenizeFraction();if(this._next===46){if(this._advance(),this._next===46)return this._advance(),this._clearValue(),F(P.SPREAD,`...`);throw Error(`Unexpected token ..`)}return this._clearValue(),F(P.DOT,`.`,13)}_tokenizeComma(){return this._advance(!0),F(P.COMMA,`,`)}_tokenizeColon(){return this._advance(!0),F(P.COLON,`:`)}_tokenizeFraction(){do this._advance();while(I(this._next??-1));return F(P.DECIMAL,this._getValue())}_tokenizeOperator(){this._advance();let e=this._getValue(2);if(Me.has(e))this._advance(),this._advance();else{if(e=this._getValue(1),e===`=>`)return this._advance(),F(P.ARROW,e);je.has(e)&&this._advance()}return e=this._getValue(),e===`?.`?F(P.OPTIONAL_DOT,e,13):F(P.OPERATOR,e,N[e])}_tokenizeGrouper(){let e=String.fromCharCode(this._next??0),t=F(P.GROUPER,e,N[e]);return this._advance(!0),t}};let He=(e,t)=>new Ue(e,t).parse();var Ue=class{_kind;_tokenizer;_ast;_token;_value;constructor(e,t){this._tokenizer=new Ve(e),this._ast=t}parse(){this._advance();let e=this._parseExpression();if(this._token)throw Error(`Unexpected token: ${this._token.value}`);return e}_advance(e,t){if(!this._matches(e,t))throw Error(`Expected kind ${e} (${t}), was ${this._token?.kind} (${this._token?.value})`);let n=this._tokenizer.nextToken();this._token=n,this._kind=n?.kind,this._value=n?.value}_matches(e,t){return!(e&&this._kind!==e||t&&this._value!==t)}_parseExpression(){if(!this._token)return this._ast.empty();let e=this._parseUnary();return e===void 0?void 0:this._parsePrecedence(e,0)}_parsePrecedence(e,t){if(e===void 0)throw Error(`Expected left to be defined.`);for(;this._token;)if(this._matches(P.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t)}else if(this._matches(P.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t)}else if(this._matches(P.DOT)||this._matches(P.OPTIONAL_DOT)){let t=this._kind===P.OPTIONAL_DOT;if(this._advance(),t&&this._matches(P.GROUPER,`[`)){let t=this._parseIndex();e=this._ast.index(e,t,!0)}else if(t&&this._matches(P.GROUPER,`(`)){let t=this._parseArguments();e=this._ast.invoke(e,void 0,t,!0)}else{let n=this._parseUnary();e=this._makeInvokeOrGetter(e,n,t)}}else if(this._matches(P.KEYWORD))break;else if(this._matches(P.OPERATOR)&&this._token.precedence>=t)e=this._value===`?`?this._parseTernary(e):this._parseBinary(e,this._token);else break;return e}_makeInvokeOrGetter(e,t,n){if(t===void 0)throw Error(`expected identifier`);if(t.type===`ID`)return this._ast.getter(e,t.value,n);if(t.type===`Invoke`&&t.receiver.type===`ID`){let r=t.receiver;return this._ast.invoke(e,r.value,t.arguments,n)}else throw Error(`expected identifier: ${t}`)}_parseBinary(e,t){if(!De.has(t.value))throw Error(`unknown operator: ${t.value}`);this._advance();let n=this._parseUnary();for(;(this._kind===P.OPERATOR||this._kind===P.DOT||this._kind===P.GROUPER)&&this._token&&(this._token.precedence??0)>t.precedence;)n=this._parsePrecedence(n,this._token?.precedence??0);if(n===void 0)throw Error(`Expected expression after ${t.value}`);return this._ast.binary(e,t.value,n)}_parseUnary(){if(this._matches(P.KEYWORD,`typeof`)){this._advance();let e=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(`typeof`,e)}if(this._matches(P.OPERATOR)){let e=this._value;if(this._advance(),e===`+`||e===`-`){if(this._matches(P.INTEGER))return this._parseInteger(e);if(this._matches(P.DECIMAL))return this._parseDecimal(e)}if(!e||!Ee.has(e))throw Error(`unexpected token: ${e}`);let t=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(e,t)}return this._parsePrimary()}_parseTernary(e){this._advance(P.OPERATOR,`?`);let t=this._parseExpression();this._advance(P.COLON);let n=this._parseExpression();return this._ast.ternary(e,t,n)}_parsePrimary(){switch(this._kind){case P.KEYWORD:{let e=this._value??``;if(e===`this`)return this._advance(),this._ast.id(e);throw we.has(e)?Error(`unexpected keyword: ${e}`):Error(`unrecognized keyword: ${e}`)}case P.IDENTIFIER:return this._parseInvokeOrIdentifier();case P.STRING:return this._parseString();case P.INTEGER:return this._parseInteger();case P.DECIMAL:return this._parseDecimal();case P.GROUPER:return this._value===`(`?this._parseParenOrFunction():this._value===`{`?this._parseMap():this._value===`[`?this._parseList():void 0;case P.COLON:throw Error(`unexpected token ":"`);default:return}}_parseList(){let e=[];do{if(this._advance(),this._matches(P.GROUPER,`]`))break;if(this._matches(P.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else e.push(this._parseExpression())}while(this._matches(P.COMMA));return this._advance(P.GROUPER,`]`),this._ast.list(e)}_parseMap(){let e=[];do{if(this._advance(),this._matches(P.GROUPER,`}`))break;if(this._matches(P.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadProperty(t))}else{let t=this._value??``;if((this._matches(P.STRING)||this._matches(P.IDENTIFIER))&&this._advance(),this._matches(P.COLON)){this._advance(P.COLON);let n=this._parseExpression();n&&e.push(this._ast.property(t,n))}else e.push(this._ast.property(t,this._ast.id(t)))}}while(this._matches(P.COMMA));return this._advance(P.GROUPER,`}`),this._ast.map(e)}_parseInvokeOrIdentifier(){let e=this._value;if(e===`true`)return this._advance(),this._ast.literal(!0);if(e===`false`)return this._advance(),this._ast.literal(!1);if(e===`null`)return this._advance(),this._ast.literal(null);if(e===`undefined`)return this._advance(),this._ast.literal(void 0);let t=this._parseIdentifier(),n=this._parseArguments();return n?this._ast.invoke(t,void 0,n):t}_parseIdentifier(){if(!this._matches(P.IDENTIFIER))throw Error(`expected identifier: ${this._value}`);let e=this._value;return this._advance(),this._ast.id(e??``)}_parseArguments(){if(!this._matches(P.GROUPER,`(`))return;let e=[];do{if(this._advance(),this._matches(P.GROUPER,`)`))break;if(this._matches(P.SPREAD)){this._advance();let t=this._parseExpression();t&&e.push(this._ast.spreadElement(t))}else{let t=this._parseExpression();e.push(t)}}while(this._matches(P.COMMA));return this._advance(P.GROUPER,`)`),e}_parseIndex(){this._advance();let e=this._parseExpression();return this._advance(P.GROUPER,`]`),e}_parseParenOrFunction(){let e=this._parseArguments();if(this._matches(P.ARROW)){this._advance();let t=this._parseExpression(),n=e?.map(e=>e.value)??[];return this._ast.arrowFunction(n,t)}else return this._ast.paren(e?.[0])}_parseString(){let e=this._ast.literal(this._value??``);return this._advance(),e}_parseInteger(e=``){let t=this._ast.literal(parseInt(`${e}${this._value}`,10));return this._advance(),t}_parseDecimal(e=``){let t=this._ast.literal(parseFloat(`${e}${this._value}`));return this._advance(),t}},We=class{timeouts=new Map;debounce(e,t){return new Promise((n,r)=>{let i=this.timeouts.get(t);i&&clearTimeout(i),this.timeouts.set(t,setTimeout(()=>{try{n(t()),this.timeouts.delete(t)}catch(e){r(e)}},e))})}};let Ge=new Ae,L=`__is_proxy__`;function Ke(e){return e instanceof Je||e[L]===!0}function R(e,t){let n=e?._store;if(n?.has(t))return n.get(t);if(n?.has(`$parent`))return R(n.get(`$parent`),t)}function z(e,t){let n=e?._store;return n?.has(t)?e:n?.has(`$parent`)?z(n.get(`$parent`),t):null}function qe(e,t,n){let r=z(e,t);r?r._store.set(t,n):e._store.set(t,n)}var Je=class extends We{evalkeys=[`$elem`,`$event`];expressionCache=new Map;observers=new Map;keyHandlers=new Map;_observer=null;_store=new Map;_lock=Promise.resolve();constructor(e){super();for(let[t,n]of Object.entries(e||{}))this.set(t,n)}wrapFunction(e){return(...t)=>e.call(this.$,...t)}wrapObject(e,t){return e==null||Ke(e)||e.constructor!==Object&&!Array.isArray(e)?e:new Proxy(e,{deleteProperty:(e,n)=>typeof n==`string`&&n in e?(delete e[n],t(),!0):!1,set:(e,n,r,i)=>{typeof r==`object`&&r&&(r=this.wrapObject(r,t));let a=Reflect.set(e,n,r,i);return t(),a},get:(e,t,n)=>t===L?!0:Reflect.get(e,t,n)})}watch(e,t){let n=z(this,e);if(!n)throw Error(`Cannot watch key "${e}" as it does not exist in the store.`);n.observers.has(e)||n.observers.set(e,new Set),n.observers.get(e)?.has(t)||n.observers.get(e)?.add(t)}addKeyHandler(e,t){this.keyHandlers.has(e)||this.keyHandlers.set(e,new Set),this.keyHandlers.get(e)?.add(t)}async notify(e,t=10){let n=z(this,e),r=Array.from(n?.observers.get(e)||[]);await this.debounce(t,()=>Promise.all(r.map(e=>e.call(this.proxify(e)))))}get(e,t){return t&&this.watch(e,t),R(this,e)}async set(e,t){if(this._store.has(e)&&t===this._store.get(e))return;let n=()=>this.notify(e);t&&typeof t==`function`&&(t=this.wrapFunction(t)),t&&typeof t==`object`&&(t=this.wrapObject(t,n)),qe(this,e,t);for(let[n,r]of this.keyHandlers.entries())if(n.test(e))for(let n of r)await Promise.resolve(n.call(this.$,e,t));await n()}async del(e){await this.set(e,null),this._store.delete(e),this.observers.delete(e)}keys(){return Array.from(this._store.keys())}has(e){return this._store.has(e)}effect(e){return e.call(this.proxify(e))}proxify(e){let t=Array.from(this._store.entries()).map(([e])=>e),n=Object.fromEntries(t.map(e=>[e,null]));return new Proxy(n,{has:(e,t)=>typeof t==`string`&&(z(this,t)||Reflect.has(this,t))?!0:Reflect.has(n,t),get:(t,n,r)=>{if(typeof n==`string`){if(z(this,n))return this.get(n,e);if(e&&n!==L&&!Reflect.has(this,n))return this.set(n,void 0),this.get(n,e)}return n===`$`?this.proxify(e):Reflect.get(this,n,r)},set:(e,t,n,r)=>(typeof t!=`string`||t in this?Reflect.set(this,t,n,r):this.set(t,n),!0)})}get $(){return this.proxify()}makeEvalFunction(e){return(t,n)=>{let r=He(e,Ge),i=new Proxy(n,{has(e,n){return n in e||n in t||n in globalThis},get(e,n){if(typeof n==`string`)return n in e?e[n]:n in t?t[n]:n in globalThis?globalThis[n]:t[n]},set(e,n,r){return typeof n==`string`?n in e?(e[n]=r,!0):(t[n]=r,!0):!1}});return r?.evaluate(i)}}cachedExpressionFunction(e){e=e.trim(),this.expressionCache.has(e)||this.expressionCache.set(e,this.makeEvalFunction(e));let t=this.expressionCache.get(e);if(!t)throw Error(`Failed to retrieve cached expression: ${e}`);return t}eval(e,t={}){let n=this._observer?this:this.$;if(this._store.has(e))return n[e];{let r=this.cachedExpressionFunction(e);try{return r(n,t)}catch(t){return console.error(`Failed to evaluate expression: ${e}`),console.error(t),null}}}$resolve(e,t){let n={$pending:!0,$result:null,$error:null};return Promise.resolve().then(()=>e(t)).then(e=>{n.$result=e}).catch(e=>{n.$error=e instanceof Error?e:Error(String(e))}).finally(()=>{n.$pending=!1}),n}},Ye=class extends Je{debugging=!1;dirpath=``;_skipNodes=new Set;_customElements=new Map;debug(e){return this.debugging=e,this}async fetchRemote(e,t){return fetch(e,{cache:t?.cache??`default`}).then(e=>e.text())}async fetchLocal(e,t){return this.fetchRemote(e,t)}async preprocessString(e,t){this.log(`Preprocessing string content with params:
`,t);let n=this.parseHTML(e,t);return await this.preprocessNode(n,t),n}async preprocessRemote(e,t){let n={};t?.cache&&(n.cache=t.cache);let r=await fetch(e,n).then(e=>e.text());return this.preprocessString(r,{...t,dirpath:k(e),rootDocument:t?.rootDocument??!e.endsWith(`.tpl.html`)})}async preprocessLocal(e,t){let n=await this.fetchLocal(e,t);return this.preprocessString(n,{...t,dirpath:k(e),rootDocument:t?.rootDocument??!e.endsWith(`.tpl.html`)})}subrenderer(){let e=new this.constructor().debug(this.debugging);return e._store.set(`$parent`,this),e._store.set(`$rootRenderer`,this.get(`$rootRenderer`)??this),e._customElements=this._customElements,e}log(...e){this.debugging&&console.debug(...e)}async preprocessNode(e,t){t={dirpath:this.dirpath,maxdepth:10,...t};let n=new A(m(e,this._skipNodes)).map(async e=>{this.log(`Preprocessing node:
`,O(e,128)),await j.resolveIncludes.call(this,e,t),await j.rebaseRelativePaths.call(this,e,t),await j.registerCustomElements.call(this,e,t),await j.resolveCustomElements.call(this,e,t)});return await Promise.all(n.generator()),e}async renderNode(e,t){for(let n of m(e,this._skipNodes))this.log(`Rendering node:
`,O(n,128)),await j.resolveForAttribute.call(this,n,t),await j.resolveRenderAttribute.call(this,n,t),await j.resolveDataAttribute.call(this,n,t),await j.resolveTextAttributes.call(this,n,t),await j.resolveHtmlAttribute.call(this,n,t),await j.resolveIfAttribute.call(this,n,t),await j.resolveShowAttribute.call(this,n,t),await j.resolveClassAttribute.call(this,n,t),await j.resolveBindAttribute.call(this,n,t),await j.resolveEventAttributes.call(this,n,t),await j.resolveTextNodeExpressions.call(this,n,t),await j.resolveCustomAttribute.call(this,n,t),await j.resolveCustomProperty.call(this,n,t),await j.stripTypes.call(this,n,t);return e}async mount(e,t){t={...t,rootNode:e},S(e,`renderer`,this),this._store.set(`$rootNode`,e),this.has(`$rootRenderer`)||this._store.set(`$rootRenderer`,this),this.get(`$rootRenderer`)===this&&await Ce(this),await this.preprocessNode(e,t),await this.renderNode(e,t)}};function Xe(){return oe([p`*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}`,p`html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}`,p`body{margin:0;line-height:inherit}`,p`hr{height:0;color:inherit;border-top-width:1px}`,p`abbr:where([title]){text-decoration:underline dotted}`,p`b,strong{font-weight:bolder}`,p`code,kbd,samp,pre{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-size:1em}`,p`small{font-size:80%}`,p`sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}`,p`sub{bottom:-0.25em}`,p`sup{top:-0.5em}`,p`button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}`,p`button,select{text-transform:none}`,p`button,[type='button'],[type='reset'],[type='submit']{-webkit-appearance:button;background-color:transparent;background-image:none;cursor:pointer}`,p`:-moz-focusring{outline:auto}`,p`:-moz-ui-invalid{box-shadow:none}`,p`progress{vertical-align:baseline}`,p`::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}`,p`[type='search']{-webkit-appearance:textfield;outline-offset:-2px}`,p`::-webkit-search-decoration{-webkit-appearance:none}`,p`::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}`,p`summary{display:list-item}`,p`blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}`,p`fieldset{margin:0;padding:0}`,p`legend{padding:0}`,p`ol,ul,menu{list-style:none;margin:0;padding:0}`,p`textarea{resize:vertical}`,p`::placeholder{opacity:1;color:#9ca3af}`,p`button,[role="button"]{cursor:pointer}`,p`:disabled{cursor:default;pointer-events:none;opacity:0.75}`,p`img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}`,p`img,video{max-width:100%;height:auto}`,p`[hidden]{display:none}`,p`dialog{padding:0}`,p`dialog::backdrop{background:rgba(0,0,0,0.5)}`])}function Ze(){return oe([p`html{`,p`max-width: 70ch;`,p`padding: 2em 1em;`,p`margin: auto;`,p`line-height: 1.75;`,p`font-size: 1.25em;`,p`font-family: sans-serif;`,p`}`,p`h1,h2,h3,h4,h5,h6{`,p`margin: 1em 0 0.5em;`,p`}`,p`p,ul,ol{`,p`margin-bottom: 1em;`,p`color: #1d1d1d;`,p`}`])}let Qe={sm:640,md:768,lg:1024,xl:1280},$e=Object.entries(Qe),B=.25,V=[...Array(15)].map((e,t)=>t+1),et=[16,20,24,28,32,36,40,48,56,64],tt=[72,80,96,128,160,192,256,320,384,512],H=[...V,...et,...tt,...Object.values(Qe)],U=Array.from({length:20},(e,t)=>(t+1)*5),nt=[0,10,20,30,40,50,60,70,80,90,100],rt=[25,50,75,100,150,200,300,500,700,1e3],it=[`hover`,`focus`,`disabled`],W={margin:`m`,padding:`p`},at={width:`w`,height:`h`},ot={top:`top`,right:`right`,bottom:`bottom`,left:`left`},st={"min-width":`min-w`,"min-height":`min-h`,"max-width":`max-w`,"max-height":`max-h`},ct={"font-mono":{"font-family":`monospace`},"font-sans":{"font-family":`sans-serif`},"font-serif":{"font-family":`serif`},"font-cursive":{"font-family":`cursive`},"text-xs":{"font-size":`.75rem`,"line-height":`calc(1 / 0.75)`},"text-sm":{"font-size":`.875rem`,"line-height":`calc(1.25 / 0.875)`},"text-base":{"font-size":`1rem`,"line-height":`calc(1.5 / 1)`},"text-lg":{"font-size":`1.125rem`,"line-height":`calc(1.75 / 1.125)`},"text-xl":{"font-size":`1.25rem`,"line-height":`calc(1.75 / 1.25)`},"text-2xl":{"font-size":`1.5rem`,"line-height":`calc(2 / 1.5)`},"text-3xl":{"font-size":`1.875rem`,"line-height":`calc(2.25 / 1.875)`},"text-4xl":{"font-size":`2.25rem`,"line-height":`calc(2.5 / 2.25)`},"text-5xl":{"font-size":`3rem`,"line-height":`1`},"text-6xl":{"font-size":`3.75rem`,"line-height":`1`},"text-7xl":{"font-size":`4.5rem`,"line-height":`1`},"font-thin":{"font-weight":100},"font-extralight":{"font-weight":200},"font-light":{"font-weight":300},"font-normal":{"font-weight":400},"font-medium":{"font-weight":500},"font-semibold":{"font-weight":600},"font-bold":{"font-weight":700},"font-extrabold":{"font-weight":800},"font-black":{"font-weight":900},italic:{"font-style":`italic`},"not-italic":{"font-style":`normal`},"w-max":{width:`max-content`},"w-min":{width:`min-content`},"w-fit":{width:`fit-content`},"h-max":{height:`max-content`},"h-min":{height:`min-content`},"h-fit":{height:`fit-content`},"size-auto":{width:`auto`,height:`auto`},"size-px":{width:`1px`,height:`1px`},"size-full":{width:`100%`,height:`100%`},"size-dvw":{width:`100dvw`,height:`100dvw`},"size-dvh":{width:`100dvh`,height:`100dvh`},"size-lvw":{width:`100lvw`,height:`100lvw`},"size-lvh":{width:`100lvh`,height:`100lvh`},"size-svw":{width:`100svw`,height:`100svw`},"size-svh":{width:`100svh`,height:`100svh`},"size-min":{width:`min-content`,height:`min-content`},"size-max":{width:`max-content`,height:`max-content`},"size-fit":{width:`fit-content`,height:`fit-content`},"tracking-tighter":{"letter-spacing":`-0.05em`},"tracking-tight":{"letter-spacing":`-0.025em`},"tracking-normal":{"letter-spacing":`0`},"tracking-wide":{"letter-spacing":`0.025em`},"tracking-wider":{"letter-spacing":`0.05em`},"tracking-widest":{"letter-spacing":`0.1em`},"leading-none":{"line-height":`1`},"leading-tight":{"line-height":`1.25`},"leading-snug":{"line-height":`1.375`},"leading-normal":{"line-height":`1.5`},"leading-relaxed":{"line-height":`1.625`},"leading-loose":{"line-height":`2`},"text-left":{"text-align":`left`},"text-right":{"text-align":`right`},"text-center":{"text-align":`center`},"text-justify":{"text-align":`justify`},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`},truncate:{"white-space":`nowrap`,overflow:`hidden`,"text-overflow":`ellipsis`},"text-elipsis":{"text-overflow":`ellipsis`},"text-clip":{"text-overflow":`clip`},"text-wrap":{"text-wrap":`wrap`},"text-nowrap":{"text-wrap":`nowrap`},"text-balance":{"text-wrap":`balance`},"text-pretty":{"text-wrap":`pretty`},"whitespace-normal":{"white-space":`normal`},"whitespace-nowrap":{"white-space":`nowrap`},"whitespace-pre":{"white-space":`pre`},"whitespace-pre-line":{"white-space":`pre-line`},"whitespace-pre-wrap":{"white-space":`pre-wrap`},"whitespace-break-spaces":{"white-space":`break-spaces`},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`},visible:{visibility:`visible`},invisible:{visibility:`hidden`},collapse:{visibility:`collapse`},"list-none":{"list-style-type":`none`},"list-disc":{"list-style-type":`disc`},"list-decimal":{"list-style-type":`decimal`},flex:{display:`flex`},grid:{display:`grid`},"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},"align-baseline":{"vertical-align":`baseline`},"align-top":{"vertical-align":`top`},"align-middle":{"vertical-align":`middle`},"align-bottom":{"vertical-align":`bottom`},"align-text-top":{"vertical-align":`text-top`},"align-text-bottom":{"vertical-align":`text-bottom`},"overflow-auto":{overflow:`auto`},"overflow-x-auto":{"overflow-x":`auto`},"overflow-y-auto":{"overflow-y":`auto`},"overflow-hidden":{overflow:`hidden`},"overflow-x-hidden":{"overflow-x":`hidden`},"overflow-y-hidden":{"overflow-y":`hidden`},"overflow-visible":{overflow:`visible`},"overscroll-auto":{"overscroll-behavior":`auto`},"overscroll-contain":{"overscroll-behavior":`contain`},"overscroll-none":{"overscroll-behavior":`none`},"overscroll-x-auto":{"overscroll-behavior-x":`auto`},"overscroll-x-contain":{"overscroll-behavior-x":`contain`},"overscroll-x-none":{"overscroll-behavior-x":`none`},"overscroll-y-auto":{"overscroll-behavior-y":`auto`},"overscroll-y-contain":{"overscroll-behavior-y":`contain`},"overscroll-y-none":{"overscroll-behavior-y":`none`},"z-auto":{"z-index":`auto`},"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`},"appearance-none":{appearance:`none`,"-webkit-appearance":`none`,"-moz-appearance":`none`},border:{border:`1px solid`},"border-none":{border:`none`},"border-solid":{"border-style":`solid`},"border-dashed":{"border-style":`dashed`},"border-dotted":{"border-style":`dotted`},"border-collapse":{"border-collapse":`collapse`},"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`},"shadow-2xs":{"box-shadow":`0 1px rgb(0 0 0 / 0.05)`},"shadow-xs":{"box-shadow":`0 1px 2px 0 rgb(0 0 0 / 0.05)`},shadow:{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-sm":{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-md":{"box-shadow":`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`},"shadow-lg":{"box-shadow":`0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)`},"shadow-xl":{"box-shadow":`0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)`},"shadow-2xl":{"box-shadow":`0 25px 50px -12px rgb(0 0 0 / 0.25)`},"shadow-inner":{"box-shadow":`inset 0 2px 4px 0 rgb(0 0 0 / 0.05)`},"shadow-none":{"box-shadow":`0 0 #0000`},ring:{"box-shadow":`var(--ring-inset, ) 0 0 0 3px rgb(59 130 246 / 0.5)`},"ring-0":{"box-shadow":`var(--ring-inset, ) 0 0 0 0px rgb(59 130 246 / 0.5)`},"ring-1":{"box-shadow":`var(--ring-inset, ) 0 0 0 1px rgb(59 130 246 / 0.5)`},"ring-2":{"box-shadow":`var(--ring-inset, ) 0 0 0 2px rgb(59 130 246 / 0.5)`},"ring-4":{"box-shadow":`var(--ring-inset, ) 0 0 0 4px rgb(59 130 246 / 0.5)`},"ring-8":{"box-shadow":`var(--ring-inset, ) 0 0 0 8px rgb(59 130 246 / 0.5)`},"ring-inset":{"--ring-inset":`inset`},outline:{"outline-style":`solid`},"outline-none":{outline:`2px solid transparent`,"outline-offset":`2px`},"outline-dashed":{"outline-style":`dashed`},"outline-dotted":{"outline-style":`dotted`},"outline-double":{"outline-style":`double`},"outline-0":{"outline-width":`0px`},"outline-1":{"outline-width":`1px`},"outline-2":{"outline-width":`2px`},"outline-4":{"outline-width":`4px`},"outline-8":{"outline-width":`8px`},"outline-offset-0":{"outline-offset":`0px`},"outline-offset-1":{"outline-offset":`1px`},"outline-offset-2":{"outline-offset":`2px`},"outline-offset-4":{"outline-offset":`4px`},"outline-offset-8":{"outline-offset":`8px`},"aspect-auto":{"aspect-ratio":`auto`},"aspect-square":{"aspect-ratio":`1 / 1`},"aspect-video":{"aspect-ratio":`16 / 9`},"backdrop-blur-none":{"backdrop-filter":`blur(0)`},"backdrop-blur-sm":{"backdrop-filter":`blur(4px)`},"backdrop-blur":{"backdrop-filter":`blur(8px)`},"backdrop-blur-md":{"backdrop-filter":`blur(12px)`},"backdrop-blur-lg":{"backdrop-filter":`blur(16px)`},"backdrop-blur-xl":{"backdrop-filter":`blur(24px)`},"backdrop-blur-2xl":{"backdrop-filter":`blur(40px)`},"backdrop-blur-3xl":{"backdrop-filter":`blur(64px)`},"transition-none":{transition:`none`},transition:{"transition-property":`all`,"transition-timing-function":`ease-in-out`,"transition-duration":`var(--transition-duration, 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`},"bg-auto":{"background-size":`auto`},"bg-cover":{"background-size":`cover`},"bg-contain":{"background-size":`contain`},"bg-no-repeat":{"background-repeat":`no-repeat`},"bg-fixed":{"background-attachment":`fixed`},"bg-local":{"background-attachment":`local`},"bg-scroll":{"background-attachment":`scroll`},"min-h-screen":{"min-height":`100vh`},"max-h-screen":{"max-height":`100vh`},"min-w-screen":{"min-width":`100vw`},"h-dvh":{height:`100dvh`},"h-svh":{height:`100svh`},"h-lvh":{height:`100lvh`},"w-dvw":{width:`100dvw`},"w-svw":{width:`100svw`},"w-lvw":{width:`100lvw`},"min-h-dvh":{"min-height":`100dvh`},"min-h-svh":{"min-height":`100svh`},"min-h-lvh":{"min-height":`100lvh`},"flex-none":{flex:`none`},"flex-auto":{flex:`1 1 auto`},"flex-initial":{flex:`0 1 auto`},grow:{"flex-grow":`1`},"grow-0":{"flex-grow":`0`},shrink:{"flex-shrink":`1`},"shrink-0":{"flex-shrink":`0`},"self-auto":{"align-self":`auto`},"self-start":{"align-self":`flex-start`},"self-end":{"align-self":`flex-end`},"self-center":{"align-self":`center`},"self-stretch":{"align-self":`stretch`},"self-baseline":{"align-self":`baseline`},"content-normal":{"align-content":`normal`},"content-start":{"align-content":`flex-start`},"content-end":{"align-content":`flex-end`},"content-center":{"align-content":`center`},"content-between":{"align-content":`space-between`},"content-around":{"align-content":`space-around`},"content-evenly":{"align-content":`space-evenly`},"content-stretch":{"align-content":`stretch`},"items-baseline":{"align-items":`baseline`},"inset-0":{inset:`0`},"inset-auto":{inset:`auto`},"in