aptechka 0.83.1 → 0.84.1

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 (286) hide show
  1. package/lib/Animation-BUD5w3AB.js +110 -0
  2. package/lib/Animation-BtUdarQ7.cjs +1 -0
  3. package/lib/Composed-BI5oe4Ij.cjs +1 -0
  4. package/lib/Composed-BaevH-MP.js +75 -0
  5. package/lib/Damped-BHm2IuyN.cjs +1 -0
  6. package/lib/Damped-Ds17AUU-.js +57 -0
  7. package/lib/DerivedArray-BePrxcLC.js +63 -0
  8. package/lib/DerivedArray-xYBpcTp8.cjs +1 -0
  9. package/lib/DragControls-BgTBgiue.js +233 -0
  10. package/lib/DragControls-FmiuZDKq.cjs +1 -0
  11. package/lib/LocalLinks-BdqYzt1b.js +65 -0
  12. package/lib/LocalLinks-D1mYcA-B.cjs +1 -0
  13. package/lib/PageAnnouncerElement-CJ-MfwJ8.cjs +1 -0
  14. package/lib/PageAnnouncerElement-HcphPbXZ.js +28 -0
  15. package/lib/PageScroll-CrfCwDA4.js +65 -0
  16. package/lib/PageScroll-IlOCUUte.cjs +1 -0
  17. package/lib/SourceElement-DC726HMy.js +265 -0
  18. package/lib/SourceElement-DNyrQby1.cjs +5 -0
  19. package/lib/Store-BRTHeZmO.js +158 -0
  20. package/lib/Store-DZnOrofs.cjs +1 -0
  21. package/lib/Tweened-3UYSwrvs.cjs +1 -0
  22. package/lib/Tweened-DabaFaHX.js +48 -0
  23. package/lib/Viewport-0n1C_IoN.js +113 -0
  24. package/lib/Viewport-D26fEJOk.cjs +1 -0
  25. package/lib/accordion/index.cjs +1 -1
  26. package/lib/accordion/index.js +97 -93
  27. package/lib/animation/index.cjs +1 -1
  28. package/lib/animation/index.js +6 -6
  29. package/lib/api-fetcher/index.cjs +1 -1
  30. package/lib/api-fetcher/index.js +67 -66
  31. package/lib/attribute/index.cjs +1 -1
  32. package/lib/attribute/index.js +37 -34
  33. package/lib/attributes-BADnRZpK.cjs +1 -0
  34. package/lib/attributes-FObgMNCf.js +36 -0
  35. package/lib/billboard/index.cjs +1 -1
  36. package/lib/billboard/index.js +240 -232
  37. package/lib/cache/index.cjs +1 -1
  38. package/lib/cache/index.js +26 -23
  39. package/lib/canvas/index.cjs +1 -1
  40. package/lib/canvas/index.js +61 -59
  41. package/lib/canvas-BP1ceie3.cjs +1 -0
  42. package/lib/canvas-DsglKco1.js +40 -0
  43. package/lib/connector/index.cjs +1 -1
  44. package/lib/connector/index.js +44 -41
  45. package/lib/controls/index.cjs +1 -1
  46. package/lib/controls/index.js +6 -6
  47. package/lib/coordinates--JG1U6kQ.js +29 -0
  48. package/lib/coordinates-DQ9XV9M1.cjs +1 -0
  49. package/lib/css-property/index.cjs +1 -1
  50. package/lib/css-property/index.d.ts +1 -1
  51. package/lib/css-property/index.js +40 -37
  52. package/lib/css-unit-parser/index.cjs +2 -2
  53. package/lib/css-unit-parser/index.js +22 -19
  54. package/lib/css-value-parser/index.cjs +1 -1
  55. package/lib/css-value-parser/index.js +13 -11
  56. package/lib/custom-elements-BfZCJde6.cjs +1 -0
  57. package/lib/custom-elements-HEMuF7yH.js +27 -0
  58. package/lib/dev/index.cjs +2 -1
  59. package/lib/dev/index.d.ts +1 -0
  60. package/lib/dev/index.js +24 -10
  61. package/lib/device/index.cjs +1 -1
  62. package/lib/device/index.js +5 -5
  63. package/lib/dom-B40i6NXw.cjs +1 -0
  64. package/lib/dom-D8D-_9ty.js +108 -0
  65. package/lib/easings-BSGJFMAo.js +40 -0
  66. package/lib/easings-BWq0pPLq.cjs +1 -0
  67. package/lib/element-CqD0jqBJ.cjs +1 -0
  68. package/lib/element-DKw5H-Tu.js +10 -0
  69. package/lib/element-linked-store/index.cjs +1 -1
  70. package/lib/element-linked-store/index.js +53 -52
  71. package/lib/element-resizer/index.cjs +1 -1
  72. package/lib/element-resizer/index.js +47 -44
  73. package/lib/en3/index.cjs +4 -4
  74. package/lib/en3/index.js +191 -185
  75. package/lib/events-Ds-TuvYW.js +9 -0
  76. package/lib/events-UlGk63iC.cjs +1 -0
  77. package/lib/file-DwQs6bB6.js +28 -0
  78. package/lib/file-RHfA3OS-.cjs +1 -0
  79. package/lib/function-H4b_gTg6.cjs +1 -0
  80. package/lib/function-UmbPrOHm.js +19 -0
  81. package/lib/gestures-DmKKNnh4.js +14 -0
  82. package/lib/gestures-DtYbQr49.cjs +1 -0
  83. package/lib/history/index.cjs +1 -1
  84. package/lib/history/index.js +24 -21
  85. package/lib/iframe/index.cjs +1 -1
  86. package/lib/iframe/index.js +27 -24
  87. package/lib/image/index.cjs +1 -1
  88. package/lib/image/index.js +17 -13
  89. package/lib/index-ClTMVKJp.js +183 -0
  90. package/lib/index-DZ44osDT.cjs +1 -0
  91. package/lib/intersector/index.cjs +1 -1
  92. package/lib/intersector/index.js +3 -3
  93. package/lib/jsx/ComponentElement.d.ts +4 -0
  94. package/lib/jsx/h.d.ts +7 -16
  95. package/lib/jsx/hooks/component/useStylesheet.d.ts +1 -1
  96. package/lib/jsx/hooks/cssProperty.d.ts +6 -0
  97. package/lib/jsx/hooks/resize.d.ts +4 -0
  98. package/lib/jsx/hooks/store.d.ts +1 -2
  99. package/lib/jsx/hooks/ticker.d.ts +5 -0
  100. package/lib/jsx/index.cjs +1 -1
  101. package/lib/jsx/index.d.ts +4 -4
  102. package/lib/jsx/index.js +170 -349
  103. package/lib/jsx/plugins/vite/index.cjs +49 -0
  104. package/lib/jsx/plugins/vite/index.d.ts +38 -0
  105. package/lib/jsx/plugins/vite/index.js +104 -0
  106. package/lib/jsx/render.d.ts +2 -0
  107. package/lib/jsx/type.d.ts +228 -190
  108. package/lib/ladder/index.cjs +1 -1
  109. package/lib/ladder/index.js +86 -84
  110. package/lib/layout-C26zkY7D.js +35 -0
  111. package/lib/layout-CnGLl7oe.cjs +1 -0
  112. package/lib/layout-box/index.cjs +1 -1
  113. package/lib/layout-box/index.js +220 -217
  114. package/lib/loading/index.cjs +1 -1
  115. package/lib/loading/index.js +48 -45
  116. package/lib/local-links/index.cjs +1 -1
  117. package/lib/local-links/index.js +2 -2
  118. package/lib/masonry-layout/index.cjs +1 -1
  119. package/lib/masonry-layout/index.js +48 -45
  120. package/lib/math-C-knY2TL.cjs +1 -0
  121. package/lib/math-r8V23YFe.js +57 -0
  122. package/lib/media/index.cjs +1 -1
  123. package/lib/media/index.js +28 -25
  124. package/lib/metadata-BNdkmeeD.js +15 -0
  125. package/lib/metadata-BrHUfpV9.cjs +1 -0
  126. package/lib/morph/index.cjs +1 -1
  127. package/lib/morph/index.js +561 -556
  128. package/lib/morph-BtgB1YQP.js +256 -0
  129. package/lib/morph-Buhxq-X0.cjs +1 -0
  130. package/lib/need_redo_tweaker/index.cjs +4 -4
  131. package/lib/need_redo_tweaker/index.js +862 -835
  132. package/lib/notifier/index.cjs +1 -1
  133. package/lib/notifier/index.js +29 -26
  134. package/lib/number-Bu4sGvW7.cjs +1 -0
  135. package/lib/number-DiVt2xnh.js +47 -0
  136. package/lib/object-CiIdEmJx.js +98 -0
  137. package/lib/object-DTY_W6xG.cjs +1 -0
  138. package/lib/order/index.cjs +1 -1
  139. package/lib/order/index.js +3 -3
  140. package/lib/page-announcer/index.cjs +1 -1
  141. package/lib/page-announcer/index.js +2 -2
  142. package/lib/page-scroll/index.cjs +1 -1
  143. package/lib/page-scroll/index.js +2 -2
  144. package/lib/pixel-perfect/index.cjs +4 -4
  145. package/lib/pixel-perfect/index.js +43 -40
  146. package/lib/pointer/index.cjs +1 -1
  147. package/lib/pointer/index.js +125 -123
  148. package/lib/polyfills-CG1XJNia.js +28 -0
  149. package/lib/polyfills-DZCuDBkA.cjs +1 -0
  150. package/lib/popover/index.cjs +1 -1
  151. package/lib/popover/index.js +249 -245
  152. package/lib/radio/index.cjs +1 -1
  153. package/lib/radio/index.js +58 -55
  154. package/lib/render-H9BjFLZ3.cjs +1 -0
  155. package/lib/render-LpimRXgl.js +354 -0
  156. package/lib/router/index.cjs +1 -1
  157. package/lib/router/index.js +196 -194
  158. package/lib/scroll/index.cjs +1 -1
  159. package/lib/scroll/index.js +890 -878
  160. package/lib/scroll-D2tOpCnP.cjs +1 -0
  161. package/lib/scroll-DoNeuIgT.js +41 -0
  162. package/lib/scroll-entries/index.cjs +1 -1
  163. package/lib/scroll-entries/index.js +37 -34
  164. package/lib/scroll-kit/index.cjs +1 -1
  165. package/lib/scroll-kit/index.js +213 -209
  166. package/lib/sequence/index.cjs +1 -1
  167. package/lib/sequence/index.js +102 -98
  168. package/lib/size-element/index.cjs +1 -1
  169. package/lib/size-element/index.js +29 -26
  170. package/lib/slicer/index.cjs +1 -1
  171. package/lib/slicer/index.js +118 -113
  172. package/lib/source/index.cjs +1 -1
  173. package/lib/source/index.js +5 -5
  174. package/lib/spa/index.cjs +1 -1
  175. package/lib/spa/index.js +94 -94
  176. package/lib/store/index.cjs +1 -1
  177. package/lib/store/index.d.ts +2 -2
  178. package/lib/store/index.js +10 -8
  179. package/lib/string-B3lm2b7v.js +84 -0
  180. package/lib/string-CbRNzmd9.cjs +1 -0
  181. package/lib/style-DBoQWK0d.js +14 -0
  182. package/lib/style-IDJ6db6n.cjs +1 -0
  183. package/lib/stylesheet-CBTuup4f.js +28 -0
  184. package/lib/stylesheet-xM7sMeuo.cjs +1 -0
  185. package/lib/ticker/index.cjs +1 -1
  186. package/lib/ticker/index.js +4 -120
  187. package/lib/url-CPCO10Sy.cjs +1 -0
  188. package/lib/url-CWCY_qe_.js +124 -0
  189. package/lib/utils/attributes.d.ts +2 -0
  190. package/lib/utils/dom.d.ts +1 -0
  191. package/lib/utils/index.cjs +1 -1
  192. package/lib/utils/index.js +260 -226
  193. package/lib/utils/polyfills.d.ts +1 -1
  194. package/lib/utils/timeouts.d.ts +6 -1
  195. package/lib/video/index.cjs +1 -1
  196. package/lib/video/index.js +35 -33
  197. package/lib/window-resizer/index.cjs +1 -1
  198. package/lib/window-resizer/index.js +27 -24
  199. package/lib/youtube/index.cjs +1 -1
  200. package/lib/youtube/index.js +56 -54
  201. package/package.json +11 -24
  202. package/lib/Animation-BzTjZIE-.js +0 -108
  203. package/lib/Animation-C39Ah-LM.cjs +0 -1
  204. package/lib/Composed-C-TV9te3.cjs +0 -1
  205. package/lib/Composed-DyAWjEXE.js +0 -121
  206. package/lib/Damped-CRusiRIV.js +0 -56
  207. package/lib/Damped-Prr0iKu1.cjs +0 -1
  208. package/lib/DragControls-8rNZwQrs.cjs +0 -1
  209. package/lib/DragControls-DBNdMBA4.js +0 -228
  210. package/lib/LocalLinks-BxhSFv_Q.cjs +0 -1
  211. package/lib/LocalLinks-DFZFpbjs.js +0 -62
  212. package/lib/PageAnnouncerElement-0LxZjtVH.js +0 -24
  213. package/lib/PageAnnouncerElement-AQ0Ja6HM.cjs +0 -1
  214. package/lib/PageScroll-0LxFblry.js +0 -62
  215. package/lib/PageScroll-BXJUQwG7.cjs +0 -1
  216. package/lib/SourceElement-BHqPFbna.cjs +0 -5
  217. package/lib/SourceElement-DjbHjynf.js +0 -260
  218. package/lib/Store-Blf4msDz.cjs +0 -1
  219. package/lib/Store-ZThXYBQd.js +0 -152
  220. package/lib/Tweened-Bw1Cn1PJ.js +0 -47
  221. package/lib/Tweened-DWtk9E-O.cjs +0 -1
  222. package/lib/Viewport-BxCr0GlB.cjs +0 -1
  223. package/lib/Viewport-Dt-d9DPi.js +0 -109
  224. package/lib/attributes-69we3byR.js +0 -10
  225. package/lib/attributes-Bf2svn4j.cjs +0 -1
  226. package/lib/canvas-CU5Xjahf.cjs +0 -1
  227. package/lib/canvas-DeZ0SLUJ.js +0 -34
  228. package/lib/coordinates-CgdGoSYs.js +0 -24
  229. package/lib/coordinates-D8Np3cPD.cjs +0 -1
  230. package/lib/custom-elements-DBnCK7Zx.js +0 -24
  231. package/lib/custom-elements-Dh4TWRDJ.cjs +0 -1
  232. package/lib/dom-BETkVSSZ.js +0 -82
  233. package/lib/dom-CBLlqORw.cjs +0 -1
  234. package/lib/easings-BEmRlrDd.js +0 -38
  235. package/lib/easings-GegIwET5.cjs +0 -1
  236. package/lib/element-CGVl1jA-.js +0 -7
  237. package/lib/element-yhcBhsho.cjs +0 -1
  238. package/lib/events-CsVF98U6.js +0 -6
  239. package/lib/events-KVanG9sR.cjs +0 -1
  240. package/lib/file-DSpfWdd9.cjs +0 -1
  241. package/lib/file-GHShUlue.js +0 -24
  242. package/lib/function-C10DGppn.js +0 -17
  243. package/lib/function-MthRj-GJ.cjs +0 -1
  244. package/lib/gestures-C7gbKx11.cjs +0 -1
  245. package/lib/gestures-CcXV6fCp.js +0 -11
  246. package/lib/index-OE2INULi.cjs +0 -1
  247. package/lib/index-e9eDuagL.js +0 -65
  248. package/lib/jsx/hydrate.d.ts +0 -1
  249. package/lib/jsx/integrations/astro/client.cjs +0 -1
  250. package/lib/jsx/integrations/astro/client.d.ts +0 -2
  251. package/lib/jsx/integrations/astro/client.js +0 -50
  252. package/lib/jsx/integrations/astro/index.cjs +0 -1
  253. package/lib/jsx/integrations/astro/index.d.ts +0 -2
  254. package/lib/jsx/integrations/astro/index.js +0 -54
  255. package/lib/jsx/integrations/astro/server.cjs +0 -1
  256. package/lib/jsx/integrations/astro/server.d.ts +0 -3
  257. package/lib/jsx/integrations/astro/server.js +0 -35
  258. package/lib/jsx/plugins/vite.d.ts +0 -21
  259. package/lib/layout-BSMtwCga.js +0 -29
  260. package/lib/layout-Ctc2p3uz.cjs +0 -1
  261. package/lib/math-BOBiC4TN.js +0 -45
  262. package/lib/math-GDWEqu7y.cjs +0 -1
  263. package/lib/metadata-BcYZ5w3T.cjs +0 -1
  264. package/lib/metadata-jfowcCyz.js +0 -12
  265. package/lib/morph-B6sGhLCi.cjs +0 -1
  266. package/lib/morph-BQErz7qP.js +0 -242
  267. package/lib/number-ChAm68cm.cjs +0 -1
  268. package/lib/number-CumqY64S.js +0 -40
  269. package/lib/object-CcMK4y_r.js +0 -87
  270. package/lib/object-baN9pgbU.cjs +0 -1
  271. package/lib/polyfills-DJrTJQky.js +0 -24
  272. package/lib/polyfills-Df4r-ETT.cjs +0 -1
  273. package/lib/render-DQs7rIoN.cjs +0 -1
  274. package/lib/render-D_0FCWEu.js +0 -18
  275. package/lib/scroll-BA2WnUrb.cjs +0 -1
  276. package/lib/scroll-DY5senkF.js +0 -37
  277. package/lib/string-BlMQbe8b.js +0 -70
  278. package/lib/string-DUXXtU8v.cjs +0 -1
  279. package/lib/style-At6aDoqG.cjs +0 -1
  280. package/lib/style-j2TwriJ_.js +0 -10
  281. package/lib/stylesheet-5_o7PFzM.cjs +0 -1
  282. package/lib/stylesheet-DdBzowZY.js +0 -24
  283. package/lib/url-CHgcNwJ1.cjs +0 -1
  284. package/lib/url-CYgo5vrG.js +0 -113
  285. package/lib/vite-C-i3hVDL.js +0 -75
  286. package/lib/vite-DzanPumM.cjs +0 -44
