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/dist/nuclo.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Nuclo={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function n(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function r(e){return typeof e==`object`&&!!e}function i(e){return r(e)&&`tagName`in e}function a(e){return typeof e==`boolean`}function o(e){return typeof e==`function`}function s(e){return o(e)&&e.length===0}function c(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}let l=typeof window<`u`&&typeof document<`u`,u=new WeakMap;function d(e,t){let n=u.get(e);n?n.push(t):u.set(e,[t])}function f(e,t){e.removeEventListener(t.type,t.wrapped,t.options)}function p(e,t){let n=u.get(e);if(!n)return;if(t===void 0){for(let t=0;t<n.length;t++)f(e,n[t]);u.delete(e);return}let r=0;for(let i=0;i<n.length;i++){let a=n[i];a.type===t?f(e,a):n[r++]=a}n.length=r,r===0&&u.delete(e)}function m(e,t,n){return function(r){if(!l||!r||typeof r.addEventListener!=`function`)return;let i=r,a=function(n){try{t.call(i,n)}catch(t){c(`Error in '${e}' listener`,t)}};i.addEventListener(e,a,n),d(i,{type:e,wrapped:a,options:n})}}let h=new Set,g=new WeakMap,_=new Set,v=new WeakMap,y=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{h.delete(e)}):null,ee=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{_.delete(e)}):null;function te(e,t){let n=g.get(e);if(n){n.info.resolver=t.resolver,n.info.lastValue=t.lastValue;return}let r=new WeakRef(e);h.add(r),g.set(e,{ref:r,info:t}),y?.register(e,r)}function ne(e,t){let n=new WeakRef(e);_.add(n),v.set(e,{ref:n,info:t}),ee?.register(e,n)}function re(e){h.delete(e)}function ie(e){_.delete(e)}function ae(e){let t=g.get(e);t&&(h.delete(t.ref),g.delete(e))}function oe(e){let t=v.get(e);t&&(_.delete(t.ref),v.delete(e))}let se=new WeakMap,b=new Set,ce=new WeakMap,le=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{b.delete(e)}):null;function ue(e,t){se.set(e,t);let n=new WeakRef(e);b.add(n),ce.set(e,n),le?.register(e,n)}function de(e){se.delete(e);let t=ce.get(e);t&&(b.delete(t),ce.delete(e))}function fe(){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 pe(e){return se.get(e)??null}let me=`http://www.w3.org/2000/svg`;function he(e){return globalThis.document?document.createElement(e):null}function ge(e,t){return globalThis.document?document.createElementNS(e,t):null}function x(e){return globalThis.document?document.createTextNode(e):null}function _e(){return globalThis.document?document.createDocumentFragment():null}function ve(e,t){try{return e.appendChild(t),!0}catch(e){return c(`Failed to append child node`,e),!1}}function ye(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;p(t),oe(t),de(t)}else e.nodeType===Node.TEXT_NODE?ae(e):e.nodeType===Node.COMMENT_NODE&&de(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)ye(e.childNodes[t])}function S(e){if(!e?.parentNode)return!1;try{return ye(e),e.parentNode.removeChild(e),!0}catch(e){return c(`Failed to remove child node`,e),!1}}function be(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return c(`Failed to insert node before reference`,e),!1}}function C(e){return globalThis.document?globalThis.document.createComment(e):null}function xe(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function Se(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 Ce(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;S(n),n=e}}function we(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)be(n,e[r],t)}function Te(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;ve(e,t)}}return e}function w(e){return e?.isConnected===!0}function Ee(e,t){if(!e?.parentNode)return!1;try{return e.parentNode.replaceChild(t,e),!0}catch(e){return c(`Error replacing conditional node`,e),!1}}let De={},Oe=!1;function ke(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=v.get(n);e&&(w(n)?Ne(e.info):(ie(e.ref),v.delete(n)))}n=n.parentNode}}function Ae(){Oe||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,ke,!0),Oe=!0)}function je(e){let t=v.get(e);if(t)return t.info;let n={attributeResolvers:new Map};return ne(e,n),n}function Me(e){return typeof e!=`object`||!e}function T(e,t){let n;try{n=t.resolver()}catch(t){c(`Failed to resolve reactive attribute: ${e}`,t);return}let r=Me(n);if(!(r&&Object.is(n,t.lastValue)))try{t.applyValue(n),t.lastValue=r?n:De}catch(t){c(`Failed to apply reactive attribute: ${e}`,t)}}function Ne(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`){c(`Invalid parameters for registerAttributeResolver`);return}let i={resolver:n,applyValue:r,lastValue:De};if(!l){T(t,i);return}Ae(),je(e).attributeResolvers.set(t,i),T(t,i)}function Pe(e){let t=[];for(let n of _){let r=n.deref();if(r===void 0){t.push(n);continue}let i=v.get(r);if(!i){t.push(n);continue}if(!w(r)){v.delete(r),t.push(n);continue}e&&!e.contains(r)||Ne(i.info)}for(let e of t)ie(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])||c(`Failed to set style property '${n}'`)}function ze(e,t){e&&(o(t)?E(e,`style`,t,function(t){Re(e,t)}):Re(e,t))}let D=new WeakMap,Be=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 Ve(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function He(e){if(e.className&&!D.has(e)){let t=new Set;O(t,e.className),D.set(e,t)}Be.add(e)}function Ue(e){return Be.has(e)}function We(e,t){if(!t)return;let n=D.get(e);n||(n=new Set,D.set(e,n)),O(n,t)}function Ge(e,t){let n=D.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;O(r,n),O(r,t),e.className=Ve(r)}else e.className=t}function qe(e,t){if(typeof e!=`function`){c(`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){c(`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 l&&te(i,{resolver:e,lastValue:r}),i}function Je(e){let t=[];for(let n of h){let r=n.deref();if(r===void 0){t.push(n);continue}let i=g.get(r);if(!i){t.push(n);continue}let a=i.info;if(!w(r)){g.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;let o;try{o=a.resolver()}catch(e){c(`Failed to update reactive text node`,e),o=void 0}let s=o===void 0?``:String(o);s!==a.lastValue&&(r.textContent=s,a.lastValue=s)}for(let e of t)re(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(o(n)&&n.length===0){let r=n;t===`className`&&e instanceof HTMLElement?(He(e),E(e,String(t),r,function(t){Ge(e,String(t||``))})):E(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 k(e,t,n=!0){if(t)for(let r of Object.keys(t)){let i=t[r];Ye(e,r,i,n&&r===`className`)}}let A=new WeakMap,j=!1,Xe=new WeakMap;function M(){return j}function Ze(){return!1}function Qe(){j=!0,Xe=new WeakMap}function $e(){j=!1}function et(e){let t=j;j=!1;try{return e()}finally{j=t}}function N(e){let t=Xe.get(e);return t===void 0?e.firstChild:t}function P(e,t){Xe.set(e,t)}function tt(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function F(e){let t=N(e),n=!1;for(;t&&tt(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 nt(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 rt(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 it(e){return r(e)&&!n(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function at(e){F(e);let t=N(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function ot(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(e,i,a){if(i==null)return null;if(o(i)){if(s(i))try{let n=A.get(i);if(n||(n={value:i(),error:!1},A.set(i,n)),n.error)return ct(a,()=>``);let r=n.value;if(it(r))return k(e,{className:()=>{let e=i();return it(e)?e.className:``}}),null;if(t(r)&&r!=null){if(M()&&at(e)){let t=e;I(t);let n=String(r),a=ot(t,n);return a&&te(a,{resolver:i,lastValue:n}),null}return ct(a,i,r)}return null}catch(e){return A.set(i,{value:void 0,error:!0}),c(`Error evaluating reactive text function:`,e),ct(a,()=>``)}let o=i(e,a);return o==null?null:t(o)?lt(a,o):n(o)?o:(r(o)&&k(e,o),null)}let l=i;if(t(l)){if(M()&&at(e)){let t=e;return I(t),ot(t,String(l)),null}return lt(a,l)}return n(l)?l:(k(e,l),null)}function st(e,t){if(l&&!M()&&!Ze())return t;let n=_e();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 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 ut(e,t){let n=he(e);return R(n,t,0),n}function dt(e,t){let n=ge(me,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return R(n,t,0),n}function ft(e,...t){return function(n,r=0){let i=n,a=i?nt(i,e):null,o=a??he(e),s=o,c=a?s.lastChild:null;return R(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??ge(`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&&rt(s,c),o}}function mt(e){return(...t)=>ft(e,...t)}function ht(e){return(...t)=>pt(e,...t)}let 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(o(e)){let r=e(t,n);return r&&i(r)?r:null}return e&&i(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}let z=new Set,B=new WeakMap,wt=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{z.delete(e)}):null;function Tt(e,t){let n=new WeakRef(e);z.add(n),B.set(e,t),wt?.register(e,n)}function Et(e){return Array.isArray(e)?e:Array.from(e)}function Dt(e,t,n){return St(e.renderItem(t,n),e.host,n)}function Ot(e){let t=e;t.element=null,t.item=null}function V(e){S(e.element),Ot(e)}function kt(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),Ot(r)}return!0}function At(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 jt(e,t,n,r,i,a,o){let s=_e(),c=0;for(let l=r;l<i;l++){let r=n[l],i=Dt(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 Mt(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Nt(e){let{host:t,startMarker:n,endMarker:r}=e,i=n.parentNode??t,a=Et(e.itemsProvider());if(Ct(e.lastSyncedItems,a))return;let o=e.records,s=a.length;if(s===0){if(!kt(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=[];jt(e,i,a,0,s,r,t),e.records=t,e.lastSyncedItems=a.slice();return}let c=e.lastSyncedItems;if(s>c.length&&Mt(c,a)){jt(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=Dt(e,n,t);if(!i){f[t]=null;continue}r={item:n,element:i}}f[t]=r}if(m===0){if(!kt(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=At(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||=_e(),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 Pt(e,t,n,r){return M()?Ft(e,t,n,r):H(e,t,n,r)}function H(e,t,n,r){let{start:i,end:a}=Se(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),Nt(o),l&&Tt(i,o),o}function Ft(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,c=N(i);for(;c;){if(c.nodeType===8){let e=c.textContent||``;if(e.startsWith(`list-start-`))s++;else if(e===`list-end`){if(s===0)break;s--}}c=c.nextSibling}let u=c;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=Et(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=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 l&&Tt(o,h),h}function It(e){for(let t=0;t<e.records.length;t++){let n=e.records[t];n.element=null,n.item=null}e.records=[]}function Lt(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)){It(i),B.delete(r),t.push(n);continue}e&&!e.contains(r)||Nt(i)}for(let e of t)z.delete(e)}function Rt(e,t){return function(n,r){return Pt(e,t,n,r).startMarker}}function zt(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function Bt(e,t){return typeof e==`function`?zt(e,t):!!e}function Vt(e,t,n,r){return o(e)?s(e)?(A.delete(e),L(t,e,n)):Ie(t,r,()=>{let r=L(t,e,n);return r&&!r.parentNode?r:null}):L(t,e,n)}function Ht(e,t,n,r){let i=[];for(let a of e){let e=Vt(a,t,n,r);e&&i.push(e)}return i}let U=new Set,W=new WeakMap,Ut=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{U.delete(e)}):null;function Wt(e,t){for(let t=0;t<e.length;t++)if(Bt(e[t].condition))return t;return t.length>0?-1:null}function Gt(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=Wt(t,n);o!==e.activeIndex&&(Ce(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&we(Ht(o>=0?t[o].content:n,r,i,a),a))}function Kt(e){let t=new WeakRef(e.startMarker);U.add(t),W.set(e.startMarker,e),Ut?.register(e.startMarker,t)}function qt(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 Jt(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function Yt(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var Xt=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}=Se(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=Fe(e);return a.appendChild(n),a.appendChild(r),Gt(i),n.textContent=Jt(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=Wt(this.groups,this.elseContent),u=Yt(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(Ce(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;et(()=>{we(Ht(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(){Gt(a)}};return l&&Kt(a),a}};function Zt(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return Zt(e.cloneWith({condition:t,content:n}))},else:function(...t){return Zt(e.cloneWith(void 0,t))}})}function Qt(e,...t){return Zt(new Xt(e,...t))}function $t(e){try{return e.isSvg?dt(e.tagName,e.modifiers):ut(e.tagName,e.modifiers)}catch(t){if(c(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=ge(me,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=he(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function en(e){let t=pe(e);if(!t)return;let n=zt(t.condition,e=>{c(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=$t(t);ue(n,t),Ee(e,n)}else if(!n&&r){let n=xe(t.tagName);n&&(ue(n,t),Ee(e,n))}}function tn(e){if(l)try{let t=fe();for(let n of t){if(!n.isConnected){de(n);continue}e&&!e.contains(n)||en(n)}}catch(e){c(`Error during conditional elements update`,e)}}function nn(){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){c(`Error dispatching global update event`,e)}}let G=new Map;function rn(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 an(e,t){let n=G.get(e);n||(n=new Set,G.set(e,n)),n.add(new WeakRef(t))}function on(e){let t=rn(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 sn(...e){let t=rn(e);return function(e){if(l&&e instanceof Element)for(let n of t)an(n,e)}}let cn=[Lt,qt,tn,Pe,Je,nn];function ln(...e){let t;if(e.length>0){let n=on(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 cn)e(t)}function un(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function dn(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=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{$e()}}let fn=null;function pn(e){fn=e}let mn=new Map,hn=new Map,gn=new Set,K=[],q=new Map,J=null,Y=null,X=null,Z=0,Q=new Map;function _n(e){for(let t of e)q.has(t)||q.set(t,[])}function vn(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 yn(e,t){try{e.insertRule(t,Z),Z++}catch{}}function bn(){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)yn(Y,e);for(let[e,t]of q){let n=vn(Y,e);if(n)for(let e of t)try{n.insertRule(e,n.cssRules.length)}catch{}}return Y}function xn(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,fn?.(t===void 0?e:t+`{`+e+`}`);let n=bn();if(n)if(t===void 0)yn(n,e);else{let r=Q.get(t)??vn(n,t);if(r)try{r.insertRule(e,r.cssRules.length)}catch{}}}function Sn(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=mn.get(i);return a===void 0?(a=`n`+Sn(i),mn.set(i,a),hn.set(a,(e??``)+`|`+t+`|`+n),xn(`.`+a+t+`{`+n+`:`+r+`}`,e),a):(bn(),a)}function Cn(e){return hn.get(e)}function wn(e,t){if(gn.has(e)){bn();return}gn.add(e),xn(t,void 0)}function Tn(){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 En(){mn.clear(),hn.clear(),gn.clear(),K.length=0,q.clear(),Q.clear(),J=null,Z=0,Y=null,X=null,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}let Dn={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`},On={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`]},kn={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`}},An={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`},jn=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`]),Mn=new Map;function Nn(e){let t=Mn.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),Mn.set(e,t)),t}function Pn(e){return e.charCodeAt(0)===64?e:`@media `+e}function Fn(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function In(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function Ln(...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(Cn(n)??n,n)}let n=``;for(let e of t.values())n+=(n?` `:``)+e;return In(n)}function Rn(e={}){let t=e.screens??{};_n(Object.values(t).map(Pn));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||jn.has(t)?String(n):n+`px`;let r=An[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=Dn[s];if(e!==void 0){i(c,n,a+e,o);continue}let l=t[s];if(l!==void 0){i(c,Fn(n,Pn(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,Fn(n,s),a,o);continue}continue}if(c===!0){let e=kn[s];if(e)for(let t in e)o.push($(n,a,t,e[t]));continue}let l=On[s];if(l!==void 0)for(let e of l)o.push($(n,a,e,r(e,c)));else{let e=Nn(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=In(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=kn[t];if(e)for(let t in e)n(t,e[t]);continue}let a=On[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=Nn(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`+Sn(t);return wn(n,`@keyframes `+n+`{`+t+`}`),n}function c(e,t){let n=e+`{`+o(t)+`}`;wn(`g|`+n,n)}return{css:a,cx:Ln,keyframes:s,globalStyle:c,theme:e}}let zn=Rn({}),Bn=zn.css,Vn=zn.keyframes,Hn=zn.globalStyle;function Un(){xt();let e=globalThis;e.list=Rt,e.update=ln,e.when=Qt,e.on=m,e.scope=sn,e.render=un,e.hydrate=dn,e.createCss=Rn,e.css=Bn,e.cx=Ln,e.keyframes=Vn,e.globalStyle=Hn}Un(),e.HTML_TAGS=gt,e.SELF_CLOSING_TAGS=vt,e.SVG_TAGS=_t,e.appendChildren=Te,e.applyAttributes=k,e.applyNodeModifier=L,e.createComment=C,e.createConditionalComment=xe,e.createCss=Rn,e.createHtmlElementWithModifiers=ut,e.createHtmlTagBuilder=mt,e.createSvgElementWithModifiers=dt,e.createSvgTagBuilder=ht,e.css=Bn,e.cx=Ln,e.getCssText=Tn,e.globalStyle=Hn,e.hydrate=dn,e.initializeRuntime=Un,e.isBoolean=a,e.isBrowser=l,e.isFunction=o,e.isNode=n,e.isObject=r,e.isPrimitive=t,e.isTagLike=i,e.isZeroArityFunction=s,e.keyframes=Vn,e.list=Rt,e.on=m,e.registerGlobalTagBuilders=xt,e.render=un,e.replaceNodeSafely=Ee,e.resetStyles=En,e.scope=sn,e.setSSRCollector=pn,e.update=ln,e.when=Qt});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Nuclo={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function n(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function r(e){return typeof e==`object`&&!!e}function i(e){return r(e)&&`tagName`in e}function a(e){return typeof e==`boolean`}function o(e){return typeof e==`function`}function s(e){return o(e)&&e.length===0}function c(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}let l=typeof window<`u`&&typeof document<`u`,u=new WeakMap;function d(e,t){let n=u.get(e);n?n.push(t):u.set(e,[t])}function f(e,t){e.removeEventListener(t.type,t.wrapped,t.options)}function p(e,t){let n=u.get(e);if(!n)return;if(t===void 0){for(let t=0;t<n.length;t++)f(e,n[t]);u.delete(e);return}let r=0;for(let i=0;i<n.length;i++){let a=n[i];a.type===t?f(e,a):n[r++]=a}n.length=r,r===0&&u.delete(e)}function m(e,t,n){return function(r){if(!l||!r||typeof r.addEventListener!=`function`)return;let i=r,a=function(n){try{t.call(i,n)}catch(t){c(`Error in '${e}' listener`,t)}};i.addEventListener(e,a,n),d(i,{type:e,wrapped:a,options:n})}}let h=new Set,g=new WeakMap,_=new Set,v=new WeakMap,y=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{h.delete(e)}):null,ee=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{_.delete(e)}):null;function te(e,t){let n=g.get(e);if(n){n.info.resolver=t.resolver,n.info.lastValue=t.lastValue;return}let r=new WeakRef(e);h.add(r),g.set(e,{ref:r,info:t}),y?.register(e,r)}function ne(e,t){let n=new WeakRef(e);_.add(n),v.set(e,{ref:n,info:t}),ee?.register(e,n)}function re(e){h.delete(e)}function ie(e){_.delete(e)}function ae(e){let t=g.get(e);t&&(h.delete(t.ref),g.delete(e))}function oe(e){let t=v.get(e);t&&(_.delete(t.ref),v.delete(e))}let se=new WeakMap,b=new Set,ce=new WeakMap,le=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{b.delete(e)}):null;function ue(e,t){se.set(e,t);let n=new WeakRef(e);b.add(n),ce.set(e,n),le?.register(e,n)}function de(e){se.delete(e);let t=ce.get(e);t&&(b.delete(t),ce.delete(e))}function fe(){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 pe(e){return se.get(e)??null}let me=`http://www.w3.org/2000/svg`;function he(e){return globalThis.document?document.createElement(e):null}function ge(e,t){return globalThis.document?document.createElementNS(e,t):null}function x(e){return globalThis.document?document.createTextNode(e):null}function _e(){return globalThis.document?document.createDocumentFragment():null}function ve(e,t){try{return e.appendChild(t),!0}catch(e){return c(`Failed to append child node`,e),!1}}function ye(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;p(t),oe(t),de(t)}else e.nodeType===Node.TEXT_NODE?ae(e):e.nodeType===Node.COMMENT_NODE&&de(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)ye(e.childNodes[t])}function S(e){if(!e?.parentNode)return!1;try{return ye(e),e.parentNode.removeChild(e),!0}catch(e){return c(`Failed to remove child node`,e),!1}}function be(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return c(`Failed to insert node before reference`,e),!1}}function C(e){return globalThis.document?globalThis.document.createComment(e):null}function xe(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function Se(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 Ce(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;S(n),n=e}}function we(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)be(n,e[r],t)}function Te(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;ve(e,t)}}return e}function w(e){return e?.isConnected===!0}function Ee(e,t){if(!e?.parentNode)return!1;try{return e.parentNode.replaceChild(t,e),!0}catch(e){return c(`Error replacing conditional node`,e),!1}}let De={},Oe=!1;function ke(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=v.get(n);e&&(w(n)?Ne(e.info):(ie(e.ref),v.delete(n)))}n=n.parentNode}}function Ae(){Oe||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,ke,!0),Oe=!0)}function je(e){let t=v.get(e);if(t)return t.info;let n={attributeResolvers:new Map};return ne(e,n),n}function Me(e){return typeof e!=`object`||!e}function T(e,t){let n;try{n=t.resolver()}catch(t){c(`Failed to resolve reactive attribute: ${e}`,t);return}let r=Me(n);if(!(r&&Object.is(n,t.lastValue)))try{t.applyValue(n),t.lastValue=r?n:De}catch(t){c(`Failed to apply reactive attribute: ${e}`,t)}}function Ne(e){for(let[t,n]of e.attributeResolvers)T(t,n)}function Pe(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){c(`Invalid parameters for registerAttributeResolver`);return}let i={resolver:n,applyValue:r,lastValue:De};if(!l){T(t,i);return}Ae(),je(e).attributeResolvers.set(t,i),T(t,i)}function Fe(e){let t=[];for(let n of _){let r=n.deref();if(r===void 0){t.push(n);continue}let i=v.get(r);if(!i){t.push(n);continue}if(!w(r)){v.delete(r),t.push(n);continue}e&&!e.contains(r)||Ne(i.info)}for(let e of t)ie(e)}function Ie(e){return e}function Le(e,t,n){let r=Ie(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 Re(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 ze(e,t){if(!(!e?.style||!t))for(let n in t)Re(e,n,t[n])||c(`Failed to set style property '${n}'`)}function Be(e,t){e&&(o(t)?Pe(e,`style`,t,function(t){ze(e,t)}):ze(e,t))}let E=new WeakMap,Ve=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 He(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function Ue(e){if(e.className&&!E.has(e)){let t=new Set;D(t,e.className),E.set(e,t)}Ve.add(e)}function We(e){return Ve.has(e)}function Ge(e,t){if(!t)return;let n=E.get(e);n||(n=new Set,E.set(e,n)),D(n,t)}function Ke(e,t){let n=E.get(e);if(!n||n.size===0){e.className=t||``;return}if(!t){e.className=He(n);return}let r=He(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 qe(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=He(r)}else e.className=t}function Je(e,t){if(typeof e!=`function`){c(`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){c(`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 l&&te(i,{resolver:e,lastValue:r}),i}function Ye(e){let t=[];for(let n of h){let r=n.deref();if(r===void 0){t.push(n);continue}let i=g.get(r);if(!i){t.push(n);continue}let a=i.info;if(!w(r)){g.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;let o;try{o=a.resolver()}catch(e){c(`Failed to update reactive text node`,e),o=void 0}let s=o===void 0?``:String(o);s!==a.lastValue&&(r.textContent=s,a.lastValue=s)}for(let e of t)re(e)}function Xe(e,t,n,r=!1){if(n==null)return;if(t===`style`){Be(e,n);return}let i=(n,r=!1)=>{if(n!=null){if(t===`className`&&e instanceof HTMLElement&&r){qe(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(o(n)&&n.length===0){let r=n;t===`className`&&e instanceof HTMLElement?(Ue(e),Pe(e,String(t),r,function(t){Ke(e,String(t||``))})):Pe(e,String(t),r,function(e){i(e,!1)})}else{if(t===`className`&&e instanceof HTMLElement&&We(e)){let t=String(n||``);t&&(Ge(e,t),qe(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];Xe(e,r,i,n&&r===`className`)}}let k=new WeakMap,A=!1,Ze=new WeakMap;function j(){return A}function Qe(){return!1}function $e(){A=!0,Ze=new WeakMap}function et(){A=!1}function tt(e){let t=A;A=!1;try{return e()}finally{A=t}}function M(e){let t=Ze.get(e);return t===void 0?e.firstChild:t}function N(e,t){Ze.set(e,t)}function nt(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function P(e){let t=M(e),n=!1;for(;t&&nt(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 rt(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 it(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 at(e){return r(e)&&!n(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function ot(e){P(e);let t=M(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function st(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(e,i,a){if(i==null)return null;if(o(i)){if(s(i))try{let n=k.get(i);if(n||(n={value:i(),error:!1},k.set(i,n)),n.error)return lt(a,()=>``);let r=n.value;if(at(r))return O(e,{className:()=>{let e=i();return at(e)?e.className:``}}),null;if(t(r)&&r!=null){if(j()&&ot(e)){let t=e;F(t);let n=String(r),a=st(t,n);return a&&te(a,{resolver:i,lastValue:n}),null}return lt(a,i,r)}return null}catch(e){return k.set(i,{value:void 0,error:!0}),c(`Error evaluating reactive text function:`,e),lt(a,()=>``)}let o=i(e,a);return o==null?null:t(o)?ut(a,o):n(o)?o:(r(o)&&O(e,o),null)}let l=i;if(t(l)){if(j()&&ot(e)){let t=e;return F(t),st(t,String(l)),null}return ut(a,l)}return n(l)?l:(O(e,l),null)}function ct(e,t){if(l&&!j()&&!Qe())return t;let n=_e();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 lt(e,t,n){return ct(e,Je(t,n))}function ut(e,t){return ct(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 dt(e,t){let n=he(e);return L(n,t,0),n}function ft(e,t){let n=ge(me,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return L(n,t,0),n}function pt(e,...t){return function(n,r=0){let i=n,a=i?rt(i,e):null,o=a??he(e),s=o,c=a?s.lastChild:null;return L(o,t,r),a&&it(s,c),o}}function mt(e,...t){return function(n,r=0){let i=n,a=i?rt(i,e):null,o=a??ge(`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&&it(s,c),o}}function ht(e){return(...t)=>pt(e,...t)}function gt(e){return(...t)=>mt(e,...t)}let _t=`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(`.`),vt=`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(`.`),yt=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`];function bt(e,t){t in e&&typeof e[t]!=`function`||(e[t]=ht(t))}function xt(e,t){let n=`${t}Svg`;n in e||(e[n]=gt(t))}function St(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<vt.length;t++)xt(e,vt[t]);for(let t=0;t<_t.length;t++)bt(e,_t[t]);e[t]=!0}}function Ct(e,t,n){if(o(e)){let r=e(t,n);return r&&i(r)?r:null}return e&&i(e)?e:null}function wt(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}let R=new Set,Tt=new WeakMap,Et=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{R.delete(e)}):null;function Dt(e,t){let n=new WeakRef(e);R.add(n),Tt.set(e,t),Et?.register(e,n)}function Ot(e){return Array.isArray(e)?e:Array.from(e)}function kt(e,t,n){return Ct(e.renderItem(t,n),e.host,n)}function At(e){let t=e;t.element=null,t.item=null}function z(e){S(e.element),At(e)}function jt(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),At(r)}return!0}function Mt(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 Nt(e,t,n,r,i,a,o){let s=_e(),c=0;for(let l=r;l<i;l++){let r=n[l],i=kt(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 Pt(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ft(e){let{host:t,startMarker:n,endMarker:r}=e,i=n.parentNode??t,a=Ot(e.itemsProvider());if(wt(e.lastSyncedItems,a))return;let o=e.records,s=a.length;if(s===0){if(!jt(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=[];Nt(e,i,a,0,s,r,t),e.records=t,e.lastSyncedItems=a.slice();return}let c=e.lastSyncedItems;if(s>c.length&&Pt(c,a)){Nt(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=kt(e,n,t);if(!i){f[t]=null;continue}r={item:n,element:i}}f[t]=r}if(m===0){if(!jt(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=Mt(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||=_e(),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 It(e,t,n,r){return j()?Lt(e,t,n,r):B(e,t,n,r)}function B(e,t,n,r){let{start:i,end:a}=Se(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),Ft(o),l&&Dt(i,o),o}function Lt(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,c=M(i);for(;c;){if(c.nodeType===8){let e=c.textContent||``;if(e.startsWith(`list-start-`))s++;else if(e===`list-end`){if(s===0)break;s--}}c=c.nextSibling}let u=c;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=Ot(e()),f=[];for(let e=0;e<d.length;e++){let r=Ct(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 l&&Dt(o,h),h}function Rt(e){for(let t=0;t<e.records.length;t++){let n=e.records[t];n.element=null,n.item=null}e.records=[]}function zt(e){let t=[];for(let n of R){let r=n.deref();if(!r){t.push(n);continue}let i=Tt.get(r);if(!i){t.push(n);continue}if(!w(r)||!w(i.endMarker)){Rt(i),Tt.delete(r),t.push(n);continue}e&&!e.contains(r)||Ft(i)}for(let e of t)R.delete(e)}function Bt(e,t){return function(n,r){return It(e,t,n,r).startMarker}}function Vt(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function Ht(e,t){return typeof e==`function`?Vt(e,t):!!e}function Ut(e,t,n,r){return o(e)?s(e)?(k.delete(e),I(t,e,n)):Le(t,r,()=>{let r=I(t,e,n);return r&&!r.parentNode?r:null}):I(t,e,n)}function Wt(e,t,n,r){let i=[];for(let a of e){let e=Ut(a,t,n,r);e&&i.push(e)}return i}let V=new Set,H=new WeakMap,Gt=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{V.delete(e)}):null;function Kt(e,t){for(let t=0;t<e.length;t++)if(Ht(e[t].condition))return t;return t.length>0?-1:null}function qt(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=Kt(t,n);o!==e.activeIndex&&(Ce(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&we(Wt(o>=0?t[o].content:n,r,i,a),a))}function Jt(e){let t=new WeakRef(e.startMarker);V.add(t),H.set(e.startMarker,e),Gt?.register(e.startMarker,t)}function Yt(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 Xt(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function Zt(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var Qt=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}=Se(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=Ie(e);return a.appendChild(n),a.appendChild(r),qt(i),n.textContent=Xt(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=Kt(this.groups,this.elseContent),u=Zt(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(Ce(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;tt(()=>{we(Wt(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(){qt(a)}};return l&&Jt(a),a}};function $t(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return $t(e.cloneWith({condition:t,content:n}))},else:function(...t){return $t(e.cloneWith(void 0,t))}})}function en(e,...t){return $t(new Qt(e,...t))}function tn(e){try{return e.isSvg?ft(e.tagName,e.modifiers):dt(e.tagName,e.modifiers)}catch(t){if(c(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=ge(me,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=he(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function nn(e){let t=pe(e);if(!t)return;let n=Vt(t.condition,e=>{c(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=tn(t);ue(n,t),Ee(e,n)}else if(!n&&r){let n=xe(t.tagName);n&&(ue(n,t),Ee(e,n))}}function rn(e){if(l)try{let t=fe();for(let n of t){if(!n.isConnected){de(n);continue}e&&!e.contains(n)||nn(n)}}catch(e){c(`Error during conditional elements update`,e)}}function an(){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){c(`Error dispatching global update event`,e)}}let U=new Map;function on(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 sn(e,t){let n=U.get(e);n||(n=new Set,U.set(e,n)),n.add(new WeakRef(t))}function cn(e){let t=on(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 ln(...e){let t=on(e);return function(e){if(l&&e instanceof Element)for(let n of t)sn(n,e)}}let un=[zt,Yt,rn,Fe,Ye,an];function dn(...e){let t;if(e.length>0){let n=cn(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 un)e(t)}function fn(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),i}function pn(e,t){let n=t||document.body,r=n;$e();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{et()}}let mn=null;function hn(e){mn=e}let gn=new Map,_n=new Map,vn=new Set,W=[],G=new Map,K=null,q=null,J=null,Y=0,X=new Map;function yn(e){for(let t of e)G.has(t)||G.set(t,[])}function bn(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 xn(e,t){try{e.insertRule(t,Y),Y++}catch{}}function Sn(){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)xn(q,e);for(let[e,t]of G){let n=bn(q,e);if(n)for(let e of t)try{n.insertRule(e,n.cssRules.length)}catch{}}return q}function Cn(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,mn?.(t===void 0?e:t+`{`+e+`}`);let n=Sn();if(n)if(t===void 0)xn(n,e);else{let r=X.get(t)??bn(n,t);if(r)try{r.insertRule(e,r.cssRules.length)}catch{}}}function wn(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=gn.get(i);return a===void 0?(a=`n`+wn(i),gn.set(i,a),_n.set(a,(e??``)+`|`+t+`|`+n),Cn(`.`+a+t+`{`+n+`:`+r+`}`,e),a):(Sn(),a)}function Tn(e){return _n.get(e)}function En(e,t){if(vn.has(e)){Sn();return}vn.add(e),Cn(t,void 0)}function Dn(){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 On(){gn.clear(),_n.clear(),vn.clear(),W.length=0,G.clear(),X.clear(),K=null,Y=0,q=null,J=null,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}let kn={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`},An={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`]},jn={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`}},Mn={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`},Nn=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`]),Pn=new Map;function Fn(e){let t=Pn.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),Pn.set(e,t)),t}function In(e){return e.charCodeAt(0)===64?e:`@media `+e}function Ln(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Rn(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function zn(e,t){for(let n of e)if(n)if(typeof n==`string`)for(let e of n.split(` `))e&&t.set(Tn(e)??e,e);else if(Array.isArray(n))zn(n,t);else for(let e of n.className.split(` `))e&&t.set(Tn(e)??e,e)}function Q(...e){let t=new Map;zn(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return Rn(n)}function Bn(e={}){let t=e.screens??{};yn(Object.values(t).map(In));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||Nn.has(t)?String(n):n+`px`;let r=Mn[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=kn[s];if(e!==void 0){i(c,n,a+e,o);continue}let l=t[s];if(l!==void 0){i(c,Ln(n,In(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,Ln(n,s),a,o);continue}continue}if(c===!0){let e=jn[s];if(e)for(let t in e)o.push(Z(n,a,t,e[t]));continue}let l=An[s];if(l!==void 0)for(let e of l)o.push(Z(n,a,e,r(e,c)));else{let e=Fn(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=Rn(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=jn[t];if(e)for(let t in e)n(t,e[t]);continue}let a=An[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=Fn(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`+wn(t);return En(n,`@keyframes `+n+`{`+t+`}`),n}function c(e,t){let n=e+`{`+o(t)+`}`;En(`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}}let $=Bn({}),Vn=$.css,Hn=$.variants,Un=$.keyframes,Wn=$.globalStyle;function Gn(){St();let e=globalThis;e.list=Bt,e.update=dn,e.when=en,e.on=m,e.scope=ln,e.render=fn,e.hydrate=pn,e.createCss=Bn,e.css=Vn,e.cx=Q,e.variants=Hn,e.keyframes=Un,e.globalStyle=Wn}Gn(),e.HTML_TAGS=_t,e.SELF_CLOSING_TAGS=yt,e.SVG_TAGS=vt,e.appendChildren=Te,e.applyAttributes=O,e.applyNodeModifier=I,e.createComment=C,e.createConditionalComment=xe,e.createCss=Bn,e.createHtmlElementWithModifiers=dt,e.createHtmlTagBuilder=ht,e.createSvgElementWithModifiers=ft,e.createSvgTagBuilder=gt,e.css=Vn,e.cx=Q,e.getCssText=Dn,e.globalStyle=Wn,e.hydrate=pn,e.initializeRuntime=Gn,e.isBoolean=a,e.isBrowser=l,e.isFunction=o,e.isNode=n,e.isObject=r,e.isPrimitive=t,e.isTagLike=i,e.isZeroArityFunction=s,e.keyframes=Un,e.list=Bt,e.on=m,e.registerGlobalTagBuilders=St,e.render=fn,e.replaceNodeSafely=Ee,e.resetStyles=On,e.scope=ln,e.setSSRCollector=hn,e.update=dn,e.variants=Hn,e.when=en});
2
2
  //# sourceMappingURL=nuclo.umd.js.map