nuclo 0.2.6 → 0.2.7
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/README.md +48 -1
- package/dist/core/runtimeBootstrap.d.ts.map +1 -1
- package/dist/nuclo.cjs +1 -1
- package/dist/nuclo.cjs.map +1 -1
- package/dist/nuclo.mjs +1 -1
- package/dist/nuclo.mjs.map +1 -1
- package/dist/nuclo.umd.js +1 -1
- package/dist/nuclo.umd.js.map +1 -1
- package/dist/style/css.d.ts +52 -5
- package/dist/style/css.d.ts.map +1 -1
- package/dist/style/index.d.ts +1 -1
- package/dist/style/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/types/features/style.d.ts +25 -3
package/dist/nuclo.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function t(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function n(e){return typeof e==`object`&&!!e}function r(e){return n(e)&&`tagName`in e}function i(e){return typeof e==`boolean`}function a(e){return typeof e==`function`}function o(e){return a(e)&&e.length===0}function s(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}const c=typeof window<`u`&&typeof document<`u`,l=new WeakMap;function u(e,t){let n=l.get(e);n?n.push(t):l.set(e,[t])}function d(e,t){e.removeEventListener(t.type,t.wrapped,t.options)}function f(e,t){let n=l.get(e);if(!n)return;if(t===void 0){for(let t=0;t<n.length;t++)d(e,n[t]);l.delete(e);return}let r=0;for(let i=0;i<n.length;i++){let a=n[i];a.type===t?d(e,a):n[r++]=a}n.length=r,r===0&&l.delete(e)}function p(e,t,n){return function(r){if(!c||!r||typeof r.addEventListener!=`function`)return;let i=r,a=function(n){try{t.call(i,n)}catch(t){s(`Error in '${e}' listener`,t)}};i.addEventListener(e,a,n),u(i,{type:e,wrapped:a,options:n})}}const m=new Set,h=new WeakMap,g=new Set,_=new WeakMap,v=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{m.delete(e)}):null,y=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{g.delete(e)}):null;function ee(e,t){let n=h.get(e);if(n){n.info.resolver=t.resolver,n.info.lastValue=t.lastValue;return}let r=new WeakRef(e);m.add(r),h.set(e,{ref:r,info:t}),v?.register(e,r)}function te(e,t){let n=new WeakRef(e);g.add(n),_.set(e,{ref:n,info:t}),y?.register(e,n)}function ne(e){m.delete(e)}function re(e){g.delete(e)}function ie(e){let t=h.get(e);t&&(m.delete(t.ref),h.delete(e))}function ae(e){let t=_.get(e);t&&(g.delete(t.ref),_.delete(e))}const oe=new WeakMap,b=new Set,se=new WeakMap,ce=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{b.delete(e)}):null;function le(e,t){oe.set(e,t);let n=new WeakRef(e);b.add(n),se.set(e,n),ce?.register(e,n)}function ue(e){oe.delete(e);let t=se.get(e);t&&(b.delete(t),se.delete(e))}function de(){let e=[],t=[];for(let n of b){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)b.delete(e);return e}function fe(e){return oe.get(e)??null}const pe=`http://www.w3.org/2000/svg`;function me(e){return globalThis.document?document.createElement(e):null}function he(e,t){return globalThis.document?document.createElementNS(e,t):null}function x(e){return globalThis.document?document.createTextNode(e):null}function ge(){return globalThis.document?document.createDocumentFragment():null}function _e(e,t){try{return e.appendChild(t),!0}catch(e){return s(`Failed to append child node`,e),!1}}function ve(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;f(t),ae(t),ue(t)}else e.nodeType===Node.TEXT_NODE?ie(e):e.nodeType===Node.COMMENT_NODE&&ue(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)ve(e.childNodes[t])}function S(e){if(!e?.parentNode)return!1;try{return ve(e),e.parentNode.removeChild(e),!0}catch(e){return s(`Failed to remove child node`,e),!1}}function ye(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return s(`Failed to insert node before reference`,e),!1}}function C(e){return globalThis.document?globalThis.document.createComment(e):null}function be(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function xe(e,t){let n=C(`${e}-end`);if(!n)throw Error(`Failed to create comment: document not available`);let r=C(`${e}-start-${t}`);if(!r)throw Error(`Failed to create comment: document not available`);return{start:r,end:n}}function Se(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;S(n),n=e}}function Ce(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)ye(n,e[r],t)}function we(e,...t){if(!e)return e;for(let n=0;n<t.length;n++){let r=t[n];if(r!=null){let t;if(typeof r==`string`){let e=x(r);if(e)t=e;else continue}else t=r;_e(e,t)}}return e}function w(e){return e?.isConnected===!0}function Te(e,t){if(!e?.parentNode)return!1;try{return e.parentNode.replaceChild(t,e),!0}catch(e){return s(`Error replacing conditional node`,e),!1}}const Ee={};let De=!1;function Oe(e){let t=e.target;if(!t||typeof Node>`u`||!(t instanceof Node))return;let n=t;for(;n;){if(n instanceof Element){let e=_.get(n);e&&(w(n)?Me(e.info):(re(e.ref),_.delete(n)))}n=n.parentNode}}function ke(){De||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,Oe,!0),De=!0)}function Ae(e){let t=_.get(e);if(t)return t.info;let n={attributeResolvers:new Map};return te(e,n),n}function je(e){return typeof e!=`object`||!e}function T(e,t){let n;try{n=t.resolver()}catch(t){s(`Failed to resolve reactive attribute: ${e}`,t);return}let r=je(n);if(!(r&&Object.is(n,t.lastValue)))try{t.applyValue(n),t.lastValue=r?n:Ee}catch(t){s(`Failed to apply reactive attribute: ${e}`,t)}}function Me(e){for(let[t,n]of e.attributeResolvers)T(t,n)}function E(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){s(`Invalid parameters for registerAttributeResolver`);return}let i={resolver:n,applyValue:r,lastValue:Ee};if(!c){T(t,i);return}ke(),Ae(e).attributeResolvers.set(t,i),T(t,i)}function Ne(e){let t=[];for(let n of g){let r=n.deref();if(r===void 0){t.push(n);continue}let i=_.get(r);if(!i){t.push(n);continue}if(!w(r)){_.delete(r),t.push(n);continue}e&&!e.contains(r)||Me(i.info)}for(let e of t)re(e)}function Pe(e){return e}function Fe(e,t,n){let r=Pe(e),i=r.appendChild.bind(r),a=r.insertBefore.bind(r);r.appendChild=function(e){return a(e,t)};try{return n()}finally{r.appendChild=i}}function Ie(e,t,n){try{if(n==null||n===``)return e.style[t]=``,!0;let r=String(n);return e.style[t]=r,!0}catch{return!1}}function Le(e,t){if(!(!e?.style||!t))for(let n in t)Ie(e,n,t[n])||s(`Failed to set style property '${n}'`)}function Re(e,t){e&&(a(t)?E(e,`style`,t,function(t){Le(e,t)}):Le(e,t))}const D=new WeakMap,ze=new WeakSet;function O(e,t){let n=t.length,r=0;for(let i=0;i<=n;i++)(i===n||t.charCodeAt(i)===32)&&(i>r&&e.add(t.substring(r,i)),r=i+1)}function Be(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function Ve(e){if(e.className&&!D.has(e)){let t=new Set;O(t,e.className),D.set(e,t)}ze.add(e)}function He(e){return ze.has(e)}function Ue(e,t){if(!t)return;let n=D.get(e);n||(n=new Set,D.set(e,n)),O(n,t)}function We(e,t){let n=D.get(e);if(!n||n.size===0){e.className=t||``;return}if(!t){e.className=Be(n);return}let r=Be(n),i=t.length,a=0;for(let e=0;e<=i;e++)if(e===i||t.charCodeAt(e)===32){if(e>a){let i=t.substring(a,e);n.has(i)||(r+=` `+i)}a=e+1}e.className=r}function Ge(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;O(r,n),O(r,t),e.className=Be(r)}else e.className=t}function Ke(e,t){if(typeof e!=`function`){s(`Invalid resolver provided to createReactiveTextNode`);let e=x(``);if(!e)throw Error(`Failed to create text node: document not available`);return e}let n;if(arguments.length>1)n=t;else try{n=e()}catch(e){s(`Failed to evaluate reactive text resolver`,e),n=``}let r=n===void 0?``:String(n),i=x(r);if(!i)throw Error(`Failed to create text node: document not available`);return c&&ee(i,{resolver:e,lastValue:r}),i}function qe(e){let t=[];for(let n of m){let r=n.deref();if(r===void 0){t.push(n);continue}let i=h.get(r);if(!i){t.push(n);continue}let a=i.info;if(!w(r)){h.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;let o;try{o=a.resolver()}catch(e){s(`Failed to update reactive text node`,e),o=void 0}let c=o===void 0?``:String(o);c!==a.lastValue&&(r.textContent=c,a.lastValue=c)}for(let e of t)ne(e)}function Je(e,t,n,r=!1){if(n==null)return;if(t===`style`){Re(e,n);return}let i=(n,r=!1)=>{if(n!=null){if(t===`className`&&e instanceof HTMLElement&&r){Ge(e,String(n));return}if(e instanceof Element&&e.namespaceURI===`http://www.w3.org/2000/svg`)e.setAttribute(String(t),String(n));else if(t in e)try{e[t]=n}catch{e instanceof Element&&e.setAttribute(String(t),String(n))}else e instanceof Element&&e.setAttribute(String(t),String(n))}};if(a(n)&&n.length===0){let r=n;t===`className`&&e instanceof HTMLElement?(Ve(e),E(e,String(t),r,function(t){We(e,String(t||``))})):E(e,String(t),r,function(e){i(e,!1)})}else{if(t===`className`&&e instanceof HTMLElement&&He(e)){let t=String(n||``);t&&(Ue(e,t),Ge(e,t));return}i(n,r)}}function k(e,t,n=!0){if(t)for(let r of Object.keys(t)){let i=t[r];Je(e,r,i,n&&r===`className`)}}const A=new WeakMap;let j=!1,Ye=new WeakMap;function M(){return j}function Xe(){return!1}function Ze(){j=!0,Ye=new WeakMap}function Qe(){j=!1}function $e(e){let t=j;j=!1;try{return e()}finally{j=t}}function N(e){let t=Ye.get(e);return t===void 0?e.firstChild:t}function P(e,t){Ye.set(e,t)}function et(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function F(e){let t=N(e),n=!1;for(;t&&et(t);)t=t.nextSibling,n=!0;n&&P(e,t)}function I(e){let t=N(e);return t&&P(e,t.nextSibling),t}function tt(e,t){if(!j)return null;F(e);let n=N(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?I(e):null}function nt(e,t){if(!t)return;let n=N(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}P(e,null)}function rt(e){return n(e)&&!t(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function it(e){F(e);let t=N(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function at(e,t){let n=N(e);if(n&&n.nodeType===3)return I(e),n.textContent!==t&&(n.textContent=t),n;let r=x(t);return r?(e.insertBefore(r,n),P(e,n),r):null}function L(r,i,c){if(i==null)return null;if(a(i)){if(o(i))try{let t=A.get(i);if(t||(t={value:i(),error:!1},A.set(i,t)),t.error)return st(c,()=>``);let n=t.value;if(rt(n))return k(r,{className:()=>{let e=i();return rt(e)?e.className:``}}),null;if(e(n)&&n!=null){if(M()&&it(r)){let e=r;I(e);let t=String(n),a=at(e,t);return a&&ee(a,{resolver:i,lastValue:t}),null}return st(c,i,n)}return null}catch(e){return A.set(i,{value:void 0,error:!0}),s(`Error evaluating reactive text function:`,e),st(c,()=>``)}let a=i(r,c);return a==null?null:e(a)?ct(c,a):t(a)?a:(n(a)&&k(r,a),null)}let l=i;if(e(l)){if(M()&&it(r)){let e=r;return I(e),at(e,String(l)),null}return ct(c,l)}return t(l)?l:(k(r,l),null)}function ot(e,t){if(c&&!M()&&!Xe())return t;let n=ge();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=C(` text-${e} `);return r&&n.appendChild(r),t&&n.appendChild(t),n}function st(e,t,n){return ot(e,Ke(t,n))}function ct(e,t){return ot(e,x(String(t)))}function R(e,t,n=0){if(!t||t.length===0)return;let r=n,i=e;for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;let o=L(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function lt(e,t){let n=me(e);return R(n,t,0),n}function ut(e,t){let n=he(pe,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return R(n,t,0),n}function dt(e,...t){return function(n,r=0){let i=n,a=i?tt(i,e):null,o=a??me(e),s=o,c=a?s.lastChild:null;return R(o,t,r),a&&nt(s,c),o}}function ft(e,...t){return function(n,r=0){let i=n,a=i?tt(i,e):null,o=a??he(`http://www.w3.org/2000/svg`,e);if(!o)throw Error(`Failed to create SVG element: ${e}`);let s=o,c=a?s.lastChild:null;return R(o,t,r),a&&nt(s,c),o}}function pt(e){return(...t)=>dt(e,...t)}function mt(e){return(...t)=>ft(e,...t)}const ht=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.menu.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.script.search.section.select.slot.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`),gt=`a.animate.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.svg.switch.symbol.text.textPath.title.tspan.use.view`.split(`.`),_t=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function vt(e,t){t in e&&typeof e[t]!=`function`||(e[t]=pt(t))}function yt(e,t){let n=`${t}Svg`;n in e||(e[n]=mt(t))}function bt(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<gt.length;t++)yt(e,gt[t]);for(let t=0;t<ht.length;t++)vt(e,ht[t]);e[t]=!0}}function xt(e,t,n){if(a(e)){let i=e(t,n);return i&&r(i)?i:null}return e&&r(e)?e:null}function St(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}const z=new Set,B=new WeakMap,Ct=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{z.delete(e)}):null;function wt(e,t){let n=new WeakRef(e);z.add(n),B.set(e,t),Ct?.register(e,n)}function Tt(e){return Array.isArray(e)?e:Array.from(e)}function Et(e,t,n){return xt(e.renderItem(t,n),e.host,n)}function Dt(e){let t=e;t.element=null,t.item=null}function V(e){S(e.element),Dt(e)}function Ot(e,t,n,r){if(n.parentNode!==t||r.parentNode!==t)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=r.element;i&&i.parentNode===t&&t.removeChild(i),Dt(r)}return!0}function kt(e){let t=e.length;if(t===0)return[];let n=Array(t),r=[];for(let i=0;i<t;i++){let t=e[i],a=0,o=r.length;for(;a<o;){let n=a+o>>1;e[r[n]]<t?a=n+1:o=n}n[i]=a>0?r[a-1]:-1,a===r.length?r.push(i):r[a]=i}let i=r.length,a=r[i-1],o=Array(i);for(;i>0;)o[--i]=a,a=n[a];return o}function At(e,t,n,r,i,a,o){let s=ge(),c=0;for(let l=r;l<i;l++){let r=n[l],i=Et(e,r,l);if(!i)continue;o.push({item:r,element:i});let u=i;s?(s.appendChild(u),c++):t.insertBefore(u,a)}s&&c>0&&t.insertBefore(s,a)}function jt(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Mt(e){let{host:t,startMarker:n,endMarker:r}=e,i=n.parentNode??t,a=Tt(e.itemsProvider());if(St(e.lastSyncedItems,a))return;let o=e.records,s=a.length;if(s===0){if(!Ot(o,i,n,r))for(let e=0;e<o.length;e++)V(o[e]);e.records=[],e.lastSyncedItems=[];return}if(o.length===0){let t=[];At(e,i,a,0,s,r,t),e.records=t,e.lastSyncedItems=a.slice();return}let c=e.lastSyncedItems;if(s>c.length&&jt(c,a)){At(e,i,a,c.length,s,r,o),e.records=o,e.lastSyncedItems=a.slice();return}let l=new Map,u=new Map,d=new Map;for(let e=0;e<o.length;e++){let t=o[e];d.set(t,e);let n=u.get(t.item);n?n.push(t):u.set(t.item,[t])}for(let e=0;e<s;e++){let t=a[e];if(e<c.length&&c[e]===t){let n=o[e];if(n&&n.item===t){l.set(e,n);let r=u.get(t);r.splice(r.indexOf(n),1),r.length===0&&u.delete(t)}}}let f=Array(s),p=new Set(o),m=0;for(let t=s-1;t>=0;t--){let n=a[t],r=l.get(t);if(!r){let e=u.get(n);e&&e.length>0&&(r=e.shift(),e.length===0&&u.delete(n))}if(r)p.delete(r),m++;else{let i=Et(e,n,t);if(!i){f[t]=null;continue}r={item:n,element:i}}f[t]=r}if(m===0){if(!Ot(o,i,n,r))for(let e of p)V(e)}else for(let e of p)V(e);let h=[],g=[];for(let e=0;e<s;e++){let t=f[e];if(!t)continue;let n=d.get(t);n!==void 0&&(h.push(e),g.push(n))}let _=new Set;if(g.length>0){let e=kt(g);for(let t=0;t<e.length;t++)_.add(h[e[t]])}let v=r,y=null;for(let e=s-1;e>=0;e--){let t=f[e];if(!t)continue;let n=t.element;if(!d.has(t)){y||=ge(),y?y.insertBefore(n,y.firstChild):(i.insertBefore(n,v),v=n);continue}if(y&&y.firstChild){let e=y.firstChild;i.insertBefore(y,v),v=e,y=null}_.has(e)||i.insertBefore(n,v),v=n}y&&y.firstChild&&i.insertBefore(y,v),e.records=f.filter(e=>e!==null),e.lastSyncedItems=a.slice()}function Nt(e,t,n,r){return M()?Pt(e,t,n,r):H(e,t,n,r)}function H(e,t,n,r){let{start:i,end:a}=xe(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),Mt(o),c&&wt(i,o),o}function Pt(e,t,n,r){let i=n;F(i);let a=N(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return H(e,t,n,r);let o=I(i),s=0,l=N(i);for(;l;){if(l.nodeType===8){let e=l.textContent||``;if(e.startsWith(`list-start-`))s++;else if(e===`list-end`){if(s===0)break;s--}}l=l.nextSibling}let u=l;if(!u){let e=C(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return H(e,t,n,r);let d=Tt(e()),f=[];for(let e=0;e<d.length;e++){let r=xt(t(d[e],e),n,e);r&&f.push({item:d[e],element:r})}let p=N(i);for(;p&&p!==u;){let e=p.nextSibling;S(p),p=e}let m=u;for(let e=f.length-1;e>=0;e--){let t=f[e].element;(t.parentNode!==i||t.nextSibling!==m)&&i.insertBefore(t,m),m=t}P(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return c&&wt(o,h),h}function Ft(e){for(let t=0;t<e.records.length;t++){let n=e.records[t];n.element=null,n.item=null}e.records=[]}function It(e){let t=[];for(let n of z){let r=n.deref();if(!r){t.push(n);continue}let i=B.get(r);if(!i){t.push(n);continue}if(!w(r)||!w(i.endMarker)){Ft(i),B.delete(r),t.push(n);continue}e&&!e.contains(r)||Mt(i)}for(let e of t)z.delete(e)}function Lt(e,t){return function(n,r){return Nt(e,t,n,r).startMarker}}function Rt(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function zt(e,t){return typeof e==`function`?Rt(e,t):!!e}function Bt(e,t,n,r){return a(e)?o(e)?(A.delete(e),L(t,e,n)):Fe(t,r,()=>{let r=L(t,e,n);return r&&!r.parentNode?r:null}):L(t,e,n)}function Vt(e,t,n,r){let i=[];for(let a of e){let e=Bt(a,t,n,r);e&&i.push(e)}return i}const U=new Set,W=new WeakMap,Ht=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{U.delete(e)}):null;function Ut(e,t){for(let t=0;t<e.length;t++)if(zt(e[t].condition))return t;return t.length>0?-1:null}function Wt(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=Ut(t,n);o!==e.activeIndex&&(Se(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&Ce(Vt(o>=0?t[o].content:n,r,i,a),a))}function Gt(e){let t=new WeakRef(e.startMarker);U.add(t),W.set(e.startMarker,e),Ht?.register(e.startMarker,t)}function Kt(e){let t=[];for(let n of U){let r=n.deref();if(r===void 0){t.push(n);continue}let i=W.get(r);if(!i){t.push(n);continue}if(!w(r)||!w(i.endMarker)){W.delete(r),t.push(n);continue}if(!(e&&!e.contains(r)))try{i.update()}catch{W.delete(r),t.push(n)}}for(let e of t)U.delete(e)}function qt(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function Jt(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var Yt=class e{groups=[];elseContent=[];constructor(e,...t){this.groups.push({condition:e,content:t})}cloneWith(t,n){let r=Object.create(e.prototype);return r.groups=[...this.groups],t&&r.groups.push(t),r.elseContent=n??[...this.elseContent],r}when(e,...t){return this.groups.push({condition:e,content:t}),this}else(...e){return this.elseContent=e,this}render(e,t){return globalThis.document?M()?this.hydrateRender(e,t):this.freshRender(e,t):null}freshRender(e,t){let{start:n,end:r}=xe(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=Pe(e);return a.appendChild(n),a.appendChild(r),Wt(i),n.textContent=qt(t,i.activeIndex),n}hydrateRender(e,t){let n=e;F(n);let r=N(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=I(n),a=0,o=N(n);for(;o;){if(o.nodeType===8){let e=o.textContent||``;if(e.startsWith(`when-start-`))a++;else if(e===`when-end`){if(a===0)break;a--}}o=o.nextSibling}let s=o,c=!1;if(!s){let e=C(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=Ut(this.groups,this.elseContent),u=Jt(i.textContent);if(!c&&(u===void 0||u===l)){if(l!==null){let n=l>=0?this.groups[l].content:this.elseContent;for(let r of n)L(e,r,t)}}else if(Se(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;$e(()=>{Ce(Vt(n,e,t,r),r)})}return P(n,s.nextSibling),this.createRuntimeFromMarkers(e,t,i,s,l),i}createRuntimeFromMarkers(e,t,n,r,i=null){let a={startMarker:n,endMarker:r,host:e,index:t,groups:[...this.groups],elseContent:[...this.elseContent],activeIndex:i,update:function(){Wt(a)}};return c&&Gt(a),a}};function Xt(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return Xt(e.cloneWith({condition:t,content:n}))},else:function(...t){return Xt(e.cloneWith(void 0,t))}})}function Zt(e,...t){return Xt(new Yt(e,...t))}function Qt(e){try{return e.isSvg?ut(e.tagName,e.modifiers):lt(e.tagName,e.modifiers)}catch(t){if(s(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=he(pe,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=me(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function $t(e){let t=fe(e);if(!t)return;let n=Rt(t.condition,e=>{s(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=Qt(t);le(n,t),Te(e,n)}else if(!n&&r){let n=be(t.tagName);n&&(le(n,t),Te(e,n))}}function en(e){if(c)try{let t=de();for(let n of t){if(!n.isConnected){ue(n);continue}e&&!e.contains(n)||$t(n)}}catch(e){s(`Error during conditional elements update`,e)}}function tn(){if(typeof document>`u`)return;let e=document.body?[document.body,document]:[document];for(let t of e)try{t.dispatchEvent(new Event(`update`,{bubbles:!0}))}catch(e){s(`Error dispatching global update event`,e)}}const G=new Map;function nn(e){let t=[],n=new Set;for(let r of e){if(typeof r!=`string`)continue;let e=r.trim();e&&(n.has(e)||(n.add(e),t.push(e)))}return t}function rn(e,t){let n=G.get(e);n||(n=new Set,G.set(e,n)),n.add(new WeakRef(t))}function an(e){let t=nn(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=G.get(e);if(!t)continue;let r=[];for(let e of t){let t=e.deref();if(t===void 0){r.push(e);continue}if(!w(t)){r.push(e);continue}n.add(t)}for(let e of r)t.delete(e);t.size===0&&G.delete(e)}return Array.from(n)}function on(...e){let t=nn(e);return function(e){if(c&&e instanceof Element)for(let n of t)rn(n,e)}}const sn=[It,Kt,en,Ne,qe,tn];function cn(...e){let t;if(e.length>0){let n=an(e);if(n.length===1){let e=n[0];t={roots:n,contains:t=>e.contains(t)}}else t={roots:n,contains:e=>{for(let t of n)if(t.contains(e))return!0;return!1}}}for(let e of sn)e(t)}function ln(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function un(e,t){let n=t||document.body,r=n;Ze();try{let t=e(n,0),i=t;if(i&&i.nodeType===1&&i.parentNode!==r){let e=N(r);if(e){let t=e.nextSibling;r.insertBefore(i,e),S(e),P(r,t)}else r.appendChild(i),P(r,null)}return t}finally{Qe()}}let dn=null;function fn(e){dn=e}const pn=new Map,mn=new Map,hn=new Set,K=[],q=new Map;let J=null,Y=null,X=null,Z=0;const Q=new Map;function gn(e){for(let t of e)q.has(t)||q.set(t,[])}function _n(e,t){try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=e.cssRules[n];return Q.set(t,r),r}catch{return null}}function vn(e,t){try{e.insertRule(t,Z),Z++}catch{}}function yn(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(Y&&X===document&&Y.ownerNode&&Y.ownerNode.isConnected)return Y;let e=document.getElementById(`nuclo-styles`);if(e||(e=document.createElement(`style`),e.id=`nuclo-styles`,document.head.appendChild(e)),Y=e.sheet,X=document,Q.clear(),Z=0,!Y)return null;for(let e of K)vn(Y,e);for(let[e,t]of q){let n=_n(Y,e);if(n)for(let e of t)try{n.insertRule(e,n.cssRules.length)}catch{}}return Y}function bn(e,t){if(t===void 0)K.push(e);else{let n=q.get(t);n||(n=[],q.set(t,n)),n.push(e)}J=null,dn?.(t===void 0?e:t+`{`+e+`}`);let n=yn();if(n)if(t===void 0)vn(n,e);else{let r=Q.get(t)??_n(n,t);if(r)try{r.insertRule(e,r.cssRules.length)}catch{}}}function xn(e){let t=2166136261,n=2128831035;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n^i,2246822507)}return(t>>>0).toString(36)+((n>>>9)%1296).toString(36)}function $(e,t,n,r){let i=(e??``)+`|`+t+`|`+n+`:`+r,a=pn.get(i);return a===void 0?(a=`n`+xn(i),pn.set(i,a),mn.set(a,(e??``)+`|`+t+`|`+n),bn(`.`+a+t+`{`+n+`:`+r+`}`,e),a):(yn(),a)}function Sn(e){return mn.get(e)}function Cn(e,t){if(hn.has(e)){yn();return}hn.add(e),bn(t,void 0)}function wn(){if(J!==null)return J;let e=K.join(``);for(let[t,n]of q)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return J=e,e}function Tn(){pn.clear(),mn.clear(),hn.clear(),K.length=0,q.clear(),Q.clear(),J=null,Z=0,Y=null,X=null,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}const En={hover:`:hover`,focus:`:focus`,focusVisible:`:focus-visible`,focusWithin:`:focus-within`,active:`:active`,visited:`:visited`,disabled:`:disabled`,enabled:`:enabled`,checked:`:checked`,required:`:required`,invalid:`:invalid`,valid:`:valid`,readOnly:`:read-only`,first:`:first-child`,last:`:last-child`,only:`:only-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,empty:`:empty`,placeholderShown:`:placeholder-shown`,placeholder:`::placeholder`,before:`::before`,after:`::after`,selection:`::selection`,marker:`::marker`,firstLine:`::first-line`,firstLetter:`::first-letter`},Dn={bg:[`background`],p:[`padding`],px:[`padding-left`,`padding-right`],py:[`padding-top`,`padding-bottom`],pt:[`padding-top`],pr:[`padding-right`],pb:[`padding-bottom`],pl:[`padding-left`],m:[`margin`],mx:[`margin-left`,`margin-right`],my:[`margin-top`,`margin-bottom`],mt:[`margin-top`],mr:[`margin-right`],mb:[`margin-bottom`],ml:[`margin-left`],w:[`width`],h:[`height`],minW:[`min-width`],maxW:[`max-width`],minH:[`min-height`],maxH:[`max-height`],size:[`width`,`height`],text:[`font-size`],font:[`font-family`],weight:[`font-weight`],leading:[`line-height`],tracking:[`letter-spacing`],align:[`text-align`],items:[`align-items`],justify:[`justify-content`],z:[`z-index`],rounded:[`border-radius`],shadow:[`box-shadow`],select:[`user-select`]},On={row:{display:`flex`,"flex-direction":`row`},col:{display:`flex`,"flex-direction":`column`},center:{"align-items":`center`,"justify-content":`center`},truncate:{overflow:`hidden`,"text-overflow":`ellipsis`,"white-space":`nowrap`}},kn={background:`colors`,"background-color":`colors`,color:`colors`,"border-color":`colors`,"border-top-color":`colors`,"border-right-color":`colors`,"border-bottom-color":`colors`,"border-left-color":`colors`,"outline-color":`colors`,"caret-color":`colors`,"text-decoration-color":`colors`,"font-family":`fonts`,"box-shadow":`shadows`,"border-radius":`radii`},An=new Set([`z-index`,`opacity`,`font-weight`,`line-height`,`flex`,`flex-grow`,`flex-shrink`,`order`,`aspect-ratio`,`zoom`,`scale`,`column-count`,`orphans`,`widows`,`tab-size`,`animation-iteration-count`,`grid-column`,`grid-row`]),jn=new Map;function Mn(e){let t=jn.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),jn.set(e,t)),t}function Nn(e){return e.charCodeAt(0)===64?e:`@media `+e}function Pn(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Fn(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function In(...e){let t=new Map;for(let n of e){if(!n)continue;let e=(typeof n==`string`?n:n.className).split(` `);for(let n of e)n&&t.set(Sn(n)??n,n)}let n=``;for(let e of t.values())n+=(n?` `:``)+e;return Fn(n)}function Ln(e={}){let t=e.screens??{};gn(Object.values(t).map(Nn));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||An.has(t)?String(n):n+`px`;let r=kn[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,n,a,o){for(let s in e){let c=e[s];if(c==null||c===!1)continue;if(typeof c==`object`){if(s===`raw`){let e=c;for(let t in e)o.push($(n,a,t,r(t,e[t])));continue}let e=En[s];if(e!==void 0){i(c,n,a+e,o);continue}let l=t[s];if(l!==void 0){i(c,Pn(n,Nn(l)),a,o);continue}let u=s.charCodeAt(0);if(u===38){i(c,n,a+s.slice(1),o);continue}if(u===64){i(c,Pn(n,s),a,o);continue}continue}if(c===!0){let e=On[s];if(e)for(let t in e)o.push($(n,a,t,e[t]));continue}let l=Dn[s];if(l!==void 0)for(let e of l)o.push($(n,a,e,r(e,c)));else{let e=Mn(s);o.push($(n,a,e,r(e,c)))}}}function a(e){let t=n.get(e);if(t)return t;let r=[];i(e,void 0,``,r);let a=Fn(r.join(` `));return n.set(e,a),a}function o(e){let t=``,n=(e,n)=>{t+=(t?`;`:``)+e+`:`+n};for(let t in e){let i=e[t];if(i==null||i===!1)continue;if(t===`raw`&&typeof i==`object`){let e=i;for(let t in e)n(t,r(t,e[t]));continue}if(typeof i==`object`)continue;if(i===!0){let e=On[t];if(e)for(let t in e)n(t,e[t]);continue}let a=Dn[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=Mn(t);n(e,r(e,i))}}return t}function s(e){let t=``;for(let n in e)t+=n+`{`+o(e[n])+`}`;let n=`nk`+xn(t);return Cn(n,`@keyframes `+n+`{`+t+`}`),n}function c(e,t){let n=e+`{`+o(t)+`}`;Cn(`g|`+n,n)}return{css:a,cx:In,keyframes:s,globalStyle:c,theme:e}}const Rn=Ln({}),zn=Rn.css,Bn=Rn.keyframes,Vn=Rn.globalStyle;function Hn(){bt();let e=globalThis;e.list=Lt,e.update=cn,e.when=Zt,e.on=p,e.scope=on,e.render=ln,e.hydrate=un,e.createCss=Ln,e.css=zn,e.cx=In,e.keyframes=Bn,e.globalStyle=Vn}Hn();export{ht as HTML_TAGS,_t as SELF_CLOSING_TAGS,gt as SVG_TAGS,we as appendChildren,k as applyAttributes,L as applyNodeModifier,C as createComment,be as createConditionalComment,Ln as createCss,lt as createHtmlElementWithModifiers,pt as createHtmlTagBuilder,ut as createSvgElementWithModifiers,mt as createSvgTagBuilder,zn as css,In as cx,wn as getCssText,Vn as globalStyle,un as hydrate,Hn as initializeRuntime,i as isBoolean,c as isBrowser,a as isFunction,t as isNode,n as isObject,e as isPrimitive,r as isTagLike,o as isZeroArityFunction,Bn as keyframes,Lt as list,p as on,bt as registerGlobalTagBuilders,ln as render,Te as replaceNodeSafely,Tn as resetStyles,on as scope,fn as setSSRCollector,cn as update,Zt as when};
|
|
1
|
+
function e(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function t(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function n(e){return typeof e==`object`&&!!e}function r(e){return n(e)&&`tagName`in e}function i(e){return typeof e==`boolean`}function a(e){return typeof e==`function`}function o(e){return a(e)&&e.length===0}function s(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}const c=typeof window<`u`&&typeof document<`u`,l=new WeakMap;function u(e,t){let n=l.get(e);n?n.push(t):l.set(e,[t])}function d(e,t){e.removeEventListener(t.type,t.wrapped,t.options)}function f(e,t){let n=l.get(e);if(!n)return;if(t===void 0){for(let t=0;t<n.length;t++)d(e,n[t]);l.delete(e);return}let r=0;for(let i=0;i<n.length;i++){let a=n[i];a.type===t?d(e,a):n[r++]=a}n.length=r,r===0&&l.delete(e)}function p(e,t,n){return function(r){if(!c||!r||typeof r.addEventListener!=`function`)return;let i=r,a=function(n){try{t.call(i,n)}catch(t){s(`Error in '${e}' listener`,t)}};i.addEventListener(e,a,n),u(i,{type:e,wrapped:a,options:n})}}const m=new Set,h=new WeakMap,g=new Set,_=new WeakMap,v=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{m.delete(e)}):null,y=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{g.delete(e)}):null;function ee(e,t){let n=h.get(e);if(n){n.info.resolver=t.resolver,n.info.lastValue=t.lastValue;return}let r=new WeakRef(e);m.add(r),h.set(e,{ref:r,info:t}),v?.register(e,r)}function te(e,t){let n=new WeakRef(e);g.add(n),_.set(e,{ref:n,info:t}),y?.register(e,n)}function ne(e){m.delete(e)}function re(e){g.delete(e)}function ie(e){let t=h.get(e);t&&(m.delete(t.ref),h.delete(e))}function ae(e){let t=_.get(e);t&&(g.delete(t.ref),_.delete(e))}const oe=new WeakMap,b=new Set,se=new WeakMap,ce=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{b.delete(e)}):null;function le(e,t){oe.set(e,t);let n=new WeakRef(e);b.add(n),se.set(e,n),ce?.register(e,n)}function ue(e){oe.delete(e);let t=se.get(e);t&&(b.delete(t),se.delete(e))}function de(){let e=[],t=[];for(let n of b){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)b.delete(e);return e}function fe(e){return oe.get(e)??null}const pe=`http://www.w3.org/2000/svg`;function me(e){return globalThis.document?document.createElement(e):null}function he(e,t){return globalThis.document?document.createElementNS(e,t):null}function x(e){return globalThis.document?document.createTextNode(e):null}function ge(){return globalThis.document?document.createDocumentFragment():null}function _e(e,t){try{return e.appendChild(t),!0}catch(e){return s(`Failed to append child node`,e),!1}}function ve(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;f(t),ae(t),ue(t)}else e.nodeType===Node.TEXT_NODE?ie(e):e.nodeType===Node.COMMENT_NODE&&ue(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)ve(e.childNodes[t])}function S(e){if(!e?.parentNode)return!1;try{return ve(e),e.parentNode.removeChild(e),!0}catch(e){return s(`Failed to remove child node`,e),!1}}function ye(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return s(`Failed to insert node before reference`,e),!1}}function C(e){return globalThis.document?globalThis.document.createComment(e):null}function be(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function xe(e,t){let n=C(`${e}-end`);if(!n)throw Error(`Failed to create comment: document not available`);let r=C(`${e}-start-${t}`);if(!r)throw Error(`Failed to create comment: document not available`);return{start:r,end:n}}function Se(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;S(n),n=e}}function Ce(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)ye(n,e[r],t)}function we(e,...t){if(!e)return e;for(let n=0;n<t.length;n++){let r=t[n];if(r!=null){let t;if(typeof r==`string`){let e=x(r);if(e)t=e;else continue}else t=r;_e(e,t)}}return e}function w(e){return e?.isConnected===!0}function Te(e,t){if(!e?.parentNode)return!1;try{return e.parentNode.replaceChild(t,e),!0}catch(e){return s(`Error replacing conditional node`,e),!1}}const Ee={};let De=!1;function Oe(e){let t=e.target;if(!t||typeof Node>`u`||!(t instanceof Node))return;let n=t;for(;n;){if(n instanceof Element){let e=_.get(n);e&&(w(n)?Me(e.info):(re(e.ref),_.delete(n)))}n=n.parentNode}}function ke(){De||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,Oe,!0),De=!0)}function Ae(e){let t=_.get(e);if(t)return t.info;let n={attributeResolvers:new Map};return te(e,n),n}function je(e){return typeof e!=`object`||!e}function T(e,t){let n;try{n=t.resolver()}catch(t){s(`Failed to resolve reactive attribute: ${e}`,t);return}let r=je(n);if(!(r&&Object.is(n,t.lastValue)))try{t.applyValue(n),t.lastValue=r?n:Ee}catch(t){s(`Failed to apply reactive attribute: ${e}`,t)}}function Me(e){for(let[t,n]of e.attributeResolvers)T(t,n)}function Ne(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){s(`Invalid parameters for registerAttributeResolver`);return}let i={resolver:n,applyValue:r,lastValue:Ee};if(!c){T(t,i);return}ke(),Ae(e).attributeResolvers.set(t,i),T(t,i)}function Pe(e){let t=[];for(let n of g){let r=n.deref();if(r===void 0){t.push(n);continue}let i=_.get(r);if(!i){t.push(n);continue}if(!w(r)){_.delete(r),t.push(n);continue}e&&!e.contains(r)||Me(i.info)}for(let e of t)re(e)}function Fe(e){return e}function Ie(e,t,n){let r=Fe(e),i=r.appendChild.bind(r),a=r.insertBefore.bind(r);r.appendChild=function(e){return a(e,t)};try{return n()}finally{r.appendChild=i}}function Le(e,t,n){try{if(n==null||n===``)return e.style[t]=``,!0;let r=String(n);return e.style[t]=r,!0}catch{return!1}}function Re(e,t){if(!(!e?.style||!t))for(let n in t)Le(e,n,t[n])||s(`Failed to set style property '${n}'`)}function ze(e,t){e&&(a(t)?Ne(e,`style`,t,function(t){Re(e,t)}):Re(e,t))}const E=new WeakMap,Be=new WeakSet;function D(e,t){let n=t.length,r=0;for(let i=0;i<=n;i++)(i===n||t.charCodeAt(i)===32)&&(i>r&&e.add(t.substring(r,i)),r=i+1)}function Ve(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function He(e){if(e.className&&!E.has(e)){let t=new Set;D(t,e.className),E.set(e,t)}Be.add(e)}function Ue(e){return Be.has(e)}function We(e,t){if(!t)return;let n=E.get(e);n||(n=new Set,E.set(e,n)),D(n,t)}function Ge(e,t){let n=E.get(e);if(!n||n.size===0){e.className=t||``;return}if(!t){e.className=Ve(n);return}let r=Ve(n),i=t.length,a=0;for(let e=0;e<=i;e++)if(e===i||t.charCodeAt(e)===32){if(e>a){let i=t.substring(a,e);n.has(i)||(r+=` `+i)}a=e+1}e.className=r}function Ke(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;D(r,n),D(r,t),e.className=Ve(r)}else e.className=t}function qe(e,t){if(typeof e!=`function`){s(`Invalid resolver provided to createReactiveTextNode`);let e=x(``);if(!e)throw Error(`Failed to create text node: document not available`);return e}let n;if(arguments.length>1)n=t;else try{n=e()}catch(e){s(`Failed to evaluate reactive text resolver`,e),n=``}let r=n===void 0?``:String(n),i=x(r);if(!i)throw Error(`Failed to create text node: document not available`);return c&&ee(i,{resolver:e,lastValue:r}),i}function Je(e){let t=[];for(let n of m){let r=n.deref();if(r===void 0){t.push(n);continue}let i=h.get(r);if(!i){t.push(n);continue}let a=i.info;if(!w(r)){h.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;let o;try{o=a.resolver()}catch(e){s(`Failed to update reactive text node`,e),o=void 0}let c=o===void 0?``:String(o);c!==a.lastValue&&(r.textContent=c,a.lastValue=c)}for(let e of t)ne(e)}function Ye(e,t,n,r=!1){if(n==null)return;if(t===`style`){ze(e,n);return}let i=(n,r=!1)=>{if(n!=null){if(t===`className`&&e instanceof HTMLElement&&r){Ke(e,String(n));return}if(e instanceof Element&&e.namespaceURI===`http://www.w3.org/2000/svg`)e.setAttribute(String(t),String(n));else if(t in e)try{e[t]=n}catch{e instanceof Element&&e.setAttribute(String(t),String(n))}else e instanceof Element&&e.setAttribute(String(t),String(n))}};if(a(n)&&n.length===0){let r=n;t===`className`&&e instanceof HTMLElement?(He(e),Ne(e,String(t),r,function(t){Ge(e,String(t||``))})):Ne(e,String(t),r,function(e){i(e,!1)})}else{if(t===`className`&&e instanceof HTMLElement&&Ue(e)){let t=String(n||``);t&&(We(e,t),Ke(e,t));return}i(n,r)}}function O(e,t,n=!0){if(t)for(let r of Object.keys(t)){let i=t[r];Ye(e,r,i,n&&r===`className`)}}const k=new WeakMap;let A=!1,Xe=new WeakMap;function j(){return A}function Ze(){return!1}function Qe(){A=!0,Xe=new WeakMap}function $e(){A=!1}function et(e){let t=A;A=!1;try{return e()}finally{A=t}}function M(e){let t=Xe.get(e);return t===void 0?e.firstChild:t}function N(e,t){Xe.set(e,t)}function tt(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function P(e){let t=M(e),n=!1;for(;t&&tt(t);)t=t.nextSibling,n=!0;n&&N(e,t)}function F(e){let t=M(e);return t&&N(e,t.nextSibling),t}function nt(e,t){if(!A)return null;P(e);let n=M(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?F(e):null}function rt(e,t){if(!t)return;let n=M(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}N(e,null)}function it(e){return n(e)&&!t(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function at(e){P(e);let t=M(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function ot(e,t){let n=M(e);if(n&&n.nodeType===3)return F(e),n.textContent!==t&&(n.textContent=t),n;let r=x(t);return r?(e.insertBefore(r,n),N(e,n),r):null}function I(r,i,c){if(i==null)return null;if(a(i)){if(o(i))try{let t=k.get(i);if(t||(t={value:i(),error:!1},k.set(i,t)),t.error)return ct(c,()=>``);let n=t.value;if(it(n))return O(r,{className:()=>{let e=i();return it(e)?e.className:``}}),null;if(e(n)&&n!=null){if(j()&&at(r)){let e=r;F(e);let t=String(n),a=ot(e,t);return a&&ee(a,{resolver:i,lastValue:t}),null}return ct(c,i,n)}return null}catch(e){return k.set(i,{value:void 0,error:!0}),s(`Error evaluating reactive text function:`,e),ct(c,()=>``)}let a=i(r,c);return a==null?null:e(a)?lt(c,a):t(a)?a:(n(a)&&O(r,a),null)}let l=i;if(e(l)){if(j()&&at(r)){let e=r;return F(e),ot(e,String(l)),null}return lt(c,l)}return t(l)?l:(O(r,l),null)}function st(e,t){if(c&&!j()&&!Ze())return t;let n=ge();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=C(` text-${e} `);return r&&n.appendChild(r),t&&n.appendChild(t),n}function ct(e,t,n){return st(e,qe(t,n))}function lt(e,t){return st(e,x(String(t)))}function L(e,t,n=0){if(!t||t.length===0)return;let r=n,i=e;for(let n=0;n<t.length;n+=1){let a=t[n];if(a==null)continue;let o=I(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function ut(e,t){let n=me(e);return L(n,t,0),n}function dt(e,t){let n=he(pe,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return L(n,t,0),n}function ft(e,...t){return function(n,r=0){let i=n,a=i?nt(i,e):null,o=a??me(e),s=o,c=a?s.lastChild:null;return L(o,t,r),a&&rt(s,c),o}}function pt(e,...t){return function(n,r=0){let i=n,a=i?nt(i,e):null,o=a??he(`http://www.w3.org/2000/svg`,e);if(!o)throw Error(`Failed to create SVG element: ${e}`);let s=o,c=a?s.lastChild:null;return L(o,t,r),a&&rt(s,c),o}}function mt(e){return(...t)=>ft(e,...t)}function ht(e){return(...t)=>pt(e,...t)}const gt=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.menu.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.script.search.section.select.slot.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`),_t=`a.animate.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.svg.switch.symbol.text.textPath.title.tspan.use.view`.split(`.`),vt=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function yt(e,t){t in e&&typeof e[t]!=`function`||(e[t]=mt(t))}function bt(e,t){let n=`${t}Svg`;n in e||(e[n]=ht(t))}function xt(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<_t.length;t++)bt(e,_t[t]);for(let t=0;t<gt.length;t++)yt(e,gt[t]);e[t]=!0}}function St(e,t,n){if(a(e)){let i=e(t,n);return i&&r(i)?i:null}return e&&r(e)?e:null}function Ct(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}const R=new Set,wt=new WeakMap,Tt=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{R.delete(e)}):null;function Et(e,t){let n=new WeakRef(e);R.add(n),wt.set(e,t),Tt?.register(e,n)}function Dt(e){return Array.isArray(e)?e:Array.from(e)}function Ot(e,t,n){return St(e.renderItem(t,n),e.host,n)}function kt(e){let t=e;t.element=null,t.item=null}function z(e){S(e.element),kt(e)}function At(e,t,n,r){if(n.parentNode!==t||r.parentNode!==t)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=r.element;i&&i.parentNode===t&&t.removeChild(i),kt(r)}return!0}function jt(e){let t=e.length;if(t===0)return[];let n=Array(t),r=[];for(let i=0;i<t;i++){let t=e[i],a=0,o=r.length;for(;a<o;){let n=a+o>>1;e[r[n]]<t?a=n+1:o=n}n[i]=a>0?r[a-1]:-1,a===r.length?r.push(i):r[a]=i}let i=r.length,a=r[i-1],o=Array(i);for(;i>0;)o[--i]=a,a=n[a];return o}function Mt(e,t,n,r,i,a,o){let s=ge(),c=0;for(let l=r;l<i;l++){let r=n[l],i=Ot(e,r,l);if(!i)continue;o.push({item:r,element:i});let u=i;s?(s.appendChild(u),c++):t.insertBefore(u,a)}s&&c>0&&t.insertBefore(s,a)}function Nt(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Pt(e){let{host:t,startMarker:n,endMarker:r}=e,i=n.parentNode??t,a=Dt(e.itemsProvider());if(Ct(e.lastSyncedItems,a))return;let o=e.records,s=a.length;if(s===0){if(!At(o,i,n,r))for(let e=0;e<o.length;e++)z(o[e]);e.records=[],e.lastSyncedItems=[];return}if(o.length===0){let t=[];Mt(e,i,a,0,s,r,t),e.records=t,e.lastSyncedItems=a.slice();return}let c=e.lastSyncedItems;if(s>c.length&&Nt(c,a)){Mt(e,i,a,c.length,s,r,o),e.records=o,e.lastSyncedItems=a.slice();return}let l=new Map,u=new Map,d=new Map;for(let e=0;e<o.length;e++){let t=o[e];d.set(t,e);let n=u.get(t.item);n?n.push(t):u.set(t.item,[t])}for(let e=0;e<s;e++){let t=a[e];if(e<c.length&&c[e]===t){let n=o[e];if(n&&n.item===t){l.set(e,n);let r=u.get(t);r.splice(r.indexOf(n),1),r.length===0&&u.delete(t)}}}let f=Array(s),p=new Set(o),m=0;for(let t=s-1;t>=0;t--){let n=a[t],r=l.get(t);if(!r){let e=u.get(n);e&&e.length>0&&(r=e.shift(),e.length===0&&u.delete(n))}if(r)p.delete(r),m++;else{let i=Ot(e,n,t);if(!i){f[t]=null;continue}r={item:n,element:i}}f[t]=r}if(m===0){if(!At(o,i,n,r))for(let e of p)z(e)}else for(let e of p)z(e);let h=[],g=[];for(let e=0;e<s;e++){let t=f[e];if(!t)continue;let n=d.get(t);n!==void 0&&(h.push(e),g.push(n))}let _=new Set;if(g.length>0){let e=jt(g);for(let t=0;t<e.length;t++)_.add(h[e[t]])}let v=r,y=null;for(let e=s-1;e>=0;e--){let t=f[e];if(!t)continue;let n=t.element;if(!d.has(t)){y||=ge(),y?y.insertBefore(n,y.firstChild):(i.insertBefore(n,v),v=n);continue}if(y&&y.firstChild){let e=y.firstChild;i.insertBefore(y,v),v=e,y=null}_.has(e)||i.insertBefore(n,v),v=n}y&&y.firstChild&&i.insertBefore(y,v),e.records=f.filter(e=>e!==null),e.lastSyncedItems=a.slice()}function Ft(e,t,n,r){return j()?It(e,t,n,r):B(e,t,n,r)}function B(e,t,n,r){let{start:i,end:a}=xe(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),Pt(o),c&&Et(i,o),o}function It(e,t,n,r){let i=n;P(i);let a=M(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return B(e,t,n,r);let o=F(i),s=0,l=M(i);for(;l;){if(l.nodeType===8){let e=l.textContent||``;if(e.startsWith(`list-start-`))s++;else if(e===`list-end`){if(s===0)break;s--}}l=l.nextSibling}let u=l;if(!u){let e=C(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return B(e,t,n,r);let d=Dt(e()),f=[];for(let e=0;e<d.length;e++){let r=St(t(d[e],e),n,e);r&&f.push({item:d[e],element:r})}let p=M(i);for(;p&&p!==u;){let e=p.nextSibling;S(p),p=e}let m=u;for(let e=f.length-1;e>=0;e--){let t=f[e].element;(t.parentNode!==i||t.nextSibling!==m)&&i.insertBefore(t,m),m=t}N(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return c&&Et(o,h),h}function Lt(e){for(let t=0;t<e.records.length;t++){let n=e.records[t];n.element=null,n.item=null}e.records=[]}function Rt(e){let t=[];for(let n of R){let r=n.deref();if(!r){t.push(n);continue}let i=wt.get(r);if(!i){t.push(n);continue}if(!w(r)||!w(i.endMarker)){Lt(i),wt.delete(r),t.push(n);continue}e&&!e.contains(r)||Pt(i)}for(let e of t)R.delete(e)}function zt(e,t){return function(n,r){return Ft(e,t,n,r).startMarker}}function Bt(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function Vt(e,t){return typeof e==`function`?Bt(e,t):!!e}function Ht(e,t,n,r){return a(e)?o(e)?(k.delete(e),I(t,e,n)):Ie(t,r,()=>{let r=I(t,e,n);return r&&!r.parentNode?r:null}):I(t,e,n)}function Ut(e,t,n,r){let i=[];for(let a of e){let e=Ht(a,t,n,r);e&&i.push(e)}return i}const V=new Set,H=new WeakMap,Wt=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{V.delete(e)}):null;function Gt(e,t){for(let t=0;t<e.length;t++)if(Vt(e[t].condition))return t;return t.length>0?-1:null}function Kt(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=Gt(t,n);o!==e.activeIndex&&(Se(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&Ce(Ut(o>=0?t[o].content:n,r,i,a),a))}function qt(e){let t=new WeakRef(e.startMarker);V.add(t),H.set(e.startMarker,e),Wt?.register(e.startMarker,t)}function Jt(e){let t=[];for(let n of V){let r=n.deref();if(r===void 0){t.push(n);continue}let i=H.get(r);if(!i){t.push(n);continue}if(!w(r)||!w(i.endMarker)){H.delete(r),t.push(n);continue}if(!(e&&!e.contains(r)))try{i.update()}catch{H.delete(r),t.push(n)}}for(let e of t)V.delete(e)}function Yt(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function Xt(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var Zt=class e{groups=[];elseContent=[];constructor(e,...t){this.groups.push({condition:e,content:t})}cloneWith(t,n){let r=Object.create(e.prototype);return r.groups=[...this.groups],t&&r.groups.push(t),r.elseContent=n??[...this.elseContent],r}when(e,...t){return this.groups.push({condition:e,content:t}),this}else(...e){return this.elseContent=e,this}render(e,t){return globalThis.document?j()?this.hydrateRender(e,t):this.freshRender(e,t):null}freshRender(e,t){let{start:n,end:r}=xe(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=Fe(e);return a.appendChild(n),a.appendChild(r),Kt(i),n.textContent=Yt(t,i.activeIndex),n}hydrateRender(e,t){let n=e;P(n);let r=M(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=F(n),a=0,o=M(n);for(;o;){if(o.nodeType===8){let e=o.textContent||``;if(e.startsWith(`when-start-`))a++;else if(e===`when-end`){if(a===0)break;a--}}o=o.nextSibling}let s=o,c=!1;if(!s){let e=C(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=Gt(this.groups,this.elseContent),u=Xt(i.textContent);if(!c&&(u===void 0||u===l)){if(l!==null){let n=l>=0?this.groups[l].content:this.elseContent;for(let r of n)I(e,r,t)}}else if(Se(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;et(()=>{Ce(Ut(n,e,t,r),r)})}return N(n,s.nextSibling),this.createRuntimeFromMarkers(e,t,i,s,l),i}createRuntimeFromMarkers(e,t,n,r,i=null){let a={startMarker:n,endMarker:r,host:e,index:t,groups:[...this.groups],elseContent:[...this.elseContent],activeIndex:i,update:function(){Kt(a)}};return c&&qt(a),a}};function Qt(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return Qt(e.cloneWith({condition:t,content:n}))},else:function(...t){return Qt(e.cloneWith(void 0,t))}})}function $t(e,...t){return Qt(new Zt(e,...t))}function en(e){try{return e.isSvg?dt(e.tagName,e.modifiers):ut(e.tagName,e.modifiers)}catch(t){if(s(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=he(pe,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=me(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function tn(e){let t=fe(e);if(!t)return;let n=Bt(t.condition,e=>{s(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=en(t);le(n,t),Te(e,n)}else if(!n&&r){let n=be(t.tagName);n&&(le(n,t),Te(e,n))}}function nn(e){if(c)try{let t=de();for(let n of t){if(!n.isConnected){ue(n);continue}e&&!e.contains(n)||tn(n)}}catch(e){s(`Error during conditional elements update`,e)}}function rn(){if(typeof document>`u`)return;let e=document.body?[document.body,document]:[document];for(let t of e)try{t.dispatchEvent(new Event(`update`,{bubbles:!0}))}catch(e){s(`Error dispatching global update event`,e)}}const U=new Map;function an(e){let t=[],n=new Set;for(let r of e){if(typeof r!=`string`)continue;let e=r.trim();e&&(n.has(e)||(n.add(e),t.push(e)))}return t}function on(e,t){let n=U.get(e);n||(n=new Set,U.set(e,n)),n.add(new WeakRef(t))}function sn(e){let t=an(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=U.get(e);if(!t)continue;let r=[];for(let e of t){let t=e.deref();if(t===void 0){r.push(e);continue}if(!w(t)){r.push(e);continue}n.add(t)}for(let e of r)t.delete(e);t.size===0&&U.delete(e)}return Array.from(n)}function cn(...e){let t=an(e);return function(e){if(c&&e instanceof Element)for(let n of t)on(n,e)}}const ln=[Rt,Jt,nn,Pe,Je,rn];function un(...e){let t;if(e.length>0){let n=sn(e);if(n.length===1){let e=n[0];t={roots:n,contains:t=>e.contains(t)}}else t={roots:n,contains:e=>{for(let t of n)if(t.contains(e))return!0;return!1}}}for(let e of ln)e(t)}function dn(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function fn(e,t){let n=t||document.body,r=n;Qe();try{let t=e(n,0),i=t;if(i&&i.nodeType===1&&i.parentNode!==r){let e=M(r);if(e){let t=e.nextSibling;r.insertBefore(i,e),S(e),N(r,t)}else r.appendChild(i),N(r,null)}return t}finally{$e()}}let pn=null;function mn(e){pn=e}const hn=new Map,gn=new Map,_n=new Set,W=[],G=new Map;let K=null,q=null,J=null,Y=0;const X=new Map;function vn(e){for(let t of e)G.has(t)||G.set(t,[])}function yn(e,t){try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=e.cssRules[n];return X.set(t,r),r}catch{return null}}function bn(e,t){try{e.insertRule(t,Y),Y++}catch{}}function xn(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(q&&J===document&&q.ownerNode&&q.ownerNode.isConnected)return q;let e=document.getElementById(`nuclo-styles`);if(e||(e=document.createElement(`style`),e.id=`nuclo-styles`,document.head.appendChild(e)),q=e.sheet,J=document,X.clear(),Y=0,!q)return null;for(let e of W)bn(q,e);for(let[e,t]of G){let n=yn(q,e);if(n)for(let e of t)try{n.insertRule(e,n.cssRules.length)}catch{}}return q}function Sn(e,t){if(t===void 0)W.push(e);else{let n=G.get(t);n||(n=[],G.set(t,n)),n.push(e)}K=null,pn?.(t===void 0?e:t+`{`+e+`}`);let n=xn();if(n)if(t===void 0)bn(n,e);else{let r=X.get(t)??yn(n,t);if(r)try{r.insertRule(e,r.cssRules.length)}catch{}}}function Cn(e){let t=2166136261,n=2128831035;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n^i,2246822507)}return(t>>>0).toString(36)+((n>>>9)%1296).toString(36)}function Z(e,t,n,r){let i=(e??``)+`|`+t+`|`+n+`:`+r,a=hn.get(i);return a===void 0?(a=`n`+Cn(i),hn.set(i,a),gn.set(a,(e??``)+`|`+t+`|`+n),Sn(`.`+a+t+`{`+n+`:`+r+`}`,e),a):(xn(),a)}function wn(e){return gn.get(e)}function Tn(e,t){if(_n.has(e)){xn();return}_n.add(e),Sn(t,void 0)}function En(){if(K!==null)return K;let e=W.join(``);for(let[t,n]of G)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return K=e,e}function Dn(){hn.clear(),gn.clear(),_n.clear(),W.length=0,G.clear(),X.clear(),K=null,Y=0,q=null,J=null,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}const On={hover:`:hover`,focus:`:focus`,focusVisible:`:focus-visible`,focusWithin:`:focus-within`,active:`:active`,visited:`:visited`,disabled:`:disabled`,enabled:`:enabled`,checked:`:checked`,required:`:required`,invalid:`:invalid`,valid:`:valid`,readOnly:`:read-only`,first:`:first-child`,last:`:last-child`,only:`:only-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,empty:`:empty`,placeholderShown:`:placeholder-shown`,placeholder:`::placeholder`,before:`::before`,after:`::after`,selection:`::selection`,marker:`::marker`,firstLine:`::first-line`,firstLetter:`::first-letter`},kn={bg:[`background`],p:[`padding`],px:[`padding-left`,`padding-right`],py:[`padding-top`,`padding-bottom`],pt:[`padding-top`],pr:[`padding-right`],pb:[`padding-bottom`],pl:[`padding-left`],m:[`margin`],mx:[`margin-left`,`margin-right`],my:[`margin-top`,`margin-bottom`],mt:[`margin-top`],mr:[`margin-right`],mb:[`margin-bottom`],ml:[`margin-left`],w:[`width`],h:[`height`],minW:[`min-width`],maxW:[`max-width`],minH:[`min-height`],maxH:[`max-height`],size:[`width`,`height`],text:[`font-size`],font:[`font-family`],weight:[`font-weight`],leading:[`line-height`],tracking:[`letter-spacing`],align:[`text-align`],items:[`align-items`],justify:[`justify-content`],z:[`z-index`],rounded:[`border-radius`],shadow:[`box-shadow`],select:[`user-select`]},An={row:{display:`flex`,"flex-direction":`row`},col:{display:`flex`,"flex-direction":`column`},center:{"align-items":`center`,"justify-content":`center`},truncate:{overflow:`hidden`,"text-overflow":`ellipsis`,"white-space":`nowrap`}},jn={background:`colors`,"background-color":`colors`,color:`colors`,"border-color":`colors`,"border-top-color":`colors`,"border-right-color":`colors`,"border-bottom-color":`colors`,"border-left-color":`colors`,"outline-color":`colors`,"caret-color":`colors`,"text-decoration-color":`colors`,"font-family":`fonts`,"box-shadow":`shadows`,"border-radius":`radii`},Mn=new Set([`z-index`,`opacity`,`font-weight`,`line-height`,`flex`,`flex-grow`,`flex-shrink`,`order`,`aspect-ratio`,`zoom`,`scale`,`column-count`,`orphans`,`widows`,`tab-size`,`animation-iteration-count`,`grid-column`,`grid-row`]),Nn=new Map;function Pn(e){let t=Nn.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),Nn.set(e,t)),t}function Fn(e){return e.charCodeAt(0)===64?e:`@media `+e}function In(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Ln(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function Rn(e,t){for(let n of e)if(n)if(typeof n==`string`)for(let e of n.split(` `))e&&t.set(wn(e)??e,e);else if(Array.isArray(n))Rn(n,t);else for(let e of n.className.split(` `))e&&t.set(wn(e)??e,e)}function Q(...e){let t=new Map;Rn(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return Ln(n)}function zn(e={}){let t=e.screens??{};vn(Object.values(t).map(Fn));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||Mn.has(t)?String(n):n+`px`;let r=jn[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,n,a,o){for(let s in e){let c=e[s];if(c==null||c===!1)continue;if(typeof c==`object`){if(s===`raw`){let e=c;for(let t in e)o.push(Z(n,a,t,r(t,e[t])));continue}let e=On[s];if(e!==void 0){i(c,n,a+e,o);continue}let l=t[s];if(l!==void 0){i(c,In(n,Fn(l)),a,o);continue}let u=s.charCodeAt(0);if(u===38){i(c,n,a+s.slice(1),o);continue}if(u===64){i(c,In(n,s),a,o);continue}continue}if(c===!0){let e=An[s];if(e)for(let t in e)o.push(Z(n,a,t,e[t]));continue}let l=kn[s];if(l!==void 0)for(let e of l)o.push(Z(n,a,e,r(e,c)));else{let e=Pn(s);o.push(Z(n,a,e,r(e,c)))}}}function a(e){let t=n.get(e);if(t)return t;let r=[];i(e,void 0,``,r);let a=Ln(r.join(` `));return n.set(e,a),a}function o(e){let t=``,n=(e,n)=>{t+=(t?`;`:``)+e+`:`+n};for(let t in e){let i=e[t];if(i==null||i===!1)continue;if(t===`raw`&&typeof i==`object`){let e=i;for(let t in e)n(t,r(t,e[t]));continue}if(typeof i==`object`)continue;if(i===!0){let e=An[t];if(e)for(let t in e)n(t,e[t]);continue}let a=kn[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=Pn(t);n(e,r(e,i))}}return t}function s(e){let t=``;for(let n in e)t+=n+`{`+o(e[n])+`}`;let n=`nk`+Cn(t);return Tn(n,`@keyframes `+n+`{`+t+`}`),n}function c(e,t){let n=e+`{`+o(t)+`}`;Tn(`g|`+n,n)}function l(e){let t=e=>e===!0?`true`:e===!1?`false`:String(e),n=e.variants??{},r=Object.keys(n),i=e.defaultVariants??{},o=e.base?a(e.base):null,s={};for(let e of r){let t=n[e],r={};for(let e in t)r[e]=a(t[e]);s[e]=r}let c=(e.compoundVariants??[]).map(e=>{let{css:n,...r}=e,i={};for(let e in r)i[e]=t(r[e]);return{conditions:i,result:a(n)}}),l=new Map;return function(e){let n={};for(let a of r){let r=(e?e[a]:void 0)??i[a];r!=null&&(n[a]=t(r))}let a=``;for(let e of r)a+=e+`=`+(n[e]??``)+`;`;let u=l.get(a);if(u)return u;let d=[];o&&d.push(o);for(let e of r){let t=n[e];if(t!==void 0){let n=s[e][t];n&&d.push(n)}}for(let e of c){let t=!0;for(let r in e.conditions)if(n[r]!==e.conditions[r]){t=!1;break}t&&d.push(e.result)}let f=Q(...d);return l.set(a,f),f}}return{css:a,cx:Q,variants:l,keyframes:s,globalStyle:c,theme:e}}const $=zn({}),Bn=$.css,Vn=$.variants,Hn=$.keyframes,Un=$.globalStyle;function Wn(){xt();let e=globalThis;e.list=zt,e.update=un,e.when=$t,e.on=p,e.scope=cn,e.render=dn,e.hydrate=fn,e.createCss=zn,e.css=Bn,e.cx=Q,e.variants=Vn,e.keyframes=Hn,e.globalStyle=Un}Wn();export{gt as HTML_TAGS,vt as SELF_CLOSING_TAGS,_t as SVG_TAGS,we as appendChildren,O as applyAttributes,I as applyNodeModifier,C as createComment,be as createConditionalComment,zn as createCss,ut as createHtmlElementWithModifiers,mt as createHtmlTagBuilder,dt as createSvgElementWithModifiers,ht as createSvgTagBuilder,Bn as css,Q as cx,En as getCssText,Un as globalStyle,fn as hydrate,Wn as initializeRuntime,i as isBoolean,c as isBrowser,a as isFunction,t as isNode,n as isObject,e as isPrimitive,r as isTagLike,o as isZeroArityFunction,Hn as keyframes,zt as list,p as on,xt as registerGlobalTagBuilders,dn as render,Te as replaceNodeSafely,Dn as resetStyles,cn as scope,mn as setSSRCollector,un as update,Vn as variants,$t as when};
|
|
2
2
|
//# sourceMappingURL=nuclo.mjs.map
|