@reactive-web-components/rwc 2.51.11 → 2.51.13

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 CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@reactive-web-components/rwc",
3
- "version": "2.51.11",
3
+ "version": "2.51.13",
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.BjYWVrAv.js",
10
- "require": "./reactive-web-component.COtoOyWr.umd.cjs"
9
+ "import": "./reactive-web-component.DGf546s3.js",
10
+ "require": "./reactive-web-component.CMl3NnC3.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.BjYWVrAv.js",
38
- "main": "./reactive-web-component.COtoOyWr.umd.cjs"
37
+ "module": "./reactive-web-component.DGf546s3.js",
38
+ "main": "./reactive-web-component.CMl3NnC3.umd.cjs"
39
39
  }
@@ -1,2 +1,2 @@
1
- (function(o,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(o=typeof globalThis<"u"?globalThis:o||self,y(o.ReactiveComponent={}))})(this,function(o){"use strict";var ze=Object.defineProperty;var Ge=(o,y,A)=>y in o?ze(o,y,{enumerable:!0,configurable:!0,writable:!0,value:A}):o[y]=A;var p=(o,y,A)=>Ge(o,typeof y!="symbol"?y+"":y,A);const y=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),A=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,H=(t,e,...n)=>{e&&e.apply(t,n)};let W=!0;const E=(...t)=>{W&&console.log(t.join(" | "),...Array.from(t.join("").matchAll(/%c/gm)).map((e,n)=>n%2===0?"color:red":"color:inherit"))},I=t=>t.replace(/([A-Z])/gm,e=>`-${e.toLowerCase()}`),Z=t=>t.replace(/-(\w)/gm,(e,n)=>n.toUpperCase()),L=(t,...e)=>{if(!W)return;const n={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=t.match(/@[rgbpycow]/g)||[],i=s.map(l=>{const h=l.slice(1);return n[h]||"color: inherit"});let c=t;s.forEach(l=>{const h=new RegExp(`\\${l}([^\\s,]+)`,"g");c=c.replace(h,"%c$1")}),console.log(c,...i,...e)},Ct=()=>{W=!0},Q=()=>{W=!1};Q();const w=new WeakMap,F=[],k=[];function O(t,e=()=>!0){const n=new Set;let s=e;function i(){const c=F[F.length-1];if(c&&!("fake"in c&&c.fake)){const l=w.get(c),h=l==null?void 0:l.parent;if(h){const a=w.get(h);a==null||a.cleanupFns.add(()=>{n.delete(c)})}n.add(c)}return t}return i.getSubscribers=()=>[...n],i.setCompareFn=function(c){return s=c,i},i.clearSubscribers=function(){n.clear()},i.peek=function(){return Object.freeze(t)},i.initValue=Object.freeze(t),i.oldValue=Object.freeze(t),i.forceSet=function(c){i.oldValue=Object.freeze(t),t=c,n.forEach(l=>Promise.resolve(l).then(h=>{const a=w.get(h);a&&a.cleanupFns.size>0&&(a.cleanupFns.forEach(d=>d()),a.cleanupFns.clear()),k.push(h),h(),k.pop()}))},i.set=function(c,l=s){t!==c&&l(t,c)&&i.forceSet(c)},i.update=function(c){i.set(c(t))},i.pipe=c=>{const l=O(null);return b(()=>{const h=c(i());h instanceof Promise?h.then(a=>l.set(a)):v(h)?b(()=>l.set(h())):l.set(h)}),l},i}function b(t){const e=Date.now();E("current effect",`%c${e}%c`);const n=t;t=()=>(E("current effect callback",`%c${e}%c`),n());const s=k[k.length-1];w.has(t)||w.set(t,{cleanupFns:new Set});const i=w.get(t);s?i.parent=s:delete i.parent,k.push(t),F.push(t),t(),F.pop(),k.pop()}const v=t=>!!t&&["object","function"].includes(typeof t)&&"set"in t&&"oldValue"in t&&"update"in t&&"forceSet"in t;function bt(t,...e){const n=O("");return b(()=>{const s=e.map(c=>v(c)?String(c()):String(c)),i=[t[0]];s.forEach((c,l)=>{i.push(c,t[l+1])}),n.set(i.join(""))}),n}function Et(t,e){const n=O(e??null),s=i=>n.set(i);return t instanceof Promise?t.then(s):typeof t=="function"&&b(()=>{const i=t();i instanceof Promise?i.then(s):v(i)?b(()=>s(i())):s(i)}),n}function yt(t,e){let n=t(),s=e();b(()=>{const i=t(),c=e();i!==c&&(i!==n?e.set(i):c!==s&&t.set(c)),n=i,s=c})}function pt(...t){let e=t.map(s=>s());const n=O(e);return t.forEach((s,i)=>{b(()=>{const c=()=>e.filter(l=>l!==void 0).length;c()===t.length&&(e=Array.from(e).fill(void 0)),e[i]=s(),c()===t.length&&n.set([...e])})}),n}class R extends HTMLElement{constructor(n=!1){super();p(this,"isSlotLazyLoading",!1);p(this,"slotTemplate");p(this,"slotContext");p(this,"rootStyle");p(this,"modelValue");p(this,"providers");p(this,"appendAllSlotContent");p(this,"allSlotContent",[]);p(this,"slotContent",{});p(this,"htmlSlotContent",{});p(this,"shadow");p(this,"injects",{});this.shadow=this.attachShadow({mode:n?"closed":"open"})}appendChild(n,s=!0){var i;if(this.isSlotLazyLoading&&s){if(n instanceof HTMLElement){const c=n.slot||"default";this.htmlSlotContent[c]||(this.htmlSlotContent[c]=[]),(i=this.htmlSlotContent[c])==null||i.push(n)}}else return super.appendChild(n)}appendSlotContent(){var n;(n=this.appendAllSlotContent)==null||n.call(this)}inject(n){return E("%cinject%c",n),this.injects[n]||(this.injects[n]=O(null)),this.injects[n]}checkInjects(){Object.entries(this.injects).forEach(([n,s])=>{E("%cinject%c",`%c${n}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(n,{detail:{context:n,callback:i=>b(()=>{s.set(i())})},bubbles:!0,composed:!0}))})}setReactiveValue(n){this.modelValue=n}}p(R,"observedAttributes",[]),p(R,"renderTagName",""),p(R,"styles");const St=t=>"render"in t&&"setReactiveValue"in t,vt="handleSlotContext",Y="onConnected",gt=()=>()=>{},_=(t,e)=>{const n=new Text(typeof e=="string"?e:JSON.stringify(e));return t.appendChild(n),t},q=(t,e)=>(t.innerHTML="",_(t,e)),z=t=>{const e=document.createElement("div");return e.style.display="contents",b(()=>{const n=t();q(e,n)}),e},G=t=>({append(...e){return e.forEach(n=>{t.appendChild(n.hostElement),Y in n.hostElement&&setTimeout(()=>{var s,i;(i=(s=n.hostElement).onConnected)==null||i.call(s,n,n.hostElement)})}),this},set(...e){this.clear();const n=document.createDocumentFragment();return e.forEach(s=>{n.appendChild(s.hostElement)}),t.appendChild(n),this},removeChild(...e){return e.forEach(n=>{Array.from(t.childNodes.values()).some(s=>s===n.hostElement)&&t.removeChild(n.hostElement)}),this},addHtmlContent(e){return _(t,e),this},setHtmlContent(e){return q(t,e),this},addEventlistener(e,n,s=!1){return t.addEventListener(e,i=>n(i,this,t),s),this},setAttribute(e,n){let s;if(typeof n=="boolean"&&!(t instanceof R))if(n)s="";else{this.removeAttribute(e);const i=e.toLowerCase();return i in t&&(t[i]=null),this}else typeof n!="string"?s=JSON.stringify(n):s=n;if(t.setAttribute(I(e),s),!(t instanceof R)){const i=e.toLowerCase();i in t&&(t[i]=n)}return this},setCustomAttribute(e,n){let s;return typeof n!="string"?s=JSON.stringify(n):s=n,t.setAttribute(I(e),s),this},setReactiveAttribute(e,n){return b(()=>this.setAttribute(e,n())),this},setReactiveCustomAttribute(e,n){return b(()=>this.setCustomAttribute(e,n())),this},removeAttribute(e){return t.removeAttribute(I(e)),this},addStyle(e){return Object.entries(e).forEach(([n,s])=>{const i=n.startsWith("--");typeof s=="function"?this.addEffect(()=>{if(i){const c=String(s()||"");t.style.setProperty(n,c)}else t.style[n]=s()}):typeof s=="string"&&(i?t.style.setProperty(n,s):t.style[n]=s)}),this},onConnected(e){return Reflect.defineProperty(t,Y,{get(){return e}}),this},addClass(...e){return e.forEach(n=>{typeof n=="string"?t.classList.add(...n.split(" ").flatMap(s=>s.split(`
2
- `)).map(s=>s.trim()).filter(Boolean)):(()=>{let s=null;this.addEffect(()=>{const i=n();i.length>0&&(s?this.replaceClass(s,i):this.addClass(i),s=i)})})()}),this},setClass(...e){return t.classList.remove(...t.classList),t.classList.add(...e),this},addReactiveClass(e){return Object.keys(e).forEach(n=>{b(()=>{e[n]()?this.addClass(n):this.removeClass(n)})}),this},removeClass(...e){return t.classList.remove(...e),this},replaceClass(e,n){return t.classList.replace(e,n),this},addEffect(e){return b(()=>e(this,this.hostElement)),this},addReactiveContent(e){return t.appendChild(z(e)),this},setReactiveContent(e){return this.clear(),t.appendChild(z(e)),this},clear(){return t.innerHTML="",this},hostElement:t}),K=(t,...e)=>({classList:[...t.map(n=>n.trim()).filter(Boolean),...e]}),At=(t,...e)=>K(t,...e),D=(t,e)=>{if(!e)return t;const n=Object.keys(e||{}).filter(s=>s.startsWith(".")||s.startsWith("@")||s.startsWith("$"));return n.filter(s=>s.startsWith(".")).forEach(s=>{e!=null&&e.attributes||(e.attributes={}),e.attributes[s.slice(1)]=e[s]}),n.filter(s=>s.startsWith("@")).forEach(s=>{e!=null&&e.listeners||(e.listeners={});const i=s.slice(1);e.listeners[i]=e[s]}),n.filter(s=>s.startsWith("$")).forEach(s=>{e!=null&&e.effects||(e.effects=[]),e.effects.push(e[s])}),nt(t,e.classList),ot(t,e.style),it(t,e.attributes),st(t,e.reactiveClassList),et(t,e.customAttributes),tt(t,e.children),x(t,e.effects),N(t,e.listeners),N(t,e.customListeners),t},N=(t,e)=>{e&&Object.entries(e).forEach(([n,s])=>{typeof s=="function"&&t.addEventlistener(n,s)})},x=(t,e)=>e==null?void 0:e.forEach(n=>t.addEffect(n)),tt=(t,e)=>$(t,...e||[]),et=(t,e)=>{const n=e;n&&Object.keys(n).forEach(s=>{v(n[s])?t.setReactiveCustomAttribute(s,n[s]):typeof n[s]=="function"?t.addEffect(()=>{t.setCustomAttribute(s,n[s]())}):t.setCustomAttribute(s,n[s])})},nt=(t,e)=>t.addClass(...e||[]),st=(t,e)=>t.addReactiveClass(e||{}),ot=(t,e)=>t.addStyle(e||{}),it=(t,e)=>{const n=e,s=(i,c)=>{c&&(v(c)?t.setReactiveAttribute(i,c):typeof c=="function"?t.addEffect(()=>{t.setAttribute(i,c())}):t.setAttribute(i,c))};n&&Object.keys(n).forEach(i=>{s(i,n[i])})},$=(t,...e)=>(e.forEach(n=>{typeof n=="string"?n.trim().length>0&&t.addHtmlContent(n):v(n)?t.addReactiveContent(n):t.append(n)}),t),j=(t,e)=>{const n=document.createElement(t),s={...G(n)};return D(s,e)},lt=(t,e)=>{const[n,...s]=t.split(" ").map(c=>c.trim()),i=j(n,e);return s.length>0&&i.addClass(...s),(...c)=>$(i,...c.filter(Boolean).map(l=>typeof l=="function"&&!v(l)?g(()=>l(i)):l))},V=(t,e)=>{const n=lt(t,e);return Object.assign(n,n())},g=t=>j("div").addStyle({display:"contents"}).addEffect(e=>{const n=t(),s=[];Array.isArray(n)?s.push(...n):s.push(n),e.clear(),$(e,...s)}),Lt=(t,e,n)=>{const s=j("div").addStyle({display:"contents"}),i=new Map,c=new Map;let l=[];const h=new Set;let a=t.peek();const d=u=>{h.delete(u),i.delete(u),c.delete(u)};return b(()=>{const u=t();l=u.map(e).map(m=>typeof m=="string"?m:m.toString());const f=Array.from(s.hostElement.children);E("containerChildren",f,l),f.forEach(m=>{const S=m.dataset.key;l.includes(S)||(E("remove element",S,m),m.remove(),d(S))}),l.forEach(m=>{var P,T;const S=u[l.indexOf(m)];i.has(m)?JSON.stringify(S)!==JSON.stringify(a[l.indexOf(m)])&&((P=s.hostElement.querySelector(`[data-key="${m}"]`))==null||P.remove(),(T=i.get(m))==null||T.set(Math.random().toString(36).substring(2,15)),c.set(m,()=>n(S,l.indexOf(m),u).setCustomAttribute("data-key",m))):(E("create new element",m,S),i.set(m,O(Math.random().toString(36).substring(2,15))),c.set(m,()=>n(S,l.indexOf(m),u).setCustomAttribute("data-key",m)))}),a=u;const C=()=>{i.forEach((m,S)=>{E("key from setTimeout foreach currItemSignalMap",S),h.has(S)||(h.add(S),b(()=>{var mt;m();const P=l.indexOf(S),T=(mt=c.get(S))==null?void 0:mt();T&&(E("call effect from setTimeout",S,T.hostElement),P<=s.hostElement.children.length-1?s.hostElement.insertBefore(T.hostElement,s.hostElement.children[P]):s.hostElement.append(T.hostElement))}))})};Promise.resolve().then(()=>C())}),s},Ot=(t,e,n)=>{const s=j("div").addStyle({display:"contents"}),i=new Map;return b(()=>{let c=Array.from(s.hostElement.children).map(d=>d.dataset.key);const l=t(),h=l.map(e).map(d=>d.toString()),a=new Map;l.forEach((d,u)=>a.set(h[u],d)),c.filter(d=>!h.includes(d)).forEach(d=>{var u;return(u=s.hostElement.querySelector(`[data-key="${d}"]`))==null?void 0:u.remove()}),c=c.filter(d=>h.includes(d)),h.forEach((d,u)=>{if(c.includes(d)){if(JSON.stringify(i.get(d))!==JSON.stringify(a.get(d))){const f=n(l[u],u,l).setCustomAttribute("data-key",d).hostElement;s.hostElement.querySelector(`[data-key="${d}"]`).replaceWith(f);const C=s.hostElement.children;u>C.length-2?s.hostElement.append(f):s.hostElement.insertBefore(f,C[u+1])}}else{const f=n(l[u],u,l).setCustomAttribute("data-key",d),C=s.hostElement.children;u>C.length-1?s.hostElement.append(f.hostElement):s.hostElement.insertBefore(f.hostElement,C[u])}}),l.forEach((d,u)=>i.set(h[u],d))}),s},Rt=t=>{let e=[j("div")],n=!1;return b(()=>{var c;const s=t(),i=[];Array.isArray(s)?(i.push(...s),n=!0):i.push(s),i.length===0&&i.push(j("div").addStyle({display:"none"}));try{(c=e[0].hostElement)==null||c.replaceWith(...i.map(l=>l.hostElement)),e.forEach(l=>{var h;return(h=l.hostElement)==null?void 0:h.remove()}),e=i}catch(l){console.error(l)}}),n?e:e[0]},jt=t=>vt in t,Tt=t=>{const e=V("div").addStyle({display:"contents"}),n=s=>(e.hostElement.innerHTML=s,e);return typeof t=="string"?n(t):e.addEffect(()=>{n(t())}),e},U=(t,e,n)=>g(t?e:n||(()=>"")),ct=(t,e,n)=>g(()=>U(!!t(),e,n)),wt=(t,e,n)=>typeof t=="boolean"?U(t,e,n):ct(t,e,n),X=(t,e)=>{const n=g(e);return typeof t=="boolean"?n.hostElement.style.display=t?"contents":"none":n.addEffect((s,i)=>{i.style.display=t()?"contents":"none"}),n},kt=(t,e,n)=>{const s=[];return s.push(X(t,e)),n&&s.push(X(()=>typeof t=="boolean"?!t:!t(),n)),g(()=>s)},rt=(t,e)=>{E("createCustomElement",t);const n=document.createElement(t),s={...G(n),setReactiveValue(i){return n instanceof R&&n.setReactiveValue(i),this},setSlotTemplate(i){const c=n.slotTemplate;return c&&Object.entries(i).forEach(([l,h])=>{c[l]=h}),this}};return D(s,e)},at=(t,e)=>{const n=t.split(" ").slice(1).map(i=>i.trim()),s=rt(t.split(" ")[0],e);return Array.isArray(n)&&n.length>0&&s.addClass(...n),(...i)=>{L("@rcreateCustomEl content",t,i);const c=i.filter(Boolean).map(l=>typeof l=="function"&&!v(l)?g(()=>l(s)):l);return s.hostElement.allSlotContent=c,s.hostElement.slotContent=c.filter(A).reduce((l,h)=>{const a=h.hostElement.getAttribute("slot")||"default";return l[a]||(l[a]=[]),l[a].push(h),l},{}),s.hostElement.appendAllSlotContent=()=>$(s,...c),s}},dt=(t,e,n)=>at(`${t.renderTagName}${e&&typeof e=="string"?" "+e:""}`,y(e)?e:e&&typeof e=="string"?n:void 0),ht=(t,e,n)=>{const s=dt(t,e,n);return Object.assign(s,s())},It=()=>{const t=()=>{};return t.oldValue=null,t},$t=()=>({}),Mt=(t,e,n)=>{const s=e?ft(e,n)(t):t;return(i,...c)=>{const l=[...c];return i&&!y(i)&&l.unshift(i),ht(s,y(i)?i:{})(...l)}},r={};["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=>{r[t]=(e,...n)=>{let s=[...n];return e&&!y(e)&&(s=[e].concat(s)),V(t,y(e)?e:{})(...s)}});const ut=r.div,Pt=r.span,Ht=r.section,Wt=r.input,Ft=r.button,Bt=r.table,Jt=r.tr,_t=r.td,qt=r.th,zt=r.ul,Gt=r.li,Dt=r.ol,Nt=r.form,Vt=r.label,Ut=r.select,Xt=r.option,Zt=r.textarea,Qt=r.img,Yt=r.a,Kt=r.p,xt=r.h1,te=r.h2,ee=r.h3,ne=r.h4,se=r.h5,oe=r.h6,ie=r.br,le=r.hr,ce=r.pre,re=r.code,ae=r.nav,de=r.header,he=r.footer,ue=r.main,fe=r.aside,me=r.article,Ce=r.figure,be=r.figcaption,Ee=r.blockquote,ye=r.cite,pe=r.small,Se=r.strong,ve=r.em,ge=r.b,Ae=r.i,Le=r.u,Oe=r.s,Re=r.sub,je=r.sup,Te=r.mark,we=r.del,ke=r.ins,Ie=r.details,$e=r.summary,Me=r.progress,Pe=r.meter,He=r.audio,We=r.video,Fe=r.canvas,Be=r.slot,Je=t=>e=>t(e).addClass(...e.classList??[]).addReactiveClass(e.reactiveClassList??{}),B="eventProps",J="EVENT_CONFIG",M="observedAttributes",_e=()=>(t,e)=>{Reflect.get(t,M)||Reflect.defineProperty(t,M,{value:[]}),Reflect.get(t,M).push(I(e))},qe=t=>(e,n)=>{Reflect.get(e,B)||Reflect.defineProperty(e,B,{value:[]}),Reflect.get(e,J)||Reflect.defineProperty(e,J,{value:{}}),Reflect.get(e,J)[n]={bubbles:(t==null?void 0:t.bubbles)??!1,composed:(t==null?void 0:t.composed)??!1},Reflect.get(e,B).push(n)},ft=(t,e=!1)=>n=>{E(t,"start register static attr",n.prototype[M]);const s=[];if(n.styles){const c=n.styles,l=[];Array.isArray(c)?l.push(...c):l.push(c),l.forEach(h=>{const a=new CSSStyleSheet;a.replaceSync(h),s.push(a);const d=new CSSStyleSheet;d.replaceSync(h.slice(h.indexOf("@property"))),document.adoptedStyleSheets.push(d)})}class i extends n{constructor(...l){E("constructor",`%c${t}%c`),super(e,...l),L("@osheet",s),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){let l=ut();const h=()=>{l=n.prototype.render.call(this)};return h.fake=!0,b(h),l}attributeChangedCallback(l,h,a){E("%cAttribute has changed.%c",`%c${l}%c`,`oldValue: ${h}, newValue: ${a}`,`%c${t}%c`);try{a=JSON.parse(a)}catch{}const d=Z(l);if(d in this&&v(this[d])){const u=this[d];a===null?(u.set(u.initValue),this.removeAttribute(l)):u.set(a)}H(this,n.prototype.attributeChangedCallback,l,h,a)}connectedCallback(){var h;E("connectedCallback",`%c${t}%c`,this),this.providers&&Object.keys(this.providers).length>0&&(E("WRAPPER for providers",t),Object.entries(this.providers).forEach(([a,d])=>{E("register provider",a,d()),this.addEventListener(a,u=>{var C;E("send provider",a,d());const f=u;((C=f.detail)==null?void 0:C.context)===a&&(f.stopPropagation(),f.detail.callback(d))})})),this.checkInjects(),(h=n.prototype[B])==null||h.forEach(a=>{this[a]=d=>{const u=n.prototype[J][a],{bubbles:f,composed:C}=u;v(d)?b(()=>{L("@oemit reactive value",d()),this.dispatchEvent(new CustomEvent(a,{detail:d(),bubbles:f,composed:C}))}):(L("@oemit value",d),this.dispatchEvent(new CustomEvent(a,{detail:d,bubbles:f,composed:C})))}}),E("start render",`%c${t}%c`,t);const l=()=>{const a=this.render();this.shadow.appendChild(a.hostElement),this.appendSlotContent(),setTimeout(()=>{H(this,n.prototype.connectedCallback)})};if(this.rootStyle&&!n.styles){const a=f=>f instanceof Promise||Array.isArray(f)&&f.every(C=>C instanceof Promise),d=this.rootStyle,u=f=>{const C=new CSSStyleSheet;C.replaceSync(f),this.shadow.adoptedStyleSheets.push(C);const m=new CSSStyleSheet;m.replaceSync(f.slice(f.indexOf("@property"))),document.adoptedStyleSheets.push(m)};if(a(d)){const f=[];Array.isArray(d)?f.push(...d):f.push(d),Promise.all(f).then(C=>C.forEach(m=>u(m.default))).then(()=>l())}else{const f=[];Array.isArray(d)?f.push(...d):f.push(d),f.forEach(C=>u(C)),l()}}else l();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(a=>{E(this.slotContext,this.slotContext&&this.slotContext[a.name]),L("@bslot element",a,`name:${a.name};`,a.assignedElements()),a.assignedElements().forEach(d=>{const u=this.slotContext[a.name];this.slotContext&&v(u)&&(L("@oslot element",a,`name:${a.name};`,a.assignedElements()),b(()=>{d.dispatchEvent(new CustomEvent("handleSlotContext",{detail:u()}))}))})})}disconnectedCallback(){this.shadow.replaceChildren(),this.replaceChildren(),H(this,n.prototype.disconnectedCallback)}}return p(i,"observedAttributes",n.prototype[M]??[]),p(i,"renderTagName",t),i.toString=()=>t,customElements.get(t)?console.error(`название тега ${t} повторяется, компонент ${n.name} не зарегистрирован`):customElements.define(t,i),i};o.BaseElement=R,o.a=Yt,o.addAttributeList=it,o.addClassList=nt,o.addCustomAttributes=et,o.addHtmlContent=_,o.addReactiveClassList=st,o.addStyleList=ot,o.appendContentItem=$,o.article=me,o.aside=fe,o.audio=He,o.b=ge,o.bindReactiveSignals=yt,o.blockquote=Ee,o.br=ie,o.button=Ft,o.camelToKebab=I,o.canvas=Fe,o.checkCall=H,o.cite=ye,o.classList=K,o.cls=At,o.code=re,o.colorLog=L,o.component=ft,o.createComponent=Je,o.createCustom=dt,o.createCustomEl=at,o.createCustomElement=rt,o.createEl=lt,o.createElement=j,o.createSignal=Et,o.customEl=ht,o.defineSlotTemplate=$t,o.del=we,o.details=Ie,o.disableLogs=Q,o.div=ut,o.effect=b,o.el=V,o.elementHelpers=G,o.em=ve,o.enableLogs=Ct,o.event=qe,o.eventEmitter=gt,o.figcaption=be,o.figure=Ce,o.footer=he,o.forkJoin=pt,o.form=Nt,o.getList=Lt,o.getSignalContent=g,o.h1=xt,o.h2=te,o.h3=ee,o.h4=ne,o.h5=se,o.h6=oe,o.header=de,o.hr=le,o.htmlEffectWrapper=z,o.i=Ae,o.img=Qt,o.initComponent=D,o.input=Wt,o.ins=ke,o.isBaseElement=St,o.isComponentConfig=A,o.isComponentInitConfig=y,o.isReactiveSignal=v,o.isSlotTemplate=jt,o.kebabToCamel=Z,o.label=Vt,o.li=Gt,o.main=ue,o.mark=Te,o.meter=Pe,o.nav=ae,o.newEventEmitter=It,o.ol=Dt,o.oldGetList=Ot,o.option=Xt,o.p=Kt,o.pre=ce,o.progress=Me,o.projectLog=E,o.property=_e,o.renderIf=U,o.rs=bt,o.rxRenderIf=ct,o.s=Oe,o.section=Ht,o.select=Ut,o.setChildren=tt,o.setEffects=x,o.setHtmlContent=q,o.setListeners=N,o.show=kt,o.showIf=X,o.signal=O,o.signalComponent=Rt,o.slot=Be,o.small=pe,o.span=Pt,o.strong=Se,o.sub=Re,o.summary=$e,o.sup=je,o.table=Bt,o.td=_t,o.textarea=Zt,o.th=qt,o.tr=Jt,o.u=Le,o.ul=zt,o.unsafeHtml=Tt,o.useCustomComponent=Mt,o.video=We,o.when=wt,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
1
+ (function(o,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(o=typeof globalThis<"u"?globalThis:o||self,y(o.ReactiveComponent={}))})(this,function(o){"use strict";var ze=Object.defineProperty;var Ge=(o,y,A)=>y in o?ze(o,y,{enumerable:!0,configurable:!0,writable:!0,value:A}):o[y]=A;var p=(o,y,A)=>Ge(o,typeof y!="symbol"?y+"":y,A);const y=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),A=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,H=(t,e,...n)=>{e&&e.apply(t,n)};let W=!0;const E=(...t)=>{W&&console.log(t.join(" | "),...Array.from(t.join("").matchAll(/%c/gm)).map((e,n)=>n%2===0?"color:red":"color:inherit"))},I=t=>t.replace(/([A-Z])/gm,e=>`-${e.toLowerCase()}`),Z=t=>t.replace(/-(\w)/gm,(e,n)=>n.toUpperCase()),L=(t,...e)=>{if(!W)return;const n={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=t.match(/@[rgbpycow]/g)||[],i=s.map(l=>{const h=l.slice(1);return n[h]||"color: inherit"});let c=t;s.forEach(l=>{const h=new RegExp(`\\${l}([^\\s,]+)`,"g");c=c.replace(h,"%c$1")}),console.log(c,...i,...e)},Ct=()=>{W=!0},Q=()=>{W=!1};Q();const w=new WeakMap,F=[],k=[];function R(t,e=()=>!0){const n=new Set;let s=e;function i(){const c=F[F.length-1];if(c&&!("fake"in c&&c.fake)){const l=w.get(c),h=l==null?void 0:l.parent;if(h){const a=w.get(h);a==null||a.cleanupFns.add(()=>{n.delete(c)})}n.add(c)}return t}return i.getSubscribers=()=>[...n],i.setCompareFn=function(c){return s=c,i},i.clearSubscribers=function(){n.clear()},i.peek=function(){return Object.freeze(t)},i.initValue=Object.freeze(t),i.oldValue=Object.freeze(t),i.forceSet=function(c){i.oldValue=Object.freeze(t),t=c,n.forEach(l=>Promise.resolve(l).then(h=>{const a=w.get(h);a&&a.cleanupFns.size>0&&(a.cleanupFns.forEach(d=>d()),a.cleanupFns.clear()),k.push(h),h(),k.pop()}))},i.set=function(c,l=s){t!==c&&l(t,c)&&i.forceSet(c)},i.update=function(c){i.set(c(t))},i.pipe=c=>{const l=R(null);return b(()=>{const h=c(i());h instanceof Promise?h.then(a=>l.set(a)):v(h)?b(()=>l.set(h())):l.set(h)}),l},i}function b(t){const e=Date.now();E("current effect",`%c${e}%c`);const n=t;t=()=>(E("current effect callback",`%c${e}%c`),n());const s=k[k.length-1];w.has(t)||w.set(t,{cleanupFns:new Set});const i=w.get(t);s?i.parent=s:delete i.parent,k.push(t),F.push(t),t(),F.pop(),k.pop()}const v=t=>!!t&&["object","function"].includes(typeof t)&&"set"in t&&"oldValue"in t&&"update"in t&&"forceSet"in t;function bt(t,...e){const n=R("");return b(()=>{const s=e.map(c=>v(c)?String(c()):String(c)),i=[t[0]];s.forEach((c,l)=>{i.push(c,t[l+1])}),n.set(i.join(""))}),n}function Et(t,e){const n=R(e??null),s=i=>n.set(i);return t instanceof Promise?t.then(s):typeof t=="function"&&b(()=>{const i=t();i instanceof Promise?i.then(s):v(i)?b(()=>s(i())):s(i)}),n}function yt(t,e){let n=t(),s=e();b(()=>{const i=t(),c=e();i!==c&&(i!==n?e.set(i):c!==s&&t.set(c)),n=i,s=c})}function pt(...t){let e=t.map(s=>s());const n=R(e);return t.forEach((s,i)=>{b(()=>{const c=()=>e.filter(l=>l!==void 0).length;c()===t.length&&(e=Array.from(e).fill(void 0)),e[i]=s(),c()===t.length&&n.set([...e])})}),n}class O extends HTMLElement{constructor(n=!1){super();p(this,"isSlotLazyLoading",!1);p(this,"slotTemplate");p(this,"slotContext");p(this,"rootStyle");p(this,"modelValue");p(this,"providers");p(this,"appendAllSlotContent");p(this,"allSlotContent",[]);p(this,"slotContent",{});p(this,"htmlSlotContent",{});p(this,"shadow");p(this,"injects",{});this.shadow=this.attachShadow({mode:n?"closed":"open"})}appendChild(n,s=!0){var i;if(this.isSlotLazyLoading&&s){if(n instanceof HTMLElement){const c=n.slot||"default";this.htmlSlotContent[c]||(this.htmlSlotContent[c]=[]),(i=this.htmlSlotContent[c])==null||i.push(n)}}else return super.appendChild(n)}appendSlotContent(){var n;(n=this.appendAllSlotContent)==null||n.call(this)}inject(n){return E("%cinject%c",n),this.injects[n]||(this.injects[n]=R(null)),this.injects[n]}checkInjects(){Object.entries(this.injects).forEach(([n,s])=>{E("%cinject%c",`%c${n}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(n,{detail:{context:n,callback:i=>b(()=>{s.set(i())})},bubbles:!0,composed:!0}))})}setReactiveValue(n){this.modelValue=n}}p(O,"observedAttributes",[]),p(O,"renderTagName",""),p(O,"styles");const St=t=>"render"in t&&"setReactiveValue"in t,vt="handleSlotContext",Y="onConnected",gt=()=>()=>{},_=(t,e)=>{const n=new Text(typeof e=="string"?e:JSON.stringify(e));return t.appendChild(n),t},q=(t,e)=>(t.innerHTML="",_(t,e)),z=t=>{const e=document.createElement("div");return e.style.display="contents",b(()=>{const n=t();q(e,n)}),e},G=t=>({append(...e){return e.forEach(n=>{t.appendChild(n.hostElement),Y in n.hostElement&&setTimeout(()=>{var s,i;(i=(s=n.hostElement).onConnected)==null||i.call(s,n,n.hostElement)})}),this},set(...e){this.clear();const n=document.createDocumentFragment();return e.forEach(s=>{n.appendChild(s.hostElement)}),t.appendChild(n),this},removeChild(...e){return e.forEach(n=>{Array.from(t.childNodes.values()).some(s=>s===n.hostElement)&&t.removeChild(n.hostElement)}),this},addHtmlContent(e){return _(t,e),this},setHtmlContent(e){return q(t,e),this},addEventlistener(e,n,s=!1){return t.addEventListener(e,i=>n(i,this,t),s),this},setAttribute(e,n){let s;if(typeof n=="boolean"&&!(t instanceof O))if(n)s="";else{this.removeAttribute(e);const i=e.toLowerCase();return i in t&&(t[i]=null),this}else typeof n!="string"?s=JSON.stringify(n):s=n;if(t.setAttribute(I(e),s),!(t instanceof O)){const i=e.toLowerCase();i in t&&(t[i]=n)}return this},setCustomAttribute(e,n){let s;return typeof n!="string"?s=JSON.stringify(n):s=n,t.setAttribute(I(e),s),this},setReactiveAttribute(e,n){return b(()=>this.setAttribute(e,n())),this},setReactiveCustomAttribute(e,n){return b(()=>this.setCustomAttribute(e,n())),this},removeAttribute(e){return t.removeAttribute(I(e)),this},addStyle(e){return Object.entries(e).forEach(([n,s])=>{const i=n.startsWith("--");typeof s=="function"?this.addEffect(()=>{if(i){const c=String(s()||"");t.style.setProperty(n,c)}else t.style[n]=s()}):typeof s=="string"&&(i?t.style.setProperty(n,s):t.style[n]=s)}),this},onConnected(e){return Reflect.defineProperty(t,Y,{get(){return e}}),this},addClass(...e){return e.forEach(n=>{typeof n=="string"?t.classList.add(...n.split(" ").flatMap(s=>s.split(`
2
+ `)).map(s=>s.trim()).filter(Boolean)):(()=>{let s=null;this.addEffect(()=>{const i=n();i.length>0&&(s?this.replaceClass(s,i):this.addClass(i),s=i)})})()}),this},setClass(...e){return t.classList.remove(...t.classList),t.classList.add(...e),this},addReactiveClass(e){return Object.keys(e).forEach(n=>{b(()=>{e[n]()?this.addClass(n):this.removeClass(n)})}),this},removeClass(...e){return t.classList.remove(...e),this},replaceClass(e,n){return t.classList.replace(e,n),this},addEffect(e){return b(()=>e(this,this.hostElement)),this},addReactiveContent(e){return t.appendChild(z(e)),this},setReactiveContent(e){return this.clear(),t.appendChild(z(e)),this},clear(){return t.innerHTML="",this},hostElement:t}),K=(t,...e)=>({classList:[...t.map(n=>n.trim()).filter(Boolean),...e]}),At=(t,...e)=>K(t,...e),N=(t,e)=>{if(!e)return t;const n=Object.keys(e||{}).filter(s=>s.startsWith(".")||s.startsWith("@")||s.startsWith("$"));return n.filter(s=>s.startsWith(".")).forEach(s=>{e!=null&&e.attributes||(e.attributes={}),e.attributes[s.slice(1)]=e[s]}),n.filter(s=>s.startsWith("@")).forEach(s=>{e!=null&&e.listeners||(e.listeners={});const i=s.slice(1);e.listeners[i]=e[s]}),n.filter(s=>s.startsWith("$")).forEach(s=>{e!=null&&e.effects||(e.effects=[]),e.effects.push(e[s])}),nt(t,e.classList),ot(t,e.style),it(t,e.attributes),st(t,e.reactiveClassList),et(t,e.customAttributes),tt(t,e.children),x(t,e.effects),D(t,e.listeners),D(t,e.customListeners),t},D=(t,e)=>{e&&Object.entries(e).forEach(([n,s])=>{typeof s=="function"&&t.addEventlistener(n,s)})},x=(t,e)=>e==null?void 0:e.forEach(n=>t.addEffect(n)),tt=(t,e)=>$(t,...e||[]),et=(t,e)=>{const n=e;n&&Object.keys(n).forEach(s=>{v(n[s])?t.setReactiveCustomAttribute(s,n[s]):typeof n[s]=="function"?t.addEffect(()=>{t.setCustomAttribute(s,n[s]())}):t.setCustomAttribute(s,n[s])})},nt=(t,e)=>t.addClass(...e||[]),st=(t,e)=>t.addReactiveClass(e||{}),ot=(t,e)=>t.addStyle(e||{}),it=(t,e)=>{const n=e,s=(i,c)=>{c&&(v(c)?t.setReactiveAttribute(i,c):typeof c=="function"?t.addEffect(()=>{t.setAttribute(i,c())}):t.setAttribute(i,c))};n&&Object.keys(n).forEach(i=>{s(i,n[i])})},$=(t,...e)=>(e.forEach(n=>{typeof n=="string"?n.trim().length>0&&t.addHtmlContent(n):v(n)?t.addReactiveContent(n):t.append(n)}),t),j=(t,e)=>{const n=document.createElement(t),s={...G(n)};return N(s,e)},lt=(t,e)=>{const[n,...s]=t.split(" ").map(c=>c.trim()),i=j(n,e);return s.length>0&&i.addClass(...s),(...c)=>$(i,...c.filter(Boolean).map(l=>typeof l=="function"&&!v(l)?g(()=>l(i)):l))},V=(t,e)=>{const n=lt(t,e);return Object.assign(n,n())},g=t=>j("div").addStyle({display:"contents"}).addEffect(e=>{const n=t(),s=[];Array.isArray(n)?s.push(...n):s.push(n),e.clear(),$(e,...s)}),Lt=(t,e,n)=>{const s=j("div").addStyle({display:"contents"}),i=new Map,c=new Map;let l=[];const h=new Set;let a=t.peek();const d=u=>{h.delete(u),i.delete(u),c.delete(u)};return b(()=>{const u=t();l=u.map(e).map(m=>typeof m=="string"?m:m.toString());const f=Array.from(s.hostElement.children);E("containerChildren",f,l),f.forEach(m=>{const S=m.dataset.key;l.includes(S)||(E("remove element",S,m),m.remove(),d(S))}),l.forEach(m=>{var P,T;const S=u[l.indexOf(m)];i.has(m)?JSON.stringify(S)!==JSON.stringify(a[l.indexOf(m)])&&((P=s.hostElement.querySelector(`[data-key="${m}"]`))==null||P.remove(),(T=i.get(m))==null||T.set(Math.random().toString(36).substring(2,15)),c.set(m,()=>n(S,l.indexOf(m),u).setCustomAttribute("data-key",m))):(E("create new element",m,S),i.set(m,R(Math.random().toString(36).substring(2,15))),c.set(m,()=>n(S,l.indexOf(m),u).setCustomAttribute("data-key",m)))}),a=u;const C=()=>{i.forEach((m,S)=>{E("key from setTimeout foreach currItemSignalMap",S),h.has(S)||(h.add(S),b(()=>{var mt;m();const P=l.indexOf(S),T=(mt=c.get(S))==null?void 0:mt();T&&(E("call effect from setTimeout",S,T.hostElement),P<=s.hostElement.children.length-1?s.hostElement.insertBefore(T.hostElement,s.hostElement.children[P]):s.hostElement.append(T.hostElement))}))})};Promise.resolve().then(()=>C())}),s},Rt=(t,e,n)=>{const s=j("div").addStyle({display:"contents"}),i=new Map;return b(()=>{let c=Array.from(s.hostElement.children).map(d=>d.dataset.key);const l=t(),h=l.map(e).map(d=>d.toString()),a=new Map;l.forEach((d,u)=>a.set(h[u],d)),c.filter(d=>!h.includes(d)).forEach(d=>{var u;return(u=s.hostElement.querySelector(`[data-key="${d}"]`))==null?void 0:u.remove()}),c=c.filter(d=>h.includes(d)),h.forEach((d,u)=>{if(c.includes(d)){if(JSON.stringify(i.get(d))!==JSON.stringify(a.get(d))){const f=n(l[u],u,l).setCustomAttribute("data-key",d).hostElement;s.hostElement.querySelector(`[data-key="${d}"]`).replaceWith(f);const C=s.hostElement.children;u>C.length-2?s.hostElement.append(f):s.hostElement.insertBefore(f,C[u+1])}}else{const f=n(l[u],u,l).setCustomAttribute("data-key",d),C=s.hostElement.children;u>C.length-1?s.hostElement.append(f.hostElement):s.hostElement.insertBefore(f.hostElement,C[u])}}),l.forEach((d,u)=>i.set(h[u],d))}),s},Ot=t=>{let e=[j("div")],n=!1;return b(()=>{var c;const s=t(),i=[];Array.isArray(s)?(i.push(...s),n=!0):i.push(s),i.length===0&&i.push(j("div").addStyle({display:"none"}));try{(c=e[0].hostElement)==null||c.replaceWith(...i.map(l=>l.hostElement)),e.forEach(l=>{var h;return(h=l.hostElement)==null?void 0:h.remove()}),e=i}catch(l){console.error(l)}}),n?e:e[0]},jt=t=>vt in t,Tt=t=>{const e=V("div").addStyle({display:"contents"}),n=s=>(e.hostElement.innerHTML=s,e);return typeof t=="string"?n(t):e.addEffect(()=>{n(t())}),e},U=(t,e,n)=>g(t?e:n||(()=>"")),ct=(t,e,n)=>g(()=>U(!!t(),e,n)),wt=(t,e,n)=>typeof t=="boolean"?U(t,e,n):ct(t,e,n),X=(t,e)=>{const n=g(e);return typeof t=="boolean"?n.hostElement.style.display=t?"contents":"none":n.addEffect((s,i)=>{i.style.display=t()?"contents":"none"}),n},kt=(t,e,n)=>{const s=[];return s.push(X(t,e)),n&&s.push(X(()=>typeof t=="boolean"?!t:!t(),n)),g(()=>s)},rt=(t,e)=>{E("createCustomElement",t);const n=document.createElement(t),s={...G(n),setReactiveValue(i){return n instanceof O&&n.setReactiveValue(i),this},setSlotTemplate(i){const c=n.slotTemplate;return c&&Object.entries(i).forEach(([l,h])=>{c[l]=h}),this}};return N(s,e)},at=(t,e)=>{const n=t.split(" ").slice(1).map(i=>i.trim()),s=rt(t.split(" ")[0],e);return Array.isArray(n)&&n.length>0&&s.addClass(...n),(...i)=>{L("@rcreateCustomEl content",t,i);const c=i.filter(Boolean).map(l=>typeof l=="function"&&!v(l)?g(()=>l(s)):l);return s.hostElement.allSlotContent=c,s.hostElement.slotContent=c.filter(A).reduce((l,h)=>{const a=h.hostElement.getAttribute("slot")||"default";return l[a]||(l[a]=[]),l[a].push(h),l},{}),s.hostElement.appendAllSlotContent=()=>$(s,...c),s}},dt=(t,e,n)=>at(`${t.renderTagName}${e&&typeof e=="string"?" "+e:""}`,y(e)?e:e&&typeof e=="string"?n:void 0),ht=(t,e,n)=>{const s=dt(t,e,n);return Object.assign(s,s())},It=()=>{const t=()=>{};return t.oldValue=null,t},$t=()=>({}),Mt=(t,e,n)=>{const s=e?ft(e,n)(t):t;return(i,...c)=>{const l=[...c];return i&&!y(i)&&l.unshift(i),ht(s,y(i)?i:{})(...l)}},r={};["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=>{r[t]=(e,...n)=>{let s=[...n];return e&&!y(e)&&(s=[e].concat(s)),V(t,y(e)?e:{})(...s)}});const ut=r.div,Pt=r.span,Ht=r.section,Wt=r.input,Ft=r.button,Bt=r.table,Jt=r.tr,_t=r.td,qt=r.th,zt=r.ul,Gt=r.li,Nt=r.ol,Dt=r.form,Vt=r.label,Ut=r.select,Xt=r.option,Zt=r.textarea,Qt=r.img,Yt=r.a,Kt=r.p,xt=r.h1,te=r.h2,ee=r.h3,ne=r.h4,se=r.h5,oe=r.h6,ie=r.br,le=r.hr,ce=r.pre,re=r.code,ae=r.nav,de=r.header,he=r.footer,ue=r.main,fe=r.aside,me=r.article,Ce=r.figure,be=r.figcaption,Ee=r.blockquote,ye=r.cite,pe=r.small,Se=r.strong,ve=r.em,ge=r.b,Ae=r.i,Le=r.u,Re=r.s,Oe=r.sub,je=r.sup,Te=r.mark,we=r.del,ke=r.ins,Ie=r.details,$e=r.summary,Me=r.progress,Pe=r.meter,He=r.audio,We=r.video,Fe=r.canvas,Be=r.slot,Je=t=>e=>t(e).addClass(...e.classList??[]).addReactiveClass(e.reactiveClassList??{}),B="eventProps",J="EVENT_CONFIG",M="observedAttributes",_e=()=>(t,e)=>{Reflect.get(t,M)||Reflect.defineProperty(t,M,{value:[]}),Reflect.get(t,M).push(I(e))},qe=t=>(e,n)=>{Reflect.get(e,B)||Reflect.defineProperty(e,B,{value:[]}),Reflect.get(e,J)||Reflect.defineProperty(e,J,{value:{}}),Reflect.get(e,J)[n]={bubbles:(t==null?void 0:t.bubbles)??!1,composed:(t==null?void 0:t.composed)??!1},Reflect.get(e,B).push(n)},ft=(t,e=!1)=>n=>{E(t,"start register static attr",n.prototype[M]);const s=[];if(n.styles){const c=n.styles,l=[];Array.isArray(c)?l.push(...c):l.push(c),l.forEach(h=>{const a=new CSSStyleSheet;a.replaceSync(h),s.push(a);const d=new CSSStyleSheet;d.replaceSync(h.slice(h.indexOf("@property"))),document.adoptedStyleSheets.push(d)})}class i extends n{constructor(...l){E("constructor",`%c${t}%c`),super(e,...l),L("@osheet",s),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){console.debug("rwc: render from new class");let l=ut();const h=()=>{console.debug("rwc: wrapperEffectCallback"),l=n.prototype.render.call(this)};return h.fake=!0,b(h),l}attributeChangedCallback(l,h,a){E("%cAttribute has changed.%c",`%c${l}%c`,`oldValue: ${h}, newValue: ${a}`,`%c${t}%c`);try{a=JSON.parse(a)}catch{}const d=Z(l);if(d in this&&v(this[d])){const u=this[d];a===null?(u.set(u.initValue),this.removeAttribute(l)):u.set(a)}H(this,n.prototype.attributeChangedCallback,l,h,a)}connectedCallback(){var h;console.debug("rwc: connectedCallback"),E("connectedCallback",`%c${t}%c`,this),this.providers&&Object.keys(this.providers).length>0&&(E("WRAPPER for providers",t),Object.entries(this.providers).forEach(([a,d])=>{E("register provider",a,d()),this.addEventListener(a,u=>{var C;E("send provider",a,d());const f=u;((C=f.detail)==null?void 0:C.context)===a&&(f.stopPropagation(),f.detail.callback(d))})})),this.checkInjects(),(h=n.prototype[B])==null||h.forEach(a=>{this[a]=d=>{const u=n.prototype[J][a],{bubbles:f,composed:C}=u;v(d)?b(()=>{L("@oemit reactive value",d()),this.dispatchEvent(new CustomEvent(a,{detail:d(),bubbles:f,composed:C}))}):(L("@oemit value",d),this.dispatchEvent(new CustomEvent(a,{detail:d,bubbles:f,composed:C})))}}),E("start render",`%c${t}%c`,t);const l=()=>{console.debug("rwc: insertRenderTemplate");const a=this.render();this.shadow.appendChild(a.hostElement),this.appendSlotContent(),H(this,n.prototype.connectedCallback)};if(this.rootStyle&&!n.styles){const a=f=>f instanceof Promise||Array.isArray(f)&&f.every(C=>C instanceof Promise),d=this.rootStyle,u=f=>{const C=new CSSStyleSheet;C.replaceSync(f),this.shadow.adoptedStyleSheets.push(C);const m=new CSSStyleSheet;m.replaceSync(f.slice(f.indexOf("@property"))),document.adoptedStyleSheets.push(m)};if(a(d)){const f=[];Array.isArray(d)?f.push(...d):f.push(d),Promise.all(f).then(C=>C.forEach(m=>u(m.default))).then(()=>l())}else{const f=[];Array.isArray(d)?f.push(...d):f.push(d),f.forEach(C=>u(C)),l()}}else l();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(a=>{E(this.slotContext,this.slotContext&&this.slotContext[a.name]),L("@bslot element",a,`name:${a.name};`,a.assignedElements()),a.assignedElements().forEach(d=>{const u=this.slotContext[a.name];this.slotContext&&v(u)&&(L("@oslot element",a,`name:${a.name};`,a.assignedElements()),b(()=>{d.dispatchEvent(new CustomEvent("handleSlotContext",{detail:u()}))}))})})}disconnectedCallback(){this.shadow.replaceChildren(),this.replaceChildren(),H(this,n.prototype.disconnectedCallback)}}return p(i,"observedAttributes",n.prototype[M]??[]),p(i,"renderTagName",t),i.toString=()=>t,customElements.get(t)?console.error(`название тега ${t} повторяется, компонент ${n.name} не зарегистрирован`):customElements.define(t,i),n.renderTagName=t,n};o.BaseElement=O,o.a=Yt,o.addAttributeList=it,o.addClassList=nt,o.addCustomAttributes=et,o.addHtmlContent=_,o.addReactiveClassList=st,o.addStyleList=ot,o.appendContentItem=$,o.article=me,o.aside=fe,o.audio=He,o.b=ge,o.bindReactiveSignals=yt,o.blockquote=Ee,o.br=ie,o.button=Ft,o.camelToKebab=I,o.canvas=Fe,o.checkCall=H,o.cite=ye,o.classList=K,o.cls=At,o.code=re,o.colorLog=L,o.component=ft,o.createComponent=Je,o.createCustom=dt,o.createCustomEl=at,o.createCustomElement=rt,o.createEl=lt,o.createElement=j,o.createSignal=Et,o.customEl=ht,o.defineSlotTemplate=$t,o.del=we,o.details=Ie,o.disableLogs=Q,o.div=ut,o.effect=b,o.el=V,o.elementHelpers=G,o.em=ve,o.enableLogs=Ct,o.event=qe,o.eventEmitter=gt,o.figcaption=be,o.figure=Ce,o.footer=he,o.forkJoin=pt,o.form=Dt,o.getList=Lt,o.getSignalContent=g,o.h1=xt,o.h2=te,o.h3=ee,o.h4=ne,o.h5=se,o.h6=oe,o.header=de,o.hr=le,o.htmlEffectWrapper=z,o.i=Ae,o.img=Qt,o.initComponent=N,o.input=Wt,o.ins=ke,o.isBaseElement=St,o.isComponentConfig=A,o.isComponentInitConfig=y,o.isReactiveSignal=v,o.isSlotTemplate=jt,o.kebabToCamel=Z,o.label=Vt,o.li=Gt,o.main=ue,o.mark=Te,o.meter=Pe,o.nav=ae,o.newEventEmitter=It,o.ol=Nt,o.oldGetList=Rt,o.option=Xt,o.p=Kt,o.pre=ce,o.progress=Me,o.projectLog=E,o.property=_e,o.renderIf=U,o.rs=bt,o.rxRenderIf=ct,o.s=Re,o.section=Ht,o.select=Ut,o.setChildren=tt,o.setEffects=x,o.setHtmlContent=q,o.setListeners=D,o.show=kt,o.showIf=X,o.signal=R,o.signalComponent=Ot,o.slot=Be,o.small=pe,o.span=Pt,o.strong=Se,o.sub=Oe,o.summary=$e,o.sup=je,o.table=Bt,o.td=_t,o.textarea=Zt,o.th=qt,o.tr=Jt,o.u=Le,o.ul=zt,o.unsafeHtml=Tt,o.useCustomComponent=Mt,o.video=We,o.when=wt,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
@@ -1,7 +1,7 @@
1
1
  var X = Object.defineProperty;
2
2
  var Z = (t, e, s) => e in t ? X(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
- var E = (t, e, s) => Z(t, typeof e != "symbol" ? e + "" : e, s);
4
- const w = (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(
3
+ var b = (t, e, s) => Z(t, typeof e != "symbol" ? e + "" : e, s);
4
+ const x = (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(
5
5
  (e) => e.startsWith(".") || e.startsWith("@") || e.startsWith("$")
6
6
  )) && !("hostElement" in t), Q = (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, F = (t, e, ...s) => {
7
7
  e && e.apply(t, s);
@@ -12,7 +12,7 @@ const C = (...t) => {
12
12
  t.join(" | "),
13
13
  ...Array.from(t.join("").matchAll(/%c/gm)).map((e, s) => s % 2 === 0 ? "color:red" : "color:inherit")
14
14
  );
15
- }, $ = (t) => t.replace(/([A-Z])/gm, (e) => `-${e.toLowerCase()}`), Y = (t) => t.replace(/-(\w)/gm, (e, s) => s.toUpperCase()), A = (t, ...e) => {
15
+ }, k = (t) => t.replace(/([A-Z])/gm, (e) => `-${e.toLowerCase()}`), Y = (t) => t.replace(/-(\w)/gm, (e, s) => s.toUpperCase()), A = (t, ...e) => {
16
16
  if (!P) return;
17
17
  const s = {
18
18
  r: "color: #ff0000",
@@ -47,7 +47,7 @@ const C = (...t) => {
47
47
  };
48
48
  K();
49
49
  const L = /* @__PURE__ */ new WeakMap(), M = [], g = [];
50
- function R(t, e = () => !0) {
50
+ function j(t, e = () => !0) {
51
51
  const s = /* @__PURE__ */ new Set();
52
52
  let n = e;
53
53
  function o() {
@@ -80,7 +80,7 @@ function R(t, e = () => !0) {
80
80
  }, o.update = function(c) {
81
81
  o.set(c(t));
82
82
  }, o.pipe = (c) => {
83
- const r = R(null);
83
+ const r = j(null);
84
84
  return m(() => {
85
85
  const h = c(o());
86
86
  h instanceof Promise ? h.then((l) => r.set(l)) : y(h) ? m(() => r.set(h())) : r.set(h);
@@ -99,7 +99,7 @@ function m(t) {
99
99
  }
100
100
  const y = (t) => !!t && ["object", "function"].includes(typeof t) && "set" in t && "oldValue" in t && "update" in t && "forceSet" in t;
101
101
  function St(t, ...e) {
102
- const s = R("");
102
+ const s = j("");
103
103
  return m(() => {
104
104
  const n = e.map(
105
105
  (c) => y(c) ? String(c()) : String(c)
@@ -110,7 +110,7 @@ function St(t, ...e) {
110
110
  }), s;
111
111
  }
112
112
  function vt(t, e) {
113
- const s = R(e ?? null), n = (o) => s.set(o);
113
+ const s = j(e ?? null), n = (o) => s.set(o);
114
114
  return t instanceof Promise ? t.then(n) : typeof t == "function" && m(() => {
115
115
  const o = t();
116
116
  o instanceof Promise ? o.then(n) : y(o) ? m(() => n(o())) : n(o);
@@ -125,7 +125,7 @@ function At(t, e) {
125
125
  }
126
126
  function gt(...t) {
127
127
  let e = t.map((n) => n());
128
- const s = R(e);
128
+ const s = j(e);
129
129
  return t.forEach((n, o) => {
130
130
  m(() => {
131
131
  const c = () => e.filter((r) => r !== void 0).length;
@@ -136,18 +136,18 @@ function gt(...t) {
136
136
  class O extends HTMLElement {
137
137
  constructor(s = !1) {
138
138
  super();
139
- E(this, "isSlotLazyLoading", !1);
140
- E(this, "slotTemplate");
141
- E(this, "slotContext");
142
- E(this, "rootStyle");
143
- E(this, "modelValue");
144
- E(this, "providers");
145
- E(this, "appendAllSlotContent");
146
- E(this, "allSlotContent", []);
147
- E(this, "slotContent", {});
148
- E(this, "htmlSlotContent", {});
149
- E(this, "shadow");
150
- E(this, "injects", {});
139
+ b(this, "isSlotLazyLoading", !1);
140
+ b(this, "slotTemplate");
141
+ b(this, "slotContext");
142
+ b(this, "rootStyle");
143
+ b(this, "modelValue");
144
+ b(this, "providers");
145
+ b(this, "appendAllSlotContent");
146
+ b(this, "allSlotContent", []);
147
+ b(this, "slotContent", {});
148
+ b(this, "htmlSlotContent", {});
149
+ b(this, "shadow");
150
+ b(this, "injects", {});
151
151
  this.shadow = this.attachShadow({ mode: s ? "closed" : "open" });
152
152
  }
153
153
  // @ts-expect-error - appendChild is not defined in the HTMLElement interface
@@ -165,7 +165,7 @@ class O extends HTMLElement {
165
165
  (s = this.appendAllSlotContent) == null || s.call(this);
166
166
  }
167
167
  inject(s) {
168
- return C("%cinject%c", s), this.injects[s] || (this.injects[s] = R(null)), this.injects[s];
168
+ return C("%cinject%c", s), this.injects[s] || (this.injects[s] = j(null)), this.injects[s];
169
169
  }
170
170
  checkInjects() {
171
171
  Object.entries(this.injects).forEach(([s, n]) => {
@@ -191,20 +191,20 @@ class O extends HTMLElement {
191
191
  this.modelValue = s;
192
192
  }
193
193
  }
194
- E(O, "observedAttributes", []), E(O, "renderTagName", ""), E(O, "styles");
194
+ b(O, "observedAttributes", []), b(O, "renderTagName", ""), b(O, "styles");
195
195
  const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotContext", _ = "onConnected", Ot = () => () => {
196
196
  }, z = (t, e) => {
197
197
  const s = new Text(
198
198
  typeof e == "string" ? e : JSON.stringify(e)
199
199
  );
200
200
  return t.appendChild(s), t;
201
- }, D = (t, e) => (t.innerHTML = "", z(t, e)), B = (t) => {
201
+ }, N = (t, e) => (t.innerHTML = "", z(t, e)), B = (t) => {
202
202
  const e = document.createElement("div");
203
203
  return e.style.display = "contents", m(() => {
204
204
  const s = t();
205
- D(e, s);
205
+ N(e, s);
206
206
  }), e;
207
- }, N = (t) => ({
207
+ }, D = (t) => ({
208
208
  append(...e) {
209
209
  return e.forEach((s) => {
210
210
  t.appendChild(s.hostElement), _ in s.hostElement && setTimeout(() => {
@@ -235,7 +235,7 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
235
235
  return z(t, e), this;
236
236
  },
237
237
  setHtmlContent(e) {
238
- return D(t, e), this;
238
+ return N(t, e), this;
239
239
  },
240
240
  addEventlistener(e, s, n = !1) {
241
241
  return t.addEventListener(e, (o) => s(o, this, t), n), this;
@@ -251,7 +251,7 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
251
251
  return o in t && (t[o] = null), this;
252
252
  }
253
253
  else typeof s != "string" ? n = JSON.stringify(s) : n = s;
254
- if (t.setAttribute($(e), n), !(t instanceof O)) {
254
+ if (t.setAttribute(k(e), n), !(t instanceof O)) {
255
255
  const o = e.toLowerCase();
256
256
  o in t && (t[o] = s);
257
257
  }
@@ -259,7 +259,7 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
259
259
  },
260
260
  setCustomAttribute(e, s) {
261
261
  let n;
262
- return typeof s != "string" ? n = JSON.stringify(s) : n = s, t.setAttribute($(e), n), this;
262
+ return typeof s != "string" ? n = JSON.stringify(s) : n = s, t.setAttribute(k(e), n), this;
263
263
  },
264
264
  setReactiveAttribute(e, s) {
265
265
  return m(() => this.setAttribute(e, s())), this;
@@ -268,7 +268,7 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
268
268
  return m(() => this.setCustomAttribute(e, s())), this;
269
269
  },
270
270
  removeAttribute(e) {
271
- return t.removeAttribute($(e)), this;
271
+ return t.removeAttribute(k(e)), this;
272
272
  },
273
273
  addStyle(e) {
274
274
  return Object.entries(e).forEach(([s, n]) => {
@@ -334,7 +334,7 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
334
334
  hostElement: t
335
335
  }), et = (t, ...e) => ({
336
336
  classList: [...t.map((s) => s.trim()).filter(Boolean), ...e]
337
- }), jt = (t, ...e) => et(t, ...e), G = (t, e) => {
337
+ }), Rt = (t, ...e) => et(t, ...e), G = (t, e) => {
338
338
  if (!e) return t;
339
339
  const s = Object.keys(e || {}).filter(
340
340
  (n) => n.startsWith(".") || n.startsWith("@") || n.startsWith("$")
@@ -370,13 +370,13 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
370
370
  });
371
371
  }, W = (t, ...e) => (e.forEach((s) => {
372
372
  typeof s == "string" ? s.trim().length > 0 && t.addHtmlContent(s) : y(s) ? t.addReactiveContent(s) : t.append(s);
373
- }), t), j = (t, e) => {
373
+ }), t), R = (t, e) => {
374
374
  const s = document.createElement(t), n = {
375
- ...N(s)
375
+ ...D(s)
376
376
  };
377
377
  return G(n, e);
378
378
  }, at = (t, e) => {
379
- const [s, ...n] = t.split(" ").map((c) => c.trim()), o = j(s, e);
379
+ const [s, ...n] = t.split(" ").map((c) => c.trim()), o = R(s, e);
380
380
  return n.length > 0 && o.addClass(...n), (...c) => W(
381
381
  o,
382
382
  ...c.filter(Boolean).map(
@@ -386,11 +386,11 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
386
386
  }, V = (t, e) => {
387
387
  const s = at(t, e);
388
388
  return Object.assign(s, s());
389
- }, S = (t) => j("div").addStyle({ display: "contents" }).addEffect((e) => {
389
+ }, S = (t) => R("div").addStyle({ display: "contents" }).addEffect((e) => {
390
390
  const s = t(), n = [];
391
391
  Array.isArray(s) ? n.push(...s) : n.push(s), e.clear(), W(e, ...n);
392
- }), Rt = (t, e, s) => {
393
- const n = j("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
392
+ }), jt = (t, e, s) => {
393
+ const n = R("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
394
394
  let r = [];
395
395
  const h = /* @__PURE__ */ new Set();
396
396
  let l = t.peek();
@@ -402,49 +402,49 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
402
402
  r = d.map(e).map((f) => typeof f == "string" ? f : f.toString());
403
403
  const u = Array.from(n.hostElement.children);
404
404
  C("containerChildren", u, r), u.forEach((f) => {
405
- const b = f.dataset.key;
406
- r.includes(b) || (C("remove element", b, f), f.remove(), a(b));
405
+ const E = f.dataset.key;
406
+ r.includes(E) || (C("remove element", E, f), f.remove(), a(E));
407
407
  }), r.forEach((f) => {
408
- var T, v;
409
- const b = d[r.indexOf(f)];
410
- o.has(f) ? JSON.stringify(b) !== JSON.stringify(l[r.indexOf(f)]) && ((T = n.hostElement.querySelector(`[data-key="${f}"]`)) == null || T.remove(), (v = o.get(f)) == null || v.set(Math.random().toString(36).substring(2, 15)), c.set(
408
+ var w, v;
409
+ const E = d[r.indexOf(f)];
410
+ o.has(f) ? JSON.stringify(E) !== JSON.stringify(l[r.indexOf(f)]) && ((w = n.hostElement.querySelector(`[data-key="${f}"]`)) == null || w.remove(), (v = o.get(f)) == null || v.set(Math.random().toString(36).substring(2, 15)), c.set(
411
411
  f,
412
- () => s(b, r.indexOf(f), d).setCustomAttribute(
412
+ () => s(E, r.indexOf(f), d).setCustomAttribute(
413
413
  "data-key",
414
414
  f
415
415
  )
416
- )) : (C("create new element", f, b), o.set(
416
+ )) : (C("create new element", f, E), o.set(
417
417
  f,
418
- R(Math.random().toString(36).substring(2, 15))
418
+ j(Math.random().toString(36).substring(2, 15))
419
419
  ), c.set(
420
420
  f,
421
- () => s(b, r.indexOf(f), d).setCustomAttribute(
421
+ () => s(E, r.indexOf(f), d).setCustomAttribute(
422
422
  "data-key",
423
423
  f
424
424
  )
425
425
  ));
426
426
  }), l = d;
427
427
  const p = () => {
428
- o.forEach((f, b) => {
429
- C("key from setTimeout foreach currItemSignalMap", b), h.has(b) || (h.add(b), m(() => {
428
+ o.forEach((f, E) => {
429
+ C("key from setTimeout foreach currItemSignalMap", E), h.has(E) || (h.add(E), m(() => {
430
430
  var H;
431
431
  f();
432
- const T = r.indexOf(b), v = (H = c.get(b)) == null ? void 0 : H();
432
+ const w = r.indexOf(E), v = (H = c.get(E)) == null ? void 0 : H();
433
433
  v && (C(
434
434
  "call effect from setTimeout",
435
- b,
435
+ E,
436
436
  v.hostElement
437
- ), T <= n.hostElement.children.length - 1 ? n.hostElement.insertBefore(
437
+ ), w <= n.hostElement.children.length - 1 ? n.hostElement.insertBefore(
438
438
  v.hostElement,
439
- n.hostElement.children[T]
439
+ n.hostElement.children[w]
440
440
  ) : n.hostElement.append(v.hostElement));
441
441
  }));
442
442
  });
443
443
  };
444
444
  Promise.resolve().then(() => p());
445
445
  }), n;
446
- }, Tt = (t, e, s) => {
447
- const n = j("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map();
446
+ }, wt = (t, e, s) => {
447
+ const n = R("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map();
448
448
  return m(() => {
449
449
  let c = Array.from(n.hostElement.children).map(
450
450
  (a) => a.dataset.key
@@ -482,13 +482,13 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
482
482
  }
483
483
  }), r.forEach((a, d) => o.set(h[d], a));
484
484
  }), n;
485
- }, xt = (t) => {
486
- let e = [j("div")], s = !1;
485
+ }, Tt = (t) => {
486
+ let e = [R("div")], s = !1;
487
487
  return m(() => {
488
488
  var c;
489
489
  const n = t(), o = [];
490
490
  Array.isArray(n) ? (o.push(...n), s = !0) : o.push(n), o.length === 0 && o.push(
491
- j("div").addStyle({ display: "none" })
491
+ R("div").addStyle({ display: "none" })
492
492
  );
493
493
  try {
494
494
  (c = e[0].hostElement) == null || c.replaceWith(
@@ -501,12 +501,12 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
501
501
  console.error(r);
502
502
  }
503
503
  }), s ? e : e[0];
504
- }, wt = (t) => tt in t, $t = (t) => {
504
+ }, xt = (t) => tt in t, kt = (t) => {
505
505
  const e = V("div").addStyle({ display: "contents" }), s = (n) => (e.hostElement.innerHTML = n, e);
506
506
  return typeof t == "string" ? s(t) : e.addEffect(() => {
507
507
  s(t());
508
508
  }), e;
509
- }, U = (t, e, s) => S(t ? e : s || (() => "")), ht = (t, e, s) => S(() => U(!!t(), e, s)), kt = (t, e, s) => typeof t == "boolean" ? U(t, e, s) : ht(t, e, s), q = (t, e) => {
509
+ }, U = (t, e, s) => S(t ? e : s || (() => "")), ht = (t, e, s) => S(() => U(!!t(), e, s)), $t = (t, e, s) => typeof t == "boolean" ? U(t, e, s) : ht(t, e, s), q = (t, e) => {
510
510
  const s = S(e);
511
511
  return typeof t == "boolean" ? s.hostElement.style.display = t ? "contents" : "none" : s.addEffect((n, o) => {
512
512
  o.style.display = t() ? "contents" : "none";
@@ -522,7 +522,7 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
522
522
  }, dt = (t, e) => {
523
523
  C("createCustomElement", t);
524
524
  const s = document.createElement(t), n = {
525
- ...N(s),
525
+ ...D(s),
526
526
  setReactiveValue(o) {
527
527
  return s instanceof O && s.setReactiveValue(o), this;
528
528
  },
@@ -551,7 +551,7 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
551
551
  };
552
552
  }, ft = (t, e, s) => ut(
553
553
  `${t.renderTagName}${e && typeof e == "string" ? " " + e : ""}`,
554
- w(e) ? e : e && typeof e == "string" ? s : void 0
554
+ x(e) ? e : e && typeof e == "string" ? s : void 0
555
555
  ), pt = (t, e, s) => {
556
556
  const n = ft(t, e, s);
557
557
  return Object.assign(n, n());
@@ -560,10 +560,10 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
560
560
  };
561
561
  return t.oldValue = null, t;
562
562
  }, Pt = () => ({}), Wt = (t, e, s) => {
563
- const n = e ? Et(e, s)(t) : t;
563
+ const n = e ? bt(e, s)(t) : t;
564
564
  return (o, ...c) => {
565
565
  const r = [...c];
566
- return o && !w(o) && r.unshift(o), pt(n, w(o) ? o : {})(...r);
566
+ return o && !x(o) && r.unshift(o), pt(n, x(o) ? o : {})(...r);
567
567
  };
568
568
  }, i = {}, mt = [
569
569
  "div",
@@ -630,29 +630,29 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
630
630
  mt.forEach((t) => {
631
631
  i[t] = (e, ...s) => {
632
632
  let n = [...s];
633
- return e && !w(e) && (n = [e].concat(n)), V(t, w(e) ? e : {})(...n);
633
+ return e && !x(e) && (n = [e].concat(n)), V(t, x(e) ? e : {})(...n);
634
634
  };
635
635
  });
636
- const Ct = i.div, Ft = i.span, Ht = i.section, _t = i.input, Bt = i.button, Jt = i.table, qt = i.tr, zt = i.td, Dt = i.th, Nt = i.ul, Gt = i.li, Vt = i.ol, Ut = i.form, Xt = i.label, Zt = i.select, Qt = i.option, Yt = i.textarea, Kt = i.img, te = i.a, ee = i.p, se = i.h1, ne = i.h2, oe = i.h3, re = i.h4, ce = i.h5, ie = i.h6, le = i.br, ae = i.hr, he = i.pre, de = i.code, ue = i.nav, fe = i.header, pe = i.footer, me = i.main, Ce = i.aside, Ee = i.article, be = i.figure, ye = i.figcaption, Se = i.blockquote, ve = i.cite, Ae = i.small, ge = i.strong, Le = i.em, Oe = i.b, je = i.i, Re = i.u, Te = i.s, xe = i.sub, we = i.sup, $e = i.mark, ke = i.del, Ie = i.ins, Me = i.details, Pe = i.summary, We = i.progress, Fe = i.meter, He = i.audio, _e = i.video, Be = i.canvas, Je = i.slot, qe = (t) => (e) => t(e).addClass(...e.classList ?? []).addReactiveClass(e.reactiveClassList ?? {}), k = "eventProps", I = "EVENT_CONFIG", x = "observedAttributes", ze = () => (t, e) => {
637
- Reflect.get(t, x) || Reflect.defineProperty(t, x, {
636
+ const Ct = i.div, Ft = i.span, Ht = i.section, _t = i.input, Bt = i.button, Jt = i.table, qt = i.tr, zt = i.td, Nt = i.th, Dt = i.ul, Gt = i.li, Vt = i.ol, Ut = i.form, Xt = i.label, Zt = i.select, Qt = i.option, Yt = i.textarea, Kt = i.img, te = i.a, ee = i.p, se = i.h1, ne = i.h2, oe = i.h3, re = i.h4, ce = i.h5, ie = i.h6, le = i.br, ae = i.hr, he = i.pre, de = i.code, ue = i.nav, fe = i.header, pe = i.footer, me = i.main, Ce = i.aside, be = i.article, Ee = i.figure, ye = i.figcaption, Se = i.blockquote, ve = i.cite, Ae = i.small, ge = i.strong, Le = i.em, Oe = i.b, Re = i.i, je = i.u, we = i.s, Te = i.sub, xe = i.sup, ke = i.mark, $e = i.del, Ie = i.ins, Me = i.details, Pe = i.summary, We = i.progress, Fe = i.meter, He = i.audio, _e = i.video, Be = i.canvas, Je = i.slot, qe = (t) => (e) => t(e).addClass(...e.classList ?? []).addReactiveClass(e.reactiveClassList ?? {}), $ = "eventProps", I = "EVENT_CONFIG", T = "observedAttributes", ze = () => (t, e) => {
637
+ Reflect.get(t, T) || Reflect.defineProperty(t, T, {
638
638
  value: []
639
- }), Reflect.get(t, x).push(
640
- $(e)
639
+ }), Reflect.get(t, T).push(
640
+ k(e)
641
641
  );
642
- }, De = (t) => (e, s) => {
643
- Reflect.get(e, k) || Reflect.defineProperty(e, k, {
642
+ }, Ne = (t) => (e, s) => {
643
+ Reflect.get(e, $) || Reflect.defineProperty(e, $, {
644
644
  value: []
645
645
  }), Reflect.get(e, I) || Reflect.defineProperty(e, I, {
646
646
  value: {}
647
647
  }), Reflect.get(e, I)[s] = {
648
648
  bubbles: (t == null ? void 0 : t.bubbles) ?? !1,
649
649
  composed: (t == null ? void 0 : t.composed) ?? !1
650
- }, Reflect.get(e, k).push(s);
651
- }, Et = (t, e = !1) => (s) => {
650
+ }, Reflect.get(e, $).push(s);
651
+ }, bt = (t, e = !1) => (s) => {
652
652
  C(
653
653
  t,
654
654
  "start register static attr",
655
- s.prototype[x]
655
+ s.prototype[T]
656
656
  );
657
657
  const n = [];
658
658
  if (s.styles) {
@@ -669,9 +669,10 @@ const Ct = i.div, Ft = i.span, Ht = i.section, _t = i.input, Bt = i.button, Jt =
669
669
  C("constructor", `%c${t}%c`), super(e, ...r), A("@osheet", n), n.length > 0 && this.shadow.adoptedStyleSheets.push(...n);
670
670
  }
671
671
  render() {
672
+ console.debug("rwc: render from new class");
672
673
  let r = Ct();
673
674
  const h = () => {
674
- r = s.prototype.render.call(this);
675
+ console.debug("rwc: wrapperEffectCallback"), r = s.prototype.render.call(this);
675
676
  };
676
677
  return h.fake = !0, m(h), r;
677
678
  }
@@ -701,7 +702,7 @@ const Ct = i.div, Ft = i.span, Ht = i.section, _t = i.input, Bt = i.button, Jt =
701
702
  }
702
703
  connectedCallback() {
703
704
  var h;
704
- C("connectedCallback", `%c${t}%c`, this), this.providers && Object.keys(this.providers).length > 0 && (C("WRAPPER for providers", t), Object.entries(this.providers).forEach(
705
+ console.debug("rwc: connectedCallback"), C("connectedCallback", `%c${t}%c`, this), this.providers && Object.keys(this.providers).length > 0 && (C("WRAPPER for providers", t), Object.entries(this.providers).forEach(
705
706
  ([l, a]) => {
706
707
  C("register provider", l, a()), this.addEventListener(l, (d) => {
707
708
  var p;
@@ -710,7 +711,7 @@ const Ct = i.div, Ft = i.span, Ht = i.section, _t = i.input, Bt = i.button, Jt =
710
711
  ((p = u.detail) == null ? void 0 : p.context) === l && (u.stopPropagation(), u.detail.callback(a));
711
712
  });
712
713
  }
713
- )), this.checkInjects(), (h = s.prototype[k]) == null || h.forEach(
714
+ )), this.checkInjects(), (h = s.prototype[$]) == null || h.forEach(
714
715
  (l) => {
715
716
  this[l] = (a) => {
716
717
  const d = s.prototype[I][l], { bubbles: u, composed: p } = d;
@@ -733,10 +734,9 @@ const Ct = i.div, Ft = i.span, Ht = i.section, _t = i.input, Bt = i.button, Jt =
733
734
  }
734
735
  ), C("start render", `%c${t}%c`, t);
735
736
  const r = () => {
737
+ console.debug("rwc: insertRenderTemplate");
736
738
  const l = this.render();
737
- this.shadow.appendChild(l.hostElement), this.appendSlotContent(), setTimeout(() => {
738
- F(this, s.prototype.connectedCallback);
739
- });
739
+ this.shadow.appendChild(l.hostElement), this.appendSlotContent(), F(this, s.prototype.connectedCallback);
740
740
  };
741
741
  if (this.rootStyle && !s.styles) {
742
742
  const l = (u) => u instanceof Promise || Array.isArray(u) && u.every((p) => p instanceof Promise), a = this.rootStyle, d = (u) => {
@@ -784,9 +784,9 @@ const Ct = i.div, Ft = i.span, Ht = i.section, _t = i.input, Bt = i.button, Jt =
784
784
  this.shadow.replaceChildren(), this.replaceChildren(), F(this, s.prototype.disconnectedCallback);
785
785
  }
786
786
  }
787
- return E(o, "observedAttributes", s.prototype[x] ?? []), E(o, "renderTagName", t), o.toString = () => t, customElements.get(t) ? console.error(
787
+ return b(o, "observedAttributes", s.prototype[T] ?? []), b(o, "renderTagName", t), o.toString = () => t, customElements.get(t) ? console.error(
788
788
  `название тега ${t} повторяется, компонент ${s.name} не зарегистрирован`
789
- ) : customElements.define(t, o), o;
789
+ ) : customElements.define(t, o), s.renderTagName = t, s;
790
790
  };
791
791
  export {
792
792
  O as BaseElement,
@@ -798,7 +798,7 @@ export {
798
798
  ct as addReactiveClassList,
799
799
  it as addStyleList,
800
800
  W as appendContentItem,
801
- Ee as article,
801
+ be as article,
802
802
  Ce as aside,
803
803
  He as audio,
804
804
  Oe as b,
@@ -806,41 +806,41 @@ export {
806
806
  Se as blockquote,
807
807
  le as br,
808
808
  Bt as button,
809
- $ as camelToKebab,
809
+ k as camelToKebab,
810
810
  Be as canvas,
811
811
  F as checkCall,
812
812
  ve as cite,
813
813
  et as classList,
814
- jt as cls,
814
+ Rt as cls,
815
815
  de as code,
816
816
  A as colorLog,
817
- Et as component,
817
+ bt as component,
818
818
  qe as createComponent,
819
819
  ft as createCustom,
820
820
  ut as createCustomEl,
821
821
  dt as createCustomElement,
822
822
  at as createEl,
823
- j as createElement,
823
+ R as createElement,
824
824
  vt as createSignal,
825
825
  pt as customEl,
826
826
  Pt as defineSlotTemplate,
827
- ke as del,
827
+ $e as del,
828
828
  Me as details,
829
829
  K as disableLogs,
830
830
  Ct as div,
831
831
  m as effect,
832
832
  V as el,
833
- N as elementHelpers,
833
+ D as elementHelpers,
834
834
  Le as em,
835
835
  yt as enableLogs,
836
- De as event,
836
+ Ne as event,
837
837
  Ot as eventEmitter,
838
838
  ye as figcaption,
839
- be as figure,
839
+ Ee as figure,
840
840
  pe as footer,
841
841
  gt as forkJoin,
842
842
  Ut as form,
843
- Rt as getList,
843
+ jt as getList,
844
844
  S as getSignalContent,
845
845
  se as h1,
846
846
  ne as h2,
@@ -851,26 +851,26 @@ export {
851
851
  fe as header,
852
852
  ae as hr,
853
853
  B as htmlEffectWrapper,
854
- je as i,
854
+ Re as i,
855
855
  Kt as img,
856
856
  G as initComponent,
857
857
  _t as input,
858
858
  Ie as ins,
859
859
  Lt as isBaseElement,
860
860
  Q as isComponentConfig,
861
- w as isComponentInitConfig,
861
+ x as isComponentInitConfig,
862
862
  y as isReactiveSignal,
863
- wt as isSlotTemplate,
863
+ xt as isSlotTemplate,
864
864
  Y as kebabToCamel,
865
865
  Xt as label,
866
866
  Gt as li,
867
867
  me as main,
868
- $e as mark,
868
+ ke as mark,
869
869
  Fe as meter,
870
870
  ue as nav,
871
871
  Mt as newEventEmitter,
872
872
  Vt as ol,
873
- Tt as oldGetList,
873
+ wt as oldGetList,
874
874
  Qt as option,
875
875
  ee as p,
876
876
  he as pre,
@@ -880,33 +880,33 @@ export {
880
880
  U as renderIf,
881
881
  St as rs,
882
882
  ht as rxRenderIf,
883
- Te as s,
883
+ we as s,
884
884
  Ht as section,
885
885
  Zt as select,
886
886
  nt as setChildren,
887
887
  st as setEffects,
888
- D as setHtmlContent,
888
+ N as setHtmlContent,
889
889
  J as setListeners,
890
890
  It as show,
891
891
  q as showIf,
892
- R as signal,
893
- xt as signalComponent,
892
+ j as signal,
893
+ Tt as signalComponent,
894
894
  Je as slot,
895
895
  Ae as small,
896
896
  Ft as span,
897
897
  ge as strong,
898
- xe as sub,
898
+ Te as sub,
899
899
  Pe as summary,
900
- we as sup,
900
+ xe as sup,
901
901
  Jt as table,
902
902
  zt as td,
903
903
  Yt as textarea,
904
- Dt as th,
904
+ Nt as th,
905
905
  qt as tr,
906
- Re as u,
907
- Nt as ul,
908
- $t as unsafeHtml,
906
+ je as u,
907
+ Dt as ul,
908
+ kt as unsafeHtml,
909
909
  Wt as useCustomComponent,
910
910
  _e as video,
911
- kt as when
911
+ $t as when
912
912
  };