New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

axii

Package Overview
Dependencies
Maintainers
0
Versions
291
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axii - npm Package Compare versions

Comparing version 2.6.69 to 2.6.70

1317

dist/axii.js

@@ -1,12 +0,12 @@

import { isAtom as q, atom as Q, RxList as _, RxSet as rt, RxMap as nt, reactive as xt, ReactiveEffect as Tt, computed as pt, destroyComputed as mt, autorun as yt, Notifier as st, isReactive as vt, TrackOpTypes as it, TriggerOpTypes as ot } from "data0";
import { isAtom as q, atom as Q, RxList as _, RxSet as re, RxMap as ne, reactive as Pe, ReactiveEffect as Te, computed as pe, destroyComputed as me, autorun as ye, Notifier as se, isReactive as ve, TrackOpTypes as ie, TriggerOpTypes as oe } from "data0";
export * from "data0";
function Rt(e, t) {
for (let r in e)
t(e[r], r);
function Re(t, e) {
for (let r in t)
e(t[r], r);
}
function gt(e, t, r = !1) {
if (e.parentElement !== t.parentElement)
function ge(t, e, r = !1) {
if (t.parentElement !== e.parentElement)
throw new Error("placeholder and element parentElement not same");
let n = e;
for (; n !== t; ) {
let n = t;
for (; n !== e; ) {
const s = n;

@@ -16,23 +16,23 @@ if (n = s.nextSibling, !n) throw new Error("can not find nextSibling");

}
r && t.remove();
r && e.remove();
}
const G = (e) => (e == null ? void 0 : e.constructor) === Object;
function b(e, t) {
if (!e)
throw new Error(t);
const G = (t) => (t == null ? void 0 : t.constructor) === Object;
function C(t, e) {
if (!t)
throw new Error(e);
}
function z(e, t) {
if (e === t) return !0;
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
const r = Object.keys(e), n = Object.keys(t);
function B(t, e) {
if (t === e) return !0;
if (typeof t != "object" || typeof e != "object" || t === null || e === null) return !1;
const r = Object.keys(t), n = Object.keys(e);
if (r.length !== n.length) return !1;
for (let s of r)
if (e[s] !== t[s]) return !1;
if (t[s] !== e[s]) return !1;
return !0;
}
function Lt(e) {
return e.length ? new Promise((t) => {
function Le(t) {
return t.length ? new Promise((e) => {
let r = 0;
const n = (s) => {
r < e.length ? (e[r++](s), requestAnimationFrame(n)) : t(!0);
r < t.length ? (t[r++](s), requestAnimationFrame(n)) : e(!0);
};

@@ -42,17 +42,17 @@ requestAnimationFrame(n);

}
const $t = /^(width|height|top|left|right|bottom|margin|padding|border|fontSize|maxWidth|maxHeight|minHeight|minWidth|gap|flexBasis|columnGap|rowGap)/;
let Et = "px";
function Ve(e) {
Et = e;
const $e = /^(width|height|top|left|right|bottom|margin|padding|border|fontSize|maxWidth|maxHeight|minHeight|minWidth|gap|flexBasis|columnGap|rowGap)/;
let Ee = "px";
function Vt(t) {
Ee = t;
}
function kt(e) {
return typeof e == "string" ? e : `${e}${Et}`;
function ke(t) {
return typeof t == "string" ? t : `${t}${Ee}`;
}
const Ht = /^(boxShadow|textShadow|transition|animation|backgroundImage)/;
function tt(e, t) {
return t === void 0 ? "" : Array.isArray(t) ? Ht.test(e) ? t.join(",") : t.map((r) => tt(e, r)).join(" ") : typeof t == "number" && $t.test(e) ? kt(t) : t.toString();
const He = /^(boxShadow|textShadow|transition|animation|backgroundImage)/;
function ee(t, e) {
return e === void 0 ? "" : Array.isArray(e) ? He.test(t) ? e.join(",") : e.map((r) => ee(t, r)).join(" ") : typeof e == "number" && $e.test(t) ? ke(e) : e.toString();
}
function Ot(e, t, r) {
function Oe(t, e, r) {
try {
e[t] = r;
t[e] = r;
} catch (n) {

@@ -62,41 +62,41 @@ console.error(n);

}
function St(e) {
const t = this._listeners[e.type];
return Array.isArray(t) ? t.forEach((r) => r == null ? void 0 : r(e, ...this.listenerBoundArgs || [])) : t == null ? void 0 : t(e, ...this.listenerBoundArgs || []);
function Se(t) {
const e = this._listeners[t.type];
return Array.isArray(e) ? e.forEach((r) => r == null ? void 0 : r(t, ...this.listenerBoundArgs || [])) : e == null ? void 0 : e(t, ...this.listenerBoundArgs || []);
}
function Nt(e) {
const t = this._captureListeners[e.type];
return Array.isArray(t) ? t.forEach((r) => r == null ? void 0 : r(e, ...this.listenerBoundArgs || [])) : t == null ? void 0 : t(e, ...this.listenerBoundArgs || []);
function Ne(t) {
const e = this._captureListeners[t.type];
return Array.isArray(e) ? e.forEach((r) => r == null ? void 0 : r(t, ...this.listenerBoundArgs || [])) : e == null ? void 0 : e(t, ...this.listenerBoundArgs || []);
}
const X = /* @__PURE__ */ new WeakMap();
function Vt(e) {
return e[0] === "o" && e[1] === "n";
function Ve(t) {
return t[0] === "o" && t[1] === "n";
}
const It = /^(strokeWidth|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeDashoffset|strokeDasharray|strokeOpacity|fillOpacity|stopOpacity)/;
function V(e, t, r, n) {
if (Array.isArray(r) && t !== "style" && t !== "className" && !Vt(t))
return V(e, t, r.at(-1), n);
if (t === "uuid") {
e.setAttribute("data-uuid", r);
const Ie = /^(strokeWidth|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeDashoffset|strokeDasharray|strokeOpacity|fillOpacity|stopOpacity)/;
function V(t, e, r, n) {
if (Array.isArray(r) && e !== "style" && e !== "className" && !Ve(e))
return V(t, e, r.at(-1), n);
if (e === "uuid") {
t.setAttribute("data-uuid", r);
return;
}
if (t[0] === "o" && t[1] === "n") {
const s = t !== (t = t.replace(/Capture$/, ""));
let i = t.toLowerCase().substring(2);
if (e[0] === "o" && e[1] === "n") {
const s = e !== (e = e.replace(/Capture$/, ""));
let i = e.toLowerCase().substring(2);
i === "change" && (i = "input");
const o = s ? Nt : St;
r ? e.addEventListener(i, o, s) : e.removeEventListener(i, o, s);
const a = s ? e._captureListeners || (e._captureListeners = {}) : e._listeners || (e._listeners = {});
b((a == null ? void 0 : a[i]) === void 0, `${t} already listened`), a[i] = r;
const o = s ? Ne : Se;
r ? t.addEventListener(i, o, s) : t.removeEventListener(i, o, s);
const a = s ? t._captureListeners || (t._captureListeners = {}) : t._listeners || (t._listeners = {});
C((a == null ? void 0 : a[i]) === void 0, `${e} already listened`), a[i] = r;
return;
}
if (t === "style") {
(!r || Array.isArray(r) && !r.length) && (e.style.cssText = r || ""), (Array.isArray(r) ? r : [r]).forEach((i) => {
typeof i == "string" ? e.style.cssText = i : typeof i == "object" ? Rt(i, (o, a) => {
e.style[a] = tt(a, o);
}) : b(!1, "style can only be string or object.");
if (e === "style") {
(!r || Array.isArray(r) && !r.length) && (t.style.cssText = r || ""), (Array.isArray(r) ? r : [r]).forEach((i) => {
typeof i == "string" ? t.style.cssText = i : typeof i == "object" ? Re(i, (o, a) => {
t.style[a] = ee(a, o);
}) : C(!1, "style can only be string or object.");
});
return;
}
if (t === "className") {
if (e === "className") {
const s = Array.isArray(r) ? r : [r];

@@ -108,43 +108,43 @@ let i = "";

o[a] && (i = `${i} ${a}`);
else typeof o == "string" ? i = `${i} ${o}` : b(!1, "className can only be string or {[k:string]:boolean}");
}), e.setAttribute("class", i);
else typeof o == "string" ? i = `${i} ${o}` : C(!1, "className can only be string or {[k:string]:boolean}");
}), t.setAttribute("class", i);
return;
}
if (!(t === "key" || t === "ref")) if (t === "class" && !n)
e.className = r || "";
else if (t === "value")
e.value = r, e.tagName === "SELECT" ? X.set(e, r) : e.tagName === "OPTION" ? wt(e) : e.tagName === "INPUT" && e.type === "checkbox" ? r ? e.setAttribute("checked", "true") : e.removeAttribute("checked") : e.tagName === "INPUT" && e.type === "text" && r === void 0 && (e.value = "");
else if (t === "checked" && e.tagName === "INPUT" && e.type === "checkbox")
r ? e.setAttribute("checked", "true") : e.removeAttribute("checked");
else if (t === "disabled")
r ? e.setAttribute("disabled", "true") : e.removeAttribute("disabled");
else if (t === "dangerouslySetInnerHTML")
e.innerHTML = r;
else if (t !== "list" && t !== "type" && !n && t in e)
Ot(e, t, r === null ? "" : r), r == null && e.removeAttribute(t);
if (!(e === "key" || e === "ref")) if (e === "class" && !n)
t.className = r || "";
else if (e === "value")
t.value = r, t.tagName === "SELECT" ? X.set(t, r) : t.tagName === "OPTION" ? Ae(t) : t.tagName === "INPUT" && t.type === "checkbox" ? r ? t.setAttribute("checked", "true") : t.removeAttribute("checked") : t.tagName === "INPUT" && t.type === "text" && r === void 0 && (t.value = "");
else if (e === "checked" && t.tagName === "INPUT" && t.type === "checkbox")
r ? t.setAttribute("checked", "true") : t.removeAttribute("checked");
else if (e === "disabled")
r ? t.setAttribute("disabled", "true") : t.removeAttribute("disabled");
else if (e === "dangerouslySetInnerHTML")
t.innerHTML = r;
else if (e !== "list" && e !== "type" && !n && e in t)
Oe(t, e, r === null ? "" : r), r == null && t.removeAttribute(e);
else {
const s = n && t !== (t = t.replace(/^xlink\:?/, ""));
const s = n && e !== (e = e.replace(/^xlink\:?/, ""));
if (r == null || r === !1)
s ? e.removeAttributeNS("http://www.w3.org/1999/xlink", t.toLowerCase()) : t.toLowerCase() === "contenteditable" && r === !1 ? e.setAttribute(t, "false") : e.removeAttribute(t);
s ? t.removeAttributeNS("http://www.w3.org/1999/xlink", e.toLowerCase()) : e.toLowerCase() === "contenteditable" && r === !1 ? t.setAttribute(e, "false") : t.removeAttribute(e);
else if (typeof r != "function" && s)
e.setAttributeNS("http://www.w3.org/1999/xlink", t.toLowerCase(), r);
t.setAttributeNS("http://www.w3.org/1999/xlink", e.toLowerCase(), r);
else {
const i = n && It.test(t) ? t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase() : t;
e.setAttribute(i, r);
const i = n && Ie.test(e) ? e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase() : e;
t.setAttribute(i, r);
}
}
}
function w(e, t, ...r) {
const { _isSVG: n, ref: s, detachStyle: i, children: o, ...a } = t || {};
if (typeof e != "string" && e !== F) {
function A(t, e, ...r) {
const { _isSVG: n, ref: s, detachStyle: i, children: o, ...a } = e || {};
if (typeof t != "string" && t !== F) {
const u = r.length ? r : o || [];
return { type: e, props: t || {}, children: u };
return { type: t, props: e || {}, children: u };
}
const c = e === F ? document.createDocumentFragment() : n ? document.createElementNS("http://www.w3.org/2000/svg", e) : document.createElement(e), l = [], p = [], f = [], m = [], d = r.length ? r : o || [];
if (e !== F && d.length === 1 && (typeof d[0] == "string" || typeof d[0] == "number"))
c.textContent = d[0].toString();
else if (d.length) {
const c = t === F ? document.createDocumentFragment() : n ? document.createElementNS("http://www.w3.org/2000/svg", t) : document.createElement(t), l = [], p = [], d = [], m = [], f = r.length ? r : o || [];
if (t !== F && f.length === 1 && (typeof f[0] == "string" || typeof f[0] == "number"))
c.textContent = f[0].toString();
else if (f.length) {
const u = document.createDocumentFragment();
d.forEach((h, S) => {
var x, T, v, R;
f.forEach((h, E) => {
var b, P, v, R;
if (h != null)

@@ -156,69 +156,69 @@ if (typeof h == "string" || typeof h == "number")

const y = h;
(x = y.unhandledChildren) != null && x.length && (p.push(...y.unhandledChildren.map((E) => ({ ...E, path: [S, ...E.path] }))), y.unhandledChildren = void 0), (T = y.unhandledAttr) != null && T.length && (l.push(...y.unhandledAttr.map((E) => ({ ...E, path: [S, ...E.path] }))), y.unhandledAttr = void 0), (v = y.refHandles) != null && v.length && (f.push(...y.refHandles.map((E) => ({ ...E, path: [S, ...E.path] }))), y.refHandles = void 0), (R = y.detachStyledChildren) != null && R.length && (m.push(...y.detachStyledChildren.map((E) => ({ ...E, path: [S, ...E.path] }))), y.detachStyledChildren = void 0);
(b = y.unhandledChildren) != null && b.length && (p.push(...y.unhandledChildren.map((S) => ({ ...S, path: [E, ...S.path] }))), y.unhandledChildren = void 0), (P = y.unhandledAttr) != null && P.length && (l.push(...y.unhandledAttr.map((S) => ({ ...S, path: [E, ...S.path] }))), y.unhandledAttr = void 0), (v = y.refHandles) != null && v.length && (d.push(...y.refHandles.map((S) => ({ ...S, path: [E, ...S.path] }))), y.refHandles = void 0), (R = y.detachStyledChildren) != null && R.length && (m.push(...y.detachStyledChildren.map((S) => ({ ...S, path: [E, ...S.path] }))), y.detachStyledChildren = void 0);
} else {
const y = document.createComment("unhandledChild");
u.appendChild(y), p.push({ placeholder: y, child: h, path: [S] });
u.appendChild(y), p.push({ placeholder: y, child: h, path: [E] });
}
}), c.appendChild(u);
}
if (t) {
s && f.push({ handle: s, path: [], el: c }), i && m.push({ el: c, style: i, path: [] });
if (e) {
s && d.push({ handle: s, path: [], el: c }), i && m.push({ el: c, style: i, path: [] });
for (const u in a) {
const h = a[u];
w.isValidAttribute(u, h) ? V(c, u, h, n) : l.push({ el: c, key: u, value: h, path: [] });
A.isValidAttribute(u, h) ? V(c, u, h, n) : l.push({ el: c, key: u, value: h, path: [] });
}
}
const g = c;
return p.length && (g.unhandledChildren = p), l.length && (g.unhandledAttr = l), f.length && (g.refHandles = f), m.length && (g.detachStyledChildren = m), c;
return p.length && (g.unhandledChildren = p), l.length && (g.unhandledAttr = l), d.length && (g.refHandles = d), m.length && (g.detachStyledChildren = m), c;
}
function at(e) {
return typeof e == "string" || typeof e == "number" || e instanceof N;
function ae(t) {
return typeof t == "string" || typeof t == "number" || t instanceof N;
}
function Mt(e) {
return G(e) && Object.entries(e).every(
([t, r]) => /[a-zA-Z\-]+/.test(t) && at(r) || Array.isArray(r) && r.every(at)
function Me(t) {
return G(t) && Object.entries(t).every(
([e, r]) => /[a-zA-Z\-]+/.test(e) && ae(r) || Array.isArray(r) && r.every(ae)
);
}
w.isValidAttribute = function(e, t) {
if (Array.isArray(t))
return t.every((n) => w.isValidAttribute(e, n));
const r = typeof t;
return e === "className" && console.log(r, t), !!(r !== "object" && r !== "function" || e[0] === "o" && e[1] === "n" && r === "function" || e === "style" && (Mt(t) || r === "string") || e === "className" && G(t));
A.isValidAttribute = function(t, e) {
if (Array.isArray(e))
return e.every((n) => A.isValidAttribute(t, n));
const r = typeof e;
return !!(r !== "object" && r !== "function" || t[0] === "o" && t[1] === "n" && r === "function" || t === "style" && (Me(e) || r === "string") || t === "className" && G(e));
};
w.attachRef = function(e, t) {
if (Array.isArray(t)) {
t.forEach((r) => w.attachRef(e, r));
A.attachRef = function(t, e) {
if (Array.isArray(e)) {
e.forEach((r) => A.attachRef(t, r));
return;
}
typeof t == "function" ? t(e) : typeof t == "object" ? t.current = e : b(!1, "ref should be function or object with current property");
typeof e == "function" ? e(t) : typeof e == "object" ? e.current = t : C(!1, "ref should be function or object with current property");
};
w.detachRef = function(e) {
if (Array.isArray(e)) {
e.forEach((t) => w.detachRef(t));
A.detachRef = function(t) {
if (Array.isArray(t)) {
t.forEach((e) => A.detachRef(e));
return;
}
typeof e == "function" ? e(null) : typeof e == "object" ? e.current = null : b(!1, "ref should be function or object with current property");
typeof t == "function" ? t(null) : typeof t == "object" ? t.current = null : C(!1, "ref should be function or object with current property");
};
function F() {
}
function wt(e) {
const t = e.parentElement;
X.has(t) && (t.value = X.get(t));
function Ae(t) {
const e = t.parentElement;
X.has(e) && (e.value = X.get(e));
}
function k(e, t) {
const r = t.parentNode.insertBefore(e, t);
return e instanceof HTMLOptionElement && wt(e), r;
function k(t, e) {
const r = e.parentNode.insertBefore(t, e);
return t instanceof HTMLOptionElement && Ae(t), r;
}
function Ie(e, t, ...r) {
return w(e, { _isSVG: !0, ...t || {} }, r);
function It(t, e, ...r) {
return A(t, { _isSVG: !0, ...e || {} }, r);
}
function jt(e, t, ...r) {
return w(e, { _isSVG: !0, ...t || {} }, r);
function je(t, e, ...r) {
return A(t, { _isSVG: !0, ...e || {} }, r);
}
function Me(e, t) {
return St.call(e, t);
function Mt(t, e) {
return Se.call(t, e);
}
class N {
constructor(t, r = "px") {
this.value = t, this.unit = r, typeof t == "string" && (this.unit = "mixed");
constructor(e, r = "px") {
this.value = e, this.unit = r, typeof e == "string" && (this.unit = "mixed");
}

@@ -234,15 +234,15 @@ toString() {

}
mul(t) {
return typeof this.value == "number" ? this.value = this.value * t : (this.value = `(${this.value}) * ${t}`, this.unit = "mixed"), this;
mul(e) {
return typeof this.value == "number" ? this.value = this.value * e : (this.value = `(${this.value}) * ${e}`, this.unit = "mixed"), this;
}
div(t) {
return typeof this.value == "number" ? this.value = this.value / t : (this.value = `(${this.value}) / ${t}`, this.unit = "mixed"), this;
div(e) {
return typeof this.value == "number" ? this.value = this.value / e : (this.value = `(${this.value}) / ${e}`, this.unit = "mixed"), this;
}
add(t, r) {
if (typeof this.value == "number" && typeof t == "number" && (!r || r === this.unit))
this.value = this.value + t;
else if (typeof this.value == "number" && t instanceof N && this.unit === t.unit)
this.value = this.value + t.value;
add(e, r) {
if (typeof this.value == "number" && typeof e == "number" && (!r || r === this.unit))
this.value = this.value + e;
else if (typeof this.value == "number" && e instanceof N && this.unit === e.unit)
this.value = this.value + e.value;
else {
const n = typeof this.value == "number" ? `${this.value}${this.unit}` : `(${this.value})`, s = typeof t == "number" ? `${t}${r || this.unit}` : t.unit === "mixed" ? `(${t.value})` : t.toString();
const n = typeof this.value == "number" ? `${this.value}${this.unit}` : `(${this.value})`, s = typeof e == "number" ? `${e}${r || this.unit}` : e.unit === "mixed" ? `(${e.value})` : e.toString();
this.value = `${n} + ${s}`, this.unit = "mixed";

@@ -252,9 +252,9 @@ }

}
sub(t, r) {
if (typeof this.value == "number" && typeof t == "number" && (!r || r === this.unit))
this.value = this.value - t;
else if (typeof this.value == "number" && t instanceof N && this.unit === t.unit)
this.value = this.value - t.value;
sub(e, r) {
if (typeof this.value == "number" && typeof e == "number" && (!r || r === this.unit))
this.value = this.value - e;
else if (typeof this.value == "number" && e instanceof N && this.unit === e.unit)
this.value = this.value - e.value;
else {
const n = typeof this.value == "number" ? `${this.value}${this.unit}` : `(${this.value})`, s = typeof t == "number" ? `${t}${r || this.unit}` : t.unit === "mixed" ? `(${t.value})` : t.toString();
const n = typeof this.value == "number" ? `${this.value}${this.unit}` : `(${this.value})`, s = typeof e == "number" ? `${e}${r || this.unit}` : e.unit === "mixed" ? `(${e.value})` : e.toString();
this.value = `${n} - ${s}`, this.unit = "mixed";

@@ -265,19 +265,19 @@ }

}
function je(e, { children: t, ...r }) {
return w(e, r, t);
function jt(t, { children: e, ...r }) {
return A(t, r, e);
}
function De(e, { children: t, ...r }) {
return w(e, r, [t]);
function Dt(t, { children: e, ...r }) {
return A(t, r, [e]);
}
function Fe(e, { children: t, ...r }) {
return Array.isArray(t) ? w(e, r, t) : w(e, r, t ? [t] : []);
function Ft(t, { children: e, ...r }) {
return Array.isArray(e) ? A(t, r, e) : A(t, r, e ? [e] : []);
}
function Dt() {
function De() {
}
function ct(e) {
const t = typeof e;
return t === "string" || t === "number";
function ce(t) {
const e = typeof t;
return e === "string" || e === "number";
}
function C(e) {
function t(...r) {
function x(t) {
function e(...r) {
var s, i, o;

@@ -288,6 +288,6 @@ function n(a) {

}
return n.argv = r, n.stringify = (s = e.stringify) == null ? void 0 : s.bind(n), n.parse = (i = e.parse) == null ? void 0 : i.bind(n), n.check = (o = e.check) == null ? void 0 : o.bind(n), n.is = e.is || ((a) => a === t), n.zeroValue = e.zeroValue, n.required = e.required, n.createDefaultValue = e.createDefaultValue, n.coerce = e.coerce, n.required || Object.defineProperty(n, "isRequired", {
return n.argv = r, n.stringify = (s = t.stringify) == null ? void 0 : s.bind(n), n.parse = (i = t.parse) == null ? void 0 : i.bind(n), n.check = (o = t.check) == null ? void 0 : o.bind(n), n.is = t.is || ((a) => a === e), n.zeroValue = t.zeroValue, n.required = t.required, n.createDefaultValue = t.createDefaultValue, n.coerce = t.coerce, n.required || Object.defineProperty(n, "isRequired", {
get() {
return C({
...e,
return x({
...t,
required: !0,

@@ -305,4 +305,4 @@ // CAUTION 注意这里 isRequired.is 和之前一样

get() {
return (a) => C({
...e,
return (a) => x({
...t,
required: n.required,

@@ -315,5 +315,5 @@ createDefaultValue: a,

}
return t;
return e;
}
function P(e, t) {
function T(t, e) {
const {

@@ -325,12 +325,12 @@ stringify: r = JSON.stringify,

...o
} = t, a = function(c) {
if (typeof e == "function" && !e(c))
} = e, a = function(c) {
if (typeof t == "function" && !t(c))
return new Error(`${c} type check failed`);
if (typeof e == "string" && typeof c !== e)
return new Error(`${c} is not ${e}`);
if (typeof t == "string" && typeof c !== t)
return new Error(`${c} is not ${t}`);
};
return a.stringify = r, a.parse = n, a.check = (c) => typeof e == "string" ? typeof c === e : e(c), a.is = s || ((c) => c === a), a.required = !!i, Object.assign(a, o), a.required || Object.defineProperty(a, "isRequired", {
return a.stringify = r, a.parse = n, a.check = (c) => typeof t == "string" ? typeof c === t : t(c), a.is = s || ((c) => c === a), a.required = !!i, Object.assign(a, o), a.required || Object.defineProperty(a, "isRequired", {
get() {
return P(e, {
...t,
return T(t, {
...e,
required: !0,

@@ -347,4 +347,4 @@ is: a.is

get() {
return (c) => P(e, {
...t,
return (c) => T(t, {
...e,
required: a.required,

@@ -357,33 +357,33 @@ createDefaultValue: c,

}
const Ft = C({
stringify(e) {
return e === null ? "" : ct(this.argv[0][0]) ? e.toString() : JSON.stringify(e);
const Fe = x({
stringify(t) {
return t === null ? "" : ce(this.argv[0][0]) ? t.toString() : JSON.stringify(t);
},
parse(e) {
return ct(this.argv[0][0]) ? typeof this.argv[0][0] == "string" ? e : parseFloat(e) : JSON.parse(e);
parse(t) {
return ce(this.argv[0][0]) ? typeof this.argv[0][0] == "string" ? t : parseFloat(t) : JSON.parse(t);
},
check(e) {
return this.argv[0].includes(e);
check(t) {
return this.argv[0].includes(t);
},
zeroValue: []
}), _t = {
}), _e = {
zeroValue: ""
}, zt = P("string", _t), Bt = {
stringify(e) {
return e.toString();
}, Be = T("string", _e), ze = {
stringify(t) {
return t.toString();
},
parse(e) {
if (/-?\d+(\.\d+)?/.test(e)) return parseFloat(e);
throw new Error(`${e} is not a number`);
parse(t) {
if (/-?\d+(\.\d+)?/.test(t)) return parseFloat(t);
throw new Error(`${t} is not a number`);
},
zeroValue: 0
}, qt = P("number", Bt), Gt = { zeroValue: null }, Wt = P((e) => typeof e == "object" && !Array.isArray(e), Gt), Kt = P((e) => Array.isArray(e), {}), Xt = { zeroValue: !1 }, Yt = P("bool", Xt), Ut = {
stringify(e) {
return e.toString();
}, qe = T("number", ze), Ge = { zeroValue: null }, We = T((t) => typeof t == "object" && !Array.isArray(t), Ge), Ke = T((t) => Array.isArray(t), {}), Xe = { zeroValue: !1 }, Ye = T("bool", Xe), Ue = {
stringify(t) {
return t.toString();
},
// eslint-disable-next-line no-new-func
parse(e) {
return new Function(e);
parse(t) {
return new Function(t);
}
}, Jt = P("function", Ut), Zt = P("symbol", {}), Qt = {
}, Je = T("function", Ue), Ze = T("symbol", {}), Qe = {
stringify() {

@@ -398,114 +398,114 @@ throw new Error("type any can not stringify");

}
}, W = P(() => !0, Qt), te = C({
check(e) {
return this.argv[0].some((t) => t.check(e));
}, W = T(() => !0, Qe), et = x({
check(t) {
return this.argv[0].some((e) => e.check(t));
},
stringify(e) {
return this.argv[0].find((r) => !(r(e) instanceof Error)).stringify(e);
stringify(t) {
return this.argv[0].find((r) => !(r(t) instanceof Error)).stringify(t);
},
parse(e) {
let t;
parse(t) {
let e;
if (!this.argv[0].some((n) => {
try {
const s = n.parse(e);
const s = n.parse(t);
if (this.check(s))
return t = s, !0;
return e = s, !0;
} catch {
}
return !1;
})) throw new Error(`can not parse ${e}`);
return t;
})) throw new Error(`can not parse ${t}`);
return e;
}
}), ee = C({
check(e) {
return Array.isArray(e) ? e.every((t) => this.argv[0].check(t)) : !1;
}), tt = x({
check(t) {
return Array.isArray(t) ? t.every((e) => this.argv[0].check(e)) : !1;
},
stringify(e) {
stringify(t) {
},
parse(e) {
parse(t) {
},
zeroValue: []
}), re = C({
check(e) {
}), rt = x({
check(t) {
return !0;
},
stringify(e) {
stringify(t) {
},
parse(e) {
parse(t) {
}
}), ne = C({
check(e) {
return Object.entries(this.argv[0]).every(([t, r]) => r.check(e[t]));
}), nt = x({
check(t) {
return Object.entries(this.argv[0]).every(([e, r]) => r.check(t[e]));
},
stringify(e) {
return `{${Object.entries(this.argv[0]).map(([t, r]) => `${t}:${JSON.stringify(r.stringify(e[t]))}`).join(",")}`;
stringify(t) {
return `{${Object.entries(this.argv[0]).map(([e, r]) => `${e}:${JSON.stringify(r.stringify(t[e]))}`).join(",")}`;
},
parse(e) {
const t = JSON.parse(e);
return Object.keys(t).forEach((r) => {
t[r] = this.argv[0][r].parse(t[r]);
}), t;
parse(t) {
const e = JSON.parse(t);
return Object.keys(e).forEach((r) => {
e[r] = this.argv[0][r].parse(e[r]);
}), e;
}
}), se = W, ie = W, oe = W, ae = Dt;
function ce() {
return C({
coerce: (e) => q(e) ? e : Q(e)
}), st = W, it = W, ot = W, at = De;
function ct() {
return x({
coerce: (t) => q(t) ? t : Q(t)
})();
}
function he() {
return C({
coerce: (e) => e instanceof _ ? e : new _(e)
function ht() {
return x({
coerce: (t) => t instanceof _ ? t : new _(t)
})();
}
function le() {
return C({
coerce: (e) => e instanceof rt ? e : new rt(e)
function lt() {
return x({
coerce: (t) => t instanceof re ? t : new re(t)
})();
}
function ue() {
return C({
coerce: (e) => e instanceof nt ? e : new nt(e)
function ut() {
return x({
coerce: (t) => t instanceof ne ? t : new ne(t)
})();
}
const H = {
string: zt,
number: qt,
object: Wt,
array: Kt,
bool: Yt,
function: Jt,
symbol: Zt,
node: se,
element: ie,
elementType: oe,
string: Be,
number: qe,
object: We,
array: Ke,
bool: Ye,
function: Je,
symbol: Ze,
node: st,
element: it,
elementType: ot,
// instanceOf
// 枚举值
oneOf: Ft,
oneOf: Fe,
// 枚举类型
oneOfType: te,
oneOfType: et,
// 数组类型,里面的值应该只能跟类型
arrayOf: ee,
arrayOf: tt,
// objectOf,
// 对象结构的嵌套类型。shape + arrayOf + oneOfType + any 可以描述任何 schema。
shapeOf: re,
shapeOf: rt,
// map 类型,就是简单的 kv,应该是 shape 的子集。
map: ne,
map: nt,
// exact,
// customProps/customArrayProps
any: W,
checkPropTypes: ae,
checkPropTypes: at,
// reactive types
atom: ce,
rxList: he,
rxSet: le,
rxMap: ue
}, ht = /* @__PURE__ */ new WeakSet();
function fe({ container: e, content: t, destroyOnUnmount: r }, { useEffect: n, pathContext: s }) {
typeof t != "function" && (ht.has(t) && console.error("static portal content can only be rendered once. Use function content for content has reactive parts."), ht.add(t));
const i = Le(e, s);
return i.render(t), n(() => () => {
atom: ct,
rxList: ht,
rxSet: lt,
rxMap: ut
}, he = /* @__PURE__ */ new WeakSet();
function ft({ container: t, content: e, destroyOnUnmount: r }, { useEffect: n, pathContext: s }) {
typeof e != "function" && (he.has(e) && console.error("static portal content can only be rendered once. Use function content for content has reactive parts."), he.add(e));
const i = Lt(t, s);
return i.render(e), n(() => () => {
i.destroy();
}), null;
}
function de() {
function dt() {
return {

@@ -515,65 +515,65 @@ current: null

}
function pe() {
const e = Q(null);
function pt() {
const t = Q(null);
return new Proxy({}, {
get: (t, r) => {
get: (e, r) => {
if (r === "current")
return e();
return t();
},
set: (t, r, n) => (r === "current" && e(n), !0)
set: (e, r, n) => (r === "current" && t(n), !0)
});
}
function M(e, t) {
function M(t, e) {
return {
prev: t,
node: e
prev: e,
node: t
};
}
function $(e) {
return e ? Array.isArray(e) ? e : [e] : [];
function $(t) {
return t ? Array.isArray(t) ? t : [t] : [];
}
function me(e, t) {
const r = { ...e };
for (const n in t) {
const s = t[n];
r[n] = Y(n, e[n], s);
function mt(t, e) {
const r = { ...t };
for (const n in e) {
const s = e[n];
r[n] = Y(n, t[n], s);
}
return r;
}
function Y(e, t, r) {
return t && (e.startsWith("on") || e === "ref" || e === "style" || e === "classname" || e === "class") ? e === "style" ? $(t).concat(r) : $(r).concat(t) : r;
function Y(t, e, r) {
return e && (t.startsWith("on") || t === "ref" || t === "style" || t === "classname" || t === "class") ? t === "style" ? $(e).concat(r) : $(r).concat(e) : r;
}
const K = "__config__", L = class L {
constructor({ type: t, props: r = {}, children: n }, s, i) {
this.placeholder = s, this.pathContext = i, this.layoutEffects = /* @__PURE__ */ new Set(), this.effects = /* @__PURE__ */ new Set(), this.destroyCallback = /* @__PURE__ */ new Set(), this.layoutEffectDestroyHandles = /* @__PURE__ */ new Set(), this.refs = xt({}), this.itemConfig = {}, this.frame = [], this.exposed = {}, this.createHTMLOrSVGElement = (o, a, c, ...l) => {
var x, T, v, R;
const p = typeof a == "function", f = c == null ? void 0 : c.as;
if (c == null || delete c.as, b(f !== "self", '"self" is reserved, please use another element name.'), f && ((x = this.itemConfig[f]) != null && x.use) && ((T = this.itemConfig[f]) == null ? void 0 : T.use) instanceof Element)
return this.itemConfig[f].use;
let m = l, { props: d, componentProps: g } = this.separateProps(c);
const u = this.itemConfig[f];
f && u && (u.props && (p ? d = { ...c, ...u.props } : d = me(c, u.props)), u.propMergeHandles && Object.entries(u.propMergeHandles).forEach(([y, E]) => {
d[y] = E.reduce((Ct, Pt) => Pt(Ct, g), d[y]);
}), u.propsMergeHandle && (d = u.propsMergeHandle.reduce((y, E) => E(y, g), d)), u.children && (m = u.children));
const h = ((v = this.itemConfig[f]) == null ? void 0 : v.use) || a;
typeof h == "function" && !p && (g[ge] = d, d = g), typeof h == "function" && ((R = u == null ? void 0 : u.configProps) != null && R.length) && Object.assign(d, { [K]: u.configProps }), f && (d.ref = $(d.ref).concat((y) => this.refs[f] = y));
const S = o ? jt(h, d, ...m) : w(h, d, ...m);
constructor({ type: e, props: r = {}, children: n }, s, i) {
this.placeholder = s, this.pathContext = i, this.layoutEffects = /* @__PURE__ */ new Set(), this.effects = /* @__PURE__ */ new Set(), this.destroyCallback = /* @__PURE__ */ new Set(), this.layoutEffectDestroyHandles = /* @__PURE__ */ new Set(), this.refs = Pe({}), this.itemConfig = {}, this.frame = [], this.exposed = {}, this.createHTMLOrSVGElement = (o, a, c, ...l) => {
var b, P, v, R;
const p = typeof a == "function", d = c == null ? void 0 : c.as;
if (c == null || delete c.as, C(d !== "self", '"self" is reserved, please use another element name.'), d && ((b = this.itemConfig[d]) != null && b.use) && ((P = this.itemConfig[d]) == null ? void 0 : P.use) instanceof Element)
return this.itemConfig[d].use;
let m = l, { props: f, componentProps: g } = this.separateProps(c);
const u = this.itemConfig[d];
d && u && (u.props && (p ? f = { ...c, ...u.props } : f = mt(c, u.props)), u.propMergeHandles && Object.entries(u.propMergeHandles).forEach(([y, S]) => {
f[y] = S.reduce((Ce, xe) => xe(Ce, g), f[y]);
}), u.propsMergeHandle && (f = u.propsMergeHandle.reduce((y, S) => S(y, g), f)), u.children && (m = u.children));
const h = ((v = this.itemConfig[d]) == null ? void 0 : v.use) || a;
typeof h == "function" && !p && (g[gt] = f, f = g), typeof h == "function" && ((R = u == null ? void 0 : u.configProps) != null && R.length) && Object.assign(f, { [K]: u.configProps }), d && (f.ref = $(f.ref).concat((y) => this.refs[d] = y));
const E = o ? je(h, f, ...m) : A(h, f, ...m);
if (typeof h != "function") {
const y = [];
let E = this.pathContext.hostPath;
for (; E; )
E instanceof L && y.push(E.props), E = E.prev;
S.listenerBoundArgs = [y, g];
let S = this.pathContext.hostPath;
for (; S; )
S instanceof L && y.push(S.props), S = S.prev;
E.listenerBoundArgs = [y, g];
}
return S;
}, this.createElement = this.createHTMLOrSVGElement.bind(this, !1), this.createSVGElement = this.createHTMLOrSVGElement.bind(this, !0), this.createPortal = (o, a) => w(fe, { container: a, content: o }), this.useLayoutEffect = (o) => {
return E;
}, this.createElement = this.createHTMLOrSVGElement.bind(this, !1), this.createSVGElement = this.createHTMLOrSVGElement.bind(this, !0), this.createPortal = (o, a) => A(ft, { container: a, content: o }), this.useLayoutEffect = (o) => {
this.layoutEffects.add(o);
}, this.useEffect = (o) => {
this.effects.add(o);
}, this.createRef = de, this.createRxRef = pe, this.cleanupsOfExternalTarget = /* @__PURE__ */ new Set(), this.createStateFromRef = (o, a) => {
}, this.createRef = dt, this.createRxRef = pt, this.cleanupsOfExternalTarget = /* @__PURE__ */ new Set(), this.createStateFromRef = (o, a) => {
let c;
const l = (f) => {
a && c && this.cleanupsOfExternalTarget.delete(c), c == null || c(), f !== null ? (c = o(f, p), a && c && this.cleanupsOfExternalTarget.add(c)) : (c = void 0, p(null));
const l = (d) => {
a && c && this.cleanupsOfExternalTarget.delete(c), c == null || c(), d !== null ? (c = o(d, p), a && c && this.cleanupsOfExternalTarget.add(c)) : (c = void 0, p(null));
}, p = new Proxy(Q(null), {
get: (f, m) => m === "ref" ? l : f[m]
get: (d, m) => m === "ref" ? l : d[m]
});

@@ -588,27 +588,27 @@ return a && p.ref(a), p;

});
}, L.typeIds.has(t) || L.typeIds.set(t, L.typeIds.size), this.name = t.name, this.type = t, this.props = {}, this.refProp = r.ref, this.thisProp = r.__this, this.inputProps = r, this.children = n;
}, L.typeIds.has(e) || L.typeIds.set(e, L.typeIds.size), this.name = e.name, this.type = e, this.props = {}, this.refProp = r.ref, this.thisProp = r.__this, this.inputProps = r, this.children = n;
}
parseItemConfigFromProp(t, r, n) {
parseItemConfigFromProp(e, r, n) {
if (r[0] === "$") {
const [s, i] = r.slice(1).split(":");
if (t[s] || (t[s] = {}), i === "_eventTarget")
t[s].eventTarget = $(t[s].eventTarget).concat(n);
if (e[s] || (e[s] = {}), i === "_eventTarget")
e[s].eventTarget = $(e[s].eventTarget).concat(n);
else if (i === "_use")
t[s].use = n;
e[s].use = n;
else if (i === "_props")
t[s].propsMergeHandle = $(t[s].propsMergeHandle).concat(n);
e[s].propsMergeHandle = $(e[s].propsMergeHandle).concat(n);
else if (i === "_children")
t[s].children = n;
e[s].children = n;
else if (i === void 0 || i === "")
t[s].configProps = $(t[s].configProps).concat(n);
e[s].configProps = $(e[s].configProps).concat(n);
else if ((i == null ? void 0 : i[0]) === "_")
b(!1, `unsupported config item: ${s}`);
C(!1, `unsupported config item: ${s}`);
else if (i.endsWith("_")) {
t[s].propMergeHandles || (t[s].propMergeHandles = {});
e[s].propMergeHandles || (e[s].propMergeHandles = {});
const o = i.slice(0, -1);
t[s].propMergeHandles[o] = $(t[s].propMergeHandles[o]).concat(n);
e[s].propMergeHandles[o] = $(e[s].propMergeHandles[o]).concat(n);
} else
t[s].props || (t[s].props = {}), t[s].props[i] = Y(i, t[s].props[i], n);
e[s].props || (e[s].props = {}), e[s].props[i] = Y(i, e[s].props[i], n);
}
return t;
return e;
}

@@ -623,14 +623,14 @@ get typeId() {

get element() {
var t;
return ((t = this.innerHost) == null ? void 0 : t.element) || this.placeholder;
var e;
return ((e = this.innerHost) == null ? void 0 : e.element) || this.placeholder;
}
separateProps(t) {
separateProps(e) {
const r = {}, n = {}, s = {};
for (const i in t)
i.startsWith("prop:") ? n[i.slice(5)] = t[i] : i.startsWith("$self:") ? s[i.slice(6)] = t[i] : r[i] = t[i];
for (const i in e)
i.startsWith("prop:") ? n[i.slice(5)] = e[i] : i.startsWith("$self:") ? s[i.slice(6)] = e[i] : r[i] = e[i];
return this.parseAndMergeProps({ props: r, itemConfig: {}, componentProp: n }, s), { props: r, componentProps: n };
}
normalizePropsByPropTypes(t, r) {
normalizePropsByPropTypes(e, r) {
const n = { ...r };
return Object.entries(t).forEach(([s, i]) => {
return Object.entries(e).forEach(([s, i]) => {
var o;

@@ -640,5 +640,5 @@ r[s] !== void 0 ? n[s] = ((o = i.coerce) == null ? void 0 : o.call(i, r[s])) || r[s] : n[s] = i.defaultValue;

}
normalizePropsWithCoerceValue(t, r) {
normalizePropsWithCoerceValue(e, r) {
const n = { ...r };
return Object.entries(t).forEach(([s, i]) => {
return Object.entries(e).forEach(([s, i]) => {
var o;

@@ -648,3 +648,3 @@ r[s] !== void 0 && (n[s] = ((o = i.coerce) == null ? void 0 : o.call(i, r[s])) || r[s]);

}
attachRef(t) {
attachRef(e) {
const r = {

@@ -654,24 +654,24 @@ ...this.exposed,

};
typeof t == "function" ? t(r) : t.current = r;
typeof e == "function" ? e(r) : e.current = r;
}
attachThis(t) {
typeof t == "function" ? t(this) : t.current = this;
attachThis(e) {
typeof e == "function" ? e(this) : e.current = this;
}
detachRef(t) {
typeof t == "function" ? t(null) : t.current = null;
detachRef(e) {
typeof e == "function" ? e(null) : e.current = null;
}
evaluateBoundProps(t, r) {
return (this.type.boundProps || []).map((n) => typeof n == "function" ? n(t, r) : n);
evaluateBoundProps(e, r) {
return (this.type.boundProps || []).map((n) => typeof n == "function" ? n(e, r) : n);
}
parseAndMergeProps(t, r) {
parseAndMergeProps(e, r) {
return Object.entries(r).forEach(([n, s]) => {
n === K || (n[0] === "$" ? t.itemConfig = this.parseItemConfigFromProp(t.itemConfig, n, s) : t.props[n] = Y(n, t.props[n], s));
}), t;
n === K || (n[0] === "$" ? e.itemConfig = this.parseItemConfigFromProp(e.itemConfig, n, s) : e.props[n] = Y(n, e.props[n], s));
}), e;
}
getFinalPropsAndItemConfig() {
const t = this.type.propTypes ? this.normalizePropsByPropTypes(this.type.propTypes, this.inputProps) : this.inputProps;
return this.evaluateBoundProps(t, this.renderContext).concat(t, ...this.inputProps[K] || []).reduce((s, i) => this.parseAndMergeProps(s, i), { props: {}, itemConfig: {}, componentProp: {} });
const e = this.type.propTypes ? this.normalizePropsByPropTypes(this.type.propTypes, this.inputProps) : this.inputProps;
return this.evaluateBoundProps(e, this.renderContext).concat(e, ...this.inputProps[K] || []).reduce((s, i) => this.parseAndMergeProps(s, i), { props: {}, itemConfig: {}, componentProp: {} });
}
render() {
this.element !== this.placeholder && b(!1, "should never rerender"), this.renderContext = {
this.element !== this.placeholder && C(!1, "should never rerender"), this.renderContext = {
Fragment: F,

@@ -684,3 +684,3 @@ createElement: this.createElement,

pathContext: this.pathContext,
context: new ye(this.pathContext.hostPath),
context: new yt(this.pathContext.hostPath),
createPortal: this.createPortal,

@@ -693,3 +693,3 @@ createRef: this.createRef,

};
const t = Tt.collectEffect(), { props: r, itemConfig: n } = this.getFinalPropsAndItemConfig();
const e = Te.collectEffect(), { props: r, itemConfig: n } = this.getFinalPropsAndItemConfig();
this.itemConfig = n, this.props = r;

@@ -699,3 +699,3 @@ const s = this.type.propTypes ? this.normalizePropsWithCoerceValue(this.type.propTypes, r) : r;

const i = this.type(s, this.renderContext);
this.frame = t(), this.innerHost = O(i, this.placeholder, { ...this.pathContext, hostPath: M(this, this.pathContext.hostPath) }), this.innerHost.render(), this.refProp && this.attachRef(this.refProp), this.thisProp && this.attachThis(this.thisProp), this.effects.forEach((o) => {
this.frame = e(), this.innerHost = O(i, this.placeholder, { ...this.pathContext, hostPath: M(this, this.pathContext.hostPath) }), this.innerHost.render(), this.refProp && this.attachRef(this.refProp), this.thisProp && this.attachThis(this.thisProp), this.effects.forEach((o) => {
const a = o();

@@ -705,7 +705,7 @@ typeof a == "function" && this.destroyCallback.add(a);

}
destroy(t, r) {
destroy(e, r) {
var n, s;
this.refProp && this.detachRef(this.refProp), r || (n = this.frame) == null || n.forEach(
(i) => i.destroy()
), this.innerHost.destroy(t, r), this.layoutEffectDestroyHandles.forEach((i) => i()), this.destroyCallback.forEach((i) => i()), this.cleanupsOfExternalTarget.forEach((i) => i()), this.cleanupsOfExternalTarget.clear(), t || this.placeholder.remove(), (s = this.deleteLayoutEffectCallback) == null || s.call(this);
), this.innerHost.destroy(e, r), this.layoutEffectDestroyHandles.forEach((i) => i()), this.destroyCallback.forEach((i) => i()), this.cleanupsOfExternalTarget.forEach((i) => i()), this.cleanupsOfExternalTarget.clear(), e || this.placeholder.remove(), (s = this.deleteLayoutEffectCallback) == null || s.call(this);
}

@@ -715,29 +715,29 @@ };

let I = L;
class ye {
constructor(t) {
this.hostPath = t, this.valueByType = /* @__PURE__ */ new Map();
class yt {
constructor(e) {
this.hostPath = e, this.valueByType = /* @__PURE__ */ new Map();
}
get(t) {
get(e) {
let r = this.hostPath;
for (; r; ) {
if (r.node instanceof I && r.node.renderContext.context.valueByType.has(t))
return r.node.renderContext.context.valueByType.get(t);
if (r.node instanceof I && r.node.renderContext.context.valueByType.has(e))
return r.node.renderContext.context.valueByType.get(e);
r = r.prev;
}
}
set(t, r) {
this.valueByType.set(t, r);
set(e, r) {
this.valueByType.set(e, r);
}
}
const ge = "__nativeAttrs";
function _e(e, t) {
const r = e.bind(null);
return r.propTypes = e.propTypes, r.boundProps = $(r.boundProps).concat(t), r;
const gt = "__nativeAttrs";
function _t(t, e) {
const r = t.bind(null);
return r.propTypes = t.propTypes, r.boundProps = $(r.boundProps).concat(e), r;
}
function lt(e) {
return e != null && e.toString ? e.toString() : e === void 0 ? "undefined" : JSON.stringify(e);
function le(t) {
return t != null && t.toString ? t.toString() : t === void 0 ? "undefined" : JSON.stringify(t);
}
class Ee {
constructor(t, r, n) {
this.source = t, this.placeholder = r, this.pathContext = n, this.stopAutoRun = () => {
class Et {
constructor(e, r, n) {
this.source = e, this.placeholder = r, this.pathContext = n, this.stopAutoRun = () => {
}, this.element = this.placeholder;

@@ -748,11 +748,11 @@ }

}
replace(t) {
replace(e) {
if (this.element === this.placeholder) {
const r = document.createTextNode(lt(t));
const r = document.createTextNode(le(e));
this.parentElement.replaceChild(r, this.placeholder), this.element = r;
} else
this.element.nodeValue = lt(t);
this.element.nodeValue = le(e);
}
render() {
this.computed = pt(
this.computed = pe(
() => {

@@ -768,9 +768,9 @@ this.replace(this.source());

}
destroy(t, r) {
r || mt(this.computed), t || (this.element.remove(), this.placeholder.remove());
destroy(e, r) {
r || me(this.computed), e || (this.element.remove(), this.placeholder.remove());
}
}
class Se {
constructor(t, r, n) {
this.source = t, this.placeholder = r, this.pathContext = n, this.fragmentParent = document.createDocumentFragment();
class St {
constructor(e, r, n) {
this.source = e, this.placeholder = r, this.pathContext = n, this.fragmentParent = document.createDocumentFragment();
}

@@ -781,66 +781,66 @@ get parentElement() {

get element() {
var t;
return ((t = this.innerHost) == null ? void 0 : t.call(this).element) || this.placeholder;
var e;
return ((e = this.innerHost) == null ? void 0 : e.call(this).element) || this.placeholder;
}
render() {
let t = !1;
this.stopAutoRender = yt(({ onCleanup: r }) => {
let e = !1;
this.stopAutoRender = ye(({ onCleanup: r }) => {
const n = this.source(), s = document.createComment("computed node");
k(s, this.placeholder);
const i = O(n, s, { ...this.pathContext, hostPath: M(this, this.pathContext.hostPath) });
st.instance.pauseTracking(), i.render(), st.instance.resetTracking(), r(() => {
se.instance.pauseTracking(), i.render(), se.instance.resetTracking(), r(() => {
i.destroy(!1, !1);
});
}, (r) => {
t || (t = !0, queueMicrotask(() => {
r(), t = !1;
e || (e = !0, queueMicrotask(() => {
r(), e = !1;
}));
});
}
destroy(t, r) {
r || this.stopAutoRender(), t || this.placeholder.remove();
destroy(e, r) {
r || this.stopAutoRender(), e || this.placeholder.remove();
}
}
const we = w.isValidAttribute;
w.isValidAttribute = function(e, t) {
return e.startsWith("on") ? !0 : Array.isArray(t) && t.some(ut) || ut(t) ? !1 : we(e, t);
const At = A.isValidAttribute;
A.isValidAttribute = function(t, e) {
return t.startsWith("on") ? !0 : Array.isArray(e) && e.some(ue) || ue(e) ? !1 : At(t, e);
};
function ut(e) {
return vt(e) || q(e) || typeof e == "function";
function ue(t) {
return ve(t) || q(t) || typeof t == "function";
}
function j(e) {
return q(e) || typeof e == "function";
function j(t) {
return q(t) || typeof t == "function";
}
function At(e) {
if (Array.isArray(e))
return e.some(At);
for (const t in e)
if (t.startsWith(":") || G(e[t]))
function be(t) {
if (Array.isArray(t))
return t.some(be);
for (const e in t)
if (e.startsWith(":") || G(t[e]))
return !0;
return !1;
}
function et(e) {
return Array.isArray(e) ? e.some(et) : e.transition || e.transitionProperty;
function te(t) {
return Array.isArray(t) ? t.some(te) : t.transition || t.transitionProperty;
}
function U(e) {
var t, r;
return Array.isArray(e) ? e.flatMap(U) : ((t = e.transitionProperty) == null ? void 0 : t.split(",").map((n) => n.trim())) ?? ((r = e.transition) == null ? void 0 : r.split(",").map((n) => n.split(/\s+/)[0])) ?? [];
function U(t) {
var e, r;
return Array.isArray(t) ? t.flatMap(U) : ((e = t.transitionProperty) == null ? void 0 : e.split(",").map((n) => n.trim())) ?? ((r = t.transition) == null ? void 0 : r.split(",").map((n) => n.split(/\s+/)[0])) ?? [];
}
function bt(e) {
return Array.isArray(e) ? e.some(bt) : e["@keyframes"] !== void 0;
function we(t) {
return Array.isArray(t) ? t.some(we) : t["@keyframes"] !== void 0;
}
function ft(e) {
e.offsetHeight;
function fe(t) {
t.offsetHeight;
}
function Ae(e, t) {
function bt(t, e) {
const r = [];
let n = e;
let n = t;
for (; n; )
r.unshift(n.node), n = n.prev;
return `${r.map((s) => s.pathContext.elementPath.join("_")).join("-")}-${t.join("_")}`;
return `${r.map((s) => s.pathContext.elementPath.join("_")).join("-")}-${e.join("_")}`;
}
function be(e, t) {
function wt(t, e) {
let r;
const n = [];
let s = e;
let s = t;
for (; s; ) {

@@ -853,9 +853,9 @@ if (s.node instanceof I) {

}
return `gen-${(r == null ? void 0 : r.typeId) ?? "global"}-${n.map((i) => i.pathContext.elementPath.join("_")).join("-")}-${t.join("_")}`;
return `gen-${(r == null ? void 0 : r.typeId) ?? "global"}-${n.map((i) => i.pathContext.elementPath.join("_")).join("-")}-${e.join("_")}`;
}
class Ce {
class Ct {
constructor() {
this.styleScripts = /* @__PURE__ */ new Map(), this.elToStyleId = /* @__PURE__ */ new WeakMap();
}
getStyleSheetId(t, r, n) {
getStyleSheetId(e, r, n) {
if (n) {

@@ -870,10 +870,10 @@ const s = this.elToStyleId.get(n);

}
return be(t, r);
return wt(e, r);
}
stringifyStyleObject(t) {
return Object.entries(t).map(([r, n]) => `${r.replace(/([A-Z])/g, "-$1").toLowerCase()}:${tt(r, n)};`).join(`
stringifyStyleObject(e) {
return Object.entries(e).map(([r, n]) => `${r.replace(/([A-Z])/g, "-$1").toLowerCase()}:${ee(r, n)};`).join(`
`);
}
update(t, r, n, s, i = !1) {
const o = this.getStyleSheetId(t, r, i ? null : s);
update(e, r, n, s, i = !1) {
const o = this.getStyleSheetId(e, r, i ? null : s);
let a = this.styleScripts.get(o);

@@ -885,26 +885,26 @@ a || (a = new CSSStyleSheet(), document.adoptedStyleSheets = [...document.adoptedStyleSheets, a], this.styleScripts.set(o, a)), s.classList.add(o);

const l = U(c[0]);
return l.length && ft(s), Lt(c.slice(1).map((p) => () => {
const [f, m, d] = this.separateStyleObject(p, l);
return l.length && fe(s), Le(c.slice(1).map((p) => () => {
const [d, m, f] = this.separateStyleObject(p, l);
if (m && this.generateStyleContent(`.${o}`, m).forEach((g) => {
a.insertRule(g, a.cssRules.length);
}), f) {
const g = U(f);
l.push(...g), this.generateStyleContent(`.${o}`, f).forEach((u) => {
}), d) {
const g = U(d);
l.push(...g), this.generateStyleContent(`.${o}`, d).forEach((u) => {
a.insertRule(u, a.cssRules.length);
});
}
d && V(s, "style", d), et(p) && ft(s);
f && V(s, "style", f), te(p) && fe(s);
}));
}
isNestedStyleObject(t, r) {
return t !== "@keyframes" && G(r);
isNestedStyleObject(e, r) {
return e !== "@keyframes" && G(r);
}
separateStyleObject(t, r) {
separateStyleObject(e, r) {
let n, s, i;
for (const o in t)
this.isNestedStyleObject(o, t[o]) || o === "animation" && t.keyframes ? (s || (s = {}), s[o] = t[o]) : r.includes(o) ? (i || (i = {}), i[o] = t[o]) : (n || (n = {}), n[o] = t[o]);
for (const o in e)
this.isNestedStyleObject(o, e[o]) || o === "animation" && e.keyframes ? (s || (s = {}), s[o] = e[o]) : r.includes(o) ? (i || (i = {}), i[o] = e[o]) : (n || (n = {}), n[o] = e[o]);
return [n, s, i];
}
stringifyKeyFrameObject(t) {
return Object.entries(t).map(([r, n]) => `${r} {
stringifyKeyFrameObject(e) {
return Object.entries(e).map(([r, n]) => `${r} {
${this.stringifyStyleObject(n)}

@@ -914,3 +914,3 @@ }`).join(`

}
generateInlineAnimationContent(t, r) {
generateInlineAnimationContent(e, r) {
const n = [];

@@ -927,3 +927,3 @@ let s = "";

n.push(`
${t} {
${e} {
animation: ${i};

@@ -935,27 +935,27 @@ }

}
generateStyleContent(t, r) {
generateStyleContent(e, r) {
const n = { ...r }, s = [], i = {};
for (const c in n)
c === "@keyframes" || c === "animation" ? (i[c] = n[c], delete n[c]) : this.isNestedStyleObject(c, n[c]) && (s.push([c, n[c]]), delete n[c]);
const o = [`${t} {
const o = [`${e} {
${this.stringifyStyleObject(n)}
}`], a = this.generateInlineAnimationContent(t, i);
}`], a = this.generateInlineAnimationContent(e, i);
return o.push(...a), s.reduce((c, [l, p]) => {
if (l.startsWith("@"))
return c.concat(`${l} {
${this.generateStyleContent(t, p)}
${this.generateStyleContent(e, p)}
}`);
const f = /^(\s?)+&/.test(l) ? l.replace("&", t) : `${t} ${l}`;
return c.concat(this.generateStyleContent(f, p));
const d = /^(\s?)+&/.test(l) ? l.replace("&", e) : `${e} ${l}`;
return c.concat(this.generateStyleContent(d, p));
}, o);
}
}
const Pe = {
const xt = {
autoGenerateTestId: !1
}, B = class B {
constructor(t, r, n) {
this.source = t, this.placeholder = r, this.pathContext = n, this.forceHandleElement = !1, this.computed = void 0, this.element = this.placeholder, this.attachRefs = () => {
}, z = class z {
constructor(e, r, n) {
this.source = e, this.placeholder = r, this.pathContext = n, this.forceHandleElement = !1, this.computed = void 0, this.element = this.placeholder, this.attachRefs = () => {
var s;
(s = this.refHandles) == null || s.forEach(({ handle: i, el: o }) => {
w.attachRef(o, i);
A.attachRef(o, i);
});

@@ -965,7 +965,7 @@ }, this.parentElement = r.parentElement;

render() {
var t, r, n;
b(this.element === this.placeholder, "should never rerender"), this.element = this.source instanceof DocumentFragment ? document.createComment("fragment start") : this.source, this.collectInnerHost(), this.collectReactiveAttr(), this.collectRefHandles(), this.collectDetachStyledChildren(), (t = this.detachStyledChildren) != null && t.length && (this.forceHandleElement = !0), (r = this.reactiveHosts) == null || r.forEach((s) => s.render()), k(this.element, this.placeholder), this.source instanceof DocumentFragment && k(this.source, this.placeholder), (n = this.refHandles) != null && n.length && (this.pathContext.root.attached ? this.attachRefs() : this.removeAttachListener = this.pathContext.root.on("attach", this.attachRefs));
var e, r, n;
C(this.element === this.placeholder, "should never rerender"), this.element = this.source instanceof DocumentFragment ? document.createComment("fragment start") : this.source, this.collectInnerHost(), this.collectReactiveAttr(), this.collectRefHandles(), this.collectDetachStyledChildren(), (e = this.detachStyledChildren) != null && e.length && (this.forceHandleElement = !0), (r = this.reactiveHosts) == null || r.forEach((s) => s.render()), k(this.element, this.placeholder), this.source instanceof DocumentFragment && k(this.source, this.placeholder), (n = this.refHandles) != null && n.length && (this.pathContext.root.attached ? this.attachRefs() : this.removeAttachListener = this.pathContext.root.on("attach", this.attachRefs));
}
collectInnerHost() {
const t = this.source, { unhandledChildren: r } = t;
const e = this.source, { unhandledChildren: r } = e;
r && (this.reactiveHosts = r.map(

@@ -977,17 +977,17 @@ ({ placeholder: n, child: s, path: i }) => O(s, n, {

})
), t.unhandledChildren = void 0);
), e.unhandledChildren = void 0);
}
collectReactiveAttr() {
const t = this.source, r = t instanceof SVGElement, { unhandledAttr: n } = t;
const e = this.source, r = e instanceof SVGElement, { unhandledAttr: n } = e;
n && (this.attrAutoruns = [], n.forEach(({ el: s, key: i, value: o, path: a }) => {
s.hasAttribute("data-testid") || this.generateTestId(s, a), i.includes(":") || this.attrAutoruns.push(yt(() => {
s.hasAttribute("data-testid") || this.generateTestId(s, a), i.includes(":") || this.attrAutoruns.push(ye(() => {
this.updateAttribute(s, i, o, a, r);
}, !0));
}), t.unhandledAttr = void 0);
}), e.unhandledAttr = void 0);
}
updateAttribute(t, r, n, s, i) {
updateAttribute(e, r, n, s, i) {
const o = Array.isArray(n) ? n.map((a) => j(a) ? a() : a) : j(n) ? n() : n;
if (r === "style" && (At(o) || et(o) || bt(o)))
return B.styleManager.update(this.pathContext.hostPath, s, o, t, !1);
V(t, r, o, i);
if (r === "style" && (be(o) || te(o) || we(o)))
return z.styleManager.update(this.pathContext.hostPath, s, o, e, !1);
V(e, r, o, i);
}

@@ -1000,22 +1000,22 @@ collectRefHandles() {

}
generateTestId(t, r) {
if (!Pe.autoGenerateTestId) return;
const n = Ae(this.pathContext.hostPath, r);
V(t, "data-testid", n);
generateTestId(e, r) {
if (!xt.autoGenerateTestId) return;
const n = bt(this.pathContext.hostPath, r);
V(e, "data-testid", n);
}
destroy(t, r) {
destroy(e, r) {
var n, s, i, o;
r || (n = this.attrAutoruns) == null || n.forEach((a) => a()), (s = this.removeAttachListener) == null || s.call(this), (i = this.reactiveHosts) == null || i.forEach((a) => a.destroy(!0, r)), (o = this.refHandles) == null || o.forEach(({ handle: a }) => {
w.detachRef(a);
}), this.removeElements(t);
A.detachRef(a);
}), this.removeElements(e);
}
async removeElements(t) {
async removeElements(e) {
var r, n, s;
if (!t) {
if (!e) {
if ((r = this.detachStyledChildren) != null && r.length) {
const i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
(n = this.detachStyledChildren) == null || n.forEach(({ el: l, style: p }) => {
const f = getComputedStyle(l).transitionProperty.split(",").map((u) => u.trim()), m = Array.isArray(p) ? Object.assign({}, ...p.map((u) => j(u) ? u() : u)) : j(p) ? p() : p, d = Object.keys(m);
(f.includes("all") || d.some((u) => f.includes(u))) && i.add(l), m.animation && o.add(l);
}), await Promise.all(((s = this.detachStyledChildren) == null ? void 0 : s.map(({ el: l, style: p, path: f }) => this.updateAttribute(l, "style", p, f, l instanceof SVGElement))) || []);
const d = getComputedStyle(l).transitionProperty.split(",").map((u) => u.trim()), m = Array.isArray(p) ? Object.assign({}, ...p.map((u) => j(u) ? u() : u)) : j(p) ? p() : p, f = Object.keys(m);
(d.includes("all") || f.some((u) => d.includes(u))) && i.add(l), m.animation && o.add(l);
}), await Promise.all(((s = this.detachStyledChildren) == null ? void 0 : s.map(({ el: l, style: p, path: d }) => this.updateAttribute(l, "style", p, d, l instanceof SVGElement))) || []);
const a = Array.from(i), c = Array.from(o);

@@ -1029,62 +1029,55 @@ await Promise.all([

}
gt(this.element, this.placeholder, !0);
ge(this.element, this.placeholder, !0);
}
}
};
B.styleManager = new Ce();
let J = B;
function D(e, t) {
z.styleManager = new Ct();
let J = z;
function D(t, e) {
return new Promise((r) => {
e.addEventListener(t, r, { once: !0 });
t.addEventListener(e, r, { once: !0 });
});
}
class xe {
constructor(t, r, n) {
this.source = t, this.placeholder = r, this.pathContext = n, this.computed = void 0, this.childHosts = [], this.parentElement = r.parentElement;
class Pt {
constructor(e, r, n) {
this.source = e, this.placeholder = r, this.pathContext = n, this.computed = void 0, this.childHosts = [], this.parentElement = r.parentElement;
}
get element() {
var t;
return ((t = this.firstChild) == null ? void 0 : t.element) || this.firstChild || this.placeholder;
var e;
return ((e = this.firstChild) == null ? void 0 : e.element) || this.firstChild || this.placeholder;
}
render() {
if (this.element === this.placeholder) {
const t = document.createDocumentFragment();
const e = document.createDocumentFragment();
this.source.forEach((r, n) => {
if (typeof r == "string" || typeof r == "number") {
const s = document.createTextNode(r.toString());
t.appendChild(s), n === 0 && (this.firstChild = s);
e.appendChild(s), n === 0 && (this.firstChild = s);
} else if (r instanceof Text)
t.appendChild(r), n === 0 && (this.firstChild = r);
e.appendChild(r), n === 0 && (this.firstChild = r);
else {
const s = document.createComment("array item");
t.appendChild(s);
e.appendChild(s);
const i = O(r, s, { ...this.pathContext, hostPath: M(this, this.pathContext.hostPath) });
this.childHosts.push(i), n === 0 && (this.firstChild = i);
}
}), this.childHosts.forEach((r) => r.render()), k(t, this.placeholder);
}), this.childHosts.forEach((r) => r.render()), k(e, this.placeholder);
} else
throw new Error("should never rerender");
}
destroy(t, r) {
t || (gt(this.element, this.placeholder, !0), this.childHosts.forEach((n) => n.destroy(!0, r)));
destroy(e, r) {
e || (ge(this.element, this.placeholder, !0), this.childHosts.forEach((n) => n.destroy(!0, r)));
}
}
class Te {
constructor(t, r, n) {
this.source = t, this.placeholder = r, this.pathContext = n;
class Tt {
constructor(e, r, n) {
this.source = e, this.placeholder = r, this.pathContext = n;
}
createPlaceholder(t) {
return [t, document.createComment("frag item host")];
}
isOnlyChildrenOfParent() {
const t = this.placeholder.parentElement;
return (t == null ? void 0 : t.lastChild) === this.placeholder && t.firstChild === this.element;
}
get element() {
var t, r;
return ((r = (t = this.hosts) == null ? void 0 : t.at(0)) == null ? void 0 : r.element) || this.placeholder;
var e, r;
return ((r = (e = this.hosts) == null ? void 0 : e.data[0]) == null ? void 0 : r.element) || this.placeholder;
}
renderNewHosts(t) {
renderNewHosts(e) {
const r = document.createDocumentFragment();
return t.forEach((n) => {
return e.forEach((n) => {
r.appendChild(n.placeholder), n.render();

@@ -1094,22 +1087,34 @@ }), r;

render() {
const t = this;
this.hosts = this.source.map((r) => O(r, document.createComment("rx list item"), { ...this.pathContext, hostPath: M(this, this.pathContext.hostPath) })), this.hostRenderComputed = pt(
const e = this;
this.hosts = this.source.map((r) => O(r, document.createComment("rx list item"), { ...this.pathContext, hostPath: M(this, this.pathContext.hostPath) })), this.hostRenderComputed = pe(
function() {
return this.manualTrack(t.hosts, it.METHOD, ot.METHOD), this.manualTrack(t.hosts, it.EXPLICIT_KEY_CHANGE, ot.EXPLICIT_KEY_CHANGE), k(t.renderNewHosts(t.hosts), t.placeholder), null;
return this.manualTrack(e.hosts, ie.METHOD, oe.METHOD), this.manualTrack(e.hosts, ie.EXPLICIT_KEY_CHANGE, oe.EXPLICIT_KEY_CHANGE), k(e.renderNewHosts(e.hosts), e.placeholder), null;
},
function(n, s) {
s.forEach(({ method: i, argv: o, result: a, key: c, newValue: l, methodResult: p }, f) => {
s.forEach(({ method: i, argv: o, result: a, key: c, newValue: l, methodResult: p }, d) => {
var m;
if (i === "splice") {
const d = t.hosts.data.slice(o[0] + o.slice(2).length).find((h) => h.element.parentNode), g = o.slice(2);
let f = null;
const g = o.slice(2);
let u = o[0] + g.length;
for (; u < e.hosts.data.length; ) {
if (e.hosts.data[u].placeholder.parentNode) {
f = e.hosts.data[u];
break;
}
u++;
}
if (g.length) {
const h = t.renderNewHosts(g);
k(h, (d == null ? void 0 : d.element) || t.placeholder);
const E = e.renderNewHosts(g);
k(E, (f == null ? void 0 : f.element) || e.placeholder);
}
p.forEach((h) => h.destroy());
const h = p;
h.length && (e.hosts.data.length === 0 && !e.placeholder.nextSibling && // 当前节点是父 Host 的最后一个
!h[0].element.previousSibling && // 删除的Host 是父 Host 的第一个,说明从头删到了尾
h.every((b) => !b.forceHandleElement) ? (e.placeholder.parentNode.replaceChildren(e.placeholder), h.forEach((P) => P.destroy(!0))) : h.forEach((b) => b.destroy()));
} else if (i === void 0 && c !== void 0) {
const d = p;
d == null || d.destroy();
const f = p;
f == null || f.destroy();
const g = c;
k(t.hosts.at(g).placeholder, ((m = t.hosts.at(g + 1)) == null ? void 0 : m.element) || t.placeholder), t.hosts.at(g).render();
k(e.hosts.at(g).placeholder, ((m = e.hosts.at(g + 1)) == null ? void 0 : m.element) || e.placeholder), e.hosts.at(g).render();
} else

@@ -1122,22 +1127,22 @@ throw new Error("unknown trigger info");

}
destroy(t, r) {
destroy(e, r) {
var n;
r || ((n = this.hosts) == null || n.destroy(), mt(this.hostRenderComputed)), this.hosts.forEach((s) => s.destroy(t)), t || this.placeholder.remove();
r || ((n = this.hosts) == null || n.destroy(), me(this.hostRenderComputed)), this.hosts.forEach((s) => s.destroy(e)), e || this.placeholder.remove();
}
}
class ve {
constructor(t, r) {
this.pathContext = t, this.placeholder = r, this.element = document.createComment("empty");
class vt {
constructor(e, r) {
this.pathContext = e, this.placeholder = r, this.element = document.createComment("empty");
}
render() {
var t;
(t = this.placeholder.parentNode) == null || t.insertBefore(this.element, this.placeholder);
var e;
(e = this.placeholder.parentNode) == null || e.insertBefore(this.element, this.placeholder);
}
destroy(t) {
t || (this.element.remove(), this.placeholder.remove());
destroy(e) {
e || (this.element.remove(), this.placeholder.remove());
}
}
class Re {
constructor(t, r, n) {
this.source = t, this.placeholder = r, this.pathContext = n, this.element = this.placeholder;
class Rt {
constructor(e, r, n) {
this.source = e, this.placeholder = r, this.pathContext = n, this.element = this.placeholder;
}

@@ -1147,17 +1152,17 @@ render() {

}
destroy(t) {
t || this.placeholder.remove(), this.element.remove();
destroy(e) {
e || this.placeholder.remove(), this.element.remove();
}
}
function O(e, t, r) {
if (!(t instanceof Comment)) throw new Error("incorrect placeholder type");
function O(t, e, r) {
if (!(e instanceof Comment)) throw new Error("incorrect placeholder type");
let n;
return e instanceof HTMLElement || e instanceof SVGElement || e instanceof DocumentFragment ? n = new J(e, t, r) : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? n = new Re(e, t, r) : Array.isArray(e) ? n = new xe(e, t, r) : e == null ? n = new ve(r, t) : e instanceof _ ? n = new Te(e, t, r) : typeof e == "object" && typeof (e == null ? void 0 : e.type) == "function" ? n = new I(e, t, r) : q(e) ? n = new Ee(e, t, r) : typeof e == "function" ? n = new Se(e, t, r) : b(!1, `unknown child type ${e}`), n;
return t instanceof HTMLElement || t instanceof SVGElement || t instanceof DocumentFragment ? n = new J(t, e, r) : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? n = new Rt(t, e, r) : Array.isArray(t) ? n = new Pt(t, e, r) : t == null ? n = new vt(r, e) : t instanceof _ ? n = new Tt(t, e, r) : typeof t == "object" && typeof (t == null ? void 0 : t.type) == "function" ? n = new I(t, e, r) : q(t) ? n = new Et(t, e, r) : typeof t == "function" ? n = new St(t, e, r) : C(!1, `unknown child type ${t}`), n;
}
function Le(e, t) {
const r = /* @__PURE__ */ new Map(), n = t || {
function Lt(t, e) {
const r = /* @__PURE__ */ new Map(), n = e || {
hostPath: [],
elementPath: []
}, s = {
element: e,
element: t,
pathContext: n,

@@ -1168,3 +1173,3 @@ host: void 0,

const o = document.createComment("root"), a = document.createDocumentFragment();
return a.appendChild(o), s.host = O(i, o, n), s.host.render(), e.appendChild(a), e.isConnected && (s.dispatch("attach"), s.attached = !0), s.host;
return a.appendChild(o), s.host = O(i, o, n), s.host.render(), t.appendChild(a), t.isConnected && (s.dispatch("attach"), s.attached = !0), s.host;
},

@@ -1189,19 +1194,19 @@ destroy() {

}
function A(e) {
return (t) => (r) => {
if (e(r))
return t(r);
function w(t) {
return (e) => (r) => {
if (t(r))
return e(r);
};
}
const ze = A((e) => e.key === "ArrowUp"), Be = A((e) => e.key === "ArrowDown"), qe = A((e) => e.key === "ArrowLeft"), Ge = A((e) => e.key === "ArrowRight"), We = A((e) => e.key === "Enter"), Ke = A((e) => e.key === "Tab"), Xe = A((e) => e.key === "Escape"), Ye = A((e) => e.key === "Backspace"), Ue = A((e) => e.key === "Space"), Je = A((e) => e.button === 0), Ze = A((e) => e.button === 2), Qe = A((e) => e.button === 1), tr = (e, t) => A((r) => t != null && t.meta && !r.metaKey || t != null && t.ctrl && !r.ctrlKey || t != null && t.alt && !r.altKey || t != null && t.shift && !r.shiftKey ? !1 : r.key === e), er = A((e) => e.target === e.currentTarget);
function rr(e) {
let t;
const Bt = w((t) => t.key === "ArrowUp"), zt = w((t) => t.key === "ArrowDown"), qt = w((t) => t.key === "ArrowLeft"), Gt = w((t) => t.key === "ArrowRight"), Wt = w((t) => t.key === "Enter"), Kt = w((t) => t.key === "Tab"), Xt = w((t) => t.key === "Escape"), Yt = w((t) => t.key === "Backspace"), Ut = w((t) => t.key === "Space"), Jt = w((t) => t.button === 0), Zt = w((t) => t.button === 2), Qt = w((t) => t.button === 1), er = (t, e) => w((r) => e != null && e.meta && !r.metaKey || e != null && e.ctrl && !r.ctrlKey || e != null && e.alt && !r.altKey || e != null && e.shift && !r.shiftKey ? !1 : r.key === t), tr = w((t) => t.target === t.currentTarget);
function rr(t) {
let e;
function r(s) {
if (t !== void 0)
if (e !== void 0)
throw new Error("event transfer can only have one target");
t = s;
e = s;
}
function n(s) {
if (t) {
let i = e ? e(s) : s;
if (e) {
let i = t ? t(s) : s;
if (i === s) {

@@ -1211,3 +1216,3 @@ const o = s.constructor;

}
i && t.dispatchEvent(i);
i && e.dispatchEvent(i);
} else

@@ -1221,44 +1226,44 @@ console.warn("target is not ready");

}
function nr(e) {
return (t) => {
function nr(t) {
return (e) => {
var n;
const r = document.getSelection() && document.getSelection().rangeCount > 0 ? (n = document.getSelection()) == null ? void 0 : n.getRangeAt(0) : void 0;
e(t, r);
t(e, r);
};
}
function sr(e) {
return (t) => {
t.preventDefault(), e(t);
function sr(t) {
return (e) => {
e.preventDefault(), t(e);
};
}
function ir(e) {
return (t) => {
t.stopPropagation(), e(t);
function ir(t) {
return (e) => {
e.stopPropagation(), t(e);
};
}
function or({ contextType: e, value: t, children: r }, { context: n }) {
return n.set(e, t), r;
function or({ contextType: t, value: e, children: r }, { context: n }) {
return n.set(t, e), r;
}
function $e(e) {
const t = {
name: e,
function $t(t) {
const e = {
name: t,
Provider({ value: r, children: n }, { context: s }) {
return s.set(t, r), n;
return s.set(e, r), n;
},
valueType: null
};
return t;
return e;
}
const ke = $e("Form");
function He({ name: e, children: t, onChange: r, onSubmit: n, onClear: s, onReset: i, values: o }, {
const kt = $t("Form");
function Ht({ name: t, children: e, onChange: r, onSubmit: n, onClear: s, onReset: i, values: o }, {
createElement: a,
context: c
}) {
const l = {}, p = (h, S, x) => {
x ? (o.get(h) || o.set(h, new _([])), l[h] || (l[h] = []), o.get(h).push(S.value)(l[h]).push(S)) : (o.set(h, S.value), l[h] = S);
}, f = (h, S, x) => {
if (x) {
const T = o.get(h), v = T.findIndex((y) => y === S.value);
v() > -1 && T.splice(v(), 1);
const R = l[h].findIndex((y) => y === S);
const l = {}, p = (h, E, b) => {
b ? (o.get(h) || o.set(h, new _([])), l[h] || (l[h] = []), o.get(h).push(E.value)(l[h]).push(E)) : (o.set(h, E.value), l[h] = E);
}, d = (h, E, b) => {
if (b) {
const P = o.get(h), v = P.findIndex((y) => y === E.value);
v() > -1 && P.splice(v(), 1);
const R = l[h].findIndex((y) => y === E);
R > -1 && l[h].splice(R, 1);

@@ -1269,9 +1274,9 @@ } else

n == null || n(o);
}, d = () => {
}, f = () => {
Object.values(l).forEach((h) => {
Array.isArray(h) ? h.forEach((S) => S.reset()) : h.reset();
Array.isArray(h) ? h.forEach((E) => E.reset()) : h.reset();
}), i == null || i();
}, g = () => {
Object.values(l).forEach((h) => {
Array.isArray(h) ? h.forEach((S) => S.clear()) : h.clear();
Array.isArray(h) ? h.forEach((E) => E.clear()) : h.clear();
}), s == null || s();

@@ -1281,5 +1286,5 @@ }, u = () => {

};
return c.set(ke, { name: e, register: p, unregister: f, onChange: u, submit: m, reset: d, clear: g }), t;
return c.set(kt, { name: t, register: p, unregister: d, onChange: u, submit: m, reset: f, clear: g }), e;
}
He.propTypes = {
Ht.propTypes = {
name: H.string.isRequired,

@@ -1294,5 +1299,5 @@ values: H.rxMap(),

const ar = Symbol("ModalContext");
function cr(e) {
return (t, r) => {
if (t === window) {
function cr(t) {
return (e, r) => {
if (e === window) {
(() => {

@@ -1305,7 +1310,7 @@ const o = {

};
return z(o, r()) || r(o), o;
return B(o, r()) || r(o), o;
})();
return;
}
const n = t, s = () => {
const n = e, s = () => {
const i = n.getBoundingClientRect(), o = {

@@ -1317,7 +1322,7 @@ top: i.top,

};
return z(o, r()) || r(o), o;
return B(o, r()) || r(o), o;
};
if (Array.isArray(e)) {
if (Array.isArray(t)) {
const i = [];
return e.forEach((o) => {
return t.forEach((o) => {
const a = () => s();

@@ -1328,3 +1333,3 @@ o.target.addEventListener(o.event, a), i.push(() => o.target.removeEventListener(o.event, a));

};
} else if (e === "requestAnimationFrame") {
} else if (t === "requestAnimationFrame") {
const i = window.requestAnimationFrame(s);

@@ -1334,3 +1339,3 @@ return () => {

};
} else if (e === "requestIdleCallback") {
} else if (t === "requestIdleCallback") {
const i = window.requestIdleCallback(s);

@@ -1340,4 +1345,4 @@ return () => {

};
} else if (e.type === "interval") {
const i = window.setInterval(s, e.duration || 1e3);
} else if (t.type === "interval") {
const i = window.setInterval(s, t.duration || 1e3);
return () => {

@@ -1347,23 +1352,23 @@ window.clearInterval(i);

} else
b(!1, "invalid options.position");
C(!1, "invalid options.position");
};
}
const Z = /* @__PURE__ */ new WeakMap(), dt = new ResizeObserver((e) => {
e.forEach((t) => {
const r = t.target, n = Z.get(r);
const Z = /* @__PURE__ */ new WeakMap(), de = new ResizeObserver((t) => {
t.forEach((e) => {
const r = e.target, n = Z.get(r);
if (n) {
const s = {
width: t.contentRect.width,
height: t.contentRect.height,
borderBoxWidth: t.borderBoxSize[0].inlineSize,
borderBoxHeight: t.borderBoxSize[0].blockSize,
contentBoxWidth: t.contentBoxSize[0].inlineSize,
contentBoxHeight: t.contentBoxSize[0].blockSize
width: e.contentRect.width,
height: e.contentRect.height,
borderBoxWidth: e.borderBoxSize[0].inlineSize,
borderBoxHeight: e.borderBoxSize[0].blockSize,
contentBoxWidth: e.contentBoxSize[0].inlineSize,
contentBoxHeight: e.contentBoxSize[0].blockSize
};
z(s, n()) || n(s);
B(s, n()) || n(s);
}
});
});
function hr(e, t) {
if (e === window) {
function hr(t, e) {
if (t === window) {
const r = () => {

@@ -1374,31 +1379,31 @@ const n = {

};
return z(n, t()) || t(n), n;
return B(n, e()) || e(n), n;
};
return window.addEventListener("resize", r), r(), () => {
t(null), window.removeEventListener("resize", r);
e(null), window.removeEventListener("resize", r);
};
} else {
dt.observe(e), Z.set(e, t);
const r = e.getBoundingClientRect();
return t({
de.observe(t), Z.set(t, e);
const r = t.getBoundingClientRect();
return e({
width: r.width,
height: r.height
}), () => {
dt.unobserve(e), Z.delete(e), t(null);
de.unobserve(t), Z.delete(t), e(null);
};
}
}
function lr(e, t) {
function lr(t, e) {
const r = () => {
t(!0);
e(!0);
}, n = () => {
t(!1);
e(!1);
};
return e.addEventListener("focusin", r), e.addEventListener("focusout", n), () => {
e.removeEventListener("focusin", r), e.removeEventListener("focusout", n);
return t.addEventListener("focusin", r), t.addEventListener("focusout", n), () => {
t.removeEventListener("focusin", r), t.removeEventListener("focusout", n);
};
}
const Oe = "dragmove";
function ur(e) {
const t = (e == null ? void 0 : e.container) || document.body, r = (e == null ? void 0 : e.customEventName) || Oe;
const Ot = "dragmove";
function ur(t) {
const e = (t == null ? void 0 : t.container) || document.body, r = (t == null ? void 0 : t.customEventName) || Ot;
return function(s) {

@@ -1408,4 +1413,4 @@ const i = (o) => {

let l = a, p = c;
const f = (m) => {
const d = {
const d = (m) => {
const f = {
clientX: m.clientX,

@@ -1418,6 +1423,6 @@ clientY: m.clientY,

};
s.dispatchEvent(new CustomEvent(r, { detail: d }));
s.dispatchEvent(new CustomEvent(r, { detail: f }));
};
t.addEventListener("mousemove", f), t.addEventListener("mouseup", () => {
t.removeEventListener("mousemove", f);
e.addEventListener("mousemove", d), e.addEventListener("mouseup", () => {
e.removeEventListener("mousemove", d);
}, { once: !0 });

@@ -1430,6 +1435,6 @@ };

}
function fr(e) {
function fr(t) {
return function(r, n) {
const s = (i) => {
if (!e())
if (!t())
return;

@@ -1453,6 +1458,6 @@ const o = { clientX: i.clientX, offsetX: 0, clientY: i.clientY, offsetY: 0 }, a = (c) => {

}
function dr(e) {
function dr(t) {
return function(r, n) {
const s = (i) => {
n(e(r)), document.addEventListener("mouseup", () => {
n(t(r)), document.addEventListener("mouseup", () => {
n(null);

@@ -1466,13 +1471,13 @@ }, { once: !0 });

}
function pr(e, t) {
function pr(t, e) {
const r = () => {
t({
scrollTop: e.scrollTop,
scrollLeft: e.scrollLeft,
scrollWidth: e.scrollWidth,
scrollHeight: e.scrollHeight
e({
scrollTop: t.scrollTop,
scrollLeft: t.scrollLeft,
scrollWidth: t.scrollWidth,
scrollHeight: t.scrollHeight
});
};
return e.addEventListener("scroll", r), () => {
e.removeEventListener("scroll", r);
return t.addEventListener("scroll", r), () => {
t.removeEventListener("scroll", r);
};

@@ -1483,19 +1488,19 @@ }

or as ContextProvider,
Oe as DEFAULT_DRAG_MOVE_EVENT,
ye as DataContext,
He as Form,
ke as FormContext,
Ot as DEFAULT_DRAG_MOVE_EVENT,
yt as DataContext,
Ht as Form,
kt as FormContext,
F as Fragment,
ar as ModalContext,
ge as N_ATTR,
fe as Portal,
gt as N_ATTR,
ft as Portal,
H as PropTypes,
J as StaticHost,
Pe as StaticHostConfig,
xt as StaticHostConfig,
N as StyleSize,
kt as autoUnit,
_e as bindProps,
$e as createContext,
w as createElement,
Ie as createElementNS,
ke as autoUnit,
_t as bindProps,
$t as createContext,
A as createElement,
It as createElementNS,
rr as createEventTransfer,

@@ -1507,30 +1512,30 @@ O as createHost,

cr as createReactivePosition,
de as createRef,
Le as createRoot,
pe as createRxRef,
Me as dispatchEvent,
A as eventAlias,
De as jsx,
Fe as jsxDEV,
je as jsxs,
dt as createRef,
Lt as createRoot,
pt as createRxRef,
Mt as dispatchEvent,
w as eventAlias,
Dt as jsx,
Ft as jsxDEV,
jt as jsxs,
Y as mergeProp,
me as mergeProps,
Ye as onBackspaceKey,
Be as onDownKey,
Xe as onESCKey,
We as onEnterKey,
tr as onKey,
qe as onLeftKey,
Je as onLeftMouseDown,
Qe as onMiddleMouseDown,
Ge as onRightKey,
Ze as onRightMouseDown,
er as onSelf,
Ue as onSpaceKey,
Ke as onTabKey,
ze as onUpKey,
mt as mergeProps,
Yt as onBackspaceKey,
zt as onDownKey,
Xt as onESCKey,
Wt as onEnterKey,
er as onKey,
qt as onLeftKey,
Jt as onLeftMouseDown,
Qt as onMiddleMouseDown,
Gt as onRightKey,
Zt as onRightMouseDown,
tr as onSelf,
Ut as onSpaceKey,
Kt as onTabKey,
Bt as onUpKey,
lr as reactiveFocused,
pr as reactiveScrollPosition,
hr as reactiveSize,
Ve as setAutoUnitType,
Vt as setAutoUnitType,
nr as withCurrentRange,

@@ -1537,0 +1542,0 @@ sr as withPreventDefault,

{
"name": "axii",
"version": "2.6.69",
"version": "2.6.70",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc