sigpro 1.1.20 → 1.2.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sigpro.js CHANGED
@@ -1,480 +1 @@
1
- (() => {
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- function __accessProp(key) {
7
- return this[key];
8
- }
9
- var __toCommonJS = (from) => {
10
- var entry = (__moduleCache ??= new WeakMap).get(from), desc;
11
- if (entry)
12
- return entry;
13
- entry = __defProp({}, "__esModule", { value: true });
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (var key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(entry, key))
17
- __defProp(entry, key, {
18
- get: __accessProp.bind(from, key),
19
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
- });
21
- }
22
- __moduleCache.set(from, entry);
23
- return entry;
24
- };
25
- var __moduleCache;
26
- var __returnValue = (v) => v;
27
- function __exportSetter(name, newValue) {
28
- this[name] = __returnValue.bind(null, newValue);
29
- }
30
- var __export = (target, all) => {
31
- for (var name in all)
32
- __defProp(target, name, {
33
- get: all[name],
34
- enumerable: true,
35
- configurable: true,
36
- set: __exportSetter.bind(all, name)
37
- });
38
- };
39
-
40
- // index.js
41
- var exports_sigpro = {};
42
- __export(exports_sigpro, {
43
- Fragment: () => Fragment,
44
- $watch: () => $watch,
45
- $router: () => $router,
46
- $mount: () => $mount,
47
- $if: () => $if,
48
- $html: () => $html,
49
- $for: () => $for,
50
- $: () => $
51
- });
52
-
53
- // sigpro/index.js
54
- var activeEffect = null;
55
- var currentOwner = null;
56
- var effectQueue = new Set;
57
- var isFlushing = false;
58
- var MOUNTED_NODES = new WeakMap;
59
- var flush = () => {
60
- if (isFlushing)
61
- return;
62
- isFlushing = true;
63
- while (effectQueue.size > 0) {
64
- const sorted = Array.from(effectQueue).sort((a, b) => (a.depth || 0) - (b.depth || 0));
65
- effectQueue.clear();
66
- for (const eff of sorted)
67
- if (!eff._deleted)
68
- eff();
69
- }
70
- isFlushing = false;
71
- };
72
- var track = (subs) => {
73
- if (activeEffect && !activeEffect._deleted) {
74
- subs.add(activeEffect);
75
- activeEffect._deps.add(subs);
76
- }
77
- };
78
- var trigger = (subs) => {
79
- for (const eff of subs) {
80
- if (eff === activeEffect || eff._deleted)
81
- continue;
82
- if (eff._isComputed) {
83
- eff.markDirty();
84
- if (eff._subs)
85
- trigger(eff._subs);
86
- } else {
87
- effectQueue.add(eff);
88
- }
89
- }
90
- if (!isFlushing)
91
- queueMicrotask(flush);
92
- };
93
- var sweep = (node) => {
94
- if (node._cleanups) {
95
- node._cleanups.forEach((f) => f());
96
- node._cleanups.clear();
97
- }
98
- node.childNodes?.forEach(sweep);
99
- };
100
- var _view = (fn) => {
101
- const cleanups = new Set;
102
- const prev = currentOwner;
103
- const container = document.createElement("div");
104
- container.style.display = "contents";
105
- currentOwner = { cleanups };
106
- try {
107
- const res = fn({ onCleanup: (f) => cleanups.add(f) });
108
- const process = (n) => {
109
- if (!n)
110
- return;
111
- if (n._isRuntime) {
112
- cleanups.add(n.destroy);
113
- container.appendChild(n.container);
114
- } else if (Array.isArray(n))
115
- n.forEach(process);
116
- else
117
- container.appendChild(n instanceof Node ? n : document.createTextNode(String(n)));
118
- };
119
- process(res);
120
- } finally {
121
- currentOwner = prev;
122
- }
123
- return {
124
- _isRuntime: true,
125
- container,
126
- destroy: () => {
127
- cleanups.forEach((f) => f());
128
- sweep(container);
129
- container.remove();
130
- }
131
- };
132
- };
133
- var $ = (initial, key = null) => {
134
- if (typeof initial === "function") {
135
- const subs2 = new Set;
136
- let cached, dirty = true;
137
- const effect = () => {
138
- if (effect._deleted)
139
- return;
140
- effect._deps.forEach((s) => s.delete(effect));
141
- effect._deps.clear();
142
- const prev = activeEffect;
143
- activeEffect = effect;
144
- try {
145
- const val = initial();
146
- if (!Object.is(cached, val) || dirty) {
147
- cached = val;
148
- dirty = false;
149
- trigger(subs2);
150
- }
151
- } finally {
152
- activeEffect = prev;
153
- }
154
- };
155
- effect._deps = new Set;
156
- effect._isComputed = true;
157
- effect._subs = subs2;
158
- effect._deleted = false;
159
- effect.markDirty = () => dirty = true;
160
- effect.stop = () => {
161
- effect._deleted = true;
162
- effect._deps.forEach((s) => s.delete(effect));
163
- subs2.clear();
164
- };
165
- if (currentOwner)
166
- currentOwner.cleanups.add(effect.stop);
167
- return () => {
168
- if (dirty)
169
- effect();
170
- track(subs2);
171
- return cached;
172
- };
173
- }
174
- let value = initial;
175
- if (key) {
176
- try {
177
- const saved = localStorage.getItem(key);
178
- if (saved !== null)
179
- value = JSON.parse(saved);
180
- } catch (e) {
181
- console.warn("SigPro: LocalStorage locked", e);
182
- }
183
- }
184
- const subs = new Set;
185
- return (...args) => {
186
- if (args.length) {
187
- const next = typeof args[0] === "function" ? args[0](value) : args[0];
188
- if (!Object.is(value, next)) {
189
- value = next;
190
- if (key)
191
- localStorage.setItem(key, JSON.stringify(value));
192
- trigger(subs);
193
- }
194
- }
195
- track(subs);
196
- return value;
197
- };
198
- };
199
- var $watch = (target, fn) => {
200
- const isExplicit = Array.isArray(target);
201
- const callback = isExplicit ? fn : target;
202
- const depsInput = isExplicit ? target : null;
203
- if (typeof callback !== "function")
204
- return () => {};
205
- const owner = currentOwner;
206
- const runner = () => {
207
- if (runner._deleted)
208
- return;
209
- runner._deps.forEach((s) => s.delete(runner));
210
- runner._deps.clear();
211
- runner._cleanups.forEach((c) => c());
212
- runner._cleanups.clear();
213
- const prevEffect = activeEffect;
214
- const prevOwner = currentOwner;
215
- activeEffect = runner;
216
- currentOwner = { cleanups: runner._cleanups };
217
- runner.depth = prevEffect ? prevEffect.depth + 1 : 0;
218
- try {
219
- if (isExplicit) {
220
- activeEffect = null;
221
- callback();
222
- activeEffect = runner;
223
- depsInput.forEach((d) => typeof d === "function" && d());
224
- } else {
225
- callback();
226
- }
227
- } finally {
228
- activeEffect = prevEffect;
229
- currentOwner = prevOwner;
230
- }
231
- };
232
- runner._deps = new Set;
233
- runner._cleanups = new Set;
234
- runner._deleted = false;
235
- runner.stop = () => {
236
- if (runner._deleted)
237
- return;
238
- runner._deleted = true;
239
- effectQueue.delete(runner);
240
- runner._deps.forEach((s) => s.delete(runner));
241
- runner._cleanups.forEach((c) => c());
242
- if (owner)
243
- owner.cleanups.delete(runner.stop);
244
- };
245
- if (owner)
246
- owner.cleanups.add(runner.stop);
247
- runner();
248
- return runner.stop;
249
- };
250
- var $html = (tag, props = {}, content = []) => {
251
- if (props instanceof Node || Array.isArray(props) || typeof props !== "object") {
252
- content = props;
253
- props = {};
254
- }
255
- const svgTags = ["svg", "path", "circle", "rect", "line", "polyline", "polygon", "g", "defs", "text", "tspan", "use"];
256
- const isSVG = svgTags.includes(tag);
257
- const el = isSVG ? document.createElementNS("http://www.w3.org/2000/svg", tag) : document.createElement(tag);
258
- const _sanitize = (key, val) => (key === "src" || key === "href") && String(val).toLowerCase().includes("javascript:") ? "#" : val;
259
- el._cleanups = new Set;
260
- const boolAttrs = ["disabled", "checked", "required", "readonly", "selected", "multiple", "autofocus"];
261
- for (let [key, val] of Object.entries(props)) {
262
- if (key === "ref") {
263
- typeof val === "function" ? val(el) : val.current = el;
264
- continue;
265
- }
266
- const isSignal = typeof val === "function", isInput = ["INPUT", "TEXTAREA", "SELECT"].includes(el.tagName), isBindAttr = key === "value" || key === "checked";
267
- if (isInput && isBindAttr && isSignal) {
268
- el._cleanups.add($watch(() => {
269
- const currentVal = val();
270
- if (el[key] !== currentVal)
271
- el[key] = currentVal;
272
- }));
273
- const eventName = key === "checked" ? "change" : "input", handler = (event) => val(event.target[key]);
274
- el.addEventListener(eventName, handler);
275
- el._cleanups.add(() => el.removeEventListener(eventName, handler));
276
- } else if (key.startsWith("on")) {
277
- const eventName = key.slice(2).toLowerCase().split(".")[0], handler = (event) => val(event);
278
- el.addEventListener(eventName, handler);
279
- el._cleanups.add(() => el.removeEventListener(eventName, handler));
280
- } else if (isSignal) {
281
- el._cleanups.add($watch(() => {
282
- const currentVal = _sanitize(key, val());
283
- if (key === "class") {
284
- el.className = currentVal || "";
285
- } else if (boolAttrs.includes(key)) {
286
- if (currentVal) {
287
- el.setAttribute(key, "");
288
- el[key] = true;
289
- } else {
290
- el.removeAttribute(key);
291
- el[key] = false;
292
- }
293
- } else {
294
- if (currentVal == null) {
295
- el.removeAttribute(key);
296
- } else if (isSVG && typeof currentVal === "number") {
297
- el.setAttribute(key, currentVal);
298
- } else {
299
- el.setAttribute(key, currentVal);
300
- }
301
- }
302
- }));
303
- } else {
304
- if (boolAttrs.includes(key)) {
305
- if (val) {
306
- el.setAttribute(key, "");
307
- el[key] = true;
308
- } else {
309
- el.removeAttribute(key);
310
- el[key] = false;
311
- }
312
- } else {
313
- el.setAttribute(key, _sanitize(key, val));
314
- }
315
- }
316
- }
317
- const append = (child) => {
318
- if (Array.isArray(child))
319
- return child.forEach(append);
320
- if (child instanceof Node) {
321
- el.appendChild(child);
322
- } else if (typeof child === "function") {
323
- const marker = document.createTextNode("");
324
- el.appendChild(marker);
325
- let nodes = [];
326
- el._cleanups.add($watch(() => {
327
- const res = child(), next = (Array.isArray(res) ? res : [res]).map((i) => i?._isRuntime ? i.container : i instanceof Node ? i : document.createTextNode(i ?? ""));
328
- nodes.forEach((n) => {
329
- sweep?.(n);
330
- n.remove();
331
- });
332
- next.forEach((n) => marker.parentNode?.insertBefore(n, marker));
333
- nodes = next;
334
- }));
335
- } else
336
- el.appendChild(document.createTextNode(child ?? ""));
337
- };
338
- append(content);
339
- return el;
340
- };
341
- var $if = (condition, thenVal, otherwiseVal = null, transition = null) => {
342
- const marker = document.createTextNode("");
343
- const container = $html("div", { style: "display:contents" }, [marker]);
344
- let current = null, last = null;
345
- $watch(() => {
346
- const state = !!(typeof condition === "function" ? condition() : condition);
347
- if (state === last)
348
- return;
349
- last = state;
350
- if (current && !state && transition?.out) {
351
- transition.out(current.container, () => {
352
- current.destroy();
353
- current = null;
354
- });
355
- } else {
356
- if (current)
357
- current.destroy();
358
- current = null;
359
- }
360
- if (state || !state && otherwiseVal) {
361
- const branch = state ? thenVal : otherwiseVal;
362
- if (branch) {
363
- current = _view(() => typeof branch === "function" ? branch() : branch);
364
- container.insertBefore(current.container, marker);
365
- if (state && transition?.in)
366
- transition.in(current.container);
367
- }
368
- }
369
- });
370
- return container;
371
- };
372
- $if.not = (condition, thenVal, otherwiseVal) => $if(() => !(typeof condition === "function" ? condition() : condition), thenVal, otherwiseVal);
373
- var $for = (source, render, keyFn, tag = "div", props = { style: "display:contents" }) => {
374
- const marker = document.createTextNode("");
375
- const container = $html(tag, props, [marker]);
376
- let cache = new Map;
377
- $watch(() => {
378
- const items = (typeof source === "function" ? source() : source) || [];
379
- const newCache = new Map;
380
- const newOrder = [];
381
- for (let i = 0;i < items.length; i++) {
382
- const item = items[i];
383
- const key = keyFn ? keyFn(item, i) : i;
384
- let run = cache.get(key);
385
- if (!run) {
386
- run = _view(() => render(item, i));
387
- } else {
388
- cache.delete(key);
389
- }
390
- newCache.set(key, run);
391
- newOrder.push(key);
392
- }
393
- cache.forEach((run) => {
394
- run.destroy();
395
- run.container.remove();
396
- });
397
- let anchor = marker;
398
- for (let i = newOrder.length - 1;i >= 0; i--) {
399
- const run = newCache.get(newOrder[i]);
400
- if (run.container.nextSibling !== anchor) {
401
- container.insertBefore(run.container, anchor);
402
- }
403
- anchor = run.container;
404
- }
405
- cache = newCache;
406
- });
407
- return container;
408
- };
409
- var $router = (routes) => {
410
- const sPath = $(window.location.hash.replace(/^#/, "") || "/");
411
- window.addEventListener("hashchange", () => sPath(window.location.hash.replace(/^#/, "") || "/"));
412
- const outlet = $html("div", { class: "router-outlet" });
413
- let current = null;
414
- $watch([sPath], async () => {
415
- const path = sPath();
416
- const route = routes.find((r) => {
417
- const rp = r.path.split("/").filter(Boolean), pp = path.split("/").filter(Boolean);
418
- return rp.length === pp.length && rp.every((p, i) => p.startsWith(":") || p === pp[i]);
419
- }) || routes.find((r) => r.path === "*");
420
- if (route) {
421
- let comp = route.component;
422
- if (typeof comp === "function" && comp.toString().includes("import")) {
423
- comp = (await comp()).default || await comp();
424
- }
425
- const params = {};
426
- route.path.split("/").filter(Boolean).forEach((p, i) => {
427
- if (p.startsWith(":"))
428
- params[p.slice(1)] = path.split("/").filter(Boolean)[i];
429
- });
430
- if (current)
431
- current.destroy();
432
- if ($router.params)
433
- $router.params(params);
434
- current = _view(() => {
435
- try {
436
- return typeof comp === "function" ? comp(params) : comp;
437
- } catch (e) {
438
- return $html("div", { class: "p-4 text-error" }, "Error loading view");
439
- }
440
- });
441
- outlet.appendChild(current.container);
442
- }
443
- });
444
- return outlet;
445
- };
446
- $router.params = $({});
447
- $router.to = (path) => window.location.hash = path.replace(/^#?\/?/, "#/");
448
- $router.back = () => window.history.back();
449
- $router.path = () => window.location.hash.replace(/^#/, "") || "/";
450
- var $mount = (component, target) => {
451
- const el = typeof target === "string" ? document.querySelector(target) : target;
452
- if (!el)
453
- return;
454
- if (MOUNTED_NODES.has(el))
455
- MOUNTED_NODES.get(el).destroy();
456
- const instance = _view(typeof component === "function" ? component : () => component);
457
- el.replaceChildren(instance.container);
458
- MOUNTED_NODES.set(el, instance);
459
- return instance;
460
- };
461
- var Fragment = ({ children }) => children;
462
- var SigProCore = { $, $watch, $html, $if, $for, $router, $mount, Fragment };
463
- if (typeof window !== "undefined") {
464
- const install = (registry) => {
465
- Object.keys(registry).forEach((key) => {
466
- window[key] = registry[key];
467
- });
468
- const tags = `div span p h1 h2 h3 h4 h5 h6 br hr section article aside nav main header footer address ul ol li dl dt dd a em strong small i b u mark time sub sup pre code blockquote details summary dialog form label input textarea select button option fieldset legend table thead tbody tfoot tr th td caption img video audio canvas svg iframe picture source progress meter`.split(/\s+/);
469
- tags.forEach((tagName) => {
470
- const helperName = tagName.charAt(0).toUpperCase() + tagName.slice(1);
471
- if (!(helperName in window)) {
472
- window[helperName] = (props, content) => $html(tagName, props, content);
473
- }
474
- });
475
- window.Fragment = Fragment;
476
- window.SigPro = Object.freeze(registry);
477
- };
478
- install(SigProCore);
479
- }
480
- })();
1
+ var m=(e)=>typeof e=="function",q=(e)=>e&&typeof e=="object",g=Array.isArray,N=typeof document<"u"?document:null,w=(e)=>N.createTextNode(e==null?"":String(e)),G=(e)=>e?._rt?e._cnt:e instanceof Node?e:w(e),B=(e)=>e.children,A=(e)=>m(e)?e():e,d=null,_=null,E=0,M=0,C=new Set,L=new WeakMap,D="http://www.w3.org/2000/svg",I="http://www.w3.org/1999/xlink",R=new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(",")),z=new Set(["src","href","formaction","action","background","code","archive"]),k=(e)=>{if(e)e.forEach((r)=>r()),e.clear()},b=(e)=>{if(!e||e._x)return;e._x=1;let r=[e],n;while(n=r.pop()){if(k(n._c),n._ch)n._ch.forEach((i)=>r.push(i)),n._ch.clear();if(n._d)n._d.forEach((i)=>i.delete(n)),n._d.clear()}},S=(e)=>_&&(_._c||=new Set).add(e),F=(e)=>{let r=d;d=null;try{return e()}finally{d=r}},v=(e,r=0)=>{let n=()=>{if(n._x)return;if(n._d)n._d.forEach((a)=>a.delete(n));k(n._c);let i=d,l=_;d=_=n;try{return n._res=e()}catch(a){console.error("[SigPro]",a)}finally{d=i,_=l}};if(n._d=n._c=n._ch=null,n._x=0,n._iC=r,n._dp=d?d._dp+1:0,n._m=[],n._p=_,_)(_._ch||=new Set).add(n);return n},W=()=>{if(E)return;E=1;let e=[...C].sort((r,n)=>r._dp-n._dp);C.clear();for(let r of e)if(!r._x)r();E=0},J=(e)=>{M++;try{return e()}finally{if(!--M&&C.size&&!E)W()}},x=(e,r=0)=>{if(!r&&d&&!d._x)e.add(d),(d._d||=new Set).add(e);else if(r&&e.size){let n=0;for(let i of e){if(i===d||i._x)continue;if(i._iC){if(i._dt=1,i._sb)x(i._sb,1)}else C.add(i),n=1}if(n&&!E&&!M)queueMicrotask(W)}},V=(e,r=null)=>{let n=new Set;if(m(e)){let i,l=()=>{if(l._dt){let a=d;d=l;try{let t=e();if(!Object.is(i,t))i=t,x(n,1)}finally{d=a}l._dt=0}return x(n),i};return l._iC=l._dt=1,l._sb=n,l._d=null,l._x=0,l}if(r)try{e=JSON.parse(localStorage.getItem(r))??e}catch(i){}return(...i)=>{if(i.length){let l=m(i[0])?i[0](e):i[0];if(!Object.is(e,l)){if(e=l,r)localStorage.setItem(r,JSON.stringify(e));x(n,1)}}return x(n),e}},P=(e,r)=>{let n=v(r?()=>{let i=g(e)?e.map((l)=>l()):e();F(()=>r(i))}:e);return n(),()=>b(n)},U=(e)=>{if(!e)return;if(k(e._c),e._oE)b(e._oE);if(e.childNodes)e.childNodes.forEach(U)},j=(e,r)=>r==null||r===!1?null:(z.has(e)||e.startsWith("on"))&&/^\s*(javascript|data|vbscript):/i.test(String(r))?"#":r,O=(e,r={},n=[])=>{if(r instanceof Node||g(r)||!q(r))n=r,r={};if(m(e)){let t=v(()=>t._res=e(r,{children:n,emit:(o,...f)=>r[`on${o[0].toUpperCase()}${o.slice(1)}`]?.(...f)}));if(t(),t._res==null)return null;let s=t._res instanceof Node||g(t._res)&&t._res.every((o)=>o instanceof Node)?t._res:w(t._res),c=(o)=>{if(q(o)&&!o._rt)o._m=t._m||[],o._c=t._c||new Set,o._oE=t};return g(s)?s.forEach(c):c(s),s}let i=R.has(e),l=i?N.createElementNS(D,e):N.createElement(e);l._c=new Set;for(let t in r){let s=r[t];if(t==="ref"){m(s)?s(l):s.current=l;continue}if(i&&t.startsWith("xlink:")){let c=j(t.slice(6),s);c==null?l.removeAttributeNS(I,t.slice(6)):l.setAttributeNS(I,t.slice(6),c);continue}if(t.startsWith("on")){let c=t.slice(2).toLowerCase();l.addEventListener(c,s);let o=()=>l.removeEventListener(c,s);l._c.add(o),S(o)}else if(m(s)){let c=v(()=>{let o=j(t,s());if(t==="class")l.className=o||"";else if(o==null)l.removeAttribute(t);else if(t==="style"&&typeof o=="string")l.setAttribute("style",o);else if(t in l&&!i)l[t]=o;else l.setAttribute(t,o===!0?"":o)});if(c(),l._c.add(()=>b(c)),S(()=>b(c)),/^(INPUT|TEXTAREA|SELECT)$/.test(l.tagName)&&(t==="value"||t==="checked"))l.addEventListener(t==="checked"?"change":"input",(o)=>s(o.target[t]))}else{let c=j(t,s);if(c!=null)if(t==="style"&&typeof c=="string")l.setAttribute("style",c);else if(t in l&&!i)l[t]=c;else l.setAttribute(t,c===!0?"":c)}}let a=(t)=>{if(g(t))return t.forEach(a);if(m(t)){let s=w(""),c=[];l.appendChild(s);let o=v(()=>{let f=t(),h=(g(f)?f:[f]).map(G),y=s;c.forEach((u)=>{if(u._rt?u._del():U(u),u.parentNode)u.remove()});for(let u=h.length-1;u>=0;u--){let p=h[u];if(p.parentNode!==y.parentNode)y.parentNode?.insertBefore(p,y);if(p._m)p._m.forEach(($)=>$());y=p}c=h});o(),l._c.add(()=>b(o)),S(()=>b(o))}else{let s=G(t);if(l.appendChild(s),s._m)s._m.forEach((c)=>c())}};return a(n),l},T=(e)=>{let r=new Set,n=_,i=d,l=N.createElement("div");l.style.display="contents",l.setAttribute("role","presentation"),_={_c:r},d=null;let a=(t)=>{if(!t)return;if(t._rt)r.add(t._del),l.appendChild(t._cnt);else if(g(t))t.forEach(a);else l.appendChild(t instanceof Node?t:w(t))};try{a(e({onCleanup:(t)=>r.add(t)}))}finally{_=n,d=i}return{_rt:1,_cnt:l,_del:()=>{k(r),U(l),l.remove()}}},X=(e,r,n=null)=>{let i=w(""),l=O("div",{style:"display:contents"},[i]),a;return P(()=>!!A(e),(t)=>{if(a)a._del(),a=null;let s=t?r:n;if(s)a=T(()=>A(s)),l.insertBefore(a._cnt,i)}),S(()=>a?._del()),l},K=(e,r,n)=>{let i=w(""),l=O("div",{style:"display:contents"},[i]),a=new Map;return P(()=>A(e)||[],(t)=>{let s=new Map,c=[];for(let f=0,h=(t||[]).length;f<h;f++){let y=t[f],u=n?y?.[n]??f:y?.id??f,p=a.get(u);if(!p)p=T(()=>r(y,f));else a.delete(u);s.set(u,p),c.push(p)}a.forEach((f)=>f._del());let o=i;for(let f=c.length-1;f>=0;f--){let h=c[f]._cnt;if(h.nextSibling!==o)l.insertBefore(h,o);o=h}a=s}),l},Q=(e,r)=>{let n=typeof r=="string"?N.querySelector(r):r;if(!n)return;if(L.has(n))L.get(n)._del();let i=T(m(e)?e:()=>e);return n.replaceChildren(i._cnt),L.set(n,i),i},H="a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup svg table tbody td template textarea tfoot th thead time tr u ul video",Y={$:V,watch:P,batch:J,h:O,Fragment:B,render:T,mount:Q,when:X,each:K,onUnmount:S,val:A,isA:g,isF:m,isO:q};if(typeof window<"u")window.SigPro=Y,H.split(" ").forEach((e)=>{window[e]=(r,n)=>O(e,r,n)});export{P as watch,A as val,T as render,S as onUnmount,Q as mount,q as isO,m as isF,g as isA,O as h,K as each,J as batch,Y as SigPro,B as Fragment,V as $};