@seontechnologies/seon-id-verification
Version:
An advanced SDK featuring web components for natural person identification through document scanning, facial recognition, hand gesture, and face turning detection, designed for secure and efficient user verification.
1,533 lines (1,532 loc) • 584 kB
JavaScript
var Dd = Object.defineProperty;
var Es = (e) => {
throw TypeError(e);
};
var zd = (e, t, r) => t in e ? Dd(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
var K = (e, t, r) => zd(e, typeof t != "symbol" ? t + "" : t, r), ki = (e, t, r) => t.has(e) || Es("Cannot " + r);
var _ = (e, t, r) => (ki(e, t, "read from private field"), r ? r.call(e) : t.get(e)), F = (e, t, r) => t.has(e) ? Es("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), B = (e, t, r, n) => (ki(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r), ie = (e, t, r) => (ki(e, t, "access private method"), r);
import { b as Md, s as Nd, h as xs, g as Fd, n as ql, u as Ld, c as $d, d as Bd, j as H, l as A, e as ja, a as ot, t as ee, f as Kt, i as so, k as lo, m as ks, L as Zi, S as Vd } from "./index-BbjzUPso.mjs";
import * as wn from "react";
import { useRef as Ti, useState as jr, useCallback as co, useEffect as Mn } from "react";
import { createCaptureUi as Gd } from "@microblink/capture";
import { C as Yl, a as Xl } from "./CameraCard-3JuZsKFO.mjs";
import { R as Zl } from "./RetryLimitHandler-iYWa2sKg.mjs";
import { C as jd } from "./CardContentWrapper-CzavS95e.mjs";
import { T as Ci } from "./TextWIcon-Nz1fc-c7.mjs";
import { u as Ql } from "./useQuery-Bnd3TQtL.mjs";
var Vt, Gt, Ce, _t, At, _o, Qi, Kl, Ud = (Kl = class extends Md {
constructor(r, n) {
super();
F(this, At);
F(this, Vt);
F(this, Gt);
F(this, Ce);
F(this, _t);
B(this, Vt, r), this.setOptions(n), this.bindMethods(), ie(this, At, _o).call(this);
}
bindMethods() {
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
}
setOptions(r) {
var o;
const n = this.options;
this.options = _(this, Vt).defaultMutationOptions(r), Nd(this.options, n) || _(this, Vt).getMutationCache().notify({
type: "observerOptionsUpdated",
mutation: _(this, Ce),
observer: this
}), n != null && n.mutationKey && this.options.mutationKey && xs(n.mutationKey) !== xs(this.options.mutationKey) ? this.reset() : ((o = _(this, Ce)) == null ? void 0 : o.state.status) === "pending" && _(this, Ce).setOptions(this.options);
}
onUnsubscribe() {
var r;
this.hasListeners() || (r = _(this, Ce)) == null || r.removeObserver(this);
}
onMutationUpdate(r) {
ie(this, At, _o).call(this), ie(this, At, Qi).call(this, r);
}
getCurrentResult() {
return _(this, Gt);
}
reset() {
var r;
(r = _(this, Ce)) == null || r.removeObserver(this), B(this, Ce, void 0), ie(this, At, _o).call(this), ie(this, At, Qi).call(this);
}
mutate(r, n) {
var o;
return B(this, _t, n), (o = _(this, Ce)) == null || o.removeObserver(this), B(this, Ce, _(this, Vt).getMutationCache().build(_(this, Vt), this.options)), _(this, Ce).addObserver(this), _(this, Ce).execute(r);
}
}, Vt = new WeakMap(), Gt = new WeakMap(), Ce = new WeakMap(), _t = new WeakMap(), At = new WeakSet(), _o = function() {
var n;
const r = ((n = _(this, Ce)) == null ? void 0 : n.state) ?? Fd();
B(this, Gt, {
...r,
isPending: r.status === "pending",
isSuccess: r.status === "success",
isError: r.status === "error",
isIdle: r.status === "idle",
mutate: this.mutate,
reset: this.reset
});
}, Qi = function(r) {
ql.batch(() => {
var n, o, i, a, s, l, c, u;
if (_(this, _t) && this.hasListeners()) {
const g = _(this, Gt).variables, d = _(this, Gt).context;
(r == null ? void 0 : r.type) === "success" ? ((o = (n = _(this, _t)).onSuccess) == null || o.call(n, r.data, g, d), (a = (i = _(this, _t)).onSettled) == null || a.call(i, r.data, null, g, d)) : (r == null ? void 0 : r.type) === "error" && ((l = (s = _(this, _t)).onError) == null || l.call(s, r.error, g, d), (u = (c = _(this, _t)).onSettled) == null || u.call(
c,
void 0,
r.error,
g,
d
));
}
this.listeners.forEach((g) => {
g(_(this, Gt));
});
});
}, Kl);
function Hd(e, t) {
const r = Ld(), [n] = wn.useState(
() => new Ud(
r,
e
)
);
wn.useEffect(() => {
n.setOptions(e);
}, [n, e]);
const o = wn.useSyncExternalStore(
wn.useCallback(
(a) => n.subscribe(ql.batchCalls(a)),
[n]
),
() => n.getCurrentResult(),
() => n.getCurrentResult()
), i = wn.useCallback(
(a, s) => {
n.mutate(a, s).catch($d);
},
[n]
);
if (o.error && Bd(n.options.throwOnError, [o.error]))
throw o.error;
return { ...o, mutate: i, mutateAsync: o.mutate };
}
const Wd = {
scan_the_front_side: "Scan the front side of the document",
flip_document: "Flip the document",
scan_the_back_side: "Scan the back side of the document",
scanning_wrong_side: "Scanning wrong side",
move_closer: "Move closer",
move_farther: "Move farther",
camera_angle_too_steep: "Keep document parallel to phone",
document_too_close_to_edge: "Move farther",
rotate_phone_animation: "Rotate card or turn phone to landscape",
rotate_phone: "Rotate phone or card",
lightning_too_bright: "Move to spot with less lighting",
lightning_too_dark: "Move to brighter spot",
blur_detected: "Keep document and phone still",
glare_detected: "Tilt or move document to remove reflection",
occluded: "Keep the document fully visible",
// Tutorial
need_help_tooltip: "Need help?",
onboarding_field_visible_title: "Keep all the details visible",
onboarding_field_visible_details: "Make sure you keep the document well lit. All document fields should be visible on the camera screen.",
tutorial_fields_visible_title: "Keep all the fields visible",
tutorial_fields_visible_start: "Start scanning",
tutorial_fields_visible_details: "Make sure you aren’t covering parts of the document with a finger, including the bottom lines. Also, watch out for hologram reflections that go over the document fields.",
tutorial_harsh_light_title: "Watch out for harsh light",
tutorial_harsh_light_details: "Avoid direct harsh light because it reflects from the document and can make parts of the document unreadable. If you can’t read data on the document, it won’t be visible to the camera either.",
tutorial_keep_still_title: "Keep still while scanning",
tutorial_keep_still_details: "Try to keep the phone and document still while scanning. Moving either can blur the image and make data on the document unreadable.",
// Camera
camera_unavailable: "Camera Unavailable",
camera_permission_error: "App doesn't have permission to use the camera, please change privacy settings",
settings: "Settings",
camera_media_capture_error: "Unable to capture media",
camera_unable_to_resume_session: "Unable to resume",
camera_query_in_progress: "",
// Shared
done: "Done",
cancel: "Cancel",
back: "Back",
next: "Next",
ok: "OK",
dismiss: "Dismiss"
}, Kd = () => H.jsx("div", { className: "tw-absolute tw-h-full tw-w-full", children: H.jsx("div", { className: "mb-style-scope mb-1lz2sq8 mb-video-screen", children: H.jsx("div", { className: "mb-79tnxm", children: H.jsxs("div", { children: [H.jsx("div", { className: "mb-1kst2vr", children: H.jsx("div", { className: "mb-qaqzbh", children: H.jsx("div", { className: "mb-1v17koz", style: {
opacity: "1",
background: "rgba(102, 102, 102, .5)"
}, children: H.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 100 100", className: "mb-1omzjeg", children: [H.jsx("path", { fill: "#fff", fillRule: "evenodd", d: "M50 7.692C26.634 7.692 7.692 26.634 7.692 50S26.634 92.308 50 92.308 92.308 73.366 92.308 50 73.366 7.692 50 7.692ZM0 50C0 22.386 22.386 0 50 0s50 22.386 50 50-22.386 50-50 50S0 77.614 0 50Z", clipRule: "evenodd", opacity: ".75" }), H.jsx("circle", { cx: "50", cy: "50", r: "4", fill: "#fff" })] }) }) }) }), H.jsx("div", { className: "mb-dcm5x3", children: H.jsx("div", { className: "mb-j1awg8", style: { opacity: "1", transform: "translateY(0px)" }, children: H.jsx("div", { children: A.document_capture_front_side }) }) })] }) }) }) });
class Jl {
constructor(t) {
K(this, "reqBody");
K(this, "responseData", null);
this.reqBody = t;
}
async postDocuments() {
const t = await ja({
endpoint: "/sessions/flow/init-document-photo-upload-v1",
method: "POST",
body: this.reqBody
});
return this.responseData = t, this.responseData;
}
async getResponseData() {
return this.responseData;
}
}
class Ro {
constructor({ url: t, image: r }) {
K(this, "UploadDocumentToBucketResponseData", {});
K(this, "url");
K(this, "image");
K(this, "filename");
if (!t)
throw new Error("URL is required");
this.url = t, this.image = r, this.filename = `${(/* @__PURE__ */ new Date()).getTime() + Math.floor(Math.random() + 1e5)}`;
}
async startUploadDocumentToBucket() {
const t = await this.imageDataToBlob(this.image), r = await ja({
endpoint: this.url,
method: "PUT",
body: t,
headers: {
"Content-Type": "image/png",
"Content-Disposition": `attachment; filename=${this.filename}.png`
},
excludeJWT: !0,
isFullUrl: !0,
binaryBody: !0
});
return this.UploadDocumentToBucketResponseData = r, this.UploadDocumentToBucketResponseData;
}
async getUploadDocumentToBucketResponse() {
return this.UploadDocumentToBucketResponseData;
}
async imageDataToBlob(t) {
const r = document.createElement("canvas");
r.id = "imageDataToBlob";
const n = r.getContext("2d");
return r.width = t.width, r.height = t.height, n == null || n.putImageData(t, 0, 0), new Promise((o) => {
r.toBlob((i) => {
const a = document.getElementById("imageDataToBlob");
a && a.remove(), o(i);
}, "image/png");
});
}
}
class ec {
constructor() {
K(this, "documentProcessingResultResponseData", {});
}
async getDocumentProcessing() {
const t = await ja({
endpoint: "/sessions/flow/document-processing-result-v1"
});
return this.documentProcessingResultResponseData = t, this.documentProcessingResultResponseData;
}
async getDocumentProcessingResult() {
return this.documentProcessingResultResponseData;
}
}
const Ke = new Zl("error_code_5", "document capture"), qd = ({ onNext: e, onScannerClosed: t, data: r, onBack: n, hardRefresh: o }) => {
var k;
const i = Ti(null), [a, s] = jr(), l = Ti(), c = Ti(!1), [u, g] = jr(!1), d = ot.config, [f, m] = jr(!1), p = co(() => {
var x;
s(void 0), m(!1), (x = l.current) == null || x.dismount(), t(), o();
}, [o, t]), v = co(async () => {
var y, S, I;
if (((y = ot.config.idVerificationSettings) == null ? void 0 : y.responseMethod) === "ASYNC") {
e();
return;
}
m(!0);
const T = ((S = ot.config.idVerificationSettings) == null ? void 0 : S.resultPollingCount) || 5, P = (((I = ot.config.idVerificationSettings) == null ? void 0 : I.resultPollingInterval) || 2) * 1e3, E = new ec();
for (let C = 0; C < T; C++) {
try {
await E.getDocumentProcessing();
const O = await E.getDocumentProcessingResult();
if (O != null && O.errorCode) {
ee({
logo: "general-error",
title: A.error_document_upload_title,
description: A.error_document_upload_description,
btnText: A.restart_button,
ERROR: O,
btnAction() {
Ke.handleRetry(() => n());
}
});
return;
}
if (Kt("Document processing result", O), (O == null ? void 0 : O.documentProcessingResult) === "SUCCESS") {
e();
return;
} else if ((O == null ? void 0 : O.documentProcessingResult) === "INVALID_ID_TYPE") {
Kt("Invalid ID type"), ee({
logo: "document-not-supported",
title: A.error_document_type_title,
description: A.error_document_type_description,
btnText: A.restart_button,
btnAction() {
Ke.handleRetry(() => n());
}
});
return;
} else if ((O == null ? void 0 : O.documentProcessingResult) === "INVALID_ID_COUNTRY") {
Kt("Invalid ID country"), ee({
logo: "country-not-supported",
title: A.error_invalid_country_title,
description: A.error_invalid_country_description,
btnText: A.restart_button,
btnAction() {
Ke.handleRetry(() => n());
}
});
return;
} else if ((O == null ? void 0 : O.documentProcessingResult) === "UNKNOWN_ERROR") {
Kt("Unknown error"), ee({
logo: "general-error",
title: A.error_liveness_upload_title,
description: A.error_document_upload_description,
btnText: A.restart_button,
btnAction() {
Ke.handleRetry(() => n());
}
});
return;
}
} catch {
ee({
logo: "general-error",
title: A.error_liveness_upload_title,
description: A.error_document_upload_description,
btnText: A.restart_button,
btnAction() {
Ke.handleRetry(() => n());
}
});
}
await new Promise((O) => setTimeout(O, P));
}
ee({
logo: "general-error",
title: A.error_liveness_upload_title,
description: A.error_document_upload_description,
btnText: A.restart_button,
btnAction() {
Ke.handleRetry(() => p());
}
});
}, [n, e, p]), w = co(async (x) => {
let T = 0;
x != null && x.firstCapture && (x != null && x.secondCapture) ? T = 2 : (x != null && x.firstCapture || x != null && x.secondCapture) && (T = 1);
const P = new Jl({
numberOfImages: T,
selectedIdCardType: r != null && r.country && (r != null && r.idType) ? {
country: r.country.value,
idType: r.idType.value
} : void 0
});
P.postDocuments().then(() => {
P.getResponseData().then((E) => {
var O, D, L, q, Q, J;
if (!E)
return;
if (!E.ok) {
ee({
logo: "general-error",
title: A.error_document_upload_title,
description: A.error_document_upload_description,
btnText: A.restart_button,
ERROR: E
});
return;
}
const y = ((O = x.firstCapture) == null ? void 0 : O.side) === "back" ? (D = x.secondCapture) == null ? void 0 : D.imageResult : (L = x.firstCapture) == null ? void 0 : L.imageResult, S = new Ro({
url: E.frontSideUploadUrl,
image: y
});
S.startUploadDocumentToBucket().then(() => {
S.getUploadDocumentToBucketResponse().then((U) => {
U.ok ? T === 1 && v() : ee({
logo: "general-error",
title: A.error_liveness_upload_title,
description: A.error_document_upload_description,
btnText: A.restart_button,
ERROR: U,
btnAction() {
Ke.handleRetry(() => p());
}
});
}).catch((U) => {
ee({
logo: "general-error",
title: A.error_document_upload_title,
description: A.error_document_upload_description,
btnText: A.restart_button,
ERROR: U
});
});
}).catch((U) => {
ee({
logo: "general-error",
title: A.error_liveness_upload_title,
description: A.error_document_upload_description,
btnText: A.restart_button,
ERROR: U,
btnAction() {
Ke.handleRetry(() => p());
}
});
});
const I = ((q = x.firstCapture) == null ? void 0 : q.side) === "back" ? (Q = x.firstCapture) == null ? void 0 : Q.imageResult : (J = x.secondCapture) == null ? void 0 : J.imageResult, C = new Ro({
url: E.backSideUploadUrl,
image: I
});
T > 1 && C.startUploadDocumentToBucket().then(() => (C.getUploadDocumentToBucketResponse().then((U) => {
if (!U.ok) {
ee({
logo: "general-error",
title: A.error_liveness_upload_title,
description: A.error_document_upload_description,
btnText: A.restart_button,
ERROR: U,
btnAction() {
Ke.handleRetry(() => p());
}
});
return;
}
}).catch((U) => {
ee({
logo: "general-error",
title: A.error_document_upload_title,
description: A.error_document_upload_description,
btnText: A.restart_button,
ERROR: U
});
}), E.ok)).then((U) => {
U && v();
});
}).catch((E) => {
ee({
logo: "general-error",
title: A.error_liveness_upload_title,
description: A.error_document_upload_description,
btnText: A.restart_button,
ERROR: E,
btnAction() {
Ke.handleRetry(() => p());
}
});
});
}).catch((E) => {
ee({
logo: "general-error",
title: A.error_liveness_upload_title,
description: A.error_document_upload_description,
btnText: A.restart_button,
ERROR: E,
btnAction() {
Ke.handleRetry(() => p());
}
});
});
}, [r, p, v]), b = co(async () => {
var x, T;
i.current && (l.current = await Gd({
sdkSettings: {
callbacks: {
onCaptureResult: (P) => {
s(P), w(P);
},
onFrameAnalysis: () => {
g(!0);
}
},
licenseKey: d.microblinkLicenseKey,
resourceUrl: "https://idv-static.seon.io/sdk-assets",
analyzerSettings: {
captureSingleSide: ((x = r == null ? void 0 : r.idType) == null ? void 0 : x.value) === "PASSPORT" || !1,
minimumDocumentDpi: 230,
blurPolicy: ot.config.blurCheckEnabled ? "relaxed" : "disabled",
captureStrategy: "default"
}
},
uiSettings: {
target: i.current,
destroyInstanceOnDismount: !0,
localization: Wd,
showTutorial: !1,
showErrorDialog: !1
}
}).catch((P) => {
ee({
ERROR: P,
btnAction() {
p(), lo("error", "error_code_4");
},
hideBtn: so()
});
}), (T = l.current) == null || T.captureSdk.subscribe((P, E) => {
var y, S, I, C, O, D;
P.errorState !== E.errorState && ((y = E.errorState) != null && y.message.toLowerCase().includes("No capable devices") || (S = P.errorState) != null && S.message.toLowerCase().includes("No capable devices") ? (ks("Camera error", P.errorState, E.errorState), ee({
logo: "camera-access",
title: A.error_device_support_title,
description: A.error_device_support_description,
btnText: A.error_device_support_button,
btnAction() {
p(), lo("error", "error_code_1");
},
hideBtn: so()
})) : (I = E.errorState) != null && I.message.toLowerCase().includes("camera") || (C = P.errorState) != null && C.message.toLowerCase().includes("camera") || (O = P.errorState) != null && O.message.toLowerCase().includes("video") || (D = E.errorState) != null && D.message.toLowerCase().includes("video") ? (ks("Camera error", P.errorState, E.errorState), ee({
logo: "camera-access",
title: A.error_no_camera_access_title,
description: A.error_no_camera_access_description,
btnText: A.error_no_camera_access_button,
btnAction() {
p();
}
})) : ee({
btnAction() {
p(), lo("error", "error_code_4");
},
hideBtn: so()
}));
}));
}, [
(k = r == null ? void 0 : r.idType) == null ? void 0 : k.value,
w,
p,
d.microblinkLicenseKey
]);
return Mn(() => {
c.current || b().then(() => {
c.current = !0;
}).catch((x) => {
ee({
btnAction() {
this.ERROR = x, p(), lo("error", "error_code_4");
},
hideBtn: so()
});
});
}, [b, p]), Mn(() => () => {
var x, T;
try {
(x = l.current) == null || x.captureSdk.destroy(), (T = l.current) == null || T.dismount(), l.current = void 0;
} catch {
}
}, []), H.jsxs(H.Fragment, { children: [f ? H.jsx(Zi, {}) : H.jsx(Yl, { className: "tw-w-full", children: H.jsx(Xl, { idPrefix: "blink-id-camera", onBack: u ? t : () => {
}, title: A.document_capture_flow_title, children: H.jsx("div", { className: "blink-id-container tw-min-h-[300px] tw-h-full tw-bg-web-secondary tw-text-center tw-relative", ref: i, children: H.jsx(Kd, {}) }) }) }), null] });
}, Yd = ({ onBack: e, onNext: t }) => H.jsx(Vd, { stepOf: "document-capture", className: "tw-w-full", children: H.jsx(jd, { idPrefix: "document-capture", description: A.tutorial_screen_description, backButtonText: A.back_to_previous_step_button, nextButtonText: A.tutorial_screen_scan_button, onBack: e, onNext: t, title: A.tutorial_screen_title, className: "tw-gap-12", children: H.jsxs("div", { className: "tw-flex tw-flex-col tw-gap-3", children: [H.jsx(Ci, { text: A.tutorial_screen_list_1 }), H.jsx(Ci, { text: A.tutorial_screen_list_2 }), H.jsx(Ci, { text: A.tutorial_screen_list_3 })] }) }) }), Xd = !1, Zd = (e, t) => e === t, Ze = Symbol("solid-proxy"), tc = typeof Proxy == "function", Do = Symbol("solid-track"), zo = {
equals: Zd
};
let rc = sc;
const Dt = 1, Mo = 2, nc = {
owned: null,
cleanups: null,
context: null,
owner: null
};
var Z = null;
let Oi = null, Qd = null, te = null, ye = null, Ct = null, di = 0;
function Ot(e, t) {
const r = te, n = Z, o = e.length === 0, i = t === void 0 ? n : t, a = o ? nc : {
owned: null,
cleanups: null,
context: i ? i.context : null,
owner: i
}, s = o ? e : () => e(() => ve(() => Fn(a)));
Z = a, te = null;
try {
return Jt(s, !0);
} finally {
te = r, Z = n;
}
}
function X(e, t) {
t = t ? Object.assign({}, zo, t) : zo;
const r = {
value: e,
observers: null,
observerSlots: null,
comparator: t.equals || void 0
}, n = (o) => (typeof o == "function" && (o = o(r.value)), ac(r, o));
return [ic.bind(r), n];
}
function Jd(e, t, r) {
const n = gi(e, t, !0, Dt);
an(n);
}
function oe(e, t, r) {
const n = gi(e, t, !1, Dt);
an(n);
}
function we(e, t, r) {
rc = s1;
const n = gi(e, t, !1, Dt);
(!r || !r.render) && (n.user = !0), Ct ? Ct.push(n) : an(n);
}
function W(e, t, r) {
r = r ? Object.assign({}, zo, r) : zo;
const n = gi(e, t, !0, 0);
return n.observers = null, n.observerSlots = null, n.comparator = r.equals || void 0, an(n), ic.bind(n);
}
function Nn(e) {
return Jt(e, !1);
}
function ve(e) {
if (te === null) return e();
const t = te;
te = null;
try {
return e();
} finally {
te = t;
}
}
function e1(e, t, r) {
const n = Array.isArray(e);
let o;
return (i) => {
let a;
if (n) {
a = Array(e.length);
for (let l = 0; l < e.length; l++) a[l] = e[l]();
} else a = e();
const s = ve(() => t(a, o, i));
return o = a, s;
};
}
function Xt(e) {
we(() => ve(e));
}
function fe(e) {
return Z === null || (Z.cleanups === null ? Z.cleanups = [e] : Z.cleanups.push(e)), e;
}
function Ji() {
return te;
}
function Ua() {
return Z;
}
function t1(e, t) {
const r = Z, n = te;
Z = e, te = null;
try {
return Jt(t, !0);
} catch (o) {
Ha(o);
} finally {
Z = r, te = n;
}
}
function r1(e) {
const t = te, r = Z;
return Promise.resolve().then(() => {
te = t, Z = r;
let n;
return Jt(e, !1), te = Z = null, n ? n.done : void 0;
});
}
const [n1, u6] = /* @__PURE__ */ X(!1);
function o1() {
return [n1, r1];
}
function Cr(e, t) {
const r = Symbol("context");
return {
id: r,
Provider: c1(r),
defaultValue: e
};
}
function Er(e) {
let t;
return Z && Z.context && (t = Z.context[e.id]) !== void 0 ? t : e.defaultValue;
}
function oc(e) {
const t = W(e), r = W(() => ea(t()));
return r.toArray = () => {
const n = r();
return Array.isArray(n) ? n : n != null ? [n] : [];
}, r;
}
function ic() {
if (this.sources && this.state)
if (this.state === Dt) an(this);
else {
const e = ye;
ye = null, Jt(() => Fo(this), !1), ye = e;
}
if (te) {
const e = this.observers ? this.observers.length : 0;
te.sources ? (te.sources.push(this), te.sourceSlots.push(e)) : (te.sources = [this], te.sourceSlots = [e]), this.observers ? (this.observers.push(te), this.observerSlots.push(te.sources.length - 1)) : (this.observers = [te], this.observerSlots = [te.sources.length - 1]);
}
return this.value;
}
function ac(e, t, r) {
let n = e.value;
return (!e.comparator || !e.comparator(n, t)) && (e.value = t, e.observers && e.observers.length && Jt(() => {
for (let o = 0; o < e.observers.length; o += 1) {
const i = e.observers[o], a = Oi && Oi.running;
a && Oi.disposed.has(i), (a ? !i.tState : !i.state) && (i.pure ? ye.push(i) : Ct.push(i), i.observers && lc(i)), a || (i.state = Dt);
}
if (ye.length > 1e6)
throw ye = [], new Error();
}, !1)), t;
}
function an(e) {
if (!e.fn) return;
Fn(e);
const t = di;
i1(e, e.value, t);
}
function i1(e, t, r) {
let n;
const o = Z, i = te;
te = Z = e;
try {
n = e.fn(t);
} catch (a) {
return e.pure && (e.state = Dt, e.owned && e.owned.forEach(Fn), e.owned = null), e.updatedAt = r + 1, Ha(a);
} finally {
te = i, Z = o;
}
(!e.updatedAt || e.updatedAt <= r) && (e.updatedAt != null && "observers" in e ? ac(e, n) : e.value = n, e.updatedAt = r);
}
function gi(e, t, r, n = Dt, o) {
const i = {
fn: e,
state: n,
updatedAt: null,
owned: null,
sources: null,
sourceSlots: null,
cleanups: null,
value: t,
owner: Z,
context: Z ? Z.context : null,
pure: r
};
return Z === null || Z !== nc && (Z.owned ? Z.owned.push(i) : Z.owned = [i]), i;
}
function No(e) {
if (e.state === 0) return;
if (e.state === Mo) return Fo(e);
if (e.suspense && ve(e.suspense.inFallback)) return e.suspense.effects.push(e);
const t = [e];
for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < di); )
e.state && t.push(e);
for (let r = t.length - 1; r >= 0; r--)
if (e = t[r], e.state === Dt)
an(e);
else if (e.state === Mo) {
const n = ye;
ye = null, Jt(() => Fo(e, t[0]), !1), ye = n;
}
}
function Jt(e, t) {
if (ye) return e();
let r = !1;
t || (ye = []), Ct ? r = !0 : Ct = [], di++;
try {
const n = e();
return a1(r), n;
} catch (n) {
r || (Ct = null), ye = null, Ha(n);
}
}
function a1(e) {
if (ye && (sc(ye), ye = null), e) return;
const t = Ct;
Ct = null, t.length && Jt(() => rc(t), !1);
}
function sc(e) {
for (let t = 0; t < e.length; t++) No(e[t]);
}
function s1(e) {
let t, r = 0;
for (t = 0; t < e.length; t++) {
const n = e[t];
n.user ? e[r++] = n : No(n);
}
for (t = 0; t < r; t++) No(e[t]);
}
function Fo(e, t) {
e.state = 0;
for (let r = 0; r < e.sources.length; r += 1) {
const n = e.sources[r];
if (n.sources) {
const o = n.state;
o === Dt ? n !== t && (!n.updatedAt || n.updatedAt < di) && No(n) : o === Mo && Fo(n, t);
}
}
}
function lc(e) {
for (let t = 0; t < e.observers.length; t += 1) {
const r = e.observers[t];
r.state || (r.state = Mo, r.pure ? ye.push(r) : Ct.push(r), r.observers && lc(r));
}
}
function Fn(e) {
let t;
if (e.sources)
for (; e.sources.length; ) {
const r = e.sources.pop(), n = e.sourceSlots.pop(), o = r.observers;
if (o && o.length) {
const i = o.pop(), a = r.observerSlots.pop();
n < o.length && (i.sourceSlots[a] = n, o[n] = i, r.observerSlots[n] = a);
}
}
if (e.tOwned) {
for (t = e.tOwned.length - 1; t >= 0; t--) Fn(e.tOwned[t]);
delete e.tOwned;
}
if (e.owned) {
for (t = e.owned.length - 1; t >= 0; t--) Fn(e.owned[t]);
e.owned = null;
}
if (e.cleanups) {
for (t = e.cleanups.length - 1; t >= 0; t--) e.cleanups[t]();
e.cleanups = null;
}
e.state = 0;
}
function l1(e) {
return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", {
cause: e
});
}
function Ha(e, t = Z) {
throw l1(e);
}
function ea(e) {
if (typeof e == "function" && !e.length) return ea(e());
if (Array.isArray(e)) {
const t = [];
for (let r = 0; r < e.length; r++) {
const n = ea(e[r]);
Array.isArray(n) ? t.push.apply(t, n) : t.push(n);
}
return t;
}
return e;
}
function c1(e, t) {
return function(n) {
let o;
return oe(() => o = ve(() => (Z.context = {
...Z.context,
[e]: n.value
}, oc(() => n.children))), void 0), o;
};
}
const ta = Symbol("fallback");
function Lo(e) {
for (let t = 0; t < e.length; t++) e[t]();
}
function u1(e, t, r = {}) {
let n = [], o = [], i = [], a = 0, s = t.length > 1 ? [] : null;
return fe(() => Lo(i)), () => {
let l = e() || [], c = l.length, u, g;
return l[Do], ve(() => {
let f, m, p, v, w, b, k, x, T;
if (c === 0)
a !== 0 && (Lo(i), i = [], n = [], o = [], a = 0, s && (s = [])), r.fallback && (n = [ta], o[0] = Ot((P) => (i[0] = P, r.fallback())), a = 1);
else if (a === 0) {
for (o = new Array(c), g = 0; g < c; g++)
n[g] = l[g], o[g] = Ot(d);
a = c;
} else {
for (p = new Array(c), v = new Array(c), s && (w = new Array(c)), b = 0, k = Math.min(a, c); b < k && n[b] === l[b]; b++) ;
for (k = a - 1, x = c - 1; k >= b && x >= b && n[k] === l[x]; k--, x--)
p[x] = o[k], v[x] = i[k], s && (w[x] = s[k]);
for (f = /* @__PURE__ */ new Map(), m = new Array(x + 1), g = x; g >= b; g--)
T = l[g], u = f.get(T), m[g] = u === void 0 ? -1 : u, f.set(T, g);
for (u = b; u <= k; u++)
T = n[u], g = f.get(T), g !== void 0 && g !== -1 ? (p[g] = o[u], v[g] = i[u], s && (w[g] = s[u]), g = m[g], f.set(T, g)) : i[u]();
for (g = b; g < c; g++)
g in p ? (o[g] = p[g], i[g] = v[g], s && (s[g] = w[g], s[g](g))) : o[g] = Ot(d);
o = o.slice(0, a = c), n = l.slice(0);
}
return o;
});
function d(f) {
if (i[g] = f, s) {
const [m, p] = X(g);
return s[g] = p, t(l[g], m);
}
return t(l[g]);
}
};
}
function d1(e, t, r = {}) {
let n = [], o = [], i = [], a = [], s = 0, l;
return fe(() => Lo(i)), () => {
const c = e() || [], u = c.length;
return c[Do], ve(() => {
if (u === 0)
return s !== 0 && (Lo(i), i = [], n = [], o = [], s = 0, a = []), r.fallback && (n = [ta], o[0] = Ot((d) => (i[0] = d, r.fallback())), s = 1), o;
for (n[0] === ta && (i[0](), i = [], n = [], o = [], s = 0), l = 0; l < u; l++)
l < n.length && n[l] !== c[l] ? a[l](() => c[l]) : l >= n.length && (o[l] = Ot(g));
for (; l < n.length; l++)
i[l]();
return s = a.length = i.length = u, n = c.slice(0), o = o.slice(0, s);
});
function g(d) {
i[l] = d;
const [f, m] = X(c[l]);
return a[l] = m, t(f, l);
}
};
}
function h(e, t) {
return ve(() => e(t || {}));
}
function uo() {
return !0;
}
const ra = {
get(e, t, r) {
return t === Ze ? r : e.get(t);
},
has(e, t) {
return t === Ze ? !0 : e.has(t);
},
set: uo,
deleteProperty: uo,
getOwnPropertyDescriptor(e, t) {
return {
configurable: !0,
enumerable: !0,
get() {
return e.get(t);
},
set: uo,
deleteProperty: uo
};
},
ownKeys(e) {
return e.keys();
}
};
function Pi(e) {
return (e = typeof e == "function" ? e() : e) ? e : {};
}
function g1() {
for (let e = 0, t = this.length; e < t; ++e) {
const r = this[e]();
if (r !== void 0) return r;
}
}
function le(...e) {
let t = !1;
for (let a = 0; a < e.length; a++) {
const s = e[a];
t = t || !!s && Ze in s, e[a] = typeof s == "function" ? (t = !0, W(s)) : s;
}
if (tc && t)
return new Proxy({
get(a) {
for (let s = e.length - 1; s >= 0; s--) {
const l = Pi(e[s])[a];
if (l !== void 0) return l;
}
},
has(a) {
for (let s = e.length - 1; s >= 0; s--)
if (a in Pi(e[s])) return !0;
return !1;
},
keys() {
const a = [];
for (let s = 0; s < e.length; s++) a.push(...Object.keys(Pi(e[s])));
return [...new Set(a)];
}
}, ra);
const r = {}, n = /* @__PURE__ */ Object.create(null);
for (let a = e.length - 1; a >= 0; a--) {
const s = e[a];
if (!s) continue;
const l = Object.getOwnPropertyNames(s);
for (let c = l.length - 1; c >= 0; c--) {
const u = l[c];
if (u === "__proto__" || u === "constructor") continue;
const g = Object.getOwnPropertyDescriptor(s, u);
if (!n[u])
n[u] = g.get ? {
enumerable: !0,
configurable: !0,
get: g1.bind(r[u] = [g.get.bind(s)])
} : g.value !== void 0 ? g : void 0;
else {
const d = r[u];
d && (g.get ? d.push(g.get.bind(s)) : g.value !== void 0 && d.push(() => g.value));
}
}
}
const o = {}, i = Object.keys(n);
for (let a = i.length - 1; a >= 0; a--) {
const s = i[a], l = n[s];
l && l.get ? Object.defineProperty(o, s, l) : o[s] = l ? l.value : void 0;
}
return o;
}
function xr(e, ...t) {
if (tc && Ze in e) {
const o = new Set(t.length > 1 ? t.flat() : t[0]), i = t.map((a) => new Proxy({
get(s) {
return a.includes(s) ? e[s] : void 0;
},
has(s) {
return a.includes(s) && s in e;
},
keys() {
return a.filter((s) => s in e);
}
}, ra));
return i.push(new Proxy({
get(a) {
return o.has(a) ? void 0 : e[a];
},
has(a) {
return o.has(a) ? !1 : a in e;
},
keys() {
return Object.keys(e).filter((a) => !o.has(a));
}
}, ra)), i;
}
const r = {}, n = t.map(() => ({}));
for (const o of Object.getOwnPropertyNames(e)) {
const i = Object.getOwnPropertyDescriptor(e, o), a = !i.get && !i.set && i.enumerable && i.writable && i.configurable;
let s = !1, l = 0;
for (const c of t)
c.includes(o) && (s = !0, a ? n[l][o] = i.value : Object.defineProperty(n[l], o, i)), ++l;
s || (a ? r[o] = i.value : Object.defineProperty(r, o, i));
}
return [...n, r];
}
let f1 = 0;
function Or() {
return `cl-${f1++}`;
}
const cc = (e) => `Stale read from <${e}>.`;
function Ts(e) {
const t = "fallback" in e && {
fallback: () => e.fallback
};
return W(u1(() => e.each, e.children, t || void 0));
}
function uc(e) {
const t = "fallback" in e && {
fallback: () => e.fallback
};
return W(d1(() => e.each, e.children, t || void 0));
}
function j(e) {
const t = e.keyed, r = W(() => e.when, void 0, void 0), n = t ? r : W(r, void 0, {
equals: (o, i) => !o == !i
});
return W(() => {
const o = n();
if (o) {
const i = e.children;
return typeof i == "function" && i.length > 0 ? ve(() => i(t ? o : () => {
if (!ve(n)) throw cc("Show");
return r();
})) : i;
}
return e.fallback;
}, void 0, void 0);
}
function dc(e) {
const t = oc(() => e.children), r = W(() => {
const n = t(), o = Array.isArray(n) ? n : [n];
let i = () => {
};
for (let a = 0; a < o.length; a++) {
const s = a, l = o[a], c = i, u = W(() => c() ? void 0 : l.when, void 0, void 0), g = l.keyed ? u : W(u, void 0, {
equals: (d, f) => !d == !f
});
i = () => c() || (g() ? [s, u, l] : void 0);
}
return i;
});
return W(() => {
const n = r()();
if (!n) return e.fallback;
const [o, i, a] = n, s = a.children;
return typeof s == "function" && s.length > 0 ? ve(() => s(a.keyed ? i() : () => {
var c;
if (((c = ve(r)()) == null ? void 0 : c[0]) !== o) throw cc("Match");
return i();
})) : s;
}, void 0, void 0);
}
function yt(e) {
return e;
}
const h1 = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"], p1 = /* @__PURE__ */ new Set(["className", "value", "readOnly", "noValidate", "formNoValidate", "isMap", "noModule", "playsInline", ...h1]), m1 = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]), v1 = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
className: "class",
htmlFor: "for"
}), b1 = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
class: "className",
novalidate: {
$: "noValidate",
FORM: 1
},
formnovalidate: {
$: "formNoValidate",
BUTTON: 1,
INPUT: 1
},
ismap: {
$: "isMap",
IMG: 1
},
nomodule: {
$: "noModule",
SCRIPT: 1
},
playsinline: {
$: "playsInline",
VIDEO: 1
},
readonly: {
$: "readOnly",
INPUT: 1,
TEXTAREA: 1
}
});
function y1(e, t) {
const r = b1[e];
return typeof r == "object" ? r[t] ? r.$ : void 0 : r;
}
const w1 = /* @__PURE__ */ new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]), _1 = /* @__PURE__ */ new Set([
"altGlyph",
"altGlyphDef",
"altGlyphItem",
"animate",
"animateColor",
"animateMotion",
"animateTransform",
"circle",
"clipPath",
"color-profile",
"cursor",
"defs",
"desc",
"ellipse",
"feBlend",
"feColorMatrix",
"feComponentTransfer",
"feComposite",
"feConvolveMatrix",
"feDiffuseLighting",
"feDisplacementMap",
"feDistantLight",
"feDropShadow",
"feFlood",
"feFuncA",
"feFuncB",
"feFuncG",
"feFuncR",
"feGaussianBlur",
"feImage",
"feMerge",
"feMergeNode",
"feMorphology",
"feOffset",
"fePointLight",
"feSpecularLighting",
"feSpotLight",
"feTile",
"feTurbulence",
"filter",
"font",
"font-face",
"font-face-format",
"font-face-name",
"font-face-src",
"font-face-uri",
"foreignObject",
"g",
"glyph",
"glyphRef",
"hkern",
"image",
"line",
"linearGradient",
"marker",
"mask",
"metadata",
"missing-glyph",
"mpath",
"path",
"pattern",
"polygon",
"polyline",
"radialGradient",
"rect",
"set",
"stop",
"svg",
"switch",
"symbol",
"text",
"textPath",
"tref",
"tspan",
"use",
"view",
"vkern"
]), S1 = {
xlink: "http://www.w3.org/1999/xlink",
xml: "http://www.w3.org/XML/1998/namespace"
}, Jr = (e) => W(() => e());
function E1(e, t, r) {
let n = r.length, o = t.length, i = n, a = 0, s = 0, l = t[o - 1].nextSibling, c = null;
for (; a < o || s < i; ) {
if (t[a] === r[s]) {
a++, s++;
continue;
}
for (; t[o - 1] === r[i - 1]; )
o--, i--;
if (o === a) {
const u = i < n ? s ? r[s - 1].nextSibling : r[i - s] : l;
for (; s < i; ) e.insertBefore(r[s++], u);
} else if (i === s)
for (; a < o; )
(!c || !c.has(t[a])) && t[a].remove(), a++;
else if (t[a] === r[i - 1] && r[s] === t[o - 1]) {
const u = t[--o].nextSibling;
e.insertBefore(r[s++], t[a++].nextSibling), e.insertBefore(r[--i], u), t[o] = r[i];
} else {
if (!c) {
c = /* @__PURE__ */ new Map();
let g = s;
for (; g < i; ) c.set(r[g], g++);
}
const u = c.get(t[a]);
if (u != null)
if (s < u && u < i) {
let g = a, d = 1, f;
for (; ++g < o && g < i && !((f = c.get(t[g])) == null || f !== u + d); )
d++;
if (d > u - s) {
const m = t[a];
for (; s < u; ) e.insertBefore(r[s++], m);
} else e.replaceChild(r[s++], t[a++]);
} else a++;
else t[a++].remove();
}
}
}
const Cs = "_$DX_DELEGATE";
function x1(e, t, r, n = {}) {
let o;
return Ot((i) => {
o = i, t === document ? e() : M(t, e(), t.firstChild ? null : void 0, r);
}, n.owner), () => {
o(), t.textContent = "";
};
}
function z(e, t, r, n) {
let o;
const i = () => {
const s = document.createElement("template");
return s.innerHTML = e, s.content.firstChild;
}, a = () => (o || (o = i())).cloneNode(!0);
return a.cloneNode = a, a;
}
function fi(e, t = window.document) {
const r = t[Cs] || (t[Cs] = /* @__PURE__ */ new Set());
for (let n = 0, o = e.length; n < o; n++) {
const i = e[n];
r.has(i) || (r.add(i), t.addEventListener(i, R1));
}
}
function na(e, t, r) {
r == null ? e.removeAttribute(t) : e.setAttribute(t, r);
}
function k1(e, t, r, n) {
n == null ? e.removeAttributeNS(t, r) : e.setAttributeNS(t, r, n);
}
function T1(e, t, r) {
r ? e.setAttribute(t, "") : e.removeAttribute(t);
}
function se(e, t) {
t == null ? e.removeAttribute("class") : e.className = t;
}
function C1(e, t, r, n) {
if (n)
Array.isArray(r) ? (e[`$$${t}`] = r[0], e[`$$${t}Data`] = r[1]) : e[`$$${t}`] = r;
else if (Array.isArray(r)) {
const o = r[0];
e.addEventListener(t, r[0] = (i) => o.call(e, r[1], i));
} else e.addEventListener(t, r, typeof r != "function" && r);
}
function O1(e, t, r = {}) {
const n = Object.keys(t || {}), o = Object.keys(r);
let i, a;
for (i = 0, a = o.length; i < a; i++) {
const s = o[i];
!s || s === "undefined" || t[s] || (Os(e, s, !1), delete r[s]);
}
for (i = 0, a = n.length; i < a; i++) {
const s = n[i], l = !!t[s];
!s || s === "undefined" || r[s] === l || !l || (Os(e, s, !0), r[s] = l);
}
return r;
}
function P1(e, t, r) {
if (!t) return r ? na(e, "style") : t;
const n = e.style;
if (typeof t == "string") return n.cssText = t;
typeof r == "string" && (n.cssText = r = void 0), r || (r = {}), t || (t = {});
let o, i;
for (i in r)
t[i] == null && n.removeProperty(i), delete r[i];
for (i in t)
o = t[i], o !== r[i] && (n.setProperty(i, o), r[i] = o);
return r;
}
function re(e, t = {}, r, n) {
const o = {};
return n || oe(() => o.children = Ln(e, t.children, o.children)), oe(() => typeof t.ref == "function" && Be(t.ref, e)), oe(() => A1(e, t, r, !0, o, !0)), o;
}
function Be(e, t, r) {
return ve(() => e(t, r));
}
function M(e, t, r, n) {
if (r !== void 0 && !n && (n = []), typeof t != "function") return Ln(e, t, n, r);
oe((o) => Ln(e, t(), o, r), n);
}
function A1(e, t, r, n, o = {}, i = !1) {
t || (t = {});
for (const a in o)
if (!(a in t)) {
if (a === "children") continue;
o[a] = Ps(e, a, null, o[a], r, i, t);
}
for (const a in t) {
if (a === "children")
continue;
const s = t[a];
o[a] = Ps(e, a, s, o[a], r, i, t);
}
}
function I1(e) {
return e.toLowerCase().replace(/-([a-z])/g, (t, r) => r.toUpperCase());
}
function Os(e, t, r) {
const n = t.trim().split(/\s+/);
for (let o = 0, i = n.length; o < i; o++) e.classList.toggle(n[o], r);
}
function Ps(e, t, r, n, o, i, a) {
let s, l, c, u, g;
if (t === "style") return P1(e, r, n);
if (t === "classList") return O1(e, r, n);
if (r === n) return n;
if (t === "ref")
i || r(e);
else if (t.slice(0, 3) === "on:") {
const d = t.slice(3);
n && e.removeEventListener(d, n, typeof n != "function" && n), r && e.addEventListener(d, r, typeof r != "function" && r);
} else if (t.slice(0, 10) === "oncapture:") {
const d = t.slice(10);
n && e.removeEventListener(d, n, !0), r && e.addEventListener(d, r, !0);
} else if (t.slice(0, 2) === "on") {
const d = t.slice(2).toLowerCase(), f = w1.has(d);
if (!f && n) {
const m = Array.isArray(n) ? n[0] : n;
e.removeEventListener(d, m);
}
(f || r) && (C1(e, d, r, f), f && fi([d]));
} else if (t.slice(0, 5) === "attr:")
na(e, t.slice(5), r);
else if (t.slice(0, 5) === "bool:")
T1(e, t.slice(5), r);
else if ((g = t.slice(0, 5) === "prop:") || (c = m1.has(t)) || !o && ((u = y1(t, e.tagName)) || (l = p1.has(t))) || (s = e.nodeName.includes("-") || "is" in a))
g && (t = t.slice(5), l = !0), t === "class" || t === "className" ? se(e, r) : s && !l && !c ? e[I1(t)] = r : e[u || t] = r;
else {
const d = o && t.indexOf(":") > -1 && S1[t.split(":")[0]];
d ? k1(e, d, t, r) : na(e, v1[t] || t, r);
}
return r;
}
function R1(e) {
let t = e.target;
const r = `$$${e.type}`, n = e.target, o = e.currentTarget, i = (l) => Object.defineProperty(e, "target", {
configurable: !0,
value: l
}), a = () => {
const l = t[r];
if (l && !t.disabled) {
const c = t[`${r}Data`];
if (c !== void 0 ? l.call(t, c, e) : l.call(t, e), e.cancelBubble) return;
}
return t.host && typeof t.host != "string" && !t.host._$host && t.contains(e.target) && i(t.host), !0;
}, s = () => {
for (; a() && (t = t._$host || t.parentNode || t.host); ) ;
};
if (Object.defineProperty(e, "currentTarget", {
configurable: !0,
get() {
return t || document;
}
}), e.composedPath) {
const l = e.composedPath();
i(l[0]);
for (let c = 0; c < l.length - 2 && (t = l[c], !!a()); c++) {
if (t._$host) {
t = t._$host, s();
break;
}
if (t.parentNode === o)
break;
}
} else s();
i(n);
}
function Ln(e, t, r, n, o) {
for (; typeof r == "function"; ) r = r();
if (t === r) return r;
const i = typeof t, a = n !== void 0;
if (e = a && r[0] && r[0].parentNode || e, i === "string" || i === "number") {
if (i === "number" && (t = t.toString(), t === r))
return r;
if (a) {
let s = r[0];
s && s.nodeType === 3 ? s.data !== t && (s.data = t) : s = document.createTextNode(t), r = Dr(e, r, n, s);
} else
r !== "" && typeof r == "string" ? r = e.firstChild.data = t : r = e.textContent = t;
} else if (t == null || i === "boolean")
r = Dr(e, r, n);
else {
if (i === "function")
return oe(() => {
let s = t();
for (; typeof s == "function"; ) s = s();
r = Ln(e, s, r, n);
}), () => r;
if (Array.isArray(t)) {
const s = [], l = r && Array.isArray(r);
if (oa(s, t, r, o))
return oe(() => r = Ln(e, s, r, n, !0)), () => r;
if (s.length === 0) {
if (r = Dr(e, r, n), a) return r;
} else l ? r.length === 0 ? As(e, s, n) : E1(e, r, s) : (r && Dr(e), As(e, s));
r = s;
} else if (t.nodeType) {
if (Array.isArray(r)) {
if (a) return r = Dr(e, r, n, t);
Dr(e, r, null, t);
} else r == null || r === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
r = t;
}
}
return r;
}
function oa(e, t, r, n) {
let o = !1;
for (let i = 0, a = t.length; i < a; i++) {
let s = t[i], l = r && r[e.length], c;
if (!(s == null || s === !0 || s === !1)) if ((c = typeof s) == "object" && s.nodeType)
e.push(s);
else if (Array.isArray(s))
o = oa(e, s, l) || o;
else if (c === "function")
if (n) {
for (; typeof s == "function"; ) s = s();
o = oa(e, Array.isArray(s) ? s : [s], Array.isArray(l) ? l : [l]) || o;
} else
e.push(s), o = !0;
else {
const u = String(s);
l && l.nodeType === 3 && l.data === u ? e.push(l) : e.push(document.createTextNode(u));
}
}
return o;
}
function As(e, t, r = null) {
for (let n = 0, o = t.length; n < o; n++) e.insertBefore(t[n], r);
}
function Dr(e, t, r, n) {
if (r === void 0) return e.textContent = "";
const o = n || document.createTextNode("");
if (t.length) {
let i = !1;
for (let a = t.length - 1; a >= 0; a--) {
const s = t[a];
if (o !== s) {
const l = s.parentNode === e;
!i && !a ? l ? e.replaceChild(o, s) : e.insertBefore(o, r) : l && s.remove();
} else i = !0;
}
} else e.insertBefore(o, r);
return [o];
}
const D1 = "http://www.w3.org/2000/svg";
function gc(e, t = !1) {
return t ? document.createElementNS(D1, e) : document.createElement(e);
}
function Wa(e) {
const {
useShadow: t
} = e, r = document.createTextNode(""), n = () => e.mount || document.body, o = Ua();
let i;
return we(() => {
i || (i = t1(o, () => W(() => e.children)));
const a = n();
if (a instanceof HTMLHeadElement) {
const [s, l] = X(!1), c = () => l(!0);
Ot((u) => M(a, () => s() ? u() : i(), null)), fe(c);
} else {
const s = gc(e.isSVG ? "g" : "div", e.isSVG), l = t && s.attachShadow ? s.attachShadow({
mode: "open"
}) : s;
Object.defineProperty(s, "_$host", {
get() {
return r.parentNode;
},
configurable: !0
}), M(l, i), a.appendChild(s), e.ref && e.ref(s), fe(() => a.removeChild(s));
}
}, void 0, {
render: !0
}), r;
}
function z1(e, t) {
const r = W(e);
return W(() => {
const n = r();
switch (typeof n) {
case "function":
return ve(() => n(t));
case "string":
const o = _1.has(n), i = gc(n, o);
return re(i, t, o), i;
}
});
}
function hi(e) {
const [, t] = xr(e, ["component"]);
return z1(() => e.component, t);
}
const M1 = (e) => (t, r, n) => {
const o = n.subscribe;
return n.subscribe = (a, s, l) => {
let c = a;
if (s) {
const u = (l == null ? void 0 : l.equalityFn) || Object.is;
let g = a(n.getState());
c = (d) => {
const f = a(d);
if (!u(g, f)) {
const m = g;
s(g = f, m);