@clusterenvision/ui-framework 1.0.0

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 (193) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +295 -0
  3. package/dist/ai-assistant-Db002XYC.d.ts +92 -0
  4. package/dist/ai-assistant-EobSUV70.d.cts +92 -0
  5. package/dist/browser-DnHpnWwE.d.cts +354 -0
  6. package/dist/browser-Dx4oKf5e.d.ts +354 -0
  7. package/dist/browser-signals-07qodpYT.d.cts +66 -0
  8. package/dist/browser-signals-07qodpYT.d.ts +66 -0
  9. package/dist/browser-signals.cjs +32 -0
  10. package/dist/browser-signals.cjs.map +1 -0
  11. package/dist/browser-signals.d.cts +1 -0
  12. package/dist/browser-signals.d.ts +1 -0
  13. package/dist/browser-signals.js +3 -0
  14. package/dist/browser-signals.js.map +1 -0
  15. package/dist/browser.cjs +197 -0
  16. package/dist/browser.cjs.map +1 -0
  17. package/dist/browser.d.cts +13 -0
  18. package/dist/browser.d.ts +13 -0
  19. package/dist/browser.js +12 -0
  20. package/dist/browser.js.map +1 -0
  21. package/dist/chunk-22HQL2Y4.js +568 -0
  22. package/dist/chunk-22HQL2Y4.js.map +1 -0
  23. package/dist/chunk-3ZBRNFEE.js +1525 -0
  24. package/dist/chunk-3ZBRNFEE.js.map +1 -0
  25. package/dist/chunk-4HRORR2Q.js +1953 -0
  26. package/dist/chunk-4HRORR2Q.js.map +1 -0
  27. package/dist/chunk-4L3UXVL5.cjs +68 -0
  28. package/dist/chunk-4L3UXVL5.cjs.map +1 -0
  29. package/dist/chunk-6BYWFGQY.cjs +226 -0
  30. package/dist/chunk-6BYWFGQY.cjs.map +1 -0
  31. package/dist/chunk-7SCIB5HP.js +57 -0
  32. package/dist/chunk-7SCIB5HP.js.map +1 -0
  33. package/dist/chunk-BBAUALNU.js +888 -0
  34. package/dist/chunk-BBAUALNU.js.map +1 -0
  35. package/dist/chunk-CHLDE4JQ.js +715 -0
  36. package/dist/chunk-CHLDE4JQ.js.map +1 -0
  37. package/dist/chunk-CXTAUXLG.cjs +71 -0
  38. package/dist/chunk-CXTAUXLG.cjs.map +1 -0
  39. package/dist/chunk-D2USIT6V.js +121 -0
  40. package/dist/chunk-D2USIT6V.js.map +1 -0
  41. package/dist/chunk-D3H5CGVD.js +36 -0
  42. package/dist/chunk-D3H5CGVD.js.map +1 -0
  43. package/dist/chunk-DQBX75NJ.js +92 -0
  44. package/dist/chunk-DQBX75NJ.js.map +1 -0
  45. package/dist/chunk-DRPG2DFX.js +208 -0
  46. package/dist/chunk-DRPG2DFX.js.map +1 -0
  47. package/dist/chunk-EFOOXCY7.cjs +41 -0
  48. package/dist/chunk-EFOOXCY7.cjs.map +1 -0
  49. package/dist/chunk-FFCZSYC7.cjs +906 -0
  50. package/dist/chunk-FFCZSYC7.cjs.map +1 -0
  51. package/dist/chunk-FNXIYAET.cjs +1593 -0
  52. package/dist/chunk-FNXIYAET.cjs.map +1 -0
  53. package/dist/chunk-I6GNUM3P.cjs +63 -0
  54. package/dist/chunk-I6GNUM3P.cjs.map +1 -0
  55. package/dist/chunk-IHAMVLRY.js +129 -0
  56. package/dist/chunk-IHAMVLRY.js.map +1 -0
  57. package/dist/chunk-IRBUKIRF.cjs +133 -0
  58. package/dist/chunk-IRBUKIRF.cjs.map +1 -0
  59. package/dist/chunk-KPG5HAHK.cjs +97 -0
  60. package/dist/chunk-KPG5HAHK.cjs.map +1 -0
  61. package/dist/chunk-N7Q2ESLG.cjs +130 -0
  62. package/dist/chunk-N7Q2ESLG.cjs.map +1 -0
  63. package/dist/chunk-PFBEIFVS.js +180 -0
  64. package/dist/chunk-PFBEIFVS.js.map +1 -0
  65. package/dist/chunk-PVZVFICK.cjs +318 -0
  66. package/dist/chunk-PVZVFICK.cjs.map +1 -0
  67. package/dist/chunk-Q3KH6HMU.js +305 -0
  68. package/dist/chunk-Q3KH6HMU.js.map +1 -0
  69. package/dist/chunk-QPAAV32J.cjs +1985 -0
  70. package/dist/chunk-QPAAV32J.cjs.map +1 -0
  71. package/dist/chunk-R6XQUMWT.cjs +61 -0
  72. package/dist/chunk-R6XQUMWT.cjs.map +1 -0
  73. package/dist/chunk-SA5UD5B6.js +92 -0
  74. package/dist/chunk-SA5UD5B6.js.map +1 -0
  75. package/dist/chunk-SM35JOYD.cjs +211 -0
  76. package/dist/chunk-SM35JOYD.cjs.map +1 -0
  77. package/dist/chunk-SZQNIMYI.cjs +592 -0
  78. package/dist/chunk-SZQNIMYI.cjs.map +1 -0
  79. package/dist/chunk-T6T7QE4J.js +224 -0
  80. package/dist/chunk-T6T7QE4J.js.map +1 -0
  81. package/dist/chunk-TIF372DZ.js +65 -0
  82. package/dist/chunk-TIF372DZ.js.map +1 -0
  83. package/dist/chunk-V6JCOBGY.js +69 -0
  84. package/dist/chunk-V6JCOBGY.js.map +1 -0
  85. package/dist/chunk-VHUXNDW2.cjs +189 -0
  86. package/dist/chunk-VHUXNDW2.cjs.map +1 -0
  87. package/dist/chunk-W3LNNY3U.cjs +729 -0
  88. package/dist/chunk-W3LNNY3U.cjs.map +1 -0
  89. package/dist/chunk-ZUWSU4OA.js +61 -0
  90. package/dist/chunk-ZUWSU4OA.js.map +1 -0
  91. package/dist/chunk-ZWUA2LPB.cjs +103 -0
  92. package/dist/chunk-ZWUA2LPB.cjs.map +1 -0
  93. package/dist/cli/index.cjs +566 -0
  94. package/dist/cli/index.cjs.map +1 -0
  95. package/dist/cli/index.d.cts +1 -0
  96. package/dist/cli/index.d.ts +1 -0
  97. package/dist/cli/index.js +558 -0
  98. package/dist/cli/index.js.map +1 -0
  99. package/dist/compiler/index.cjs +80 -0
  100. package/dist/compiler/index.cjs.map +1 -0
  101. package/dist/compiler/index.d.cts +130 -0
  102. package/dist/compiler/index.d.ts +130 -0
  103. package/dist/compiler/index.js +3 -0
  104. package/dist/compiler/index.js.map +1 -0
  105. package/dist/component-BVzvepw9.d.cts +90 -0
  106. package/dist/component-wTxZ2BPD.d.ts +90 -0
  107. package/dist/index-CpxDa60m.d.cts +644 -0
  108. package/dist/index-CpxDa60m.d.ts +644 -0
  109. package/dist/index.cjs +1356 -0
  110. package/dist/index.cjs.map +1 -0
  111. package/dist/index.d.cts +165 -0
  112. package/dist/index.d.ts +165 -0
  113. package/dist/index.js +772 -0
  114. package/dist/index.js.map +1 -0
  115. package/dist/lib/dom.cjs +102 -0
  116. package/dist/lib/dom.cjs.map +1 -0
  117. package/dist/lib/dom.d.cts +373 -0
  118. package/dist/lib/dom.d.ts +373 -0
  119. package/dist/lib/dom.js +3 -0
  120. package/dist/lib/dom.js.map +1 -0
  121. package/dist/lib/icons.cjs +20 -0
  122. package/dist/lib/icons.cjs.map +1 -0
  123. package/dist/lib/icons.d.cts +64 -0
  124. package/dist/lib/icons.d.ts +64 -0
  125. package/dist/lib/icons.js +3 -0
  126. package/dist/lib/icons.js.map +1 -0
  127. package/dist/lib/index.cjs +247 -0
  128. package/dist/lib/index.cjs.map +1 -0
  129. package/dist/lib/index.d.cts +30 -0
  130. package/dist/lib/index.d.ts +30 -0
  131. package/dist/lib/index.js +92 -0
  132. package/dist/lib/index.js.map +1 -0
  133. package/dist/lib/theme.cjs +56 -0
  134. package/dist/lib/theme.cjs.map +1 -0
  135. package/dist/lib/theme.d.cts +27 -0
  136. package/dist/lib/theme.d.ts +27 -0
  137. package/dist/lib/theme.js +3 -0
  138. package/dist/lib/theme.js.map +1 -0
  139. package/dist/router-B9kms5XQ.d.ts +124 -0
  140. package/dist/router-YnpW_sIK.d.cts +124 -0
  141. package/dist/runtime/adapters/angular.cjs +48 -0
  142. package/dist/runtime/adapters/angular.cjs.map +1 -0
  143. package/dist/runtime/adapters/angular.d.cts +38 -0
  144. package/dist/runtime/adapters/angular.d.ts +38 -0
  145. package/dist/runtime/adapters/angular.js +46 -0
  146. package/dist/runtime/adapters/angular.js.map +1 -0
  147. package/dist/runtime/adapters/react.cjs +41 -0
  148. package/dist/runtime/adapters/react.cjs.map +1 -0
  149. package/dist/runtime/adapters/react.d.cts +26 -0
  150. package/dist/runtime/adapters/react.d.ts +26 -0
  151. package/dist/runtime/adapters/react.js +39 -0
  152. package/dist/runtime/adapters/react.js.map +1 -0
  153. package/dist/runtime/adapters/vue.cjs +44 -0
  154. package/dist/runtime/adapters/vue.cjs.map +1 -0
  155. package/dist/runtime/adapters/vue.d.cts +37 -0
  156. package/dist/runtime/adapters/vue.d.ts +37 -0
  157. package/dist/runtime/adapters/vue.js +42 -0
  158. package/dist/runtime/adapters/vue.js.map +1 -0
  159. package/dist/runtime/components/ai-assistant.cjs +18 -0
  160. package/dist/runtime/components/ai-assistant.cjs.map +1 -0
  161. package/dist/runtime/components/ai-assistant.d.cts +8 -0
  162. package/dist/runtime/components/ai-assistant.d.ts +8 -0
  163. package/dist/runtime/components/ai-assistant.js +9 -0
  164. package/dist/runtime/components/ai-assistant.js.map +1 -0
  165. package/dist/runtime/components/ai-summary-card.cjs +18 -0
  166. package/dist/runtime/components/ai-summary-card.cjs.map +1 -0
  167. package/dist/runtime/components/ai-summary-card.d.cts +19 -0
  168. package/dist/runtime/components/ai-summary-card.d.ts +19 -0
  169. package/dist/runtime/components/ai-summary-card.js +9 -0
  170. package/dist/runtime/components/ai-summary-card.js.map +1 -0
  171. package/dist/runtime/router.cjs +429 -0
  172. package/dist/runtime/router.cjs.map +1 -0
  173. package/dist/runtime/router.d.cts +2 -0
  174. package/dist/runtime/router.d.ts +2 -0
  175. package/dist/runtime/router.js +421 -0
  176. package/dist/runtime/router.js.map +1 -0
  177. package/dist/runtime/server.cjs +125 -0
  178. package/dist/runtime/server.cjs.map +1 -0
  179. package/dist/runtime/server.d.cts +27 -0
  180. package/dist/runtime/server.d.ts +27 -0
  181. package/dist/runtime/server.js +117 -0
  182. package/dist/runtime/server.js.map +1 -0
  183. package/dist/runtime/workflow/index.cjs +282 -0
  184. package/dist/runtime/workflow/index.cjs.map +1 -0
  185. package/dist/runtime/workflow/index.d.cts +1 -0
  186. package/dist/runtime/workflow/index.d.ts +1 -0
  187. package/dist/runtime/workflow/index.js +5 -0
  188. package/dist/runtime/workflow/index.js.map +1 -0
  189. package/dist/tracing-DGdvMCEl.d.cts +109 -0
  190. package/dist/tracing-DGdvMCEl.d.ts +109 -0
  191. package/dist/types-C4RXXKfk.d.cts +76 -0
  192. package/dist/types-C4RXXKfk.d.ts +76 -0
  193. package/package.json +166 -0
