p-l)for(var g=n(t[c],0);l=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0&&void 0!==arguments[0]?arguments[0]:fe(),o=nt(this.t,3),a=o[0],u=o[1],c=o[2],l=document.importNode(a,!0),f=this.v,s=f.length,v=U;if(s!==u.length)throw yt(this.t[3],f);if(0",x+2);if(k<0)throw ut(t);if("--\x3e"===o.slice(k-2,k+1)){if(k-x<6)throw ft(t);var A=o.slice(x+4,k-2);"!"===A[0]&&z(d,new n(A.slice(1).replace(/!$/,"")))}else{if(!o.slice(x+2,k).toLowerCase().startsWith("doctype"))throw vt(t,o.slice(x+2,k));z(d,new i(o.slice(x+2,k)))}p=k+1}else if(S.startsWith("")){var j=o.indexOf(">",x+2);if(j<0)throw ct(t);if(r&&"svg"===d.name&&(r=!1),!(d=Ct(d,l)))throw st(t);p=j+1}else{var E=x+S.length,C=o.indexOf(">",E),T=S.slice(1);if(C<0)throw at(t,T);var I=T;if(T===St?(I="template",d=z(d,new v),g=Et(d).slice(1),s.push(h(d,B,g,"",e[b++]))):(r||(I=I.toLowerCase(),"table"!==d.name||"tr"!==I&&"td"!==I||(d=z(d,new f("tbody",r)),l.add(d)),"tbody"===d.name&&"td"===I&&(d=z(d,new f("tr",r)),l.add(d))),d=z(d,new f(I,!!r&&"svg"!==I)),g=U),E"),p);if(F<0)throw ot(t,I);var H=o.slice(p,F);if(H.trim()===St)y++,s.push(h(d,3,Et(d),"",e[b++]));else{if(H.includes(St))throw it(t,I,H);z(d,new a(H))}if(!(d=d.parent))throw st(t);p=F+T.length+3,y++;continue}}}}}catch(t){m.e(t)}finally{m.f()}if(p1&&void 0!==arguments[1]?arguments[1]:new WeakMap;return function(n){for(var r,i=e.get(n),o=arguments.length,a=new Array(o>1?o-1:0),u=1;u1?e-1:0),r=1;r1?e-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{},n=t.all,r=void 0!==n&&n,i=t.shallow,o=void 0===i||i,a=t.useState,u=void 0===a?Be:a,c=t.getAttribute,l=void 0===c?function(t,e){return t.getAttribute(e)}:c;return function(t,n,i){var a=function(t,e,n,r,i,o){for(var a={},u=i!==Be,c=[n,r,u],l=_e(t),f=0;f]*?)(\/?)>/g,l=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,o=/[\x01\x02]/g;const a=(e,t)=>111===e.nodeType?1/t<0?t?(({firstChild:e,lastChild:t})=>{const n=document.createRange();return n.setStartAfter(e),n.setEndAfter(t),n.deleteContents(),e})(e):e.lastChild:t?e.valueOf():e.firstChild:e,{isArray:c}=Array,i=e=>null==e?e:e.valueOf(),u=(e,t)=>{let n,s,r=t.slice(2);return!(t in e)&&(s=t.toLowerCase())in e&&(r=s.slice(2)),t=>{const s=c(t)?t:[t,!1];n!==s[0]&&(n&&e.removeEventListener(r,n,s[1]),(n=s[0])&&e.addEventListener(r,n,s[1]))}};const{isArray:d,prototype:p}=Array,{indexOf:h}=p,{createDocumentFragment:f,createElement:g,createElementNS:b,createTextNode:m,createTreeWalker:y,importNode:v}=new Proxy(document,{get:(e,t)=>e[t].bind(e)});let w;const x=(e,t)=>t?(e=>{w||(w=b("http://www.w3.org/2000/svg","svg")),w.innerHTML=e;const t=f();return t.append(...w.childNodes),t})(e):(e=>{const t=g("template");return t.innerHTML=e,t.content})(e),C=({childNodes:e},t)=>e[t],A=(e,t,n)=>((e,t,n,s,r)=>{const l=n.length;let o=t.length,a=l,c=0,i=0,u=null;for(;cr-i){const l=s(t[c],0);for(;i{switch(t[0]){case"?":return((e,t,n)=>s=>{const r=!!i(s);n!==r&&((n=r)?e.setAttribute(t,""):e.removeAttribute(t))})(e,t.slice(1),!1);case".":return((e,t)=>"dataset"===t?(({dataset:e})=>t=>{for(const n in t){const s=t[n];null==s?delete e[n]:e[n]=s}})(e):n=>{e[t]=n})(e,t.slice(1));case"@":return u(e,"on"+t.slice(1));case"o":if("n"===t[1])return u(e,t)}switch(t){case"ref":return(e=>{let t;return n=>{t!==n&&(t=n,"function"==typeof n?n(e):n.current=e)}})(e);case"aria":return(e=>t=>{for(const n in t){const s="role"===n?n:`aria-${n}`,r=t[n];null==r?e.removeAttribute(s):e.setAttribute(s,r)}})(e)}return((e,t)=>{let n,s=!0;const r=document.createAttributeNS(null,t);return t=>{const l=i(t);n!==l&&(null==(n=l)?s||(e.removeAttributeNode(r),s=!0):(r.value=l,s&&(e.setAttributeNodeNS(r),s=!1)))}})(e,t)};function N(e){const{type:t,path:n}=e,s=n.reduceRight(C,this);return"node"===t?(e=>{let t,n,s=[];const r=l=>{switch(typeof l){case"string":case"number":case"boolean":t!==l&&(t=l,n||(n=m("")),n.data=l,s=A(e,s,[n]));break;case"object":case"undefined":if(null==l){t!=l&&(t=l,s=A(e,s,[]));break}if(d(l)){t=l,0===l.length?s=A(e,s,[]):"object"==typeof l[0]?s=A(e,s,l):r(String(l));break}if(t!==l)if("ELEMENT_NODE"in l)t=l,s=A(e,s,11===l.nodeType?[...l.childNodes]:[l]);else{const e=l.valueOf();e!==l&&r(e)}break;case"function":r(l(e))}};return r})(s):"attr"===t?k(s,e.name):(e=>{let t;return n=>{const s=i(n);t!=s&&(t=s,e.textContent=null==s?"":s)}})(s)}const E=e=>{const t=[];let{parentNode:n}=e;for(;n;)t.push(h.call(n.childNodes,e)),e=n,({parentNode:n}=e);return t},O="isµ",$=new n,S=/^(?:textarea|script|style|title|plaintext|xmp)$/,M=(e,t)=>{const n="svg"===e,a=((e,t,n)=>{let a=0;return e.join("").trim().replace(r,((e,t,r,o)=>{let a=t+r.replace(l,"=$2$1").trimEnd();return o.length&&(a+=n||s.test(t)?" /":">"+t),"<"+a+">"})).replace(o,(e=>""===e?"\x3c!--"+t+a+++"--\x3e":t+a++))})(t,O,n),c=x(a,n),i=y(c,129),u=[],d=t.length-1;let p=0,h=`${O}${p}`;for(;p{const{content:n,nodes:s}=$.get(t)||$.set(t,M(e,t)),r=v(n,!0);return{content:r,updates:s.map(N,r)}},L=(e,{type:t,template:n,values:s})=>{const r=j(e,s);let{entry:l}=e;l&&l.template===n&&l.type===t||(e.entry=l=((e,t)=>{const{content:n,updates:s}=T(e,t);return{type:e,template:t,content:n,updates:s,wire:null}})(t,n));const{content:o,updates:a,wire:c}=l;for(let e=0;e{const{firstChild:t,lastChild:n}=e;if(t===n)return n||e;const{childNodes:s}=e,r=[...s];return{ELEMENT_NODE:1,nodeType:111,firstChild:t,lastChild:n,valueOf:()=>(s.length!==r.length&&e.append(...r),e)}})(o))},j=({stack:e},t)=>{const{length:n}=t;for(let s=0;s{const s=new n;return Object.assign(((t,...n)=>new P(e,t,n)),{for(n,r){const l=s.get(n)||s.set(n,new t);return l.get(r)||l.set(r,(t=>(n,...s)=>L(t,{type:e,template:n,values:s}))({stack:[],entry:null,wire:null}))},node:(t,...n)=>L({stack:[],entry:null,wire:null},new P(e,t,n)).valueOf()})},D=new n,W=(e,t)=>{const n="function"==typeof t?t():t,s=D.get(e)||D.set(e,{stack:[],entry:null,wire:null}),r=n instanceof P?L(s,n):n;return r!==s.wire&&(s.wire=r,e.replaceChildren(r.valueOf())),e},H=B("html"),_=B("svg");function z(e){for(var t=e[0],n=1,s=arguments.length;n({configurable:!0,get:()=>s,set(l){(e||l!==s||t&&"object"==typeof l&&l)&&(s=l,n?r.call(this,s):r.call(this))}}),q=()=>{};const G=(({all:e=!1,shallow:t=!0,useState:n=q,getAttribute:s=((e,t)=>e.getAttribute(t))}={})=>(r,l,o)=>{const a=((e,t,n,s,r,l)=>{const o={},a=r!==q,c=[n,s,a];for(let n=F(e),s=0;s{let n=e[t],l=typeof n;return r.hasOwnProperty(t)?(n=r[t],delete r[t]):r.hasAttribute(t)&&(n=s(r,t),"number"==l?n=+n:"boolean"==l&&(n=!/^(?:false|0|)$/.test(n))),n}),e,t,n,o);return R(r,a)})({dom:!0}),I=customElements,{define:K}=I,{parse:Q,stringify:U}=JSON,{create:V,defineProperties:X,getOwnPropertyDescriptor:Y,keys:Z}=Object,ee="element",te=new WeakMap,ne=(se=new Map([[ee,{c:HTMLElement,e:ee}]]),{get:e=>se.get(e),set:(e,t)=>(se.set(e,t),t)});var se;const re=e=>document.createElement(e),le=e=>ne.get(e)||ne.set(e,{c:re(e).constructor,e:e}),oe=(e,t)=>{const{attachShadow:n,attributeChanged:s,bound:r,connected:l,disconnected:o,formAssociated:a,handleEvent:c,init:i,observedAttributes:u,props:d,render:p,style:h}=t,f=new WeakMap,g={},b={},m=[],y=V(null),v=(e,t,s)=>{if(!f.has(e)){f.set(e,0),X(e,{html:{configurable:!0,value:ce.bind(n?e.attachShadow(n):e)}});for(let t=0;t{n.push(d(void 0));try{return e()}finally{d(n.pop())}};class g{constructor(e,t){this._=e(t)}get value(){return this._()}set value(e){this._(e)}peek(){return v(this._)}valueOf(){return this.value}}const{isArray:m}=Array,{assign:b,defineProperties:w,entries:y,freeze:x}=Object;class S{#e;constructor(e){this.#e=e}valueOf(){return this.#e}toString(){return String(this.#e)}}const $=e=>document.createComment(e),k=42,C=new Set(["plaintext","script","style","textarea","title","xmp"]),E=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]),O=x({}),T=x([]),N=(e,t)=>(e.children===T&&(e.children=[]),e.children.push(t),t.parent=e,t),D=(e,t,n)=>{e.props===O&&(e.props={}),e.props[t]=n},A=(e,t,n)=>{e!==t&&n.push(e)};class W{constructor(e){this.type=e,this.parent=null}toJSON(){return[this.type,this.data]}}class M extends W{constructor(e){super(8),this.data=e}toString(){return`\x3c!--${this.data}--\x3e`}}class L extends W{constructor(e){super(10),this.data=e}toString(){return``}}class j extends W{constructor(e){super(3),this.data=e}toString(){return this.data}}class I extends W{constructor(){super(k),this.name="template",this.props=O,this.children=T}toJSON(){const e=[k];return A(this.props,O,e),A(this.children,T,e),e}toString(){let e="";for(const t in this.props){const n=this.props[t];null!=n&&("boolean"==typeof n?n&&(e+=` ${t}`):e+=` ${t}="${n}"`)}return`${this.children.join("")}`}}class P extends W{constructor(e,t=!1){super(1),this.name=e,this.xml=t,this.props=O,this.children=T}toJSON(){const e=[1,this.name,+this.xml];return A(this.props,O,e),A(this.children,T,e),e}toString(){const{xml:e,name:t,props:n,children:s}=this,{length:i}=s;let r=`<${t}`;for(const t in n){const s=n[t];null!=s&&("boolean"==typeof s?s&&(r+=e?` ${t}=""`:` ${t}`):r+=` ${t}="${s}"`)}if(i){r+=">";for(let n=!e&&C.has(t),o=0;o`}else r+=e?" />":E.has(t)?">":`>${t}>`;return r}}class R extends W{constructor(){super(11),this.name="#fragment",this.children=T}toJSON(){const e=[11];return A(this.children,T,e),e}toString(){return this.children.join("")}}const J=e=>(e?.raw||e)?.join?.(",")||"unknown";var _=(e,t,n)=>new SyntaxError(`Mixed text and interpolations found in text only <${t}> element ${JSON.stringify(String(n))} in template ${J(e)}`),F=(e,t)=>new SyntaxError(`The text only <${t}> element requires explicit ${t}> closing tag in template ${J(e)}`),B=(e,t)=>new SyntaxError(`Unclosed element <${t}> found in template ${J(e)}`),V=e=>new SyntaxError(`Invalid content "new SyntaxError(`Invalid closing tag: new SyntaxError(`Invalid content: NUL char \\x00 found in template: ${J(e)}`),U=e=>new SyntaxError(`Invalid comment: no closing --\x3e found in template ${J(e)}`),q=e=>new SyntaxError(`Too many closing tags found in template ${J(e)}`),G=(e,t)=>new SyntaxError(`Invalid doctype: ${t} found in template ${J(e)}`),K=e=>new SyntaxError(`Invalid template - the amount of values does not match the amount of updates: ${J(e)}`),Q=(e,t)=>new SyntaxError(`Invalid path - unreachable node at the path [${t.join(", ")}] found in template ${J(e)}`),X=(e,t)=>new SyntaxError(`Invalid ${t} attribute in template definition\n${J(e)}`),Y=(e,t)=>new SyntaxError(`Invalid interpolation - expected hole or array: ${String(t)} found in template ${J(e)}`),Z=e=>new SyntaxError(`Invalid key attribute or position in template: ${String(e)}`),ee=e=>new SyntaxError(`Invalid component: ${String(e)}`);const te="\0",ne=`"${te}"`,se=`'${te}'`,ie=/\x00|<[^><\s]+/g,re=/([^\s/>=]+)(?:=(\x00|(?:(['"])[\s\S]*?\3)))?/g,oe=(e,t,n,s,i)=>[t,n,s],le=e=>{const t=[];for(;e.parent;){switch(e.type){case k:case 1:"template"===e.name&&t.push(-1)}t.push(e.parent.children.indexOf(e)),e=e.parent}return t},ae=(e,t)=>{do{e=e.parent}while(t.has(e));return e};const ce=(e,t)=>t<0?e?.content:e?.childNodes?.[t];var ue=(e,t)=>t.reduceRight(ce,e);let fe,de=!1;const he=({firstChild:e,lastChild:t})=>{const n=fe||(fe=document.createRange());return n.setStartAfter(e),n.setEndAfter(t),n.deleteContents(),e},pe=(e,t)=>de&&11===e.nodeType?1/t<0?t?he(e):e.lastChild:t?e.valueOf():e.firstChild:e,ve=Symbol("nodes"),ge={get(){return this.firstChild.parentNode}},me={value(e){he(this).replaceWith(e)}},be={value(){he(this).remove()}},we={value(){const{parentNode:e}=this;if(e===this)this[ve]===T&&(this[ve]=[...this.childNodes]);else{if(e){let{firstChild:e,lastChild:t}=this;for(this[ve]=[e];e!==t;)this[ve].push(e=e.nextSibling)}this.replaceChildren(...this[ve])}return this}};function ye(e){const t=$("<>"),n=$(">");return e.replaceChildren(t,...e.childNodes,n),de=!0,w(e,{[ve]:{writable:!0,value:T},firstChild:{value:t},lastChild:{value:n},parentNode:ge,valueOf:we,replaceWith:me,remove:be})}ye.prototype=DocumentFragment.prototype;const xe=16,Se=32768,$e=((e=globalThis.document)=>{let t,n=e.createElement("template");return(s,i=!1)=>{if(i)return t||(t=e.createRange(),t.selectNodeContents(e.createElementNS("http://www.w3.org/2000/svg","svg"))),t.createContextualFragment(s);n.innerHTML=s;const r=n.content;return n=n.cloneNode(!1),r}})(document),ke=Symbol("ref"),Ce=(e,t)=>{for(const[n,s]of y(t)){const t="role"===n?n:`aria-${n.toLowerCase()}`;null==s?e.removeAttribute(t):e.setAttribute(t,s)}},Ee=e=>(t,n)=>{null==n?t.removeAttribute(e):t.setAttribute(e,n)},Oe=(e,t)=>{e[ve]=((e,t,n,s)=>{const i=s.parentNode,r=t.length;let o=e.length,l=r,a=0,c=0,u=null;for(;as-c){const r=n(e[a],0);for(;c{const n="object"==typeof t?t??e:((e,t)=>{let n=Te.get(e);return n?n.data=t:Te.set(e,n=document.createTextNode(t)),n})(e,t),s=e[ve]??e;n!==s&&s.replaceWith(pe(e[ve]=n,1))},De=(e,t)=>{Ne(e,t instanceof g?t.value:t)},Ae=({dataset:e},t)=>{for(const[n,s]of y(t))null==s?delete e[n]:e[n]=s},We=new Map,Me=e=>{let t=We.get(e);return t||We.set(e,t=Le(e)),t},Le=e=>(t,n)=>{t[e]=n},je=(e,t)=>{for(const[n,s]of y(t))Ee(n)(e,s)},Ie=(e,t,n)=>n?(n,s)=>{const i=n[t];i?.length&&n.removeEventListener(e,...i),s&&n.addEventListener(e,...s),n[t]=s}:(n,s)=>{const i=n[t];i&&n.removeEventListener(e,i),s&&n.addEventListener(e,s),n[t]=s},Pe=e=>(t,n)=>{t.toggleAttribute(e,!!n)};let Re=!1;let Je=!0;const _e=e=>{Je=e},Fe=()=>Je,Be=e=>pe(e.n?e.update(e):e.valueOf(!1),1),Ve=(e,t)=>{const n=[],s=e.length,i=t.length;for(let r,o,l=0,a=0;a{n.length;const s=Fe();s&&_e(!s);try{return e(t,Ge)}finally{s&&_e(s)}},He=(e,t)=>(e.t===t.t?e.update(t):(e.n.replaceWith(Be(t)),e=t),e),Ue=(e,t,n)=>{let i,r=[],o=[xe,null,n],l=!0;return function(e){const t={fn:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:2};void 0!==u?s(t,u):void 0!==f&&s(t,f);const n=d(t);try{t.fn()}finally{d(n)}p.bind(t)}(()=>{if(l)l=!1,i=ze(t,n,r),r.length||(r=T),i?(e.replaceWith(Be(i)),o[1]=i):e.remove();else{const e=ze(t,n,r);if(i){if(!(e instanceof Ke))throw ee(t);He(i,e)===e&&(o[2]=i=e)}}}),o},qe=Symbol(),Ge={};class Ke{constructor(e,t){this.t=e,this.v=t,this.n=null,this.k=-1}valueOf(e=Fe()){const[t,n,s]=this.t,i=document.importNode(t,!0),r=this.v;let o,l,a,c=r.length,u=T;if(c!==n.length)throw Y(this.t[3],r);if(0{for(const t of e){const e=t[ke];"function"==typeof e?e(t):e instanceof g?e.value=t:e&&(e.current=t)}})(a)}const{childNodes:f}=i,d=f.length,h=1===d?f[0]:d?ye(i):i;return this.v=u,this.n=h,-1e.t[2].get(t)?.update(e)??e.valueOf(!1))(e,s[t]);let{length:i}=n;for(;i--;){const e=n[i],[t,r,o]=e;if(512===t)continue;let l=s[i];if(t&xe)if(t===xe){if("function"!=typeof l)throw ee(l);const t=l(o,Ge);if(r){if(!(t instanceof Ke))throw ee(l);He(r,t)===t&&(e[2]=t)}}else r(o,l);else{let n=l;if(1&t){if(!m(l))throw Y([],l);if(8&t){if(l.length&&l[0]instanceof Ke){if(o.length&&!(o[0]instanceof Ke))throw Y([],l[0]);n=Ve(o,l)}}else if(256&t&&l[0]===o[0])continue}else if(8&t)if(t&Se){if(l===o){r(e[3],n);continue}}else if(o instanceof Ke){if(!(l instanceof Ke))throw Y([],l);l=He(o,l),n=l.n}l!==o&&(e[2]=l,r(e[3],n))}}return this.n}}const Qe=new WeakMap;class Xe extends Map{constructor(){super()._=new FinalizationRegistry(e=>this.delete(e))}get(e){const t=super.get(e)?.deref();return t&&Qe.get(t)}set(e,t,n){Qe.set(t,n),this._.register(t,e),super.set(e,new WeakRef(t))}}const Ye=(({Comment:e=M,DocumentType:t=L,Text:n=j,Fragment:s=R,Element:i=P,Component:r=I,update:o=oe})=>(l,a,c)=>{if(l.some(e=>e.includes(te)))throw H(l);const u=l.join(te).trim();if(u.replace(/(\S+)=(['"])([\S\s]+?)\2/g,(...e)=>/^[^\x00]+\x00|\x00[^\x00]+$/.test(e[3])?c=e[1]:e[0])!==u)throw X(l,c);const f=new Set,d=[];let h=new s,p=0,v=0,g=0,m=T;for(const s of u.matchAll(ie)){if(0",w+2);if(n<0)throw V(l);if("--\x3e"===u.slice(n-2,n+1)){if(n-w<6)throw U(l);const t=u.slice(w+4,n-2);"!"===t[0]&&N(h,new e(t.slice(1).replace(/!$/,"")))}else{if(!u.slice(w+2,n).toLowerCase().startsWith("doctype"))throw G(l,u.slice(w+2,n));N(h,new t(u.slice(w+2,n)))}p=n+1}else if(b.startsWith("")){const e=u.indexOf(">",w+2);if(e<0)throw z(l);if(c&&"svg"===h.name&&(c=!1),h=ae(h,f),!h)throw q(l);p=e+1}else{const e=w+b.length,t=u.indexOf(">",e),s=b.slice(1);if(t<0)throw B(l,s);let y=s;if(s===te?(y="template",h=N(h,new r),m=le(h).slice(1),d.push(o(h,k,m,"",a[g++]))):(c||(y=y.toLowerCase(),"table"!==h.name||"tr"!==y&&"td"!==y||(h=N(h,new i("tbody",c)),f.add(h)),"tbody"===h.name&&"td"===y&&(h=N(h,new i("tr",c)),f.add(h))),h=N(h,new i(y,!!c&&"svg"!==y)),m=T),e`,p);if(e<0)throw F(l,y);const t=u.slice(p,e);if(t.trim()===te)v++,d.push(o(h,3,le(h),"",a[g++]));else{if(t.includes(te))throw _(l,y,t);N(h,new n(t))}if(h=h.parent,!h)throw q(l);p=e+s.length+3,v++;continue}}}if(p{switch(t){case k:return[n,i,xe];case 8:return m(i)?[n,Oe,9]:i instanceof S?[n,(r=e.xml,(e,t)=>{const n=e[ke]??(e[ke]={});n.v!==t&&(n.f=ye($e(t,r)),n.v=t),Ne(e,n.f)}),8192]:i instanceof g?[n,De,32776]:[n,Ne,8];case 3:return[n,Me("textContent"),2048];case 2:{const t=e.type===k;switch(s.at(0)){case"@":{if(t)throw X([],s);const e=m(i);return[n,Ie(s.slice(1),Symbol(s),e),e?257:256]}case"?":if(t)throw X([],s);return[n,Pe(s.slice(1)),4096];case".":return"..."===s?[n,t?b:je,t?144:128]:[n,Le(s.slice(1)),t?80:64];default:if(t)return[n,Le(s),1040];if("aria"===s)return[n,Ce,2];if("data"===s&&!/^object$/i.test(e.name))return[n,Ae,32];if("key"===s){if(1(n,...s)=>{let i=t.get(n);return i||(i=Ye(n,s,e),i.push((()=>{const e=Re;return Re=!1,e})()?new Xe:null),i.push(n),i[0]=$e(i[0].toString(),e),t.set(n,i)),new Ke(i,s)},et=Ze(!1),tt=Ze(!0),nt=new WeakMap;function st(e,...t){const n=et.apply(null,arguments);return Fe()?n.valueOf(!0):n}function it(e,...t){const n=tt.apply(null,arguments);return Fe()?n.valueOf(!0):n}const rt=(e,t)=>{const n=nt.get(e);if(n&&n[0](),"function"==typeof t){let i;_e(!1);const r=function(e){const t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:0};void 0!==f&&s(t,f);const n=d(void 0),i=h(t);try{e()}finally{h(i),d(n)}return p.bind(t)}(()=>{i=t()});if(n&&n[1].t===i.t)n[1].update(i);else{const t=i.valueOf(!1);e.replaceChildren(t)}nt.set(e,[r,i])}else _e(!0),nt.delete(e),e.replaceChildren(t instanceof Ke?Be(t):pe(t,1));return e};function ot(e){for(var t=e[0],n=1,s=arguments.length;n({configurable:!0,get:()=>s,set(r){(e||r!==s||t&&"object"==typeof r&&r)&&(s=r,n?i.call(this,s):i.call(this))}}),ut=()=>{};const ft=(({all:e=!1,shallow:t=!0,useState:n=ut,getAttribute:s=(e,t)=>e.getAttribute(t)}={})=>(i,r,o)=>{const l=((e,t,n,s,i,r)=>{const o={},l=i!==ut,a=[n,s,l];for(let n=at(e),s=0;s{let n=e[t],r=typeof n;return i.hasOwnProperty(t)?(n=i[t],delete i[t]):i.hasAttribute(t)&&(n=s(i,t),"number"==r?n=+n:"boolean"==r&&(n=!/^(?:false|0|)$/.test(n))),n},e,t,n,o);return lt(i,l)})({}),dt=customElements,{define:ht}=dt,{parse:pt,stringify:vt}=JSON,{create:gt,defineProperties:mt,getOwnPropertyDescriptor:bt,keys:wt}=Object,yt="element",xt=new WeakMap,St=($t=new Map([[yt,{c:HTMLElement,e:yt}]]),{get:e=>$t.get(e),set:(e,t)=>($t.set(e,t),t)});var $t;const kt=e=>document.createElement(e),Ct=e=>St.get(e)||St.set(e,{c:kt(e).constructor,e:e}),Et=(e,t)=>{const{attachShadow:n,attributeChanged:s,bound:i,connected:r,disconnected:o,formAssociated:l,handleEvent:a,init:c,observedAttributes:u,props:f,render:d,style:h}=t,p=new WeakMap,v={},g={},m=[],b=gt(null),w=(e,t,s)=>{if(!p.has(e)){p.set(e,0),mt(e,{html:{configurable:!0,value:Tt.bind(n?e.attachShadow(n):e)}});for(let t=0;t');
@@ -12,87 +12,93 @@ globalThis.customElements = customElements;
globalThis.HTMLElement = HTMLElement;
globalThis.DocumentFragment = DocumentFragment;
-const uhtml = require('uhtml');
-const {define, css} = require('../cjs');
-
-console.assert(css`1${2}3` === '123', 'css works');
-
-define('el-0', {props: {}, attachShadow: {mode: 'open'}});
-define('el-1', {init() {}, style(selector) { return `${selector}{color:green}` }});
-define('el-2', {onClick() {}, ontest() {}, onCamelCase() {}});
-define('el-3', {onClick() {}, onClickOptions: true});
-define('el-4', {props: null, onClick() {}, handleEvent() {}});
-define('el-5', {
- props: {test: true},
- attachShadow: {mode: 'open'},
- observedAttributes: ['test'],
- attributeChanged() {}
-});
-define('el-6', {
- observedAttributes: ['test'],
- props: {test: true, items},
- bound: ['render'],
- constructor() {},
- connected() {},
- disconnected() {},
- render() {}
-});
-
-define('el-7', {extends: 'div', style(selector) { return `${selector}{color:green}` }});
-
-const El1 = customElements.get('el-1');
-const el1 = new El1(document);
-el1.connectedCallback();
-el1.attributeChangedCallback();
-el1.setAttribute('test', 123);
-console.assert(el1.props.test == 123, 'props working');
-
-const El2 = customElements.get('el-2');
-const el2 = new El2(document);
-el2.connectedCallback();
-el2.handleEvent({type: 'click'});
-el2.handleEvent({type: 'test'});
-el2.handleEvent({type: 'camelCase'});
-
-const El5 = customElements.get('el-5');
-const el5 = new El5(document);
-console.assert(el5.test === true, 'defined props working as getter');
-el5.test = false;
-console.assert(el5.test === false, 'defined props working as setter');
-el5.attributeChangedCallback('test');
-
-const el5b = new El5(document);
-el5b.test = false;
-console.assert(el5.test === false, 'defined props working as setter');
-
-const El6 = customElements.get('el-6');
-const el6 = new El6(document);
-console.assert(el6.test === true, 'defined props working as getter');
-el6.test = false;
-console.assert(el6.test === false, 'defined props working as setter');
-el6.connectedCallback();
-
-const el7 = document.createElement('div', {is: 'el-7'});
-el7.connectedCallback();
-el7.html``;
-
-el7.innerHTML = ``;
-console.assert(el7.firstChild.test === false, 'props over attributes');
-console.assert(el7.firstChild.items !== items, 'props not shared');
-console.assert(el7.firstChild.items.join('') === '', 'props not shared');
-
-/* https://github.com/whatwg/html/issues/5552
-((c,w,m)=>{
- m=c[w];c[w]=n=>m.call(c,n).then(()=>c.get(n));
-})(customElements,'whenDefined');
-//*/
-customElements.whenDefined('uce-lib').then(
- ({css, html, svg, render, define: udefine} = customElements.get('uce-lib')) => {
- console.assert(css`1${2}3` === '123', 'css works');
- console.assert(udefine === define, 'define is OK');
- console.assert(typeof html === 'function', 'html is OK');
- console.assert(typeof svg === 'function', 'svg is OK');
- console.assert(typeof render === 'function', 'render is OK');
- console.log('OK');
- }
-);
+(async () => {
+ await import("uhtml");
+ const {css, define } = await import('../esm/index.js');
+ console.assert(css`1${2}3` === '123', 'css works');
+
+ define('el-0', {props: {}, attachShadow: {mode: 'open'}});
+ define('el-1', {init() {}, style(selector) { return `${selector}{color:green}` }});
+ define('el-2', {onClick() {}, ontest() {}, onCamelCase() {}});
+ define('el-3', {onClick() {}, onClickOptions: true});
+ define('el-4', {props: null, onClick() {}, handleEvent() {}});
+ define('el-5', {
+ props: {test: true},
+ attachShadow: {mode: 'open'},
+ observedAttributes: ['test'],
+ attributeChanged() {}
+ });
+ define('el-6', {
+ observedAttributes: ['test'],
+ props: {test: true, items},
+ bound: ['render'],
+ constructor() {},
+ connected() {},
+ disconnected() {},
+ render() {}
+ });
+
+ define('el-7', {extends: 'div', style(selector) { return `${selector}{color:green}` }});
+ define('el-8', {props: {}, formAssociated: true})
+
+ const El1 = customElements.get('el-1');
+ const el1 = new El1(document);
+ el1.connectedCallback();
+ el1.attributeChangedCallback();
+ el1.setAttribute('test', 123);
+ console.assert(el1.props.test == 123, 'props working');
+
+ const El2 = customElements.get('el-2');
+ const el2 = new El2(document);
+ el2.connectedCallback();
+ el2.handleEvent({type: 'click'});
+ el2.handleEvent({type: 'test'});
+ el2.handleEvent({type: 'camelCase'});
+
+ const El5 = customElements.get('el-5');
+ const el5 = new El5(document);
+ console.assert(el5.test === true, 'defined props working as getter');
+ el5.test = false;
+ console.assert(el5.test === false, 'defined props working as setter');
+ el5.attributeChangedCallback('test');
+
+ const el5b = new El5(document);
+ el5b.test = false;
+ console.assert(el5.test === false, 'defined props working as setter');
+
+ const El6 = customElements.get('el-6');
+ const el6 = new El6(document);
+ console.assert(el6.test === true, 'defined props working as getter');
+ el6.test = false;
+ console.assert(el6.test === false, 'defined props working as setter');
+ el6.connectedCallback();
+
+ const el7 = document.createElement('div', {is: 'el-7'});
+ el7.connectedCallback();
+ el7.html``;
+
+ el7.innerHTML = ``;
+ console.assert(el7.firstChild.test === false, 'props over attributes');
+ console.assert(el7.firstChild.items !== items, 'props not shared');
+ console.assert(el7.firstChild.items.join('') === '', 'props not shared');
+
+ const e18 = document.createElement("el-8");
+ console.assert(e18.formAssociated === true)
+
+ /* https://github.com/whatwg/html/issues/5552
+ ((c,w,m)=>{
+ m=c[w];c[w]=n=>m.call(c,n).then(()=>c.get(n));
+ })(customElements,'whenDefined');
+ //*/
+ customElements.whenDefined('uce-lib').then(
+ ({css, html, svg, render, define: udefine} = customElements.get('uce-lib')) => {
+ console.assert(css`1${2}3` === '123', 'css works');
+ console.assert(udefine === define, 'define is OK');
+ console.assert(typeof html === 'function', 'html is OK');
+ console.assert(typeof svg === 'function', 'svg is OK');
+ console.assert(typeof render === 'function', 'render is OK');
+ console.log('OK');
+ }
+ );
+})();
+
diff --git a/test/package.json b/test/package.json
index 0292b99..7c34deb 100644
--- a/test/package.json
+++ b/test/package.json
@@ -1 +1 @@
-{"type":"commonjs"}
\ No newline at end of file
+{"type":"module"}
\ No newline at end of file
From c15299d9d55c79b79da26deee0ade878f4d4c977 Mon Sep 17 00:00:00 2001
From: Keven McDowell <36285281+kpmcdowellmo@users.noreply.github.com>
Date: Wed, 10 Dec 2025 20:27:23 -0600
Subject: [PATCH 3/3] Add exports from uhtml5
- Exports new signal utilities, etc from uhtml 5 from uce
---
esm/index.js | 4 +-
index.js | 3000 ++++++++++++++++++++------------------------------
min.js | 2 +-
new.js | 2 +-
4 files changed, 1171 insertions(+), 1837 deletions(-)
diff --git a/esm/index.js b/esm/index.js
index ba0125a..658532e 100644
--- a/esm/index.js
+++ b/esm/index.js
@@ -1,4 +1,4 @@
-import {render, html, svg} from 'uhtml/dom';
+import {render, html, svg, unsafe, Hole, signal, computed, effect, untracked, batch, fragment} from 'uhtml';
import umap from 'umap';
import css from 'plain-tag';
@@ -170,7 +170,7 @@ const define = (tagName, definition) => {
return MicroElement;
};
-export {define, render, html, svg, css};
+export {define, render, html, svg, css, unsafe, Hole, signal, computed, effect, untracked, batch, fragment};
/* istanbul ignore else */
if (!CE.get('uce-lib'))
diff --git a/index.js b/index.js
index b236936..bdf5d15 100644
--- a/index.js
+++ b/index.js
@@ -79,11 +79,106 @@ var uce = (function (exports) {
}), e && _setPrototypeOf(t, e);
}
- var DEBUG = true;
+ function _isNativeFunction(t) {
+ try {
+ return -1 !== Function.toString.call(t).indexOf("[native code]");
+ } catch (n) {
+ return "function" == typeof t;
+ }
+ }
- function _superPropBase(t, o) {
- for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
- return t;
+ function _isNativeReflectConstruct$2() {
+ try {
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
+ } catch (t) {}
+ return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() {
+ return !!t;
+ })();
+ }
+
+ function _construct(t, e, r) {
+ if (_isNativeReflectConstruct$2()) return Reflect.construct.apply(null, arguments);
+ var o = [null];
+ o.push.apply(o, e);
+ var p = new (t.bind.apply(t, o))();
+ return r && _setPrototypeOf(p, r.prototype), p;
+ }
+
+ function _wrapNativeSuper(t) {
+ var r = "function" == typeof Map ? new Map() : void 0;
+ return _wrapNativeSuper = function _wrapNativeSuper(t) {
+ if (null === t || !_isNativeFunction(t)) return t;
+ if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
+ if (void 0 !== r) {
+ if (r.has(t)) return r.get(t);
+ r.set(t, Wrapper);
+ }
+ function Wrapper() {
+ return _construct(t, arguments, _getPrototypeOf(this).constructor);
+ }
+ return Wrapper.prototype = Object.create(t.prototype, {
+ constructor: {
+ value: Wrapper,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ }), _setPrototypeOf(Wrapper, t);
+ }, _wrapNativeSuper(t);
+ }
+
+ function _arrayWithHoles(r) {
+ if (Array.isArray(r)) return r;
+ }
+
+ function _iterableToArrayLimit(r, l) {
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
+ if (null != t) {
+ var e,
+ n,
+ i,
+ u,
+ a = [],
+ f = true,
+ o = false;
+ try {
+ if (i = (t = t.call(r)).next, 0 === l) {
+ if (Object(t) !== t) return;
+ f = !1;
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
+ } catch (r) {
+ o = true, n = r;
+ } finally {
+ try {
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
+ } finally {
+ if (o) throw n;
+ }
+ }
+ return a;
+ }
+ }
+
+ function _arrayLikeToArray$1(r, a) {
+ (null == a || a > r.length) && (a = r.length);
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
+ return n;
+ }
+
+ function _unsupportedIterableToArray$1(r, a) {
+ if (r) {
+ if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
+ var t = {}.toString.call(r).slice(8, -1);
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0;
+ }
+ }
+
+ function _nonIterableRest() {
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
+
+ function _slicedToArray(r, e) {
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest();
}
function _defineProperty(e, r, t) {
@@ -95,437 +190,396 @@ var uce = (function (exports) {
}) : e[r] = t, e;
}
- function _get$1() {
- return _get$1 = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
+ function _arrayWithoutHoles(r) {
+ if (Array.isArray(r)) return _arrayLikeToArray$1(r);
+ }
+
+ function _iterableToArray(r) {
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
+ }
+
+ function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
+
+ function _toConsumableArray(r) {
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$1(r) || _nonIterableSpread();
+ }
+
+ function _superPropBase(t, o) {
+ for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
+ return t;
+ }
+
+ function set(e, r, t, o) {
+ return set = "undefined" != typeof Reflect && Reflect.set ? Reflect.set : function (e, r, t, o) {
+ var f,
+ i = _superPropBase(e, r);
+ if (i) {
+ if ((f = Object.getOwnPropertyDescriptor(i, r)).set) return f.set.call(o, t), true;
+ if (!f.writable) return false;
+ }
+ if (f = Object.getOwnPropertyDescriptor(o, r)) {
+ if (!f.writable) return false;
+ f.value = t, Object.defineProperty(o, r, f);
+ } else _defineProperty(o, r, t);
+ return true;
+ }, set(e, r, t, o);
+ }
+ function _set(e, r, t, o, f) {
+ if (!set(e, r, t, o || e) && f) throw new TypeError("failed to set property");
+ return t;
+ }
+
+ function _get() {
+ return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
var p = _superPropBase(e, t);
if (p) {
var n = Object.getOwnPropertyDescriptor(p, t);
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
}
- }, _get$1.apply(null, arguments);
+ }, _get.apply(null, arguments);
}
- var ReactiveFlags;
- (function (ReactiveFlags) {
- ReactiveFlags[ReactiveFlags["None"] = 0] = "None";
- ReactiveFlags[ReactiveFlags["Mutable"] = 1] = "Mutable";
- ReactiveFlags[ReactiveFlags["Watching"] = 2] = "Watching";
- ReactiveFlags[ReactiveFlags["RecursedCheck"] = 4] = "RecursedCheck";
- ReactiveFlags[ReactiveFlags["Recursed"] = 8] = "Recursed";
- ReactiveFlags[ReactiveFlags["Dirty"] = 16] = "Dirty";
- ReactiveFlags[ReactiveFlags["Pending"] = 32] = "Pending";
- })(ReactiveFlags || (ReactiveFlags = {}));
- function createReactiveSystem(_ref) {
- var update = _ref.update,
- notify = _ref.notify,
- unwatched = _ref.unwatched;
- var currentVersion = 0;
- return {
- link: link,
- unlink: unlink,
- propagate: propagate,
- checkDirty: checkDirty,
- endTracking: endTracking,
- startTracking: startTracking,
- shallowPropagate: shallowPropagate
- };
- function link(dep, sub) {
- var prevDep = sub.depsTail;
- if (prevDep !== undefined && prevDep.dep === dep) {
- return;
- }
- var nextDep = prevDep !== undefined ? prevDep.nextDep : sub.deps;
- if (nextDep !== undefined && nextDep.dep === dep) {
- nextDep.version = currentVersion;
- sub.depsTail = nextDep;
- return;
- }
- var prevSub = dep.subsTail;
- if (prevSub !== undefined && prevSub.version === currentVersion && prevSub.sub === sub) {
- return;
- }
- var newLink = sub.depsTail = dep.subsTail = {
- version: currentVersion,
- dep: dep,
- sub: sub,
- prevDep: prevDep,
- nextDep: nextDep,
- prevSub: prevSub,
- nextSub: undefined
- };
- if (nextDep !== undefined) {
- nextDep.prevDep = newLink;
- }
- if (prevDep !== undefined) {
- prevDep.nextDep = newLink;
- } else {
- sub.deps = newLink;
- }
- if (prevSub !== undefined) {
- prevSub.nextSub = newLink;
- } else {
- dep.subs = newLink;
- }
- }
- function unlink(link) {
- var sub = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : link.sub;
- var dep = link.dep;
- var prevDep = link.prevDep;
- var nextDep = link.nextDep;
- var nextSub = link.nextSub;
- var prevSub = link.prevSub;
- if (nextDep !== undefined) {
- nextDep.prevDep = prevDep;
- } else {
- sub.depsTail = prevDep;
- }
- if (prevDep !== undefined) {
- prevDep.nextDep = nextDep;
- } else {
- sub.deps = nextDep;
- }
- if (nextSub !== undefined) {
- nextSub.prevSub = prevSub;
- } else {
- dep.subsTail = prevSub;
- }
- if (prevSub !== undefined) {
- prevSub.nextSub = nextSub;
- } else if ((dep.subs = nextSub) === undefined) {
- unwatched(dep);
- }
- return nextDep;
- }
- function propagate(link) {
- var next = link.nextSub;
- var stack;
- top: do {
- var sub = link.sub;
- var flags = sub.flags;
- if (!(flags & 60)) {
- sub.flags = flags | 32;
- } else if (!(flags & 12)) {
- flags = 0;
- } else if (!(flags & 4)) {
- sub.flags = flags & -9 | 32;
- } else if (!(flags & 48) && isValidLink(link, sub)) {
- sub.flags = flags | 40;
- flags &= 1;
- } else {
- flags = 0;
- }
- if (flags & 2) {
- notify(sub);
- }
- if (flags & 1) {
- var subSubs = sub.subs;
- if (subSubs !== undefined) {
- var nextSub = (link = subSubs).nextSub;
- if (nextSub !== undefined) {
- stack = {
- value: next,
- prev: stack
- };
- next = nextSub;
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { t && (r = t); var _n1 = 0, F = function F() {}; return { s: F, n: function n() { return _n1 >= r.length ? { done: true } : { done: false, value: r[_n1++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = true, u = false; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = true, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
+ function _superPropSet(t, e, o, r, p, f) { return _set(_getPrototypeOf(t.prototype ), e, o, r, p); }
+ function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
+ function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
+ function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { return !!t; })(); }
+ var e;
+ !function (e) {
+ e[e.None = 0] = "None", e[e.Mutable = 1] = "Mutable", e[e.Watching = 2] = "Watching", e[e.RecursedCheck = 4] = "RecursedCheck", e[e.Recursed = 8] = "Recursed", e[e.Dirty = 16] = "Dirty", e[e.Pending = 32] = "Pending";
+ }(e || (e = {}));
+ var t = [],
+ n = [],
+ _ref = function (_ref2) {
+ var e = _ref2.update,
+ t = _ref2.notify,
+ n = _ref2.unwatched;
+ var s = 0;
+ return {
+ link: function link(e, t) {
+ var n = t.depsTail;
+ if (void 0 !== n && n.dep === e) return;
+ var i;
+ if (4 & t.flags && (i = void 0 !== n ? n.nextDep : t.deps, void 0 !== i && i.dep === e)) return i.version = s, void (t.depsTail = i);
+ var r = e.subsTail;
+ if (void 0 !== r && r.version === s && r.sub === t) return;
+ var o = t.depsTail = e.subsTail = {
+ version: s,
+ dep: e,
+ sub: t,
+ prevDep: n,
+ nextDep: i,
+ prevSub: r,
+ nextSub: void 0
+ };
+ void 0 !== i && (i.prevDep = o);
+ void 0 !== n ? n.nextDep = o : t.deps = o;
+ void 0 !== r ? r.nextSub = o : e.subs = o;
+ },
+ unlink: i,
+ propagate: function propagate(e) {
+ var n,
+ s = e.nextSub;
+ e: for (;;) {
+ var _i = e.sub;
+ var _r = _i.flags;
+ if (3 & _r && (60 & _r ? 12 & _r ? 4 & _r ? 48 & _r || !o(e, _i) ? _r = 0 : (_i.flags = 40 | _r, _r &= 1) : _i.flags = -9 & _r | 32 : _r = 0 : _i.flags = 32 | _r, 2 & _r && t(_i), 1 & _r)) {
+ var _t = _i.subs;
+ if (void 0 !== _t) {
+ e = _t, void 0 !== _t.nextSub && (n = {
+ value: s,
+ prev: n
+ }, s = e.nextSub);
+ continue;
+ }
}
- continue;
- }
- }
- if ((link = next) !== undefined) {
- next = link.nextSub;
- continue;
- }
- while (stack !== undefined) {
- link = stack.value;
- stack = stack.prev;
- if (link !== undefined) {
- next = link.nextSub;
- continue top;
- }
- }
- break;
- } while (true);
- }
- function startTracking(sub) {
- ++currentVersion;
- sub.depsTail = undefined;
- sub.flags = sub.flags & -57 | 4;
- }
- function endTracking(sub) {
- var depsTail = sub.depsTail;
- var toRemove = depsTail !== undefined ? depsTail.nextDep : sub.deps;
- while (toRemove !== undefined) {
- toRemove = unlink(toRemove, sub);
- }
- sub.flags &= -5;
- }
- function checkDirty(link, sub) {
- var stack;
- var checkDepth = 0;
- var dirty = false;
- top: do {
- var dep = link.dep;
- var flags = dep.flags;
- if (sub.flags & 16) {
- dirty = true;
- } else if ((flags & 17) === 17) {
- if (update(dep)) {
- var subs = dep.subs;
- if (subs.nextSub !== undefined) {
- shallowPropagate(subs);
+ if (void 0 === (e = s)) {
+ for (; void 0 !== n;) if (e = n.value, n = n.prev, void 0 !== e) {
+ s = e.nextSub;
+ continue e;
+ }
+ break;
}
- dirty = true;
- }
- } else if ((flags & 33) === 33) {
- if (link.nextSub !== undefined || link.prevSub !== undefined) {
- stack = {
- value: link,
- prev: stack
- };
- }
- link = dep.deps;
- sub = dep;
- ++checkDepth;
- continue;
- }
- if (!dirty) {
- var nextDep = link.nextDep;
- if (nextDep !== undefined) {
- link = nextDep;
- continue;
- }
- }
- while (checkDepth--) {
- var firstSub = sub.subs;
- var hasMultipleSubs = firstSub.nextSub !== undefined;
- if (hasMultipleSubs) {
- link = stack.value;
- stack = stack.prev;
- } else {
- link = firstSub;
+ s = e.nextSub;
}
- if (dirty) {
- if (update(sub)) {
- if (hasMultipleSubs) {
- shallowPropagate(firstSub);
+ },
+ checkDirty: function checkDirty(t, n) {
+ var s,
+ i = 0;
+ e: for (;;) {
+ var _o = t.dep,
+ _l = _o.flags;
+ var _a = false;
+ if (16 & n.flags) _a = true;else if (17 & ~_l) {
+ if (!(33 & ~_l)) {
+ void 0 === t.nextSub && void 0 === t.prevSub || (s = {
+ value: t,
+ prev: s
+ }), t = _o.deps, n = _o, ++i;
+ continue;
}
- sub = link.sub;
- continue;
+ } else if (e(_o)) {
+ var _e2 = _o.subs;
+ void 0 !== _e2.nextSub && r(_e2), _a = true;
}
- dirty = false;
- } else {
- sub.flags &= -33;
- }
- sub = link.sub;
- var _nextDep = link.nextDep;
- if (_nextDep !== undefined) {
- link = _nextDep;
- continue top;
- }
- }
- return dirty;
- } while (true);
- }
- function shallowPropagate(link) {
- do {
- var sub = link.sub;
- var flags = sub.flags;
- if ((flags & 48) === 32) {
- sub.flags = flags | 16;
- if (flags & 2) {
- notify(sub);
+ if (_a || void 0 === t.nextDep) {
+ for (; i;) {
+ --i;
+ var _o2 = n.subs,
+ _l2 = void 0 !== _o2.nextSub;
+ if (_l2 ? (t = s.value, s = s.prev) : t = _o2, _a) {
+ if (e(n)) {
+ _l2 && r(_o2), n = t.sub;
+ continue;
+ }
+ } else n.flags &= -33;
+ if (n = t.sub, void 0 !== t.nextDep) {
+ t = t.nextDep;
+ continue e;
+ }
+ _a = false;
+ }
+ return _a;
+ }
+ t = t.nextDep;
}
+ },
+ endTracking: function endTracking(e) {
+ var t = e.depsTail;
+ var n = void 0 !== t ? t.nextDep : e.deps;
+ for (; void 0 !== n;) n = i(n, e);
+ e.flags &= -5;
+ },
+ startTracking: function startTracking(e) {
+ ++s, e.depsTail = void 0, e.flags = -57 & e.flags | 4;
+ },
+ shallowPropagate: r
+ };
+ function i(e) {
+ var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : e.sub;
+ var s = e.dep,
+ i = e.prevDep,
+ r = e.nextDep,
+ o = e.nextSub,
+ l = e.prevSub;
+ return void 0 !== r ? r.prevDep = i : t.depsTail = i, void 0 !== i ? i.nextDep = r : t.deps = r, void 0 !== o ? o.prevSub = l : s.subsTail = l, void 0 !== l ? l.nextSub = o : void 0 === (s.subs = o) && n(s), r;
+ }
+ function r(e) {
+ do {
+ var _n = e.sub,
+ _s = e.nextSub,
+ _i2 = _n.flags;
+ 32 == (48 & _i2) && (_n.flags = 16 | _i2, 2 & _i2 && t(_n)), e = _s;
+ } while (void 0 !== e);
+ }
+ function o(e, t) {
+ var n = t.depsTail;
+ if (void 0 !== n) {
+ var _s2 = t.deps;
+ do {
+ if (_s2 === e) return true;
+ if (_s2 === n) break;
+ _s2 = _s2.nextDep;
+ } while (void 0 !== _s2);
}
- } while ((link = link.nextSub) !== undefined);
- }
- function isValidLink(checkLink, sub) {
- var link = sub.depsTail;
- while (link !== undefined) {
- if (link === checkLink) {
- return true;
- }
- link = link.prevDep;
+ return false;
}
- return false;
- }
- }
-
- var pauseStack = [];
- var _createReactiveSystem = createReactiveSystem({
- update: function update(signal) {
- if ('getter' in signal) {
- return updateComputed(signal);
- } else {
- return updateSignal(signal, signal.value);
+ }({
+ update: function update(e) {
+ return "getter" in e ? y(e) : w(e, e.value);
+ },
+ notify: function e(t) {
+ var s = t.flags;
+ if (!(64 & s)) {
+ t.flags = 64 | s;
+ var _i3 = t.subs;
+ void 0 !== _i3 ? e(_i3.sub) : n[h++] = t;
}
},
- notify: notify,
- unwatched: function unwatched(node) {
- if ('getter' in node) {
- var toRemove = node.deps;
- if (toRemove !== undefined) {
- node.flags = 17;
+ unwatched: function unwatched(e) {
+ if ("getter" in e) {
+ var _t2 = e.deps;
+ if (void 0 !== _t2) {
+ e.flags = 17;
do {
- toRemove = unlink(toRemove, node);
- } while (toRemove !== undefined);
+ _t2 = i(_t2, e);
+ } while (void 0 !== _t2);
}
- } else if (!('previousValue' in node)) {
- effectOper.call(node);
- }
+ } else "previousValue" in e || D.call(e);
}
}),
- link = _createReactiveSystem.link,
- unlink = _createReactiveSystem.unlink;
- _createReactiveSystem.propagate;
- _createReactiveSystem.checkDirty;
- var endTracking = _createReactiveSystem.endTracking,
- startTracking = _createReactiveSystem.startTracking;
- _createReactiveSystem.shallowPropagate;
- var activeSub;
- var activeScope;
- function setCurrentSub(sub) {
- var prevSub = activeSub;
- activeSub = sub;
- return prevSub;
+ s = _ref.link,
+ i = _ref.unlink,
+ r = _ref.propagate,
+ o = _ref.checkDirty,
+ l = _ref.endTracking,
+ a = _ref.startTracking,
+ c = _ref.shallowPropagate;
+ var u,
+ d,
+ f = 0,
+ p = 0,
+ h = 0;
+ function v(e) {
+ var t = u;
+ return u = e, t;
}
- function setCurrentScope(scope) {
- var prevScope = activeScope;
- activeScope = scope;
- return prevScope;
+ function g(e) {
+ var t = d;
+ return d = e, t;
}
- function pauseTracking() {
- pauseStack.push(setCurrentSub(undefined));
+ function b(e) {
+ return T.bind({
+ previousValue: e,
+ value: e,
+ subs: void 0,
+ subsTail: void 0,
+ flags: 1
+ });
}
- function resumeTracking() {
- setCurrentSub(pauseStack.pop());
+ function m(e) {
+ return C.bind({
+ value: void 0,
+ subs: void 0,
+ subsTail: void 0,
+ deps: void 0,
+ depsTail: void 0,
+ flags: 17,
+ getter: e
+ });
}
- function effect(fn) {
- var e = {
- fn: fn,
- subs: undefined,
- subsTail: undefined,
- deps: undefined,
- depsTail: undefined,
+ function x(e) {
+ var t = {
+ fn: e,
+ subs: void 0,
+ subsTail: void 0,
+ deps: void 0,
+ depsTail: void 0,
flags: 2
};
- if (activeSub !== undefined) {
- link(e, activeSub);
- } else if (activeScope !== undefined) {
- link(e, activeScope);
- }
- var prev = setCurrentSub(e);
- try {
- e.fn();
- } finally {
- setCurrentSub(prev);
- }
- return effectOper.bind(e);
- }
- function effectScope(fn) {
- var e = {
- deps: undefined,
- depsTail: undefined,
- subs: undefined,
- subsTail: undefined,
- flags: 0
- };
- if (activeScope !== undefined) {
- link(e, activeScope);
- }
- var prevSub = setCurrentSub(undefined);
- var prevScope = setCurrentScope(e);
+ void 0 !== u ? s(t, u) : void 0 !== d && s(t, d);
+ var n = v(t);
try {
- fn();
+ t.fn();
} finally {
- setCurrentScope(prevScope);
- setCurrentSub(prevSub);
+ v(n);
}
- return effectOper.bind(e);
+ return D.bind(t);
}
- function updateComputed(c) {
- var prevSub = setCurrentSub(c);
- startTracking(c);
+ function y(e) {
+ var t = v(e);
+ a(e);
try {
- var oldValue = c.value;
- return oldValue !== (c.value = c.getter(oldValue));
+ var _t3 = e.value;
+ return _t3 !== (e.value = e.getter(_t3));
} finally {
- setCurrentSub(prevSub);
- endTracking(c);
+ v(t), l(e);
}
}
- function updateSignal(s, value) {
- s.flags = 1;
- return s.previousValue !== (s.previousValue = value);
+ function w(e, t) {
+ return e.flags = 1, e.previousValue !== (e.previousValue = t);
}
- function notify(e) {
- var flags = e.flags;
- if (!(flags & 64)) {
- e.flags = flags | 64;
- var subs = e.subs;
- if (subs !== undefined) {
- notify(subs.sub);
+ function S(e, t) {
+ if (16 & t || 32 & t && o(e.deps, e)) {
+ var _t4 = v(e);
+ a(e);
+ try {
+ e.fn();
+ } finally {
+ v(_t4), l(e);
}
+ return;
}
- }
- function effectOper() {
- var dep = this.deps;
- while (dep !== undefined) {
- dep = unlink(dep, this);
+ 32 & t && (e.flags = -33 & t);
+ var n = e.deps;
+ for (; void 0 !== n;) {
+ var _e3 = n.dep,
+ _t5 = _e3.flags;
+ 64 & _t5 && S(_e3, _e3.flags = -65 & _t5), n = n.nextDep;
}
- var sub = this.subs;
- if (sub !== undefined) {
- unlink(sub);
+ }
+ function k() {
+ for (; p < h;) {
+ var _e4 = n[p];
+ n[p++] = void 0, S(_e4, _e4.flags &= -65);
}
- this.flags = 0;
+ p = 0, h = 0;
}
-
- /**
- * @template T
- * @param {function(): T} fn
- * @returns {T}
- */
- var untracked = function untracked(fn) {
- pauseTracking();
- try {
- return fn();
- } finally {
- resumeTracking();
+ function C() {
+ var e = this.flags;
+ if (16 & e || 32 & e && o(this.deps, this)) {
+ if (y(this)) {
+ var _e5 = this.subs;
+ void 0 !== _e5 && c(_e5);
+ }
+ } else 32 & e && (this.flags = -33 & e);
+ return void 0 !== u ? s(this, u) : void 0 !== d && s(this, d), this.value;
+ }
+ function T() {
+ if (!arguments.length) {
+ var _e6 = this.value;
+ if (16 & this.flags && w(this, _e6)) {
+ var _e7 = this.subs;
+ void 0 !== _e7 && c(_e7);
+ }
+ return void 0 !== u && s(this, u), _e6;
}
- };
-
- /**
- * @template T
- */
- var Signal = /*#__PURE__*/function () {
- /**
- * @param {(value: T) => T} fn
- * @param {T} value
- */
- function Signal(fn, value) {
- _classCallCheck(this, Signal);
- this._ = fn(value);
+ {
+ var _t6 = arguments.length <= 0 ? undefined : arguments[0];
+ if (this.value !== (this.value = _t6)) {
+ this.flags = 17;
+ var _e8 = this.subs;
+ void 0 !== _e8 && (r(_e8), f || k());
+ }
}
-
- /** @returns {T} */
- return _createClass(Signal, [{
+ }
+ function D() {
+ var e = this.deps;
+ for (; void 0 !== e;) e = i(e, this);
+ var t = this.subs;
+ void 0 !== t && i(t), this.flags = 0;
+ }
+ var O = {
+ greedy: false
+ },
+ N = function N(e) {
+ return new A(e);
+ },
+ $ = function $(e) {
+ t.push(v(void 0));
+ try {
+ return e();
+ } finally {
+ v(t.pop());
+ }
+ };
+ var W = /*#__PURE__*/function () {
+ function W(e, t) {
+ _classCallCheck(this, W);
+ this._ = e(t);
+ }
+ return _createClass(W, [{
key: "value",
get: function get() {
return this._();
+ },
+ set: function set(e) {
+ this._(e);
}
-
- /** @param {T} value */,
- set: function set(value) {
- this._(value);
- }
-
- /** @returns {T} */
}, {
key: "peek",
value: function peek() {
- return untracked(this._);
+ return $(this._);
}
-
- /** @returns {T} */
}, {
key: "valueOf",
value: function valueOf() {
@@ -533,1589 +587,861 @@ var uce = (function (exports) {
}
}]);
}();
-
- function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
- function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
- function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
- var isArray = Array.isArray;
- var assign = Object.assign,
- defineProperties$2 = Object.defineProperties,
- entries = Object.entries,
- freeze = Object.freeze;
- var _data = /*#__PURE__*/new WeakMap();
- var Unsafe = /*#__PURE__*/function () {
- function Unsafe(data) {
- _classCallCheck(this, Unsafe);
- _classPrivateFieldInitSpec(this, _data, void 0);
- _classPrivateFieldSet(_data, this, data);
+ var A = /*#__PURE__*/function (_W) {
+ function A(e) {
+ _classCallCheck(this, A);
+ return _callSuper$1(this, A, [m, e]);
+ }
+ _inherits(A, _W);
+ return _createClass(A, [{
+ key: "value",
+ get: function get() {
+ return this._();
+ },
+ set: function set(e) {
+ throw new Error("Computed values are read-only");
+ }
+ }]);
+ }(W);
+ var E = /*#__PURE__*/function (_W2) {
+ function E(e) {
+ _classCallCheck(this, E);
+ return _callSuper$1(this, E, [b, [e]]);
+ }
+ _inherits(E, _W2);
+ return _createClass(E, [{
+ key: "value",
+ get: function get() {
+ return _superPropGet(E, "value", this, 1)[0];
+ },
+ set: function set(e) {
+ _superPropSet(E, "value", [e], this, 1);
+ }
+ }, {
+ key: "peek",
+ value: function peek() {
+ return _superPropGet(E, "peek", this, 3)([])[0];
+ }
+ }]);
+ }(W);
+ var M = function M(e) {
+ ++f;
+ try {
+ return e();
+ } finally {
+ --f || k();
+ }
+ };
+ var R = function R(e) {
+ var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : O,
+ _ref3$greedy = _ref3.greedy,
+ t = _ref3$greedy === void 0 ? false : _ref3$greedy;
+ return t ? new E(e) : new W(b, e);
+ };
+ function L() {
+ return R.apply(null, arguments);
+ }
+ var _ = function _(e) {
+ R = e;
+ },
+ j = Array.isArray,
+ F = Object.assign,
+ P = Object.defineProperties,
+ B = Object.entries,
+ J = Object.freeze;
+ var _e9 = /*#__PURE__*/new WeakMap();
+ var V = /*#__PURE__*/function () {
+ function V(e) {
+ _classCallCheck(this, V);
+ _classPrivateFieldInitSpec(this, _e9, void 0);
+ _classPrivateFieldSet(_e9, this, e);
}
- return _createClass(Unsafe, [{
+ return _createClass(V, [{
key: "valueOf",
value: function valueOf() {
- return _classPrivateFieldGet(_data, this);
+ return _classPrivateFieldGet(_e9, this);
}
}, {
key: "toString",
value: function toString() {
- return String(_classPrivateFieldGet(_data, this));
+ return String(_classPrivateFieldGet(_e9, this));
}
}]);
}();
- var createComment = function createComment(value) {
- return document.createComment(value);
- };
- /* c8 ignore stop */
-
- function _callSuper$2(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
- function _isNativeReflectConstruct$3() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() { return !!t; })(); }
- var ELEMENT = 1;
- var ATTRIBUTE$1 = 2;
- var TEXT$1 = 3;
- var COMMENT$1 = 8;
- var DOCUMENT_TYPE = 10;
- var FRAGMENT = 11;
- var COMPONENT$1 = 42;
- var TEXT_ELEMENTS = new Set(['plaintext', 'script', 'style', 'textarea', 'title', 'xmp']);
- var VOID_ELEMENTS = new Set(['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr']);
- var props$1 = freeze({});
- var children = freeze([]);
- var append = function append(node, child) {
- if (node.children === children) node.children = [];
- node.children.push(child);
- child.parent = node;
- return child;
- };
- var prop = function prop(node, name, value) {
- if (node.props === props$1) node.props = {};
- node.props[name] = value;
- };
- var addJSON = function addJSON(value, comp, json) {
- if (value !== comp) json.push(value);
- };
- var Node = /*#__PURE__*/function () {
- function Node(type) {
- _classCallCheck(this, Node);
- this.type = type;
- this.parent = null;
+ var z = function z(e) {
+ return new V(e);
+ },
+ H = function H(e) {
+ return document.createComment(e);
+ },
+ q = 42,
+ G = new Set(["plaintext", "script", "style", "textarea", "title", "xmp"]),
+ I = new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr"]),
+ K = J({}),
+ Q = J([]),
+ U = function U(e, t) {
+ return e.children === Q && (e.children = []), e.children.push(t), t.parent = e, t;
+ },
+ X = function X(e, t, n) {
+ e.props === K && (e.props = {}), e.props[t] = n;
+ },
+ Y = function Y(e, t, n) {
+ e !== t && n.push(e);
+ };
+ var Z = /*#__PURE__*/function () {
+ function Z(e) {
+ _classCallCheck(this, Z);
+ this.type = e, this.parent = null;
}
- return _createClass(Node, [{
+ return _createClass(Z, [{
key: "toJSON",
value: function toJSON() {
- //@ts-ignore
return [this.type, this.data];
}
}]);
}();
- var Comment = /*#__PURE__*/function (_Node) {
- function Comment(data) {
+ var ee = /*#__PURE__*/function (_Z) {
+ function ee(e) {
var _this;
- _classCallCheck(this, Comment);
- _this = _callSuper$2(this, Comment, [COMMENT$1]);
- _this.data = data;
+ _classCallCheck(this, ee);
+ _this = _callSuper$1(this, ee, [8]), _this.data = e;
return _this;
}
- _inherits(Comment, _Node);
- return _createClass(Comment, [{
+ _inherits(ee, _Z);
+ return _createClass(ee, [{
key: "toString",
value: function toString() {
return "");
}
}]);
- }(Node);
- var DocumentType = /*#__PURE__*/function (_Node2) {
- function DocumentType(data) {
+ }(Z);
+ var te = /*#__PURE__*/function (_Z2) {
+ function te(e) {
var _this2;
- _classCallCheck(this, DocumentType);
- _this2 = _callSuper$2(this, DocumentType, [DOCUMENT_TYPE]);
- _this2.data = data;
+ _classCallCheck(this, te);
+ _this2 = _callSuper$1(this, te, [10]), _this2.data = e;
return _this2;
}
- _inherits(DocumentType, _Node2);
- return _createClass(DocumentType, [{
+ _inherits(te, _Z2);
+ return _createClass(te, [{
key: "toString",
value: function toString() {
return "");
}
}]);
- }(Node);
- var Text = /*#__PURE__*/function (_Node3) {
- function Text(data) {
+ }(Z);
+ var ne = /*#__PURE__*/function (_Z3) {
+ function ne(e) {
var _this3;
- _classCallCheck(this, Text);
- _this3 = _callSuper$2(this, Text, [TEXT$1]);
- _this3.data = data;
+ _classCallCheck(this, ne);
+ _this3 = _callSuper$1(this, ne, [3]), _this3.data = e;
return _this3;
}
- _inherits(Text, _Node3);
- return _createClass(Text, [{
+ _inherits(ne, _Z3);
+ return _createClass(ne, [{
key: "toString",
value: function toString() {
return this.data;
}
}]);
- }(Node);
- var Component = /*#__PURE__*/function (_Node4) {
- function Component() {
+ }(Z);
+ var se = /*#__PURE__*/function (_Z4) {
+ function se() {
var _this4;
- _classCallCheck(this, Component);
- _this4 = _callSuper$2(this, Component, [COMPONENT$1]);
- _this4.name = 'template';
- _this4.props = props$1;
- _this4.children = children;
+ _classCallCheck(this, se);
+ _this4 = _callSuper$1(this, se, [q]), _this4.name = "template", _this4.props = K, _this4.children = Q;
return _this4;
}
- _inherits(Component, _Node4);
- return _createClass(Component, [{
+ _inherits(se, _Z4);
+ return _createClass(se, [{
key: "toJSON",
value: function toJSON() {
- var json = [COMPONENT$1];
- addJSON(this.props, props$1, json);
- addJSON(this.children, children, json);
- return json;
+ var e = [q];
+ return Y(this.props, K, e), Y(this.children, Q, e), e;
}
}, {
key: "toString",
value: function toString() {
- var attrs = '';
- for (var key in this.props) {
- var value = this.props[key];
- if (value != null) {
- /* c8 ignore start */
- if (typeof value === 'boolean') {
- if (value) attrs += " ".concat(key);
- } else attrs += " ".concat(key, "=\"").concat(value, "\"");
- /* c8 ignore stop */
- }
+ var e = "";
+ for (var _t7 in this.props) {
+ var _n2 = this.props[_t7];
+ null != _n2 && ("boolean" == typeof _n2 ? _n2 && (e += " ".concat(_t7)) : e += " ".concat(_t7, "=\"").concat(_n2, "\""));
}
- return "").concat(this.children.join(''), "");
+ return "").concat(this.children.join(""), "");
}
}]);
- }(Node);
- var Element = /*#__PURE__*/function (_Node5) {
- function Element(name) {
+ }(Z);
+ var ie = /*#__PURE__*/function (_Z5) {
+ function ie(e) {
var _this5;
- var xml = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- _classCallCheck(this, Element);
- _this5 = _callSuper$2(this, Element, [ELEMENT]);
- _this5.name = name;
- _this5.xml = xml;
- _this5.props = props$1;
- _this5.children = children;
+ var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+ _classCallCheck(this, ie);
+ _this5 = _callSuper$1(this, ie, [1]), _this5.name = e, _this5.xml = t, _this5.props = K, _this5.children = Q;
return _this5;
}
- _inherits(Element, _Node5);
- return _createClass(Element, [{
+ _inherits(ie, _Z5);
+ return _createClass(ie, [{
key: "toJSON",
value: function toJSON() {
- var json = [ELEMENT, this.name, +this.xml];
- addJSON(this.props, props$1, json);
- addJSON(this.children, children, json);
- return json;
+ var e = [1, this.name, +this.xml];
+ return Y(this.props, K, e), Y(this.children, Q, e), e;
}
}, {
key: "toString",
value: function toString() {
- var xml = this.xml,
- name = this.name,
- props = this.props,
- children = this.children;
- var length = children.length;
- var html = "<".concat(name);
- for (var key in props) {
- var value = props[key];
- if (value != null) {
- if (typeof value === 'boolean') {
- if (value) html += xml ? " ".concat(key, "=\"\"") : " ".concat(key);
- } else html += " ".concat(key, "=\"").concat(value, "\"");
- }
+ var e = this.xml,
+ t = this.name,
+ n = this.props,
+ s = this.children,
+ i = s.length;
+ var r = "<".concat(t);
+ for (var _t8 in n) {
+ var _s3 = n[_t8];
+ null != _s3 && ("boolean" == typeof _s3 ? _s3 && (r += e ? " ".concat(_t8, "=\"\"") : " ".concat(_t8)) : r += " ".concat(_t8, "=\"").concat(_s3, "\""));
}
- if (length) {
- html += '>';
- for (var text = !xml && TEXT_ELEMENTS.has(name), i = 0; i < length; i++) html += text ? children[i].data : children[i];
- html += "".concat(name, ">");
- } else if (xml) html += ' />';else html += VOID_ELEMENTS.has(name) ? '>' : ">".concat(name, ">");
- return html;
+ if (i) {
+ r += ">";
+ for (var _n3 = !e && G.has(t), _o3 = 0; _o3 < i; _o3++) r += _n3 ? s[_o3].data : s[_o3];
+ r += "".concat(t, ">");
+ } else r += e ? " />" : I.has(t) ? ">" : ">".concat(t, ">");
+ return r;
}
}]);
- }(Node);
- var Fragment = /*#__PURE__*/function (_Node6) {
- function Fragment() {
+ }(Z);
+ var re = /*#__PURE__*/function (_Z6) {
+ function re() {
var _this6;
- _classCallCheck(this, Fragment);
- _this6 = _callSuper$2(this, Fragment, [FRAGMENT]);
- _this6.name = '#fragment';
- _this6.children = children;
+ _classCallCheck(this, re);
+ _this6 = _callSuper$1(this, re, [11]), _this6.name = "#fragment", _this6.children = Q;
return _this6;
}
- _inherits(Fragment, _Node6);
- return _createClass(Fragment, [{
+ _inherits(re, _Z6);
+ return _createClass(re, [{
key: "toJSON",
value: function toJSON() {
- var json = [FRAGMENT];
- addJSON(this.children, children, json);
- return json;
+ var e = [11];
+ return Y(this.children, Q, e), e;
}
}, {
key: "toString",
value: function toString() {
- return this.children.join('');
+ return this.children.join("");
}
}]);
- }(Node);
-
- function _arrayWithHoles(r) {
- if (Array.isArray(r)) return r;
- }
-
- function _iterableToArrayLimit(r, l) {
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
- if (null != t) {
- var e,
- n,
- i,
- u,
- a = [],
- f = true,
- o = false;
- try {
- if (i = (t = t.call(r)).next, 0 === l) {
- if (Object(t) !== t) return;
- f = !1;
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
- } catch (r) {
- o = true, n = r;
- } finally {
- try {
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
- } finally {
- if (o) throw n;
+ }(Z);
+ var oe = "\0",
+ le = "\"".concat(oe, "\""),
+ ae = "'".concat(oe, "'"),
+ ce = /\x00|<[^><\s]+/g,
+ ue = /([^\s/>=]+)(?:=(\x00|(?:(['"])[\s\S]*?\3)))?/g,
+ de = function de(e, t, n, s, i) {
+ return [t, n, s];
+ },
+ fe = function fe(e) {
+ var t = [];
+ for (; e.parent;) {
+ switch (e.type) {
+ case q:
+ case 1:
+ "template" === e.name && t.push(-1);
}
+ t.push(e.parent.children.indexOf(e)), e = e.parent;
}
- return a;
- }
- }
-
- function _arrayLikeToArray$3(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
- return n;
- }
-
- function _unsupportedIterableToArray$3(r, a) {
- if (r) {
- if ("string" == typeof r) return _arrayLikeToArray$3(r, a);
- var t = {}.toString.call(r).slice(8, -1);
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0;
- }
- }
-
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
-
- function _slicedToArray(r, e) {
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$3(r, e) || _nonIterableRest();
- }
-
- /* c8 ignore start */
- var asTemplate = function asTemplate(template) {
- var _ref, _ref$join;
- return ((_ref = (template === null || template === void 0 ? void 0 : template.raw) || template) === null || _ref === void 0 || (_ref$join = _ref.join) === null || _ref$join === void 0 ? void 0 : _ref$join.call(_ref, ',')) || 'unknown';
- };
- /* c8 ignore stop */
-
- var errors = {
- text: function text(template, tag, value) {
- return new SyntaxError("Mixed text and interpolations found in text only <".concat(tag, "> element ").concat(JSON.stringify(String(value)), " in template ").concat(asTemplate(template)));
- },
- unclosed: function unclosed(template, tag) {
- return new SyntaxError("The text only <".concat(tag, "> element requires explicit ").concat(tag, "> closing tag in template ").concat(asTemplate(template)));
+ return t;
},
- unclosed_element: function unclosed_element(template, tag) {
- return new SyntaxError("Unclosed element <".concat(tag, "> found in template ").concat(asTemplate(template)));
- },
- invalid_content: function invalid_content(template) {
- return new SyntaxError("Invalid content \" found in template ".concat(asTemplate(template)));
- },
- invalid_layout: function invalid_layout(template) {
- return new SyntaxError("Too many closing tags found in template ".concat(asTemplate(template)));
- },
- invalid_doctype: function invalid_doctype(template, value) {
- return new SyntaxError("Invalid doctype: ".concat(value, " found in template ").concat(asTemplate(template)));
- },
- // DOM ONLY
- /* c8 ignore start */
- invalid_template: function invalid_template(template) {
- return new SyntaxError("Invalid template - the amount of values does not match the amount of updates: ".concat(asTemplate(template)));
- },
- invalid_path: function invalid_path(template, path) {
- return new SyntaxError("Invalid path - unreachable node at the path [".concat(path.join(', '), "] found in template ").concat(asTemplate(template)));
- },
- invalid_attribute: function invalid_attribute(template, kind) {
- return new SyntaxError("Invalid ".concat(kind, " attribute in template definition\n").concat(asTemplate(template)));
- },
- invalid_interpolation: function invalid_interpolation(template, value) {
- return new SyntaxError("Invalid interpolation - expected hole or array: ".concat(String(value), " found in template ").concat(asTemplate(template)));
+ pe = function pe(e, t) {
+ do {
+ e = e.parent;
+ } while (t.has(e));
+ return e;
+ };
+ var he = function he(e, t) {
+ return t < 0 ? e.content : e.childNodes[t];
+ };
+ var ve = function ve(e, t) {
+ return t.reduceRight(he, e);
+ };
+ var ge,
+ be = false;
+ var me = function me(_ref4) {
+ var e = _ref4.firstChild,
+ t = _ref4.lastChild;
+ var n = ge || (ge = document.createRange());
+ return n.setStartAfter(e), n.setEndAfter(t), n.deleteContents(), e;
},
- invalid_hole: function invalid_hole(value) {
- return new SyntaxError("Invalid interpolation - expected hole: ".concat(String(value)));
+ xe = function xe(e, t) {
+ return be && 11 === e.nodeType ? 1 / t < 0 ? t ? me(e) : e.lastChild : t ? e.valueOf() : e.firstChild : e;
},
- invalid_key: function invalid_key(value) {
- return new SyntaxError("Invalid key attribute or position in template: ".concat(String(value)));
+ ye = Symbol("nodes"),
+ we = {
+ get: function get() {
+ return this.firstChild.parentNode;
+ }
},
- invalid_array: function invalid_array(value) {
- return new SyntaxError("Invalid array - expected html/svg but found something else: ".concat(String(value)));
+ Se = {
+ value: function value(e) {
+ me(this).replaceWith(e);
+ }
},
- invalid_component: function invalid_component(value) {
- return new SyntaxError("Invalid component: ".concat(String(value)));
- }
- };
-
- function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: true } : { done: false, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = true, u = false; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = true, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
- function _unsupportedIterableToArray$2(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$2(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; } }
- function _arrayLikeToArray$2(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
- var NUL = '\x00';
- var DOUBLE_QUOTED_NUL = "\"".concat(NUL, "\"");
- var SINGLE_QUOTED_NUL = "'".concat(NUL, "'");
- var NEXT = /\x00|<[^><\s]+/g;
- var ATTRS = /([^\s/>=]+)(?:=(\x00|(?:(['"])[\s\S]*?\3)))?/g;
-
- // // YAGNI: NUL char in the wild is a shenanigan
- // // usage: template.map(safe).join(NUL).trim()
- // const NUL_RE = /\x00/g;
- // const safe = s => s.replace(NUL_RE, '');
-
- /** @typedef {import('../dom/ish.js').Node} Node */
- /** @typedef {import('../dom/ish.js').Element} Element */
- /** @typedef {import('../dom/ish.js').Component} Component */
- /** @typedef {(node: import('../dom/ish.js').Node, type: typeof ATTRIBUTE | typeof TEXT | typeof COMMENT | typeof COMPONENT, path: number[], name: string, hint: unknown) => unknown} update */
- /** @typedef {Element | Component} Container */
-
- /** @type {update} */
- var defaultUpdate = function defaultUpdate(_, type, path, name, hint) {
- return [type, path, name];
- };
-
- /**
- * @param {Node} node
- * @returns {number[]}
- */
- var path = function path(node) {
- var insideout = [];
- while (node.parent) {
- switch (node.type) {
- /* c8 ignore start */
- case COMPONENT$1:
- // fallthrough
- /* c8 ignore stop */
- case ELEMENT:
- {
- if (/** @type {Container} */node.name === 'template') insideout.push(-1);
- break;
- }
+ ke = {
+ value: function value() {
+ me(this).remove();
}
- insideout.push(node.parent.children.indexOf(node));
- node = node.parent;
- }
- return insideout;
- };
-
- /**
- * @param {Node} node
- * @param {Set} ignore
- * @returns {Node}
- */
- var parent = function parent(node, ignore) {
- do {
- node = node.parent;
- } while (ignore.has(node));
- return node;
- };
- var parser = (function (_ref) {
- var _ref$Comment = _ref.Comment,
- Comment$1 = _ref$Comment === void 0 ? Comment : _ref$Comment,
- _ref$DocumentType = _ref.DocumentType,
- DocumentType$1 = _ref$DocumentType === void 0 ? DocumentType : _ref$DocumentType,
- _ref$Text = _ref.Text,
- Text$1 = _ref$Text === void 0 ? Text : _ref$Text,
- _ref$Fragment = _ref.Fragment,
- Fragment$1 = _ref$Fragment === void 0 ? Fragment : _ref$Fragment,
- _ref$Element = _ref.Element,
- Element$1 = _ref$Element === void 0 ? Element : _ref$Element,
- _ref$Component = _ref.Component,
- Component$1 = _ref$Component === void 0 ? Component : _ref$Component,
- _ref$update = _ref.update,
- update = _ref$update === void 0 ? defaultUpdate : _ref$update;
- return (
- /**
- * Parse a template string into a crawable JS literal tree and provide a list of updates.
- * @param {TemplateStringsArray|string[]} template
- * @param {unknown[]} holes
- * @param {boolean} xml
- * @returns {[Node, unknown[]]}
- */
- function (template, holes, xml) {
- if (template.some(function (chunk) {
- return chunk.includes(NUL);
- })) throw errors.invalid_nul(template);
- var content = template.join(NUL).trim();
- if (content.replace(/(\S+)=(['"])([\S\s]+?)\2/g, function () {
- return /^[^\x00]+\x00|\x00[^\x00]+$/.test(arguments.length <= 3 ? undefined : arguments[3]) ? xml = arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 0 ? undefined : arguments[0];
- }) !== content) throw errors.invalid_attribute(template, xml);
- var ignore = new Set();
- var values = [];
- var node = new Fragment$1(),
- pos = 0,
- skip = 0,
- hole = 0,
- resolvedPath = children;
- var _iterator = _createForOfIteratorHelper$2(content.matchAll(NEXT)),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var match = _step.value;
- // already handled via attributes or text content nodes
- if (0 < skip) {
- skip--;
- continue;
- }
- var chunk = match[0];
- var index = match.index;
-
- // prepend previous content, if any
- if (pos < index) append(node, new Text$1(content.slice(pos, index)));
-
- // holes
- if (chunk === NUL) {
- if (node.name === 'table') {
- node = append(node, new Element$1('tbody', xml));
- ignore.add(node);
- }
- var comment = append(node, new Comment$1('◦'));
- values.push(update(comment, COMMENT$1, path(comment), '', holes[hole++]));
- pos = index + 1;
- }
- // comments or doctype
- else if (chunk.startsWith('', index + 2);
- if (DEBUG && i < 0) throw errors.invalid_content(template);
- if (content.slice(i - 2, i + 1) === '-->') {
- if (DEBUG && i - index < 6) throw errors.invalid_comment(template);
- var data = content.slice(index + 4, i - 2);
- if (data[0] === '!') append(node, new Comment$1(data.slice(1).replace(/!$/, '')));
- } else {
- if (DEBUG && !content.slice(index + 2, i).toLowerCase().startsWith('doctype')) throw errors.invalid_doctype(template, content.slice(index + 2, i));
- append(node, new DocumentType$1(content.slice(index + 2, i)));
- }
- pos = i + 1;
- }
- // closing tag > or
- else if (chunk.startsWith('')) {
- var _i = content.indexOf('>', index + 2);
- if (DEBUG && _i < 0) throw errors.invalid_closing(template);
- if (xml && node.name === 'svg') xml = false;
- node = /** @type {Container} */parent(node, ignore);
- if (DEBUG && !node) throw errors.invalid_layout(template);
- pos = _i + 1;
- }
- // opening tag or
- else {
- var _i2 = index + chunk.length;
- var j = content.indexOf('>', _i2);
- var name = chunk.slice(1);
- if (DEBUG && j < 0) throw errors.unclosed_element(template, name);
- var tag = name;
- // <${Component} ... />
- if (name === NUL) {
- tag = 'template';
- node = append(node, new Component$1());
- resolvedPath = path(node).slice(1);
- //@ts-ignore
- values.push(update(node, COMPONENT$1, resolvedPath, '', holes[hole++]));
- }
- // any other element
- else {
- if (!xml) {
- tag = tag.toLowerCase();
- // patch automatic elements insertion with
- // or path will fail once live on the DOM
- if (node.name === 'table' && (tag === 'tr' || tag === 'td')) {
- node = append(node, new Element$1('tbody', xml));
- ignore.add(node);
- }
- if (node.name === 'tbody' && tag === 'td') {
- node = append(node, new Element$1('tr', xml));
- ignore.add(node);
- }
- }
- node = append(node, new Element$1(tag, xml ? tag !== 'svg' : false));
- resolvedPath = children;
- }
-
- // attributes
- if (_i2 < j) {
- var dot = false;
- var _iterator2 = _createForOfIteratorHelper$2(content.slice(_i2, j).matchAll(ATTRS)),
- _step2;
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
- var _step2$value = _slicedToArray(_step2.value, 3),
- _ = _step2$value[0],
- _name = _step2$value[1],
- value = _step2$value[2];
- if (value === NUL || value === DOUBLE_QUOTED_NUL || value === SINGLE_QUOTED_NUL || (dot = _name.endsWith(NUL))) {
- var p = resolvedPath === children ? resolvedPath = path(node) : resolvedPath;
- //@ts-ignore
- values.push(update(node, ATTRIBUTE$1, p, dot ? _name.slice(0, -1) : _name, holes[hole++]));
- dot = false;
- skip++;
- } else prop(node, _name, value ? value.slice(1, -1) : true);
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- resolvedPath = children;
- }
- pos = j + 1;
-
- // to handle self-closing tags
- var closed = 0 < j && content[j - 1] === '/';
- if (xml) {
- if (closed) {
- node = node.parent;
- /* c8 ignore start unable to reproduce, still worth a guard */
- if (DEBUG && !node) throw errors.invalid_layout(template);
- /* c8 ignore stop */
- }
- } else if (closed || VOID_ELEMENTS.has(tag)) {
- // void elements are never td or tr
- node = closed ? parent(node, ignore) : node.parent;
-
- /* c8 ignore start unable to reproduce, still worth a guard */
- if (DEBUG && !node) throw errors.invalid_layout();
- /* c8 ignore stop */
- }
- //