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