jq79 0.4.18 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/jq79.cjs CHANGED
@@ -1,14 +1,14 @@
1
- var tt=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var be=Object.prototype.hasOwnProperty;var Ee=(t,e,n)=>e in t?tt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Se=(t,e)=>{for(var n in e)tt(t,n,{get:e[n],enumerable:!0})},we=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ye(e))!be.call(t,r)&&r!==n&&tt(t,r,{get:()=>e[r],enumerable:!(s=me(e,r))||s.enumerable});return t};var Re=t=>we(tt({},"__esModule",{value:!0}),t);var N=(t,e,n)=>Ee(t,typeof e!="symbol"?e+"":e,n);var Wn={};Se(Wn,{$:()=>z,$$:()=>et,$create:()=>nt,$reactive:()=>X,C79:()=>q,Component79:()=>q,PendingComponent79:()=>pt,enableHotReload:()=>he,hotUpdate:()=>pe,parseComponent:()=>qn,renderComponent:()=>fn});module.exports=Re(Wn);function z(t,e){return typeof t=="string"?document.querySelector(t):t.querySelector(e)}function et(t,e){return Array.from(typeof t=="string"?document.querySelectorAll(t):t.querySelectorAll(e))}var nt=(t,e={})=>{let n=document.createElement(t);for(let[s,r]of Object.entries(e))if(s==="className")n.className=Array.isArray(r)?r.join(" "):r;else if(s==="textContent")n.textContent=r;else if(s==="children")for(let o of r)n.appendChild(o);else n.setAttribute(s,r);return n},$e=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),Lt={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},Te=new Set(["http:","https:","mailto:"]);function xe(t){try{let e=new URL(t,"https://example.com");return Te.has(e.protocol)}catch{return!1}}var Ce={"https:":"443","http:":"80"};function _e(t){let e=t.trim().toLowerCase().match(/^([a-z\d*][a-z\d.*-]*?)(?::(\d{1,5}|\*))?$/);if(!e)return null;let[,n,s]=e,r=n.split(".");return r.some(i=>i!=="*"&&!/^[a-z\d-]+$/.test(i))?null:{host:new RegExp(`^${r.map(i=>i==="*"?"[^.]+":i).join("\\.")}$`),port:!s||s==="*"?null:s}}var Pt=t=>{let e=(Array.isArray(t)?t:t.split(",")).map(_e).filter(n=>n!==null);return n=>{let s=n.hostname.toLowerCase(),r=n.port||Ce[n.protocol]||"";return e.some(o=>o.host.test(s)&&(o.port===null||o.port===r))}};function Ae(t,e,n,s){try{return!!t(new URL(e,document.baseURI),n,s)}catch{return!1}}var vt=512;function Mt(t,e,n,s){if(n>vt)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${vt} elements`);for(let r of Array.from(t.childNodes))if(r.nodeType===Node.ELEMENT_NODE){let o=je(r,n,s);o&&e.appendChild(o)}else r.nodeType===Node.TEXT_NODE&&e.appendChild(r.cloneNode())}function je(t,e,n){let s=t.tagName.toLowerCase();if(!$e.has(s))return null;let r=document.createElement(s);for(let o of Array.from(t.attributes)){let i=o.name.toLowerCase(),l=Lt[s]?.has(i),u=Lt["*"]?.has(i);!l&&!u||(i==="href"||i==="src")&&(!xe(o.value)||n&&!Ae(n,o.value,s,i))||r.setAttribute(i,o.value)}return s==="a"&&r.setAttribute("rel","noopener noreferrer"),Mt(t,r,e+1,n),r}function Dt(t,e){let n=document.createElement("template");n.innerHTML=t;let s=document.createElement("div");return Mt(n.content,s,0,e?.allowUrl),s.innerHTML}var Ne=(t,e)=>e.split(".").reduce((n,s)=>n?.[s],t),Wt=t=>{if(Array.isArray(t))return!0;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null},Ut=(t,e,n)=>{Object.entries(t).forEach(([s,r])=>{let o=e?`${e}.${s}`:s;r&&typeof r=="object"&&Wt(r)?Ut(r,o,n):n(o,r)})},Oe=(t,e)=>t===e||t.startsWith(`${e}.`)||e.startsWith(`${t}.`),mt=Symbol("jq79.raw"),st=t=>{let e=t;for(;e!==null&&typeof e=="object"&&e[mt];)e=e[mt];return e},Ft=Symbol("jq79.store"),V=t=>t!==null&&typeof t=="object"&&t[Ft]===!0,Z=[],J=t=>{Z.push(new Set);try{return t()}finally{Z.pop()}},qt="$__attach",rt=Symbol("jq79.alsoWakenBy"),X=t=>{let e=new Map,n=new Set,s=new Set,r=new WeakMap,o=Object.create(null),i=(h,m,T=!1)=>{e.get(h)?.forEach(S=>S(m,h)),n.forEach(S=>S(h,m)),s.forEach(S=>{(T||Array.from(S.deps).some(c=>Oe(c,h)))&&S.run()})},l=h=>h!==null&&typeof h=="object"&&Wt(h),u=new Map,p=(h,m)=>{let T=u.get(m);T?.store!==h&&(T?.unsubscribe(),u.set(m,{store:h,unsubscribe:h.$onAny((S,c)=>i(`${m}.${S}`,c))}))},d=h=>{u.get(h)?.unsubscribe(),u.delete(h)},g=(h,m)=>{let T=r.get(h);if(T)return T;let S=null,c=new Proxy(h,{has(f,a){return Reflect.has(f,a)||typeof a=="string"&&S?.has(a)===!0},get(f,a,w){if(a===mt)return f;if(a===Ft)return m==="";if(typeof a!="string")return Reflect.get(f,a,w);if(m===""&&a in o)return o[a];let A=m?`${m}.${a}`:a;Z[Z.length-1]?.add(A);let j=Reflect.get(f,a,w);if(V(j))return p(j,A),j;let E=st(j);return l(E)?g(E,A):E},set(f,a,w,A){if(A!==c&&!Object.prototype.hasOwnProperty.call(f,a))return Reflect.set(f,a,w,A);let j=m?`${m}.${a}`:a,E=V(w)?w:st(w),v=!Object.prototype.hasOwnProperty.call(f,a);if(!v&&Object.is(f[a],E)&&(E===null||typeof E!="object"))return!0;f[a]=E,S?.delete(a),V(E)?p(E,j):d(j);let L=V(E)||!l(E)?E:g(E,j);return i(j,L,v),!0},deleteProperty(f,a){if(typeof a!="string")return Reflect.deleteProperty(f,a);let w=Object.prototype.hasOwnProperty.call(f,a),A=Reflect.deleteProperty(f,a);if(A&&w){let j=m?`${m}.${a}`:a;(S??(S=new Set)).add(a),d(j),i(j,void 0)}return A}});return r.set(h,c),c},b=g(st(t),"");Object.entries(st(t)).forEach(([h,m])=>{V(m)&&p(m,h)});let O=(h,m,{immediate:T=!1}={})=>(e.has(h)||e.set(h,new Set),e.get(h).add(m),T&&m(Ne(b,h),h),()=>e.get(h)?.delete(m)),x=(h,{immediate:m=!1}={})=>(n.add(h),m&&Ut(b,"",(T,S)=>h(T,S)),()=>n.delete(h)),y=(h,m)=>{let T=!1,S=!1,c={deps:new Set,run:()=>{if(T){S=!0;return}T=!0;try{let f=0;do{S=!1;let a=new Set;Z.push(a);try{h()}finally{Z.pop(),c.deps=a}}while(S&&++f<100);S&&console.error("jq79: an effect re-woke itself 100 times in a row (it writes what it reads); giving up on it settling")}finally{T=!1}}};return s.add(c),m?.length?R(c,m):(c.run(),()=>{s.delete(c)})},R=(h,m)=>{let T=m.map(S=>S?.[qt]?.(h)).filter(Boolean);return h.run(),()=>{s.delete(h),T.forEach(S=>S())}},$=h=>(s.add(h),()=>{s.delete(h)}),_=()=>{u.forEach(({unsubscribe:h})=>h()),u.clear()};return o.$on=O,o.$onAny=x,o.$effect=y,o.$dispose=_,o[qt]=$,b},I=t=>{let e=[],n=[],s=t[rt];return{effect:r=>{e.push(t.$effect(r,s)),n.push(r)},onDispose:r=>{e.push(r)},refresh:()=>{n.forEach(r=>r())},dispose:()=>{e.splice(0).forEach(r=>r()),n.length=0}}};var It=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,kt=/\$:\s*/y,it=/import(?=\s*\()/y,Bt=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,W=(t,e)=>{let n=t[e],s=e+1;for(;s<t.length;){if(t[s]==="\\"){s+=2;continue}if(t[s]===n)return s+1;s++}return t.length},M=(t,e)=>{let n=t.indexOf(`
2
- `,e);return n===-1?t.length:n},D=(t,e)=>{let n=t.indexOf("*/",e+2);return n===-1?t.length:n+2},ot=(t,e)=>{let n=e;for(;n<t.length;){if(/\s/.test(t[n])){n++;continue}if(t[n]==="/"&&t[n+1]==="/"){n=M(t,n);continue}if(t[n]==="/"&&t[n+1]==="*"){n=D(t,n);continue}break}return n},Le=new Set(["return","typeof","case","in","instanceof","new","delete","void","do","else","yield","await"]),U=(t,e)=>{let n=e-1;for(;n>=0;){let r=t[n];if(/\s/.test(r)){n--;continue}if(r==="/"&&t[n-1]==="*"){let o=t.lastIndexOf("/*",n-2);if(o===-1)return!0;n=o-1;continue}break}if(n<0)return!0;let s=t[n];if(/[\w$]/.test(s)){let r=n;for(;r>0&&/[\w$]/.test(t[r-1]);)r--;return Le.has(t.slice(r,n+1))}return(s==="+"||s==="-")&&t[n-1]===s?!1:!")]}\"'`.".includes(s)},F=(t,e)=>{let n=e+1,s=!1;for(;n<t.length;){let r=t[n];if(r==="\\"){n+=2;continue}if(r===`
3
- `)return n;if(r==="[")s=!0;else if(r==="]")s=!1;else if(r==="/"&&!s){for(n++;n<t.length&&/[a-z]/i.test(t[n]);)n++;return n}n++}return t.length},ve=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,Pe=(t,e)=>{let n=e-1;for(;n>=0;){let s=t[n];if(/\s/.test(s)){n--;continue}if(s==="/"&&t[n-1]==="*"){let r=t.lastIndexOf("/*",n-2);if(r===-1)return"";n=r-1;continue}return s}return""},Ht=(t,e)=>{let n=0,s=e;for(;s<t.length;){let r=t[s];if(r==="'"||r==='"'||r==="`"){s=W(t,s);continue}if(r==="/"&&t[s+1]==="/"){s=M(t,s);continue}if(r==="/"&&t[s+1]==="*"){s=D(t,s);continue}if(r==="/"&&U(t,s)){s=F(t,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else{if(n<=0&&r===";")return s;if(n<=0&&r===`
4
- `){let o=ot(t,s+1);if(!(o<t.length&&(ve.test(t.slice(o,o+2))||[",","="].includes(Pe(t,s)))))return s;s=o;continue}}s++}return t.length},Me=t=>{let e=[],n=0,s=0,r=0,o=l=>{e.push({raw:t.slice(s,l),codeEnd:Math.max(0,r-s)}),s=l+1,r=s},i=0;for(;i<t.length;){let l=t[i];if(l==="'"||l==='"'||l==="`"){i=W(t,i),r=i;continue}if(l==="/"&&t[i+1]==="/"){i=M(t,i);continue}if(l==="/"&&t[i+1]==="*"){i=D(t,i);continue}if(l==="/"&&U(t,i)){i=F(t,i),r=i;continue}if("([{".includes(l))n++;else if(")]}".includes(l))n--;else if(l===","&&n<=0){o(i),i++;continue}/\s/.test(l)||(r=i+1),i++}return o(t.length),e},yt=t=>{let e=t.trim();if(!e.startsWith("{")&&!e.startsWith("["))return at.test(e)?[e]:[];let n=[];for(let s of Et(e.slice(1,Zt(e)))){s.startsWith("...")&&(s=s.slice(3).trim());let r=St(s);if(r!==-1&&(s=s.slice(0,r).trim()),e.startsWith("{")){let o=bt(s,":");if(o!==-1){n.push(...yt(s.slice(o+1)));continue}}n.push(...yt(s))}return n},De=t=>{let e=[],n=Me(t).map(({raw:o,codeEnd:i})=>{let l=o.match(/^\s*/)[0];if(i<=l.length)return{text:o,empty:!0};let u=o.slice(l.length,i),p=o.slice(i),d=St(u),g=(d===-1?u:u.slice(0,d)).trim(),b=u[0]==="{"||u[0]==="[";b?e.push(...yt(g)):at.test(g)&&e.push(g);let O=ct(u).code;return{text:`${l}${b?`(${O})`:O}${p}`,empty:!1}}),s=[];for(;n.length&&n[n.length-1].empty;)s.unshift(n.pop().text);let r=n.map(o=>o.text).join(",")+s.join("");return r.trimStart().startsWith("(")&&(r=`;${r}`),{vars:e,code:r}},ct=t=>{let e=[],n="",s=0,r=0,o=!0;for(;s<t.length;){let i=t[s],l=t[s+1];if(i==="'"||i==='"'||i==="`"){let u=W(t,s);n+=t.slice(s,u),s=u,o=!1;continue}if(i==="/"&&(l==="/"||l==="*")){let u=l==="/"?M(t,s):D(t,s);n+=t.slice(s,u),s=u;continue}if(i==="/"&&U(t,s)){let u=F(t,s);n+=t.slice(s,u),s=u,o=!1;continue}if(i==="i"&&(s===0||!/[\w$.]/.test(t[s-1]))&&(it.lastIndex=s,it.test(t))){n+="$__import",s+=6,o=!1;continue}if(r===0&&o){It.lastIndex=s;let u=It.exec(t);if(u){let d=s+u[0].length,g=Ht(t,d),{vars:b,code:O}=De(t.slice(d,g));e.push(...b),n+=O,s=g,o=!1;continue}kt.lastIndex=s;let p=kt.exec(t);if(p){Bt.lastIndex=s;let d=Bt.exec(t);d&&e.push(d[1]);let g=s+p[0].length,b=Ht(t,g);n+=`$__effect(() => { ${ct(t.slice(g,b)).code} });`,s=b;continue}}"([{".includes(i)?r++:")]}".includes(i)&&(r=Math.max(0,r-1)),i===`
5
- `||i===";"||i==="}"?o=!0:/\s/.test(i)||(o=!1),n+=i,s++}return{vars:e,code:n}},lt=/export\s+default(?![\w$])/y,zt=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,qe=t=>{let e=[],n=0,s=0;for(let r=0;r<=t.length;r++){let o=t[r];if(o==="{")n++;else if(o==="}")n--;else if(r===t.length||o===","&&n===0){let i=t.slice(s,r).trim();i&&e.push(i),s=r+1}}return e},We=(t,e,n)=>{let s=`await $__import(${JSON.stringify(e)})`;if(t===void 0)return s;let r=qe(t),o=[],i=s;if(r.length>1){let l=`$__mod${n}`;o.push(`${l} = ${s}`),i=l}for(let l of r)l.startsWith("{")?o.push(`${l.replace(/\s+as\s+/g,": ")} = ${i}`):l.startsWith("*")?o.push(`${l.replace(/^\*\s*as\s+/,"")} = ${i}`):o.push(`${l} = $__default(${i})`);return`const ${o.join(", ")}`},at=/^[A-Za-z_$][\w$]*$/,Zt=t=>{let e=0,n=0;for(;n<t.length;){let s=t[n];if(s==="'"||s==='"'||s==="`"){n=W(t,n);continue}if(s==="/"&&t[n+1]==="/"){n=M(t,n);continue}if(s==="/"&&t[n+1]==="*"){n=D(t,n);continue}if(s==="/"&&U(t,n)){n=F(t,n);continue}if("([{".includes(s))e++;else if(")]}".includes(s)&&--e===0)return n;n++}return t.length},bt=(t,e)=>{let n=0,s=0;for(;s<t.length;){let r=t[s];if(r==="'"||r==='"'||r==="`"){s=W(t,s);continue}if(r==="/"&&t[s+1]==="/"){s=M(t,s);continue}if(r==="/"&&t[s+1]==="*"){s=D(t,s);continue}if(r==="/"&&r!==e&&U(t,s)){s=F(t,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else if(n===0&&r===e)return s;s++}return-1},Et=t=>{let e=[],n=0,s=0,r=0;for(;r<=t.length;){let o=t[r];if(o==="'"||o==='"'||o==="`"){r=W(t,r);continue}if(o==="/"&&t[r+1]==="/"){r=M(t,r);continue}if(o==="/"&&t[r+1]==="*"){r=D(t,r);continue}if(o==="/"&&U(t,r)){r=F(t,r);continue}if(o!==void 0&&"([{".includes(o))n++;else if(o!==void 0&&")]}".includes(o))n--;else if(r===t.length||o===","&&n===0){let i=t.slice(s,r).trim();i&&e.push(i),s=r+1}r++}return e},St=t=>{let e=0;for(;e<t.length;){let n=bt(t.slice(e),"=");if(n===-1)return-1;let s=e+n;if(t[s+1]!=="="&&t[s+1]!==">"&&t[s-1]!=="="&&t[s-1]!=="!")return s;e=s+1}return-1},G=t=>{let e=(t??"").trim();if(!e.startsWith("{"))return null;let n=Zt(e);if(n>=e.length)return null;let s=[];for(let r of Et(e.slice(1,n))){if(r.startsWith("..."))continue;let o=St(r),i=o===-1?r:r.slice(0,o),l=o===-1?void 0:r.slice(o+1).trim(),u=bt(i,":"),p=(u===-1?i:i.slice(0,u)).trim();if(!at.test(p))continue;let d={name:p};l!==void 0&&(d.default=l);let g=u===-1?"":i.slice(u+1).trim();at.test(g)&&(d.as=g),s.push(d)}return s},Ue=t=>{let e=0,n=0,s=!0;for(;e<t.length;){let r=t[e];if(r==="'"||r==='"'||r==="`"){e=W(t,e),s=!1;continue}if(r==="/"&&t[e+1]==="/"){e=M(t,e);continue}if(r==="/"&&t[e+1]==="*"){e=D(t,e);continue}if(r==="/"&&U(t,e)){e=F(t,e),s=!1;continue}if(r==="e"&&n===0&&s&&(e===0||!/[\w$.]/.test(t[e-1]))){lt.lastIndex=e;let o=lt.exec(t);if(o)return e+o[0].length}"([{".includes(r)?n++:")]}".includes(r)&&(n=Math.max(0,n-1)),r===`
6
- `||r===";"||r==="}"?s=!0:/\s/.test(r)||(s=!1),e++}return-1},Fe=/^async(?![\w$])/,Ie=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,ke=t=>{let e=Ue(t);if(e===-1)return null;let n=ot(t,e),s=t.slice(n);Fe.test(s)&&(n=ot(t,n+5));let r=Ie.exec(t.slice(n));if(r&&(n=ot(t,n+r[0].length)),t[n]!=="(")return null;let o=0,i=n;for(;i<t.length;){let l=t[i];if(l==="'"||l==='"'||l==="`"){i=W(t,i);continue}if(l==="/"&&t[i+1]==="/"){i=M(t,i);continue}if(l==="/"&&t[i+1]==="*"){i=D(t,i);continue}if(l==="/"&&U(t,i)){i=F(t,i);continue}if("([{".includes(l))o++;else if(")]}".includes(l)&&--o===0)break;i++}return Et(t.slice(n+1,i))[0]??""},ut=t=>{let e=ke(t);if(e===null)return null;let n=G(e),s=n?.find(r=>r.name.startsWith("$"))?.name;if(s)throw new Error(`jq79: the factory signature is (props, ctx), so \`${s}\` can't be destructured from the first parameter. Write \`export default (props, { ${s} }) => \u2026\`, or \`_\` in place of props if the component takes none.`);return n},Gt=t=>{let e="",n=0,s=0,r=!0,o=!1,i=0;for(;n<t.length;){let l=t[n],u=t[n+1],p=n===0||!/[\w$.]/.test(t[n-1]);if(l==="'"||l==='"'||l==="`"){let d=W(t,n);e+=t.slice(n,d),n=d,r=!1;continue}if(l==="/"&&(u==="/"||u==="*")){let d=u==="/"?M(t,n):D(t,n);e+=t.slice(n,d),n=d;continue}if(l==="/"&&U(t,n)){let d=F(t,n);e+=t.slice(n,d),n=d,r=!1;continue}if(l==="i"&&p){if(it.lastIndex=n,it.test(t)){e+="$__import",n+=6,r=!1;continue}if(s===0&&r){zt.lastIndex=n;let d=zt.exec(t);if(d){e+=We(d[1],d[3],i++),n+=d[0].length,r=!1;continue}}}if(l==="e"&&p&&s===0&&r){lt.lastIndex=n;let d=lt.exec(t);if(d){o=!0,e+="$__exports.default =",n+=d[0].length,r=!1;continue}}"([{".includes(l)?s++:")]}".includes(l)&&(s=Math.max(0,s-1)),l===`
7
- `||l===";"||l==="}"?r=!0:/\s/.test(l)||(r=!1),e+=l,n++}return o?e:null};var Be="0.4.18",se=t=>Object.fromEntries(Array.from(t.attributes).map(e=>[e.name,e.value])),re=t=>({tag:t.tagName.toLowerCase(),attrs:se(t),children:Array.from((t instanceof HTMLTemplateElement?t.content:t).childNodes).flatMap(e=>{if(e.nodeType===Node.TEXT_NODE){let n=e.textContent??"";return n?[n]:[]}return e.nodeType===Node.ELEMENT_NODE?[re(e)]:[]})}),Kt=new Map,oe=(t,e)=>{let n=`${e.join(",")}|${t}`,s=Kt.get(n);if(s===void 0){try{s=new Function("$scope",...e,`with ($scope) { return (${t}
8
- ); }`)}catch{s=null}Kt.set(n,s)}return s},C=(t,e,n)=>{let s=oe(t,n?Object.keys(n):[]);if(s)try{return s(e,...n?Object.values(n):[])}catch{return}},He=(t,e)=>t.replace(/{{\s*([\s\S]+?)\s*}}/g,(n,s)=>C(s,e)??""),ze=new Set([":attrs",":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":with",":text",":html",":html.allowed",":props"]),xt=t=>ze.has(t)||t.startsWith(":class.")||t.startsWith(":props.")||t===":slot"||t.startsWith(":slot."),Ze=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,Ge=(t,e,n,s)=>{let[r,...o]=e.slice(1).split("."),i=new Set(o);t.addEventListener(r,l=>{if(i.has("self")&&l.target!==t)return;i.has("prevent")&&l.preventDefault(),i.has("stop")&&l.stopPropagation();let u=C(n,s,{$event:l});typeof u=="function"&&u.call(t,l)},{once:i.has("once"),capture:i.has("capture")})},Ke=(t,e,n,s)=>{let[r,...o]=e.slice(1).split("."),i=new Set(o),l=u=>{i.has("prevent")&&u.preventDefault(),i.has("stop")&&u.stopPropagation(),i.has("once")&&t.off(r,l),J(()=>{let p=C(n,s,{$event:u});typeof p=="function"&&p(u)})};t.on(r,l)},k=t=>t.replace(/-(\w)/g,(e,n)=>n.toUpperCase()),Rt=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),Ct=t=>t instanceof DocumentFragment?{first:t.firstChild,last:t.lastChild}:{first:t,last:t},ft=({first:t,last:e})=>{for(let n=t;n;){let s=n===e?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},Ve=({first:t,last:e},n)=>{let s=n.nextSibling;for(let r=t;r;){let o=r===e?null:r.nextSibling;n.parentNode.insertBefore(r,s),r=o}},Vt=(t,e)=>{let n=e.replace(/-/g,"").toLowerCase();for(let s=t;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r;return null},Jt=200,wt=0,ie=Symbol("jq79.slots"),Je=t=>t==="slot"||t.startsWith("slot."),le=t=>t?k(t):"default",_t=t=>Object.keys(t.attrs).find(e=>e===":slot"||e.startsWith(":slot.")),Xe=t=>t==="default"?":slot":`:slot.${t}`,Qe=t=>typeof t!="string"||t.trim()!=="",Ye=t=>{let e={},n=[];t.children.forEach(r=>{let o=typeof r=="object"&&r.tag==="template"?_t(r):void 0;if(typeof r=="string"||o===void 0){n.push(r);return}let i=le(o.slice(6));if(i in e){console.warn(`jq79: two <template ${Xe(i)}> in <${t.tag}>; the second was ignored`);return}e[i]={nodes:r.children,binder:r.attrs[o]||void 0}});let s=n.some(Qe);return s&&"default"in e?console.warn(`jq79: <${t.tag}> has both a <template :slot> and content outside it - the <template> is the default slot's content, and the rest was ignored`):s&&(e.default={nodes:n,binder:t.attrs[":slot"]||void 0}),e},tn=(t,e,n)=>{G(e)?.forEach(({name:s,as:r,default:o})=>{let i=r??s;Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>{let l=n[s]?.();return l===void 0&&o!==void 0?C(o,t):l},set:()=>console.warn(`jq79: "${i}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},en=t=>{let e=_t(t);return console.warn(`jq79: <template ${e}> fills a slot only as a direct child of a component tag; here it rendered nothing`),document.createComment(`misplaced ${e}`)},nn=(t,e)=>{let n=Object.entries(Ye(t));if(!n.length)return null;let s={};return n.forEach(([r,o])=>{s[r]=sn(o,e)}),s},sn=(t,e)=>(n,s,r,o)=>{let i=Object.create(e);tn(i,t.binder,n);let l=i[rt]??[];Object.defineProperty(i,rt,{value:[...l,s]});let u=I(i);return r.onDispose(()=>u.dispose()),K(t.nodes,i,u,o)},rn=(t,e,n,s)=>{let r=le(t.tag.slice(5)),o=document.createDocumentFragment(),i=document.createComment(t.tag),l=document.createComment(`/${t.tag}`);o.append(i,l);let u=e[ie]?.[r];if(!u)return o.insertBefore(K(t.children,e,n,s),l),o;let p={};return Object.entries(t.attrs).forEach(([d,g])=>{if(!(d===ht||xt(d)||d.startsWith("@")))if(d.startsWith(":")){let b=g||d.slice(1);p[k(d.slice(1))]=()=>C(b,e)}else p[k(d)]=()=>g}),o.insertBefore(u(p,e,n,s),l),o},Xt=(t,e,n,s,r)=>{let o=document.createComment(t),i=document.createComment(`/${t}`),l=document.createDocumentFragment();l.append(o,i);let u=nn(e,n),p={},d={},g=[],b=[],O=!1;Object.entries(e.attrs).forEach(([c,f])=>{if(c!==ht){if(c===":props"||c.startsWith(":props.")){O=!0,b.push({expr:f});return}if(!xt(c))if(c.startsWith("@"))g.push([c,f]);else if(c===":model"||c.startsWith(":model.")){let a=c===":model"?"default":k(c.slice(7));d[a]=f||(c===":model"?"model":a)}else if(c.startsWith(":")){let a=k(c.slice(1));p[a]=f||a,b.push({name:a,expr:f||a})}else{let a=k(c),w=JSON.stringify(f);p[a]=w,b.push({name:a,expr:w})}}});let x=c=>c==="default"?":model":`:model.${c}`,y=c=>c==="default"?"model":c,R=c=>`${c}
9
- = $value`;Object.entries(d).forEach(([c,f])=>{let a=y(c);p[a]!==void 0&&console.warn(`jq79: <${e.tag}> binds prop "${a}" through both :${a} and ${x(c)} - ${x(c)} wins`),p[a]=f,oe(R(f),["$value"])===null&&console.warn(`jq79: ${x(c)}="${f}" is not assignable - updates from <${e.tag}> will be dropped`)});let $=()=>{let c={};return b.forEach(({name:f,expr:a})=>{if(f!==void 0)c[f]=C(a,n);else{let w=C(a,n);w!==null&&typeof w=="object"&&Object.assign(c,w)}}),Object.entries(d).forEach(([f,a])=>{c[y(f)]=C(a,n)}),c},_=null,h=null,m=null,T=new Set,S=c=>{if(c==null){if(!n[de]?.has(t)||T.has("unfilled"))return;T.add("unfilled"),console.error(`jq79: <${e.tag}> is declared as a prop and the parent passed nothing - nothing renders here. Pass it (:${t}="\u2026"), or drop it from the signature to use the one declared in this file.`);return}T.has("type")||(T.add("type"),console.error(`jq79: <${e.tag}> is ${typeof c}, not a component - nothing renders here`))};return s.effect(()=>{let c=C(t,n),f=c instanceof q?c:null;if(f||S(c),f===h||(m?.dispose(),m=null,_?.destroy(),_=null,h=f,!f))return;let a=new q({template:f.template,scripts:f.scripts,styles:f.styles,modules:f.modules,filename:f.filename,siblings:f.siblings,name:f.name});if(u&&(a.slots=u),Object.keys(d).length){let v=new Set,L=(H,P)=>{v.has(H)||(v.add(H),console.warn(P))};a.on("model:update",(H,P)=>{if(P===null||typeof P!="object"){L("payload",`jq79: model:update expects a { name?, value } payload, got ${P===null?"null":typeof P}`);return}let gt=P.name==null?"default":k(String(P.name)),Ot=d[gt];if(Ot===void 0){L(gt,`jq79: <${e.tag}> has no ${x(gt)} - bound: ${Object.keys(d).map(x).join(", ")}`);return}J(()=>C(R(Ot),n,{$value:P.value}))})}g.forEach(([v,L])=>Ke(a,v,L,n));let w=Nn(a.scripts),A=ee(J($),w),j=document.createDocumentFragment();if(wt>=Jt){console.error(`jq79: <${e.tag}> is ${Jt} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}wt++;try{(r?a.renderShadow(A):a.render(A)).mount(j)}finally{wt--}i.parentNode.insertBefore(j,i);let E=I(n);if(O){let v=[];E.effect(()=>{let L=ee($(),w),H=Object.keys(L);v.forEach(P=>{P in L||(a.data[P]=void 0)}),H.forEach(P=>{a.data[P]=L[P]}),v=H})}else Object.entries(p).forEach(([v,L])=>{w!==null&&!w.has(v)||E.effect(()=>{a.data[v]=C(L,n)})});m=E,_=a}),s.onDispose(()=>{m?.dispose(),_?.destroy()}),l},on=(t,e)=>{let n=()=>{let s=C(t,e);return s!==null&&typeof s=="object"?s:null};return new Proxy(e,{has(s,r){let o=n();return o!==null&&Reflect.has(o,r)||Reflect.has(s,r)},get(s,r){let o=n();return o!==null&&Reflect.has(o,r)?o[r]:Reflect.get(s,r)},set(s,r,o){let i=n();return i!==null&&Reflect.has(i,r)?(i[r]=o,!0):Reflect.set(s,r,o)}})},Y=t=>typeof t=="string"?t.split(/\s+/).filter(Boolean):Array.isArray(t)?t.flatMap(Y):t!==null&&typeof t=="object"?Object.entries(t).flatMap(([e,n])=>n?Y(e):[]):[],ln=t=>typeof t=="function"?(e,n,s)=>{try{return!!t(e,n,s)}catch{return!1}}:typeof t=="string"||Array.isArray(t)?Pt(t):()=>!1,At=(t,e,n,s)=>{let r=t.attrs[":with"],o=r!==void 0?on(r,e):e;if(Je(t.tag))return rn(t,o,n,s);if(t.tag==="template"&&_t(t)!==void 0)return en(t);let i=Vt(o,t.tag);if(i)return Xt(i,t,o,n,s);let l=document.createElement(t.tag);if(l instanceof HTMLUnknownElement||t.tag.includes("-")){let y=!1;n.effect(()=>{if(y)return;let R=Vt(o,t.tag);if(!R)return;y=!0;let $=Xt(R,t,o,n,s),_=Ct($);n.onDispose(()=>ft(_)),l.replaceWith($)})}Object.entries(t.attrs).forEach(([y,R])=>{y.startsWith("@")?Ge(l,y,R,o):y===":model"||y.startsWith(":model.")?l instanceof HTMLUnknownElement||t.tag.includes("-")||console.warn(`jq79: ${y} on <${t.tag}> does nothing - :model binds component tags only (for now)`):xt(y)||l.setAttribute(y,R)});let u=t.attrs[":attrs"];if(u!==void 0){let y=[];n.effect(()=>{y.forEach($=>l.removeAttribute($));let R=C(u,o);y=R&&typeof R=="object"?Object.keys(R):[],y.forEach($=>{let _=R[$];_!=null&&_!==!1&&l.setAttribute($,String(_))})})}let p=t.attrs[":class"],d=Object.entries(t.attrs).filter(([y])=>y.startsWith(":class.")).map(([y,R])=>[y.slice(7),R]);if(p!==void 0||d.length){let y=new Set(Y(t.attrs.class??"")),R=[];n.effect(()=>{let $=p!==void 0?Y(C(p,o)):[];d.forEach(([_,h])=>{C(h,o)&&$.push(...Y(_))}),R.forEach(_=>{!$.includes(_)&&!y.has(_)&&l.classList.remove(_)}),l.classList.add(...$),R=$})}let g=t.attrs[":text"],b=t.attrs[":html"],O=t.attrs[":html.allowed"];O!==void 0&&b===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),g!==void 0?n.effect(()=>{l.textContent=String(C(g,o)??"")}):b!==void 0?n.effect(()=>{let y=O!==void 0?{allowUrl:ln(C(O,o))}:void 0;l.innerHTML=Dt(String(C(b,o)??""),y)}):l instanceof HTMLTemplateElement?l.content.appendChild(K(t.children,o,n,s)):l.appendChild(K(t.children,o,n,s));let x=t.attrs[":value"];return x!==void 0&&n.effect(()=>{let y=String(C(x,o)??"");l.value!==y&&(l.value=y)}),[":checked",":selected"].forEach(y=>{let R=t.attrs[y];if(R===void 0)return;let $=y.slice(1);n.effect(()=>{l[$]=!!C(R,o)})}),l},an=(t,e,n,s)=>{let r=document.createComment("if"),o=document.createDocumentFragment();o.appendChild(r);let i=null,l=null,u=null;return n.effect(()=>{let p=t.find(g=>g.expr===void 0||C(g.expr,e))??null;if(p===l||(u?.dispose(),i&&ft(i),i=null,l=p,!p))return;u=I(e);let d=At(p.node,e,u,s);i=Ct(d),r.parentNode.insertBefore(d,r.nextSibling)}),o},Q=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})},cn=t=>{if(t===null||typeof t!="object"||Array.isArray(t))return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null},un=(t,e,n,s)=>{let r=t.attrs[":each"].match(Ze);if(!r)return document.createComment(`invalid :each expression "${t.attrs[":each"]}"`);let[,o,i,l]=r,u=t.attrs[":key"],{[":each"]:p,[":key"]:d,...g}=t.attrs,b={...t,attrs:g},O=document.createComment("each"),x=document.createDocumentFragment();x.appendChild(O),(":if"in t.attrs||":elseif"in t.attrs||":else"in t.attrs)&&console.warn("jq79: :if/:elseif/:else on a :each element is ignored; filter the list expression instead");let y=[],R=!1;return n.effect(()=>{let $=C(l,e),_=Array.isArray($)?$.map((f,a)=>[a,f]):cn($)?Object.entries($):[],h=new Map;y.forEach(f=>{let a=h.get(f.key);a?a.push(f):h.set(f.key,[f])});let m=new Set,T=[],S=_.map(([f,a],w)=>{let A=Object.create(e);Q(A,o,a),i&&Q(A,i,f),Q(A,"$index",w);let j=u!==void 0?C(u,A):f;m.has(j)&&!R&&(R=!0,console.warn(`jq79: duplicate :key in :each "${t.attrs[":each"]}"; duplicates pair up by position`)),m.add(j);let E=h.get(j)?.shift();if(E&&Object.is(E.item,a))return E.scope.$index!==w&&T.push(E),Q(E.scope,"$index",w),i&&Q(E.scope,i,f),E;E&&(E.fx.dispose(),ft(E.range));let v=I(e),L=Ct(At(b,A,v,s));return{key:j,item:a,scope:A,fx:v,range:L}});h.forEach(f=>f.forEach(a=>{a.fx.dispose(),ft(a.range)}));let c=O;S.forEach(f=>{c.nextSibling!==f.range.first&&Ve(f.range,c),c=f.range.last}),T.forEach(f=>J(()=>f.fx.refresh())),y=S}),x},K=(t,e,n,s=!1)=>{let r=document.createDocumentFragment(),o=0;for(;o<t.length;){let i=t[o];if(typeof i=="string"){let l=document.createTextNode(i);i.includes("{{")&&n.effect(()=>{l.textContent=He(i,e)}),r.appendChild(l),o++;continue}if(":each"in i.attrs){r.appendChild(un(i,e,n,s)),o++;continue}if(":if"in i.attrs){let l=[{expr:i.attrs[":if"],node:i}];o++;let u=d=>{let g=o;for(;g<t.length&&typeof t[g]=="string"&&!t[g].trim();)g++;let b=t[g];if(typeof b=="object"&&d in b.attrs)return o=g+1,b};for(let d=u(":elseif");d;d=u(":elseif"))l.push({expr:d.attrs[":elseif"],node:d});let p=u(":else");p&&l.push({node:p}),r.appendChild(an(l,e,n,s));continue}r.appendChild(At(i,e,n,s)),o++}return r},fn=(t,e,n=!1)=>K(t.template,e,I(e),n),dn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),pn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,jt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,hn=t=>t.split(jt).map((e,n)=>n%2===1?e:e.replace(pn,(s,r,o)=>dn.has(r.toLowerCase())?s:`<${r}${o}></${r}>`)).join(""),ae=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,gn=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,mn=t=>t.split(jt).map((e,n)=>n%2===1?e:e.replace(ae,(s,r,o)=>{let i=0,l=o.replace(gn,(u,p,d)=>d===void 0?u:`${p}:props.${i++}="${d}"`);return`<${r}${l}>`})).join(""),yn=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,bn=/<\/slot\.([\w.$-]+)(\s*)>/gi,En=/^slot\./i,Sn=t=>En.test(t)?`slot.${Rt(t.slice(5))}`:t,wn=t=>t.split(jt).map((e,n)=>n%2===1?e:e.replace(ae,(s,r,o)=>{let i=o.replace(yn,(l,u,p)=>p===void 0?l:`${u}${Rt(p)}`);return`<${Sn(r)}${i}>`}).replace(bn,(s,r,o)=>`</slot.${Rt(r)}${o}>`)).join(""),ht="data-jq79",Rn=t=>{let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return(e>>>0).toString(36)},ce=(t,e)=>{t.forEach(n=>{typeof n!="string"&&(n.attrs[ht]=e,ce(n.children,e))})},$n=(t,e)=>t.split(",").map(n=>{let s=n.trim(),r=s.indexOf("::"),o=r===-1?s:s.slice(0,r),i=r===-1?"":s.slice(r);return`${o}[${ht}="${e}"]${i}`}).join(", "),ue=(t,e)=>{Array.from(t).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=$n(n.selectorText,e):n instanceof CSSGroupingRule&&ue(n.cssRules,e)})},Tn=(t,e)=>{/:deep\(|::v-deep|>>>/.test(t)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let n=new CSSStyleSheet;return n.replaceSync(t),ue(n.cssRules,e),Array.from(n.cssRules).map(s=>s.cssText).join(`
10
- `)},xn=/^[A-Z][A-Za-z0-9]*$/,$t=t=>{let e=hn(mn(wn(t))),s=new DOMParser().parseFromString(`<template>${e}</template>`,"text/html").querySelector("template"),r=[],o=[];Array.from(s.content.children).forEach(u=>{u.tagName==="TEMPLATE"?o.push(u):r.push(u)});let i=Qt(r,t),l={};return o.forEach(u=>{let p=u.getAttribute("name");if(p===null){console.warn("jq79: a top-level <template> without a name declares nothing and was ignored");return}if(!xn.test(p)){console.warn(`jq79: <template name="${p}"> was ignored - a component name has to be PascalCase, or no tag could ever reference it (only capitalized names resolve as components)`);return}if(p in l){console.warn(`jq79: two <template name="${p}"> in one file; the second was ignored`);return}l[p]=new q({...Qt(Array.from(u.content.children),u.innerHTML),siblings:l,name:p})}),Object.keys(l).length&&(i.siblings=l),i},Qt=(t,e)=>{let n=[],s=[],r=[];t.forEach(i=>{let l={attrs:se(i),content:i.textContent??""};i.tagName==="SCRIPT"?n.push(l):i.tagName==="STYLE"?s.push(l):r.push(re(i))}),s.forEach(i=>{"lang"in i.attrs&&console.warn(`jq79: <style lang="${i.attrs.lang}"> needs the jq79/vite plugin to compile it. This component didn't go through the bundler, so its styles were left uncompiled and the browser will ignore them.`)});let o=i=>"scoped"in i.attrs&&!("lang"in i.attrs);if(s.some(o)){let i=Rn(e);ce(r,i),s.forEach(l=>{o(l)&&(l.scoped=Tn(l.content,i))})}return{template:r,scripts:n,styles:s}},Nt=t=>/\.html?([?#]|$)/.test(t)?Tt(t):import(t),fe=(t,e)=>t?`
11
- //# sourceURL=${t}?jq79-script=${e}`:"",Yt=t=>t.scoped??t.content,dt=new Map,Cn=t=>{let e=dt.get(t);if(!e){let n=document.createElement("style");n.textContent=t,document.head.appendChild(n),e={el:n,count:0},dt.set(t,e)}e.count++},_n=t=>{let e=dt.get(t);e&&--e.count<=0&&(e.el.remove(),dt.delete(t))},An=(t,e,n,s={},r=Nt,o={})=>{let i={...ge,...s},l=new Proxy(e,{has:(p,d)=>d!=="$__effect"&&d!=="$__import"&&(Reflect.has(p,d)||!(d in globalThis)&&!(d in i))});new Function("$scope","$__effect","$__import",...Object.keys(i),`return (async () => { with ($scope) { ${t} } })()${fe(o.filename,o.index??0)}`)(l,n,r,...Object.values(i)).catch(p=>console.error("jq79: error in :setup script",p))},te=(t,e)=>{e?.forEach(({name:n,default:s})=>{t[n]===void 0&&(t[n]=s===void 0?void 0:C(s,t))})},jn=t=>{let e=new Set;return t.forEach(n=>{(ut(n.content)??G(n.attrs[":setup"]))?.forEach(({name:r})=>e.add(r))}),e},Nn=t=>{let e=null;return t.forEach(n=>{let s=ut(n.content)??G(n.attrs[":setup"]);if(!s)return;let r=e??(e=new Set);s.forEach(({name:o})=>r.add(o))}),e},ee=(t,e)=>{if(e===null)return t;let n={};return Object.keys(t).forEach(s=>{e.has(s)&&(n[s]=t[s])}),n},On=(t,e)=>{if(!t)return null;let n=Object.create(null),s=!1;return Object.entries(t).forEach(([r,o])=>{e.has(r)||(n[r]=o,s=!0)}),s?n:null},de=Symbol("jq79.unfilledProps"),Ln=t=>t&&t.default!==void 0?t.default:t,vn=(t,e,n,s={},r=Nt,o={})=>{let i={...ge,...s},l={},u=new Function("$__exports","$__default","$__import",...Object.keys(i),`return (async () => { "use strict";
1
+ var et=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var be=Object.prototype.hasOwnProperty;var Ee=(t,e,n)=>e in t?et(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Se=(t,e)=>{for(var n in e)et(t,n,{get:e[n],enumerable:!0})},we=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ye(e))!be.call(t,o)&&o!==n&&et(t,o,{get:()=>e[o],enumerable:!(s=me(e,o))||s.enumerable});return t};var Re=t=>we(et({},"__esModule",{value:!0}),t);var A=(t,e,n)=>Ee(t,typeof e!="symbol"?e+"":e,n);var Wn={};Se(Wn,{$:()=>Z,$$:()=>nt,$create:()=>st,$reactive:()=>Q,C79:()=>W,Component79:()=>W,PendingComponent79:()=>ht,enableHotReload:()=>he,hotUpdate:()=>pe,parseComponent:()=>qn,renderComponent:()=>fn});module.exports=Re(Wn);function Z(t,e){return typeof t=="string"?document.querySelector(t):t.querySelector(e)}function nt(t,e){return Array.from(typeof t=="string"?document.querySelectorAll(t):t.querySelectorAll(e))}var st=(t,e={})=>{let n=document.createElement(t);for(let[s,o]of Object.entries(e))if(s==="className")n.className=Array.isArray(o)?o.join(" "):o;else if(s==="textContent")n.textContent=o;else if(s==="children")for(let r of o)n.appendChild(r);else n.setAttribute(s,o);return n},$e=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),Lt={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},Te=new Set(["http:","https:","mailto:"]);function xe(t){try{let e=new URL(t,"https://example.com");return Te.has(e.protocol)}catch{return!1}}var Ce={"https:":"443","http:":"80"};function _e(t){let e=t.trim().toLowerCase().match(/^([a-z\d*][a-z\d.*-]*?)(?::(\d{1,5}|\*))?$/);if(!e)return null;let[,n,s]=e,o=n.split(".");return o.some(i=>i!=="*"&&!/^[a-z\d-]+$/.test(i))?null:{host:new RegExp(`^${o.map(i=>i==="*"?"[^.]+":i).join("\\.")}$`),port:!s||s==="*"?null:s}}var Pt=t=>{let e=(Array.isArray(t)?t:t.split(",")).map(_e).filter(n=>n!==null);return n=>{let s=n.hostname.toLowerCase(),o=n.port||Ce[n.protocol]||"";return e.some(r=>r.host.test(s)&&(r.port===null||r.port===o))}};function Ae(t,e,n,s){try{return!!t(new URL(e,document.baseURI),n,s)}catch{return!1}}var vt=512;function Mt(t,e,n,s){if(n>vt)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${vt} elements`);for(let o of Array.from(t.childNodes))if(o.nodeType===Node.ELEMENT_NODE){let r=je(o,n,s);r&&e.appendChild(r)}else o.nodeType===Node.TEXT_NODE&&e.appendChild(o.cloneNode())}function je(t,e,n){let s=t.tagName.toLowerCase();if(!$e.has(s))return null;let o=document.createElement(s);for(let r of Array.from(t.attributes)){let i=r.name.toLowerCase(),a=Lt[s]?.has(i),c=Lt["*"]?.has(i);!a&&!c||(i==="href"||i==="src")&&(!xe(r.value)||n&&!Ae(n,r.value,s,i))||o.setAttribute(i,r.value)}return s==="a"&&o.setAttribute("rel","noopener noreferrer"),Mt(t,o,e+1,n),o}function Dt(t,e){let n=document.createElement("template");n.innerHTML=t;let s=document.createElement("div");return Mt(n.content,s,0,e?.allowUrl),s.innerHTML}var Ne=(t,e)=>e.split(".").reduce((n,s)=>n?.[s],t),Wt=t=>{if(Array.isArray(t))return!0;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null},kt=(t,e,n)=>{Object.entries(t).forEach(([s,o])=>{let r=e?`${e}.${s}`:s;o&&typeof o=="object"&&Wt(o)?kt(o,r,n):n(r,o)})},Oe=(t,e)=>t===e||t.startsWith(`${e}.`)||e.startsWith(`${t}.`),mt=Symbol("jq79.raw"),ot=t=>{let e=t;for(;e!==null&&typeof e=="object"&&e[mt];)e=e[mt];return e},Ut=Symbol("jq79.store"),J=t=>t!==null&&typeof t=="object"&&t[Ut]===!0,G=[],X=t=>{G.push(new Set);try{return t()}finally{G.pop()}},qt="$__attach",rt=Symbol("jq79.alsoWakenBy"),Q=t=>{let e=new Map,n=new Set,s=new Set,o=new WeakMap,r=Object.create(null),i=(h,E,R=!1)=>{e.get(h)?.forEach(S=>S(E,h)),n.forEach(S=>S(h,E)),s.forEach(S=>{(R||Array.from(S.deps).some(N=>Oe(N,h)))&&S.run()})},a=h=>h!==null&&typeof h=="object"&&Wt(h),c=new Map,d=(h,E)=>{let R=c.get(E);R?.store!==h&&(R?.unsubscribe(),c.set(E,{store:h,unsubscribe:h.$onAny((S,N)=>i(`${E}.${S}`,N))}))},u=h=>{c.get(h)?.unsubscribe(),c.delete(h)},m=(h,E)=>{let R=o.get(h);if(R)return R;let S=null,N=new Proxy(h,{has(f,l){return Reflect.has(f,l)||typeof l=="string"&&S?.has(l)===!0},get(f,l,p){if(l===mt)return f;if(l===Ut)return E==="";if(typeof l!="string")return Reflect.get(f,l,p);if(E===""&&l in r)return r[l];let g=E?`${E}.${l}`:l;G[G.length-1]?.add(g);let C=Reflect.get(f,l,p);if(J(C))return d(C,g),C;let w=ot(C);return a(w)?m(w,g):w},set(f,l,p,g){if(g!==N&&!Object.prototype.hasOwnProperty.call(f,l))return Reflect.set(f,l,p,g);let C=E?`${E}.${l}`:l,w=J(p)?p:ot(p),P=!Object.prototype.hasOwnProperty.call(f,l);if(!P&&Object.is(f[l],w)&&(w===null||typeof w!="object"))return!0;f[l]=w,S?.delete(l),J(w)?d(w,C):u(C);let L=J(w)||!a(w)?w:m(w,C);return i(C,L,P),!0},deleteProperty(f,l){if(typeof l!="string")return Reflect.deleteProperty(f,l);let p=Object.prototype.hasOwnProperty.call(f,l),g=Reflect.deleteProperty(f,l);if(g&&p){let C=E?`${E}.${l}`:l;(S??(S=new Set)).add(l),u(C),i(C,void 0)}return g}});return o.set(h,N),N},b=m(ot(t),"");Object.entries(ot(t)).forEach(([h,E])=>{J(E)&&d(E,h)});let O=(h,E,{immediate:R=!1}={})=>(e.has(h)||e.set(h,new Set),e.get(h).add(E),R&&E(Ne(b,h),h),()=>e.get(h)?.delete(E)),x=(h,{immediate:E=!1}={})=>(n.add(h),E&&kt(b,"",(R,S)=>h(R,S)),()=>n.delete(h)),y=(h,E)=>{let R=!1,S=!1,N={deps:new Set,run:()=>{if(R){S=!0;return}R=!0;try{let f=0;do{S=!1;let l=new Set;G.push(l);try{h()}finally{G.pop(),N.deps=l}}while(S&&++f<100);S&&console.error("jq79: an effect re-woke itself 100 times in a row (it writes what it reads); giving up on it settling")}finally{R=!1}}};return s.add(N),E?.length?$(N,E):(N.run(),()=>{s.delete(N)})},$=(h,E)=>{let R=E.map(S=>S?.[qt]?.(h)).filter(Boolean);return h.run(),()=>{s.delete(h),R.forEach(S=>S())}},T=h=>(s.add(h),()=>{s.delete(h)}),j=()=>{c.forEach(({unsubscribe:h})=>h()),c.clear()};return r.$on=O,r.$onAny=x,r.$effect=y,r.$dispose=j,r[qt]=T,b},B=t=>{let e=[],n=[],s=t[rt];return{effect:o=>{e.push(t.$effect(o,s)),n.push(o)},onDispose:o=>{e.push(o)},refresh:()=>{n.forEach(o=>o())},dispose:()=>{e.splice(0).forEach(o=>o()),n.length=0}}};var Ft=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,It=/\$:\s*/y,at=/import(?=\s*\()/y,Bt=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,U=(t,e)=>{let n=t[e],s=e+1;for(;s<t.length;){if(t[s]==="\\"){s+=2;continue}if(t[s]===n)return s+1;s++}return t.length},D=(t,e)=>{let n=t.indexOf(`
2
+ `,e);return n===-1?t.length:n},q=(t,e)=>{let n=t.indexOf("*/",e+2);return n===-1?t.length:n+2},it=(t,e)=>{let n=e;for(;n<t.length;){if(/\s/.test(t[n])){n++;continue}if(t[n]==="/"&&t[n+1]==="/"){n=D(t,n);continue}if(t[n]==="/"&&t[n+1]==="*"){n=q(t,n);continue}break}return n},Le=new Set(["return","typeof","case","in","instanceof","new","delete","void","do","else","yield","await"]),F=(t,e)=>{let n=e-1;for(;n>=0;){let o=t[n];if(/\s/.test(o)){n--;continue}if(o==="/"&&t[n-1]==="*"){let r=t.lastIndexOf("/*",n-2);if(r===-1)return!0;n=r-1;continue}break}if(n<0)return!0;let s=t[n];if(/[\w$]/.test(s)){let o=n;for(;o>0&&/[\w$]/.test(t[o-1]);)o--;return Le.has(t.slice(o,n+1))}return(s==="+"||s==="-")&&t[n-1]===s?!1:!")]}\"'`.".includes(s)},I=(t,e)=>{let n=e+1,s=!1;for(;n<t.length;){let o=t[n];if(o==="\\"){n+=2;continue}if(o===`
3
+ `)return n;if(o==="[")s=!0;else if(o==="]")s=!1;else if(o==="/"&&!s){for(n++;n<t.length&&/[a-z]/i.test(t[n]);)n++;return n}n++}return t.length},ve=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,Pe=(t,e)=>{let n=e-1;for(;n>=0;){let s=t[n];if(/\s/.test(s)){n--;continue}if(s==="/"&&t[n-1]==="*"){let o=t.lastIndexOf("/*",n-2);if(o===-1)return"";n=o-1;continue}return s}return""},Ht=(t,e)=>{let n=0,s=e;for(;s<t.length;){let o=t[s];if(o==="'"||o==='"'||o==="`"){s=U(t,s);continue}if(o==="/"&&t[s+1]==="/"){s=D(t,s);continue}if(o==="/"&&t[s+1]==="*"){s=q(t,s);continue}if(o==="/"&&F(t,s)){s=I(t,s);continue}if("([{".includes(o))n++;else if(")]}".includes(o))n--;else{if(n<=0&&o===";")return s;if(n<=0&&o===`
4
+ `){let r=it(t,s+1);if(!(r<t.length&&(ve.test(t.slice(r,r+2))||[",","="].includes(Pe(t,s)))))return s;s=r;continue}}s++}return t.length},Me=t=>{let e=[],n=0,s=0,o=0,r=a=>{e.push({raw:t.slice(s,a),codeEnd:Math.max(0,o-s)}),s=a+1,o=s},i=0;for(;i<t.length;){let a=t[i];if(a==="'"||a==='"'||a==="`"){i=U(t,i),o=i;continue}if(a==="/"&&t[i+1]==="/"){i=D(t,i);continue}if(a==="/"&&t[i+1]==="*"){i=q(t,i);continue}if(a==="/"&&F(t,i)){i=I(t,i),o=i;continue}if("([{".includes(a))n++;else if(")]}".includes(a))n--;else if(a===","&&n<=0){r(i),i++;continue}/\s/.test(a)||(o=i+1),i++}return r(t.length),e},yt=t=>{let e=t.trim();if(!e.startsWith("{")&&!e.startsWith("["))return ct.test(e)?[e]:[];let n=[];for(let s of Et(e.slice(1,Zt(e)))){s.startsWith("...")&&(s=s.slice(3).trim());let o=St(s);if(o!==-1&&(s=s.slice(0,o).trim()),e.startsWith("{")){let r=bt(s,":");if(r!==-1){n.push(...yt(s.slice(r+1)));continue}}n.push(...yt(s))}return n},De=t=>{let e=[],n=Me(t).map(({raw:r,codeEnd:i})=>{let a=r.match(/^\s*/)[0];if(i<=a.length)return{text:r,empty:!0};let c=r.slice(a.length,i),d=r.slice(i),u=St(c),m=(u===-1?c:c.slice(0,u)).trim(),b=c[0]==="{"||c[0]==="[";b?e.push(...yt(m)):ct.test(m)&&e.push(m);let O=ut(c).code;return{text:`${a}${b?`(${O})`:O}${d}`,empty:!1}}),s=[];for(;n.length&&n[n.length-1].empty;)s.unshift(n.pop().text);let o=n.map(r=>r.text).join(",")+s.join("");return o.trimStart().startsWith("(")&&(o=`;${o}`),{vars:e,code:o}},ut=t=>{let e=[],n="",s=0,o=0,r=!0;for(;s<t.length;){let i=t[s],a=t[s+1];if(i==="'"||i==='"'||i==="`"){let c=U(t,s);n+=t.slice(s,c),s=c,r=!1;continue}if(i==="/"&&(a==="/"||a==="*")){let c=a==="/"?D(t,s):q(t,s);n+=t.slice(s,c),s=c;continue}if(i==="/"&&F(t,s)){let c=I(t,s);n+=t.slice(s,c),s=c,r=!1;continue}if(i==="i"&&(s===0||!/[\w$.]/.test(t[s-1]))&&(at.lastIndex=s,at.test(t))){n+="$__import",s+=6,r=!1;continue}if(o===0&&r){Ft.lastIndex=s;let c=Ft.exec(t);if(c){let u=s+c[0].length,m=Ht(t,u),{vars:b,code:O}=De(t.slice(u,m));e.push(...b),n+=O,s=m,r=!1;continue}It.lastIndex=s;let d=It.exec(t);if(d){Bt.lastIndex=s;let u=Bt.exec(t);u&&e.push(u[1]);let m=s+d[0].length,b=Ht(t,m);n+=`$__effect(() => { ${ut(t.slice(m,b)).code} });`,s=b;continue}}"([{".includes(i)?o++:")]}".includes(i)&&(o=Math.max(0,o-1)),i===`
5
+ `||i===";"||i==="}"?r=!0:/\s/.test(i)||(r=!1),n+=i,s++}return{vars:e,code:n}},lt=/export\s+default(?![\w$])/y,zt=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,qe=t=>{let e=[],n=0,s=0;for(let o=0;o<=t.length;o++){let r=t[o];if(r==="{")n++;else if(r==="}")n--;else if(o===t.length||r===","&&n===0){let i=t.slice(s,o).trim();i&&e.push(i),s=o+1}}return e},We=(t,e,n)=>{let s=`await $__import(${JSON.stringify(e)})`;if(t===void 0)return s;let o=qe(t),r=[],i=s;if(o.length>1){let a=`$__mod${n}`;r.push(`${a} = ${s}`),i=a}for(let a of o)a.startsWith("{")?r.push(`${a.replace(/\s+as\s+/g,": ")} = ${i}`):a.startsWith("*")?r.push(`${a.replace(/^\*\s*as\s+/,"")} = ${i}`):r.push(`${a} = $__default(${i})`);return`const ${r.join(", ")}`},ct=/^[A-Za-z_$][\w$]*$/,Zt=t=>{let e=0,n=0;for(;n<t.length;){let s=t[n];if(s==="'"||s==='"'||s==="`"){n=U(t,n);continue}if(s==="/"&&t[n+1]==="/"){n=D(t,n);continue}if(s==="/"&&t[n+1]==="*"){n=q(t,n);continue}if(s==="/"&&F(t,n)){n=I(t,n);continue}if("([{".includes(s))e++;else if(")]}".includes(s)&&--e===0)return n;n++}return t.length},bt=(t,e)=>{let n=0,s=0;for(;s<t.length;){let o=t[s];if(o==="'"||o==='"'||o==="`"){s=U(t,s);continue}if(o==="/"&&t[s+1]==="/"){s=D(t,s);continue}if(o==="/"&&t[s+1]==="*"){s=q(t,s);continue}if(o==="/"&&o!==e&&F(t,s)){s=I(t,s);continue}if("([{".includes(o))n++;else if(")]}".includes(o))n--;else if(n===0&&o===e)return s;s++}return-1},Et=t=>{let e=[],n=0,s=0,o=0;for(;o<=t.length;){let r=t[o];if(r==="'"||r==='"'||r==="`"){o=U(t,o);continue}if(r==="/"&&t[o+1]==="/"){o=D(t,o);continue}if(r==="/"&&t[o+1]==="*"){o=q(t,o);continue}if(r==="/"&&F(t,o)){o=I(t,o);continue}if(r!==void 0&&"([{".includes(r))n++;else if(r!==void 0&&")]}".includes(r))n--;else if(o===t.length||r===","&&n===0){let i=t.slice(s,o).trim();i&&e.push(i),s=o+1}o++}return e},St=t=>{let e=0;for(;e<t.length;){let n=bt(t.slice(e),"=");if(n===-1)return-1;let s=e+n;if(t[s+1]!=="="&&t[s+1]!==">"&&t[s-1]!=="="&&t[s-1]!=="!")return s;e=s+1}return-1},K=t=>{let e=(t??"").trim();if(!e.startsWith("{"))return null;let n=Zt(e);if(n>=e.length)return null;let s=[];for(let o of Et(e.slice(1,n))){if(o.startsWith("..."))continue;let r=St(o),i=r===-1?o:o.slice(0,r),a=r===-1?void 0:o.slice(r+1).trim(),c=bt(i,":"),d=(c===-1?i:i.slice(0,c)).trim();if(!ct.test(d))continue;let u={name:d};a!==void 0&&(u.default=a);let m=c===-1?"":i.slice(c+1).trim();ct.test(m)&&(u.as=m),s.push(u)}return s},ke=t=>{let e=0,n=0,s=!0;for(;e<t.length;){let o=t[e];if(o==="'"||o==='"'||o==="`"){e=U(t,e),s=!1;continue}if(o==="/"&&t[e+1]==="/"){e=D(t,e);continue}if(o==="/"&&t[e+1]==="*"){e=q(t,e);continue}if(o==="/"&&F(t,e)){e=I(t,e),s=!1;continue}if(o==="e"&&n===0&&s&&(e===0||!/[\w$.]/.test(t[e-1]))){lt.lastIndex=e;let r=lt.exec(t);if(r)return e+r[0].length}"([{".includes(o)?n++:")]}".includes(o)&&(n=Math.max(0,n-1)),o===`
6
+ `||o===";"||o==="}"?s=!0:/\s/.test(o)||(s=!1),e++}return-1},Ue=/^async(?![\w$])/,Fe=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,Ie=t=>{let e=ke(t);if(e===-1)return null;let n=it(t,e),s=t.slice(n);Ue.test(s)&&(n=it(t,n+5));let o=Fe.exec(t.slice(n));if(o&&(n=it(t,n+o[0].length)),t[n]!=="(")return null;let r=0,i=n;for(;i<t.length;){let a=t[i];if(a==="'"||a==='"'||a==="`"){i=U(t,i);continue}if(a==="/"&&t[i+1]==="/"){i=D(t,i);continue}if(a==="/"&&t[i+1]==="*"){i=q(t,i);continue}if(a==="/"&&F(t,i)){i=I(t,i);continue}if("([{".includes(a))r++;else if(")]}".includes(a)&&--r===0)break;i++}return Et(t.slice(n+1,i))[0]??""},ft=t=>{let e=Ie(t);if(e===null)return null;let n=K(e),s=n?.find(o=>o.name.startsWith("$"))?.name;if(s)throw new Error(`jq79: the factory signature is (props, ctx), so \`${s}\` can't be destructured from the first parameter. Write \`export default (props, { ${s} }) => \u2026\`, or \`_\` in place of props if the component takes none.`);return n},Gt=t=>{let e="",n=0,s=0,o=!0,r=!1,i=0;for(;n<t.length;){let a=t[n],c=t[n+1],d=n===0||!/[\w$.]/.test(t[n-1]);if(a==="'"||a==='"'||a==="`"){let u=U(t,n);e+=t.slice(n,u),n=u,o=!1;continue}if(a==="/"&&(c==="/"||c==="*")){let u=c==="/"?D(t,n):q(t,n);e+=t.slice(n,u),n=u;continue}if(a==="/"&&F(t,n)){let u=I(t,n);e+=t.slice(n,u),n=u,o=!1;continue}if(a==="i"&&d){if(at.lastIndex=n,at.test(t)){e+="$__import",n+=6,o=!1;continue}if(s===0&&o){zt.lastIndex=n;let u=zt.exec(t);if(u){e+=We(u[1],u[3],i++),n+=u[0].length,o=!1;continue}}}if(a==="e"&&d&&s===0&&o){lt.lastIndex=n;let u=lt.exec(t);if(u){r=!0,e+="$__exports.default =",n+=u[0].length,o=!1;continue}}"([{".includes(a)?s++:")]}".includes(a)&&(s=Math.max(0,s-1)),a===`
7
+ `||a===";"||a==="}"?o=!0:/\s/.test(a)||(o=!1),e+=a,n++}return r?e:null};var Be="0.5.0",se=t=>Object.fromEntries(Array.from(t.attributes).map(e=>[e.name,e.value])),oe=t=>({tag:t.tagName.toLowerCase(),attrs:se(t),children:Array.from((t instanceof HTMLTemplateElement?t.content:t).childNodes).flatMap(e=>{if(e.nodeType===Node.TEXT_NODE){let n=e.textContent??"";return n?[n]:[]}return e.nodeType===Node.ELEMENT_NODE?[oe(e)]:[]})}),Kt=new Map,re=(t,e)=>{let n=`${e.join(",")}|${t}`,s=Kt.get(n);if(s===void 0){try{s=new Function("$scope",...e,`with ($scope) { return (${t}
8
+ ); }`)}catch{s=null}Kt.set(n,s)}return s},_=(t,e,n)=>{let s=re(t,n?Object.keys(n):[]);if(s)try{return s(e,...n?Object.values(n):[])}catch{return}},He=(t,e)=>t.replace(/{{\s*([\s\S]+?)\s*}}/g,(n,s)=>_(s,e)??""),ze=new Set([":attrs",":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":with",":text",":html",":html.allowed",":props"]),xt=t=>ze.has(t)||t.startsWith(":class.")||t.startsWith(":props.")||t===":slot"||t.startsWith(":slot."),Ze=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,Ge=(t,e,n,s)=>{let[o,...r]=e.slice(1).split("."),i=new Set(r);t.addEventListener(o,a=>{if(i.has("self")&&a.target!==t)return;i.has("prevent")&&a.preventDefault(),i.has("stop")&&a.stopPropagation();let c=_(n,s,{$event:a});typeof c=="function"&&c.call(t,a)},{once:i.has("once"),capture:i.has("capture")})},Ke=(t,e,n,s)=>{let[o,...r]=e.slice(1).split("."),i=new Set(r),a=c=>{i.has("prevent")&&c.preventDefault(),i.has("stop")&&c.stopPropagation(),i.has("once")&&t.off(o,a),X(()=>{let d=_(n,s,{$event:c});typeof d=="function"&&d(c)})};t.on(o,a)},H=t=>t.replace(/-(\w)/g,(e,n)=>n.toUpperCase()),Rt=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),Ct=t=>t instanceof DocumentFragment?{first:t.firstChild,last:t.lastChild}:{first:t,last:t},dt=({first:t,last:e})=>{for(let n=t;n;){let s=n===e?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},Ve=({first:t,last:e},n)=>{let s=n.nextSibling;for(let o=t;o;){let r=o===e?null:o.nextSibling;n.parentNode.insertBefore(o,s),o=r}},Vt=(t,e)=>{let n=e.replace(/-/g,"").toLowerCase();for(let s=t;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let o of Object.keys(s))if(/^[A-Z]/.test(o)&&o.replace(/-/g,"").toLowerCase()===n)return o;return null},Jt=200,wt=0,ie=Symbol("jq79.slots"),Je=t=>t==="slot"||t.startsWith("slot."),ae=t=>t?H(t):"default",_t=t=>Object.keys(t.attrs).find(e=>e===":slot"||e.startsWith(":slot.")),Xe=t=>t==="default"?":slot":`:slot.${t}`,Qe=t=>typeof t!="string"||t.trim()!=="",Ye=t=>{let e={},n=[];t.children.forEach(o=>{let r=typeof o=="object"&&o.tag==="template"?_t(o):void 0;if(typeof o=="string"||r===void 0){n.push(o);return}let i=ae(r.slice(6));if(i in e){console.warn(`jq79: two <template ${Xe(i)}> in <${t.tag}>; the second was ignored`);return}e[i]={nodes:o.children,binder:o.attrs[r]||void 0}});let s=n.some(Qe);return s&&"default"in e?console.warn(`jq79: <${t.tag}> has both a <template :slot> and content outside it - the <template> is the default slot's content, and the rest was ignored`):s&&(e.default={nodes:n,binder:t.attrs[":slot"]||void 0}),e},tn=(t,e,n)=>{K(e)?.forEach(({name:s,as:o,default:r})=>{let i=o??s;Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>{let a=n[s]?.();return a===void 0&&r!==void 0?_(r,t):a},set:()=>console.warn(`jq79: "${i}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},en=t=>{let e=_t(t);return console.warn(`jq79: <template ${e}> fills a slot only as a direct child of a component tag; here it rendered nothing`),document.createComment(`misplaced ${e}`)},nn=(t,e)=>{let n=Object.entries(Ye(t));if(!n.length)return null;let s={};return n.forEach(([o,r])=>{s[o]=sn(r,e)}),s},sn=(t,e)=>(n,s,o,r)=>{let i=Object.create(e);tn(i,t.binder,n);let a=i[rt]??[];Object.defineProperty(i,rt,{value:[...a,s]});let c=B(i);return o.onDispose(()=>c.dispose()),V(t.nodes,i,c,r)},on=(t,e,n,s)=>{let o=ae(t.tag.slice(5)),r=document.createDocumentFragment(),i=document.createComment(t.tag),a=document.createComment(`/${t.tag}`);r.append(i,a);let c=e[ie]?.[o];if(!c)return r.insertBefore(V(t.children,e,n,s),a),r;let d={};return Object.entries(t.attrs).forEach(([u,m])=>{if(!(u===gt||xt(u)||u.startsWith("@")))if(u.startsWith(":")){let b=m||u.slice(1);d[H(u.slice(1))]=()=>_(b,e)}else d[H(u)]=()=>m}),r.insertBefore(c(d,e,n,s),a),r},Xt=(t,e,n,s,o)=>{let r=document.createComment(t),i=document.createComment(`/${t}`),a=document.createDocumentFragment();a.append(r,i);let c=nn(e,n),d={},u={},m=[],b=[],O=!1;Object.entries(e.attrs).forEach(([f,l])=>{if(f!==gt){if(f===":props"||f.startsWith(":props.")){O=!0,b.push({expr:l});return}if(!xt(f))if(f.startsWith("@"))m.push([f,l]);else if(f===":model"||f.startsWith(":model.")){let p=f===":model"?"default":H(f.slice(7));u[p]=l||(f===":model"?"model":p)}else if(f.startsWith(":")){let p=H(f.slice(1));d[p]=l||p,b.push({name:p,expr:l||p})}else{let p=H(f),g=JSON.stringify(l);d[p]=g,b.push({name:p,expr:g})}}});let x=f=>f==="default"?":model":`:model.${f}`,y=f=>f==="default"?"model":f,$=f=>`${f}
9
+ = $value`,T=new Set;Object.entries(u).forEach(([f,l])=>{let p=y(f);d[p]!==void 0&&console.warn(`jq79: <${e.tag}> binds prop "${p}" through both :${p} and ${x(f)} - ${x(f)} wins`),d[p]=l,re($(l),["$value"])===null&&(T.add(f),console.warn(`jq79: ${x(f)}="${l}" is not assignable - updates from <${e.tag}> will be dropped`))});let j=()=>{let f={};return b.forEach(({name:l,expr:p})=>{if(l!==void 0)f[l]=_(p,n);else{let g=_(p,n);g!==null&&typeof g=="object"&&Object.assign(f,g)}}),Object.entries(u).forEach(([l,p])=>{f[y(l)]=_(p,n)}),f},h=null,E=null,R=null,S=new Set,N=f=>{if(f==null){if(!n[de]?.has(t)||S.has("unfilled"))return;S.add("unfilled"),console.error(`jq79: <${e.tag}> is declared as a prop and the parent passed nothing - nothing renders here. Pass it (:${t}="\u2026"), or drop it from the signature to use the one declared in this file.`);return}S.has("type")||(S.add("type"),console.error(`jq79: <${e.tag}> is ${typeof f}, not a component - nothing renders here`))};return s.effect(()=>{let f=_(t,n),l=f instanceof W?f:null;if(l||N(f),l===E||(R?.dispose(),R=null,h?.destroy(),h=null,E=l,!l))return;let p=new W({template:l.template,scripts:l.scripts,styles:l.styles,modules:l.modules,filename:l.filename,siblings:l.siblings,name:l.name});if(c&&(p.slots=c),Object.keys(u).length){let L=new Set;p.modelWriteback=(v,k)=>{let M=v==null?"default":H(String(v)),Ot=u[M];return Ot===void 0?(L.has(M)||(L.add(M),console.warn(`jq79: <${e.tag}> has no ${x(M)} - bound: ${Object.keys(u).map(x).join(", ")}`)),!1):T.has(M)?!1:(X(()=>_($(Ot),n,{$value:k})),!0)}}m.forEach(([L,v])=>Ke(p,L,v,n));let g=Nn(p.scripts),C=ee(X(j),g),w=document.createDocumentFragment();if(wt>=Jt){console.error(`jq79: <${e.tag}> is ${Jt} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}wt++;try{(o?p.renderShadow(C):p.render(C)).mount(w)}finally{wt--}i.parentNode.insertBefore(w,i);let P=B(n);if(O){let L=[];P.effect(()=>{let v=ee(j(),g),k=Object.keys(v);L.forEach(M=>{M in v||(p.data[M]=void 0)}),k.forEach(M=>{p.data[M]=v[M]}),L=k})}else Object.entries(d).forEach(([L,v])=>{g!==null&&!g.has(L)||P.effect(()=>{p.data[L]=_(v,n)})});R=P,h=p}),s.onDispose(()=>{R?.dispose(),h?.destroy()}),a},rn=(t,e)=>{let n=()=>{let s=_(t,e);return s!==null&&typeof s=="object"?s:null};return new Proxy(e,{has(s,o){let r=n();return r!==null&&Reflect.has(r,o)||Reflect.has(s,o)},get(s,o){let r=n();return r!==null&&Reflect.has(r,o)?r[o]:Reflect.get(s,o)},set(s,o,r){let i=n();return i!==null&&Reflect.has(i,o)?(i[o]=r,!0):Reflect.set(s,o,r)}})},tt=t=>typeof t=="string"?t.split(/\s+/).filter(Boolean):Array.isArray(t)?t.flatMap(tt):t!==null&&typeof t=="object"?Object.entries(t).flatMap(([e,n])=>n?tt(e):[]):[],an=t=>typeof t=="function"?(e,n,s)=>{try{return!!t(e,n,s)}catch{return!1}}:typeof t=="string"||Array.isArray(t)?Pt(t):()=>!1,At=(t,e,n,s)=>{let o=t.attrs[":with"],r=o!==void 0?rn(o,e):e;if(Je(t.tag))return on(t,r,n,s);if(t.tag==="template"&&_t(t)!==void 0)return en(t);let i=Vt(r,t.tag);if(i)return Xt(i,t,r,n,s);let a=document.createElement(t.tag);if(a instanceof HTMLUnknownElement||t.tag.includes("-")){let y=!1;n.effect(()=>{if(y)return;let $=Vt(r,t.tag);if(!$)return;y=!0;let T=Xt($,t,r,n,s),j=Ct(T);n.onDispose(()=>dt(j)),a.replaceWith(T)})}Object.entries(t.attrs).forEach(([y,$])=>{y.startsWith("@")?Ge(a,y,$,r):y===":model"||y.startsWith(":model.")?a instanceof HTMLUnknownElement||t.tag.includes("-")||console.warn(`jq79: ${y} on <${t.tag}> does nothing - :model binds component tags only (for now)`):xt(y)||a.setAttribute(y,$)});let c=t.attrs[":attrs"];if(c!==void 0){let y=[];n.effect(()=>{y.forEach(T=>a.removeAttribute(T));let $=_(c,r);y=$&&typeof $=="object"?Object.keys($):[],y.forEach(T=>{let j=$[T];j!=null&&j!==!1&&a.setAttribute(T,String(j))})})}let d=t.attrs[":class"],u=Object.entries(t.attrs).filter(([y])=>y.startsWith(":class.")).map(([y,$])=>[y.slice(7),$]);if(d!==void 0||u.length){let y=new Set(tt(t.attrs.class??"")),$=[];n.effect(()=>{let T=d!==void 0?tt(_(d,r)):[];u.forEach(([j,h])=>{_(h,r)&&T.push(...tt(j))}),$.forEach(j=>{!T.includes(j)&&!y.has(j)&&a.classList.remove(j)}),a.classList.add(...T),$=T})}let m=t.attrs[":text"],b=t.attrs[":html"],O=t.attrs[":html.allowed"];O!==void 0&&b===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),m!==void 0?n.effect(()=>{a.textContent=String(_(m,r)??"")}):b!==void 0?n.effect(()=>{let y=O!==void 0?{allowUrl:an(_(O,r))}:void 0;a.innerHTML=Dt(String(_(b,r)??""),y)}):a instanceof HTMLTemplateElement?a.content.appendChild(V(t.children,r,n,s)):a.appendChild(V(t.children,r,n,s));let x=t.attrs[":value"];return x!==void 0&&n.effect(()=>{let y=String(_(x,r)??"");a.value!==y&&(a.value=y)}),[":checked",":selected"].forEach(y=>{let $=t.attrs[y];if($===void 0)return;let T=y.slice(1);n.effect(()=>{a[T]=!!_($,r)})}),a},ln=(t,e,n,s)=>{let o=document.createComment("if"),r=document.createDocumentFragment();r.appendChild(o);let i=null,a=null,c=null;return n.effect(()=>{let d=t.find(m=>m.expr===void 0||_(m.expr,e))??null;if(d===a||(c?.dispose(),i&&dt(i),i=null,a=d,!d))return;c=B(e);let u=At(d.node,e,c,s);i=Ct(u),o.parentNode.insertBefore(u,o.nextSibling)}),r},Y=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})},cn=t=>{if(t===null||typeof t!="object"||Array.isArray(t))return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null},un=(t,e,n,s)=>{let o=t.attrs[":each"].match(Ze);if(!o)return document.createComment(`invalid :each expression "${t.attrs[":each"]}"`);let[,r,i,a]=o,c=t.attrs[":key"],{[":each"]:d,[":key"]:u,...m}=t.attrs,b={...t,attrs:m},O=document.createComment("each"),x=document.createDocumentFragment();x.appendChild(O),(":if"in t.attrs||":elseif"in t.attrs||":else"in t.attrs)&&console.warn("jq79: :if/:elseif/:else on a :each element is ignored; filter the list expression instead");let y=[],$=!1;return n.effect(()=>{let T=_(a,e),j=Array.isArray(T)?T.map((f,l)=>[l,f]):cn(T)?Object.entries(T):[],h=new Map;y.forEach(f=>{let l=h.get(f.key);l?l.push(f):h.set(f.key,[f])});let E=new Set,R=[],S=j.map(([f,l],p)=>{let g=Object.create(e);Y(g,r,l),i&&Y(g,i,f),Y(g,"$index",p);let C=c!==void 0?_(c,g):f;E.has(C)&&!$&&($=!0,console.warn(`jq79: duplicate :key in :each "${t.attrs[":each"]}"; duplicates pair up by position`)),E.add(C);let w=h.get(C)?.shift();if(w&&Object.is(w.item,l))return w.scope.$index!==p&&R.push(w),Y(w.scope,"$index",p),i&&Y(w.scope,i,f),w;w&&(w.fx.dispose(),dt(w.range));let P=B(e),L=Ct(At(b,g,P,s));return{key:C,item:l,scope:g,fx:P,range:L}});h.forEach(f=>f.forEach(l=>{l.fx.dispose(),dt(l.range)}));let N=O;S.forEach(f=>{N.nextSibling!==f.range.first&&Ve(f.range,N),N=f.range.last}),R.forEach(f=>X(()=>f.fx.refresh())),y=S}),x},V=(t,e,n,s=!1)=>{let o=document.createDocumentFragment(),r=0;for(;r<t.length;){let i=t[r];if(typeof i=="string"){let a=document.createTextNode(i);i.includes("{{")&&n.effect(()=>{a.textContent=He(i,e)}),o.appendChild(a),r++;continue}if(":each"in i.attrs){o.appendChild(un(i,e,n,s)),r++;continue}if(":if"in i.attrs){let a=[{expr:i.attrs[":if"],node:i}];r++;let c=u=>{let m=r;for(;m<t.length&&typeof t[m]=="string"&&!t[m].trim();)m++;let b=t[m];if(typeof b=="object"&&u in b.attrs)return r=m+1,b};for(let u=c(":elseif");u;u=c(":elseif"))a.push({expr:u.attrs[":elseif"],node:u});let d=c(":else");d&&a.push({node:d}),o.appendChild(ln(a,e,n,s));continue}o.appendChild(At(i,e,n,s)),r++}return o},fn=(t,e,n=!1)=>V(t.template,e,B(e),n),dn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),pn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,jt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,hn=t=>t.split(jt).map((e,n)=>n%2===1?e:e.replace(pn,(s,o,r)=>dn.has(o.toLowerCase())?s:`<${o}${r}></${o}>`)).join(""),le=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,gn=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,mn=t=>t.split(jt).map((e,n)=>n%2===1?e:e.replace(le,(s,o,r)=>{let i=0,a=r.replace(gn,(c,d,u)=>u===void 0?c:`${d}:props.${i++}="${u}"`);return`<${o}${a}>`})).join(""),yn=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,bn=/<\/slot\.([\w.$-]+)(\s*)>/gi,En=/^slot\./i,Sn=t=>En.test(t)?`slot.${Rt(t.slice(5))}`:t,wn=t=>t.split(jt).map((e,n)=>n%2===1?e:e.replace(le,(s,o,r)=>{let i=r.replace(yn,(a,c,d)=>d===void 0?a:`${c}${Rt(d)}`);return`<${Sn(o)}${i}>`}).replace(bn,(s,o,r)=>`</slot.${Rt(o)}${r}>`)).join(""),gt="data-jq79",Rn=t=>{let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return(e>>>0).toString(36)},ce=(t,e)=>{t.forEach(n=>{typeof n!="string"&&(n.attrs[gt]=e,ce(n.children,e))})},$n=(t,e)=>t.split(",").map(n=>{let s=n.trim(),o=s.indexOf("::"),r=o===-1?s:s.slice(0,o),i=o===-1?"":s.slice(o);return`${r}[${gt}="${e}"]${i}`}).join(", "),ue=(t,e)=>{Array.from(t).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=$n(n.selectorText,e):n instanceof CSSGroupingRule&&ue(n.cssRules,e)})},Tn=(t,e)=>{/:deep\(|::v-deep|>>>/.test(t)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let n=new CSSStyleSheet;return n.replaceSync(t),ue(n.cssRules,e),Array.from(n.cssRules).map(s=>s.cssText).join(`
10
+ `)},xn=/^[A-Z][A-Za-z0-9]*$/,$t=t=>{let e=hn(mn(wn(t))),s=new DOMParser().parseFromString(`<template>${e}</template>`,"text/html").querySelector("template"),o=[],r=[];Array.from(s.content.children).forEach(c=>{c.tagName==="TEMPLATE"?r.push(c):o.push(c)});let i=Qt(o,t),a={};return r.forEach(c=>{let d=c.getAttribute("name");if(d===null){console.warn("jq79: a top-level <template> without a name declares nothing and was ignored");return}if(!xn.test(d)){console.warn(`jq79: <template name="${d}"> was ignored - a component name has to be PascalCase, or no tag could ever reference it (only capitalized names resolve as components)`);return}if(d in a){console.warn(`jq79: two <template name="${d}"> in one file; the second was ignored`);return}a[d]=new W({...Qt(Array.from(c.content.children),c.innerHTML),siblings:a,name:d})}),Object.keys(a).length&&(i.siblings=a),i},Qt=(t,e)=>{let n=[],s=[],o=[];t.forEach(i=>{let a={attrs:se(i),content:i.textContent??""};i.tagName==="SCRIPT"?n.push(a):i.tagName==="STYLE"?s.push(a):o.push(oe(i))}),s.forEach(i=>{"lang"in i.attrs&&console.warn(`jq79: <style lang="${i.attrs.lang}"> needs the jq79/vite plugin to compile it. This component didn't go through the bundler, so its styles were left uncompiled and the browser will ignore them.`)});let r=i=>"scoped"in i.attrs&&!("lang"in i.attrs);if(s.some(r)){let i=Rn(e);ce(o,i),s.forEach(a=>{r(a)&&(a.scoped=Tn(a.content,i))})}return{template:o,scripts:n,styles:s}},Nt=t=>/\.html?([?#]|$)/.test(t)?Tt(t):import(t),fe=(t,e)=>t?`
11
+ //# sourceURL=${t}?jq79-script=${e}`:"",Yt=t=>t.scoped??t.content,pt=new Map,Cn=t=>{let e=pt.get(t);if(!e){let n=document.createElement("style");n.textContent=t,document.head.appendChild(n),e={el:n,count:0},pt.set(t,e)}e.count++},_n=t=>{let e=pt.get(t);e&&--e.count<=0&&(e.el.remove(),pt.delete(t))},An=(t,e,n,s={},o=Nt,r={})=>{let i={...ge,...s},a=new Proxy(e,{has:(d,u)=>u!=="$__effect"&&u!=="$__import"&&(Reflect.has(d,u)||!(u in globalThis)&&!(u in i))});new Function("$scope","$__effect","$__import",...Object.keys(i),`return (async () => { with ($scope) { ${t} } })()${fe(r.filename,r.index??0)}`)(a,n,o,...Object.values(i)).catch(d=>console.error("jq79: error in :setup script",d))},te=(t,e)=>{e?.forEach(({name:n,default:s})=>{t[n]===void 0&&(t[n]=s===void 0?void 0:_(s,t))})},jn=t=>{let e=new Set;return t.forEach(n=>{(ft(n.content)??K(n.attrs[":setup"]))?.forEach(({name:o})=>e.add(o))}),e},Nn=t=>{let e=null;return t.forEach(n=>{let s=ft(n.content)??K(n.attrs[":setup"]);if(!s)return;let o=e??(e=new Set);s.forEach(({name:r})=>o.add(r))}),e},ee=(t,e)=>{if(e===null)return t;let n={};return Object.keys(t).forEach(s=>{e.has(s)&&(n[s]=t[s])}),n},On=(t,e)=>{if(!t)return null;let n=Object.create(null),s=!1;return Object.entries(t).forEach(([o,r])=>{e.has(o)||(n[o]=r,s=!0)}),s?n:null},de=Symbol("jq79.unfilledProps"),Ln=t=>t&&t.default!==void 0?t.default:t,vn=(t,e,n,s={},o=Nt,r={})=>{let i={...ge,...s},a={},c=new Function("$__exports","$__default","$__import",...Object.keys(i),`return (async () => { "use strict";
12
12
  ${t}
13
- ;$__exports.done = true })()${fe(o.filename,o.index??0)}`)(l,Ln,r,...Object.values(i)),p=b=>console.error("jq79: error in factory script",b),d=!1,g=()=>{if(d)return;d=!0;let b=l.default;if(typeof b!="function")return;let O=x=>{x&&typeof x=="object"&&Object.assign(e,x)};try{let x=b(e,{$data:e,$props:e,$effect:n,...s});x instanceof Promise?x.then(O).catch(p):O(x)}catch(x){p(x)}};u.then(g,p),l.done&&g()},Pn="__JQ79_HMR_ENABLED__",Mn="__JQ79_HMR__",B=null,Dn=t=>{if(!B||!t.filename)return;let e=B.get(t.filename);e||B.set(t.filename,e=new Set),e.add(new WeakRef(t))},ne=t=>{try{return new URL(t,document.baseURI).pathname}catch{return t}},pe=(t,e)=>{if(!B)return 0;let n=ne(t),s=$t(e),r=!1,o=l=>l.name===void 0?s:s.siblings?.[l.name]??null,i=0;for(let[l,u]of B)if(ne(l)===n){for(let p of u){let d=p.deref();if(!d){u.delete(p);continue}let g=o(d);if(!g){r=!0;continue}d.hotReplace(g)&&i++}u.size||B.delete(l)}return r?0:i},he=()=>{B??(B=new Map),globalThis[Mn]={update:pe}},Tt=async t=>{let e=await fetch(t);if(!e.ok)throw new Error(`failed to fetch component from ${t}: ${e.status}`);return new q(await e.text(),{filename:t})},q=class{constructor(e,n={}){N(this,"template");N(this,"scripts");N(this,"styles");N(this,"modules");N(this,"filename");N(this,"siblings");N(this,"name");N(this,"slots");N(this,"data",null);N(this,"fx",null);N(this,"content",null);N(this,"startMarker",null);N(this,"endMarker",null);N(this,"styleEls",[]);N(this,"ownsSharedStyles",!1);N(this,"useShadow",!1);N(this,"mountRoot",null);N(this,"resolveMounted",null);N(this,"emitListeners",new Map);let s=typeof e=="string"?$t(e):e;this.template=s.template,this.scripts=s.scripts,this.styles=s.styles,this.modules=n.modules??(typeof e=="string"?void 0:e.modules),this.filename=n.filename??(typeof e=="string"?void 0:e.filename),this.siblings=s.siblings,this.name=s.name,this.adoptSiblings(),Dn(this)}adoptSiblings(){this.siblings&&Object.entries(this.siblings).forEach(([e,n])=>{n.filename??(n.filename=this.filename),n.modules??(n.modules=this.modules),this.name||(this[e]=n)})}hotReplace(e){let n=typeof e=="string"?$t(e):e,s=this.startMarker,r=!!(s&&this.content),o=r&&s.isConnected,i=o?s.parentNode:null,l=o?this.endMarker.nextSibling:null,u={...this.data},p=this.useShadow;return r&&this.destroy(),this.template=n.template,this.scripts=n.scripts,this.styles=n.styles,this.siblings=n.siblings,this.adoptSiblings(),!r||(this.renderWith(u,p),!i)?!1:(p&&this.styleEls.forEach(d=>i.insertBefore(d,l)),i.insertBefore(this.content,l),this.mountRoot=i,this.resolveMounted?.(),!0)}static fetch(e){if(Array.isArray(e))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new pt(Tt(e))}static fetchAll(e){return Promise.all(e.map(Tt))}on(e,n){return this.emitListeners.has(e)||this.emitListeners.set(e,new Set),this.emitListeners.get(e).add(n),this}off(e,n){return this.emitListeners.get(e)?.delete(n),this}render(e={}){return this.renderWith(e,!1)}renderShadow(e={}){return this.renderWith(e,!0)}renderWith(e,n){this.destroy();let s=jn(this.scripts),r=On(this.siblings,s),o=r?Object.assign(Object.create(r),e):{...e},i=new Set([...s].filter(c=>!(c in e)));i.size&&Object.defineProperty(o,de,{value:i}),this.slots&&Object.defineProperty(o,ie,{value:this.slots});let l=X(o),u=I(l);this.data=l,this.fx=u,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let p=this.startMarker,d=(c,f)=>{let a=new CustomEvent(c,{detail:f,bubbles:!0,composed:!0,cancelable:!0});return p===this.startMarker&&this.emitListeners.get(c)?.forEach(w=>w(a,f)),a.cancelBubble||p.dispatchEvent(a),!a.defaultPrevented},g,b=new Promise(c=>{g=c});this.resolveMounted=g;let O=()=>b,x=this.endMarker,y=c=>{let f=[];for(let a=p.nextSibling;a&&a!==x;a=a.nextSibling)a instanceof Element&&(a.matches(c)&&f.push(a),f.push(...Array.from(a.querySelectorAll(c))));return f},R=c=>y(c)[0]??null,$=this.modules,_=c=>$&&c in $?Promise.resolve($[c]):Nt(c),h=Object.assign(Object.create(null),{$emit:d,$slots:Object.fromEntries(Object.keys(this.slots??{}).map(c=>[c,!0]))}),m=c=>`await $mounted();${c}`;this.scripts.forEach((c,f)=>{let a={$mounted:O,$self:R,$$self:y,...h,...r},w={filename:this.filename,index:f},A=Gt(c.content);if(A!==null){te(l,ut(c.content));let L=":mounted"in c.attrs?m(A):A;vn(L,l,u.effect,a,_,w);return}let{vars:j,code:E}=ct(c.content);te(l,G(c.attrs[":setup"])),j.forEach(L=>{L in l||(l[L]=void 0)});let v=":mounted"in c.attrs?m(E):E;An(v,l,u.effect,a,_,w)});let T=document.createDocumentFragment(),S=new Proxy(l,{has:(c,f)=>typeof f=="string"&&f in h||Reflect.has(c,f),get:(c,f,a)=>typeof f=="string"&&f in h&&!Reflect.has(c,f)?h[f]:Reflect.get(c,f,a)});return T.append(this.startMarker,K(this.template,S,u,n),this.endMarker),this.content=T,n?this.styleEls=this.styles.map(c=>{let f=document.createElement("style");return f.textContent=c.content,f}):(this.styles.forEach(c=>Cn(Yt(c))),this.ownsSharedStyles=!0),this}mount(e,n){let s=typeof e=="string"?z(e):e;if(!s)throw new Error(`mount target not found: ${e}`);return(!this.content||n!==void 0)&&this.renderWith(n??{},this.useShadow),this.attach(s)}mountShadow(e,n){let s=typeof e=="string"?z(e):e;if(!s)throw new Error(`mount target not found: ${e}`);return(!this.content||n!==void 0||!this.useShadow)&&this.renderWith(n??{},!0),this.attach(s)}attach(e){this.mountRoot&&this.detach();let n=this.useShadow&&e instanceof Element?e.shadowRoot??e.attachShadow({mode:"open"}):e;return this.useShadow&&this.styleEls.forEach(s=>n.appendChild(s)),n.appendChild(this.content),this.mountRoot=n,this.resolveMounted?.(),this}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;let e=this.startMarker;for(;e;){let n=e.nextSibling;if(this.content.appendChild(e),e===this.endMarker)break;e=n}return this.mountRoot=null,this}destroy(){return this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(e=>e.parentNode?.removeChild(e)),this.styleEls=[],this.ownsSharedStyles&&(this.styles.forEach(e=>_n(Yt(e))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.data=null,this.resolveMounted=null,this}};N(q,"version",Be);var pt=class{constructor(e){N(this,"chain");this.chain=e}queue(e){return this.chain=this.chain.then(n=>(e(n),n)),this}then(e,n){return this.chain.then(e,n)}catch(e){return this.chain.catch(e)}finally(e){return this.chain.finally(e)}mount(e,n){return this.queue(s=>s.mount(e,n))}mountShadow(e,n){return this.queue(s=>s.mountShadow(e,n))}render(e={}){return this.queue(n=>n.render(e))}renderShadow(e={}){return this.queue(n=>n.renderShadow(e))}on(e,n){return this.queue(s=>s.on(e,n))}off(e,n){return this.queue(s=>s.off(e,n))}detach(){return this.queue(e=>e.detach())}destroy(){return this.queue(e=>e.destroy())}};var qn=t=>new q(t),ge={$:z,$$:et,$create:nt,$reactive:X,Component79:q};typeof globalThis<"u"&&globalThis[Pn]&&he();0&&(module.exports={$,$$,$create,$reactive,C79,Component79,PendingComponent79,enableHotReload,hotUpdate,parseComponent,renderComponent});
13
+ ;$__exports.done = true })()${fe(r.filename,r.index??0)}`)(a,Ln,o,...Object.values(i)),d=b=>console.error("jq79: error in factory script",b),u=!1,m=()=>{if(u)return;u=!0;let b=a.default;if(typeof b!="function")return;let O=x=>{x&&typeof x=="object"&&Object.assign(e,x)};try{let x=b(e,{$data:e,$props:e,$effect:n,...s});x instanceof Promise?x.then(O).catch(d):O(x)}catch(x){d(x)}};c.then(m,d),a.done&&m()},Pn="__JQ79_HMR_ENABLED__",Mn="__JQ79_HMR__",z=null,Dn=t=>{if(!z||!t.filename)return;let e=z.get(t.filename);e||z.set(t.filename,e=new Set),e.add(new WeakRef(t))},ne=t=>{try{return new URL(t,document.baseURI).pathname}catch{return t}},pe=(t,e)=>{if(!z)return 0;let n=ne(t),s=$t(e),o=!1,r=a=>a.name===void 0?s:s.siblings?.[a.name]??null,i=0;for(let[a,c]of z)if(ne(a)===n){for(let d of c){let u=d.deref();if(!u){c.delete(d);continue}let m=r(u);if(!m){o=!0;continue}u.hotReplace(m)&&i++}c.size||z.delete(a)}return o?0:i},he=()=>{z??(z=new Map),globalThis[Mn]={update:pe}},Tt=async t=>{let e=await fetch(t);if(!e.ok)throw new Error(`failed to fetch component from ${t}: ${e.status}`);return new W(await e.text(),{filename:t})},W=class{constructor(e,n={}){A(this,"template");A(this,"scripts");A(this,"styles");A(this,"modules");A(this,"filename");A(this,"siblings");A(this,"name");A(this,"slots");A(this,"modelWriteback");A(this,"data",null);A(this,"fx",null);A(this,"content",null);A(this,"startMarker",null);A(this,"endMarker",null);A(this,"styleEls",[]);A(this,"ownsSharedStyles",!1);A(this,"useShadow",!1);A(this,"mountRoot",null);A(this,"resolveMounted",null);A(this,"emitListeners",new Map);let s=typeof e=="string"?$t(e):e;this.template=s.template,this.scripts=s.scripts,this.styles=s.styles,this.modules=n.modules??(typeof e=="string"?void 0:e.modules),this.filename=n.filename??(typeof e=="string"?void 0:e.filename),this.siblings=s.siblings,this.name=s.name,this.adoptSiblings(),Dn(this)}adoptSiblings(){this.siblings&&Object.entries(this.siblings).forEach(([e,n])=>{n.filename??(n.filename=this.filename),n.modules??(n.modules=this.modules),this.name||(this[e]=n)})}hotReplace(e){let n=typeof e=="string"?$t(e):e,s=this.startMarker,o=!!(s&&this.content),r=o&&s.isConnected,i=r?s.parentNode:null,a=r?this.endMarker.nextSibling:null,c={...this.data},d=this.useShadow;return o&&this.destroy(),this.template=n.template,this.scripts=n.scripts,this.styles=n.styles,this.siblings=n.siblings,this.adoptSiblings(),!o||(this.renderWith(c,d),!i)?!1:(d&&this.styleEls.forEach(u=>i.insertBefore(u,a)),i.insertBefore(this.content,a),this.mountRoot=i,this.resolveMounted?.(),!0)}static fetch(e){if(Array.isArray(e))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new ht(Tt(e))}static fetchAll(e){return Promise.all(e.map(Tt))}on(e,n){return this.emitListeners.has(e)||this.emitListeners.set(e,new Set),this.emitListeners.get(e).add(n),this}off(e,n){return this.emitListeners.get(e)?.delete(n),this}render(e={}){return this.renderWith(e,!1)}renderShadow(e={}){return this.renderWith(e,!0)}renderWith(e,n){this.destroy();let s=jn(this.scripts),o=On(this.siblings,s),r=o?Object.assign(Object.create(o),e):{...e},i=new Set([...s].filter(l=>!(l in e)));i.size&&Object.defineProperty(r,de,{value:i}),this.slots&&Object.defineProperty(r,ie,{value:this.slots});let a=Q(r),c=B(a);this.data=a,this.fx=c,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let d=this.startMarker,u=!1,m=(l,p)=>{l==="model:update"&&!u&&(u=!0,console.warn("jq79: $emit('model:update', \u2026) no longer feeds :model - call $updateModel(value) or $updateModel(name, value) instead"));let g=new CustomEvent(l,{detail:p,bubbles:!0,composed:!0,cancelable:!0});return d===this.startMarker&&this.emitListeners.get(l)?.forEach(C=>C(g,p)),g.cancelBubble||d.dispatchEvent(g),!g.defaultPrevented},b,O=new Promise(l=>{b=l});this.resolveMounted=b;let x=()=>O,y=this.endMarker,$=l=>{let p=[];for(let g=d.nextSibling;g&&g!==y;g=g.nextSibling)g instanceof Element&&(g.matches(l)&&p.push(g),p.push(...Array.from(g.querySelectorAll(l))));return p},T=l=>$(l)[0]??null,j=this.modules,h=l=>j&&l in j?Promise.resolve(j[l]):Nt(l),R=Object.assign(Object.create(null),{$emit:m,$updateModel:(...l)=>{let[p,g]=l.length>1?l:[void 0,l[0]];return d!==this.startMarker?!1:this.modelWriteback?.(p,g)??!1},$slots:Object.fromEntries(Object.keys(this.slots??{}).map(l=>[l,!0]))}),S=l=>`await $mounted();${l}`;this.scripts.forEach((l,p)=>{let g={$mounted:x,$self:T,$$self:$,...R,...o},C={filename:this.filename,index:p},w=Gt(l.content);if(w!==null){te(a,ft(l.content));let k=":mounted"in l.attrs?S(w):w;vn(k,a,c.effect,g,h,C);return}let{vars:P,code:L}=ut(l.content);te(a,K(l.attrs[":setup"])),P.forEach(k=>{k in a||(a[k]=void 0)});let v=":mounted"in l.attrs?S(L):L;An(v,a,c.effect,g,h,C)});let N=document.createDocumentFragment(),f=new Proxy(a,{has:(l,p)=>typeof p=="string"&&p in R||Reflect.has(l,p),get:(l,p,g)=>typeof p=="string"&&p in R&&!Reflect.has(l,p)?R[p]:Reflect.get(l,p,g)});return N.append(this.startMarker,V(this.template,f,c,n),this.endMarker),this.content=N,n?this.styleEls=this.styles.map(l=>{let p=document.createElement("style");return p.textContent=l.content,p}):(this.styles.forEach(l=>Cn(Yt(l))),this.ownsSharedStyles=!0),this}mount(e,n){let s=typeof e=="string"?Z(e):e;if(!s)throw new Error(`mount target not found: ${e}`);return(!this.content||n!==void 0)&&this.renderWith(n??{},this.useShadow),this.attach(s)}mountShadow(e,n){let s=typeof e=="string"?Z(e):e;if(!s)throw new Error(`mount target not found: ${e}`);return(!this.content||n!==void 0||!this.useShadow)&&this.renderWith(n??{},!0),this.attach(s)}attach(e){this.mountRoot&&this.detach();let n=this.useShadow&&e instanceof Element?e.shadowRoot??e.attachShadow({mode:"open"}):e;return this.useShadow&&this.styleEls.forEach(s=>n.appendChild(s)),n.appendChild(this.content),this.mountRoot=n,this.resolveMounted?.(),this}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;let e=this.startMarker;for(;e;){let n=e.nextSibling;if(this.content.appendChild(e),e===this.endMarker)break;e=n}return this.mountRoot=null,this}destroy(){return this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(e=>e.parentNode?.removeChild(e)),this.styleEls=[],this.ownsSharedStyles&&(this.styles.forEach(e=>_n(Yt(e))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.data=null,this.resolveMounted=null,this}};A(W,"version",Be);var ht=class{constructor(e){A(this,"chain");this.chain=e}queue(e){return this.chain=this.chain.then(n=>(e(n),n)),this}then(e,n){return this.chain.then(e,n)}catch(e){return this.chain.catch(e)}finally(e){return this.chain.finally(e)}mount(e,n){return this.queue(s=>s.mount(e,n))}mountShadow(e,n){return this.queue(s=>s.mountShadow(e,n))}render(e={}){return this.queue(n=>n.render(e))}renderShadow(e={}){return this.queue(n=>n.renderShadow(e))}on(e,n){return this.queue(s=>s.on(e,n))}off(e,n){return this.queue(s=>s.off(e,n))}detach(){return this.queue(e=>e.detach())}destroy(){return this.queue(e=>e.destroy())}};var qn=t=>new W(t),ge={$:Z,$$:nt,$create:st,$reactive:Q,Component79:W};typeof globalThis<"u"&&globalThis[Pn]&&he();0&&(module.exports={$,$$,$create,$reactive,C79,Component79,PendingComponent79,enableHotReload,hotUpdate,parseComponent,renderComponent});
14
14
  //# sourceMappingURL=jq79.cjs.map