@reactive-web-components/rwc 2.51.5

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.
Files changed (37) hide show
  1. package/main.d.ts +0 -0
  2. package/package.json +15 -0
  3. package/reactive-web-component.B5z__-wD.umd.cjs +2 -0
  4. package/reactive-web-component.siUNa4Q7.js +912 -0
  5. package/shared/constants/constants.d.ts +2 -0
  6. package/shared/index.d.ts +2 -0
  7. package/shared/types/base-element.d.ts +1 -0
  8. package/shared/types/element.d.ts +191 -0
  9. package/shared/types/index.d.ts +3 -0
  10. package/shared/types/list.type.d.ts +7 -0
  11. package/shared/utils/helpers.d.ts +7 -0
  12. package/shared/utils/html-decorators/html-property.d.ts +6 -0
  13. package/shared/utils/html-decorators/index.d.ts +1 -0
  14. package/shared/utils/html-elements/__tests__/element.test.d.ts +1 -0
  15. package/shared/utils/html-elements/base-element.d.ts +33 -0
  16. package/shared/utils/html-elements/custom-element.d.ts +11 -0
  17. package/shared/utils/html-elements/element-helper.d.ts +21 -0
  18. package/shared/utils/html-elements/element.d.ts +84 -0
  19. package/shared/utils/html-elements/index.d.ts +4 -0
  20. package/shared/utils/html-fabric/custom-fabric.d.ts +3 -0
  21. package/shared/utils/html-fabric/fabric.d.ts +67 -0
  22. package/shared/utils/html-fabric/fn-component.d.ts +5 -0
  23. package/shared/utils/html-fabric/index.d.ts +3 -0
  24. package/shared/utils/index.d.ts +5 -0
  25. package/shared/utils/routing/router.d.ts +10 -0
  26. package/shared/utils/signal/helpers.types.d.ts +3 -0
  27. package/shared/utils/signal/index.d.ts +3 -0
  28. package/shared/utils/signal/signal.d.ts +18 -0
  29. package/shared/utils/signal/signal.type.d.ts +18 -0
  30. package/shared/utils/signal/utils.d.ts +10 -0
  31. package/test-components/examples/button/button.d.ts +12 -0
  32. package/test-components/examples/counter.d.ts +15 -0
  33. package/test-components/examples/test-list/dynamic-items-test.d.ts +17 -0
  34. package/test-components/examples/test-list/example.list.d.ts +26 -0
  35. package/test-components/examples/useCustomComponent.d.ts +21 -0
  36. package/test-components/examples/when.d.ts +6 -0
  37. package/test-components/tab-bar.d.ts +23 -0
package/main.d.ts ADDED
File without changes
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@reactive-web-components/rwc",
3
+ "version": "2.51.5",
4
+ "type": "module",
5
+ "types": "./shared/index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./shared/index.d.ts",
9
+ "import": "./reactive-web-component.siUNa4Q7.js",
10
+ "require": "./reactive-web-component.B5z__-wD.umd.cjs"
11
+ }
12
+ },
13
+ "module": "./reactive-web-component.siUNa4Q7.js",
14
+ "main": "./reactive-web-component.B5z__-wD.umd.cjs"
15
+ }
@@ -0,0 +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=()=>{for(;this.shadow.firstChild;)this.shadow.removeChild(this.shadow.firstChild);const a=this.render();this.shadow.appendChild(a.hostElement),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.appendSlotContent(),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(){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"})});