@reactive-web-components/rwc 2.60.1 → 2.61.4
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.
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(r,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(r=typeof globalThis<"u"?globalThis:r||self,S(r.ReactiveComponent={}))})(this,function(r){"use strict";var Qe=Object.defineProperty;var Ye=(r,S,g)=>S in r?Qe(r,S,{enumerable:!0,configurable:!0,writable:!0,value:g}):r[S]=g;var h=(r,S,g)=>Ye(r,typeof S!="symbol"?S+"":S,g);const S=n=>n&&typeof n=="object"&&("classList"in n||"attributes"in n||"customAttributes"in n||"reactiveClassList"in n||"listeners"in n||"customListeners"in n||"children"in n||"effects"in n||"style"in n||Object.keys(n).some(t=>t.startsWith(".")||t.startsWith("@")||t.startsWith("$")))&&!("hostElement"in n),g=n=>n&&typeof n=="object"&&"hostElement"in n&&"append"in n&&"set"in n&&"addStyle"in n&&"setAttribute"in n&&"addClass"in n&&"addEffect"in n&&"addReactiveContent"in n&&"setReactiveContent"in n&&"clear"in n,P=(n,t,...e)=>{t&&t.apply(n,e)};let _=!0;const p=(...n)=>{_&&console.debug(["[rwc]",...n].join(" | "),...Array.from(n.join("").matchAll(/%c/gm)).map((t,e)=>e%2===0?"color:red":"color:inherit"))},k=n=>n.replace(/([A-Z])/gm,t=>`-${t.toLowerCase()}`),X=n=>n.replace(/-(\w)/gm,(t,e)=>e.toUpperCase()),$=(n,...t)=>{if(!_)return;const e={r:"color: #ff0000",g:"color: #00ff00",b:"color: #0000ff",y:"color: #ffff00",p:"color: #800080",c:"color: #00ffff",o:"color: #ffa500",w:"color: #808080"},s=n.match(/@[rgbpycow]/g)||[],o=s.map(c=>{const l=c.slice(1);return e[l]||"color: inherit"});let i=n;s.forEach(c=>{const l=new RegExp(`\\${c}([^\\s,]+)`,"g");i=i.replace(l,"%c$1")}),console.log(i,...o,...t)},bt=()=>{_=!0},Z=()=>{_=!1};Z();const St=(n,t)=>{n.every(Boolean)&&t(n)},A=[],F=n=>{var t,e,s,o;(t=n.children)==null||t.forEach(i=>{var c;return(c=i.destroy)==null?void 0:c.call(i)}),(e=n.children)==null||e.clear(),(s=n.cleanupSet)==null||s.forEach(i=>i()),(o=n.cleanupSet)==null||o.clear()};function R(n,t){let e=(t==null?void 0:t.signalCompareFn)||(()=>!0);const s=new Set;function o(){var c;const i=A[A.length-1];return i&&!i.fake&&!s.has(i)&&i.status==="active"&&(s.add(i),(c=i.cleanupSet)==null||c.add(()=>s.delete(i))),!(t!=null&&t.name)&&(i!=null&&i.effectId)&&o.setName(i.effectId),n}return o.signalId=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`,o.setName=function(i){return o.signalId=`${i}_${Math.random().toString(36).substring(2,15)}`,o},o.setCompareFn=function(i){return e=i,o},o.clearSubscribers=function(){s.clear()},o.getSubscribers=function(){return s},o.peek=function(){return Object.freeze(n)},o.initValue=Object.freeze(n),o.forceSet=function(i){n=i,s.forEach(c=>{F(c),Promise.resolve().then(()=>{A.push(c),c(),A.pop()})})},o.set=function(i,c=e){n!==i&&c(n,i)&&o.forceSet(i)},o.update=function(i){o.set(i(n))},o.pipe=(i,c)=>{c!=null&&c.name&&o.setName(c.name);const l=R(null);return b(()=>{const u=o();b(()=>{const d=i(u);d instanceof Promise?d.then(v=>l.set(v)):w(d)?b(()=>l.set(d()),{name:"pipe_effect_inner"}):l.set(d)},{name:"pipe_effect"})},{name:(c==null?void 0:c.name)||`pipe_${o.signalId}`}),l},o}function b(n,t){var i;const e=`${(t==null?void 0:t.name)||""}_${Math.random().toString(36).substring(2,15)}`;p("current effect",`%c${e}%c`);const s=n;s.status="active",s.children=new Set,s.effectId=e;const o=A[A.length-1];o&&((i=o.children)==null||i.add(s),s.parent=new WeakRef(o),s.destroy=()=>{var c;F(s),(c=o.children)==null||c.delete(s),s.destroy=void 0,s.status="inactive"}),s.cleanupSet=new Set,A.push(s),s(),A.pop()}const w=n=>!!n&&["object","function"].includes(typeof n)&&"set"in n&&"update"in n&&"forceSet"in n&&"signalId"in n;function yt(n,...t){const e=R("");return b(()=>{const s=t.map(i=>w(i)?String(i()):String(i)),o=[n[0]];s.forEach((i,c)=>{o.push(i,n[c+1])}),e.set(o.join(""))}),e}function vt(n,t){const e=R(t??null),s=o=>e.set(o);return n instanceof Promise?n.then(s):typeof n=="function"&&b(()=>{const o=n();o instanceof Promise?o.then(s):w(o)?b(()=>s(o())):s(o)}),e}function wt(n,t){let e=n(),s=t();b(()=>{const o=n(),i=t();o!==i&&(o!==e?t.set(o):i!==s&&n.set(i)),e=o,s=i})}function At(...n){let t=n.map(s=>s());const e=R(t);return n.forEach((s,o)=>{b(()=>{const i=()=>t.filter(c=>c!==void 0).length;i()===n.length&&(t=Array.from(t).fill(void 0)),t[o]=s(),i()===n.length&&e.set([...t])})}),e}const Rt=(...n)=>{const t=R([]);return b(()=>{t.set(n.map(e=>e()))}),t},B="eventProps",V="EVENT_CONFIG",W="observedAttributes",Lt=()=>(n,t)=>{Reflect.get(n,W)||Reflect.defineProperty(n,W,{value:[]}),Reflect.get(n,W).push(k(t))},gt=n=>(t,e)=>{Reflect.get(t,B)||Reflect.defineProperty(t,B,{value:[]}),Reflect.get(t,V)||Reflect.defineProperty(t,V,{value:{}}),Reflect.get(t,V)[e]={bubbles:(n==null?void 0:n.bubbles)??!1,composed:(n==null?void 0:n.composed)??!1},Reflect.get(t,B).push(e)},q=(n,t=!1)=>e=>{p(n,"start register static attr",e.prototype[W]);const s=[];if(e.styles){const i=e.styles,c=[];Array.isArray(i)?c.push(...i):c.push(i),c.forEach(l=>{const u=new CSSStyleSheet;u.replaceSync(l),s.push(u);const y=new CSSStyleSheet;y.replaceSync(l.slice(l.indexOf("@property"))),document.adoptedStyleSheets.push(y)})}class o extends e{constructor(...c){p("constructor",`%c${n}%c`),super(t,...c),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){return p("rwc: render from new class"),e.prototype.render.call(this)}attributeChangedCallback(c,l,u){p("%cAttribute has changed.%c",`%c${c}%c`,`oldValue: ${l}, newValue: ${u}`,`%c${n}%c`);try{u=JSON.parse(u)}catch{}const y=X(c);if(y in this&&w(this[y])){const d=this[y];d.setName(c),u===null?(d.set(d.initValue),this.removeAttribute(c)):d.set(u)}P(this,e.prototype.attributeChangedCallback,c,l,u)}connectedCallback(){const c=()=>{var u,y;p("rwc: connectedCallback"),p("connectedCallback",`%c${n}%c`,this),(u=this.init)==null||u.call(this),this.providers&&Object.keys(this.providers).length>0&&(p("WRAPPER for providers",n),Object.entries(this.providers).forEach(([d,m])=>{p("register provider",d,m()),this.addEventListener(d,v=>{var f;p("send provider",d,m());const C=v;((f=C.detail)==null?void 0:f.context)===d&&(C.stopPropagation(),C.detail.callback(m))})})),this.checkInjects(),(y=e.prototype[B])==null||y.forEach(d=>{this[d]=m=>{const v=e.prototype[V][d],{bubbles:C,composed:f}=v;w(m)?b(()=>{$("@oemit reactive value",m()),this.dispatchEvent(new CustomEvent(d,{detail:m(),bubbles:C,composed:f}))}):($("@oemit value",m),this.dispatchEvent(new CustomEvent(d,{detail:m,bubbles:C,composed:f})))}}),p("start render",`%c${n}%c`,n);const l=()=>{p("rwc: insertRenderTemplate");const m=this.render().hostElement;m&&this.shadow.appendChild(m),P(this,e.prototype.connectedCallback),this.appendSlotContent()};if(this.rootStyle&&!e.styles){const d=C=>C instanceof Promise||Array.isArray(C)&&C.every(f=>f instanceof Promise),m=this.rootStyle,v=C=>{const f=new CSSStyleSheet;f.replaceSync(C),this.shadow.adoptedStyleSheets.push(f);const E=new CSSStyleSheet;E.replaceSync(C.slice(C.indexOf("@property"))),document.adoptedStyleSheets.push(E)};if(d(m)){const C=[];Array.isArray(m)?C.push(...m):C.push(m),Promise.all(C).then(f=>f.forEach(E=>v(E.default))).then(()=>l())}else{const C=[];Array.isArray(m)?C.push(...m):C.push(m),C.forEach(f=>v(f)),l()}}else l();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(d=>{p(this.slotContext,this.slotContext&&this.slotContext[d.name]),$("@bslot element",d,`name:${d.name};`,d.assignedElements()),d.assignedElements().forEach(m=>{const v=this.slotContext[d.name];this.slotContext&&w(v)&&($("@oslot element",d,`name:${d.name};`,d.assignedElements()),b(()=>{m.dispatchEvent(new CustomEvent("handleSlotContext",{detail:v()}))}))})})};c.fake=!0,c.component=new WeakRef(this),this.effectSet.add(new WeakRef(c)),b(c,{name:"FAKE_wrapperEffect"})}disconnectedCallback(){this.allSlotContent=[],this.slotContent={},this.htmlSlotContent={},this.effectSet.forEach(c=>{var l,u;return(u=(l=c.deref())==null?void 0:l.destroy)==null?void 0:u.call(l)}),this.effectSet.clear(),this.shadow.replaceChildren(),this.replaceChildren(),P(this,e.prototype.disconnectedCallback)}}return h(o,"observedAttributes",e.prototype[W]??[]),h(o,"renderTagName",n),o.toString=()=>n,customElements.get(n)?console.error(`название тега ${n} повторяется, компонент ${e.name} не зарегистрирован`):customElements.define(n,o),e.renderTagName=n,e};class j extends HTMLElement{constructor(e=!1){super();h(this,"init");h(this,"isSlotLazyLoading",!1);h(this,"slotTemplate");h(this,"slotContext");h(this,"rootStyle");h(this,"modelValue");h(this,"providers");h(this,"effectSet",new Set);h(this,"appendAllSlotContent");h(this,"allSlotContent",[]);h(this,"slotContent",{});h(this,"htmlSlotContent",{});h(this,"shadow");h(this,"injects",{});this.shadow=this.attachShadow({mode:e?"closed":"open"})}appendChild(e,s=!0){var o;if(this.isSlotLazyLoading&&s){if(e instanceof HTMLElement){const i=e.slot||"default";this.htmlSlotContent[i]||(this.htmlSlotContent[i]=[]),(o=this.htmlSlotContent[i])==null||o.push(e)}}else return super.appendChild(e)}appendSlotContent(){var e;(e=this.appendAllSlotContent)==null||e.call(this)}inject(e){return p("%cinject%c",e),this.injects[e]||(this.injects[e]=R(null)),this.injects[e]}checkInjects(){Object.entries(this.injects).forEach(([e,s])=>{p("%cinject%c",`%c${e}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(e,{detail:{context:e,callback:o=>b(()=>{s.set(o())},{name:e})},bubbles:!0,composed:!0}))})}setReactiveValue(e){this.modelValue=e}}h(j,"observedAttributes",[]),h(j,"renderTagName",""),h(j,"styles");const jt=n=>"render"in n&&"setReactiveValue"in n,Ot="handleSlotContext",Q="onConnected",Y=n=>typeof n=="string"?n:JSON.stringify(n),Tt=n=>{const t=document.createElement("span");return t.textContent=Y(n),t},K=(n,t)=>(n.appendChild(Tt(t)),n),It=(n,t)=>(n.replaceChildren(),K(n,t)),x=n=>{const t=document.createElement("span");return b(()=>{const e=n();t.textContent=Y(e)}),t};class tt{constructor(t){h(this,"wrapper");h(this,"keyedEffects",new Map);h(this,"append",(...t)=>(t.forEach(e=>{var o;const s=e.hostElement;s&&((o=this.hostElement)==null||o.appendChild(s),Q in s&&setTimeout(()=>{var i;(i=s.onConnected)==null||i.call(s,e,s)}))}),this));h(this,"set",(...t)=>{var s;this.clear();const e=document.createDocumentFragment();return t.forEach(o=>{const i=o.hostElement;i&&e.appendChild(i)}),(s=this.hostElement)==null||s.appendChild(e),this});h(this,"removeChild",(...t)=>(t.forEach(e=>{var s,o;if(Array.from(((s=this.hostElement)==null?void 0:s.childNodes.values())||[]).some(i=>i===e.hostElement)){const i=e.hostElement;i&&((o=this.hostElement)==null||o.removeChild(i))}}),this));h(this,"addHtmlContent",t=>{const e=this.hostElement;return e?(K(e,t),this):this});h(this,"setHtmlContent",t=>{const e=this.hostElement;return e?(It(e,t),this):this});h(this,"setAttribute",(t,e)=>{var i;const s=this.hostElement;if(!s)return this;let o;if(typeof e=="boolean"&&!(s instanceof j))if(e)o="";else{this.removeAttribute(t);const c=t.toLowerCase();return c in s&&(s[c]=null),this}else typeof e!="string"?o=JSON.stringify(e):o=e;if((i=this.hostElement)==null||i.setAttribute(k(t),o),!(s instanceof j)){const c=t.toLowerCase();c in s&&(s[c]=e)}return this});h(this,"setCustomAttribute",(t,e)=>{var o;let s;return typeof e!="string"?s=JSON.stringify(e):s=e,(o=this.hostElement)==null||o.setAttribute(k(t),s),this});h(this,"setReactiveAttribute",(t,e)=>(this.addEffect(s=>{s.setAttribute(t,e())},t),this));h(this,"setReactiveCustomAttribute",(t,e)=>(this.addEffect(s=>{s.setCustomAttribute(t,e())}),this));h(this,"removeAttribute",t=>{var e;return(e=this.hostElement)==null||e.removeAttribute(k(t)),this});h(this,"addStyle",t=>{const e=this.hostElement;return e?(Object.entries(t).forEach(([s,o])=>{const i=s.startsWith("--");typeof o=="function"?this.addEffect(()=>{if(i){const c=String(o()||"");e.style.setProperty(s,c)}else e.style[s]=o()}):typeof o=="string"&&(i?e.style.setProperty(s,o):e.style[s]=o)}),this):this});h(this,"onConnected",t=>this.hostElement?(Reflect.defineProperty(this.hostElement,Q,{get(){return t}}),this):this);h(this,"addClass",(...t)=>(t.forEach(e=>{var s;typeof e=="string"?(s=this.hostElement)==null||s.classList.add(...e.split(" ").flatMap(o=>o.split(`
|
|
2
|
-
`)).map(o=>o.trim()).filter(Boolean)):(()=>{let o=null;this.addEffect(()=>{const i=e();i.length>0&&(o?this.replaceClass(o,i):this.addClass(i),o=i)})})()}),this));h(this,"setClass",(...t)=>{var e,s,o;return(s=this.hostElement)==null||s.classList.remove(...((e=this.hostElement)==null?void 0:e.classList)||[]),(o=this.hostElement)==null||o.classList.add(...t),this});h(this,"addReactiveClass",t=>(Object.keys(t).forEach(e=>{this.addEffect(s=>{t[e]()?s.addClass(e):s.removeClass(e)})}),this));h(this,"removeClass",(...t)=>{var e;return(e=this.hostElement)==null||e.classList.remove(...t),this});h(this,"replaceClass",(t,e)=>{var s;return(s=this.hostElement)==null||s.classList.replace(t,e),this});h(this,"addEffect",(t,e)=>{var i,c;const s=this.hostElement;if(!s)return this;const o=()=>t(this,s);if(e){const l=(i=this.keyedEffects.get(e))==null?void 0:i.deref();l&&F(l)}return(c=s.effectSet)==null||c.add(new WeakRef(o)),o.component=this.wrapper,b(o,{name:(e==null?void 0:e.toString())||s.tagName}),this});h(this,"addReactiveContent",t=>{var e;return(e=this.hostElement)==null||e.appendChild(x(t)),this});h(this,"setReactiveContent",t=>{var e;return this.clear(),(e=this.hostElement)==null||e.appendChild(x(t)),this});h(this,"clear",()=>{var t;return(t=this.hostElement)==null||t.replaceChildren(),this});this.wrapper=t;const e=t.deref();e&&(e.effectSet=new Set)}get hostElement(){return this.wrapper.deref()}addEventlistener(t,e,s=!1){var o;return(o=this.hostElement)==null||o.addEventListener(t,i=>e(i,this,this.hostElement),s),this}}class kt extends tt{constructor(){super(...arguments);h(this,"setReactiveValue",e=>(this.hostElement instanceof j&&this.hostElement.setReactiveValue(e),this));h(this,"setSlotTemplate",e=>{var o;const s=(o=this.hostElement)==null?void 0:o.slotTemplate;return s&&Object.entries(e).forEach(([i,c])=>{s[i]=c}),this})}}const $t=()=>()=>{},et=n=>new kt(new WeakRef(n)),nt=n=>new tt(new WeakRef(n)),st=(n,...t)=>({classList:[...n.map(e=>e.trim()).filter(Boolean),...t]}),Wt=(n,...t)=>st(n,...t),z=(n,t)=>{if(!t||!n.deref())return;const e=Object.keys(t||{}).filter(o=>o.startsWith(".")||o.startsWith("@")||o.startsWith("$"));e.filter(o=>o.startsWith(".")).forEach(o=>{t!=null&&t.attributes||(t.attributes={}),t.attributes[o.slice(1)]=t[o]}),e.filter(o=>o.startsWith("@")).forEach(o=>{t!=null&&t.listeners||(t.listeners={});const i=o.slice(1);t.listeners[i]=t[o]}),e.filter(o=>o.startsWith("$")).forEach(o=>{t!=null&&t.effects||(t.effects=[]),t.effects.push(t[o])});const s=n.deref();if(s)return ct(s,t.classList),lt(s,t.style),dt(s,t.attributes),at(s,t.reactiveClassList),it(s,t.customAttributes),rt(s,t.children),ot(s,t.effects),G(s,t.listeners),G(s,t.customListeners),s},G=(n,t)=>{t&&Object.entries(t).forEach(([e,s])=>{typeof s=="function"&&n.addEventlistener(e,s)})},ot=(n,t)=>t==null?void 0:t.forEach(e=>n.addEffect(e)),rt=(n,t)=>H(new WeakRef(n),...t||[])??n,it=(n,t)=>{const e=t;e&&Object.keys(e).forEach(s=>{w(e[s])?n.setReactiveCustomAttribute(s,e[s]):typeof e[s]=="function"?n.addEffect(()=>{n.setCustomAttribute(s,e[s]())}):n.setCustomAttribute(s,e[s])})},ct=(n,t)=>n.addClass(...t||[]),at=(n,t)=>n.addReactiveClass(t||{}),lt=(n,t)=>n.addStyle(t||{}),dt=(n,t)=>{const e=t,s=(o,i)=>{i&&(w(i)?n.setReactiveAttribute(o,i):typeof i=="function"?n.addEffect(()=>{n.setAttribute(o,i())}):n.setAttribute(o,i))};e&&Object.keys(e).forEach(o=>{s(o,e[o])})},H=(n,...t)=>{const e=n.deref();if(e)return t.forEach(s=>{typeof s=="string"?s.trim().length>0&&e.addHtmlContent(s):w(s)?e.addReactiveContent(s):e.append(s)}),e},T=(n,t)=>{const e=document.createElement(n),s=nt(e);return z(new WeakRef(s),t)??s},J=(n,t)=>{const[e,...s]=n.split(" ").map(i=>i.trim()),o=T(e,t);return s.length>0&&o.addClass(...s),(...i)=>H(new WeakRef(o),...i.filter(Boolean).flat().flatMap(c=>typeof c=="function"&&!w(c)?L(()=>c(o)):c))??o},L=n=>{const t=`getSignalContent_${Math.random().toString(36).substring(2,15)}`;return T("div").addStyle({display:"contents"}).addEffect(e=>{e.clear(),H(new WeakRef(e),...[n()].flat())},t)},Ht=(n,t,e)=>{const s=T("div").addStyle({display:"contents"}),o=new Map,i=new Map;let c=[];const l=new Set;let u=n.peek();const y=d=>{l.delete(d),o.delete(d),i.delete(d)};return b(()=>{var C;const d=n();c=d.map(t).map(f=>typeof f=="string"?f:f.toString());const m=Array.from(((C=s.hostElement)==null?void 0:C.children)||[]);p("containerChildren",m,c),m.forEach(f=>{const E=f.dataset.key;c.includes(E)||(p("remove element",E,f),f.remove(),y(E))}),c.forEach(f=>{var M,I,O;const E=d[c.indexOf(f)];o.has(f)?JSON.stringify(E)!==JSON.stringify(u[c.indexOf(f)])&&((I=(M=s.hostElement)==null?void 0:M.querySelector(`[data-key="${f}"]`))==null||I.remove(),(O=o.get(f))==null||O.set(Math.random().toString(36).substring(2,15)),i.set(f,()=>e(E,c.indexOf(f),d).setCustomAttribute("data-key",f))):(p("create new element",f,E),o.set(f,R(Math.random().toString(36).substring(2,15))),i.set(f,()=>e(E,c.indexOf(f),d).setCustomAttribute("data-key",f)))}),u=[...d.map(f=>({...f}))];const v=()=>{o.forEach((f,E)=>{p("key from setTimeout foreach currItemSignalMap",E),l.has(E)||(l.add(E),b(()=>{var Ct,Et;f();const M=c.indexOf(E),I=(Ct=i.get(E))==null?void 0:Ct();if(!I)return;p("call effect from setTimeout",E,I.hostElement);const O=s.hostElement,N=I.hostElement;O&&N&&M<=O.children.length-1?O.insertBefore(N,O.children[M]):N&&((Et=s.hostElement)==null||Et.append(N))}))})};Promise.resolve().then(()=>v())}),s},Mt=n=>{let t=[T("div")],e=!1;return b(()=>{var i,c;const s=n();e=Array.isArray(s);const o=[];o.push(...[s].flat()),o.length===0&&o.push(T("div").addStyle({display:"none"}).setAttribute("id","empty_template"));try{p("newReactiveComponent.map",o.map(l=>{var u;return p("newReactiveComponent hostElement",l.hostElement),(u=l.hostElement)==null?void 0:u.id})),p("currComponent[0].hostElement?.id",(i=t[0].hostElement)==null?void 0:i.id,t),(c=t[0].hostElement)==null||c.replaceWith(...o.map(l=>l.hostElement).filter(Boolean)),t.slice(1).forEach(l=>{var u;return(u=l.hostElement)==null?void 0:u.remove()}),t=o}catch(l){console.error(l)}}),e?t:t[0]},Pt=n=>Ot in n,_t=n=>{const t=J("div")().addStyle({display:"contents"}),e=s=>{const o=t.hostElement;return o&&(o.innerHTML=s),t};return typeof n=="string"?e(n):t.addEffect(()=>{e(n())}),t},D=(n,t,e)=>n?L(t):e?L(e):J("div")().setAttribute("id","empty_div_renderIf").addStyle({display:"none"}),ht=(n,t,e)=>L(()=>D(!!n(),t,e)),Ft=(n,t,e)=>typeof n=="boolean"?D(n,t,e):ht(n,t,e),U=(n,t)=>L(t).addEffect((e,s)=>{if(typeof n=="boolean")s.style.display=n?"block":"none";else{const o=n()?"block":"none";s.style.display=o}}),Bt=(n,t,e)=>{const s=[U(n,t)].flat();return e&&s.push(...[U(()=>typeof n=="boolean"?!n:!n(),e)].flat()),L(()=>s)},ft=(n,t)=>{p("createCustomElement",n);const e=document.createElement(n),s=et(e);return e.init=()=>{z(new WeakRef(s),t)},s},ut=(n,t)=>{const e=n.split(" ").slice(1).map(o=>o.trim()),s=ft(n.split(" ")[0],t);return Array.isArray(e)&&e.length>0&&s.addClass(...e),(...o)=>{const i=o.filter(Boolean).flat().flatMap(l=>typeof l=="function"&&!w(l)?L(()=>l(s)):l),c=s.hostElement;return c&&(c.allSlotContent=i,c.slotContent=i.filter(g).reduce((l,u)=>{var d;const y=((d=u.hostElement)==null?void 0:d.getAttribute("slot"))||"default";return l[y]||(l[y]=[]),l[y].push(u),l},{}),c.appendAllSlotContent=()=>{H(new WeakRef(s),...i)}),s}},mt=(n,t,e)=>ut(`${n.renderTagName}${t&&typeof t=="string"?" "+t:""}`,S(t)?t:t&&typeof t=="string"?e:void 0),Vt=()=>{const n=()=>{};return n.oldValue=null,n},Jt=()=>({}),pt=(n,t,e)=>{const s=t?q(t,e)(n):n;return(o,...i)=>{const c=[...i];return o&&!S(o)&&c.unshift(o),mt(s,S(o)?o:{})(...c)}},Nt=n=>[pt(n),(t,e)=>{q(t,e)(n)}],a={};["div","span","section","input","button","table","tr","td","th","ul","li","ol","form","label","select","option","textarea","img","a","p","h1","h2","h3","h4","h5","h6","br","hr","pre","code","nav","header","footer","main","aside","article","figure","figcaption","blockquote","cite","small","strong","em","b","i","u","s","sub","sup","mark","del","ins","details","summary","progress","meter","audio","video","canvas","slot"].forEach(n=>{a[n]=(t,...e)=>{let s=[...e];return t&&!S(t)&&(s=[t].concat(s)),J(n,S(t)?t:{})(...s)}});const qt=a.div,zt=a.span,Gt=a.section,Dt=a.input,Ut=a.button,Xt=a.table,Zt=a.tr,Qt=a.td,Yt=a.th,Kt=a.ul,xt=a.li,te=a.ol,ee=a.form,ne=a.label,se=a.select,oe=a.option,re=a.textarea,ie=a.img,ce=a.a,ae=a.p,le=a.h1,de=a.h2,he=a.h3,fe=a.h4,ue=a.h5,me=a.h6,pe=a.br,Ce=a.hr,Ee=a.pre,be=a.code,Se=a.nav,ye=a.header,ve=a.footer,we=a.main,Ae=a.aside,Re=a.article,Le=a.figure,ge=a.figcaption,je=a.blockquote,Oe=a.cite,Te=a.small,Ie=a.strong,ke=a.em,$e=a.b,We=a.i,He=a.u,Me=a.s,Pe=a.sub,_e=a.sup,Fe=a.mark,Be=a.del,Ve=a.ins,Je=a.details,Ne=a.summary,qe=a.progress,ze=a.meter,Ge=a.audio,De=a.video,Ue=a.canvas,Xe=a.slot,Ze=n=>t=>n(t).addClass(...t.classList??[]).addReactiveClass(t.reactiveClassList??{});r.BaseElement=j,r.a=ce,r.addAttributeList=dt,r.addClassList=ct,r.addCustomAttributes=it,r.addReactiveClassList=at,r.addStyleList=lt,r.appendContentItem=H,r.article=Re,r.aside=Ae,r.audio=Ge,r.b=$e,r.bindReactiveSignals=wt,r.blockquote=je,r.br=pe,r.button=Ut,r.camelToKebab=k,r.canvas=Ue,r.checkCall=P,r.checkRef=St,r.cite=Oe,r.classList=st,r.cls=Wt,r.code=be,r.colorLog=$,r.combineLatest=Rt,r.component=q,r.configCustomComponent=Nt,r.createComponent=Ze,r.createCustom=mt,r.createCustomEl=ut,r.createCustomElement=ft,r.createEl=J,r.createElement=T,r.createSignal=vt,r.customElementHelpers=et,r.defineSlotTemplate=Jt,r.del=Be,r.details=Je,r.disableLogs=Z,r.div=qt,r.effect=b,r.elementHelpers=nt,r.em=ke,r.enableLogs=bt,r.event=gt,r.eventEmitter=$t,r.figcaption=ge,r.figure=Le,r.footer=ve,r.forkJoin=At,r.form=ee,r.getList=Ht,r.getSignalContent=L,r.h1=le,r.h2=de,r.h3=he,r.h4=fe,r.h5=ue,r.h6=me,r.header=ye,r.hr=Ce,r.i=We,r.img=ie,r.initComponent=z,r.input=Dt,r.ins=Ve,r.isBaseElement=jt,r.isComponentConfig=g,r.isComponentInitConfig=S,r.isReactiveSignal=w,r.isSlotTemplate=Pt,r.kebabToCamel=X,r.label=ne,r.li=xt,r.main=we,r.mark=Fe,r.meter=ze,r.nav=Se,r.newEventEmitter=Vt,r.ol=te,r.option=oe,r.p=ae,r.pre=Ee,r.progress=qe,r.projectLog=p,r.property=Lt,r.removeEffect=F,r.renderIf=D,r.rs=yt,r.rxRenderIf=ht,r.s=Me,r.section=Gt,r.select=se,r.setChildren=rt,r.setEffects=ot,r.setListeners=G,r.show=Bt,r.showIf=U,r.signal=R,r.signalComponent=Mt,r.slot=Xe,r.small=Te,r.span=zt,r.strong=Ie,r.sub=Pe,r.summary=Ne,r.sup=_e,r.table=Xt,r.td=Qt,r.textarea=re,r.th=Yt,r.tr=Zt,r.u=He,r.ul=Kt,r.unsafeHtml=_t,r.useCustomComponent=pt,r.video=De,r.when=Ft,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|