var x = {
  exports: {}
};
(function(h, n) {
  (function(o) {
    h.exports = o();
  })(function(o) {
    var f = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
    function u(a, s) {
      var e = a[0], t = a[1], i = a[2], r = a[3];
      e += (t & i | ~t & r) + s[0] - 680876936 | 0, e = (e << 7 | e >>> 25) + t | 0, r += (e & t | ~e & i) + s[1] - 389564586 | 0, r = (r << 12 | r >>> 20) + e | 0, i += (r & e | ~r & t) + s[2] + 606105819 | 0, i = (i << 17 | i >>> 15) + r | 0, t += (i & r | ~i & e) + s[3] - 1044525330 | 0, t = (t << 22 | t >>> 10) + i | 0, e += (t & i | ~t & r) + s[4] - 176418897 | 0, e = (e << 7 | e >>> 25) + t | 0, r += (e & t | ~e & i) + s[5] + 1200080426 | 0, r = (r << 12 | r >>> 20) + e | 0, i += (r & e | ~r & t) + s[6] - 1473231341 | 0, i = (i << 17 | i >>> 15) + r | 0, t += (i & r | ~i & e) + s[7] - 45705983 | 0, t = (t << 22 | t >>> 10) + i | 0, e += (t & i | ~t & r) + s[8] + 1770035416 | 0, e = (e << 7 | e >>> 25) + t | 0, r += (e & t | ~e & i) + s[9] - 1958414417 | 0, r = (r << 12 | r >>> 20) + e | 0, i += (r & e | ~r & t) + s[10] - 42063 | 0, i = (i << 17 | i >>> 15) + r | 0, t += (i & r | ~i & e) + s[11] - 1990404162 | 0, t = (t << 22 | t >>> 10) + i | 0, e += (t & i | ~t & r) + s[12] + 1804603682 | 0, e = (e << 7 | e >>> 25) + t | 0, r += (e & t | ~e & i) + s[13] - 40341101 | 0, r = (r << 12 | r >>> 20) + e | 0, i += (r & e | ~r & t) + s[14] - 1502002290 | 0, i = (i << 17 | i >>> 15) + r | 0, t += (i & r | ~i & e) + s[15] + 1236535329 | 0, t = (t << 22 | t >>> 10) + i | 0, e += (t & r | i & ~r) + s[1] - 165796510 | 0, e = (e << 5 | e >>> 27) + t | 0, r += (e & i | t & ~i) + s[6] - 1069501632 | 0, r = (r << 9 | r >>> 23) + e | 0, i += (r & t | e & ~t) + s[11] + 643717713 | 0, i = (i << 14 | i >>> 18) + r | 0, t += (i & e | r & ~e) + s[0] - 373897302 | 0, t = (t << 20 | t >>> 12) + i | 0, e += (t & r | i & ~r) + s[5] - 701558691 | 0, e = (e << 5 | e >>> 27) + t | 0, r += (e & i | t & ~i) + s[10] + 38016083 | 0, r = (r << 9 | r >>> 23) + e | 0, i += (r & t | e & ~t) + s[15] - 660478335 | 0, i = (i << 14 | i >>> 18) + r | 0, t += (i & e | r & ~e) + s[4] - 405537848 | 0, t = (t << 20 | t >>> 12) + i | 0, e += (t & r | i & ~r) + s[9] + 568446438 | 0, e = (e << 5 | e >>> 27) + t | 0, r += (e & i | t & ~i) + s[14] - 1019803690 | 0, r = (r << 9 | r >>> 23) + e | 0, i += (r & t | e & ~t) + s[3] - 187363961 | 0, i = (i << 14 | i >>> 18) + r | 0, t += (i & e | r & ~e) + s[8] + 1163531501 | 0, t = (t << 20 | t >>> 12) + i | 0, e += (t & r | i & ~r) + s[13] - 1444681467 | 0, e = (e << 5 | e >>> 27) + t | 0, r += (e & i | t & ~i) + s[2] - 51403784 | 0, r = (r << 9 | r >>> 23) + e | 0, i += (r & t | e & ~t) + s[7] + 1735328473 | 0, i = (i << 14 | i >>> 18) + r | 0, t += (i & e | r & ~e) + s[12] - 1926607734 | 0, t = (t << 20 | t >>> 12) + i | 0, e += (t ^ i ^ r) + s[5] - 378558 | 0, e = (e << 4 | e >>> 28) + t | 0, r += (e ^ t ^ i) + s[8] - 2022574463 | 0, r = (r << 11 | r >>> 21) + e | 0, i += (r ^ e ^ t) + s[11] + 1839030562 | 0, i = (i << 16 | i >>> 16) + r | 0, t += (i ^ r ^ e) + s[14] - 35309556 | 0, t = (t << 23 | t >>> 9) + i | 0, e += (t ^ i ^ r) + s[1] - 1530992060 | 0, e = (e << 4 | e >>> 28) + t | 0, r += (e ^ t ^ i) + s[4] + 1272893353 | 0, r = (r << 11 | r >>> 21) + e | 0, i += (r ^ e ^ t) + s[7] - 155497632 | 0, i = (i << 16 | i >>> 16) + r | 0, t += (i ^ r ^ e) + s[10] - 1094730640 | 0, t = (t << 23 | t >>> 9) + i | 0, e += (t ^ i ^ r) + s[13] + 681279174 | 0, e = (e << 4 | e >>> 28) + t | 0, r += (e ^ t ^ i) + s[0] - 358537222 | 0, r = (r << 11 | r >>> 21) + e | 0, i += (r ^ e ^ t) + s[3] - 722521979 | 0, i = (i << 16 | i >>> 16) + r | 0, t += (i ^ r ^ e) + s[6] + 76029189 | 0, t = (t << 23 | t >>> 9) + i | 0, e += (t ^ i ^ r) + s[9] - 640364487 | 0, e = (e << 4 | e >>> 28) + t | 0, r += (e ^ t ^ i) + s[12] - 421815835 | 0, r = (r << 11 | r >>> 21) + e | 0, i += (r ^ e ^ t) + s[15] + 530742520 | 0, i = (i << 16 | i >>> 16) + r | 0, t += (i ^ r ^ e) + s[2] - 995338651 | 0, t = (t << 23 | t >>> 9) + i | 0, e += (i ^ (t | ~r)) + s[0] - 198630844 | 0, e = (e << 6 | e >>> 26) + t | 0, r += (t ^ (e | ~i)) + s[7] + 1126891415 | 0, r = (r << 10 | r >>> 22) + e | 0, i += (e ^ (r | ~t)) + s[14] - 1416354905 | 0, i = (i << 15 | i >>> 17) + r | 0, t += (r ^ (i | ~e)) + s[5] - 57434055 | 0, t = (t << 21 | t >>> 11) + i | 0, e += (i ^ (t | ~r)) + s[12] + 1700485571 | 0, e = (e << 6 | e >>> 26) + t | 0, r += (t ^ (e | ~i)) + s[3] - 1894986606 | 0, r = (r << 10 | r >>> 22) + e | 0, i += (e ^ (r | ~t)) + s[10] - 1051523 | 0, i = (i << 15 | i >>> 17) + r | 0, t += (r ^ (i | ~e)) + s[1] - 2054922799 | 0, t = (t << 21 | t >>> 11) + i | 0, e += (i ^ (t | ~r)) + s[8] + 1873313359 | 0, e = (e << 6 | e >>> 26) + t | 0, r += (t ^ (e | ~i)) + s[15] - 30611744 | 0, r = (r << 10 | r >>> 22) + e | 0, i += (e ^ (r | ~t)) + s[6] - 1560198380 | 0, i = (i << 15 | i >>> 17) + r | 0, t += (r ^ (i | ~e)) + s[13] + 1309151649 | 0, t = (t << 21 | t >>> 11) + i | 0, e += (i ^ (t | ~r)) + s[4] - 145523070 | 0, e = (e << 6 | e >>> 26) + t | 0, r += (t ^ (e | ~i)) + s[11] - 1120210379 | 0, r = (r << 10 | r >>> 22) + e | 0, i += (e ^ (r | ~t)) + s[2] + 718787259 | 0, i = (i << 15 | i >>> 17) + r | 0, t += (r ^ (i | ~e)) + s[9] - 343485551 | 0, t = (t << 21 | t >>> 11) + i | 0, a[0] = e + a[0] | 0, a[1] = t + a[1] | 0, a[2] = i + a[2] | 0, a[3] = r + a[3] | 0;
    }
    function p(a) {
      var s = [], e;
      for (e = 0; e < 64; e += 4)
        s[e >> 2] = a.charCodeAt(e) + (a.charCodeAt(e + 1) << 8) + (a.charCodeAt(e + 2) << 16) + (a.charCodeAt(e + 3) << 24);
      return s;
    }
    function d(a) {
      var s = [], e;
      for (e = 0; e < 64; e += 4)
        s[e >> 2] = a[e] + (a[e + 1] << 8) + (a[e + 2] << 16) + (a[e + 3] << 24);
      return s;
    }
    function y(a) {
      var s = a.length, e = [1732584193, -271733879, -1732584194, 271733878], t, i, r, l, b, g;
      for (t = 64; t <= s; t += 64)
        u(e, p(a.substring(t - 64, t)));
      for (a = a.substring(t - 64), i = a.length, r = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], t = 0; t < i; t += 1)
        r[t >> 2] |= a.charCodeAt(t) << (t % 4 << 3);
      if (r[t >> 2] |= 128 << (t % 4 << 3), t > 55)
        for (u(e, r), t = 0; t < 16; t += 1)
          r[t] = 0;
      return l = s * 8, l = l.toString(16).match(/(.*?)(.{0,8})$/), b = parseInt(l[2], 16), g = parseInt(l[1], 16) || 0, r[14] = b, r[15] = g, u(e, r), e;
    }
    function L(a) {
      var s = a.length, e = [1732584193, -271733879, -1732584194, 271733878], t, i, r, l, b, g;
      for (t = 64; t <= s; t += 64)
        u(e, d(a.subarray(t - 64, t)));
      for (a = t - 64 < s ? a.subarray(t - 64) : new Uint8Array(0), i = a.length, r = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], t = 0; t < i; t += 1)
        r[t >> 2] |= a[t] << (t % 4 << 3);
      if (r[t >> 2] |= 128 << (t % 4 << 3), t > 55)
        for (u(e, r), t = 0; t < 16; t += 1)
          r[t] = 0;
      return l = s * 8, l = l.toString(16).match(/(.*?)(.{0,8})$/), b = parseInt(l[2], 16), g = parseInt(l[1], 16) || 0, r[14] = b, r[15] = g, u(e, r), e;
    }
    function F(a) {
      var s = "", e;
      for (e = 0; e < 4; e += 1)
        s += f[a >> e * 8 + 4 & 15] + f[a >> e * 8 & 15];
      return s;
    }
    function m(a) {
      var s;
      for (s = 0; s < a.length; s += 1)
        a[s] = F(a[s]);
      return a.join("");
    }
    m(y("hello")), typeof ArrayBuffer < "u" && !ArrayBuffer.prototype.slice && function() {
      function a(s, e) {
        return s = s | 0 || 0, s < 0 ? Math.max(s + e, 0) : Math.min(s, e);
      }
      ArrayBuffer.prototype.slice = function(s, e) {
        var t = this.byteLength, i = a(s, t), r = t, l, b, g, B;
        return e !== o && (r = a(e, t)), i > r ? new ArrayBuffer(0) : (l = r - i, b = new ArrayBuffer(l), g = new Uint8Array(b), B = new Uint8Array(this, i, l), g.set(B), b);
      };
    }();
    function E(a) {
      return /[\u0080-\uFFFF]/.test(a) && (a = unescape(encodeURIComponent(a))), a;
    }
    function I(a, s) {
      var e = a.length, t = new ArrayBuffer(e), i = new Uint8Array(t), r;
      for (r = 0; r < e; r += 1)
        i[r] = a.charCodeAt(r);
      return s ? i : t;
    }
    function H(a) {
      return String.fromCharCode.apply(null, new Uint8Array(a));
    }
    function M(a, s, e) {
      var t = new Uint8Array(a.byteLength + s.byteLength);
      return t.set(new Uint8Array(a)), t.set(new Uint8Array(s), a.byteLength), t;
    }
    function A(a) {
      var s = [], e = a.length, t;
      for (t = 0; t < e - 1; t += 2)
        s.push(parseInt(a.substr(t, 2), 16));
      return String.fromCharCode.apply(String, s);
    }
    function c() {
      this.reset();
    }
    return c.prototype.append = function(a) {
      return this.appendBinary(E(a)), this;
    }, c.prototype.appendBinary = function(a) {
      this._buff += a, this._length += a.length;
      var s = this._buff.length, e;
      for (e = 64; e <= s; e += 64)
        u(this._hash, p(this._buff.substring(e - 64, e)));
      return this._buff = this._buff.substring(e - 64), this;
    }, c.prototype.end = function(a) {
      var s = this._buff, e = s.length, t, i = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], r;
      for (t = 0; t < e; t += 1)
        i[t >> 2] |= s.charCodeAt(t) << (t % 4 << 3);
      return this._finish(i, e), r = m(this._hash), a && (r = A(r)), this.reset(), r;
    }, c.prototype.reset = function() {
      return this._buff = "", this._length = 0, this._hash = [1732584193, -271733879, -1732584194, 271733878], this;
    }, c.prototype.getState = function() {
      return {
        buff: this._buff,
        length: this._length,
        hash: this._hash.slice()
      };
    }, c.prototype.setState = function(a) {
      return this._buff = a.buff, this._length = a.length, this._hash = a.hash, this;
    }, c.prototype.destroy = function() {
      delete this._hash, delete this._buff, delete this._length;
    }, c.prototype._finish = function(a, s) {
      var e = s, t, i, r;
      if (a[e >> 2] |= 128 << (e % 4 << 3), e > 55)
        for (u(this._hash, a), e = 0; e < 16; e += 1)
          a[e] = 0;
      t = this._length * 8, t = t.toString(16).match(/(.*?)(.{0,8})$/), i = parseInt(t[2], 16), r = parseInt(t[1], 16) || 0, a[14] = i, a[15] = r, u(this._hash, a);
    }, c.hash = function(a, s) {
      return c.hashBinary(E(a), s);
    }, c.hashBinary = function(a, s) {
      var e = y(a), t = m(e);
      return s ? A(t) : t;
    }, c.ArrayBuffer = function() {
      this.reset();
    }, c.ArrayBuffer.prototype.append = function(a) {
      var s = M(this._buff.buffer, a), e = s.length, t;
      for (this._length += a.byteLength, t = 64; t <= e; t += 64)
        u(this._hash, d(s.subarray(t - 64, t)));
      return this._buff = t - 64 < e ? new Uint8Array(s.buffer.slice(t - 64)) : new Uint8Array(0), this;
    }, c.ArrayBuffer.prototype.end = function(a) {
      var s = this._buff, e = s.length, t = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], i, r;
      for (i = 0; i < e; i += 1)
        t[i >> 2] |= s[i] << (i % 4 << 3);
      return this._finish(t, e), r = m(this._hash), a && (r = A(r)), this.reset(), r;
    }, c.ArrayBuffer.prototype.reset = function() {
      return this._buff = new Uint8Array(0), this._length = 0, this._hash = [1732584193, -271733879, -1732584194, 271733878], this;
    }, c.ArrayBuffer.prototype.getState = function() {
      var a = c.prototype.getState.call(this);
      return a.buff = H(a.buff), a;
    }, c.ArrayBuffer.prototype.setState = function(a) {
      return a.buff = I(a.buff, !0), c.prototype.setState.call(this, a);
    }, c.ArrayBuffer.prototype.destroy = c.prototype.destroy, c.ArrayBuffer.prototype._finish = c.prototype._finish, c.ArrayBuffer.hash = function(a, s) {
      var e = L(new Uint8Array(a)), t = m(e);
      return s ? A(t) : t;
    }, c;
  });
})(x);
var $ = x.exports;
const z = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
class S {
  static create(n, o) {
    new S(n).create(o);
  }
  constructor(n) {
    this.file = n, this.chunkSize = 2097152, this.chunkCount = Math.ceil(this.file.size / this.chunkSize), this.chunkIndex = 0;
  }
  create(n) {
    this.callback = n, this.md5Buffer = new $.ArrayBuffer(), this.fileReader = new FileReader(), this.fileReader.addEventListener("load", (o) => this.fileReaderDidLoad(o)), this.fileReader.addEventListener("error", (o) => this.fileReaderDidError(o)), this.readNextChunk();
  }
  fileReaderDidLoad(n) {
    if (this.md5Buffer.append(n.target.result), !this.readNextChunk()) {
      const o = this.md5Buffer.end(!0), f = btoa(o);
      this.callback(null, f);
    }
  }
  fileReaderDidError(n) {
    this.callback(`Error reading ${this.file.name}`);
  }
  readNextChunk() {
    if (this.chunkIndex < this.chunkCount || this.chunkIndex == 0 && this.chunkCount == 0) {
      const n = this.chunkIndex * this.chunkSize, o = Math.min(n + this.chunkSize, this.file.size), f = z.call(this.file, n, o);
      return this.fileReader.readAsArrayBuffer(f), this.chunkIndex++, !0;
    } else
      return !1;
  }
}
function N(h) {
  const n = R(document.head, `meta[name="${h}"]`);
  if (n)
    return n.getAttribute("content");
}
function T(h, n) {
  typeof h == "string" && (n = h, h = document);
  const o = h.querySelectorAll(n);
  return D(o);
}
function R(h, n) {
  return typeof h == "string" && (n = h, h = document), h.querySelector(n);
}
function w(h, n, o = {}) {
  const { disabled: f } = h, { bubbles: u, cancelable: p, detail: d } = o, y = document.createEvent("Event");
  y.initEvent(n, u || !0, p || !0), y.detail = d || {};
  try {
    h.disabled = !1, h.dispatchEvent(y);
  } finally {
    h.disabled = f;
  }
  return y;
}
function D(h) {
  return Array.isArray(h) ? h : Array.from ? Array.from(h) : [].slice.call(h);
}
class W {
  constructor(n, o, f, u = {}) {
    this.file = n, this.attributes = {
      filename: n.name,
      content_type: n.type || "application/octet-stream",
      byte_size: n.size,
      checksum: o
    }, this.xhr = new XMLHttpRequest(), this.xhr.open("POST", f, !0), this.xhr.responseType = "json", this.xhr.setRequestHeader("Content-Type", "application/json"), this.xhr.setRequestHeader("Accept", "application/json"), this.xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"), Object.keys(u).forEach((d) => {
      this.xhr.setRequestHeader(d, u[d]);
    });
    const p = N("csrf-token");
    p != null && this.xhr.setRequestHeader("X-CSRF-Token", p), this.xhr.addEventListener("load", (d) => this.requestDidLoad(d)), this.xhr.addEventListener("error", (d) => this.requestDidError(d));
  }
  get status() {
    return this.xhr.status;
  }
  get response() {
    const { responseType: n, response: o } = this.xhr;
    return n == "json" ? o : JSON.parse(o);
  }
  create(n) {
    this.callback = n, this.xhr.send(JSON.stringify({
      blob: this.attributes
    }));
  }
  requestDidLoad(n) {
    if (this.status >= 200 && this.status < 300) {
      const { response: o } = this, { direct_upload: f } = o;
      delete o.direct_upload, this.attributes = o, this.directUploadData = f, this.callback(null, this.toJSON());
    } else
      this.requestDidError(n);
  }
  requestDidError(n) {
    this.callback(`Error creating Blob for "${this.file.name}". Status: ${this.status}`);
  }
  toJSON() {
    const n = {};
    for (const o in this.attributes)
      n[o] = this.attributes[o];
    return n;
  }
}
class X {
  constructor(n) {
    this.blob = n, this.file = n.file;
    const { url: o, headers: f } = n.directUploadData;
    this.xhr = new XMLHttpRequest(), this.xhr.open("PUT", o, !0), this.xhr.responseType = "text";
    for (const u in f)
      this.xhr.setRequestHeader(u, f[u]);
    this.xhr.addEventListener("load", (u) => this.requestDidLoad(u)), this.xhr.addEventListener("error", (u) => this.requestDidError(u));
  }
  create(n) {
    this.callback = n, this.xhr.send(this.file.slice());
  }
  requestDidLoad(n) {
    const { status: o, response: f } = this.xhr;
    o >= 200 && o < 300 ? this.callback(null, f) : this.requestDidError(n);
  }
  requestDidError(n) {
    this.callback(`Error storing "${this.file.name}". Status: ${this.xhr.status}`);
  }
}
let O = 0;
class j {
  constructor(n, o, f, u = {}) {
    this.id = ++O, this.file = n, this.url = o, this.delegate = f, this.customHeaders = u;
  }
  create(n) {
    S.create(this.file, (o, f) => {
      if (o) {
        n(o);
        return;
      }
      const u = new W(this.file, f, this.url, this.customHeaders);
      U(this.delegate, "directUploadWillCreateBlobWithXHR", u.xhr), u.create((p) => {
        if (p)
          n(p);
        else {
          const d = new X(u);
          U(this.delegate, "directUploadWillStoreFileWithXHR", d.xhr), d.create((y) => {
            y ? n(y) : n(null, u.toJSON());
          });
        }
      });
    });
  }
}
function U(h, n, ...o) {
  if (h && typeof h[n] == "function")
    return h[n](...o);
}
class J {
  constructor(n, o) {
    this.input = n, this.file = o, this.directUpload = new j(this.file, this.url, this), this.dispatch("initialize");
  }
  start(n) {
    const o = document.createElement("input");
    o.type = "hidden", o.name = this.input.name, this.input.insertAdjacentElement("beforebegin", o), this.dispatch("start"), this.directUpload.create((f, u) => {
      f ? (o.parentNode.removeChild(o), this.dispatchError(f)) : o.value = u.signed_id, this.dispatch("end"), n(f);
    });
  }
  uploadRequestDidProgress(n) {
    const o = n.loaded / n.total * 100;
    o && this.dispatch("progress", {
      progress: o
    });
  }
  get url() {
    return this.input.getAttribute("data-direct-upload-url");
  }
  dispatch(n, o = {}) {
    return o.file = this.file, o.id = this.directUpload.id, w(this.input, `direct-upload:${n}`, {
      detail: o
    });
  }
  dispatchError(n) {
    this.dispatch("error", {
      error: n
    }).defaultPrevented || alert(n);
  }
  directUploadWillCreateBlobWithXHR(n) {
    this.dispatch("before-blob-request", {
      xhr: n
    });
  }
  directUploadWillStoreFileWithXHR(n) {
    this.dispatch("before-storage-request", {
      xhr: n
    }), n.upload.addEventListener("progress", (o) => this.uploadRequestDidProgress(o));
  }
}
const P = "input[type=file][data-direct-upload-url]:not([disabled])";
class V {
  constructor(n) {
    this.form = n, this.inputs = T(n, P).filter((o) => o.files.length);
  }
  start(n) {
    const o = this.createDirectUploadControllers(), f = () => {
      const u = o.shift();
      u ? u.start((p) => {
        p ? (n(p), this.dispatch("end")) : f();
      }) : (n(), this.dispatch("end"));
    };
    this.dispatch("start"), f();
  }
  createDirectUploadControllers() {
    const n = [];
    return this.inputs.forEach((o) => {
      D(o.files).forEach((f) => {
        const u = new J(o, f);
        n.push(u);
      });
    }), n;
  }
  dispatch(n, o = {}) {
    return w(this.form, `direct-uploads:${n}`, {
      detail: o
    });
  }
}
const _ = "data-direct-uploads-processing", v = /* @__PURE__ */ new WeakMap();
let C = !1;
function G() {
  C || (C = !0, document.addEventListener("click", Q, !0), document.addEventListener("submit", Y, !0), document.addEventListener("ajax:before", Z));
}
function Q(h) {
  const n = h.target.closest("button, input");
  n && n.type === "submit" && n.form && v.set(n.form, n);
}
function Y(h) {
  q(h);
}
function Z(h) {
  h.target.tagName == "FORM" && q(h);
}
function q(h) {
  const n = h.target;
  if (n.hasAttribute(_)) {
    h.preventDefault();
    return;
  }
  const o = new V(n), { inputs: f } = o;
  f.length && (h.preventDefault(), n.setAttribute(_, ""), f.forEach(k), o.start((u) => {
    n.removeAttribute(_), u ? f.forEach(tt) : K(n);
  }));
}
function K(h) {
  let n = v.get(h) || R(h, "input[type=submit], button[type=submit]");
  if (n) {
    const { disabled: o } = n;
    n.disabled = !1, n.focus(), n.click(), n.disabled = o;
  } else
    n = document.createElement("input"), n.type = "submit", n.style.display = "none", h.appendChild(n), n.click(), h.removeChild(n);
  v.delete(h);
}
function k(h) {
  h.disabled = !0;
}
function tt(h) {
  h.disabled = !1;
}
function et() {
  window.ActiveStorage && G();
}
setTimeout(et, 1);
export {
  j as DirectUpload,
  J as DirectUploadController,
  V as DirectUploadsController,
  w as dispatchEvent,
  G as start
};
//# sourceMappingURL=index.es80.js.map