@@ -0,0 +1,592 @@
1
+ 'use strict';
2
+
3
+ // src/lib/dom.ts
4
+ var DOM_CONFIG = {
5
+ /** Enable debug logging */
6
+ DEBUG: false};
7
+ function setDebugMode(enabled) {
8
+ DOM_CONFIG.DEBUG = enabled;
9
+ }
10
+ function log(message, ...args) {
11
+ if (DOM_CONFIG.DEBUG) {
12
+ console.log(`[DOM] ${message}`, ...args);
13
+ }
14
+ }
15
+ function safeQuerySelector(selector, context = document) {
16
+ try {
17
+ const found = context.querySelector(selector);
18
+ return found instanceof HTMLElement ? found : null;
19
+ } catch (error) {
20
+ log(`Invalid selector: ${selector}`, error);
21
+ return null;
22
+ }
23
+ }
24
+ function safeQuerySelectorAll(selector, context = document) {
25
+ try {
26
+ return Array.from(context.querySelectorAll(selector)).filter(
27
+ (node) => node instanceof HTMLElement
28
+ );
29
+ } catch (error) {
30
+ log(`Invalid selector: ${selector}`, error);
31
+ return [];
32
+ }
33
+ }
34
+ var DOMElementImpl = class _DOMElementImpl {
35
+ el;
36
+ constructor(element) {
37
+ this.el = element;
38
+ }
39
+ // Class manipulation
40
+ addClass(...classes) {
41
+ this.el?.classList.add(...classes.filter(Boolean));
42
+ return this;
43
+ }
44
+ removeClass(...classes) {
45
+ this.el?.classList.remove(...classes.filter(Boolean));
46
+ return this;
47
+ }
48
+ toggleClass(className, force) {
49
+ if (force === void 0) {
50
+ this.el?.classList.toggle(className);
51
+ } else {
52
+ this.el?.classList.toggle(className, force);
53
+ }
54
+ return this;
55
+ }
56
+ hasClass(className) {
57
+ return this.el?.classList.contains(className) ?? false;
58
+ }
59
+ attr(name, value) {
60
+ if (value === void 0) {
61
+ return this.el?.getAttribute(name) ?? null;
62
+ }
63
+ this.el?.setAttribute(name, String(value));
64
+ return this;
65
+ }
66
+ removeAttr(name) {
67
+ this.el?.removeAttribute(name);
68
+ return this;
69
+ }
70
+ data(key, value) {
71
+ const dataKey = `data-${key}`;
72
+ if (value === void 0) {
73
+ return this.el?.getAttribute(dataKey) ?? null;
74
+ }
75
+ this.el?.setAttribute(dataKey, String(value));
76
+ return this;
77
+ }
78
+ html(content) {
79
+ if (content === void 0) {
80
+ return this.el?.innerHTML ?? "";
81
+ }
82
+ if (this.el) this.el.innerHTML = content;
83
+ return this;
84
+ }
85
+ text(content) {
86
+ if (content === void 0) {
87
+ return this.el?.textContent ?? "";
88
+ }
89
+ if (this.el) this.el.textContent = content;
90
+ return this;
91
+ }
92
+ val(value) {
93
+ if (!(this.el instanceof HTMLInputElement || this.el instanceof HTMLTextAreaElement || this.el instanceof HTMLSelectElement)) {
94
+ return "";
95
+ }
96
+ if (value === void 0) {
97
+ return this.el.value;
98
+ }
99
+ this.el.value = value;
100
+ return this;
101
+ }
102
+ // Events
103
+ on(event, handler, options) {
104
+ this.el?.addEventListener(event, handler, options);
105
+ return this;
106
+ }
107
+ off(event, handler) {
108
+ this.el?.removeEventListener(event, handler);
109
+ return this;
110
+ }
111
+ once(event, handler) {
112
+ this.el?.addEventListener(event, handler, { once: true });
113
+ return this;
114
+ }
115
+ trigger(event, detail) {
116
+ if (this.el) {
117
+ const customEvent = new CustomEvent(event, { detail, bubbles: true, cancelable: true });
118
+ this.el.dispatchEvent(customEvent);
119
+ }
120
+ return this;
121
+ }
122
+ // DOM manipulation
123
+ append(content) {
124
+ const el = this.el;
125
+ if (!el) return this;
126
+ if (typeof content === "string") {
127
+ el.insertAdjacentHTML("beforeend", content);
128
+ } else if (Array.isArray(content)) {
129
+ content.forEach((node) => el.appendChild(node));
130
+ } else {
131
+ el.appendChild(content);
132
+ }
133
+ return this;
134
+ }
135
+ prepend(content) {
136
+ const el = this.el;
137
+ if (!el) return this;
138
+ if (typeof content === "string") {
139
+ el.insertAdjacentHTML("afterbegin", content);
140
+ } else if (Array.isArray(content)) {
141
+ content.reverse().forEach((node) => el.insertBefore(node, el.firstChild));
142
+ } else {
143
+ el.insertBefore(content, el.firstChild);
144
+ }
145
+ return this;
146
+ }
147
+ before(content) {
148
+ if (!this.el) return this;
149
+ if (typeof content === "string") {
150
+ this.el.insertAdjacentHTML("beforebegin", content);
151
+ } else {
152
+ this.el.parentElement?.insertBefore(content, this.el);
153
+ }
154
+ return this;
155
+ }
156
+ after(content) {
157
+ if (!this.el) return this;
158
+ if (typeof content === "string") {
159
+ this.el.insertAdjacentHTML("afterend", content);
160
+ } else {
161
+ this.el.parentElement?.insertBefore(content, this.el.nextSibling);
162
+ }
163
+ return this;
164
+ }
165
+ remove() {
166
+ this.el?.remove();
167
+ }
168
+ empty() {
169
+ if (this.el) this.el.innerHTML = "";
170
+ return this;
171
+ }
172
+ replace(newContent) {
173
+ if (!this.el) return;
174
+ if (typeof newContent === "string") {
175
+ this.el.outerHTML = newContent;
176
+ } else {
177
+ this.el.parentElement?.replaceChild(newContent, this.el);
178
+ }
179
+ }
180
+ // Traversal
181
+ parent() {
182
+ const el = this.el;
183
+ return new _DOMElementImpl(el ? el.parentElement : null);
184
+ }
185
+ children() {
186
+ const el = this.el;
187
+ return el ? Array.from(el.children).filter((child) => child instanceof HTMLElement) : [];
188
+ }
189
+ siblings() {
190
+ const el = this.el;
191
+ if (!el?.parentElement) return [];
192
+ return Array.from(el.parentElement.children).filter((child) => child !== el);
193
+ }
194
+ find(selector) {
195
+ const el = this.el;
196
+ if (!el) return new _DOMElementImpl(null);
197
+ const found = el.querySelector(selector);
198
+ return new _DOMElementImpl(found instanceof HTMLElement ? found : null);
199
+ }
200
+ findAll(selector) {
201
+ const el = this.el;
202
+ return el ? Array.from(el.querySelectorAll(selector)).filter((node) => node instanceof HTMLElement) : [];
203
+ }
204
+ closest(selector) {
205
+ const el = this.el;
206
+ if (!el) return new _DOMElementImpl(null);
207
+ const found = el.closest(selector);
208
+ return new _DOMElementImpl(found instanceof HTMLElement ? found : null);
209
+ }
210
+ next() {
211
+ const el = this.el?.nextElementSibling;
212
+ return new _DOMElementImpl(el instanceof HTMLElement ? el : null);
213
+ }
214
+ prev() {
215
+ const el = this.el?.previousElementSibling;
216
+ return new _DOMElementImpl(el instanceof HTMLElement ? el : null);
217
+ }
218
+ css(propertyOrProperties, value) {
219
+ const el = this.el;
220
+ if (!el) return typeof propertyOrProperties === "string" ? "" : this;
221
+ if (typeof propertyOrProperties === "string") {
222
+ if (value === void 0) {
223
+ return window.getComputedStyle(el).getPropertyValue(propertyOrProperties);
224
+ }
225
+ el.style.setProperty(propertyOrProperties, String(value));
226
+ return this;
227
+ }
228
+ Object.entries(propertyOrProperties).forEach(([prop, val]) => {
229
+ el.style.setProperty(prop, String(val));
230
+ });
231
+ return this;
232
+ }
233
+ show() {
234
+ if (this.el) this.el.style.display = "";
235
+ return this;
236
+ }
237
+ hide() {
238
+ if (this.el) this.el.style.display = "none";
239
+ return this;
240
+ }
241
+ toggle(force) {
242
+ if (!this.el) return this;
243
+ const shouldShow = force ?? this.isHidden();
244
+ return shouldShow ? this.show() : this.hide();
245
+ }
246
+ // Dimensions
247
+ width() {
248
+ return this.el?.offsetWidth ?? 0;
249
+ }
250
+ height() {
251
+ return this.el?.offsetHeight ?? 0;
252
+ }
253
+ offset() {
254
+ if (!this.el) return { top: 0, left: 0 };
255
+ const rect = this.el.getBoundingClientRect();
256
+ return {
257
+ top: rect.top + window.scrollY,
258
+ left: rect.left + window.scrollX
259
+ };
260
+ }
261
+ scrollTop(value) {
262
+ if (!this.el) return value === void 0 ? 0 : this;
263
+ if (value === void 0) {
264
+ return this.el.scrollTop;
265
+ }
266
+ this.el.scrollTop = value;
267
+ return this;
268
+ }
269
+ // State
270
+ isVisible() {
271
+ if (!this.el) return false;
272
+ return this.el.offsetParent !== null && window.getComputedStyle(this.el).display !== "none";
273
+ }
274
+ isHidden() {
275
+ return !this.isVisible();
276
+ }
277
+ exists() {
278
+ return this.el !== null;
279
+ }
280
+ // Focus
281
+ focus() {
282
+ this.el?.focus();
283
+ return this;
284
+ }
285
+ blur() {
286
+ this.el?.blur();
287
+ return this;
288
+ }
289
+ };
290
+ function $(selector) {
291
+ if (!selector) return new DOMElementImpl(null);
292
+ if (typeof selector === "string") {
293
+ return new DOMElementImpl(safeQuerySelector(selector));
294
+ }
295
+ return new DOMElementImpl(selector);
296
+ }
297
+ function $$(selector) {
298
+ return safeQuerySelectorAll(selector);
299
+ }
300
+ function $id(id) {
301
+ return new DOMElementImpl(document.getElementById(id));
302
+ }
303
+ function create(tag, options) {
304
+ const el = document.createElement(tag);
305
+ if (!options) return el;
306
+ if (options.className) el.className = options.className;
307
+ if (options.classes) {
308
+ const validClasses = options.classes.filter(Boolean);
309
+ if (validClasses.length > 0) {
310
+ el.classList.add(...validClasses);
311
+ }
312
+ }
313
+ if (options.id) el.id = options.id;
314
+ if (options.text !== void 0) el.textContent = options.text;
315
+ if (options.html !== void 0) {
316
+ log(`Setting innerHTML on ${tag} element`);
317
+ el.innerHTML = options.html;
318
+ }
319
+ if (options.attrs) {
320
+ Object.entries(options.attrs).forEach(([key, value]) => {
321
+ el.setAttribute(key, String(value));
322
+ });
323
+ }
324
+ if (options.data) {
325
+ Object.entries(options.data).forEach(([key, value]) => {
326
+ el.setAttribute(`data-${key}`, String(value));
327
+ });
328
+ }
329
+ if (options.styles) {
330
+ Object.entries(options.styles).forEach(([key, value]) => {
331
+ el.style.setProperty(key, String(value));
332
+ });
333
+ }
334
+ if (options.on) {
335
+ Object.entries(options.on).forEach(([event, handler]) => {
336
+ el.addEventListener(event, handler);
337
+ });
338
+ }
339
+ if (options.children) {
340
+ options.children.forEach((child) => {
341
+ if (typeof child === "string") {
342
+ el.appendChild(document.createTextNode(child));
343
+ return;
344
+ }
345
+ el.appendChild(child);
346
+ });
347
+ }
348
+ return el;
349
+ }
350
+ function fragment(html) {
351
+ const template = document.createElement("template");
352
+ template.innerHTML = html.trim();
353
+ return template.content;
354
+ }
355
+ function delegate(event, selector, handler, root = document) {
356
+ const delegatedHandler = (e) => {
357
+ const origin = e.target;
358
+ if (!(origin instanceof Element)) {
359
+ return;
360
+ }
361
+ const target = origin.closest(selector);
362
+ if (target instanceof HTMLElement) {
363
+ handler(e, target);
364
+ }
365
+ };
366
+ root.addEventListener(event, delegatedHandler);
367
+ log(`Delegated ${event} on ${selector}`);
368
+ return () => {
369
+ root.removeEventListener(event, delegatedHandler);
370
+ log(`Removed delegation for ${event} on ${selector}`);
371
+ };
372
+ }
373
+ function ready(callback) {
374
+ if (document.readyState === "loading") {
375
+ document.addEventListener("DOMContentLoaded", callback);
376
+ } else {
377
+ callback();
378
+ }
379
+ }
380
+ function clone(element, deep = true) {
381
+ return element.cloneNode(deep);
382
+ }
383
+ function matches(element, selector) {
384
+ return element.matches(selector);
385
+ }
386
+ var dataStore = /* @__PURE__ */ new WeakMap();
387
+ function elementData(element, key, value) {
388
+ if (value === void 0) {
389
+ const store2 = dataStore.get(element);
390
+ return store2?.[key];
391
+ }
392
+ let store = dataStore.get(element);
393
+ if (!store) {
394
+ store = {};
395
+ dataStore.set(element, store);
396
+ }
397
+ store[key] = value;
398
+ }
399
+ function serializeForm(form) {
400
+ const formData = new FormData(form);
401
+ const data = {};
402
+ formData.forEach((value, key) => {
403
+ data[key] = value instanceof File ? value.name : value;
404
+ });
405
+ return data;
406
+ }
407
+ var ARRAY_KEY = /^([^\[]+)\[([^\]]*)\]$/;
408
+ function getFormValues(form) {
409
+ const formData = new FormData(form);
410
+ const result = {};
411
+ formData.forEach((value, key) => {
412
+ const arrayMatch = ARRAY_KEY.exec(key);
413
+ if (arrayMatch) {
414
+ const [, name, index] = arrayMatch;
415
+ const existing = result[name];
416
+ const list = Array.isArray(existing) ? existing : [];
417
+ if (!Array.isArray(existing)) {
418
+ result[name] = list;
419
+ }
420
+ if (index) {
421
+ list[Number.parseInt(index, 10)] = value;
422
+ } else {
423
+ list.push(value);
424
+ }
425
+ return;
426
+ }
427
+ result[key] = value;
428
+ });
429
+ return result;
430
+ }
431
+ function debounce(func, wait) {
432
+ let timeout = null;
433
+ return function(...args) {
434
+ if (timeout) clearTimeout(timeout);
435
+ timeout = setTimeout(() => func.apply(this, args), wait);
436
+ };
437
+ }
438
+ function throttle(func, limit) {
439
+ let inThrottle = false;
440
+ return function(...args) {
441
+ if (!inThrottle) {
442
+ func.apply(this, args);
443
+ inThrottle = true;
444
+ setTimeout(() => {
445
+ inThrottle = false;
446
+ }, limit);
447
+ }
448
+ };
449
+ }
450
+ function waitForElement(selector, timeout = 5e3) {
451
+ return new Promise((resolve, reject) => {
452
+ const element = document.querySelector(selector);
453
+ if (element instanceof HTMLElement) {
454
+ resolve(element);
455
+ return;
456
+ }
457
+ const observer = new MutationObserver(() => {
458
+ const observed = document.querySelector(selector);
459
+ if (observed instanceof HTMLElement) {
460
+ observer.disconnect();
461
+ clearTimeout(timeoutId);
462
+ resolve(observed);
463
+ }
464
+ });
465
+ observer.observe(document.body, {
466
+ childList: true,
467
+ subtree: true
468
+ });
469
+ const timeoutId = setTimeout(() => {
470
+ observer.disconnect();
471
+ reject(new Error(`Element "${selector}" not found within ${String(timeout)}ms`));
472
+ }, timeout);
473
+ });
474
+ }
475
+ function onVisible(element, callback, options) {
476
+ const observer = new IntersectionObserver((entries) => {
477
+ entries.forEach((entry) => {
478
+ if (entry.isIntersecting) {
479
+ callback(entry);
480
+ }
481
+ });
482
+ }, options);
483
+ observer.observe(element);
484
+ return () => {
485
+ observer.disconnect();
486
+ };
487
+ }
488
+ function animate(element, properties, duration = 300, easing = "ease") {
489
+ return new Promise((resolve) => {
490
+ const originalTransition = element.style.transition;
491
+ element.style.transition = `all ${String(duration)}ms ${easing}`;
492
+ Object.entries(properties).forEach(([prop, value]) => {
493
+ element.style.setProperty(prop, value);
494
+ });
495
+ setTimeout(() => {
496
+ element.style.transition = originalTransition;
497
+ resolve();
498
+ }, duration);
499
+ });
500
+ }
501
+ function fadeIn(element, duration = 300) {
502
+ element.style.opacity = "0";
503
+ element.style.display = "";
504
+ return animate(element, { opacity: "1" }, duration);
505
+ }
506
+ function fadeOut(element, duration = 300) {
507
+ return animate(element, { opacity: "0" }, duration).then(() => {
508
+ element.style.display = "none";
509
+ });
510
+ }
511
+ function slideDown(element, duration = 300) {
512
+ element.style.display = "block";
513
+ const height = element.scrollHeight;
514
+ element.style.height = "0";
515
+ element.style.overflow = "hidden";
516
+ return animate(element, { height: `${String(height)}px` }, duration).then(() => {
517
+ element.style.height = "";
518
+ element.style.overflow = "";
519
+ });
520
+ }
521
+ function slideUp(element, duration = 300) {
522
+ const height = element.scrollHeight;
523
+ element.style.height = `${String(height)}px`;
524
+ element.style.overflow = "hidden";
525
+ return animate(element, { height: "0" }, duration).then(() => {
526
+ element.style.display = "none";
527
+ element.style.height = "";
528
+ element.style.overflow = "";
529
+ });
530
+ }
531
+ var DOMApi = {
532
+ // Version
533
+ version: "2.0.0",
534
+ // Core selectors
535
+ $,
536
+ $$,
537
+ $id,
538
+ // Element creation
539
+ create,
540
+ fragment,
541
+ // Event handling
542
+ delegate,
543
+ ready,
544
+ // Utilities
545
+ clone,
546
+ matches,
547
+ elementData,
548
+ // Form helpers
549
+ serializeForm,
550
+ getFormValues,
551
+ // Performance
552
+ debounce,
553
+ throttle,
554
+ // Async utilities
555
+ waitForElement,
556
+ onVisible,
557
+ // Animations
558
+ animate,
559
+ fadeIn,
560
+ fadeOut,
561
+ slideDown,
562
+ slideUp,
563
+ // Configuration
564
+ setDebugMode
565
+ };
566
+ var dom_default = DOMApi;
567
+
568
+ exports.$ = $;
569
+ exports.$$ = $$;
570
+ exports.$id = $id;
571
+ exports.animate = animate;
572
+ exports.clone = clone;
573
+ exports.create = create;
574
+ exports.debounce = debounce;
575
+ exports.delegate = delegate;
576
+ exports.dom_default = dom_default;
577
+ exports.elementData = elementData;
578
+ exports.fadeIn = fadeIn;
579
+ exports.fadeOut = fadeOut;
580
+ exports.fragment = fragment;
581
+ exports.getFormValues = getFormValues;
582
+ exports.matches = matches;
583
+ exports.onVisible = onVisible;
584
+ exports.ready = ready;
585
+ exports.serializeForm = serializeForm;
586
+ exports.setDebugMode = setDebugMode;
587
+ exports.slideDown = slideDown;
588
+ exports.slideUp = slideUp;
589
+ exports.throttle = throttle;
590
+ exports.waitForElement = waitForElement;
591
+ //# sourceMappingURL=chunk-SZQNIMYI.cjs.map
592
+ //# sourceMappingURL=chunk-SZQNIMYI.cjs.map