nuclo 0.2.31 → 0.2.33
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 +20 -0
- package/dist/Element-C3mU75-a.mjs +2 -0
- package/dist/Element-C3mU75-a.mjs.map +1 -0
- package/dist/nuclo.cjs +2 -0
- package/dist/nuclo.cjs.map +1 -0
- package/dist/nuclo.mjs +2 -0
- package/dist/nuclo.mjs.map +1 -0
- package/dist/nuclo.umd.js +2 -0
- package/dist/nuclo.umd.js.map +1 -0
- package/dist/polyfill/nuclo.polyfill.mjs +2 -0
- package/dist/polyfill/nuclo.polyfill.mjs.map +1 -0
- package/dist/ssr/nuclo.ssr.cjs +1 -1
- package/dist/ssr/nuclo.ssr.cjs.map +1 -1
- package/dist/ssr/nuclo.ssr.mjs +2 -0
- package/dist/ssr/nuclo.ssr.mjs.map +1 -0
- package/package.json +10 -10
- package/types/core/base.d.ts +12 -0
- package/types/core/lifecycle.d.ts +28 -0
- package/types/features/on.d.ts +27 -2
- package/types/index.d.ts +8 -0
|
@@ -0,0 +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=!1,d=new WeakMap;function f(){return u}function p(){return!1}function m(){u=!0,d=new WeakMap}function h(){u=!1}function ee(e){let t=u;u=!1;try{return e()}finally{u=t}}function g(e){let t=d.get(e);return t===void 0?e.firstChild:t}function _(e,t){d.set(e,t)}function v(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function y(e){let t=g(e),n=!1;for(;t&&v(t);)t=t.nextSibling,n=!0;n&&_(e,t)}function b(e){let t=g(e);return t&&_(e,t.nextSibling),t}function x(e,t){if(!u)return null;y(e);let n=g(e);return n&&n.nodeType===1&&n.tagName.toLowerCase()===t?b(e):null}function S(e,t){if(!t)return;let n=g(e);for(;n;){let r=n===t?null:n.nextSibling;e.removeChild(n),n=r}_(e,null)}let C=new WeakMap,w=0,T=[];function E(){return!l||p()}function D(e){let t=C.get(e);return t||(t={mount:null,destroy:null,state:0,queued:!1},C.set(e,t),w++),t}function O(e,t){return e===null?t:Array.isArray(e)?(e.push(t),e):[e,t]}function te(e,t){t.queued||t.state!==0||(t.queued=!0,T.push(e))}function ne(e,t){if(E())return;let n=D(e);n.state!==2&&(n.mount=O(n.mount,t),te(e,n))}function re(e,t){if(E())return;let n=D(e);n.state!==2&&(n.destroy=O(n.destroy,t),te(e,n))}function ie(e,t,n){try{let r=t(e);typeof r==`function`&&(n.destroy=O(n.destroy,r))}catch(e){c(`Error in mount callback`,e)}}function ae(e,t){try{t(e)}catch(e){c(`Error in destroy callback`,e)}}function oe(e){let t=C.get(e);if(!t||(t.queued=!1,t.state!==0))return;t.state=1;let n=t.mount;if(n!==null){if(Array.isArray(n))for(let r=0;r<n.length;r++)ie(e,n[r],t);else ie(e,n,t)}}function se(){if(T.length===0)return;let e=T;T=[];for(let t=0;t<e.length;t++)oe(e[t])}function ce(e){let t=C.get(e);if(!t||t.state===2)return;let n=t.state===1;if(t.state=2,w--,n){let n=t.destroy;if(n!==null){if(Array.isArray(n))for(let t=0;t<n.length;t++)ae(e,n[t]);else ae(e,n)}}t.mount=null,t.destroy=null}function le(){return w>0}let k=new WeakMap;function ue(e,t){let n=k.get(e);n?Array.isArray(n)?n.includes(t)||n.push(t):n!==t&&k.set(e,[n,t]):k.set(e,t)}function A(e,t){e.removeEventListener(t.type,t.wrapped,t.capture)}function de(e,t){let n=k.get(e);if(!n)return;if(t===void 0){if(Array.isArray(n))for(let t=0;t<n.length;t++)A(e,n[t]);else A(e,n);k.delete(e);return}if(!Array.isArray(n)){n.type===t&&(A(e,n),k.delete(e));return}let r=0;for(let i=0;i<n.length;i++){let a=n[i];a.type===t?A(e,a):n[r++]=a}r===0?k.delete(e):r===1?k.set(e,n[0]):n.length=r}function fe(e){}function pe(e,t){return l?function(n){if(!n)return;let r=n;e===`mount`?ne(r,t):re(r,t)}:fe}function me(e,t,n){return{type:e,wrapped:function(n){let r=this;try{t.call(r,n)}catch(t){c(`Error in '${e}' listener`,t)}},capture:n}}function he(e,t,n){if(e===`mount`||e===`destroy`)return pe(e,t);if(!l)return fe;let r=me(e,t,n===!0||typeof n==`object`&&!!n&&n.capture===!0);return function(t){if(!t||typeof t.addEventListener!=`function`)return;let i=t;i.addEventListener(e,r.wrapped,n),ue(i,r)}}let j=new Set,M=new WeakMap,N=new Set,P=new WeakMap;function ge(e,t){let n=M.get(e);if(n){n.info.resolver=t.resolver,n.info.lastValue=t.lastValue,n.info.sanitize=t.sanitize;return}let r=new WeakRef(e);j.add(r),M.set(e,{ref:r,info:t})}function _e(e,t){let n=new WeakRef(e);N.add(n),P.set(e,{ref:n,info:t})}function ve(e){j.delete(e)}function ye(e){N.delete(e)}function be(e){let t=M.get(e);t&&(j.delete(t.ref),M.delete(e))}function xe(e){let t=P.get(e);t&&(N.delete(t.ref),P.delete(e))}let Se=new WeakMap,F=new Set,Ce=new WeakMap,we=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{F.delete(e)}):null;function Te(e,t){Se.set(e,t);let n=new WeakRef(e);F.add(n),Ce.set(e,n),we?.register(e,n)}function Ee(e){Se.delete(e);let t=Ce.get(e);t&&(F.delete(t),Ce.delete(e))}function De(){let e=[],t=[];for(let n of F){let r=n.deref();r===void 0?t.push(n):e.push(r)}for(let e of t)F.delete(e);return e}function Oe(e){return Se.get(e)??null}let ke=`http://www.w3.org/2000/svg`;function Ae(e){return globalThis.document?document.createElement(e):null}function je(e,t){return globalThis.document?document.createElementNS(e,t):null}function I(e){return globalThis.document?document.createTextNode(e):null}function Me(){return globalThis.document?document.createDocumentFragment():null}function Ne(e,t){try{return e.appendChild(t),!0}catch(e){return c(`Failed to append child node`,e),!1}}function Pe(e){if(e.nodeType===Node.ELEMENT_NODE){let t=e;de(t),xe(t),Ee(t)}else e.nodeType===Node.TEXT_NODE?be(e):e.nodeType===Node.COMMENT_NODE&&Ee(e);if(e.childNodes&&e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)Pe(e.childNodes[t]);e.nodeType===Node.ELEMENT_NODE&&ce(e)}function Fe(e){if(!le())return;let t=e.childNodes;for(let e=0;e<t.length;e++)Fe(t[e]);e.nodeType===Node.ELEMENT_NODE&&ce(e)}function L(e){if(!e?.parentNode)return!1;try{return Pe(e),e.parentNode.removeChild(e),!0}catch(e){return c(`Failed to remove child node`,e),!1}}function Ie(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return c(`Failed to insert node before reference`,e),!1}}function R(e){return globalThis.document?globalThis.document.createComment(e):null}function Le(e,t=`hidden`){return globalThis.document?globalThis.document.createComment(`conditional-${e}-${t}`):null}function Re(e,t){let n=R(`${e}-end`);if(!n)throw Error(`Failed to create comment: document not available`);let r=R(`${e}-start-${t}`);if(!r)throw Error(`Failed to create comment: document not available`);return{start:r,end:n}}function ze(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;L(n),n=e}}function Be(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)Ie(n,e[r],t)}function Ve(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=I(r);if(e)t=e;else continue}else t=r;Ne(e,t)}}return e}function z(e){return e?.isConnected===!0}function He(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}}function Ue(e){return e}function We(e,t,n){let r=Ue(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 Ge(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}}let Ke={},qe=!1;function Je(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=P.get(n);e&&(z(n)?$e(e.info):(ye(e.ref),P.delete(n)))}n=n.parentNode}}function Ye(){qe||typeof document>`u`||typeof document.addEventListener!=`function`||(document.addEventListener(`update`,Je,!0),qe=!0)}function Xe(e){let t=P.get(e);if(t)return t.info;let n={attributeResolvers:[]};return _e(e,n),n}function Ze(e){return typeof e!=`object`||!e}function Qe(e){let t;try{t=e.resolver()}catch(t){c(`Failed to resolve reactive attribute: ${e.key}`,t);return}let n=Ze(t);if(!(n&&Object.is(t,e.lastValue)))try{e.applyValue(t),e.lastValue=n?t:Ke}catch(t){c(`Failed to apply reactive attribute: ${e.key}`,t)}}function $e(e){let t=e.attributeResolvers;for(let e=0;e<t.length;e++)Qe(t[e])}function et(e,t,n,r){if(!(e instanceof Element)||!t||typeof n!=`function`){c(`Invalid parameters for registerAttributeResolver`);return}let i={key:t,resolver:n,applyValue:r,lastValue:Ke};if(!l){Qe(i);return}Ye();let a=Xe(e).attributeResolvers,o=!1;for(let e=0;e<a.length;e++)if(a[e].key===t){a[e]=i,o=!0;break}o||a.push(i),Qe(i)}function tt(e){let t=[];for(let n of N){let r=n.deref();if(r===void 0){t.push(n);continue}let i=P.get(r);if(!i){t.push(n);continue}if(!z(r)){P.delete(r),t.push(n);continue}(!e||e.contains(r))&&$e(i.info)}for(let e of t)ye(e)}function nt(e,t){if(e?.style&&t)for(let n in t)Ge(e,n,t[n])||c(`Failed to set style property '${n}'`)}function rt(e,t){e&&(o(t)?et(e,`style`,t,function(t){nt(e,t)}):nt(e,t))}let it=new Set([`onMount`,`onDestroy`]),at=new WeakMap;function ot(e){if(e.length<=2||e.charCodeAt(0)!==111||e.charCodeAt(1)!==110)return null;let t=e.charCodeAt(2);return t<65||t>90||it.has(e)?null:e===`onDoubleClick`?`ondblclick`:e.toLowerCase()}function st(e,t,n){if(t in e){e[t]=n;return}let r=t.slice(2),i=at.get(e);if(i){for(let t=0;t<i.length;t+=2){if(i[t]!==r)continue;let a=i[t+1];if(a===n)return;e.removeEventListener(r,a),e.addEventListener(r,n),i[t+1]=n;return}e.addEventListener(r,n),i.push(r,n);return}e.addEventListener(r,n),at.set(e,[r,n])}let B=new WeakMap,ct=new WeakSet;function V(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 lt(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function ut(e){if(e.className&&!B.has(e)){let t=new Set;V(t,e.className),B.set(e,t)}ct.add(e)}function dt(e){return ct.has(e)}function ft(e,t){if(!t)return;let n=B.get(e);n||(n=new Set,B.set(e,n)),V(n,t)}function pt(e,t){let n=B.get(e);if(!n||n.size===0){let n=t||``;e.className!==n&&(e.className=n);return}if(!t){e.className=lt(n);return}let r=lt(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 mt(e,t){if(!t)return;let n=e.className;if(n&&n!==t){let r=new Set;V(r,n),V(r,t),e.className=lt(r)}else e.className=t}function ht(e,t,n){if(typeof e!=`function`){c(`Invalid resolver provided to createReactiveTextNode`);let e=I(``);if(!e)throw Error(`Failed to create text node: document not available`);return e}let r;if(arguments.length>1)r=t;else try{r=e()}catch(e){c(`Failed to evaluate reactive text resolver`,e),r=``}let i=r===void 0?``:String(r),a=I(i);if(!a)throw Error(`Failed to create text node: document not available`);return l&&ge(a,{resolver:e,lastValue:i,sanitize:n}),a}function gt(e){let t=[];for(let n of j){let r=n.deref();if(r===void 0){t.push(n);continue}let i=M.get(r);if(!i){t.push(n);continue}let a=i.info;if(!z(r)){M.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=a.sanitize?o==null||typeof o==`object`||typeof o==`function`?``:String(o):o===void 0?``:String(o);s!==a.lastValue&&(r.textContent=s,a.lastValue=s)}for(let e of t)ve(e)}function _t(e,t,n,r){if(n!=null){if(r&&t===`className`&&e instanceof HTMLElement){mt(e,String(n));return}if(e instanceof Element&&e.namespaceURI===`http://www.w3.org/2000/svg`)e.setAttribute(t,String(n));else if(t in e)try{e[t]=n}catch{e instanceof Element&&e.setAttribute(t,String(n))}else e instanceof Element&&e.setAttribute(t,String(n))}}function vt(e,t,n,r=!1){if(n==null)return;let i=t;if(i===`style`){rt(e,n);return}if(o(n)){if(i===`onMount`){ne(e,n);return}if(i===`onDestroy`){re(e,n);return}if(i===`onClick`){e.onclick=n;return}if(i.charCodeAt(0)===111&&i.charCodeAt(1)===110){let t=ot(i);if(t){st(e,t,n);return}if(i in e){e[i]=n;return}}if(n.length===0){let t=n;i===`className`&&e instanceof HTMLElement?(ut(e),et(e,i,t,function(t){pt(e,String(t||``))})):et(e,i,t,function(t){_t(e,i,t,!1)});return}}if(i===`className`&&e instanceof HTMLElement&&dt(e)){let t=String(n||``);t&&(ft(e,t),mt(e,t));return}_t(e,i,n,r)}function H(e,t,n=!0){if(t)for(let r in t){let i=r,a=t[r];vt(e,i,a,n&&i===`className`)}}let U=new WeakMap;function yt(e){return r(e)&&!n(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function bt(e){y(e);let t=g(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function xt(e,t){let n=g(e);if(n&&n.nodeType===3)return b(e),n.textContent!==t&&(n.textContent=t),n;let r=I(t);return r?(e.insertBefore(r,n),_(e,n),r):null}function W(e,i,a){if(i==null)return null;if(o(i)){if(s(i))try{let n=U.get(i);if(n||(n={value:i(),error:!1},U.set(i,n)),n.error)return Ct(a,()=>``);let r=n.value;if(yt(r))return H(e,{className:()=>{let e=i();return yt(e)?e.className:``}}),null;if(t(r)){let t=i,n=r??``;if(f()&&bt(e)){let r=e;b(r);let i=String(n),a=xt(r,i);return a&&ge(a,{resolver:t,lastValue:i,sanitize:!0}),null}return Ct(a,t,n,!0)}return null}catch(e){return U.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)?wt(a,o):n(o)?o:(r(o)&&H(e,o),null)}let l=i;if(t(l)){if(f()&&bt(e)){let t=e;return b(t),xt(t,String(l)),null}return wt(a,l)}return n(l)?l:(H(e,l),null)}function St(e,t){if(l&&!f()&&!p())return t;let n=Me();if(!n)throw Error(`Failed to create document fragment: document not available`);let r=R(` text-${e} `);return r&&n.appendChild(r),t&&n.appendChild(t),n}function Ct(e,t,n,r){return St(e,ht(t,n,r))}function wt(e,t){return St(e,I(String(t)))}let Tt=Symbol(`nuclo.factory.tag`),Et=Symbol(`nuclo.factory.mods`),G=0,Dt=[],Ot=0;function kt(){return Ot>=Dt.length&&Dt.push(()=>null),Dt[Ot++]}function At(e,t,n){e[Tt]=t,e[Et]=n}function K(e){return typeof e==`function`?e[Et]:void 0}function q(e){return typeof e==`function`?e[Tt]:void 0}function jt(){return G>0}function Mt(e,t,n){let r=G===0;G++,r&&(Ot=0);try{return e(t,n)}finally{G--}}function J(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=W(e,a,r);o&&(o.parentNode!==i&&i.appendChild(o),r+=1)}}function Nt(e,t){let n=Ae(e);if(!n)throw Error(`Failed to create element: ${e}`);return J(n,t,0),n}function Pt(e,t){let n=je(ke,e);if(!n)throw Error(`Failed to create SVG element: ${e}`);return J(n,t,0),n}function Ft(e,t){if(jt()){let n=kt();return At(n,e,t),n}let n=function(n,r=0){let i=n,a=i?x(i,e):null,o=a??Ae(e);if(!o)throw Error(`Failed to create element: ${e}`);let s=o,c=a?s.lastChild:null;return J(o,t,r),a&&S(s,c),o};return At(n,e,t),n}function It(e,t){if(jt()){let n=kt();return At(n,e,t),n}return function(n,r=0){let i=n,a=i?x(i,e):null,o=a??je(`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 J(o,t,r),a&&S(s,c),o}}function Lt(e){return(...t)=>Ft(e,t)}function Rt(e){return(...t)=>It(e,t)}let zt=`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(`.`),Bt=`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 Ht(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let r=n();return Object.defineProperty(e,t,{value:r,configurable:!0,enumerable:!0,writable:!0}),r},set(n){Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}})}function Ut(e,t){t in e&&typeof e[t]!=`function`||(Ht(e,t,()=>Lt(t)),t===`var`&&Ht(e,`var_`,()=>Lt(t)))}function Wt(e,t){let n=`${t}Svg`;n in e||Ht(e,n,()=>Rt(t))}function Gt(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<Bt.length;t++)Wt(e,Bt[t]);for(let t=0;t<zt.length;t++)Ut(e,zt[t]);e[t]=!0}}function Y(e,t,n){if(o(e)){let r=e(t,n);return r&&i(r)?r:null}return e&&i(e)?e:null}function Kt(e,t){let r=[],i=0;for(let e=0;e<t.length;e++){let a=t[e];if(a==null){r.push({kind:4});continue}let o=typeof a;if(o===`function`){let e=K(a);if(e!==void 0){let t=q(a);if(!t)return null;let n=Kt(t,e);if(!n)return null;r.push({kind:3,child:n});continue}if(a.length===0){let e;try{e=a(),U.set(a,{value:e,error:!1})}catch{return null}if(e==null||typeof e!=`object`&&typeof e!=`function`){r.push({kind:2});continue}return null}return null}if(o===`object`){if(n(a))return null;let e=a,t=Object.keys(e),o=[];for(let n=0;n<t.length;n++){let r=t[n],a=e[r];if(a==null){o.push({key:r,kind:3,prop:!1});continue}if(r===`style`)return null;let s=typeof a;if(s===`function`){let e=ot(r);if(e){o.push({key:r,kind:1,prop:!1,value:e});continue}if(r===`className`&&a.length===0){if(i++)return null;o.push({key:r,kind:2,prop:!1});continue}return null}if(s===`object`||r===`className`&&i++)return null;o.push({key:r,kind:0,prop:!1,value:a})}r.push({kind:0,keys:o});continue}r.push({kind:1})}return{tag:e,slots:r}}function qt(e,t){let n=e.slots,r=t.firstChild;for(let e=0;e<n.length;e++){let i=n[e];switch(i.kind){case 0:{let e=i.keys;for(let n=0;n<e.length;n++){let r=e[n];r.kind===0?r.prop=r.key in t:r.kind===2&&(t.className=``)}break}case 1:case 2:r&&=r.nextSibling;break;case 3:if(!r)return;qt(i.child,r),r=r.nextSibling}}}function Jt(e,t,n,r){let i=e.slots;if(t.length!==i.length)return!1;let a=n.firstChild;for(let e=0;e<i.length;e++){let o=i[e],s=t[e];switch(o.kind){case 0:{if(typeof s!=`object`||!s)return!1;let e=s,t=o.keys,i=0;for(let t in e)i++;if(i!==t.length)return!1;for(let i=0;i<t.length;i++){let a=t[i],o=e[a.key];switch(a.kind){case 0:if(o==null||typeof o==`object`||typeof o==`function`)return!1;if(o===a.value)break;if(a.prop){let e=n;e[a.key]!==o&&(e[a.key]=o)}else{let e=String(o);n.getAttribute(a.key)!==e&&n.setAttribute(a.key,e)}break;case 1:{if(typeof o!=`function`)return!1;let e=a.value;e===`onclick`?n.onclick=o:st(n,e,o);break}case 2:{if(typeof o!=`function`||o.length!==0)return!1;let e=o,t;try{t=e()}catch{return!1}let i=t?String(t):``;i&&(n.className=i),r.push({kind:1,node:n,fn:e,last:i});break}case 3:if(o!=null)return!1}}break}case 1:if(s==null||typeof s==`object`||typeof s==`function`||!a)return!1;a.nodeValue=String(s),a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||K(s)!==void 0||!a)return!1;let e;try{e=s()}catch{return!1}if(e!=null&&(typeof e==`object`||typeof e==`function`))return!1;let t=e==null?``:String(e),n=a;n.nodeValue=t,r.push({kind:0,node:n,fn:s,last:t}),a=n.nextSibling;break}case 3:{let e=K(s);if(e===void 0||q(s)!==o.child.tag||!a||!Jt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1}}return!0}function Yt(e,t,n,r){let i=e.slots;if(t.length!==i.length)return!1;let a=n.firstChild;for(let e=0;e<i.length;e++){let o=i[e],s=t[e];switch(o.kind){case 0:{if(typeof s!=`object`||!s)return!1;let e=s,t=o.keys,i=0;for(let a in e){if(i>=t.length)return!1;let o=t[i];if(o.key!==a)return!1;i++;let s=e[a];if(o.kind===2){if(typeof s!=`function`||s.length!==0)return!1;xe(n),r.push({kind:1,node:n,fn:s,last:n.className})}}if(i!==t.length)return!1;break}case 1:if(!a)return!1;a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||!a||a.nodeType!==3)return!1;let e=a;be(e),r.push({kind:0,node:e,fn:s,last:e.nodeValue??``}),a=e.nextSibling;break}case 3:{let e=K(s);if(e===void 0||q(s)!==o.child.tag||!a||!Yt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1}}return!0}function Xt(e){for(let t=0;t<e.length;t++){let n=e[t],r;try{r=n.fn()}catch{continue}if(n.kind===0){let e=r==null||typeof r==`object`||typeof r==`function`?``:String(r);e!==n.last&&(n.node.nodeValue=e,n.last=e)}else{let e=r?String(r):``;e!==n.last&&(n.node.className=e,n.last=e)}}}function Zt(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 X=new Set,Qt=new WeakMap,$t=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{X.delete(e)}):null,en=0;function tn(e,t){let n=new WeakRef(e);X.add(n),Qt.set(e,t),$t?.register(e,n)}function nn(e){return Array.isArray(e)?e:Array.from(e)}function rn(e){if(typeof e!=`object`||!e)return!1;let t=e.element;return!!t&&typeof Node<`u`&&t instanceof Node}function an(e,t,n){let r=e.renderItem(t,n);return rn(r)?(e.lastRenderRefresh=typeof r.update==`function`?r.update:null,r.element):Y(r,e.host,n)}function on(e,t,n){e.lastRenderLeaves=null,e.lastRenderRefresh=null;let r=e.template,i=l&&!f()&&!p(),a=r&&i?Mt(e.renderItem,t,n):e.renderItem(t,n);if(rn(a))return e.lastRenderRefresh=typeof a.update==`function`?a.update:null,a.element;if(r!==null&&i){let i=K(a);if(i!==void 0){if(r===void 0){let t=q(a),r=t?Kt(t,i):null,o=Y(a,e.host,n);if(r&&o){let t=o.cloneNode(!0);qt(r,t);let n=[];if(Yt(r,i,o,n))n.length>0&&(e.lastRenderLeaves=n);else return e.template=null,e.lastRenderLeaves=null,o;e.template={tmpl:r,skeleton:t}}else e.template=null;return o}let o=r.skeleton.cloneNode(!0),s=[];return Jt(r.tmpl,i,o,s)?(s.length>0&&(e.lastRenderLeaves=s),o):(e.template=null,an(e,t,n))}if(r===void 0)e.template=null;else return e.template=null,an(e,t,n)}return Y(a,e.host,n)}function sn(e){L(e.element)}function cn(e,t,n,r){if(n.parentNode!==t||r.parentNode!==t)return!1;if(le())for(let t=0;t<e.length;t++){let n=e[t].element;n&&Fe(n)}if(l&&t.firstChild===n&&t.lastChild===r)return t.textContent=``,t.appendChild(n),t.appendChild(r),!0;for(let n=0;n<e.length;n++){let r=e[n].element;r&&r.parentNode===t&&t.removeChild(r)}return!0}function ln(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 un(e,t,n,r,i,a,o){let s=Me(),c=0;for(let l=r;l<i;l++){let r=n[l],i=on(e,r,l);if(!i)continue;let u=e.lastRenderLeaves;o.push({item:r,element:i,dyn:u,refresh:e.lastRenderRefresh,dynCreatedAt:u?e.currentFlushEpoch:void 0});let d=i;s?(s.appendChild(d),c++):t.insertBefore(d,a)}s&&c>0&&t.insertBefore(s,a)}function dn(e){let{startMarker:t,endMarker:n}=e,r=t.parentNode??e.host,i=nn(e.itemsProvider());if(Zt(e.lastSyncedItems,i))return;let a=e.records,o=a.length,s=i.length;if(s===0){if(o>0&&!cn(a,r,t,n))for(let e=0;e<o;e++)sn(a[e]);e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0;return}let c=0,l=Math.min(o,s);for(;c<l&&a[c].item===i[c];)c++;let u=0,d=l-c;for(;u<d&&a[o-1-u].item===i[s-1-u];)u++;let f=c,p=o-u,m=c,h=s-u;if(f===p){let t=p<o?a[p].element:n;if(p===o)un(e,r,i,m,h,t,a),e.allRecordsCreatedAt=o===0?e.currentFlushEpoch:void 0;else{let n=[];un(e,r,i,m,h,t,n),e.records=a.slice(0,f).concat(n,a.slice(f)),e.allRecordsCreatedAt=void 0}e.lastSyncedItems=i.slice();return}if(m===h){for(let e=f;e<p;e++)sn(a[e]);a.splice(f,p-f),e.allRecordsCreatedAt=void 0,e.lastSyncedItems=i.slice();return}let ee=p-f,g=h-m,_=Array(g).fill(-1),v=new Uint8Array(ee),y=0,b=Math.min(p,h);for(let e=c;e<b;e++)a[e].item===i[e]&&(_[e-m]=e,v[e-f]=1,y++);let x=new Map;for(let e=f;e<p;e++){if(v[e-f])continue;let t=a[e].item,n=x.get(t);n===void 0?x.set(t,e):typeof n==`number`?x.set(t,[n,e]):n.push(e)}for(let e=0;e<g;e++){if(_[e]!==-1)continue;let t=x.get(i[m+e]);if(t===void 0)continue;let n;typeof t==`number`?(n=t,x.delete(i[m+e])):(n=t.shift(),t.length===0&&x.delete(i[m+e])),_[e]=n,v[n-f]=1,y++}if(y===0&&f===0&&p===o){if(!cn(a,r,t,n))for(let e=0;e<o;e++)sn(a[e]);let c=[];un(e,r,i,0,s,n,c),e.records=c,e.allRecordsCreatedAt=e.currentFlushEpoch,e.lastSyncedItems=i.slice();return}for(let e=f;e<p;e++)v[e-f]||sn(a[e]);let S=null;if(y>0){let e=[],t=[];for(let n=0;n<g;n++)_[n]!==-1&&(e.push(_[n]),t.push(n));S=new Uint8Array(g);let n=ln(e);for(let e=0;e<n.length;e++)S[t[n[e]]]=1}let C=Array(g),w=0,T=p<o?a[p].element:n,E=null;for(let t=g-1;t>=0;t--){let n=_[t];if(n===-1){let n=i[m+t],a=on(e,n,m+t);if(!a){C[t]=null,w++;continue}let o=e.lastRenderLeaves;C[t]={item:n,element:a,dyn:o,refresh:e.lastRenderRefresh,dynCreatedAt:o?e.currentFlushEpoch:void 0};let s=a;E||=Me(),E?E.insertBefore(s,E.firstChild):(r.insertBefore(s,T),T=s);continue}let o=a[n];C[t]=o;let s=o.element;if(E&&E.firstChild){let e=E.firstChild;r.insertBefore(E,T),T=e,E=null}(!S||!S[t])&&r.insertBefore(s,T),T=s}E&&E.firstChild&&r.insertBefore(E,T);let D=Array(f+(g-w)+(o-p)),O=0;for(let e=0;e<f;e++)D[O++]=a[e];for(let e=0;e<g;e++){let t=C[e];t&&(D[O++]=t)}for(let e=p;e<o;e++)D[O++]=a[e];e.records=D,e.allRecordsCreatedAt=void 0,e.lastSyncedItems=i.slice()}function fn(e,t,n,r){return f()?mn(e,t,n,r):pn(e,t,n,r)}function pn(e,t,n,r){let{start:i,end:a}=Re(`list`,r),o={itemsProvider:e,renderItem:t,startMarker:i,endMarker:a,records:[],host:n,lastSyncedItems:[]},s=n;return s.appendChild(i),s.appendChild(a),dn(o),l&&tn(i,o),o}function mn(e,t,n,r){let i=n;y(i);let a=g(i);if(!a||a.nodeType!==8||!a.textContent?.startsWith(`list-start-`))return pn(e,t,n,r);let o=b(i),s=0,c=g(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=R(`list-end`);e&&(i.insertBefore(e,o.nextSibling),u=e)}if(!u)return pn(e,t,n,r);let d=nn(e()),f=[];for(let e=0;e<d.length;e++){let r=t(d[e],e),i=rn(r)?r:null,a=i?i.element:Y(r,n,e);a&&f.push({item:d[e],element:a,refresh:i&&typeof i.update==`function`?i.update:void 0})}let p=g(i);for(;p&&p!==u;){let e=p.nextSibling;L(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}_(i,u.nextSibling);let h={itemsProvider:e,renderItem:t,startMarker:o,endMarker:u,records:f,host:n,lastSyncedItems:d.slice()};return l&&tn(o,h),h}function hn(e){for(let t=0;t<e.records.length;t++){let n=e.records[t];n.element=null,n.item=null,n.dyn=null,n.refresh=null,delete n.dynCreatedAt}e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0}function gn(e){let t=[];en++;for(let n of X){let r=n.deref();if(!r){t.push(n);continue}let i=Qt.get(r);if(!i){t.push(n);continue}if(!z(r)||!z(i.endMarker)){hn(i),Qt.delete(r),t.push(n);continue}if(e&&!e.contains(r))continue;i.currentFlushEpoch=en;try{dn(i)}finally{i.currentFlushEpoch=void 0}if(i.allRecordsCreatedAt===en)continue;let a=i.records;for(let e=0;e<a.length;e++){if(a[e].dynCreatedAt===en)continue;let t=a[e].refresh;t&&t();let n=a[e].dyn;n&&Xt(n)}}for(let e of t)X.delete(e)}function _n(e,t){return function(n,r){return fn(e,t,n,r).startMarker}}function vn(e,t){try{return e()}catch(e){if(t)return t(e),!1;throw e}}function yn(e,t){return typeof e==`function`?vn(e,t):!!e}let bn=new Set,xn=new WeakMap,Sn=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{bn.delete(e)}):null;function Cn(e,t){for(let t=0;t<e.length;t++)if(yn(e[t].condition))return t;return t.length>0?-1:null}function wn(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=Cn(t,n);o===e.activeIndex||(ze(e.startMarker,e.endMarker),e.activeIndex=o,o===null)||Be(On(o>=0?t[o].content:n,r,i,a),a)}function Tn(e){let t=new WeakRef(e.startMarker);bn.add(t),xn.set(e.startMarker,e),Sn?.register(e.startMarker,t)}function En(e){let t=[];for(let n of bn){let r=n.deref();if(r===void 0){t.push(n);continue}let i=xn.get(r);if(!i){t.push(n);continue}if(!z(r)||!z(i.endMarker)){xn.delete(r),t.push(n);continue}if(!e||e.contains(r))try{i.update()}catch(e){c(`when() branch threw during update; unregistering this conditional`,e),xn.delete(r),t.push(n)}}for(let e of t)bn.delete(e)}function Dn(e,t,n,r){return o(e)?s(e)?(U.delete(e),W(t,e,n)):We(t,r,()=>{let r=W(t,e,n);return r&&!r.parentNode?r:null}):W(t,e,n)}function On(e,t,n,r){let i=[];for(let a of e){let e=Dn(a,t,n,r);e&&i.push(e)}return i}function kn(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function An(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var jn=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?f()?this.hydrateRender(e,t):this.freshRender(e,t):null}freshRender(e,t){let{start:n,end:r}=Re(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=Ue(e);return a.appendChild(n),a.appendChild(r),wn(i),n.textContent=kn(t,i.activeIndex),n}hydrateRender(e,t){let n=e;y(n);let r=g(n);if(!r||r.nodeType!==8||!r.textContent?.startsWith(`when-start-`))return this.freshRender(e,t);let i=b(n),a=0,o=g(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=R(`when-end`);if(!e)return i;n.insertBefore(e,i.nextSibling),s=e,c=!0}let l=Cn(this.groups,this.elseContent),u=An(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)W(e,r,t)}}else if(ze(i,s),l!==null){let n=l>=0?this.groups[l].content:this.elseContent,r=s;ee(()=>{Be(On(n,e,t,r),r)})}return _(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(){wn(a)}};return l&&Tn(a),a}};function Mn(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return Mn(e.cloneWith({condition:t,content:n}))},else:function(...t){return Mn(e.cloneWith(void 0,t))}})}function Nn(e,...t){return Mn(new jn(e,...t))}function Pn(e){try{return e.isSvg?Pt(e.tagName,e.modifiers):Nt(e.tagName,e.modifiers)}catch(t){if(c(`Error applying modifiers in conditional element "${e.tagName}"`,t),e.isSvg){let n=je(ke,e.tagName);if(!n)throw Error(`Failed to create SVG element: ${e.tagName}`,{cause:t});return n}let n=Ae(e.tagName);if(!n)throw Error(`Failed to create element: ${e.tagName}`,{cause:t});return n}}function Fn(e){let t=Oe(e);if(!t)return;let n=vn(t.condition,e=>{c(`Error evaluating conditional condition`,e)}),r=e.nodeType===Node.ELEMENT_NODE;if(n&&!r){let n=Pn(t);Te(n,t),He(e,n)}else if(!n&&r){let n=Le(t.tagName);n&&(Fe(e),Te(n,t),He(e,n))}}function In(e){if(l)try{let t=De();for(let n of t){if(!n.isConnected){Ee(n);continue}(!e||e.contains(n))&&Fn(n)}}catch(e){c(`Error during conditional elements update`,e)}}let Ln=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 zn(e,t){let n=Ln.get(e);n||(n=new Set,Ln.set(e,n)),n.add(new WeakRef(t))}function Bn(e){let t=Rn(e);if(t.length===0)return[];let n=new Set;for(let e of t){let t=Ln.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(!z(t)){r.push(e);continue}n.add(t)}for(let e of r)t.delete(e);t.size===0&&Ln.delete(e)}return Array.from(n)}function Vn(...e){let t=Rn(e);return function(e){if(l&&e instanceof Element)for(let n of t)zn(n,e)}}let Hn=[gn,En,In,tt,gt,Wn];function Un(...e){let t;if(e.length>0){let n=Bn(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 Hn)e(t);se()}function Wn(e){if(typeof document>`u`)return;let t=e?e.roots:[document.body??document];for(let e of t)try{e.dispatchEvent(new Event(`update`,{bubbles:!0}))}catch(e){c(`Error dispatching global update event`,e)}}function Gn(e,t,n=0){let r=t||document.body,i=e(r,n);return r.appendChild(i),se(),i}function Kn(e,t){let n=t||document.body,r=n;m();let i;try{i=e(n,0);let t=i;if(t&&t.nodeType===1&&t.parentNode!==r){let e=g(r);if(e){let n=e.nextSibling;r.insertBefore(t,e),L(e),_(r,n)}else r.appendChild(t),_(r,null)}}finally{h()}return se(),i}function qn(){return{ssrCollector:null,atomCache:new Map,atomMeta:new Map,rawKeys:new Set,baseRules:[],queryRules:new Map,styleEpoch:0,cssTextCache:null,sheet:null,sheetDocument:null,baseRuleCount:0,groupRules:new Map,externalRules:null,hasExternalGroups:!1}}let Jn=Symbol.for(`nuclo.style.engine.v1`),Yn=globalThis,Z=Yn[Jn]??(Yn[Jn]=qn());function Xn(e){Z.ssrCollector=e}function Zn(e){for(let t of e)Z.queryRules.has(t)||Z.queryRules.set(t,[])}function Qn(e,t){try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=e.cssRules[n];return Z.groupRules.set(t,r),Z.groupRules.set(Q(r),r),r}catch{return null}}function Q(e){let t=e.cssText,n=t.indexOf(`{`);return(n===-1?t:t.slice(0,n)).trim()}function $n(e){return e instanceof CSSStyleRule?e.selectorText:Q(e)}function er(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function tr(e,t){if(!Z.externalRules)return;let n=er(t,$n(e)),r=Z.externalRules.get(n);r||(r=new Set,Z.externalRules.set(n,r)),r.add(e.cssText)}function nr(e,t){if(!Z.externalRules)return!1;let n=er(t,$n(e)),r=Z.externalRules.get(n);return r?.delete(e.cssText)?(r.size===0&&Z.externalRules.delete(n),Z.externalRules.size===0&&(Z.externalRules=null),!0):!1}function rr(e){for(let t=0;t<e.length;t++){let n=e[t];if(n instanceof CSSStyleRule){tr(n,void 0);continue}let r=Q(n);if(`cssRules`in n&&!r.startsWith(`@keyframes`)){let e=n;Z.hasExternalGroups=!0,Z.groupRules.set(r,e);for(let t=0;t<e.cssRules.length;t++)tr(e.cssRules[t],r)}else tr(n,void 0)}}function ir(e,t){try{e.insertRule(t,Z.baseRuleCount);let n=e.cssRules[Z.baseRuleCount];if(nr(n,void 0)){e.deleteRule(Z.baseRuleCount);return}Z.baseRuleCount++}catch{}}function ar(e,t){try{let n=e.cssRules.length;e.insertRule(t,n);let r=e.cssRules[n];nr(r,Q(e))&&e.deleteRule(n)}catch{}}function or(e,t){let n=Z.groupRules.get(t);if(n)return n;if(!Z.hasExternalGroups)return Qn(e,t);try{let n=e.cssRules.length;e.insertRule(t+`{}`,n);let r=Q(e.cssRules[n]);e.deleteRule(n);let i=Z.groupRules.get(r);if(i)return Z.groupRules.set(t,i),i}catch{return null}return Qn(e,t)}function sr(){if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(Z.sheet&&Z.sheetDocument===document&&Z.sheet.ownerNode&&Z.sheet.ownerNode.isConnected)return Z.sheet;let e=document.getElementById(`nuclo-styles`),t;if(e?.tagName===`STYLE`?t=e:(t=document.createElement(`style`),t.id=`nuclo-styles`,e?e.replaceWith(t):document.head.appendChild(t)),Z.sheet=t.sheet,Z.sheetDocument=document,Z.groupRules.clear(),Z.baseRuleCount=0,Z.externalRules=null,Z.hasExternalGroups=!1,!Z.sheet)return null;if(Z.sheet.cssRules.length>0){let e=0;for(;e<Z.sheet.cssRules.length;){let t=Z.sheet.cssRules[e];if(!(t instanceof CSSStyleRule)&&`cssRules`in t&&!Q(t).startsWith(`@keyframes`))break;e++}Z.baseRuleCount=e,Z.externalRules=new Map,rr(Z.sheet.cssRules)}for(let e of Z.baseRules)ir(Z.sheet,e);for(let[e,t]of Z.queryRules){let n=or(Z.sheet,e);if(n)for(let e of t)ar(n,e)}return Z.sheet}function cr(e,t){let n=sr();if(t===void 0)Z.baseRules.push(e);else{let n=Z.queryRules.get(t);n||(n=[],Z.queryRules.set(t,n)),n.push(e)}if(Z.cssTextCache=null,n){if(t===void 0)ir(n,e);else{let r=or(n,t);r&&ar(r,e)}}Z.ssrCollector?.(t===void 0?e:t+`{`+e+`}`)}function lr(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 ur(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function dr(e,t){return e+t.length+`:`+t}function fr(e,t){let n=``,r=0;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);if(a===92&&i+1<e.length){n+=e[i]+e[++i];continue}if(r!==0){n+=e[i],a===r&&(r=0);continue}a===34||a===39?(r=a,n+=e[i]):n+=a===38?t:e[i]}return n}function pr(e,t){let n=`.`+e;return n+fr(t,n)}function mr(e){if(e.length===0||e===`-`)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n>=97&&n<=122||n>=65&&n<=90||n===45||n===95||t>0&&n>=48&&n<=57))return!1}if(e.charCodeAt(0)===45&&e.length>1){let t=e.charCodeAt(1);if(t>=48&&t<=57)return!1}return!0}function hr(e,t,n,r,i=!1){let a=``,o=ur(e,t);for(let[e,t]of n)a+=(a?`;`:``)+e+`:`+t,o=dr(dr(o,e),t);r!==void 0&&!mr(r)&&(console.warn(`[nuclo] css() name ${JSON.stringify(r)} is not a valid CSS class name (letters, digits, - and _ only, not starting with a digit); falling back to a generated name.`),r=void 0);let s=r===void 0?`a`+o:`n`+dr(``,r)+o,c=Z.atomCache.get(s);return c===void 0?(r===void 0?c=`n`+lr(s):(c=i?r:r+`-`+lr(s),Z.atomMeta.has(c)&&console.warn(`[nuclo] css() name ${JSON.stringify(c)} is already used by a different style. Both rules are emitted under the same class, so they will override each other — rename one.`)),Z.atomCache.set(s,c),Z.atomMeta.set(c,{query:e,suffix:t,decls:n,name:r}),cr(pr(c,t)+`{`+a+`}`,e),c):(sr(),c)}function gr(e,t,n,r,i=!1){return hr(e,t,n,r,i)}function _r(e,t){let n=Z.atomMeta.get(e),r=Z.atomMeta.get(t);if(!n||!r)return t;let i=[...n.decls,...r.decls],a=new Map;for(let e=0;e<i.length;e++)a.set(i[e][0],e);let o=i.filter((e,t)=>a.get(e[0])===t);return hr(n.query,n.suffix,o,n.name??r.name)}function vr(e){let t=Z.atomMeta.get(e);return t===void 0?void 0:ur(t.query,t.suffix)}function yr(){return Z.styleEpoch}function br(e,t){if(Z.rawKeys.has(e)){sr();return}Z.rawKeys.add(e),cr(t,void 0)}function xr(){if(Z.cssTextCache!==null)return Z.cssTextCache;let e=Z.baseRules.join(``);for(let[t,n]of Z.queryRules)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return Z.cssTextCache=e,e}function Sr(){Z.atomCache.clear(),Z.atomMeta.clear(),Z.rawKeys.clear(),Z.baseRules.length=0,Z.queryRules.clear(),Z.groupRules.clear(),Z.cssTextCache=null,Z.baseRuleCount=0,Z.sheet=null,Z.sheetDocument=null,Z.externalRules=null,Z.hasExternalGroups=!1,Z.styleEpoch++,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}let Cr={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`},wr={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`]},Tr={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`}},Er={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`},Dr=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`]),Or=new Map;function kr(e){let t=Or.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()),Or.set(e,t)),t}function Ar(e){return e.charCodeAt(0)===64?e:`@media `+e}function jr(e,t){return e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)?e+` and`+t.slice(6):t}function Mr(e,t){for(let n in t){let r=t[n],i=e[n];e[n]=typeof r==`object`&&r&&!Array.isArray(r)&&typeof i==`object`&&i&&!Array.isArray(i)?Mr({...i},r):r}return e}function Nr(e){let t={className:e};return Object.defineProperty(t,"toString",{value:()=>e,enumerable:!1}),t}function Pr(e,t){let n=vr(t);if(n===void 0){e.set(t,t);return}let r=e.get(n);r===void 0||r===t?e.set(n,t):e.set(n,_r(r,t))}function Fr(e,t){let n=0;for(let r=0;r<=e.length;r++){let i=r===e.length?32:e.charCodeAt(r);(i===32||i===9||i===10||i===12||i===13)&&(r>n&&Pr(t,e.slice(n,r)),n=r+1)}}function Ir(e,t){for(let n of e)n&&(typeof n==`string`?Fr(n,t):Array.isArray(n)?Ir(n,t):Fr(n.className,t))}function Lr(...e){let t=new Map;Ir(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return Nr(n)}function Rr(e={}){let t=e.screens??{};Zn(Object.values(t).map(Ar));let n=new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||Dr.has(t)?String(n):n+`px`;let r=Er[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,t,n){let r=(t===void 0?`-`:`+`+t.length+`:`+t)+n.length+`:`+n,i=e.get(r);return i||(i={query:t,suffix:n,decls:[]},e.set(r,i)),i}function a(e,n,o,s){for(let c in e){let l=e[c];if(l==null||l===!1)continue;if(typeof l==`object`){if(c===`raw`){let e=l,t=i(s,n,o).decls;for(let n in e)t.push([n,r(n,e[n])]);continue}let e=Cr[c];if(e!==void 0){a(l,n,o+e,s);continue}let u=t[c];if(u!==void 0){a(l,jr(n,Ar(u)),o,s);continue}let d=c.charCodeAt(0);if(d===38){a(l,n,fr(c,`&`+o).slice(1),s);continue}if(d===64){a(l,jr(n,c),o,s);continue}continue}if(l===!0){let e=Tr[c];if(e){let t=i(s,n,o).decls;for(let n in e)t.push([n,e[n]])}continue}let u=wr[c];if(u!==void 0){let e=i(s,n,o).decls;for(let t of u)e.push([t,r(t,l)])}else{let e=kr(c);i(s,n,o).decls.push([e,r(e,l)])}}}function o(e,t){let r=typeof e==`string`,i=r?t:e,o=r?e:void 0;if(i==null)return Nr(``);let s=yr(),c=n.get(i);if(c!==void 0&&c.epoch===s&&c.name===o)return c.result;let l=new Map;a(i,void 0,``,l);let u=[];for(let e of l.values()){if(e.decls.length===0)continue;let t=e.query===void 0&&e.suffix===``;u.push(gr(e.query,e.suffix,e.decls,o,t))}let d=Nr(u.join(` `));return n.set(i,{epoch:s,name:o,result:d}),d}function s(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=Tr[t];if(e)for(let t in e)n(t,e[t]);continue}let a=wr[t];if(a!==void 0)for(let e of a)n(e,r(e,i));else{let e=kr(t);n(e,r(e,i))}}return t}function c(e){let t=``;for(let n in e)t+=n+`{`+s(e[n])+`}`;let n=`nk`+lr(t);return br(n,`@keyframes `+n+`{`+t+`}`),n}function l(e,t){let n=e+`{`+s(t)+`}`;br(`g|`+n,n)}function u(e){let t=e=>e===!0?`true`:e===!1?`false`:String(e),n=e.variants??{},r=Object.keys(n),i=e.defaultVariants??{},a=e.base??null,s=(e.compoundVariants??[]).map(e=>{let{css:n,...r}=e,i={};for(let e in r)i[e]=t(r[e]);return{conditions:i,style:n}}),c=new Map;return function(e){let l={};for(let n of r){let r=(e?e[n]:void 0)??i[n];r!=null&&(l[n]=t(r))}let u=``;for(let e of r){let t=l[e];u+=e.length+`:`+e,u+=t===void 0?`-`:`+`+t.length+`:`+t}let d=c.get(u);if(d)return d;let f={};a&&(f=Mr(f,a));for(let e of r){let t=l[e];if(t!==void 0){let r=n[e][t];r&&(f=Mr(f,r))}}for(let e of s){let t=!0;for(let n in e.conditions)if(l[n]!==e.conditions[n]){t=!1;break}t&&(f=Mr(f,e.style))}let p=o(f);return c.set(u,p),p}}return{css:o,cx:Lr,variants:u,keyframes:c,globalStyle:l,theme:e}}let zr;function $(){return zr??=Rr({})}let Br=(e,t)=>typeof e==`string`?$().css(e,t):$().css(e),Vr=e=>$().variants(e),Hr=e=>$().keyframes(e),Ur=(e,t)=>$().globalStyle(e,t);function Wr(){Gt();let e=globalThis;e.list=_n,e.update=Un,e.when=Nn,e.on=he,e.scope=Vn,e.render=Gn,e.hydrate=Kn,e.createCss=Rr,e.css=Br,e.cx=Lr,e.variants=Vr,e.keyframes=Hr,e.globalStyle=Ur}Wr(),e.HTML_TAGS=zt,e.SELF_CLOSING_TAGS=Vt,e.SVG_TAGS=Bt,e.appendChildren=Ve,e.applyAttributes=H,e.applyNodeModifier=W,e.createComment=R,e.createConditionalComment=Le,e.createCss=Rr,e.createHtmlElementWithModifiers=Nt,e.createHtmlTagBuilder=Lt,e.createSvgElementWithModifiers=Pt,e.createSvgTagBuilder=Rt,e.css=Br,e.cx=Lr,e.getCssText=xr,e.globalStyle=Ur,e.hydrate=Kn,e.initializeRuntime=Wr,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=Hr,e.list=_n,e.on=he,e.registerGlobalTagBuilders=Gt,e.render=Gn,e.replaceNodeSafely=He,e.resetStyles=Sr,e.scope=Vn,e.setSSRCollector=Xn,e.update=Un,e.variants=Vr,e.when=Nn});
|
|
2
|
+
//# sourceMappingURL=nuclo.umd.js.map
|