@caspingus/lt
Version:
A utility library of helpers and extensions useful when working with Learnosity APIs.
1,326 lines • 432 kB
JavaScript
import { c as Ps } from "../../styling-BAmPgGwX.js";
import { c as Cs, L as z } from "../../extensionsFactory-BHOEyOSK.js";
import { c as ht, a as $e } from "../../_commonjsHelpers-DQNKXVTB.js";
function Bs(i, e, t) {
const r = [];
return i.forEach((a) => typeof a != "string" ? r.push(a) : e[Symbol.split](a).forEach((o, s, n) => {
o !== "" && r.push(o), s < n.length - 1 && r.push(t);
})), r;
}
/**
* Takes a string with placeholder variables like `%{smart_count} file selected`
* and replaces it with values from options `{smart_count: 5}`
*
* @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
* taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
*
* @param phrase that needs interpolation, with placeholders
* @param options with values that will be used to replace placeholders
*/
function br(i, e) {
const t = /\$/g, r = "$$$$";
let a = [i];
if (e == null)
return a;
for (const o of Object.keys(e))
if (o !== "_") {
let s = e[o];
typeof s == "string" && (s = t[Symbol.replace](s, r)), a = Bs(a, new RegExp(`%\\{${o}\\}`, "g"), s);
}
return a;
}
const Is = (i) => {
throw new Error(`missing string: ${i}`);
};
class no {
locale;
constructor(e, { onMissingKey: t = Is } = {}) {
this.locale = {
strings: {},
pluralize(r) {
return r === 1 ? 0 : 1;
}
}, Array.isArray(e) ? e.forEach(this.#t, this) : this.#t(e), this.#e = t;
}
#e;
#t(e) {
if (!e?.strings)
return;
const t = this.locale;
Object.assign(this.locale, {
strings: { ...t.strings, ...e.strings },
pluralize: e.pluralize || t.pluralize
});
}
/**
* Public translate method
*
* @param key
* @param options with values that will be used later to replace placeholders in string
* @returns string translated (and interpolated)
*/
translate(e, t) {
return this.translateArray(e, t).join("");
}
/**
* Get a translation and return the translated and interpolated parts as an array.
*
* @returns The translated and interpolated parts, in order.
*/
translateArray(e, t) {
let r = this.locale.strings[e];
if (r == null && (this.#e(e), r = e), typeof r == "object") {
if (t && typeof t.smart_count < "u") {
const o = this.locale.pluralize(t.smart_count);
return br(r[o], t);
}
throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}");
}
if (typeof r != "string")
throw new Error("string was not a string");
return br(r, t);
}
}
class lo {
uppy;
opts;
id;
defaultLocale;
i18n;
i18nArray;
type;
VERSION;
constructor(e, t) {
this.uppy = e, this.opts = t ?? {};
}
getPluginState() {
const { plugins: e } = this.uppy.getState();
return e?.[this.id] || {};
}
setPluginState(e) {
const { plugins: t } = this.uppy.getState();
this.uppy.setState({
plugins: {
...t,
[this.id]: {
...t[this.id],
...e
}
}
});
}
setOptions(e) {
this.opts = { ...this.opts, ...e }, this.setPluginState(void 0), this.i18nInit();
}
i18nInit() {
const e = new no([
this.defaultLocale,
this.uppy.locale,
this.opts.locale
]);
this.i18n = e.translate.bind(e), this.i18nArray = e.translateArray.bind(e), this.setPluginState(void 0);
}
/**
* Extendable methods
* ==================
* These methods are here to serve as an overview of the extendable methods as well as
* making them not conditional in use, such as `if (this.afterUpdate)`.
*/
addTarget(e) {
throw new Error("Extend the addTarget method to add your plugin to another plugin's target");
}
install() {
}
uninstall() {
}
update(e) {
}
// Called after every state update, after everything's mounted. Debounced.
afterUpdate() {
}
}
function Lt(i) {
return i < 10 ? `0${i}` : i.toString();
}
function It() {
const i = /* @__PURE__ */ new Date(), e = Lt(i.getHours()), t = Lt(i.getMinutes()), r = Lt(i.getSeconds());
return `${e}:${t}:${r}`;
}
const Fs = {
debug: () => {
},
warn: () => {
},
error: (...i) => console.error(`[Uppy] [${It()}]`, ...i)
}, Ts = {
debug: (...i) => console.debug(`[Uppy] [${It()}]`, ...i),
warn: (...i) => console.warn(`[Uppy] [${It()}]`, ...i),
error: (...i) => console.error(`[Uppy] [${It()}]`, ...i)
};
function po(i) {
return typeof i != "object" || i === null || !("nodeType" in i) ? !1 : i.nodeType === Node.ELEMENT_NODE;
}
function Es(i, e = document) {
return typeof i == "string" ? e.querySelector(i) : po(i) ? i : null;
}
function uo(i) {
for (; i && !i.dir; )
i = i.parentNode;
return i?.dir;
}
var pt, P, co, Be, vr, ho, fo, mo, qi, Di, ki, it = {}, go = [], As = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, dt = Array.isArray;
function le(i, e) {
for (var t in e) i[t] = e[t];
return i;
}
function Wi(i) {
i && i.parentNode && i.parentNode.removeChild(i);
}
function rt(i, e, t) {
var r, a, o, s = {};
for (o in e) o == "key" ? r = e[o] : o == "ref" ? a = e[o] : s[o] = e[o];
if (arguments.length > 2 && (s.children = arguments.length > 3 ? pt.call(arguments, 2) : t), typeof i == "function" && i.defaultProps != null) for (o in i.defaultProps) s[o] === void 0 && (s[o] = i.defaultProps[o]);
return Je(i, s, r, a, null);
}
function Je(i, e, t, r, a) {
var o = { type: i, props: e, key: t, ref: r, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: a ?? ++co, __i: -1, __u: 0 };
return a == null && P.vnode != null && P.vnode(o), o;
}
function Os() {
return { current: null };
}
function re(i) {
return i.children;
}
function X(i, e) {
this.props = i, this.context = e;
}
function Ue(i, e) {
if (e == null) return i.__ ? Ue(i.__, i.__i + 1) : null;
for (var t; e < i.__k.length; e++) if ((t = i.__k[e]) != null && t.__e != null) return t.__e;
return typeof i.type == "function" ? Ue(i) : null;
}
function yo(i) {
var e, t;
if ((i = i.__) != null && i.__c != null) {
for (i.__e = i.__c.base = null, e = 0; e < i.__k.length; e++) if ((t = i.__k[e]) != null && t.__e != null) {
i.__e = i.__c.base = t.__e;
break;
}
return yo(i);
}
}
function wr(i) {
(!i.__d && (i.__d = !0) && Be.push(i) && !Et.__r++ || vr != P.debounceRendering) && ((vr = P.debounceRendering) || ho)(Et);
}
function Et() {
for (var i, e, t, r, a, o, s, n = 1; Be.length; ) Be.length > n && Be.sort(fo), i = Be.shift(), n = Be.length, i.__d && (t = void 0, a = (r = (e = i).__v).__e, o = [], s = [], e.__P && ((t = le({}, r)).__v = r.__v + 1, P.vnode && P.vnode(t), Vi(e.__P, t, r, e.__n, e.__P.namespaceURI, 32 & r.__u ? [a] : null, o, a ?? Ue(r), !!(32 & r.__u), s), t.__v = r.__v, t.__.__k[t.__i] = t, wo(o, t, s), t.__e != a && yo(t)));
Et.__r = 0;
}
function bo(i, e, t, r, a, o, s, n, p, l, c) {
var d, h, m, f, y, b, v = r && r.__k || go, x = e.length;
for (p = Ms(t, e, v, p, x), d = 0; d < x; d++) (m = t.__k[d]) != null && (h = m.__i == -1 ? it : v[m.__i] || it, m.__i = d, b = Vi(i, m, h, a, o, s, n, p, l, c), f = m.__e, m.ref && h.ref != m.ref && (h.ref && Gi(h.ref, null, m), c.push(m.ref, m.__c || f, m)), y == null && f != null && (y = f), 4 & m.__u || h.__k === m.__k ? p = vo(m, p, i) : typeof m.type == "function" && b !== void 0 ? p = b : f && (p = f.nextSibling), m.__u &= -7);
return t.__e = y, p;
}
function Ms(i, e, t, r, a) {
var o, s, n, p, l, c = t.length, d = c, h = 0;
for (i.__k = new Array(a), o = 0; o < a; o++) (s = e[o]) != null && typeof s != "boolean" && typeof s != "function" ? (p = o + h, (s = i.__k[o] = typeof s == "string" || typeof s == "number" || typeof s == "bigint" || s.constructor == String ? Je(null, s, null, null, null) : dt(s) ? Je(re, { children: s }, null, null, null) : s.constructor == null && s.__b > 0 ? Je(s.type, s.props, s.key, s.ref ? s.ref : null, s.__v) : s).__ = i, s.__b = i.__b + 1, n = null, (l = s.__i = zs(s, t, p, d)) != -1 && (d--, (n = t[l]) && (n.__u |= 2)), n == null || n.__v == null ? (l == -1 && (a > c ? h-- : a < c && h++), typeof s.type != "function" && (s.__u |= 4)) : l != p && (l == p - 1 ? h-- : l == p + 1 ? h++ : (l > p ? h-- : h++, s.__u |= 4))) : i.__k[o] = null;
if (d) for (o = 0; o < c; o++) (n = t[o]) != null && (2 & n.__u) == 0 && (n.__e == r && (r = Ue(n)), _o(n, n));
return r;
}
function vo(i, e, t) {
var r, a;
if (typeof i.type == "function") {
for (r = i.__k, a = 0; r && a < r.length; a++) r[a] && (r[a].__ = i, e = vo(r[a], e, t));
return e;
}
i.__e != e && (e && i.type && !t.contains(e) && (e = Ue(i)), t.insertBefore(i.__e, e || null), e = i.__e);
do
e = e && e.nextSibling;
while (e != null && e.nodeType == 8);
return e;
}
function te(i, e) {
return e = e || [], i == null || typeof i == "boolean" || (dt(i) ? i.some(function(t) {
te(t, e);
}) : e.push(i)), e;
}
function zs(i, e, t, r) {
var a, o, s, n = i.key, p = i.type, l = e[t], c = l != null && (2 & l.__u) == 0;
if (l === null && i.key == null || c && n == l.key && p == l.type) return t;
if (r > (c ? 1 : 0)) {
for (a = t - 1, o = t + 1; a >= 0 || o < e.length; ) if ((l = e[s = a >= 0 ? a-- : o++]) != null && (2 & l.__u) == 0 && n == l.key && p == l.type) return s;
}
return -1;
}
function xr(i, e, t) {
e[0] == "-" ? i.setProperty(e, t ?? "") : i[e] = t == null ? "" : typeof t != "number" || As.test(e) ? t : t + "px";
}
function ft(i, e, t, r, a) {
var o, s;
e: if (e == "style") if (typeof t == "string") i.style.cssText = t;
else {
if (typeof r == "string" && (i.style.cssText = r = ""), r) for (e in r) t && e in t || xr(i.style, e, "");
if (t) for (e in t) r && t[e] == r[e] || xr(i.style, e, t[e]);
}
else if (e[0] == "o" && e[1] == "n") o = e != (e = e.replace(mo, "$1")), s = e.toLowerCase(), e = s in i || e == "onFocusOut" || e == "onFocusIn" ? s.slice(2) : e.slice(2), i.l || (i.l = {}), i.l[e + o] = t, t ? r ? t.u = r.u : (t.u = qi, i.addEventListener(e, o ? ki : Di, o)) : i.removeEventListener(e, o ? ki : Di, o);
else {
if (a == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in i) try {
i[e] = t ?? "";
break e;
} catch {
}
typeof t == "function" || (t == null || t === !1 && e[4] != "-" ? i.removeAttribute(e) : i.setAttribute(e, e == "popover" && t == 1 ? "" : t));
}
}
function _r(i) {
return function(e) {
if (this.l) {
var t = this.l[e.type + i];
if (e.t == null) e.t = qi++;
else if (e.t < t.u) return;
return t(P.event ? P.event(e) : e);
}
};
}
function Vi(i, e, t, r, a, o, s, n, p, l) {
var c, d, h, m, f, y, b, v, x, _, C, B, g, D, k, S, O, T = e.type;
if (e.constructor != null) return null;
128 & t.__u && (p = !!(32 & t.__u), o = [n = e.__e = t.__e]), (c = P.__b) && c(e);
e: if (typeof T == "function") try {
if (v = e.props, x = "prototype" in T && T.prototype.render, _ = (c = T.contextType) && r[c.__c], C = c ? _ ? _.props.value : c.__ : r, t.__c ? b = (d = e.__c = t.__c).__ = d.__E : (x ? e.__c = d = new T(v, C) : (e.__c = d = new X(v, C), d.constructor = T, d.render = Ns), _ && _.sub(d), d.props = v, d.state || (d.state = {}), d.context = C, d.__n = r, h = d.__d = !0, d.__h = [], d._sb = []), x && d.__s == null && (d.__s = d.state), x && T.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = le({}, d.__s)), le(d.__s, T.getDerivedStateFromProps(v, d.__s))), m = d.props, f = d.state, d.__v = e, h) x && T.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), x && d.componentDidMount != null && d.__h.push(d.componentDidMount);
else {
if (x && T.getDerivedStateFromProps == null && v !== m && d.componentWillReceiveProps != null && d.componentWillReceiveProps(v, C), !d.__e && d.shouldComponentUpdate != null && d.shouldComponentUpdate(v, d.__s, C) === !1 || e.__v == t.__v) {
for (e.__v != t.__v && (d.props = v, d.state = d.__s, d.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.some(function(M) {
M && (M.__ = e);
}), B = 0; B < d._sb.length; B++) d.__h.push(d._sb[B]);
d._sb = [], d.__h.length && s.push(d);
break e;
}
d.componentWillUpdate != null && d.componentWillUpdate(v, d.__s, C), x && d.componentDidUpdate != null && d.__h.push(function() {
d.componentDidUpdate(m, f, y);
});
}
if (d.context = C, d.props = v, d.__P = i, d.__e = !1, g = P.__r, D = 0, x) {
for (d.state = d.__s, d.__d = !1, g && g(e), c = d.render(d.props, d.state, d.context), k = 0; k < d._sb.length; k++) d.__h.push(d._sb[k]);
d._sb = [];
} else do
d.__d = !1, g && g(e), c = d.render(d.props, d.state, d.context), d.state = d.__s;
while (d.__d && ++D < 25);
d.state = d.__s, d.getChildContext != null && (r = le(le({}, r), d.getChildContext())), x && !h && d.getSnapshotBeforeUpdate != null && (y = d.getSnapshotBeforeUpdate(m, f)), S = c, c != null && c.type === re && c.key == null && (S = xo(c.props.children)), n = bo(i, dt(S) ? S : [S], e, t, r, a, o, s, n, p, l), d.base = e.__e, e.__u &= -161, d.__h.length && s.push(d), b && (d.__E = d.__ = null);
} catch (M) {
if (e.__v = null, p || o != null) if (M.then) {
for (e.__u |= p ? 160 : 128; n && n.nodeType == 8 && n.nextSibling; ) n = n.nextSibling;
o[o.indexOf(n)] = null, e.__e = n;
} else {
for (O = o.length; O--; ) Wi(o[O]);
Si(e);
}
else e.__e = t.__e, e.__k = t.__k, M.then || Si(e);
P.__e(M, e, t);
}
else o == null && e.__v == t.__v ? (e.__k = t.__k, e.__e = t.__e) : n = e.__e = Rs(t.__e, e, t, r, a, o, s, p, l);
return (c = P.diffed) && c(e), 128 & e.__u ? void 0 : n;
}
function Si(i) {
i && i.__c && (i.__c.__e = !0), i && i.__k && i.__k.forEach(Si);
}
function wo(i, e, t) {
for (var r = 0; r < t.length; r++) Gi(t[r], t[++r], t[++r]);
P.__c && P.__c(e, i), i.some(function(a) {
try {
i = a.__h, a.__h = [], i.some(function(o) {
o.call(a);
});
} catch (o) {
P.__e(o, a.__v);
}
});
}
function xo(i) {
return typeof i != "object" || i == null || i.__b && i.__b > 0 ? i : dt(i) ? i.map(xo) : le({}, i);
}
function Rs(i, e, t, r, a, o, s, n, p) {
var l, c, d, h, m, f, y, b = t.props, v = e.props, x = e.type;
if (x == "svg" ? a = "http://www.w3.org/2000/svg" : x == "math" ? a = "http://www.w3.org/1998/Math/MathML" : a || (a = "http://www.w3.org/1999/xhtml"), o != null) {
for (l = 0; l < o.length; l++) if ((m = o[l]) && "setAttribute" in m == !!x && (x ? m.localName == x : m.nodeType == 3)) {
i = m, o[l] = null;
break;
}
}
if (i == null) {
if (x == null) return document.createTextNode(v);
i = document.createElementNS(a, x, v.is && v), n && (P.__m && P.__m(e, o), n = !1), o = null;
}
if (x == null) b === v || n && i.data == v || (i.data = v);
else {
if (o = o && pt.call(i.childNodes), b = t.props || it, !n && o != null) for (b = {}, l = 0; l < i.attributes.length; l++) b[(m = i.attributes[l]).name] = m.value;
for (l in b) if (m = b[l], l != "children") {
if (l == "dangerouslySetInnerHTML") d = m;
else if (!(l in v)) {
if (l == "value" && "defaultValue" in v || l == "checked" && "defaultChecked" in v) continue;
ft(i, l, null, m, a);
}
}
for (l in v) m = v[l], l == "children" ? h = m : l == "dangerouslySetInnerHTML" ? c = m : l == "value" ? f = m : l == "checked" ? y = m : n && typeof m != "function" || b[l] === m || ft(i, l, m, b[l], a);
if (c) n || d && (c.__html == d.__html || c.__html == i.innerHTML) || (i.innerHTML = c.__html), e.__k = [];
else if (d && (i.innerHTML = ""), bo(e.type == "template" ? i.content : i, dt(h) ? h : [h], e, t, r, x == "foreignObject" ? "http://www.w3.org/1999/xhtml" : a, o, s, o ? o[0] : t.__k && Ue(t, 0), n, p), o != null) for (l = o.length; l--; ) Wi(o[l]);
n || (l = "value", x == "progress" && f == null ? i.removeAttribute("value") : f != null && (f !== i[l] || x == "progress" && !f || x == "option" && f != b[l]) && ft(i, l, f, b[l], a), l = "checked", y != null && y != i[l] && ft(i, l, y, b[l], a));
}
return i;
}
function Gi(i, e, t) {
try {
if (typeof i == "function") {
var r = typeof i.__u == "function";
r && i.__u(), r && e == null || (i.__u = i(e));
} else i.current = e;
} catch (a) {
P.__e(a, t);
}
}
function _o(i, e, t) {
var r, a;
if (P.unmount && P.unmount(i), (r = i.ref) && (r.current && r.current != i.__e || Gi(r, null, e)), (r = i.__c) != null) {
if (r.componentWillUnmount) try {
r.componentWillUnmount();
} catch (o) {
P.__e(o, e);
}
r.base = r.__P = null;
}
if (r = i.__k) for (a = 0; a < r.length; a++) r[a] && _o(r[a], e, t || typeof i.type != "function");
t || Wi(i.__e), i.__c = i.__ = i.__e = void 0;
}
function Ns(i, e, t) {
return this.constructor(i, t);
}
function Us(i, e, t) {
var r, a, o, s;
e == document && (e = document.documentElement), P.__ && P.__(i, e), a = (r = typeof t == "function") ? null : e.__k, o = [], s = [], Vi(e, i = e.__k = rt(re, null, [i]), a || it, it, e.namespaceURI, a ? null : e.firstChild ? pt.call(e.childNodes) : null, o, a ? a.__e : e.firstChild, r, s), wo(o, i, s);
}
function Do(i, e, t) {
var r, a, o, s, n = le({}, i.props);
for (o in i.type && i.type.defaultProps && (s = i.type.defaultProps), e) o == "key" ? r = e[o] : o == "ref" ? a = e[o] : n[o] = e[o] === void 0 && s != null ? s[o] : e[o];
return arguments.length > 2 && (n.children = arguments.length > 3 ? pt.call(arguments, 2) : t), Je(i.type, n, r || i.key, a || i.ref, null);
}
pt = go.slice, P = { __e: function(i, e, t, r) {
for (var a, o, s; e = e.__; ) if ((a = e.__c) && !a.__) try {
if ((o = a.constructor) && o.getDerivedStateFromError != null && (a.setState(o.getDerivedStateFromError(i)), s = a.__d), a.componentDidCatch != null && (a.componentDidCatch(i, r || {}), s = a.__d), s) return a.__E = a;
} catch (n) {
i = n;
}
throw i;
} }, co = 0, X.prototype.setState = function(i, e) {
var t;
t = this.__s != null && this.__s != this.state ? this.__s : this.__s = le({}, this.state), typeof i == "function" && (i = i(le({}, t), this.props)), i && le(t, i), i != null && this.__v && (e && this._sb.push(e), wr(this));
}, X.prototype.forceUpdate = function(i) {
this.__v && (this.__e = !0, i && this.__h.push(i), wr(this));
}, X.prototype.render = re, Be = [], ho = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, fo = function(i, e) {
return i.__v.__b - e.__v.__b;
}, Et.__r = 0, mo = /(PointerCapture)$|Capture$/i, qi = 0, Di = _r(!1), ki = _r(!0);
var at, $, Ht, Dr, ot = 0, ko = [], L = P, kr = L.__b, Sr = L.__r, Pr = L.diffed, Cr = L.__c, Br = L.unmount, Ir = L.__;
function Xi(i, e) {
L.__h && L.__h($, i, ot || e), ot = 0;
var t = $.__H || ($.__H = { __: [], __h: [] });
return i >= t.__.length && t.__.push({}), t.__[i];
}
function At(i) {
return ot = 1, $s(Po, i);
}
function $s(i, e, t) {
var r = Xi(at++, 2);
if (r.t = i, !r.__c && (r.__ = [t ? t(e) : Po(void 0, e), function(n) {
var p = r.__N ? r.__N[0] : r.__[0], l = r.t(p, n);
p !== l && (r.__N = [l, r.__[1]], r.__c.setState({}));
}], r.__c = $, !$.__f)) {
var a = function(n, p, l) {
if (!r.__c.__H) return !0;
var c = r.__c.__H.__.filter(function(h) {
return !!h.__c;
});
if (c.every(function(h) {
return !h.__N;
})) return !o || o.call(this, n, p, l);
var d = r.__c.props !== n;
return c.forEach(function(h) {
if (h.__N) {
var m = h.__[0];
h.__ = h.__N, h.__N = void 0, m !== h.__[0] && (d = !0);
}
}), o && o.call(this, n, p, l) || d;
};
$.__f = !0;
var o = $.shouldComponentUpdate, s = $.componentWillUpdate;
$.componentWillUpdate = function(n, p, l) {
if (this.__e) {
var c = o;
o = void 0, a(n, p, l), o = c;
}
s && s.call(this, n, p, l);
}, $.shouldComponentUpdate = a;
}
return r.__N || r.__;
}
function Pi(i, e) {
var t = Xi(at++, 3);
!L.__s && So(t.__H, e) && (t.__ = i, t.u = e, $.__H.__h.push(t));
}
function Ft(i) {
return ot = 5, Yi(function() {
return { current: i };
}, []);
}
function Yi(i, e) {
var t = Xi(at++, 7);
return So(t.__H, e) && (t.__ = i(), t.__H = e, t.__h = i), t.__;
}
function Ls(i, e) {
return ot = 8, Yi(function() {
return i;
}, e);
}
function Hs() {
for (var i; i = ko.shift(); ) if (i.__P && i.__H) try {
i.__H.__h.forEach(Tt), i.__H.__h.forEach(Ci), i.__H.__h = [];
} catch (e) {
i.__H.__h = [], L.__e(e, i.__v);
}
}
L.__b = function(i) {
$ = null, kr && kr(i);
}, L.__ = function(i, e) {
i && e.__k && e.__k.__m && (i.__m = e.__k.__m), Ir && Ir(i, e);
}, L.__r = function(i) {
Sr && Sr(i), at = 0;
var e = ($ = i.__c).__H;
e && (Ht === $ ? (e.__h = [], $.__h = [], e.__.forEach(function(t) {
t.__N && (t.__ = t.__N), t.u = t.__N = void 0;
})) : (e.__h.forEach(Tt), e.__h.forEach(Ci), e.__h = [], at = 0)), Ht = $;
}, L.diffed = function(i) {
Pr && Pr(i);
var e = i.__c;
e && e.__H && (e.__H.__h.length && (ko.push(e) !== 1 && Dr === L.requestAnimationFrame || ((Dr = L.requestAnimationFrame) || js)(Hs)), e.__H.__.forEach(function(t) {
t.u && (t.__H = t.u), t.u = void 0;
})), Ht = $ = null;
}, L.__c = function(i, e) {
e.some(function(t) {
try {
t.__h.forEach(Tt), t.__h = t.__h.filter(function(r) {
return !r.__ || Ci(r);
});
} catch (r) {
e.some(function(a) {
a.__h && (a.__h = []);
}), e = [], L.__e(r, t.__v);
}
}), Cr && Cr(i, e);
}, L.unmount = function(i) {
Br && Br(i);
var e, t = i.__c;
t && t.__H && (t.__H.__.forEach(function(r) {
try {
Tt(r);
} catch (a) {
e = a;
}
}), t.__H = void 0, e && L.__e(e, t.__v));
};
var Fr = typeof requestAnimationFrame == "function";
function js(i) {
var e, t = function() {
clearTimeout(r), Fr && cancelAnimationFrame(e), setTimeout(i);
}, r = setTimeout(t, 35);
Fr && (e = requestAnimationFrame(t));
}
function Tt(i) {
var e = $, t = i.__c;
typeof t == "function" && (i.__c = void 0, t()), $ = e;
}
function Ci(i) {
var e = $;
i.__c = i.__(), $ = e;
}
function So(i, e) {
return !i || i.length !== e.length || e.some(function(t, r) {
return t !== i[r];
});
}
function Po(i, e) {
return typeof e == "function" ? e(i) : e;
}
function qs(i, e) {
for (var t in e) i[t] = e[t];
return i;
}
function Tr(i, e) {
for (var t in i) if (t !== "__source" && !(t in e)) return !0;
for (var r in e) if (r !== "__source" && i[r] !== e[r]) return !0;
return !1;
}
function Er(i, e) {
this.props = i, this.context = e;
}
(Er.prototype = new X()).isPureReactComponent = !0, Er.prototype.shouldComponentUpdate = function(i, e) {
return Tr(this.props, i) || Tr(this.state, e);
};
var Ar = P.__b;
P.__b = function(i) {
i.type && i.type.__f && i.ref && (i.props.ref = i.ref, i.ref = null), Ar && Ar(i);
};
var Ws = P.__e;
P.__e = function(i, e, t, r) {
if (i.then) {
for (var a, o = e; o = o.__; ) if ((a = o.__c) && a.__c) return e.__e == null && (e.__e = t.__e, e.__k = t.__k), a.__c(i, e);
}
Ws(i, e, t, r);
};
var Or = P.unmount;
function Co(i, e, t) {
return i && (i.__c && i.__c.__H && (i.__c.__H.__.forEach(function(r) {
typeof r.__c == "function" && r.__c();
}), i.__c.__H = null), (i = qs({}, i)).__c != null && (i.__c.__P === t && (i.__c.__P = e), i.__c.__e = !0, i.__c = null), i.__k = i.__k && i.__k.map(function(r) {
return Co(r, e, t);
})), i;
}
function Bo(i, e, t) {
return i && t && (i.__v = null, i.__k = i.__k && i.__k.map(function(r) {
return Bo(r, e, t);
}), i.__c && i.__c.__P === e && (i.__e && t.appendChild(i.__e), i.__c.__e = !0, i.__c.__P = t)), i;
}
function jt() {
this.__u = 0, this.o = null, this.__b = null;
}
function Io(i) {
var e = i.__.__c;
return e && e.__a && e.__a(i);
}
function mt() {
this.i = null, this.l = null;
}
P.unmount = function(i) {
var e = i.__c;
e && e.__R && e.__R(), e && 32 & i.__u && (i.type = null), Or && Or(i);
}, (jt.prototype = new X()).__c = function(i, e) {
var t = e.__c, r = this;
r.o == null && (r.o = []), r.o.push(t);
var a = Io(r.__v), o = !1, s = function() {
o || (o = !0, t.__R = null, a ? a(n) : n());
};
t.__R = s;
var n = function() {
if (!--r.__u) {
if (r.state.__a) {
var p = r.state.__a;
r.__v.__k[0] = Bo(p, p.__c.__P, p.__c.__O);
}
var l;
for (r.setState({ __a: r.__b = null }); l = r.o.pop(); ) l.forceUpdate();
}
};
r.__u++ || 32 & e.__u || r.setState({ __a: r.__b = r.__v.__k[0] }), i.then(s, s);
}, jt.prototype.componentWillUnmount = function() {
this.o = [];
}, jt.prototype.render = function(i, e) {
if (this.__b) {
if (this.__v.__k) {
var t = document.createElement("div"), r = this.__v.__k[0].__c;
this.__v.__k[0] = Co(this.__b, t, r.__O = r.__P);
}
this.__b = null;
}
var a = e.__a && rt(re, null, i.fallback);
return a && (a.__u &= -33), [rt(re, null, e.__a ? null : i.children), a];
};
var Mr = function(i, e, t) {
if (++t[1] === t[0] && i.l.delete(e), i.props.revealOrder && (i.props.revealOrder[0] !== "t" || !i.l.size)) for (t = i.i; t; ) {
for (; t.length > 3; ) t.pop()();
if (t[1] < t[0]) break;
i.i = t = t[2];
}
};
(mt.prototype = new X()).__a = function(i) {
var e = this, t = Io(e.__v), r = e.l.get(i);
return r[0]++, function(a) {
var o = function() {
e.props.revealOrder ? (r.push(a), Mr(e, i, r)) : a();
};
t ? t(o) : o();
};
}, mt.prototype.render = function(i) {
this.i = null, this.l = /* @__PURE__ */ new Map();
var e = te(i.children);
i.revealOrder && i.revealOrder[0] === "b" && e.reverse();
for (var t = e.length; t--; ) this.l.set(e[t], this.i = [1, 0, this.i]);
return i.children;
}, mt.prototype.componentDidUpdate = mt.prototype.componentDidMount = function() {
var i = this;
this.l.forEach(function(e, t) {
Mr(i, t, e);
});
};
var Vs = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, Gs = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, Xs = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Ys = /[A-Z0-9]/g, Ks = typeof document < "u", Zs = function(i) {
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(i);
};
function zr(i, e, t) {
return e.__k == null && (e.textContent = ""), Us(i, e), typeof t == "function" && t(), i ? i.__c : null;
}
X.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(i) {
Object.defineProperty(X.prototype, i, { configurable: !0, get: function() {
return this["UNSAFE_" + i];
}, set: function(e) {
Object.defineProperty(this, i, { configurable: !0, writable: !0, value: e });
} });
});
var Rr = P.event;
function Qs() {
}
function Js() {
return this.cancelBubble;
}
function en() {
return this.defaultPrevented;
}
P.event = function(i) {
return Rr && (i = Rr(i)), i.persist = Qs, i.isPropagationStopped = Js, i.isDefaultPrevented = en, i.nativeEvent = i;
};
var tn = { enumerable: !1, configurable: !0, get: function() {
return this.class;
} }, Nr = P.vnode;
P.vnode = function(i) {
typeof i.type == "string" && function(e) {
var t = e.props, r = e.type, a = {}, o = r.indexOf("-") === -1;
for (var s in t) {
var n = t[s];
if (!(s === "value" && "defaultValue" in t && n == null || Ks && s === "children" && r === "noscript" || s === "class" || s === "className")) {
var p = s.toLowerCase();
s === "defaultValue" && "value" in t && t.value == null ? s = "value" : s === "download" && n === !0 ? n = "" : p === "translate" && n === "no" ? n = !1 : p[0] === "o" && p[1] === "n" ? p === "ondoubleclick" ? s = "ondblclick" : p !== "onchange" || r !== "input" && r !== "textarea" || Zs(t.type) ? p === "onfocus" ? s = "onfocusin" : p === "onblur" ? s = "onfocusout" : Xs.test(s) && (s = p) : p = s = "oninput" : o && Gs.test(s) ? s = s.replace(Ys, "-$&").toLowerCase() : n === null && (n = void 0), p === "oninput" && a[s = p] && (s = "oninputCapture"), a[s] = n;
}
}
r == "select" && a.multiple && Array.isArray(a.value) && (a.value = te(t.children).forEach(function(l) {
l.props.selected = a.value.indexOf(l.props.value) != -1;
})), r == "select" && a.defaultValue != null && (a.value = te(t.children).forEach(function(l) {
l.props.selected = a.multiple ? a.defaultValue.indexOf(l.props.value) != -1 : a.defaultValue == l.props.value;
})), t.class && !t.className ? (a.class = t.class, Object.defineProperty(a, "className", tn)) : (t.className && !t.class || t.class && t.className) && (a.class = a.className = t.className), e.props = a;
}(i), i.$$typeof = Vs, Nr && Nr(i);
};
var Ur = P.__r;
P.__r = function(i) {
Ur && Ur(i), i.__c;
};
var $r = P.diffed;
P.diffed = function(i) {
$r && $r(i);
var e = i.props, t = i.__e;
t != null && i.type === "textarea" && "value" in e && e.value !== t.value && (t.value = e.value == null ? "" : e.value);
};
function rn(i) {
let e = null, t;
return (...r) => (t = r, e || (e = Promise.resolve().then(() => (e = null, i(...t)))), e);
}
class ve extends lo {
#e;
isTargetDOMEl;
el;
parent;
title;
getTargetPlugin(e) {
let t;
if (typeof e?.addTarget == "function")
t = e, t instanceof ve || console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.", { cause: { targetPlugin: t, UIPlugin: ve } }));
else if (typeof e == "function") {
const r = e;
this.uppy.iteratePlugins((a) => {
a instanceof r && (t = a);
});
}
return t;
}
/**
* Check if supplied `target` is a DOM element or an `object`.
* If it’s an object — target is a plugin, and we search `plugins`
* for a plugin with same name and return its target.
*/
mount(e, t) {
const r = t.id, a = Es(e);
if (a) {
this.isTargetDOMEl = !0;
const n = document.createElement("div");
return n.classList.add("uppy-Root"), this.#e = rn((p) => {
this.uppy.getPlugin(this.id) && (zr(this.render(p, n), n), this.afterUpdate());
}), this.uppy.log(`Installing ${r} to a DOM element '${e}'`), this.opts.replaceTargetContent && (a.innerHTML = ""), zr(this.render(this.uppy.getState(), n), n), this.el = n, a.appendChild(n), n.dir = this.opts.direction || uo(n) || "ltr", this.onMount(), this.el;
}
const o = this.getTargetPlugin(e);
if (o)
return this.uppy.log(`Installing ${r} to ${o.id}`), this.parent = o, this.el = o.addTarget(t), this.onMount(), this.el;
this.uppy.log(`Not installing ${r}`);
let s = `Invalid target option given to ${r}.`;
throw typeof e == "function" ? s += " The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly." : s += "If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.", new Error(s);
}
/**
* Called when plugin is mounted, whether in DOM or into another plugin.
* Needed because sometimes plugins are mounted separately/after `install`,
* so this.el and this.parent might not be available in `install`.
* This is the case with @uppy/react plugins, for example.
*/
render(e, t) {
throw new Error("Extend the render method to add your plugin to a DOM element");
}
update(e) {
this.el != null && this.#e?.(e);
}
unmount() {
this.isTargetDOMEl && this.el?.remove(), this.onUnmount();
}
onMount() {
}
onUnmount() {
}
}
const an = "@uppy/store-default", on = "The default simple object-based store for Uppy.", sn = "4.3.2", nn = "MIT", ln = "lib/index.js", pn = "module", dn = { build: "tsc --build tsconfig.build.json", typecheck: "tsc --build", test: "vitest run --environment=jsdom --silent='passed-only'" }, un = ["file uploader", "uppy", "uppy-store"], cn = "https://uppy.io", hn = { url: "https://github.com/transloadit/uppy/issues" }, fn = { jsdom: "^26.1.0", typescript: "^5.8.3", vitest: "^3.2.4" }, mn = { type: "git", url: "git+https://github.com/transloadit/uppy.git" }, gn = ["src", "lib", "dist", "CHANGELOG.md"], yn = {
name: an,
description: on,
version: sn,
license: nn,
main: ln,
type: pn,
scripts: dn,
keywords: un,
homepage: cn,
bugs: hn,
devDependencies: fn,
repository: mn,
files: gn
};
class bn {
static VERSION = yn.version;
state = {};
#e = /* @__PURE__ */ new Set();
getState() {
return this.state;
}
setState(e) {
const t = { ...this.state }, r = { ...this.state, ...e };
this.state = r, this.#t(t, r, e);
}
subscribe(e) {
return this.#e.add(e), () => {
this.#e.delete(e);
};
}
#t(...e) {
this.#e.forEach((t) => {
t(...e);
});
}
}
function Ot(i) {
const e = i.lastIndexOf(".");
return e === -1 || e === i.length - 1 ? {
name: i,
extension: void 0
} : {
name: i.slice(0, e),
extension: i.slice(e + 1)
};
}
const Lr = {
__proto__: null,
md: "text/markdown",
markdown: "text/markdown",
mp4: "video/mp4",
mp3: "audio/mp3",
svg: "image/svg+xml",
jpg: "image/jpeg",
png: "image/png",
webp: "image/webp",
gif: "image/gif",
heic: "image/heic",
heif: "image/heif",
yaml: "text/yaml",
yml: "text/yaml",
csv: "text/csv",
tsv: "text/tab-separated-values",
tab: "text/tab-separated-values",
avi: "video/x-msvideo",
mks: "video/x-matroska",
mkv: "video/x-matroska",
mov: "video/quicktime",
dicom: "application/dicom",
doc: "application/msword",
msg: "application/vnd.ms-outlook",
docm: "application/vnd.ms-word.document.macroenabled.12",
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
dot: "application/msword",
dotm: "application/vnd.ms-word.template.macroenabled.12",
dotx: "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
xla: "application/vnd.ms-excel",
xlam: "application/vnd.ms-excel.addin.macroenabled.12",
xlc: "application/vnd.ms-excel",
xlf: "application/x-xliff+xml",
xlm: "application/vnd.ms-excel",
xls: "application/vnd.ms-excel",
xlsb: "application/vnd.ms-excel.sheet.binary.macroenabled.12",
xlsm: "application/vnd.ms-excel.sheet.macroenabled.12",
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
xlt: "application/vnd.ms-excel",
xltm: "application/vnd.ms-excel.template.macroenabled.12",
xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
xlw: "application/vnd.ms-excel",
txt: "text/plain",
text: "text/plain",
conf: "text/plain",
log: "text/plain",
pdf: "application/pdf",
zip: "application/zip",
"7z": "application/x-7z-compressed",
rar: "application/x-rar-compressed",
tar: "application/x-tar",
gz: "application/gzip",
dmg: "application/x-apple-diskimage"
};
function Fo(i) {
if (i.type)
return i.type;
const e = i.name ? Ot(i.name).extension?.toLowerCase() : null;
return e && e in Lr ? Lr[e] : "application/octet-stream";
}
function vn(i) {
return i.charCodeAt(0).toString(32);
}
function Hr(i) {
let e = "";
return i.replace(/[^A-Z0-9]/gi, (t) => (e += `-${vn(t)}`, "/")) + e;
}
function wn(i, e) {
let t = e || "uppy";
return typeof i.name == "string" && (t += `-${Hr(i.name.toLowerCase())}`), i.type !== void 0 && (t += `-${i.type}`), i.meta && typeof i.meta.relativePath == "string" && (t += `-${Hr(i.meta.relativePath.toLowerCase())}`), i.data.size !== void 0 && (t += `-${i.data.size}`), i.data.lastModified !== void 0 && (t += `-${i.data.lastModified}`), t;
}
function xn(i) {
return !i.isRemote || !i.remote ? !1 : (/* @__PURE__ */ new Set([
"box",
"dropbox",
"drive",
"facebook",
"unsplash"
])).has(i.remote.provider);
}
function _n(i, e) {
if (xn(i))
return i.id;
const t = Fo(i);
return wn({
...i,
type: t
}, e);
}
var qt, jr;
function Ki() {
if (jr) return qt;
jr = 1;
function i(e) {
var t = typeof e;
return e != null && (t == "object" || t == "function");
}
return qt = i, qt;
}
var Wt, qr;
function Dn() {
if (qr) return Wt;
qr = 1;
var i = typeof ht == "object" && ht && ht.Object === Object && ht;
return Wt = i, Wt;
}
var Vt, Wr;
function To() {
if (Wr) return Vt;
Wr = 1;
var i = Dn(), e = typeof self == "object" && self && self.Object === Object && self, t = i || e || Function("return this")();
return Vt = t, Vt;
}
var Gt, Vr;
function kn() {
if (Vr) return Gt;
Vr = 1;
var i = To(), e = function() {
return i.Date.now();
};
return Gt = e, Gt;
}
var Xt, Gr;
function Sn() {
if (Gr) return Xt;
Gr = 1;
var i = /\s/;
function e(t) {
for (var r = t.length; r-- && i.test(t.charAt(r)); )
;
return r;
}
return Xt = e, Xt;
}
var Yt, Xr;
function Pn() {
if (Xr) return Yt;
Xr = 1;
var i = Sn(), e = /^\s+/;
function t(r) {
return r && r.slice(0, i(r) + 1).replace(e, "");
}
return Yt = t, Yt;
}
var Kt, Yr;
function Eo() {
if (Yr) return Kt;
Yr = 1;
var i = To(), e = i.Symbol;
return Kt = e, Kt;
}
var Zt, Kr;
function Cn() {
if (Kr) return Zt;
Kr = 1;
var i = Eo(), e = Object.prototype, t = e.hasOwnProperty, r = e.toString, a = i ? i.toStringTag : void 0;
function o(s) {
var n = t.call(s, a), p = s[a];
try {
s[a] = void 0;
var l = !0;
} catch {
}
var c = r.call(s);
return l && (n ? s[a] = p : delete s[a]), c;
}
return Zt = o, Zt;
}
var Qt, Zr;
function Bn() {
if (Zr) return Qt;
Zr = 1;
var i = Object.prototype, e = i.toString;
function t(r) {
return e.call(r);
}
return Qt = t, Qt;
}
var Jt, Qr;
function In() {
if (Qr) return Jt;
Qr = 1;
var i = Eo(), e = Cn(), t = Bn(), r = "[object Null]", a = "[object Undefined]", o = i ? i.toStringTag : void 0;
function s(n) {
return n == null ? n === void 0 ? a : r : o && o in Object(n) ? e(n) : t(n);
}
return Jt = s, Jt;
}
var ei, Jr;
function Fn() {
if (Jr) return ei;
Jr = 1;
function i(e) {
return e != null && typeof e == "object";
}
return ei = i, ei;
}
var ti, ea;
function Tn() {
if (ea) return ti;
ea = 1;
var i = In(), e = Fn(), t = "[object Symbol]";
function r(a) {
return typeof a == "symbol" || e(a) && i(a) == t;
}
return ti = r, ti;
}
var ii, ta;
function En() {
if (ta) return ii;
ta = 1;
var i = Pn(), e = Ki(), t = Tn(), r = NaN, a = /^[-+]0x[0-9a-f]+$/i, o = /^0b[01]+$/i, s = /^0o[0-7]+$/i, n = parseInt;
function p(l) {
if (typeof l == "number")
return l;
if (t(l))
return r;
if (e(l)) {
var c = typeof l.valueOf == "function" ? l.valueOf() : l;
l = e(c) ? c + "" : c;
}
if (typeof l != "string")
return l === 0 ? l : +l;
l = i(l);
var d = o.test(l);
return d || s.test(l) ? n(l.slice(2), d ? 2 : 8) : a.test(l) ? r : +l;
}
return ii = p, ii;
}
var ri, ia;
function Ao() {
if (ia) return ri;
ia = 1;
var i = Ki(), e = kn(), t = En(), r = "Expected a function", a = Math.max, o = Math.min;
function s(n, p, l) {
var c, d, h, m, f, y, b = 0, v = !1, x = !1, _ = !0;
if (typeof n != "function")
throw new TypeError(r);
p = t(p) || 0, i(l) && (v = !!l.leading, x = "maxWait" in l, h = x ? a(t(l.maxWait) || 0, p) : h, _ = "trailing" in l ? !!l.trailing : _);
function C(F) {
var R = c, A = d;
return c = d = void 0, b = F, m = n.apply(A, R), m;
}
function B(F) {
return b = F, f = setTimeout(k, p), v ? C(F) : m;
}
function g(F) {
var R = F - y, A = F - b, V = p - R;
return x ? o(V, h - A) : V;
}
function D(F) {
var R = F - y, A = F - b;
return y === void 0 || R >= p || R < 0 || x && A >= h;
}
function k() {
var F = e();
if (D(F))
return S(F);
f = setTimeout(k, g(F));
}
function S(F) {
return f = void 0, _ && c ? C(F) : (c = d = void 0, m);
}
function O() {
f !== void 0 && clearTimeout(f), b = 0, c = y = d = f = void 0;
}
function T() {
return f === void 0 ? m : S(e());
}
function M() {
var F = e(), R = D(F);
if (c = arguments, d = this, y = F, R) {
if (f === void 0)
return B(y);
if (x)
return clearTimeout(f), f = setTimeout(k, p), C(y);
}
return f === void 0 && (f = setTimeout(k, p)), m;
}
return M.cancel = O, M.flush = T, M;
}
return ri = s, ri;
}
var ai, ra;
function An() {
if (ra) return ai;
ra = 1;
var i = Ao(), e = Ki(), t = "Expected a function";
function r(a, o, s) {
var n = !0, p = !0;
if (typeof a != "function")
throw new TypeError(t);
return e(s) && (n = "leading" in s ? !!s.leading : n, p = "trailing" in s ? !!s.trailing : p), i(a, o, {
leading: n,
maxWait: o,
trailing: p
});
}
return ai = r, ai;
}
var On = An();
const Mn = /* @__PURE__ */ $e(On);
var oi, aa;
function zn() {
return aa || (aa = 1, oi = function() {
var e = {}, t = e._fns = {};
e.emit = function(s, n, p, l, c, d, h) {
var m = r(s);
m.length && a(s, m, [n, p, l, c, d, h]);
}, e.on = function(s, n) {
t[s] || (t[s] = []), t[s].push(n);
}, e.once = function(s, n) {
function p() {
n.apply(this, arguments), e.off(s, p);
}
this.on(s, p);
}, e.off = function(s, n) {
var p = [];
if (s && n) {
var l = this._fns[s], c = 0, d = l ? l.length : 0;
for (c; c < d; c++)
l[c] !== n && p.push(l[c]);
}
p.length ? this._fns[s] = p : delete this._fns[s];
};
function r(o) {
var s = t[o] ? t[o] : [], n = o.indexOf(":"), p = n === -1 ? [o] : [o.substring(0, n), o.substring(n + 1)], l = Object.keys(t), c = 0, d = l.length;
for (c; c < d; c++) {
var h = l[c];
if (h === "*" && (s = s.concat(t[h])), p.length === 2 && p[0] === h) {
s = s.concat(t[h]);
break;
}
}
return s;
}
function a(o, s, n) {
var p = 0, l = s.length;
for (p; p < l && s[p]; p++)
s[p].event = o, s[p].apply(s[p], n);
}
return e;
}), oi;
}
var Rn = zn();
const Nn = /* @__PURE__ */ $e(Rn);
let Un = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", Zi = (i = 21) => {
let e = "", t = i | 0;
for (; t--; )
e += Un[Math.random() * 64 | 0];
return e;
};
const $n = "@uppy/core", Ln = "Core module for the extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:", Hn = "4.5.3", jn = "MIT", qn = "lib/index.js", Wn = "dist/style.min.css", Vn = "module", Gn = ["*.css"], Xn = { build: "tsc --build tsconfig.build.json", "build:css": "sass --load-path=../../ src/style.scss dist/style.css && postcss dist/style.css -u cssnano -o dist/style.min.css", typecheck: "tsc --build", test: "vitest run --environment=jsdom --silent='passed-only'" }, Yn = ["file uploader", "uppy", "uppy-plugin"], Kn = "https://uppy.io", Zn = { url: "https://github.com/transloadit/uppy/issues" }, Qn = { type: "git", url: "git+https://github.com/transloadit/uppy.git" }, Jn = ["src", "lib", "dist", "CHANGELOG.md"], el = { "@transloadit/prettier-bytes": "^0.3.4", "@uppy/store-default": "^4.3.2", "@uppy/utils": "^6.2.2", lodash: "^4.17.21", "mime-match": "^1.0.2", "namespace-emitter": "^2.0.1", nanoid: "^5.0.9", preact: "^10.5.13" }, tl = { "@types/deep-freeze": "^0", cssnano: "^7.0.7", "deep-freeze": "^0.0.1", jsdom: "^26.1.0", postcss: "^8.5.6", "postcss-cli": "^11.0.1", sass: "^1.89.2", typescript: "^5.8.3", vitest: "^3.2.4" }, il = {
name: $n,
description: Ln,
version: Hn,
license: jn,
main: qn,
style: Wn,
type: Vn,
sideEffects: Gn,
scripts: Xn,
keywords: Yn,
homepage: Kn,
bugs: Zn,
repository: Qn,
files: Jn,
dependencies: el,
devDependencies: tl
};
function rl(i, e) {
return e.name ? e.name : i.split("/")[0] === "image" ? `${i.split("/")[0]}.${i.split("/")[1]}` : "noname";
}
const al = {
strings: {
addBulkFilesFailed: {
0: "Failed to add %{smart_count} file due to an internal error",
1: "Failed to add %{smart_count} files due to internal errors"
},
youCanOnlyUploadX: {
0: "You can only upload %{smart_count} file",
1: "You can only upload %{smart_count} files"
},
youHaveToAtLeastSelectX: {
0: "You have to select at least %{smart_count} file",
1: "You have to select at least %{smart_count} files"
},
aggregateExceedsSize: "You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",
exceedsSize: "%{file} exceeds maximum allowed size of %{size}",
missingRequiredMetaField: "Missing required meta fields",
missingRequiredMetaFieldOnFile: "Missing required meta fields in %{fileName}",
inferiorSize: "This file is smaller than the allowed size of %{size}",
youCanOnlyUploadFileTypes: "You can only upload: %{types}",
noMoreFilesAllowed: "Cannot add more files",
noDuplicates: "Cannot add the duplicate file '%{fileName}', it already exists",
companionError: "Connection with Companion failed",
authAborted: "Authentication aborted",
companionUnauthorizeHint: "To unauthorize to your %{provider} account, please go to %{url}",
failedToUpload: "Failed to upload %{file}",
noInternetConnection: "No Internet connection",
connectedToInternet: "Connected to the Internet",
// Strings for remote providers
noFilesFound: "You have no files or folders here",
noSearchResults: "Unfortunately, there are no results for this search",
selectX: {
0: "Select %{smart_count}",
1: "Select %{smart_count}"
},
allFilesFromFolderNamed: "All files from folder %{name}",
openFolderNamed: "Open folder %{name}",
cancel: "Cancel",
logOut: "Log out",
logIn: "Log in",
pickFiles: "Pick files",
pickPhotos: "Pick photos",
filter: "Filter",
resetFilter: "Reset filter",
loading: "Loading...",
loadedXFiles: "Loaded %{numFiles} files",
authenticateWithTitle: "Please authenticate with %{pluginName} to select files",
authenticateWith: "Connect to %{pluginName}",
signInWithGoogle: "Sign in with Google",
searchImages: "Search for images",
enterTextToSearch: "Enter text to search for images",
search: "Search",
resetSearch: "Reset search",
emptyFolderAdded: "No files were added from empty folder",
addedNumFiles: "Added %{numFiles} file(s)",
folderAlreadyAdded: 'The folder "%{folder}" was already added',
folderAdded: {
0: "Added %{smart_count} file from %{folder}",
1: "Added %{smart_count} files from %{folder}"
},
additionalRestrictionsFailed: "%{count} additional restrictions were not fulfilled",
unnamed: "Unnamed",
pleaseWait: "Please wait"
}
};
var si, oa;
function ol() {
return oa || (oa = 1, si = function(e) {
if (typeof e != "number" || Number.isNaN(e))
throw new TypeError(`Expected a number, got ${typeof e}`);
const t = e < 0;
let r = Math.abs(e);
if (t && (r = -r), r === 0)
return "0 B";
const a = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], o = Math.min(Math.floor(Math.log(r) / Math.log(1024)), a.length - 1), s = Number(r / 1024 ** o), n = a[o];
return `${s >= 10 || s % 1 === 0 ? Math.round(s) : s.toFixed(1)} ${n}`;
}), si;
}
var sl = ol();
const ce = /* @__PURE__ */ $e(sl);
var ni, sa;
function nl() {
if (sa) return ni;
sa = 1;
function i(e, t) {
this.text = e = e || "", this.hasWild = ~e.indexOf("*"), this.separator = t, this.parts = e.split(t);
}
return i.prototype.match = function(e) {
var t = !0, r = this.parts, a, o = r.length, s;
if (typeof e == "string" || e instanceof String)
if (!this.hasWild && this.text != e)
t = !1;
else {
for (s = (e || "").split(this.separator), a = 0; t && a < o; a++)
r[a] !== "*" && (a < s.length ? t = r[a] === s[a] : t = !1);
t = t && s;
}
else if (typeof e.splice == "function")
for (t = [], a = e.length; a--; )
this.match(e[a]) && (t[t.length] = e[a]);
else if (typeof e == "object") {
t = {};
for (var n in e)
this.match(n) && (t[n] = e[n]);
}
return t;
}, ni = function(e, t, r) {
var a = new i(e, r || /[\/\.]/);
return typeof t < "u" ? a.match(t) : a;
}, ni;
}
var li, na;
function ll() {
if (na) return li;
na = 1;
var i = nl(), e = /[\/\+\.]/;
return li = function(t, r) {
function a(o) {
var s = i(o, t, e);
return s && s.length >= 2;
}
return r ? a(r.split(";")[0]) : a;
}, li;
}
var pl