@@ -1 +1 @@
1
- "use strict";var f=i=>{throw TypeError(i)};var v=(i,a,t)=>a.has(i)||f("Cannot "+t);var e=(i,a,t)=>(v(i,a,"read from private field"),t?t.call(i):a.get(i)),r=(i,a,t)=>a.has(i)?f("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(i):a.set(i,t),d=(i,a,t,s)=>(v(i,a,"write to private field"),s?s.call(i,t):a.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../events-KVanG9sR.cjs");require("construct-style-sheets-polyfill");require("../index-OE2INULi.cjs");var E,n,h,o,c,m,u,b;class g extends HTMLElement{constructor(){super(...arguments);r(this,E,[]);r(this,n,[]);r(this,h);r(this,o,null);r(this,c,!1);r(this,m,()=>{this.isConnected&&(document.documentElement.addEventListener("radioChange",e(this,b)),e(this,n).forEach(t=>{t.addEventListener("click",e(this,u)),t.hasAttribute("data-checked")&&this.setValue(t.getAttribute("data-value"))}))});r(this,u,t=>{if(!e(this,c)){const l=t.currentTarget.getAttribute("data-value");l&&this.setValue(l)}});r(this,b,t=>{const s=t.target;s!==this&&s.name===this.name&&this.setValue(t.detail)})}get value(){return e(this,h)}get name(){return this.getAttribute("name")}get currentButtonElement(){return e(this,o)}get disabled(){return e(this,c)}disable(){d(this,c,!0)}enable(){d(this,c,!1)}addButton(t){e(this,n).push(t),t.addEventListener("click",e(this,u))}removeButton(t){const s=e(this,n).find(l=>l===t);s&&(s.removeEventListener("click",e(this,u)),d(this,n,e(this,n).filter(l=>l!==t)))}setValue(t){t&&t!==e(this,h)&&(d(this,h,t),e(this,n).forEach(s=>{s.getAttribute("data-value")===e(this,h)?(s.setAttribute("data-checked",""),d(this,o,s)):s.removeAttribute("data-checked")}),e(this,o)&&e(this,E).forEach(s=>{s.innerHTML=e(this,o).getAttribute("data-name")||t}),L.dispatchEvent(this,"radioChange",{detail:e(this,h),bubbles:!0}))}connectedCallback(){d(this,E,[...this.querySelectorAll("[data-radio-listener]")]),d(this,n,[...this.querySelectorAll("[data-radio-button]")]),document.readyState==="complete"?e(this,m).call(this):addEventListener("load",e(this,m))}disconnectedCallback(){e(this,n).forEach(t=>{t.removeEventListener("click",e(this,u))}),removeEventListener("load",e(this,m)),document.documentElement.removeEventListener("radioChange",e(this,b))}}E=new WeakMap,n=new WeakMap,h=new WeakMap,o=new WeakMap,c=new WeakMap,m=new WeakMap,u=new WeakMap,b=new WeakMap;customElements.get("e-radio")||customElements.define("e-radio",g);exports.RadioElement=g;
1
+ "use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const events=require("../events-UlGk63iC.cjs");require("construct-style-sheets-polyfill");require("../index-DZ44osDT.cjs");var _listenerElements,_buttonElements,_value,_currentButtonElement,_disabled,_loadListener,_buttonClickListener,_documentRadioChangeListener;const _RadioElement=class _RadioElement extends HTMLElement{constructor(){super(...arguments);__privateAdd(this,_listenerElements,[]);__privateAdd(this,_buttonElements,[]);__privateAdd(this,_value);__privateAdd(this,_currentButtonElement,null);__privateAdd(this,_disabled,!1);__privateAdd(this,_loadListener,__name(()=>{this.isConnected&&(document.documentElement.addEventListener("radioChange",__privateGet(this,_documentRadioChangeListener)),__privateGet(this,_buttonElements).forEach(element=>{element.addEventListener("click",__privateGet(this,_buttonClickListener)),element.hasAttribute("data-checked")&&this.setValue(element.getAttribute("data-value"))}))},"#loadListener"));__privateAdd(this,_buttonClickListener,__name(e=>{if(!__privateGet(this,_disabled)){const value=e.currentTarget.getAttribute("data-value");value&&this.setValue(value)}},"#buttonClickListener"));__privateAdd(this,_documentRadioChangeListener,__name(event=>{const ct=event.target;ct!==this&&ct.name===this.name&&this.setValue(event.detail)},"#documentRadioChangeListener"))}get value(){return __privateGet(this,_value)}get name(){return this.getAttribute("name")}get currentButtonElement(){return __privateGet(this,_currentButtonElement)}get disabled(){return __privateGet(this,_disabled)}disable(){__privateSet(this,_disabled,!0)}enable(){__privateSet(this,_disabled,!1)}addButton(element){__privateGet(this,_buttonElements).push(element),element.addEventListener("click",__privateGet(this,_buttonClickListener))}removeButton(element){const founded=__privateGet(this,_buttonElements).find(el=>el===element);founded&&(founded.removeEventListener("click",__privateGet(this,_buttonClickListener)),__privateSet(this,_buttonElements,__privateGet(this,_buttonElements).filter(el=>el!==element)))}setValue(value){value&&value!==__privateGet(this,_value)&&(__privateSet(this,_value,value),__privateGet(this,_buttonElements).forEach(element=>{element.getAttribute("data-value")===__privateGet(this,_value)?(element.setAttribute("data-checked",""),__privateSet(this,_currentButtonElement,element)):element.removeAttribute("data-checked")}),__privateGet(this,_currentButtonElement)&&__privateGet(this,_listenerElements).forEach(element=>{element.innerHTML=__privateGet(this,_currentButtonElement).getAttribute("data-name")||value}),events.dispatchEvent(this,"radioChange",{detail:__privateGet(this,_value),bubbles:!0}))}connectedCallback(){__privateSet(this,_listenerElements,[...this.querySelectorAll("[data-radio-listener]")]),__privateSet(this,_buttonElements,[...this.querySelectorAll("[data-radio-button]")]),document.readyState==="complete"?__privateGet(this,_loadListener).call(this):addEventListener("load",__privateGet(this,_loadListener))}disconnectedCallback(){__privateGet(this,_buttonElements).forEach(element=>{element.removeEventListener("click",__privateGet(this,_buttonClickListener))}),removeEventListener("load",__privateGet(this,_loadListener)),document.documentElement.removeEventListener("radioChange",__privateGet(this,_documentRadioChangeListener))}};_listenerElements=new WeakMap,_buttonElements=new WeakMap,_value=new WeakMap,_currentButtonElement=new WeakMap,_disabled=new WeakMap,_loadListener=new WeakMap,_buttonClickListener=new WeakMap,_documentRadioChangeListener=new WeakMap,__name(_RadioElement,"RadioElement");let RadioElement=_RadioElement;customElements.get("e-radio")||customElements.define("e-radio",RadioElement);exports.RadioElement=RadioElement;
@@ -1,92 +1,95 @@
1
- var b = (i) => {
2
- throw TypeError(i);
1
+ var __defProp = Object.defineProperty;
2
+ var __typeError = (msg) => {
3
+ throw TypeError(msg);
3
4
  };
4
- var v = (i, a, t) => a.has(i) || b("Cannot " + t);
5
- var e = (i, a, t) => (v(i, a, "read from private field"), t ? t.call(i) : a.get(i)), r = (i, a, t) => a.has(i) ? b("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(i) : a.set(i, t), d = (i, a, t, s) => (v(i, a, "write to private field"), s ? s.call(i, t) : a.set(i, t), t);
6
- import { d as g } from "../events-CsVF98U6.js";
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
6
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
7
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
8
+ import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
7
9
  import "construct-style-sheets-polyfill";
8
- import "../index-e9eDuagL.js";
9
- var E, n, h, o, c, m, l, f;
10
- class L extends HTMLElement {
10
+ import "../index-ClTMVKJp.js";
11
+ var _listenerElements, _buttonElements, _value, _currentButtonElement, _disabled, _loadListener, _buttonClickListener, _documentRadioChangeListener;
12
+ const _RadioElement = class _RadioElement extends HTMLElement {
11
13
  constructor() {
12
14
  super(...arguments);
13
- r(this, E, []);
14
- r(this, n, []);
15
- r(this, h);
16
- r(this, o, null);
17
- r(this, c, !1);
18
- r(this, m, () => {
15
+ __privateAdd(this, _listenerElements, []);
16
+ __privateAdd(this, _buttonElements, []);
17
+ __privateAdd(this, _value);
18
+ __privateAdd(this, _currentButtonElement, null);
19
+ __privateAdd(this, _disabled, !1);
20
+ __privateAdd(this, _loadListener, /* @__PURE__ */ __name(() => {
19
21
  this.isConnected && (document.documentElement.addEventListener(
20
22
  "radioChange",
21
- e(this, f)
22
- ), e(this, n).forEach((t) => {
23
- t.addEventListener("click", e(this, l)), t.hasAttribute("data-checked") && this.setValue(t.getAttribute("data-value"));
23
+ __privateGet(this, _documentRadioChangeListener)
24
+ ), __privateGet(this, _buttonElements).forEach((element) => {
25
+ element.addEventListener("click", __privateGet(this, _buttonClickListener)), element.hasAttribute("data-checked") && this.setValue(element.getAttribute("data-value"));
24
26
  }));
25
- });
26
- r(this, l, (t) => {
27
- if (!e(this, c)) {
28
- const u = t.currentTarget.getAttribute("data-value");
29
- u && this.setValue(u);
27
+ }, "#loadListener"));
28
+ __privateAdd(this, _buttonClickListener, /* @__PURE__ */ __name((e) => {
29
+ if (!__privateGet(this, _disabled)) {
30
+ const value = e.currentTarget.getAttribute("data-value");
31
+ value && this.setValue(value);
30
32
  }
31
- });
32
- r(this, f, (t) => {
33
- const s = t.target;
34
- s !== this && s.name === this.name && this.setValue(t.detail);
35
- });
33
+ }, "#buttonClickListener"));
34
+ __privateAdd(this, _documentRadioChangeListener, /* @__PURE__ */ __name((event) => {
35
+ const ct = event.target;
36
+ ct !== this && ct.name === this.name && this.setValue(event.detail);
37
+ }, "#documentRadioChangeListener"));
36
38
  }
37
39
  get value() {
38
- return e(this, h);
40
+ return __privateGet(this, _value);
39
41
  }
40
42
  get name() {
41
43
  return this.getAttribute("name");
42
44
  }
43
45
  get currentButtonElement() {
44
- return e(this, o);
46
+ return __privateGet(this, _currentButtonElement);
45
47
  }
46
48
  get disabled() {
47
- return e(this, c);
49
+ return __privateGet(this, _disabled);
48
50
  }
49
51
  disable() {
50
- d(this, c, !0);
52
+ __privateSet(this, _disabled, !0);
51
53
  }
52
54
  enable() {
53
- d(this, c, !1);
55
+ __privateSet(this, _disabled, !1);
54
56
  }
55
- addButton(t) {
56
- e(this, n).push(t), t.addEventListener("click", e(this, l));
57
+ addButton(element) {
58
+ __privateGet(this, _buttonElements).push(element), element.addEventListener("click", __privateGet(this, _buttonClickListener));
57
59
  }
58
- removeButton(t) {
59
- const s = e(this, n).find((u) => u === t);
60
- s && (s.removeEventListener("click", e(this, l)), d(this, n, e(this, n).filter((u) => u !== t)));
60
+ removeButton(element) {
61
+ const founded = __privateGet(this, _buttonElements).find((el) => el === element);
62
+ founded && (founded.removeEventListener("click", __privateGet(this, _buttonClickListener)), __privateSet(this, _buttonElements, __privateGet(this, _buttonElements).filter((el) => el !== element)));
61
63
  }
62
- setValue(t) {
63
- t && t !== e(this, h) && (d(this, h, t), e(this, n).forEach((s) => {
64
- s.getAttribute("data-value") === e(this, h) ? (s.setAttribute("data-checked", ""), d(this, o, s)) : s.removeAttribute("data-checked");
65
- }), e(this, o) && e(this, E).forEach((s) => {
66
- s.innerHTML = e(this, o).getAttribute("data-name") || t;
67
- }), g(this, "radioChange", {
68
- detail: e(this, h),
64
+ setValue(value) {
65
+ value && value !== __privateGet(this, _value) && (__privateSet(this, _value, value), __privateGet(this, _buttonElements).forEach((element) => {
66
+ element.getAttribute("data-value") === __privateGet(this, _value) ? (element.setAttribute("data-checked", ""), __privateSet(this, _currentButtonElement, element)) : element.removeAttribute("data-checked");
67
+ }), __privateGet(this, _currentButtonElement) && __privateGet(this, _listenerElements).forEach((element) => {
68
+ element.innerHTML = __privateGet(this, _currentButtonElement).getAttribute("data-name") || value;
69
+ }), dispatchEvent(this, "radioChange", {
70
+ detail: __privateGet(this, _value),
69
71
  bubbles: !0
70
72
  }));
71
73
  }
72
74
  connectedCallback() {
73
- d(this, E, [
75
+ __privateSet(this, _listenerElements, [
74
76
  ...this.querySelectorAll("[data-radio-listener]")
75
- ]), d(this, n, [
77
+ ]), __privateSet(this, _buttonElements, [
76
78
  ...this.querySelectorAll("[data-radio-button]")
77
- ]), document.readyState === "complete" ? e(this, m).call(this) : addEventListener("load", e(this, m));
79
+ ]), document.readyState === "complete" ? __privateGet(this, _loadListener).call(this) : addEventListener("load", __privateGet(this, _loadListener));
78
80
  }
79
81
  disconnectedCallback() {
80
- e(this, n).forEach((t) => {
81
- t.removeEventListener("click", e(this, l));
82
- }), removeEventListener("load", e(this, m)), document.documentElement.removeEventListener(
82
+ __privateGet(this, _buttonElements).forEach((element) => {
83
+ element.removeEventListener("click", __privateGet(this, _buttonClickListener));
84
+ }), removeEventListener("load", __privateGet(this, _loadListener)), document.documentElement.removeEventListener(
83
85
  "radioChange",
84
- e(this, f)
86
+ __privateGet(this, _documentRadioChangeListener)
85
87
  );
86
88
  }
87
- }
88
- E = new WeakMap(), n = new WeakMap(), h = new WeakMap(), o = new WeakMap(), c = new WeakMap(), m = new WeakMap(), l = new WeakMap(), f = new WeakMap();
89
- customElements.get("e-radio") || customElements.define("e-radio", L);
89
+ };
90
+ _listenerElements = new WeakMap(), _buttonElements = new WeakMap(), _value = new WeakMap(), _currentButtonElement = new WeakMap(), _disabled = new WeakMap(), _loadListener = new WeakMap(), _buttonClickListener = new WeakMap(), _documentRadioChangeListener = new WeakMap(), __name(_RadioElement, "RadioElement");
91
+ let RadioElement = _RadioElement;
92
+ customElements.get("e-radio") || customElements.define("e-radio", RadioElement);
90
93
  export {
91
- L as RadioElement
94
+ RadioElement
92
95
  };
@@ -0,0 +1 @@
1
+ "use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);const Store=require("./Store-DZnOrofs.cjs"),string=require("./string-CbRNzmd9.cjs"),morph=require("./morph-Buhxq-X0.cjs"),object=require("./object-DTY_W6xG.cjs");require("construct-style-sheets-polyfill");const intersector_index=require("./index-DZ44osDT.cjs"),connector_index=require("./connector/index.cjs"),DerivedArray=require("./DerivedArray-xYBpcTp8.cjs");require("./css-value-parser/index.cjs");require("./window-resizer/index.cjs");require("./element-resizer/index.cjs");const activeComponent={current:null},componentElementLoadingTypes=["idle","load","visible","constructor","connect"];var _loadCallback,_connectCallbacks,_disconnectCallbacks,_loadingType,_idleId,_windowLoadListener,_idleListener,_intersectionListener,_ComponentElement_instances,connect_fn;const _ComponentElement=class _ComponentElement extends HTMLElement{constructor(){super();__privateAdd(this,_ComponentElement_instances);__privateAdd(this,_loadCallback);__privateAdd(this,_connectCallbacks,[]);__privateAdd(this,_disconnectCallbacks,[]);__privateAdd(this,_loadingType,"constructor");__privateAdd(this,_idleId);__privateAdd(this,_windowLoadListener,__name(()=>{window.removeEventListener("load",__privateGet(this,_windowLoadListener)),__privateGet(this,_loadingType)==="load"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this)},"#windowLoadListener"));__privateAdd(this,_idleListener,__name(()=>{__privateSet(this,_idleId,void 0),__privateGet(this,_loadingType)==="idle"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this)},"#idleListener"));__privateAdd(this,_intersectionListener,__name(entry=>{entry.isIntersecting&&(intersector_index.intersector.unsubscribe(__privateGet(this,_intersectionListener)),__privateGet(this,_loadingType)==="visible"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this))},"#intersectionListener"));activeComponent.current=this}addLoadCallback(callback){this.hasAttribute("loading")&&componentElementLoadingTypes.includes(this.getAttribute("loading"))?__privateSet(this,_loadingType,this.getAttribute("loading")):__privateSet(this,_loadingType,"constructor"),__privateSet(this,_loadCallback,callback),__privateGet(this,_loadingType)==="constructor"&&__privateGet(this,_loadCallback).call(this)}addConnectCallback(callback){__privateGet(this,_connectCallbacks).push(callback)}addDisconnectCallback(callback){__privateGet(this,_disconnectCallbacks).push(callback)}connectedCallback(){const windowLoadSetup=__name(()=>{document.readyState==="complete"?__privateGet(this,_windowLoadListener).call(this):window.addEventListener("load",__privateGet(this,_windowLoadListener))},"windowLoadSetup");__privateGet(this,_loadingType)==="connect"||__privateGet(this,_loadingType)==="constructor"?__privateMethod(this,_ComponentElement_instances,connect_fn).call(this):__privateGet(this,_loadingType)==="load"?windowLoadSetup():__privateGet(this,_loadingType)==="idle"?window.requestIdleCallback?__privateSet(this,_idleId,window.requestIdleCallback(__privateGet(this,_idleListener))):windowLoadSetup():__privateGet(this,_loadingType)==="visible"&&intersector_index.intersector.subscribe(this,__privateGet(this,_intersectionListener)),activeComponent.current===this&&(activeComponent.current=null)}disconnectedCallback(){__privateGet(this,_disconnectCallbacks).forEach(callback=>{callback(this)}),__privateSet(this,_connectCallbacks,[]),__privateSet(this,_disconnectCallbacks,[]),activeComponent.current===this&&(activeComponent.current=null),window.removeEventListener("load",__privateGet(this,_windowLoadListener)),window.cancelIdleCallback&&__privateGet(this,_idleId)&&window.cancelIdleCallback(__privateGet(this,_idleId)),intersector_index.intersector.unsubscribe(__privateGet(this,_intersectionListener))}};_loadCallback=new WeakMap,_connectCallbacks=new WeakMap,_disconnectCallbacks=new WeakMap,_loadingType=new WeakMap,_idleId=new WeakMap,_windowLoadListener=new WeakMap,_idleListener=new WeakMap,_intersectionListener=new WeakMap,_ComponentElement_instances=new WeakSet,connect_fn=__name(function(){var _a;activeComponent.current=this,this.querySelectorAll("[data-fallback]").forEach(el=>{el.remove()}),__privateGet(this,_loadingType)!=="constructor"&&((_a=__privateGet(this,_loadCallback))==null||_a.call(this)),__privateGet(this,_connectCallbacks).forEach(callback=>{const unsub=callback(this);unsub&&__privateGet(this,_disconnectCallbacks).push(unsub)}),activeComponent.current===this&&(activeComponent.current=null)},"#connect"),__name(_ComponentElement,"ComponentElement");let ComponentElement=_ComponentElement;function subscribeToStore(element,store,callback){const unsubscribe=store.subscribe(e=>{callback(e)});connector_index.connector.subscribe(element,{disconnectCallback:__name(()=>{unsubscribe()},"disconnectCallback"),maxWaitSec:20,unsubscribeAfterDisconnect:!0})}__name(subscribeToStore,"subscribeToStore");function setClassAttribute(element,classes){classes&&(classes instanceof Store.Store?subscribeToStore(element,classes,e=>{e.previous&&element.classList.remove(e.previous.toString()),e.current&&element.classList.add(e.current.toString())}):typeof classes=="object"&&!Array.isArray(classes)?Object.entries(classes).forEach(([key,value])=>{value instanceof Store.Store?subscribeToStore(element,value,e=>{element.classList.toggle(key,!!e.current)}):value&&element.classList.add(key)}):Array.isArray(classes)?classes.forEach(item=>{typeof item=="string"?element.classList.add(item):setClassAttribute(element,item)}):classes.toString().split(" ").map(v=>element.classList.add(v.trim())))}__name(setClassAttribute,"setClassAttribute");function setStyleAttribute(element,value){value&&(typeof value=="object"?Object.entries(value).forEach(([key,value2])=>{value2 instanceof Store.Store?subscribeToStore(element,value2,e=>{var _a;element.style[key]=(_a=e.current)==null?void 0:_a.toString()}):(typeof value2=="number"||typeof value2=="string"||typeof value2=="boolean")&&(element.style[key]=value2.toString())}):typeof value=="string"&&(element.style=value))}__name(setStyleAttribute,"setStyleAttribute");function setAttribute(element,key,value){key==="ref"&&value?Array.isArray(value)?value.forEach(v=>{typeof v=="object"&&"value"in v&&(v.value=element)}):typeof value=="object"&&"value"in value&&(value.value=element):key==="className"||key==="class"?setClassAttribute(element,value):key==="style"?setStyleAttribute(element,value):key==="setHtml"&&value!=null?element.innerHTML=value:typeof value=="number"?key==="tabIndex"?element.setAttribute("tabindex",value.toString()):setAttribute(element,key,value.toString()):typeof value=="string"?key==="htmlFor"?element.setAttribute("for",value):element.setAttribute(key,value):typeof value=="boolean"?value?element.setAttribute(key,""):element.removeAttribute(key):value instanceof Store.Store&&subscribeToStore(element,value,e=>{key in element?element[key]=e.current:setAttribute(element,key,e.current)})}__name(setAttribute,"setAttribute");function setAttributes(ele,attributes){for(const[key,value]of Object.entries(attributes!=null?attributes:{}))typeof value=="function"&&key.startsWith("on")?ele.addEventListener(string.uncapitalize(key.replace("on","")),value):setAttribute(ele,key,value)}__name(setAttributes,"setAttributes");function createElement(tag,isSVG){return tag==="svg"?document.createElementNS("http://www.w3.org/2000/svg","svg"):isSVG?document.createElementNS("http://www.w3.org/2000/svg",tag):document.createElement(tag)}__name(createElement,"createElement");function filterChildren(children){const filtered=[];return(Array.isArray(children)?children:[children]).forEach(child=>{child!=null&&(typeof child=="number"?filtered.push(child.toString()):Array.isArray(child)?child.forEach(c=>{filtered.push(...filterChildren(c))}):filtered.push(child))}),filtered}__name(filterChildren,"filterChildren");function hydrateTextNode(element,newChild,index){const existingChild=element.childNodes[index];existingChild&&existingChild.nodeType===Node.TEXT_NODE?existingChild.textContent!==String(newChild)&&(console.warn(`Hydration text mismatch: expected "${newChild}", got "${existingChild.textContent}"`),existingChild.textContent=String(newChild)):newChild!=null&&newChild!==""&&element.insertBefore(document.createTextNode(String(newChild)),element.childNodes[index]||null)}__name(hydrateTextNode,"hydrateTextNode");function storeChildren(element,store){const currentChildNodes=[...element.childNodes].filter(node=>node.__storeId===store.id),newChildren=store.current,newChildrenArray=Array.isArray(newChildren)?newChildren:[newChildren],newNodes=[];if(newChildrenArray.forEach(newChild=>{let newNode=null;typeof newChild=="boolean"||typeof newChild=="number"||typeof newChild=="string"?newNode=document.createTextNode(newChild.toString()):newChild instanceof Node&&(newNode=newChild),newNode&&(newNode.__storeId=store.id,newNodes.push(newNode))}),store instanceof DerivedArray.DerivedKeyedArray){const nodesToStay=[];newNodes.forEach((newNode,i)=>{const oldNode=currentChildNodes.find(oldNode2=>oldNode2.__key===newNode.__key);oldNode?oldNode.isEqualNode(newNode)?nodesToStay.push(oldNode):(oldNode.replaceWith(newNode),nodesToStay.push(newNode)):(nodesToStay.push(newNode),element.appendChild(newNode))}),currentChildNodes.forEach(currentNode=>{nodesToStay.includes(currentNode)||currentNode.remove()})}else newNodes.forEach((node,i)=>{var _a;const founded=currentChildNodes[i];if(founded)founded.isEqualNode(node)||(founded.replaceWith(node),currentChildNodes[i]=node);else{const lastChildNode=currentChildNodes[currentChildNodes.length-1];lastChildNode?(_a=lastChildNode.parentNode)==null||_a.insertBefore(node,lastChildNode.nextSibling):element.appendChild(node)}}),currentChildNodes.slice(newNodes.length).forEach(node=>{node.remove()})}__name(storeChildren,"storeChildren");const _Props=class _Props{constructor(tag,attributes,children){this.tag=tag,this.attributes=attributes,this.children=children}};__name(_Props,"Props");let Props=_Props;const _ComponentProps=class _ComponentProps extends Props{};__name(_ComponentProps,"ComponentProps");let ComponentProps=_ComponentProps;const _ElementProps=class _ElementProps extends Props{};__name(_ElementProps,"ElementProps");let ElementProps=_ElementProps;const _HeadProps=class _HeadProps extends Props{};__name(_HeadProps,"HeadProps");let HeadProps=_HeadProps;function appendChildren(element,attributes,children,isSVG=!1){const filteredChildren=filterChildren(children);setAttributes(element,attributes),filteredChildren.forEach((child,index)=>{handleChild(element,child,index,isSVG)})}__name(appendChildren,"appendChildren");function handleChild(element,child,index,isSVG){child instanceof Store.Store?handleStoreChild(element,child):child instanceof ComponentProps?handleComponentProps(element,child):child instanceof ElementProps?handleElementProps(element,child,index,isSVG):child instanceof HeadProps?handleHeadProps(child):handleTextNode(element,child,index)}__name(handleChild,"handleChild");function handleStoreChild(element,child){subscribeToStore(element,child,()=>{storeChildren(element,child)})}__name(handleStoreChild,"handleStoreChild");function handleComponentProps(element,child){child.tag==="shadow"&&element.shadowRoot?appendChildren(element.shadowRoot,child.attributes,child.children):appendChildren(element,child.attributes,child.children)}__name(handleComponentProps,"handleComponentProps");function handleElementProps(element,child,index,isSVG){let childElement=null;if(isHydrating.value){const existingChild=element.children[index];(existingChild==null?void 0:existingChild.nodeName.toLowerCase())===child.tag?(childElement=existingChild,appendChildren(childElement,child.attributes,child.children,isSVG)):(childElement=createElement(child.tag,isSVG),appendChildren(childElement,child.attributes,child.children,isSVG),element.append(childElement))}else childElement=createElement(child.tag,isSVG),appendChildren(childElement,child.attributes,child.children,isSVG),element.append(childElement)}__name(handleElementProps,"handleElementProps");function handleHeadProps(child){const headElement=document.createElement(child.tag);appendChildren(headElement,child.attributes,child.children);const patches=morph.diff(document.head,headElement);morph.patch(document.head,patches)}__name(handleHeadProps,"handleHeadProps");function handleTextNode(element,child,index){isHydrating.value?hydrateTextNode(element,child,index):element.append(child)}__name(handleTextNode,"handleTextNode");function processChildren(attributes,children){let result=children.filter(Boolean).length?children:attributes==null?void 0:attributes.children;return result?result.flat(2):[]}__name(processChildren,"processChildren");function handleStringTag(tag,attributes,children){switch(tag){case"component":case"shadow":return new ComponentProps(tag,attributes,children);case"head":return new HeadProps(tag,attributes,children);default:return new ElementProps(tag,attributes,children)}}__name(handleStringTag,"handleStringTag");function handleFunctionTag(jsxTag,attributes,children){return object.isESClass(jsxTag)?createClassElement(jsxTag,attributes,children):jsxTag===Fragment?Fragment(children):jsxTag.template?jsxTag(__spreadValues({},attributes)):createCustomElement(jsxTag,attributes,children)}__name(handleFunctionTag,"handleFunctionTag");function createClassElement(jsxTag,attributes,children){const element=new jsxTag;return appendChildren(element,attributes,children),element}__name(createClassElement,"createClassElement");function createCustomElement(jsxTag,attributes,children){const name=jsxTag.define||`e-${string.camelToKebab(jsxTag.name)}`,Constructor=getOrDefineCustomElement(name,jsxTag),id=generateElementId(jsxTag.name,attributes),element=getOrCreateElement(name,id,Constructor);return fillComponentElement(element,jsxTag,attributes,children),element}__name(createCustomElement,"createCustomElement");function getOrDefineCustomElement(name,jsxTag){var _a;let Constructor=customElements.get(name);return Constructor||(Constructor=(_a=class extends ComponentElement{constructor(){super()}},__name(_a,"Constructor"),_a.formAssociated=jsxTag.formAssociated,_a),customElements.define(name,Constructor)),Constructor}__name(getOrDefineCustomElement,"getOrDefineCustomElement");function generateElementId(tagName,attributes){if(attributes!=null&&attributes.__hydrationId)return attributes.__hydrationId;const index=(indexMap.get(tagName)||0)+1;return indexMap.set(tagName,index),`${tagName}-${index}`}__name(generateElementId,"generateElementId");function getOrCreateElement(name,id,Constructor){if(isHydrating.value){const selector=`${name}[data-id="${id}"]`,existingElement=document.querySelector(selector);if(existingElement&&existingElement instanceof Constructor)return existingElement}const element=new Constructor;return element.setAttribute("data-id",id),element}__name(getOrCreateElement,"getOrCreateElement");function fillComponentElement(element,jsxTag,attributes,children){const props=__spreadProps(__spreadValues({},attributes),{children}),setHtml=props.setHtml;delete props.setHtml;const result=jsxTag(props);result instanceof ElementProps?appendChildren(element,{setHtml},result):result instanceof ComponentProps&&appendChildren(element,__spreadProps(__spreadValues({},result.attributes),{setHtml}),result.children)}__name(fillComponentElement,"fillComponentElement");const isHydrating={value:!1},indexMap=new Map;function h(jsxTag,attributes,...children){const processedChildren=processChildren(attributes,children),processedAttributes=__spreadValues({},attributes);return delete processedAttributes.children,typeof jsxTag=="string"?handleStringTag(jsxTag,processedAttributes,processedChildren):handleFunctionTag(jsxTag,processedAttributes,processedChildren)}__name(h,"h");function Fragment(children){const fragment=document.createDocumentFragment();return appendChildren(fragment,void 0,children),fragment}__name(Fragment,"Fragment");function render(container,Component,params,children){const element=h(Component,__spreadValues({},params),children);return container.append(element),element}__name(render,"render");function hydrate(Component,params,children){isHydrating.value=!0;const element=h(Component,__spreadValues({},params),children);return isHydrating.value=!1,element}__name(hydrate,"hydrate");exports.Fragment=Fragment;exports.activeComponent=activeComponent;exports.h=h;exports.hydrate=hydrate;exports.indexMap=indexMap;exports.render=render;
@@ -0,0 +1,354 @@
1
+ var __defProp = Object.defineProperty, __defProps = Object.defineProperties;
2
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __typeError = (msg) => {
6
+ throw TypeError(msg);
7
+ };
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ __hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
11
+ if (__getOwnPropSymbols)
12
+ for (var prop of __getOwnPropSymbols(b))
13
+ __propIsEnum.call(b, prop) && __defNormalProp(a, prop, b[prop]);
14
+ return a;
15
+ }, __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)), __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
16
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
17
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
18
+ import { S as Store } from "./Store-BRTHeZmO.js";
19
+ import { u as uncapitalize, c as camelToKebab } from "./string-B3lm2b7v.js";
20
+ import { k as diff, p as patch } from "./morph-BtgB1YQP.js";
21
+ import { i as isESClass } from "./object-CiIdEmJx.js";
22
+ import "construct-style-sheets-polyfill";
23
+ import { a as intersector } from "./index-ClTMVKJp.js";
24
+ import { connector } from "./connector/index.js";
25
+ import { a as DerivedKeyedArray } from "./DerivedArray-BePrxcLC.js";
26
+ import "./css-value-parser/index.js";
27
+ import "./window-resizer/index.js";
28
+ import "./element-resizer/index.js";
29
+ const activeComponent = { current: null }, componentElementLoadingTypes = [
30
+ "idle",
31
+ "load",
32
+ "visible",
33
+ "constructor",
34
+ "connect"
35
+ ];
36
+ var _loadCallback, _connectCallbacks, _disconnectCallbacks, _loadingType, _idleId, _windowLoadListener, _idleListener, _intersectionListener, _ComponentElement_instances, connect_fn;
37
+ const _ComponentElement = class _ComponentElement extends HTMLElement {
38
+ constructor() {
39
+ super();
40
+ __privateAdd(this, _ComponentElement_instances);
41
+ __privateAdd(this, _loadCallback);
42
+ __privateAdd(this, _connectCallbacks, []);
43
+ __privateAdd(this, _disconnectCallbacks, []);
44
+ __privateAdd(this, _loadingType, "constructor");
45
+ __privateAdd(this, _idleId);
46
+ __privateAdd(this, _windowLoadListener, /* @__PURE__ */ __name(() => {
47
+ window.removeEventListener("load", __privateGet(this, _windowLoadListener)), __privateGet(this, _loadingType) === "load" && __privateMethod(this, _ComponentElement_instances, connect_fn).call(this);
48
+ }, "#windowLoadListener"));
49
+ __privateAdd(this, _idleListener, /* @__PURE__ */ __name(() => {
50
+ __privateSet(this, _idleId, void 0), __privateGet(this, _loadingType) === "idle" && __privateMethod(this, _ComponentElement_instances, connect_fn).call(this);
51
+ }, "#idleListener"));
52
+ __privateAdd(this, _intersectionListener, /* @__PURE__ */ __name((entry) => {
53
+ entry.isIntersecting && (intersector.unsubscribe(__privateGet(this, _intersectionListener)), __privateGet(this, _loadingType) === "visible" && __privateMethod(this, _ComponentElement_instances, connect_fn).call(this));
54
+ }, "#intersectionListener"));
55
+ activeComponent.current = this;
56
+ }
57
+ addLoadCallback(callback) {
58
+ this.hasAttribute("loading") && componentElementLoadingTypes.includes(
59
+ this.getAttribute("loading")
60
+ ) ? __privateSet(this, _loadingType, this.getAttribute(
61
+ "loading"
62
+ )) : __privateSet(this, _loadingType, "constructor"), __privateSet(this, _loadCallback, callback), __privateGet(this, _loadingType) === "constructor" && __privateGet(this, _loadCallback).call(this);
63
+ }
64
+ addConnectCallback(callback) {
65
+ __privateGet(this, _connectCallbacks).push(callback);
66
+ }
67
+ addDisconnectCallback(callback) {
68
+ __privateGet(this, _disconnectCallbacks).push(callback);
69
+ }
70
+ connectedCallback() {
71
+ const windowLoadSetup = /* @__PURE__ */ __name(() => {
72
+ document.readyState === "complete" ? __privateGet(this, _windowLoadListener).call(this) : window.addEventListener("load", __privateGet(this, _windowLoadListener));
73
+ }, "windowLoadSetup");
74
+ __privateGet(this, _loadingType) === "connect" || __privateGet(this, _loadingType) === "constructor" ? __privateMethod(this, _ComponentElement_instances, connect_fn).call(this) : __privateGet(this, _loadingType) === "load" ? windowLoadSetup() : __privateGet(this, _loadingType) === "idle" ? window.requestIdleCallback ? __privateSet(this, _idleId, window.requestIdleCallback(__privateGet(this, _idleListener))) : windowLoadSetup() : __privateGet(this, _loadingType) === "visible" && intersector.subscribe(this, __privateGet(this, _intersectionListener)), activeComponent.current === this && (activeComponent.current = null);
75
+ }
76
+ disconnectedCallback() {
77
+ __privateGet(this, _disconnectCallbacks).forEach((callback) => {
78
+ callback(this);
79
+ }), __privateSet(this, _connectCallbacks, []), __privateSet(this, _disconnectCallbacks, []), activeComponent.current === this && (activeComponent.current = null), window.removeEventListener("load", __privateGet(this, _windowLoadListener)), window.cancelIdleCallback && __privateGet(this, _idleId) && window.cancelIdleCallback(__privateGet(this, _idleId)), intersector.unsubscribe(__privateGet(this, _intersectionListener));
80
+ }
81
+ };
82
+ _loadCallback = new WeakMap(), _connectCallbacks = new WeakMap(), _disconnectCallbacks = new WeakMap(), _loadingType = new WeakMap(), _idleId = new WeakMap(), _windowLoadListener = new WeakMap(), _idleListener = new WeakMap(), _intersectionListener = new WeakMap(), _ComponentElement_instances = new WeakSet(), connect_fn = /* @__PURE__ */ __name(function() {
83
+ var _a;
84
+ activeComponent.current = this, this.querySelectorAll("[data-fallback]").forEach((el) => {
85
+ el.remove();
86
+ }), __privateGet(this, _loadingType) !== "constructor" && ((_a = __privateGet(this, _loadCallback)) == null || _a.call(this)), __privateGet(this, _connectCallbacks).forEach((callback) => {
87
+ const unsub = callback(this);
88
+ unsub && __privateGet(this, _disconnectCallbacks).push(unsub);
89
+ }), activeComponent.current === this && (activeComponent.current = null);
90
+ }, "#connect"), __name(_ComponentElement, "ComponentElement");
91
+ let ComponentElement = _ComponentElement;
92
+ function subscribeToStore(element, store, callback) {
93
+ const unsubscribe = store.subscribe((e) => {
94
+ callback(e);
95
+ });
96
+ connector.subscribe(element, {
97
+ disconnectCallback: /* @__PURE__ */ __name(() => {
98
+ unsubscribe();
99
+ }, "disconnectCallback"),
100
+ maxWaitSec: 20,
101
+ unsubscribeAfterDisconnect: !0
102
+ });
103
+ }
104
+ __name(subscribeToStore, "subscribeToStore");
105
+ function setClassAttribute(element, classes) {
106
+ classes && (classes instanceof Store ? subscribeToStore(element, classes, (e) => {
107
+ e.previous && element.classList.remove(e.previous.toString()), e.current && element.classList.add(e.current.toString());
108
+ }) : typeof classes == "object" && !Array.isArray(classes) ? Object.entries(classes).forEach(([key, value]) => {
109
+ value instanceof Store ? subscribeToStore(element, value, (e) => {
110
+ element.classList.toggle(key, !!e.current);
111
+ }) : value && element.classList.add(key);
112
+ }) : Array.isArray(classes) ? classes.forEach((item) => {
113
+ typeof item == "string" ? element.classList.add(item) : setClassAttribute(element, item);
114
+ }) : classes.toString().split(" ").map((v) => element.classList.add(v.trim())));
115
+ }
116
+ __name(setClassAttribute, "setClassAttribute");
117
+ function setStyleAttribute(element, value) {
118
+ value && (typeof value == "object" ? Object.entries(value).forEach(([key, value2]) => {
119
+ value2 instanceof Store ? subscribeToStore(element, value2, (e) => {
120
+ var _a;
121
+ element.style[key] = (_a = e.current) == null ? void 0 : _a.toString();
122
+ }) : (typeof value2 == "number" || typeof value2 == "string" || typeof value2 == "boolean") && (element.style[key] = value2.toString());
123
+ }) : typeof value == "string" && (element.style = value));
124
+ }
125
+ __name(setStyleAttribute, "setStyleAttribute");
126
+ function setAttribute(element, key, value) {
127
+ key === "ref" && value ? Array.isArray(value) ? value.forEach((v) => {
128
+ typeof v == "object" && "value" in v && (v.value = element);
129
+ }) : typeof value == "object" && "value" in value && (value.value = element) : key === "className" || key === "class" ? setClassAttribute(element, value) : key === "style" ? setStyleAttribute(element, value) : key === "setHtml" && value != null ? element.innerHTML = value : typeof value == "number" ? key === "tabIndex" ? element.setAttribute("tabindex", value.toString()) : setAttribute(element, key, value.toString()) : typeof value == "string" ? key === "htmlFor" ? element.setAttribute("for", value) : element.setAttribute(key, value) : typeof value == "boolean" ? value ? element.setAttribute(key, "") : element.removeAttribute(key) : value instanceof Store && subscribeToStore(element, value, (e) => {
130
+ key in element ? element[key] = e.current : setAttribute(element, key, e.current);
131
+ });
132
+ }
133
+ __name(setAttribute, "setAttribute");
134
+ function setAttributes(ele, attributes) {
135
+ for (const [key, value] of Object.entries(attributes != null ? attributes : {}))
136
+ typeof value == "function" && key.startsWith("on") ? ele.addEventListener(
137
+ uncapitalize(key.replace("on", "")),
138
+ value
139
+ ) : setAttribute(ele, key, value);
140
+ }
141
+ __name(setAttributes, "setAttributes");
142
+ function createElement(tag, isSVG) {
143
+ return tag === "svg" ? document.createElementNS("http://www.w3.org/2000/svg", "svg") : isSVG ? document.createElementNS("http://www.w3.org/2000/svg", tag) : document.createElement(tag);
144
+ }
145
+ __name(createElement, "createElement");
146
+ function filterChildren(children) {
147
+ const filtered = [];
148
+ return (Array.isArray(children) ? children : [children]).forEach((child) => {
149
+ child != null && (typeof child == "number" ? filtered.push(child.toString()) : Array.isArray(child) ? child.forEach((c) => {
150
+ filtered.push(...filterChildren(c));
151
+ }) : filtered.push(child));
152
+ }), filtered;
153
+ }
154
+ __name(filterChildren, "filterChildren");
155
+ function hydrateTextNode(element, newChild, index) {
156
+ const existingChild = element.childNodes[index];
157
+ existingChild && existingChild.nodeType === Node.TEXT_NODE ? existingChild.textContent !== String(newChild) && (console.warn(
158
+ `Hydration text mismatch: expected "${newChild}", got "${existingChild.textContent}"`
159
+ ), existingChild.textContent = String(newChild)) : newChild != null && newChild !== "" && element.insertBefore(
160
+ document.createTextNode(String(newChild)),
161
+ element.childNodes[index] || null
162
+ );
163
+ }
164
+ __name(hydrateTextNode, "hydrateTextNode");
165
+ function storeChildren(element, store) {
166
+ const currentChildNodes = [...element.childNodes].filter((node) => node.__storeId === store.id), newChildren = store.current, newChildrenArray = Array.isArray(newChildren) ? newChildren : [newChildren], newNodes = [];
167
+ if (newChildrenArray.forEach((newChild) => {
168
+ let newNode = null;
169
+ typeof newChild == "boolean" || typeof newChild == "number" || typeof newChild == "string" ? newNode = document.createTextNode(newChild.toString()) : newChild instanceof Node && (newNode = newChild), newNode && (newNode.__storeId = store.id, newNodes.push(newNode));
170
+ }), store instanceof DerivedKeyedArray) {
171
+ const nodesToStay = [];
172
+ newNodes.forEach((newNode, i) => {
173
+ const oldNode = currentChildNodes.find(
174
+ (oldNode2) => oldNode2.__key === newNode.__key
175
+ );
176
+ oldNode ? oldNode.isEqualNode(newNode) ? nodesToStay.push(oldNode) : (oldNode.replaceWith(newNode), nodesToStay.push(newNode)) : (nodesToStay.push(newNode), element.appendChild(newNode));
177
+ }), currentChildNodes.forEach((currentNode) => {
178
+ nodesToStay.includes(currentNode) || currentNode.remove();
179
+ });
180
+ } else
181
+ newNodes.forEach((node, i) => {
182
+ var _a;
183
+ const founded = currentChildNodes[i];
184
+ if (founded)
185
+ founded.isEqualNode(node) || (founded.replaceWith(node), currentChildNodes[i] = node);
186
+ else {
187
+ const lastChildNode = currentChildNodes[currentChildNodes.length - 1];
188
+ lastChildNode ? (_a = lastChildNode.parentNode) == null || _a.insertBefore(
189
+ node,
190
+ lastChildNode.nextSibling
191
+ ) : element.appendChild(node);
192
+ }
193
+ }), currentChildNodes.slice(newNodes.length).forEach((node) => {
194
+ node.remove();
195
+ });
196
+ }
197
+ __name(storeChildren, "storeChildren");
198
+ const _Props = class _Props {
199
+ constructor(tag, attributes, children) {
200
+ this.tag = tag, this.attributes = attributes, this.children = children;
201
+ }
202
+ };
203
+ __name(_Props, "Props");
204
+ let Props = _Props;
205
+ const _ComponentProps = class _ComponentProps extends Props {
206
+ };
207
+ __name(_ComponentProps, "ComponentProps");
208
+ let ComponentProps = _ComponentProps;
209
+ const _ElementProps = class _ElementProps extends Props {
210
+ };
211
+ __name(_ElementProps, "ElementProps");
212
+ let ElementProps = _ElementProps;
213
+ const _HeadProps = class _HeadProps extends Props {
214
+ };
215
+ __name(_HeadProps, "HeadProps");
216
+ let HeadProps = _HeadProps;
217
+ function appendChildren(element, attributes, children, isSVG = !1) {
218
+ const filteredChildren = filterChildren(children);
219
+ setAttributes(element, attributes), filteredChildren.forEach((child, index) => {
220
+ handleChild(element, child, index, isSVG);
221
+ });
222
+ }
223
+ __name(appendChildren, "appendChildren");
224
+ function handleChild(element, child, index, isSVG) {
225
+ child instanceof Store ? handleStoreChild(element, child) : child instanceof ComponentProps ? handleComponentProps(element, child) : child instanceof ElementProps ? handleElementProps(element, child, index, isSVG) : child instanceof HeadProps ? handleHeadProps(child) : handleTextNode(element, child, index);
226
+ }
227
+ __name(handleChild, "handleChild");
228
+ function handleStoreChild(element, child) {
229
+ subscribeToStore(element, child, () => {
230
+ storeChildren(element, child);
231
+ });
232
+ }
233
+ __name(handleStoreChild, "handleStoreChild");
234
+ function handleComponentProps(element, child) {
235
+ child.tag === "shadow" && element.shadowRoot ? appendChildren(element.shadowRoot, child.attributes, child.children) : appendChildren(element, child.attributes, child.children);
236
+ }
237
+ __name(handleComponentProps, "handleComponentProps");
238
+ function handleElementProps(element, child, index, isSVG) {
239
+ let childElement = null;
240
+ if (isHydrating.value) {
241
+ const existingChild = element.children[index];
242
+ (existingChild == null ? void 0 : existingChild.nodeName.toLowerCase()) === child.tag ? (childElement = existingChild, appendChildren(childElement, child.attributes, child.children, isSVG)) : (childElement = createElement(child.tag, isSVG), appendChildren(childElement, child.attributes, child.children, isSVG), element.append(childElement));
243
+ } else
244
+ childElement = createElement(child.tag, isSVG), appendChildren(childElement, child.attributes, child.children, isSVG), element.append(childElement);
245
+ }
246
+ __name(handleElementProps, "handleElementProps");
247
+ function handleHeadProps(child) {
248
+ const headElement = document.createElement(child.tag);
249
+ appendChildren(headElement, child.attributes, child.children);
250
+ const patches = diff(document.head, headElement);
251
+ patch(document.head, patches);
252
+ }
253
+ __name(handleHeadProps, "handleHeadProps");
254
+ function handleTextNode(element, child, index) {
255
+ isHydrating.value ? hydrateTextNode(element, child, index) : element.append(child);
256
+ }
257
+ __name(handleTextNode, "handleTextNode");
258
+ function processChildren(attributes, children) {
259
+ let result = children.filter(Boolean).length ? children : attributes == null ? void 0 : attributes.children;
260
+ return result ? result.flat(2) : [];
261
+ }
262
+ __name(processChildren, "processChildren");
263
+ function handleStringTag(tag, attributes, children) {
264
+ switch (tag) {
265
+ case "component":
266
+ case "shadow":
267
+ return new ComponentProps(tag, attributes, children);
268
+ case "head":
269
+ return new HeadProps(tag, attributes, children);
270
+ default:
271
+ return new ElementProps(tag, attributes, children);
272
+ }
273
+ }
274
+ __name(handleStringTag, "handleStringTag");
275
+ function handleFunctionTag(jsxTag, attributes, children) {
276
+ return isESClass(jsxTag) ? createClassElement(jsxTag, attributes, children) : jsxTag === Fragment ? Fragment(children) : jsxTag.template ? jsxTag(__spreadValues({}, attributes)) : createCustomElement(jsxTag, attributes, children);
277
+ }
278
+ __name(handleFunctionTag, "handleFunctionTag");
279
+ function createClassElement(jsxTag, attributes, children) {
280
+ const element = new jsxTag();
281
+ return appendChildren(element, attributes, children), element;
282
+ }
283
+ __name(createClassElement, "createClassElement");
284
+ function createCustomElement(jsxTag, attributes, children) {
285
+ const name = jsxTag.define || `e-${camelToKebab(jsxTag.name)}`, Constructor = getOrDefineCustomElement(name, jsxTag), id = generateElementId(jsxTag.name, attributes), element = getOrCreateElement(name, id, Constructor);
286
+ return fillComponentElement(element, jsxTag, attributes, children), element;
287
+ }
288
+ __name(createCustomElement, "createCustomElement");
289
+ function getOrDefineCustomElement(name, jsxTag) {
290
+ var _a;
291
+ let Constructor = customElements.get(name);
292
+ return Constructor || (Constructor = (_a = class extends ComponentElement {
293
+ constructor() {
294
+ super();
295
+ }
296
+ }, __name(_a, "Constructor"), _a.formAssociated = jsxTag.formAssociated, _a), customElements.define(name, Constructor)), Constructor;
297
+ }
298
+ __name(getOrDefineCustomElement, "getOrDefineCustomElement");
299
+ function generateElementId(tagName, attributes) {
300
+ if (attributes != null && attributes.__hydrationId)
301
+ return attributes.__hydrationId;
302
+ const index = (indexMap.get(tagName) || 0) + 1;
303
+ return indexMap.set(tagName, index), `${tagName}-${index}`;
304
+ }
305
+ __name(generateElementId, "generateElementId");
306
+ function getOrCreateElement(name, id, Constructor) {
307
+ if (isHydrating.value) {
308
+ const selector = `${name}[data-id="${id}"]`, existingElement = document.querySelector(selector);
309
+ if (existingElement && existingElement instanceof Constructor)
310
+ return existingElement;
311
+ }
312
+ const element = new Constructor();
313
+ return element.setAttribute("data-id", id), element;
314
+ }
315
+ __name(getOrCreateElement, "getOrCreateElement");
316
+ function fillComponentElement(element, jsxTag, attributes, children) {
317
+ const props = __spreadProps(__spreadValues({}, attributes), {
318
+ children
319
+ }), setHtml = props.setHtml;
320
+ delete props.setHtml;
321
+ const result = jsxTag(props);
322
+ result instanceof ElementProps ? appendChildren(element, { setHtml }, result) : result instanceof ComponentProps && appendChildren(element, __spreadProps(__spreadValues({}, result.attributes), { setHtml }), result.children);
323
+ }
324
+ __name(fillComponentElement, "fillComponentElement");
325
+ const isHydrating = { value: !1 }, indexMap = /* @__PURE__ */ new Map();
326
+ function h(jsxTag, attributes, ...children) {
327
+ const processedChildren = processChildren(attributes, children), processedAttributes = __spreadValues({}, attributes);
328
+ return delete processedAttributes.children, typeof jsxTag == "string" ? handleStringTag(jsxTag, processedAttributes, processedChildren) : handleFunctionTag(jsxTag, processedAttributes, processedChildren);
329
+ }
330
+ __name(h, "h");
331
+ function Fragment(children) {
332
+ const fragment = document.createDocumentFragment();
333
+ return appendChildren(fragment, void 0, children), fragment;
334
+ }
335
+ __name(Fragment, "Fragment");
336
+ function render(container, Component, params, children) {
337
+ const element = /* @__PURE__ */ h(Component, __spreadValues({}, params), children);
338
+ return container.append(element), element;
339
+ }
340
+ __name(render, "render");
341
+ function hydrate(Component, params, children) {
342
+ isHydrating.value = !0;
343
+ const element = /* @__PURE__ */ h(Component, __spreadValues({}, params), children);
344
+ return isHydrating.value = !1, element;
345
+ }
346
+ __name(hydrate, "hydrate");
347
+ export {
348
+ Fragment as F,
349
+ activeComponent as a,
350
+ hydrate as b,
351
+ h,
352
+ indexMap as i,
353
+ render as r
354
+ };