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EnF,MAAMkkB,EAAUlkB,EAAMiG,OAGtB,GAAI,yBAAyBzP,KAAK0tB,GAChC,IACE,MAAM+B,EAAY,IAAIC,IAAIlmB,GAEpBmmB,EADa,IAAIC,gBAAgBH,EAAUI,QACjBvjB,IAAI,OACpC,GAAIqjB,EACF,OAAOG,mBAAmBH,EAE9B,CAAE,MAEA,OAAOjC,CACT,CAEF,OAAOA,CACT,CAYcqC,CADIT,EAAYR,IAE5B,IAAIkB,EAAW,CACblnB,GAAI,KACJmnB,QAAS,MAsCX,MApCI,sCAAsCjwB,KAAK2G,GAC7CqpB,EAAW,CACTlnB,GAAI0kB,EAAQ7mB,GACZspB,QAAS,WAEF,QAAQjwB,KAAK2G,GACtBqpB,EAAW,CACTlnB,GAAIulB,EAAM1nB,GACVspB,QAAS,SAEF,OAAOjwB,KAAK2G,GACrBqpB,EAAW,CACTlnB,GAAI8lB,EAAKjoB,GACTspB,QAAS,QAEF,aAAajwB,KAAK2G,GAC3BqpB,EAAW,CACTlnB,GAAI+lB,EAAWloB,GACfspB,QAAS,cAEF,kBAAkBjwB,KAAK2G,GAChCqpB,EAAW,CACTlnB,GAAIkmB,EAAgBroB,GACpBspB,QAAS,mBAEF,cAAcjwB,KAAK2G,GAC5BqpB,EAAW,CACTlnB,GAAImmB,EAAOtoB,GACXspB,QAAS,UAEF,6BAA6BjwB,KAAK2G,KAC3CqpB,EAAW,CACTlnB,GAAIqmB,EAAYxoB,GAChBspB,QAAS,gBAGND,CACT","sources":["webpack:///./node_modules/@rails/actiontext/app/assets/javascripts/actiontext.esm.js","webpack:///./node_modules/@mux/upchunk/dist/upchunk.mjs","webpack:///./node_modules/@mux/mux-uploader/dist/index.mjs","webpack:///./node_modules/get-video-id/dist/get-video-id.esm.js"],"sourcesContent":["var sparkMd5 = {\n exports: {}\n};\n\n(function(module, exports) {\n (function(factory) {\n {\n module.exports = factory();\n }\n })((function(undefined$1) {\n var hex_chr = [ \"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\" ];\n function md5cycle(x, k) {\n var a = x[0], b = x[1], c = x[2], d = x[3];\n a += (b & c | ~b & d) + k[0] - 680876936 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[1] - 389564586 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[2] + 606105819 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[3] - 1044525330 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[4] - 176418897 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[5] + 1200080426 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[6] - 1473231341 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[7] - 45705983 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[8] + 1770035416 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[9] - 1958414417 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[10] - 42063 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[11] - 1990404162 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[12] + 1804603682 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[13] - 40341101 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[14] - 1502002290 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[15] + 1236535329 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & d | c & ~d) + k[1] - 165796510 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[6] - 1069501632 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[11] + 643717713 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[0] - 373897302 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[5] - 701558691 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[10] + 38016083 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[15] - 660478335 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[4] - 405537848 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[9] + 568446438 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[14] - 1019803690 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[3] - 187363961 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[8] + 1163531501 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[13] - 1444681467 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[2] - 51403784 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[7] + 1735328473 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[12] - 1926607734 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b ^ c ^ d) + k[5] - 378558 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[8] - 2022574463 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[11] + 1839030562 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[14] - 35309556 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[1] - 1530992060 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[4] + 1272893353 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[7] - 155497632 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[10] - 1094730640 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[13] + 681279174 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[0] - 358537222 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[3] - 722521979 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[6] + 76029189 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[9] - 640364487 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[12] - 421815835 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[15] + 530742520 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[2] - 995338651 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n x[0] = a + x[0] | 0;\n x[1] = b + x[1] | 0;\n x[2] = c + x[2] | 0;\n x[3] = d + x[3] | 0;\n }\n function md5blk(s) {\n var md5blks = [], i;\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n }\n return md5blks;\n }\n function md5blk_array(a) {\n var md5blks = [], i;\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);\n }\n return md5blks;\n }\n function md51(s) {\n var n = s.length, state = [ 1732584193, -271733879, -1732584194, 271733878 ], i, length, tail, tmp, lo, hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n length = s.length;\n tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n function md51_array(a) {\n var n = a.length, state = [ 1732584193, -271733879, -1732584194, 271733878 ], i, length, tail, tmp, lo, hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\n }\n a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);\n length = a.length;\n tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= a[i] << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n function rhex(n) {\n var s = \"\", j;\n for (j = 0; j < 4; j += 1) {\n s += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15];\n }\n return s;\n }\n function hex(x) {\n var i;\n for (i = 0; i < x.length; i += 1) {\n x[i] = rhex(x[i]);\n }\n return x.join(\"\");\n }\n if (hex(md51(\"hello\")) !== \"5d41402abc4b2a76b9719d911017c592\") ;\n if (typeof ArrayBuffer !== \"undefined\" && !ArrayBuffer.prototype.slice) {\n (function() {\n function clamp(val, length) {\n val = val | 0 || 0;\n if (val < 0) {\n return Math.max(val + length, 0);\n }\n return Math.min(val, length);\n }\n ArrayBuffer.prototype.slice = function(from, to) {\n var length = this.byteLength, begin = clamp(from, length), end = length, num, target, targetArray, sourceArray;\n if (to !== undefined$1) {\n end = clamp(to, length);\n }\n if (begin > end) {\n return new ArrayBuffer(0);\n }\n num = end - begin;\n target = new ArrayBuffer(num);\n targetArray = new Uint8Array(target);\n sourceArray = new Uint8Array(this, begin, num);\n targetArray.set(sourceArray);\n return target;\n };\n })();\n }\n function toUtf8(str) {\n if (/[\\u0080-\\uFFFF]/.test(str)) {\n str = unescape(encodeURIComponent(str));\n }\n return str;\n }\n function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n var length = str.length, buff = new ArrayBuffer(length), arr = new Uint8Array(buff), i;\n for (i = 0; i < length; i += 1) {\n arr[i] = str.charCodeAt(i);\n }\n return returnUInt8Array ? arr : buff;\n }\n function arrayBuffer2Utf8Str(buff) {\n return String.fromCharCode.apply(null, new Uint8Array(buff));\n }\n function concatenateArrayBuffers(first, second, returnUInt8Array) {\n var result = new Uint8Array(first.byteLength + second.byteLength);\n result.set(new Uint8Array(first));\n result.set(new Uint8Array(second), first.byteLength);\n return returnUInt8Array ? result : result.buffer;\n }\n function hexToBinaryString(hex) {\n var bytes = [], length = hex.length, x;\n for (x = 0; x < length - 1; x += 2) {\n bytes.push(parseInt(hex.substr(x, 2), 16));\n }\n return String.fromCharCode.apply(String, bytes);\n }\n function SparkMD5() {\n this.reset();\n }\n SparkMD5.prototype.append = function(str) {\n this.appendBinary(toUtf8(str));\n return this;\n };\n SparkMD5.prototype.appendBinary = function(contents) {\n this._buff += contents;\n this._length += contents.length;\n var length = this._buff.length, i;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n }\n this._buff = this._buff.substring(i - 64);\n return this;\n };\n SparkMD5.prototype.end = function(raw) {\n var buff = this._buff, length = buff.length, i, tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\n };\n SparkMD5.prototype.reset = function() {\n this._buff = \"\";\n this._length = 0;\n this._hash = [ 1732584193, -271733879, -1732584194, 271733878 ];\n return this;\n };\n SparkMD5.prototype.getState = function() {\n return {\n buff: this._buff,\n length: this._length,\n hash: this._hash.slice()\n };\n };\n SparkMD5.prototype.setState = function(state) {\n this._buff = state.buff;\n this._length = state.length;\n this._hash = state.hash;\n return this;\n };\n SparkMD5.prototype.destroy = function() {\n delete this._hash;\n delete this._buff;\n delete this._length;\n };\n SparkMD5.prototype._finish = function(tail, length) {\n var i = length, tmp, lo, hi;\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(this._hash, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = this._length * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(this._hash, tail);\n };\n SparkMD5.hash = function(str, raw) {\n return SparkMD5.hashBinary(toUtf8(str), raw);\n };\n SparkMD5.hashBinary = function(content, raw) {\n var hash = md51(content), ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n SparkMD5.ArrayBuffer = function() {\n this.reset();\n };\n SparkMD5.ArrayBuffer.prototype.append = function(arr) {\n var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), length = buff.length, i;\n this._length += arr.byteLength;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n }\n this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n return this;\n };\n SparkMD5.ArrayBuffer.prototype.end = function(raw) {\n var buff = this._buff, length = buff.length, tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], i, ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff[i] << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\n };\n SparkMD5.ArrayBuffer.prototype.reset = function() {\n this._buff = new Uint8Array(0);\n this._length = 0;\n this._hash = [ 1732584193, -271733879, -1732584194, 271733878 ];\n return this;\n };\n SparkMD5.ArrayBuffer.prototype.getState = function() {\n var state = SparkMD5.prototype.getState.call(this);\n state.buff = arrayBuffer2Utf8Str(state.buff);\n return state;\n };\n SparkMD5.ArrayBuffer.prototype.setState = function(state) {\n state.buff = utf8Str2ArrayBuffer(state.buff, true);\n return SparkMD5.prototype.setState.call(this, state);\n };\n SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n SparkMD5.ArrayBuffer.hash = function(arr, raw) {\n var hash = md51_array(new Uint8Array(arr)), ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n return SparkMD5;\n }));\n})(sparkMd5);\n\nvar SparkMD5 = sparkMd5.exports;\n\nconst fileSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;\n\nclass FileChecksum {\n static create(file, callback) {\n const instance = new FileChecksum(file);\n instance.create(callback);\n }\n constructor(file) {\n this.file = file;\n this.chunkSize = 2097152;\n this.chunkCount = Math.ceil(this.file.size / this.chunkSize);\n this.chunkIndex = 0;\n }\n create(callback) {\n this.callback = callback;\n this.md5Buffer = new SparkMD5.ArrayBuffer;\n this.fileReader = new FileReader;\n this.fileReader.addEventListener(\"load\", (event => this.fileReaderDidLoad(event)));\n this.fileReader.addEventListener(\"error\", (event => this.fileReaderDidError(event)));\n this.readNextChunk();\n }\n fileReaderDidLoad(event) {\n this.md5Buffer.append(event.target.result);\n if (!this.readNextChunk()) {\n const binaryDigest = this.md5Buffer.end(true);\n const base64digest = btoa(binaryDigest);\n this.callback(null, base64digest);\n }\n }\n fileReaderDidError(event) {\n this.callback(`Error reading ${this.file.name}`);\n }\n readNextChunk() {\n if (this.chunkIndex < this.chunkCount || this.chunkIndex == 0 && this.chunkCount == 0) {\n const start = this.chunkIndex * this.chunkSize;\n const end = Math.min(start + this.chunkSize, this.file.size);\n const bytes = fileSlice.call(this.file, start, end);\n this.fileReader.readAsArrayBuffer(bytes);\n this.chunkIndex++;\n return true;\n } else {\n return false;\n }\n }\n}\n\nfunction getMetaValue(name) {\n const element = findElement(document.head, `meta[name=\"${name}\"]`);\n if (element) {\n return element.getAttribute(\"content\");\n }\n}\n\nfunction findElements(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n const elements = root.querySelectorAll(selector);\n return toArray(elements);\n}\n\nfunction findElement(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n return root.querySelector(selector);\n}\n\nfunction dispatchEvent(element, type, eventInit = {}) {\n const {disabled: disabled} = element;\n const {bubbles: bubbles, cancelable: cancelable, detail: detail} = eventInit;\n const event = document.createEvent(\"Event\");\n event.initEvent(type, bubbles || true, cancelable || true);\n event.detail = detail || {};\n try {\n element.disabled = false;\n element.dispatchEvent(event);\n } finally {\n element.disabled = disabled;\n }\n return event;\n}\n\nfunction toArray(value) {\n if (Array.isArray(value)) {\n return value;\n } else if (Array.from) {\n return Array.from(value);\n } else {\n return [].slice.call(value);\n }\n}\n\nclass BlobRecord {\n constructor(file, checksum, url, customHeaders = {}) {\n this.file = file;\n this.attributes = {\n filename: file.name,\n content_type: file.type || \"application/octet-stream\",\n byte_size: file.size,\n checksum: checksum\n };\n this.xhr = new XMLHttpRequest;\n this.xhr.open(\"POST\", url, true);\n this.xhr.responseType = \"json\";\n this.xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n this.xhr.setRequestHeader(\"Accept\", \"application/json\");\n this.xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n Object.keys(customHeaders).forEach((headerKey => {\n this.xhr.setRequestHeader(headerKey, customHeaders[headerKey]);\n }));\n const csrfToken = getMetaValue(\"csrf-token\");\n if (csrfToken != undefined) {\n this.xhr.setRequestHeader(\"X-CSRF-Token\", csrfToken);\n }\n this.xhr.addEventListener(\"load\", (event => this.requestDidLoad(event)));\n this.xhr.addEventListener(\"error\", (event => this.requestDidError(event)));\n }\n get status() {\n return this.xhr.status;\n }\n get response() {\n const {responseType: responseType, response: response} = this.xhr;\n if (responseType == \"json\") {\n return response;\n } else {\n return JSON.parse(response);\n }\n }\n create(callback) {\n this.callback = callback;\n this.xhr.send(JSON.stringify({\n blob: this.attributes\n }));\n }\n requestDidLoad(event) {\n if (this.status >= 200 && this.status < 300) {\n const {response: response} = this;\n const {direct_upload: direct_upload} = response;\n delete response.direct_upload;\n this.attributes = response;\n this.directUploadData = direct_upload;\n this.callback(null, this.toJSON());\n } else {\n this.requestDidError(event);\n }\n }\n requestDidError(event) {\n this.callback(`Error creating Blob for \"${this.file.name}\". Status: ${this.status}`);\n }\n toJSON() {\n const result = {};\n for (const key in this.attributes) {\n result[key] = this.attributes[key];\n }\n return result;\n }\n}\n\nclass BlobUpload {\n constructor(blob) {\n this.blob = blob;\n this.file = blob.file;\n const {url: url, headers: headers} = blob.directUploadData;\n this.xhr = new XMLHttpRequest;\n this.xhr.open(\"PUT\", url, true);\n this.xhr.responseType = \"text\";\n for (const key in headers) {\n this.xhr.setRequestHeader(key, headers[key]);\n }\n this.xhr.addEventListener(\"load\", (event => this.requestDidLoad(event)));\n this.xhr.addEventListener(\"error\", (event => this.requestDidError(event)));\n }\n create(callback) {\n this.callback = callback;\n this.xhr.send(this.file.slice());\n }\n requestDidLoad(event) {\n const {status: status, response: response} = this.xhr;\n if (status >= 200 && status < 300) {\n this.callback(null, response);\n } else {\n this.requestDidError(event);\n }\n }\n requestDidError(event) {\n this.callback(`Error storing \"${this.file.name}\". Status: ${this.xhr.status}`);\n }\n}\n\nlet id = 0;\n\nclass DirectUpload {\n constructor(file, url, delegate, customHeaders = {}) {\n this.id = ++id;\n this.file = file;\n this.url = url;\n this.delegate = delegate;\n this.customHeaders = customHeaders;\n }\n create(callback) {\n FileChecksum.create(this.file, ((error, checksum) => {\n if (error) {\n callback(error);\n return;\n }\n const blob = new BlobRecord(this.file, checksum, this.url, this.customHeaders);\n notify(this.delegate, \"directUploadWillCreateBlobWithXHR\", blob.xhr);\n blob.create((error => {\n if (error) {\n callback(error);\n } else {\n const upload = new BlobUpload(blob);\n notify(this.delegate, \"directUploadWillStoreFileWithXHR\", upload.xhr);\n upload.create((error => {\n if (error) {\n callback(error);\n } else {\n callback(null, blob.toJSON());\n }\n }));\n }\n }));\n }));\n }\n}\n\nfunction notify(object, methodName, ...messages) {\n if (object && typeof object[methodName] == \"function\") {\n return object[methodName](...messages);\n }\n}\n\nclass DirectUploadController {\n constructor(input, file) {\n this.input = input;\n this.file = file;\n this.directUpload = new DirectUpload(this.file, this.url, this);\n this.dispatch(\"initialize\");\n }\n start(callback) {\n const hiddenInput = document.createElement(\"input\");\n hiddenInput.type = \"hidden\";\n hiddenInput.name = this.input.name;\n this.input.insertAdjacentElement(\"beforebegin\", hiddenInput);\n this.dispatch(\"start\");\n this.directUpload.create(((error, attributes) => {\n if (error) {\n hiddenInput.parentNode.removeChild(hiddenInput);\n this.dispatchError(error);\n } else {\n hiddenInput.value = attributes.signed_id;\n }\n this.dispatch(\"end\");\n callback(error);\n }));\n }\n uploadRequestDidProgress(event) {\n const progress = event.loaded / event.total * 100;\n if (progress) {\n this.dispatch(\"progress\", {\n progress: progress\n });\n }\n }\n get url() {\n return this.input.getAttribute(\"data-direct-upload-url\");\n }\n dispatch(name, detail = {}) {\n detail.file = this.file;\n detail.id = this.directUpload.id;\n return dispatchEvent(this.input, `direct-upload:${name}`, {\n detail: detail\n });\n }\n dispatchError(error) {\n const event = this.dispatch(\"error\", {\n error: error\n });\n if (!event.defaultPrevented) {\n alert(error);\n }\n }\n directUploadWillCreateBlobWithXHR(xhr) {\n this.dispatch(\"before-blob-request\", {\n xhr: xhr\n });\n }\n directUploadWillStoreFileWithXHR(xhr) {\n this.dispatch(\"before-storage-request\", {\n xhr: xhr\n });\n xhr.upload.addEventListener(\"progress\", (event => this.uploadRequestDidProgress(event)));\n }\n}\n\nconst inputSelector = \"input[type=file][data-direct-upload-url]:not([disabled])\";\n\nclass DirectUploadsController {\n constructor(form) {\n this.form = form;\n this.inputs = findElements(form, inputSelector).filter((input => input.files.length));\n }\n start(callback) {\n const controllers = this.createDirectUploadControllers();\n const startNextController = () => {\n const controller = controllers.shift();\n if (controller) {\n controller.start((error => {\n if (error) {\n callback(error);\n this.dispatch(\"end\");\n } else {\n startNextController();\n }\n }));\n } else {\n callback();\n this.dispatch(\"end\");\n }\n };\n this.dispatch(\"start\");\n startNextController();\n }\n createDirectUploadControllers() {\n const controllers = [];\n this.inputs.forEach((input => {\n toArray(input.files).forEach((file => {\n const controller = new DirectUploadController(input, file);\n controllers.push(controller);\n }));\n }));\n return controllers;\n }\n dispatch(name, detail = {}) {\n return dispatchEvent(this.form, `direct-uploads:${name}`, {\n detail: detail\n });\n }\n}\n\nconst processingAttribute = \"data-direct-uploads-processing\";\n\nconst submitButtonsByForm = new WeakMap;\n\nlet started = false;\n\nfunction start() {\n if (!started) {\n started = true;\n document.addEventListener(\"click\", didClick, true);\n document.addEventListener(\"submit\", didSubmitForm, true);\n document.addEventListener(\"ajax:before\", didSubmitRemoteElement);\n }\n}\n\nfunction didClick(event) {\n const button = event.target.closest(\"button, input\");\n if (button && button.type === \"submit\" && button.form) {\n submitButtonsByForm.set(button.form, button);\n }\n}\n\nfunction didSubmitForm(event) {\n handleFormSubmissionEvent(event);\n}\n\nfunction didSubmitRemoteElement(event) {\n if (event.target.tagName == \"FORM\") {\n handleFormSubmissionEvent(event);\n }\n}\n\nfunction handleFormSubmissionEvent(event) {\n const form = event.target;\n if (form.hasAttribute(processingAttribute)) {\n event.preventDefault();\n return;\n }\n const controller = new DirectUploadsController(form);\n const {inputs: inputs} = controller;\n if (inputs.length) {\n event.preventDefault();\n form.setAttribute(processingAttribute, \"\");\n inputs.forEach(disable);\n controller.start((error => {\n form.removeAttribute(processingAttribute);\n if (error) {\n inputs.forEach(enable);\n } else {\n submitForm(form);\n }\n }));\n }\n}\n\nfunction submitForm(form) {\n let button = submitButtonsByForm.get(form) || findElement(form, \"input[type=submit], button[type=submit]\");\n if (button) {\n const {disabled: disabled} = button;\n button.disabled = false;\n button.focus();\n button.click();\n button.disabled = disabled;\n } else {\n button = document.createElement(\"input\");\n button.type = \"submit\";\n button.style.display = \"none\";\n form.appendChild(button);\n button.click();\n form.removeChild(button);\n }\n submitButtonsByForm.delete(form);\n}\n\nfunction disable(input) {\n input.disabled = true;\n}\n\nfunction enable(input) {\n input.disabled = false;\n}\n\nfunction autostart() {\n if (window.ActiveStorage) {\n start();\n }\n}\n\nsetTimeout(autostart, 1);\n\nclass AttachmentUpload {\n constructor(attachment, element) {\n this.attachment = attachment;\n this.element = element;\n this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this);\n }\n start() {\n this.directUpload.create(this.directUploadDidComplete.bind(this));\n }\n directUploadWillStoreFileWithXHR(xhr) {\n xhr.upload.addEventListener(\"progress\", (event => {\n const progress = event.loaded / event.total * 100;\n this.attachment.setUploadProgress(progress);\n }));\n }\n directUploadDidComplete(error, attributes) {\n if (error) {\n throw new Error(`Direct upload failed: ${error}`);\n }\n this.attachment.setAttributes({\n sgid: attributes.attachable_sgid,\n url: this.createBlobUrl(attributes.signed_id, attributes.filename)\n });\n }\n createBlobUrl(signedId, filename) {\n return this.blobUrlTemplate.replace(\":signed_id\", signedId).replace(\":filename\", encodeURIComponent(filename));\n }\n get directUploadUrl() {\n return this.element.dataset.directUploadUrl;\n }\n get blobUrlTemplate() {\n return this.element.dataset.blobUrlTemplate;\n }\n}\n\naddEventListener(\"trix-attachment-add\", (event => {\n const {attachment: attachment, target: target} = event;\n if (attachment.file) {\n const upload = new AttachmentUpload(attachment, target);\n upload.start();\n }\n}));\n","var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target, mod));\n\n// node_modules/global/window.js\nvar require_window = __commonJS({\n \"node_modules/global/window.js\"(exports, module) {\n var win;\n if (typeof window !== \"undefined\") {\n win = window;\n } else if (typeof global !== \"undefined\") {\n win = global;\n } else if (typeof self !== \"undefined\") {\n win = self;\n } else {\n win = {};\n }\n module.exports = win;\n }\n});\n\n// node_modules/is-function/index.js\nvar require_is_function = __commonJS({\n \"node_modules/is-function/index.js\"(exports, module) {\n module.exports = isFunction;\n var toString = Object.prototype.toString;\n function isFunction(fn) {\n if (!fn) {\n return false;\n }\n var string = toString.call(fn);\n return string === \"[object Function]\" || typeof fn === \"function\" && string !== \"[object RegExp]\" || typeof window !== \"undefined\" && (fn === window.setTimeout || fn === window.alert || fn === window.confirm || fn === window.prompt);\n }\n }\n});\n\n// node_modules/parse-headers/parse-headers.js\nvar require_parse_headers = __commonJS({\n \"node_modules/parse-headers/parse-headers.js\"(exports, module) {\n var trim = function(string) {\n return string.replace(/^\\s+|\\s+$/g, \"\");\n };\n var isArray = function(arg) {\n return Object.prototype.toString.call(arg) === \"[object Array]\";\n };\n module.exports = function(headers) {\n if (!headers)\n return {};\n var result = {};\n var headersArr = trim(headers).split(\"\\n\");\n for (var i = 0; i < headersArr.length; i++) {\n var row = headersArr[i];\n var index = row.indexOf(\":\"), key = trim(row.slice(0, index)).toLowerCase(), value = trim(row.slice(index + 1));\n if (typeof result[key] === \"undefined\") {\n result[key] = value;\n } else if (isArray(result[key])) {\n result[key].push(value);\n } else {\n result[key] = [result[key], value];\n }\n }\n return result;\n };\n }\n});\n\n// node_modules/xtend/immutable.js\nvar require_immutable = __commonJS({\n \"node_modules/xtend/immutable.js\"(exports, module) {\n module.exports = extend;\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n function extend() {\n var target = {};\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n }\n }\n});\n\n// node_modules/xhr/index.js\nvar require_xhr = __commonJS({\n \"node_modules/xhr/index.js\"(exports, module) {\n \"use strict\";\n var window2 = require_window();\n var isFunction = require_is_function();\n var parseHeaders = require_parse_headers();\n var xtend = require_immutable();\n module.exports = createXHR;\n module.exports.default = createXHR;\n createXHR.XMLHttpRequest = window2.XMLHttpRequest || noop;\n createXHR.XDomainRequest = \"withCredentials\" in new createXHR.XMLHttpRequest() ? createXHR.XMLHttpRequest : window2.XDomainRequest;\n forEachArray([\"get\", \"put\", \"post\", \"patch\", \"head\", \"delete\"], function(method) {\n createXHR[method === \"delete\" ? \"del\" : method] = function(uri, options, callback) {\n options = initParams(uri, options, callback);\n options.method = method.toUpperCase();\n return _createXHR(options);\n };\n });\n function forEachArray(array, iterator) {\n for (var i = 0; i < array.length; i++) {\n iterator(array[i]);\n }\n }\n function isEmpty(obj) {\n for (var i in obj) {\n if (obj.hasOwnProperty(i))\n return false;\n }\n return true;\n }\n function initParams(uri, options, callback) {\n var params = uri;\n if (isFunction(options)) {\n callback = options;\n if (typeof uri === \"string\") {\n params = { uri };\n }\n } else {\n params = xtend(options, { uri });\n }\n params.callback = callback;\n return params;\n }\n function createXHR(uri, options, callback) {\n options = initParams(uri, options, callback);\n return _createXHR(options);\n }\n function _createXHR(options) {\n if (typeof options.callback === \"undefined\") {\n throw new Error(\"callback argument missing\");\n }\n var called = false;\n var callback = function cbOnce(err, response, body2) {\n if (!called) {\n called = true;\n options.callback(err, response, body2);\n }\n };\n function readystatechange() {\n if (xhr2.readyState === 4) {\n setTimeout(loadFunc, 0);\n }\n }\n function getBody() {\n var body2 = void 0;\n if (xhr2.response) {\n body2 = xhr2.response;\n } else {\n body2 = xhr2.responseText || getXml(xhr2);\n }\n if (isJson) {\n try {\n body2 = JSON.parse(body2);\n } catch (e) {\n }\n }\n return body2;\n }\n function errorFunc(evt) {\n clearTimeout(timeoutTimer);\n if (!(evt instanceof Error)) {\n evt = new Error(\"\" + (evt || \"Unknown XMLHttpRequest Error\"));\n }\n evt.statusCode = 0;\n return callback(evt, failureResponse);\n }\n function loadFunc() {\n if (aborted)\n return;\n var status;\n clearTimeout(timeoutTimer);\n if (options.useXDR && xhr2.status === void 0) {\n status = 200;\n } else {\n status = xhr2.status === 1223 ? 204 : xhr2.status;\n }\n var response = failureResponse;\n var err = null;\n if (status !== 0) {\n response = {\n body: getBody(),\n statusCode: status,\n method,\n headers: {},\n url: uri,\n rawRequest: xhr2\n };\n if (xhr2.getAllResponseHeaders) {\n response.headers = parseHeaders(xhr2.getAllResponseHeaders());\n }\n } else {\n err = new Error(\"Internal XMLHttpRequest Error\");\n }\n return callback(err, response, response.body);\n }\n var xhr2 = options.xhr || null;\n if (!xhr2) {\n if (options.cors || options.useXDR) {\n xhr2 = new createXHR.XDomainRequest();\n } else {\n xhr2 = new createXHR.XMLHttpRequest();\n }\n }\n var key;\n var aborted;\n var uri = xhr2.url = options.uri || options.url;\n var method = xhr2.method = options.method || \"GET\";\n var body = options.body || options.data;\n var headers = xhr2.headers = options.headers || {};\n var sync = !!options.sync;\n var isJson = false;\n var timeoutTimer;\n var failureResponse = {\n body: void 0,\n headers: {},\n statusCode: 0,\n method,\n url: uri,\n rawRequest: xhr2\n };\n if (\"json\" in options && options.json !== false) {\n isJson = true;\n headers[\"accept\"] || headers[\"Accept\"] || (headers[\"Accept\"] = \"application/json\");\n if (method !== \"GET\" && method !== \"HEAD\") {\n headers[\"content-type\"] || headers[\"Content-Type\"] || (headers[\"Content-Type\"] = \"application/json\");\n body = JSON.stringify(options.json === true ? body : options.json);\n }\n }\n xhr2.onreadystatechange = readystatechange;\n xhr2.onload = loadFunc;\n xhr2.onerror = errorFunc;\n xhr2.onprogress = function() {\n };\n xhr2.onabort = function() {\n aborted = true;\n };\n xhr2.ontimeout = errorFunc;\n xhr2.open(method, uri, !sync, options.username, options.password);\n if (!sync) {\n xhr2.withCredentials = !!options.withCredentials;\n }\n if (!sync && options.timeout > 0) {\n timeoutTimer = setTimeout(function() {\n if (aborted)\n return;\n aborted = true;\n xhr2.abort(\"timeout\");\n var e = new Error(\"XMLHttpRequest timeout\");\n e.code = \"ETIMEDOUT\";\n errorFunc(e);\n }, options.timeout);\n }\n if (xhr2.setRequestHeader) {\n for (key in headers) {\n if (headers.hasOwnProperty(key)) {\n xhr2.setRequestHeader(key, headers[key]);\n }\n }\n } else if (options.headers && !isEmpty(options.headers)) {\n throw new Error(\"Headers cannot be set on an XDomainRequest object\");\n }\n if (\"responseType\" in options) {\n xhr2.responseType = options.responseType;\n }\n if (\"beforeSend\" in options && typeof options.beforeSend === \"function\") {\n options.beforeSend(xhr2);\n }\n xhr2.send(body || null);\n return xhr2;\n }\n function getXml(xhr2) {\n try {\n if (xhr2.responseType === \"document\") {\n return xhr2.responseXML;\n }\n var firefoxBugTakenEffect = xhr2.responseXML && xhr2.responseXML.documentElement.nodeName === \"parsererror\";\n if (xhr2.responseType === \"\" && !firefoxBugTakenEffect) {\n return xhr2.responseXML;\n }\n } catch (e) {\n }\n return null;\n }\n function noop() {\n }\n }\n});\n\n// node_modules/event-target-shim/index.mjs\nfunction assertType(condition, message, ...args) {\n if (!condition) {\n throw new TypeError(format(message, args));\n }\n}\nfunction format(message, args) {\n let i = 0;\n return message.replace(/%[os]/gu, () => anyToString(args[i++]));\n}\nfunction anyToString(x) {\n if (typeof x !== \"object\" || x === null) {\n return String(x);\n }\n return Object.prototype.toString.call(x);\n}\nvar currentErrorHandler;\nfunction reportError(maybeError) {\n try {\n const error = maybeError instanceof Error ? maybeError : new Error(anyToString(maybeError));\n if (currentErrorHandler) {\n currentErrorHandler(error);\n return;\n }\n if (typeof dispatchEvent === \"function\" && typeof ErrorEvent === \"function\") {\n dispatchEvent(new ErrorEvent(\"error\", { error, message: error.message }));\n } else if (typeof process !== \"undefined\" && typeof process.emit === \"function\") {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n } catch (_a) {\n }\n}\nvar Global = typeof window !== \"undefined\" ? window : typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : typeof globalThis !== \"undefined\" ? globalThis : void 0;\nvar currentWarnHandler;\nvar Warning = class {\n constructor(code, message) {\n this.code = code;\n this.message = message;\n }\n warn(...args) {\n var _a;\n try {\n if (currentWarnHandler) {\n currentWarnHandler({ ...this, args });\n return;\n }\n const stack = ((_a = new Error().stack) !== null && _a !== void 0 ? _a : \"\").replace(/^(?:.+?\\n){2}/gu, \"\\n\");\n console.warn(this.message, ...args, stack);\n } catch (_b) {\n }\n }\n};\nvar InitEventWasCalledWhileDispatching = new Warning(\"W01\", \"Unable to initialize event under dispatching.\");\nvar FalsyWasAssignedToCancelBubble = new Warning(\"W02\", \"Assigning any falsy value to 'cancelBubble' property has no effect.\");\nvar TruthyWasAssignedToReturnValue = new Warning(\"W03\", \"Assigning any truthy value to 'returnValue' property has no effect.\");\nvar NonCancelableEventWasCanceled = new Warning(\"W04\", \"Unable to preventDefault on non-cancelable events.\");\nvar CanceledInPassiveListener = new Warning(\"W05\", \"Unable to preventDefault inside passive event listener invocation.\");\nvar EventListenerWasDuplicated = new Warning(\"W06\", \"An event listener wasn't added because it has been added already: %o, %o\");\nvar OptionWasIgnored = new Warning(\"W07\", \"The %o option value was abandoned because the event listener wasn't added as duplicated.\");\nvar InvalidEventListener = new Warning(\"W08\", \"The 'callback' argument must be a function or an object that has 'handleEvent' method: %o\");\nvar InvalidAttributeHandler = new Warning(\"W09\", \"Event attribute handler must be a function: %o\");\nvar Event = class {\n static get NONE() {\n return NONE;\n }\n static get CAPTURING_PHASE() {\n return CAPTURING_PHASE;\n }\n static get AT_TARGET() {\n return AT_TARGET;\n }\n static get BUBBLING_PHASE() {\n return BUBBLING_PHASE;\n }\n constructor(type, eventInitDict) {\n Object.defineProperty(this, \"isTrusted\", {\n value: false,\n enumerable: true\n });\n const opts = eventInitDict !== null && eventInitDict !== void 0 ? eventInitDict : {};\n internalDataMap.set(this, {\n type: String(type),\n bubbles: Boolean(opts.bubbles),\n cancelable: Boolean(opts.cancelable),\n composed: Boolean(opts.composed),\n target: null,\n currentTarget: null,\n stopPropagationFlag: false,\n stopImmediatePropagationFlag: false,\n canceledFlag: false,\n inPassiveListenerFlag: false,\n dispatchFlag: false,\n timeStamp: Date.now()\n });\n }\n get type() {\n return $(this).type;\n }\n get target() {\n return $(this).target;\n }\n get srcElement() {\n return $(this).target;\n }\n get currentTarget() {\n return $(this).currentTarget;\n }\n composedPath() {\n const currentTarget = $(this).currentTarget;\n if (currentTarget) {\n return [currentTarget];\n }\n return [];\n }\n get NONE() {\n return NONE;\n }\n get CAPTURING_PHASE() {\n return CAPTURING_PHASE;\n }\n get AT_TARGET() {\n return AT_TARGET;\n }\n get BUBBLING_PHASE() {\n return BUBBLING_PHASE;\n }\n get eventPhase() {\n return $(this).dispatchFlag ? 2 : 0;\n }\n stopPropagation() {\n $(this).stopPropagationFlag = true;\n }\n get cancelBubble() {\n return $(this).stopPropagationFlag;\n }\n set cancelBubble(value) {\n if (value) {\n $(this).stopPropagationFlag = true;\n } else {\n FalsyWasAssignedToCancelBubble.warn();\n }\n }\n stopImmediatePropagation() {\n const data = $(this);\n data.stopPropagationFlag = data.stopImmediatePropagationFlag = true;\n }\n get bubbles() {\n return $(this).bubbles;\n }\n get cancelable() {\n return $(this).cancelable;\n }\n get returnValue() {\n return !$(this).canceledFlag;\n }\n set returnValue(value) {\n if (!value) {\n setCancelFlag($(this));\n } else {\n TruthyWasAssignedToReturnValue.warn();\n }\n }\n preventDefault() {\n setCancelFlag($(this));\n }\n get defaultPrevented() {\n return $(this).canceledFlag;\n }\n get composed() {\n return $(this).composed;\n }\n get isTrusted() {\n return false;\n }\n get timeStamp() {\n return $(this).timeStamp;\n }\n initEvent(type, bubbles = false, cancelable = false) {\n const data = $(this);\n if (data.dispatchFlag) {\n InitEventWasCalledWhileDispatching.warn();\n return;\n }\n internalDataMap.set(this, {\n ...data,\n type: String(type),\n bubbles: Boolean(bubbles),\n cancelable: Boolean(cancelable),\n target: null,\n currentTarget: null,\n stopPropagationFlag: false,\n stopImmediatePropagationFlag: false,\n canceledFlag: false\n });\n }\n};\nvar NONE = 0;\nvar CAPTURING_PHASE = 1;\nvar AT_TARGET = 2;\nvar BUBBLING_PHASE = 3;\nvar internalDataMap = /* @__PURE__ */ new WeakMap();\nfunction $(event, name = \"this\") {\n const retv = internalDataMap.get(event);\n assertType(retv != null, \"'%s' must be an object that Event constructor created, but got another one: %o\", name, event);\n return retv;\n}\nfunction setCancelFlag(data) {\n if (data.inPassiveListenerFlag) {\n CanceledInPassiveListener.warn();\n return;\n }\n if (!data.cancelable) {\n NonCancelableEventWasCanceled.warn();\n return;\n }\n data.canceledFlag = true;\n}\nObject.defineProperty(Event, \"NONE\", { enumerable: true });\nObject.defineProperty(Event, \"CAPTURING_PHASE\", { enumerable: true });\nObject.defineProperty(Event, \"AT_TARGET\", { enumerable: true });\nObject.defineProperty(Event, \"BUBBLING_PHASE\", { enumerable: true });\nvar keys = Object.getOwnPropertyNames(Event.prototype);\nfor (let i = 0; i < keys.length; ++i) {\n if (keys[i] === \"constructor\") {\n continue;\n }\n Object.defineProperty(Event.prototype, keys[i], { enumerable: true });\n}\nif (typeof Global !== \"undefined\" && typeof Global.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, Global.Event.prototype);\n}\nfunction createInvalidStateError(message) {\n if (Global.DOMException) {\n return new Global.DOMException(message, \"InvalidStateError\");\n }\n if (DOMException == null) {\n DOMException = class DOMException2 extends Error {\n constructor(msg) {\n super(msg);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, DOMException2);\n }\n }\n get code() {\n return 11;\n }\n get name() {\n return \"InvalidStateError\";\n }\n };\n Object.defineProperties(DOMException.prototype, {\n code: { enumerable: true },\n name: { enumerable: true }\n });\n defineErrorCodeProperties(DOMException);\n defineErrorCodeProperties(DOMException.prototype);\n }\n return new DOMException(message);\n}\nvar DOMException;\nvar ErrorCodeMap = {\n INDEX_SIZE_ERR: 1,\n DOMSTRING_SIZE_ERR: 2,\n HIERARCHY_REQUEST_ERR: 3,\n WRONG_DOCUMENT_ERR: 4,\n INVALID_CHARACTER_ERR: 5,\n NO_DATA_ALLOWED_ERR: 6,\n NO_MODIFICATION_ALLOWED_ERR: 7,\n NOT_FOUND_ERR: 8,\n NOT_SUPPORTED_ERR: 9,\n INUSE_ATTRIBUTE_ERR: 10,\n INVALID_STATE_ERR: 11,\n SYNTAX_ERR: 12,\n INVALID_MODIFICATION_ERR: 13,\n NAMESPACE_ERR: 14,\n INVALID_ACCESS_ERR: 15,\n VALIDATION_ERR: 16,\n TYPE_MISMATCH_ERR: 17,\n SECURITY_ERR: 18,\n NETWORK_ERR: 19,\n ABORT_ERR: 20,\n URL_MISMATCH_ERR: 21,\n QUOTA_EXCEEDED_ERR: 22,\n TIMEOUT_ERR: 23,\n INVALID_NODE_TYPE_ERR: 24,\n DATA_CLONE_ERR: 25\n};\nfunction defineErrorCodeProperties(obj) {\n const keys2 = Object.keys(ErrorCodeMap);\n for (let i = 0; i < keys2.length; ++i) {\n const key = keys2[i];\n const value = ErrorCodeMap[key];\n Object.defineProperty(obj, key, {\n get() {\n return value;\n },\n configurable: true,\n enumerable: true\n });\n }\n}\nvar EventWrapper = class extends Event {\n static wrap(event) {\n return new (getWrapperClassOf(event))(event);\n }\n constructor(event) {\n super(event.type, {\n bubbles: event.bubbles,\n cancelable: event.cancelable,\n composed: event.composed\n });\n if (event.cancelBubble) {\n super.stopPropagation();\n }\n if (event.defaultPrevented) {\n super.preventDefault();\n }\n internalDataMap$1.set(this, { original: event });\n const keys2 = Object.keys(event);\n for (let i = 0; i < keys2.length; ++i) {\n const key = keys2[i];\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(event, key));\n }\n }\n }\n stopPropagation() {\n super.stopPropagation();\n const { original } = $$1(this);\n if (\"stopPropagation\" in original) {\n original.stopPropagation();\n }\n }\n get cancelBubble() {\n return super.cancelBubble;\n }\n set cancelBubble(value) {\n super.cancelBubble = value;\n const { original } = $$1(this);\n if (\"cancelBubble\" in original) {\n original.cancelBubble = value;\n }\n }\n stopImmediatePropagation() {\n super.stopImmediatePropagation();\n const { original } = $$1(this);\n if (\"stopImmediatePropagation\" in original) {\n original.stopImmediatePropagation();\n }\n }\n get returnValue() {\n return super.returnValue;\n }\n set returnValue(value) {\n super.returnValue = value;\n const { original } = $$1(this);\n if (\"returnValue\" in original) {\n original.returnValue = value;\n }\n }\n preventDefault() {\n super.preventDefault();\n const { original } = $$1(this);\n if (\"preventDefault\" in original) {\n original.preventDefault();\n }\n }\n get timeStamp() {\n const { original } = $$1(this);\n if (\"timeStamp\" in original) {\n return original.timeStamp;\n }\n return super.timeStamp;\n }\n};\nvar internalDataMap$1 = /* @__PURE__ */ new WeakMap();\nfunction $$1(event) {\n const retv = internalDataMap$1.get(event);\n assertType(retv != null, \"'this' is expected an Event object, but got\", event);\n return retv;\n}\nvar wrapperClassCache = /* @__PURE__ */ new WeakMap();\nwrapperClassCache.set(Object.prototype, EventWrapper);\nif (typeof Global !== \"undefined\" && typeof Global.Event !== \"undefined\") {\n wrapperClassCache.set(Global.Event.prototype, EventWrapper);\n}\nfunction getWrapperClassOf(originalEvent) {\n const prototype = Object.getPrototypeOf(originalEvent);\n if (prototype == null) {\n return EventWrapper;\n }\n let wrapper = wrapperClassCache.get(prototype);\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapperClassOf(prototype), prototype);\n wrapperClassCache.set(prototype, wrapper);\n }\n return wrapper;\n}\nfunction defineWrapper(BaseEventWrapper, originalPrototype) {\n class CustomEventWrapper extends BaseEventWrapper {\n }\n const keys2 = Object.keys(originalPrototype);\n for (let i = 0; i < keys2.length; ++i) {\n Object.defineProperty(CustomEventWrapper.prototype, keys2[i], defineRedirectDescriptor(originalPrototype, keys2[i]));\n }\n return CustomEventWrapper;\n}\nfunction defineRedirectDescriptor(obj, key) {\n const d = Object.getOwnPropertyDescriptor(obj, key);\n return {\n get() {\n const original = $$1(this).original;\n const value = original[key];\n if (typeof value === \"function\") {\n return value.bind(original);\n }\n return value;\n },\n set(value) {\n const original = $$1(this).original;\n original[key] = value;\n },\n configurable: d.configurable,\n enumerable: d.enumerable\n };\n}\nfunction createListener(callback, capture, passive, once, signal, signalListener) {\n return {\n callback,\n flags: (capture ? 1 : 0) | (passive ? 2 : 0) | (once ? 4 : 0),\n signal,\n signalListener\n };\n}\nfunction setRemoved(listener) {\n listener.flags |= 8;\n}\nfunction isCapture(listener) {\n return (listener.flags & 1) === 1;\n}\nfunction isPassive(listener) {\n return (listener.flags & 2) === 2;\n}\nfunction isOnce(listener) {\n return (listener.flags & 4) === 4;\n}\nfunction isRemoved(listener) {\n return (listener.flags & 8) === 8;\n}\nfunction invokeCallback({ callback }, target, event) {\n try {\n if (typeof callback === \"function\") {\n callback.call(target, event);\n } else if (typeof callback.handleEvent === \"function\") {\n callback.handleEvent(event);\n }\n } catch (thrownError) {\n reportError(thrownError);\n }\n}\nfunction findIndexOfListener({ listeners }, callback, capture) {\n for (let i = 0; i < listeners.length; ++i) {\n if (listeners[i].callback === callback && isCapture(listeners[i]) === capture) {\n return i;\n }\n }\n return -1;\n}\nfunction addListener(list, callback, capture, passive, once, signal) {\n let signalListener;\n if (signal) {\n signalListener = removeListener.bind(null, list, callback, capture);\n signal.addEventListener(\"abort\", signalListener);\n }\n const listener = createListener(callback, capture, passive, once, signal, signalListener);\n if (list.cow) {\n list.cow = false;\n list.listeners = [...list.listeners, listener];\n } else {\n list.listeners.push(listener);\n }\n return listener;\n}\nfunction removeListener(list, callback, capture) {\n const index = findIndexOfListener(list, callback, capture);\n if (index !== -1) {\n return removeListenerAt(list, index);\n }\n return false;\n}\nfunction removeListenerAt(list, index, disableCow = false) {\n const listener = list.listeners[index];\n setRemoved(listener);\n if (listener.signal) {\n listener.signal.removeEventListener(\"abort\", listener.signalListener);\n }\n if (list.cow && !disableCow) {\n list.cow = false;\n list.listeners = list.listeners.filter((_, i) => i !== index);\n return false;\n }\n list.listeners.splice(index, 1);\n return true;\n}\nfunction createListenerListMap() {\n return /* @__PURE__ */ Object.create(null);\n}\nfunction ensureListenerList(listenerMap, type) {\n var _a;\n return (_a = listenerMap[type]) !== null && _a !== void 0 ? _a : listenerMap[type] = {\n attrCallback: void 0,\n attrListener: void 0,\n cow: false,\n listeners: []\n };\n}\nvar EventTarget = class {\n constructor() {\n internalDataMap$2.set(this, createListenerListMap());\n }\n addEventListener(type0, callback0, options0) {\n const listenerMap = $$2(this);\n const { callback, capture, once, passive, signal, type } = normalizeAddOptions(type0, callback0, options0);\n if (callback == null || (signal === null || signal === void 0 ? void 0 : signal.aborted)) {\n return;\n }\n const list = ensureListenerList(listenerMap, type);\n const i = findIndexOfListener(list, callback, capture);\n if (i !== -1) {\n warnDuplicate(list.listeners[i], passive, once, signal);\n return;\n }\n addListener(list, callback, capture, passive, once, signal);\n }\n removeEventListener(type0, callback0, options0) {\n const listenerMap = $$2(this);\n const { callback, capture, type } = normalizeOptions(type0, callback0, options0);\n const list = listenerMap[type];\n if (callback != null && list) {\n removeListener(list, callback, capture);\n }\n }\n dispatchEvent(e) {\n const list = $$2(this)[String(e.type)];\n if (list == null) {\n return true;\n }\n const event = e instanceof Event ? e : EventWrapper.wrap(e);\n const eventData = $(event, \"event\");\n if (eventData.dispatchFlag) {\n throw createInvalidStateError(\"This event has been in dispatching.\");\n }\n eventData.dispatchFlag = true;\n eventData.target = eventData.currentTarget = this;\n if (!eventData.stopPropagationFlag) {\n const { cow, listeners } = list;\n list.cow = true;\n for (let i = 0; i < listeners.length; ++i) {\n const listener = listeners[i];\n if (isRemoved(listener)) {\n continue;\n }\n if (isOnce(listener) && removeListenerAt(list, i, !cow)) {\n i -= 1;\n }\n eventData.inPassiveListenerFlag = isPassive(listener);\n invokeCallback(listener, this, event);\n eventData.inPassiveListenerFlag = false;\n if (eventData.stopImmediatePropagationFlag) {\n break;\n }\n }\n if (!cow) {\n list.cow = false;\n }\n }\n eventData.target = null;\n eventData.currentTarget = null;\n eventData.stopImmediatePropagationFlag = false;\n eventData.stopPropagationFlag = false;\n eventData.dispatchFlag = false;\n return !eventData.canceledFlag;\n }\n};\nvar internalDataMap$2 = /* @__PURE__ */ new WeakMap();\nfunction $$2(target, name = \"this\") {\n const retv = internalDataMap$2.get(target);\n assertType(retv != null, \"'%s' must be an object that EventTarget constructor created, but got another one: %o\", name, target);\n return retv;\n}\nfunction normalizeAddOptions(type, callback, options) {\n var _a;\n assertCallback(callback);\n if (typeof options === \"object\" && options !== null) {\n return {\n type: String(type),\n callback: callback !== null && callback !== void 0 ? callback : void 0,\n capture: Boolean(options.capture),\n passive: Boolean(options.passive),\n once: Boolean(options.once),\n signal: (_a = options.signal) !== null && _a !== void 0 ? _a : void 0\n };\n }\n return {\n type: String(type),\n callback: callback !== null && callback !== void 0 ? callback : void 0,\n capture: Boolean(options),\n passive: false,\n once: false,\n signal: void 0\n };\n}\nfunction normalizeOptions(type, callback, options) {\n assertCallback(callback);\n if (typeof options === \"object\" && options !== null) {\n return {\n type: String(type),\n callback: callback !== null && callback !== void 0 ? callback : void 0,\n capture: Boolean(options.capture)\n };\n }\n return {\n type: String(type),\n callback: callback !== null && callback !== void 0 ? callback : void 0,\n capture: Boolean(options)\n };\n}\nfunction assertCallback(callback) {\n if (typeof callback === \"function\" || typeof callback === \"object\" && callback !== null && typeof callback.handleEvent === \"function\") {\n return;\n }\n if (callback == null || typeof callback === \"object\") {\n InvalidEventListener.warn(callback);\n return;\n }\n throw new TypeError(format(InvalidEventListener.message, [callback]));\n}\nfunction warnDuplicate(listener, passive, once, signal) {\n EventListenerWasDuplicated.warn(isCapture(listener) ? \"capture\" : \"bubble\", listener.callback);\n if (isPassive(listener) !== passive) {\n OptionWasIgnored.warn(\"passive\");\n }\n if (isOnce(listener) !== once) {\n OptionWasIgnored.warn(\"once\");\n }\n if (listener.signal !== signal) {\n OptionWasIgnored.warn(\"signal\");\n }\n}\nvar keys$1 = Object.getOwnPropertyNames(EventTarget.prototype);\nfor (let i = 0; i < keys$1.length; ++i) {\n if (keys$1[i] === \"constructor\") {\n continue;\n }\n Object.defineProperty(EventTarget.prototype, keys$1[i], { enumerable: true });\n}\nif (typeof Global !== \"undefined\" && typeof Global.EventTarget !== \"undefined\") {\n Object.setPrototypeOf(EventTarget.prototype, Global.EventTarget.prototype);\n}\n\n// src/upchunk.ts\nvar import_xhr = __toESM(require_xhr());\nvar DEFAULT_CHUNK_SIZE = 30720;\nvar DEFAULT_MAX_CHUNK_SIZE = 512e3;\nvar DEFAULT_MIN_CHUNK_SIZE = 256;\nvar isValidChunkSize = (chunkSize, {\n minChunkSize = DEFAULT_MIN_CHUNK_SIZE,\n maxChunkSize = DEFAULT_MAX_CHUNK_SIZE\n} = {}) => {\n return chunkSize == null || typeof chunkSize === \"number\" && chunkSize >= 256 && chunkSize % 256 === 0 && chunkSize >= minChunkSize && chunkSize <= maxChunkSize;\n};\nvar getChunkSizeError = (chunkSize, {\n minChunkSize = DEFAULT_MIN_CHUNK_SIZE,\n maxChunkSize = DEFAULT_MAX_CHUNK_SIZE\n} = {}) => {\n return new TypeError(`chunkSize ${chunkSize} must be a positive number in multiples of 256, between ${minChunkSize} and ${maxChunkSize}`);\n};\nvar ChunkedStreamIterable = class {\n constructor(readableStream, options = {}) {\n this.readableStream = readableStream;\n var _a, _b, _c;\n if (!isValidChunkSize(options.defaultChunkSize, options)) {\n throw getChunkSizeError(options.defaultChunkSize, options);\n }\n this.defaultChunkSize = (_a = options.defaultChunkSize) != null ? _a : DEFAULT_CHUNK_SIZE;\n this.minChunkSize = (_b = options.minChunkSize) != null ? _b : DEFAULT_MIN_CHUNK_SIZE;\n this.maxChunkSize = (_c = options.maxChunkSize) != null ? _c : DEFAULT_MAX_CHUNK_SIZE;\n }\n get chunkSize() {\n var _a;\n return (_a = this._chunkSize) != null ? _a : this.defaultChunkSize;\n }\n set chunkSize(value) {\n if (!isValidChunkSize(value, this)) {\n throw getChunkSizeError(value, this);\n }\n this._chunkSize = value;\n }\n get chunkByteSize() {\n return this.chunkSize * 1024;\n }\n get error() {\n return this._error;\n }\n async *[Symbol.asyncIterator]() {\n let chunk;\n const reader = this.readableStream.getReader();\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n if (chunk) {\n const outgoingChunk = chunk;\n chunk = void 0;\n yield outgoingChunk;\n }\n break;\n }\n const normalizedBlobChunk = value instanceof Uint8Array ? new Blob([value], { type: \"application/octet-stream\" }) : value;\n chunk = chunk ? new Blob([chunk, normalizedBlobChunk]) : normalizedBlobChunk;\n while (chunk) {\n if (chunk.size === this.chunkByteSize) {\n const outgoingChunk = chunk;\n chunk = void 0;\n yield outgoingChunk;\n break;\n } else if (chunk.size < this.chunkByteSize) {\n break;\n } else {\n const outgoingChunk = chunk.slice(0, this.chunkByteSize);\n chunk = chunk.slice(this.chunkByteSize);\n yield outgoingChunk;\n }\n }\n }\n } catch (e) {\n this._error = e;\n } finally {\n if (chunk) {\n const outgoingChunk = chunk;\n chunk = void 0;\n yield outgoingChunk;\n }\n reader.releaseLock();\n return;\n }\n }\n};\nvar ChunkedFileIterable = class {\n constructor(file, options = {}) {\n this.file = file;\n var _a, _b, _c;\n if (!isValidChunkSize(options.defaultChunkSize, options)) {\n throw getChunkSizeError(options.defaultChunkSize, options);\n }\n this.defaultChunkSize = (_a = options.defaultChunkSize) != null ? _a : DEFAULT_CHUNK_SIZE;\n this.minChunkSize = (_b = options.minChunkSize) != null ? _b : DEFAULT_MIN_CHUNK_SIZE;\n this.maxChunkSize = (_c = options.maxChunkSize) != null ? _c : DEFAULT_MAX_CHUNK_SIZE;\n }\n get chunkSize() {\n var _a;\n return (_a = this._chunkSize) != null ? _a : this.defaultChunkSize;\n }\n set chunkSize(value) {\n if (!isValidChunkSize(value, this)) {\n throw getChunkSizeError(value, this);\n }\n this._chunkSize = value;\n }\n get chunkByteSize() {\n return this.chunkSize * 1024;\n }\n get error() {\n return this._error;\n }\n async *[Symbol.asyncIterator]() {\n const reader = new FileReader();\n let nextChunkRangeStart = 0;\n const getChunk = () => {\n return new Promise((resolve) => {\n if (nextChunkRangeStart >= this.file.size) {\n resolve(void 0);\n return;\n }\n const length = Math.min(this.chunkByteSize, this.file.size - nextChunkRangeStart);\n reader.onload = () => {\n if (reader.result !== null) {\n resolve(new Blob([reader.result], {\n type: \"application/octet-stream\"\n }));\n } else {\n resolve(void 0);\n }\n };\n reader.readAsArrayBuffer(this.file.slice(nextChunkRangeStart, nextChunkRangeStart + length));\n });\n };\n try {\n while (true) {\n const nextChunk = await getChunk();\n if (!!nextChunk) {\n nextChunkRangeStart += nextChunk.size;\n yield nextChunk;\n } else {\n break;\n }\n }\n } catch (e) {\n this._error = e;\n }\n }\n};\nvar SUCCESSFUL_CHUNK_UPLOAD_CODES = [200, 201, 202, 204, 308];\nvar TEMPORARY_ERROR_CODES = [408, 502, 503, 504];\nvar RESUME_INCOMPLETE_CODES = [308];\nvar isSuccessfulChunkUpload = (res, _options) => !!res && SUCCESSFUL_CHUNK_UPLOAD_CODES.includes(res.statusCode);\nvar isRetriableChunkUpload = (res, { retryCodes = TEMPORARY_ERROR_CODES }) => !res || retryCodes.includes(res.statusCode);\nvar isFailedChunkUpload = (res, options) => {\n return options.attemptCount >= options.attempts || !(isSuccessfulChunkUpload(res) || isRetriableChunkUpload(res, options));\n};\nvar isIncompleteChunkUploadNeedingRetry = (res, _options) => {\n var _a;\n if (!res || !RESUME_INCOMPLETE_CODES.includes(res.statusCode) || !((_a = res.headers) == null ? void 0 : _a[\"range\"])) {\n return false;\n }\n const range = res.headers[\"range\"].match(/bytes=(\\d+)-(\\d+)/);\n if (!range) {\n return false;\n }\n const endByte = parseInt(range[2], 10);\n return endByte !== _options.currentChunkEndByte;\n};\nvar UpChunk = class {\n static createUpload(options) {\n return new UpChunk(options);\n }\n constructor(options) {\n this.eventTarget = new EventTarget();\n this.endpoint = options.endpoint;\n this.file = options.file;\n this.headers = options.headers || {};\n this.method = options.method || \"PUT\";\n this.attempts = options.attempts || 5;\n this.delayBeforeAttempt = options.delayBeforeAttempt || 1;\n this.retryCodes = options.retryCodes || TEMPORARY_ERROR_CODES;\n this.dynamicChunkSize = options.dynamicChunkSize || false;\n this.maxFileBytes = (options.maxFileSize || 0) * 1024;\n this.chunkCount = 0;\n this.attemptCount = 0;\n this._offline = typeof window !== \"undefined\" && !window.navigator.onLine;\n this._paused = false;\n this.success = false;\n this.nextChunkRangeStart = 0;\n if (options.useLargeFileWorkaround) {\n const readableStreamErrorCallback = (event) => {\n if (this.chunkedIterable.error) {\n console.warn(`Unable to read file of size ${this.file.size} bytes via a ReadableStream. Falling back to in-memory FileReader!`);\n event.stopImmediatePropagation();\n this.chunkedIterable = new ChunkedFileIterable(this.file, {\n ...options,\n defaultChunkSize: options.chunkSize\n });\n this.chunkedIterator = this.chunkedIterable[Symbol.asyncIterator]();\n this.getEndpoint().then(() => {\n this.sendChunks();\n });\n this.off(\"error\", readableStreamErrorCallback);\n }\n };\n this.on(\"error\", readableStreamErrorCallback);\n }\n this.chunkedIterable = new ChunkedStreamIterable(this.file.stream(), { ...options, defaultChunkSize: options.chunkSize });\n this.chunkedIterator = this.chunkedIterable[Symbol.asyncIterator]();\n this.totalChunks = Math.ceil(this.file.size / this.chunkByteSize);\n this.validateOptions();\n this.getEndpoint().then(() => this.sendChunks());\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"online\", () => {\n if (!this.offline)\n return;\n this._offline = false;\n this.dispatch(\"online\");\n this.sendChunks();\n });\n window.addEventListener(\"offline\", () => {\n if (this.offline)\n return;\n this._offline = true;\n this.dispatch(\"offline\");\n });\n }\n }\n get maxChunkSize() {\n var _a, _b;\n return (_b = (_a = this.chunkedIterable) == null ? void 0 : _a.maxChunkSize) != null ? _b : DEFAULT_MAX_CHUNK_SIZE;\n }\n get minChunkSize() {\n var _a, _b;\n return (_b = (_a = this.chunkedIterable) == null ? void 0 : _a.minChunkSize) != null ? _b : DEFAULT_MIN_CHUNK_SIZE;\n }\n get chunkSize() {\n var _a, _b;\n return (_b = (_a = this.chunkedIterable) == null ? void 0 : _a.chunkSize) != null ? _b : DEFAULT_CHUNK_SIZE;\n }\n set chunkSize(value) {\n this.chunkedIterable.chunkSize = value;\n }\n get chunkByteSize() {\n return this.chunkedIterable.chunkByteSize;\n }\n get totalChunkSize() {\n return Math.ceil(this.file.size / this.chunkByteSize);\n }\n on(eventName, fn) {\n this.eventTarget.addEventListener(eventName, fn);\n }\n once(eventName, fn) {\n this.eventTarget.addEventListener(eventName, fn, {\n once: true\n });\n }\n off(eventName, fn) {\n this.eventTarget.removeEventListener(eventName, fn);\n }\n get offline() {\n return this._offline;\n }\n get paused() {\n return this._paused;\n }\n abort() {\n var _a;\n this.pause();\n (_a = this.currentXhr) == null ? void 0 : _a.abort();\n }\n pause() {\n this._paused = true;\n }\n resume() {\n if (this._paused) {\n this._paused = false;\n this.sendChunks();\n }\n }\n get successfulPercentage() {\n return this.nextChunkRangeStart / this.file.size;\n }\n dispatch(eventName, detail) {\n const event = new CustomEvent(eventName, {\n detail\n });\n this.eventTarget.dispatchEvent(event);\n }\n validateOptions() {\n if (!this.endpoint || typeof this.endpoint !== \"function\" && typeof this.endpoint !== \"string\") {\n throw new TypeError(\"endpoint must be defined as a string or a function that returns a promise\");\n }\n if (!(this.file instanceof File)) {\n throw new TypeError(\"file must be a File object\");\n }\n if (this.headers && typeof this.headers !== \"function\" && typeof this.headers !== \"object\") {\n throw new TypeError(\"headers must be null, an object, or a function that returns an object or a promise\");\n }\n if (!isValidChunkSize(this.chunkSize, {\n maxChunkSize: this.maxChunkSize,\n minChunkSize: this.minChunkSize\n })) {\n throw getChunkSizeError(this.chunkSize, {\n maxChunkSize: this.maxChunkSize,\n minChunkSize: this.minChunkSize\n });\n }\n if (this.maxChunkSize && (typeof this.maxChunkSize !== \"number\" || this.maxChunkSize < 256 || this.maxChunkSize % 256 !== 0 || this.maxChunkSize < this.chunkSize || this.maxChunkSize < this.minChunkSize)) {\n throw new TypeError(`maxChunkSize must be a positive number in multiples of 256, and larger than or equal to both ${this.minChunkSize} and ${this.chunkSize}`);\n }\n if (this.minChunkSize && (typeof this.minChunkSize !== \"number\" || this.minChunkSize < 256 || this.minChunkSize % 256 !== 0 || this.minChunkSize > this.chunkSize || this.minChunkSize > this.maxChunkSize)) {\n throw new TypeError(`minChunkSize must be a positive number in multiples of 256, and smaller than ${this.chunkSize} and ${this.maxChunkSize}`);\n }\n if (this.maxFileBytes > 0 && this.maxFileBytes < this.file.size) {\n throw new Error(`file size exceeds maximum (${this.file.size} > ${this.maxFileBytes})`);\n }\n if (this.attempts && (typeof this.attempts !== \"number\" || this.attempts <= 0)) {\n throw new TypeError(\"retries must be a positive number\");\n }\n if (this.delayBeforeAttempt && (typeof this.delayBeforeAttempt !== \"number\" || this.delayBeforeAttempt < 0)) {\n throw new TypeError(\"delayBeforeAttempt must be a positive number\");\n }\n }\n getEndpoint() {\n if (typeof this.endpoint === \"string\") {\n this.endpointValue = this.endpoint;\n return Promise.resolve(this.endpoint);\n }\n return this.endpoint(this.file).then((value) => {\n this.endpointValue = value;\n return this.endpointValue;\n });\n }\n xhrPromise(options) {\n const beforeSend = (xhrObject) => {\n xhrObject.upload.onprogress = (event) => {\n var _a;\n const remainingChunks = this.totalChunks - this.chunkCount;\n const percentagePerChunk = (this.file.size - this.nextChunkRangeStart) / this.file.size / remainingChunks;\n const currentChunkProgress = event.loaded / ((_a = event.total) != null ? _a : this.chunkByteSize);\n const chunkPercentage = currentChunkProgress * percentagePerChunk;\n this.dispatch(\"progress\", Math.min((this.successfulPercentage + chunkPercentage) * 100, 100));\n };\n };\n return new Promise((resolve, reject) => {\n this.currentXhr = (0, import_xhr.default)({ ...options, beforeSend }, (err, resp) => {\n this.currentXhr = void 0;\n if (err) {\n return reject(err);\n }\n return resolve(resp);\n });\n });\n }\n async sendChunk(chunk) {\n const rangeStart = this.nextChunkRangeStart;\n const rangeEnd = rangeStart + chunk.size - 1;\n const extraHeaders = await (typeof this.headers === \"function\" ? this.headers() : this.headers);\n const headers = {\n ...extraHeaders,\n \"Content-Type\": this.file.type,\n \"Content-Range\": `bytes ${rangeStart}-${rangeEnd}/${this.file.size}`\n };\n this.dispatch(\"attempt\", {\n chunkNumber: this.chunkCount,\n totalChunks: this.totalChunks,\n chunkSize: this.chunkSize\n });\n return this.xhrPromise({\n headers,\n url: this.endpointValue,\n method: this.method,\n body: chunk\n });\n }\n async sendChunkWithRetries(chunk) {\n const successfulChunkUploadCb = async (res2, _chunk) => {\n var _a;\n const lastChunkEnd = new Date();\n const lastChunkInterval = (lastChunkEnd.getTime() - this.lastChunkStart.getTime()) / 1e3;\n this.dispatch(\"chunkSuccess\", {\n chunk: this.chunkCount,\n chunkSize: this.chunkSize,\n attempts: this.attemptCount,\n timeInterval: lastChunkInterval,\n response: res2\n });\n this.attemptCount = 0;\n this.chunkCount = ((_a = this.chunkCount) != null ? _a : 0) + 1;\n this.nextChunkRangeStart = this.nextChunkRangeStart + this.chunkByteSize;\n if (this.dynamicChunkSize) {\n let unevenChunkSize = this.chunkSize;\n if (lastChunkInterval < 10) {\n unevenChunkSize = Math.min(this.chunkSize * 2, this.maxChunkSize);\n } else if (lastChunkInterval > 30) {\n unevenChunkSize = Math.max(this.chunkSize / 2, this.minChunkSize);\n }\n this.chunkSize = Math.ceil(unevenChunkSize / 256) * 256;\n const remainingChunks = (this.file.size - this.nextChunkRangeStart) / this.chunkByteSize;\n this.totalChunks = Math.ceil(this.chunkCount + remainingChunks);\n }\n return true;\n };\n const failedChunkUploadCb = async (res2, _chunk) => {\n this.dispatch(\"progress\", Math.min(this.successfulPercentage * 100, 100));\n this.dispatch(\"error\", {\n message: `Server responded with ${res2.statusCode}. Stopping upload.`,\n chunk: this.chunkCount,\n attempts: this.attemptCount,\n response: res2\n });\n return false;\n };\n const retriableChunkUploadCb = async (res2, _chunk) => {\n this.dispatch(\"attemptFailure\", {\n message: `An error occured uploading chunk ${this.chunkCount}. ${this.attempts - this.attemptCount} retries left.`,\n chunkNumber: this.chunkCount,\n attemptsLeft: this.attempts - this.attemptCount,\n response: res2\n });\n return new Promise((resolve) => {\n setTimeout(async () => {\n if (this._paused || this.offline) {\n this.pendingChunk = chunk;\n resolve(false);\n return;\n }\n const chunkUploadSuccess = await this.sendChunkWithRetries(chunk);\n resolve(chunkUploadSuccess);\n }, this.delayBeforeAttempt * 1e3);\n });\n };\n let res;\n try {\n this.attemptCount = this.attemptCount + 1;\n this.lastChunkStart = new Date();\n res = await this.sendChunk(chunk);\n } catch (err) {\n if (typeof (err == null ? void 0 : err.statusCode) === \"number\") {\n res = err;\n }\n }\n const options = {\n retryCodes: this.retryCodes,\n attemptCount: this.attemptCount,\n attempts: this.attempts,\n currentChunkEndByte: this.nextChunkRangeStart + chunk.size - 1\n };\n if (isIncompleteChunkUploadNeedingRetry(res, options)) {\n return retriableChunkUploadCb(res, chunk);\n }\n if (isSuccessfulChunkUpload(res, options)) {\n return successfulChunkUploadCb(res, chunk);\n }\n if (isFailedChunkUpload(res, options)) {\n return failedChunkUploadCb(res, chunk);\n }\n return retriableChunkUploadCb(res, chunk);\n }\n async sendChunks() {\n if (this.pendingChunk && !(this._paused || this.offline)) {\n const chunk = this.pendingChunk;\n this.pendingChunk = void 0;\n const chunkUploadSuccess = await this.sendChunkWithRetries(chunk);\n if (this.success && chunkUploadSuccess) {\n this.dispatch(\"success\");\n }\n }\n while (!(this.success || this._paused || this.offline)) {\n const { value: chunk, done } = await this.chunkedIterator.next();\n let chunkUploadSuccess = !chunk && done;\n if (chunk) {\n chunkUploadSuccess = await this.sendChunkWithRetries(chunk);\n }\n if (this.chunkedIterable.error) {\n chunkUploadSuccess = false;\n this.dispatch(\"error\", {\n message: `Unable to read file of size ${this.file.size} bytes. Try loading from another browser.`\n });\n return;\n }\n this.success = !!done;\n if (this.success && chunkUploadSuccess) {\n this.dispatch(\"success\");\n }\n if (!chunkUploadSuccess) {\n return;\n }\n }\n }\n};\nfunction createUpload(options) {\n return UpChunk.createUpload(options);\n}\nexport {\n ChunkedFileIterable,\n ChunkedStreamIterable,\n UpChunk,\n createUpload,\n getChunkSizeError,\n isIncompleteChunkUploadNeedingRetry,\n isValidChunkSize\n};\n//# sourceMappingURL=upchunk.mjs.map\n","var ce=Object.defineProperty;var Y=o=>{throw TypeError(o)};var me=(o,t)=>{for(var e in t)ce(o,e,{get:t[e],enumerable:!0})};var J=(o,t,e)=>t.has(o)||Y(\"Cannot \"+e);var s=(o,t,e)=>(J(o,t,\"read from private field\"),e?e.call(o):t.get(o)),l=(o,t,e)=>t.has(o)?Y(\"Cannot add the same private member more than once\"):t instanceof WeakSet?t.add(o):t.set(o,e),u=(o,t,e,r)=>(J(o,t,\"write to private field\"),r?r.call(o,e):t.set(o,e),e);var K={};me(K,{ProgressTypes:()=>x});var x={BAR:\"bar\",RADIAL:\"radial\",PERCENTAGE:\"percentage\"};var L=class{addEventListener(){}removeEventListener(){}dispatchEvent(t){return!0}};if(typeof DocumentFragment==\"undefined\"){class o extends L{}globalThis.DocumentFragment=o}var R=class extends L{},G=class extends L{},ge={get(o){},define(o,t,e){},getName(o){return null},upgrade(o){},whenDefined(o){return Promise.resolve(R)}},P,W=class{constructor(t,e={}){l(this,P);u(this,P,e==null?void 0:e.detail)}get detail(){return s(this,P)}initCustomEvent(){}};P=new WeakMap;function fe(o,t){return new R}var Q={document:{createElement:fe},DocumentFragment,customElements:ge,CustomEvent:W,EventTarget:L,HTMLElement:R,HTMLVideoElement:G},Z=typeof window==\"undefined\"||typeof globalThis.customElements==\"undefined\",a=Z?Q:globalThis,p=Z?Q.document:globalThis.document;import{UpChunk as Me}from\"@mux/upchunk\";var V=(o,t)=>{if(!o)return null;let e=o.closest(t);return e||V(o.getRootNode().host,t)},h=o=>{let t=o.getAttribute(\"mux-uploader\");return t?document.getElementById(t):V(o,\"mux-uploader\")};var ee=p.createElement(\"template\");ee.innerHTML=`\n\n\n\n Drop a video file here to upload\n\n\n or\n\n\n\n
\n

\n
\n`;var q={MUX_UPLOADER:\"mux-uploader\",OVERLAY_TEXT:\"overlay-text\"},z,m,k,H=class extends a.HTMLElement{constructor(){super();l(this,z);l(this,m);l(this,k);let e=this.attachShadow({mode:\"open\"});e.appendChild(ee.content.cloneNode(!0)),u(this,z,e.getElementById(\"overlay-label\"))}connectedCallback(){if(u(this,m,h(this)),u(this,k,new AbortController),s(this,m)){let e={signal:s(this,k).signal};s(this,m).addEventListener(\"file-ready\",()=>this.toggleAttribute(\"file-ready\",!0),e),s(this,m).addEventListener(\"uploadstart\",()=>this.toggleAttribute(\"upload-in-progress\",!0),e),s(this,m).addEventListener(\"success\",()=>{this.toggleAttribute(\"upload-in-progress\",!1),this.toggleAttribute(\"upload-complete\",!0)},e),s(this,m).addEventListener(\"reset\",()=>{this.toggleAttribute(\"file-ready\",!1),this.toggleAttribute(\"upload-in-progress\",!1),this.toggleAttribute(\"upload-complete\",!1)},e),this.setupDragEvents(e),this.toggleAttribute(\"upload-in-progress\",s(this,m).hasAttribute(\"upload-in-progress\")),this.toggleAttribute(\"upload-complete\",s(this,m).hasAttribute(\"upload-complete\")),this.toggleAttribute(\"file-ready\",s(this,m).hasAttribute(\"file-ready\"))}}disconnectedCallback(){var e;(e=s(this,k))==null||e.abort()}attributeChangedCallback(e,r,i){e===q.OVERLAY_TEXT&&r!==i?s(this,z).innerHTML=i!=null?i:\"\":e===\"active\"&&this.hasAttribute(\"overlay\")&&i!=null&&(this._currentDragTarget=this)}static get observedAttributes(){return[q.OVERLAY_TEXT,q.MUX_UPLOADER,\"active\"]}setupDragEvents(e){this.addEventListener(\"dragenter\",r=>{this._currentDragTarget=r.target,r.preventDefault(),r.stopPropagation(),this.toggleAttribute(\"active\",!0)},e),this.addEventListener(\"dragleave\",r=>{this._currentDragTarget===r.target&&(this._currentDragTarget=void 0,this.toggleAttribute(\"active\",!1))},e),this.addEventListener(\"dragover\",r=>{r.preventDefault(),r.stopPropagation()},e),this.addEventListener(\"drop\",r=>{var A;r.preventDefault(),r.stopPropagation();let{dataTransfer:i}=r,{files:n}=i,y=n[0];((A=s(this,m))!=null?A:this).dispatchEvent(new CustomEvent(\"file-ready\",{composed:!0,bubbles:!0,detail:y})),this.removeAttribute(\"active\")},e)}};z=new WeakMap,m=new WeakMap,k=new WeakMap;a.customElements.get(\"mux-uploader-drop\")||(a.customElements.define(\"mux-uploader-drop\",H),a.MuxUploaderDropElement=H);var be=H;function te(o){return`${Math.floor(o)}%`}var se=p.createElement(\"template\"),Ee=\"Media upload progress bar\";se.innerHTML=`\n\n\n\n\n

\n
\n
\n
\n
\n \n \n \n \n
\n`;var f,M,D=class extends a.HTMLElement{constructor(){var r,i,n,y;super();l(this,f);l(this,M);this.onUploadStart=()=>{var e;(e=this.progressBar)==null||e.focus(),this.toggleAttribute(\"upload-in-progress\",!0)};this.onProgress=e=>{var i;let r=e.detail;switch((i=this.progressBar)==null||i.setAttribute(\"aria-valuenow\",`${Math.floor(r)}`),this.getAttribute(\"type\")){case x.BAR:{this.progressBar&&(this.progressBar.style.width=`${r}%`);break}case x.RADIAL:{if(this.svgCircle){let n=this.getCircumference()-r/100*this.getCircumference();this.svgCircle.style.strokeDashoffset=n.toString()}break}case x.PERCENTAGE:{this.uploadPercentage&&(this.uploadPercentage.innerHTML=te(r));break}}};this.onSuccess=()=>{this.toggleAttribute(\"upload-in-progress\",!1),this.toggleAttribute(\"upload-complete\",!0)};this.onReset=()=>{this.toggleAttribute(\"upload-in-progress\",!1),this.uploadPercentage&&(this.uploadPercentage.innerHTML=\"\"),this.svgCircle&&(this.svgCircle.style.strokeDashoffset=`${this.getCircumference()}`)};this.attachShadow({mode:\"open\"}).appendChild(se.content.cloneNode(!0)),this.svgCircle=(r=this.shadowRoot)==null?void 0:r.querySelector(\"circle\"),this.progressBar=(i=this.shadowRoot)==null?void 0:i.getElementById(\"progress-bar\"),this.uploadPercentage=(n=this.shadowRoot)==null?void 0:n.getElementById(\"percentage-type\"),(y=this.progressBar)==null||y.setAttribute(\"aria-description\",Ee)}connectedCallback(){if(this.setDefaultType(),u(this,f,h(this)),u(this,M,new AbortController),s(this,f)){let e={signal:s(this,M).signal};s(this,f).addEventListener(\"uploadstart\",this.onUploadStart,e),s(this,f).addEventListener(\"reset\",this.onReset),s(this,f).addEventListener(\"progress\",this.onProgress),s(this,f).addEventListener(\"success\",this.onSuccess),this.toggleAttribute(\"upload-in-progress\",s(this,f).hasAttribute(\"upload-in-progress\")),this.toggleAttribute(\"upload-complete\",s(this,f).hasAttribute(\"upload-complete\"))}}disconnectedCallback(){var e;(e=s(this,M))==null||e.abort()}getRadius(){var e;return Number((e=this.svgCircle)==null?void 0:e.getAttribute(\"r\"))}getCircumference(){return this.getRadius()*2*Math.PI}setDefaultType(){let e=this.getAttribute(\"type\");e||this.setAttribute(\"type\",x.BAR),e===x.RADIAL&&this.svgCircle&&(this.svgCircle.style.strokeDasharray=`${this.getCircumference()} ${this.getCircumference()}`,this.svgCircle.style.strokeDashoffset=`${this.getCircumference()}`)}};f=new WeakMap,M=new WeakMap;a.customElements.get(\"mux-uploader-progress\")||a.customElements.define(\"mux-uploader-progress\",D);var ye=D;var re=p.createElement(\"template\");re.innerHTML=`\n\n\n\n`;var c,C,F=class extends a.HTMLElement{constructor(){var r;super();l(this,c);l(this,C);this.clearStatusMessage=()=>{this.toggleAttribute(\"upload-error\",!1),this.statusMessage&&(this.statusMessage.innerHTML=\"\")};this.onUploadError=e=>{this.toggleAttribute(\"upload-error\",!0),this.statusMessage&&(this.statusMessage.innerHTML=e.detail.message)};this.onSuccess=()=>{this.toggleAttribute(\"upload-error\",!1);let e=\"Upload complete!\";this.statusMessage&&(this.statusMessage.innerHTML=e),console.info(e)};this.onOffline=()=>{this.toggleAttribute(\"upload-error\",!1);let e=\"Currently offline. Upload will resume automatically when online.\";this.statusMessage&&(this.statusMessage.innerHTML=e)};this.attachShadow({mode:\"open\"}).appendChild(re.content.cloneNode(!0)),this.statusMessage=(r=this.shadowRoot)==null?void 0:r.getElementById(\"status-message\")}connectedCallback(){if(u(this,c,h(this)),u(this,C,new AbortController),s(this,c)){let e={signal:s(this,C).signal};s(this,c).addEventListener(\"reset\",this.clearStatusMessage,e),s(this,c).addEventListener(\"uploaderror\",this.onUploadError,e),s(this,c).addEventListener(\"success\",this.onSuccess,e),s(this,c).addEventListener(\"uploadstart\",this.clearStatusMessage,e),s(this,c).addEventListener(\"offline\",this.onOffline,e),s(this,c).addEventListener(\"online\",this.clearStatusMessage,e),this.toggleAttribute(\"upload-in-progress\",s(this,c).hasAttribute(\"upload-in-progress\")),this.toggleAttribute(\"upload-complete\",s(this,c).hasAttribute(\"upload-complete\")),this.toggleAttribute(\"upload-error\",s(this,c).hasAttribute(\"upload-error\"))}}disconnectedCallback(){var e;(e=s(this,C))==null||e.abort()}};c=new WeakMap,C=new WeakMap;a.customElements.get(\"mux-uploader-status\")||a.customElements.define(\"mux-uploader-status\",F);var ve=F;var oe=p.createElement(\"template\");oe.innerHTML=`\n\n\nTry again\n`;var E,T,_=class extends a.HTMLElement{constructor(){var r;super();l(this,E);l(this,T);this.handleKeyup=e=>{let r=[\"Enter\",\" \"],{key:i}=e;r.includes(i)&&this.triggerReset()};this.triggerReset=()=>{var e;(e=s(this,E))==null||e.dispatchEvent(new CustomEvent(\"reset\"))};this.attachShadow({mode:\"open\"}).appendChild(oe.content.cloneNode(!0)),this.retryButton=(r=this.shadowRoot)==null?void 0:r.getElementById(\"retry-button\")}connectedCallback(){var e,r;if(u(this,E,h(this)),u(this,T,new AbortController),s(this,E)){let i={signal:s(this,T).signal};s(this,E).addEventListener(\"uploaderror\",()=>this.toggleAttribute(\"upload-error\",!0)),s(this,E).addEventListener(\"reset\",()=>this.toggleAttribute(\"upload-error\",!1)),(e=this.retryButton)==null||e.addEventListener(\"click\",this.triggerReset,i),(r=this.retryButton)==null||r.addEventListener(\"keyup\",this.handleKeyup,i),this.toggleAttribute(\"upload-error\",s(this,E).hasAttribute(\"upload-error\"))}}disconnectedCallback(){var e;(e=s(this,T))==null||e.abort()}};E=new WeakMap,T=new WeakMap;a.customElements.get(\"mux-uploader-retry\")||a.customElements.define(\"mux-uploader-retry\",_);var xe=_;var ie=p.createElement(\"template\");ie.innerHTML=`\n\n\n\n`,ne=p.createElement(\"template\");ne.innerHTML=`\n \n\n \n ${j}\n \n`;var b,g,S,I=class extends a.HTMLElement{constructor(){var r,i,n;super();l(this,b);l(this,g);l(this,S);this.attachShadow({mode:\"open\"}).appendChild(ne.content.cloneNode(!0)),this.handleFilePickerElClick=this.handleFilePickerElClick.bind(this),this.filePickerEl=(r=this.shadowRoot)==null?void 0:r.querySelector(\"button\"),(n=(i=this.shadowRoot)==null?void 0:i.querySelector(\"slot\"))==null||n.addEventListener(\"slotchange\",y=>{let U=y.currentTarget;this.filePickerEl=U.assignedElements({flatten:!0}).filter(A=>![\"STYLE\"].includes(A.nodeName))[0]})}connectedCallback(){if(u(this,g,h(this)),u(this,S,new AbortController),s(this,g)){let e={signal:s(this,S).signal};s(this,g).addEventListener(\"file-ready\",()=>{this.toggleAttribute(\"file-ready\",!0)},e),s(this,g).addEventListener(\"uploadstart\",()=>this.toggleAttribute(\"upload-in-progress\",!0),e),s(this,g).addEventListener(\"success\",()=>{this.toggleAttribute(\"upload-in-progress\",!1),this.toggleAttribute(\"upload-complete\",!0)},e),s(this,g).addEventListener(\"reset\",()=>{this.toggleAttribute(\"file-ready\",!1)},e),this.toggleAttribute(\"upload-in-progress\",s(this,g).hasAttribute(\"upload-in-progress\")),this.toggleAttribute(\"upload-complete\",s(this,g).hasAttribute(\"upload-complete\")),this.toggleAttribute(\"file-ready\",s(this,g).hasAttribute(\"file-ready\"))}}disconnectedCallback(){var e;(e=s(this,S))==null||e.abort()}get filePickerEl(){return s(this,b)}set filePickerEl(e){e!==s(this,b)&&(s(this,b)&&s(this,b).removeEventListener(\"click\",this.handleFilePickerElClick),u(this,b,e),s(this,b)&&s(this,b).addEventListener(\"click\",this.handleFilePickerElClick))}handleFilePickerElClick(){var i,n;let e=this.getAttribute(\"mux-uploader\"),r=e?p.getElementById(e):this.getRootNode().host;(n=(i=r==null?void 0:r.shadowRoot)==null?void 0:i.querySelector(\"#hidden-file-input\"))==null||n.click()}};b=new WeakMap,g=new WeakMap,S=new WeakMap;a.customElements.get(\"mux-uploader-file-select\")||a.customElements.define(\"mux-uploader-file-select\",I);var Le=I;function N(o,t){return o?\"\":t}var ke=(o,t)=>{if(t==null||t===!1)return\"\";let e=t===!0?\"\":`${t}`;return`${o}=\"${e}\"`};function X(o){let{noDrop:t,noProgress:e,noStatus:r,noRetry:i,pausable:n,type:y}=o,U=t?\"div\":'mux-uploader-drop overlay part=\"drop\"',A=N(e,`\n \n \n `),de=N(r,''),pe=N(i,''),he=N(!n,'');return p.createRange().createContextualFragment(`\n <${U}>\n ${de}\n ${pe}\n ${he}\n\n \n \n ${j}\n \n \n\n ${A}\n \n `)}var ae=p.createElement(\"template\");ae.innerHTML=`\n\n\n\n\n`;var B=class extends a.HTMLElement{static get observedAttributes(){return[\"pausable\",\"type\",\"no-drop\",\"no-progress\",\"no-status\",\"no-retry\",\"max-file-size\",\"use-large-file-workaround\"]}constructor(){var e;super(),this.attachShadow({mode:\"open\"}).appendChild(ae.content.cloneNode(!0)),this.updateLayout(),(e=this.hiddenFileInput)==null||e.addEventListener(\"change\",()=>{var i,n;let r=(n=(i=this.hiddenFileInput)==null?void 0:i.files)==null?void 0:n[0];this.toggleAttribute(\"file-ready\",!!r),r&&this.dispatchEvent(new CustomEvent(\"file-ready\",{composed:!0,bubbles:!0,detail:r}))})}connectedCallback(){this.addEventListener(\"file-ready\",this.handleUpload),this.addEventListener(\"reset\",this.resetState)}disconnectedCallback(){this.removeEventListener(\"file-ready\",this.handleUpload,!1),this.removeEventListener(\"reset\",this.resetState)}attributeChangedCallback(){this.updateLayout()}get hiddenFileInput(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector(\"#hidden-file-input\")}get endpoint(){var t;return(t=this.getAttribute(\"endpoint\"))!=null?t:this._endpoint}set endpoint(t){t!==this.endpoint&&(typeof t==\"string\"?this.setAttribute(\"endpoint\",t):t==null&&this.removeAttribute(\"endpoint\"),this._endpoint=t)}get type(){var t;return(t=this.getAttribute(\"type\"))!=null?t:void 0}set type(t){t!=this.type&&(t?this.setAttribute(\"type\",t):this.removeAttribute(\"type\"))}get noDrop(){return this.hasAttribute(\"no-drop\")}set noDrop(t){this.toggleAttribute(\"no-drop\",!!t)}get noProgress(){return this.hasAttribute(\"no-progress\")}set noProgress(t){this.toggleAttribute(\"no-progress\",!!t)}get noStatus(){return this.hasAttribute(\"no-status\")}set noStatus(t){this.toggleAttribute(\"no-status\",!!t)}get noRetry(){return this.hasAttribute(\"no-retry\")}set noRetry(t){this.toggleAttribute(\"no-retry\",!!t)}get pausable(){return this.hasAttribute(\"pausable\")}set pausable(t){this.toggleAttribute(\"pausable\",!!t)}get dynamicChunkSize(){return this.hasAttribute(\"dynamic-chunk-size\")}set dynamicChunkSize(t){t!==this.hasAttribute(\"dynamic-chunk-size\")&&(t?this.setAttribute(\"dynamic-chunk-size\",\"\"):this.removeAttribute(\"dynamic-chunk-size\"))}get useLargeFileWorkaround(){return this.hasAttribute(\"use-large-file-workaround\")}set useLargeFileWorkaround(t){t!=this.useLargeFileWorkaround&&this.toggleAttribute(\"use-large-file-workaround\",!!t)}get maxFileSize(){let t=this.getAttribute(\"max-file-size\");return t!==null?parseInt(t):void 0}set maxFileSize(t){t?this.setAttribute(\"max-file-size\",t.toString()):this.removeAttribute(\"max-file-size\")}get chunkSize(){let t=this.getAttribute(\"chunk-size\");return t!==null?parseInt(t):void 0}set chunkSize(t){t?this.setAttribute(\"chunk-size\",t.toString()):this.removeAttribute(\"chunk-size\")}get upload(){return this._upload}get paused(){var t,e;return(e=(t=this.upload)==null?void 0:t.paused)!=null?e:!1}set paused(t){if(!this.upload){console.warn(\"Pausing before an upload has begun is unsupported\");return}let e=!!t;e!==this.paused&&(e?this.upload.pause():this.upload.resume(),this.toggleAttribute(\"paused\",e),this.dispatchEvent(new CustomEvent(\"pausedchange\",{detail:e})))}updateLayout(){var r,i;let t=(r=this.shadowRoot)==null?void 0:r.querySelector(\"mux-uploader-drop, div\");t&&t.remove();let e=X(this);(i=this.shadowRoot)==null||i.appendChild(e)}setError(t){this.setAttribute(\"upload-error\",\"\"),this.dispatchEvent(new CustomEvent(\"uploaderror\",{detail:{message:t}}))}resetState(){this.removeAttribute(\"upload-error\"),this.removeAttribute(\"upload-in-progress\"),this.removeAttribute(\"upload-complete\"),this.hiddenFileInput.value=\"\"}handleUpload(t){let e=this.endpoint,r=this.dynamicChunkSize;if(e)this.removeAttribute(\"upload-error\");else{this.setError(\"No url or endpoint specified -- cannot handleUpload\");return}try{let i=Me.createUpload({endpoint:e,dynamicChunkSize:r,file:t.detail,maxFileSize:this.maxFileSize,chunkSize:this.chunkSize,useLargeFileWorkaround:this.useLargeFileWorkaround});this._upload=i,this.dispatchEvent(new CustomEvent(\"uploadstart\",{detail:{file:i.file,chunkSize:i.chunkSize}})),this.setAttribute(\"upload-in-progress\",\"\"),i.offline&&this.dispatchEvent(new CustomEvent(\"offline\")),i.on(\"attempt\",n=>{this.dispatchEvent(new CustomEvent(\"chunkattempt\",n))}),i.on(\"chunkSuccess\",n=>{this.dispatchEvent(new CustomEvent(\"chunksuccess\",n))}),i.on(\"error\",n=>{this.setAttribute(\"upload-error\",\"\"),console.error(\"error handler\",n.detail.message),this.dispatchEvent(new CustomEvent(\"uploaderror\",n))}),i.on(\"progress\",n=>{this.dispatchEvent(new CustomEvent(\"progress\",n))}),i.on(\"success\",n=>{this.removeAttribute(\"upload-in-progress\"),this.setAttribute(\"upload-complete\",\"\"),this.dispatchEvent(new CustomEvent(\"success\",n))}),i.on(\"offline\",n=>{this.dispatchEvent(new CustomEvent(\"offline\",n))}),i.on(\"online\",n=>{this.dispatchEvent(new CustomEvent(\"online\",n))})}catch(i){i instanceof Error&&this.setError(i.message)}}};a.customElements.get(\"mux-uploader\")||(a.customElements.define(\"mux-uploader\",B),a.MuxUploaderElement=B);var le=B;var ue=p.createElement(\"template\");ue.innerHTML=`\n\n\n
\n`;var v,$=class extends a.HTMLElement{constructor(){var r;super();l(this,v);this.attachShadow({mode:\"open\"}).appendChild(ue.content.cloneNode(!0)),this.srOnlyText=(r=this.shadowRoot)==null?void 0:r.getElementById(\"sr-only\")}connectedCallback(){u(this,v,h(this)),s(this,v)&&s(this,v).addEventListener(\"success\",this.updateText.bind(this))}disconnectedCallback(){s(this,v)&&s(this,v).removeEventListener(\"success\",this.updateText.bind(this))}updateText(){this.srOnlyText&&(this.srOnlyText.textContent=\"Upload complete!\")}};v=new WeakMap;a.customElements.get(\"mux-uploader-sr-text\")||a.customElements.define(\"mux-uploader-sr-text\",$);var Ce=$;var Ut=le;export{be as MuxUploaderDropElement,Le as MuxUploaderFileSelectElement,Ae as MuxUploaderPauseElement,ye as MuxUploaderProgressElement,xe as MuxUploaderRetryElement,Ce as MuxUploaderSrTextElement,ve as MuxUploaderStatusElement,K as constants,Ut as default};\n//# sourceMappingURL=index.mjs.map\n","/*! get-video-id v3.5.3 | @license MIT © Michael Wuergler | https://github.com/radiovisual/get-video-id */\n/**\n * Strip away any remaining parameters following `?` or `/` or '&' for YouTube shortcode strings.\n *\n * @note this function is not meant to work with url strings containing a protocol like https://\n * @param {String} shortcodeString - the parameter string\n * @returns {String}\n */\nfunction stripParameters(shortcodeString) {\n // Split parameters or split folder separator\n if (shortcodeString.includes('?')) {\n shortcodeString = shortcodeString.split('?')[0];\n }\n if (shortcodeString.includes('/')) {\n shortcodeString = shortcodeString.split('/')[0];\n }\n if (shortcodeString.includes('&')) {\n shortcodeString = shortcodeString.split('&')[0];\n }\n return shortcodeString;\n}\n\n/**\n * Get the Youtube Video id.\n * @param {string} youtubeStr - the url from which you want to extract the id\n * @returns {string|undefined}\n */\nfunction youtube(youtubeString) {\n let string_ = youtubeString;\n\n // Remove the '-nocookie' flag from youtube urls\n string_ = string_.replace('-nocookie', '');\n\n // Remove time hash at the end of the string\n string_ = string_.replace(/#t=.*$/, '');\n\n // Strip the leading protocol\n string_ = string_.replace(/^https?:\\/\\//, '');\n\n // Shortcode\n const shortcode = /youtube:\\/\\/|youtu\\.be\\/|y2u\\.be\\//g;\n if (shortcode.test(string_)) {\n const shortcodeid = string_.split(shortcode)[1];\n return stripParameters(shortcodeid);\n }\n\n // Shorts\n const shortsUrl = /\\/shorts\\//g;\n if (shortsUrl.test(string_)) {\n return stripParameters(string_.split(shortsUrl)[1]);\n }\n\n // V= or vi=\n const parameterv = /v=|vi=/g;\n if (parameterv.test(string_)) {\n const array = string_.split(parameterv);\n return stripParameters(array[1].split('&')[0]);\n }\n\n // /v/ or /vi/ or /watch/\n const inlinev = /\\/v\\/|\\/vi\\/|\\/watch\\//g;\n if (inlinev.test(string_)) {\n const inlineid = string_.split(inlinev)[1];\n return stripParameters(inlineid);\n }\n\n // Format an_webp\n const parameterwebp = /\\/an_webp\\//g;\n if (parameterwebp.test(string_)) {\n const webp = string_.split(parameterwebp)[1];\n return stripParameters(webp);\n }\n\n // /e/\n const eformat = /\\/e\\//g;\n if (eformat.test(string_)) {\n const estring = string_.split(eformat)[1];\n return stripParameters(estring);\n }\n\n // Embed\n const embedreg = /\\/embed\\//g;\n if (embedreg.test(string_)) {\n const embedid = string_.split(embedreg)[1];\n return stripParameters(embedid);\n }\n\n // ignore /user/username pattern\n const usernamereg = /\\/user\\/([a-zA-Z\\d]*)$/g;\n if (usernamereg.test(string_)) {\n return undefined;\n }\n\n // User\n const userreg = /\\/user\\/(?!.*videos)/g;\n if (userreg.test(string_)) {\n const elements = string_.split('/');\n return stripParameters(elements.pop());\n }\n\n // Attribution_link\n const attrreg = /\\/attribution_link\\?.*v%3D([^%&]*)(%26|&|$)/;\n if (attrreg.test(string_)) {\n return stripParameters(string_.match(attrreg)[1]);\n }\n\n // Live\n const livereg = /\\/live\\//g;\n if (livereg.test(string_)) {\n const liveid = string_.split(livereg)[1];\n return stripParameters(liveid);\n }\n return undefined;\n}\n\n/**\n * Get the vimeo id.\n *\n * @param {String} vimeoString the url from which you want to extract the id\n * @returns {String|undefined}\n */\nfunction vimeo(vimeoString) {\n let string_ = vimeoString;\n if (string_.includes('#')) {\n [string_] = string_.split('#');\n }\n if (string_.includes('?') && !string_.includes('clip_id=')) {\n [string_] = string_.split('?');\n }\n let id;\n let array;\n const event = /https?:\\/\\/vimeo\\.com\\/event\\/(\\d+)$/;\n const eventMatches = event.exec(string_);\n if (eventMatches && eventMatches[1]) {\n return eventMatches[1];\n }\n const primary = /https?:\\/\\/vimeo\\.com\\/(\\d+)/;\n const matches = primary.exec(string_);\n if (matches && matches[1]) {\n return matches[1];\n }\n const vimeoPipe = ['https?://player.vimeo.com/video/[0-9]+$', 'https?://vimeo.com/channels', 'groups', 'album'].join('|');\n const vimeoRegex = new RegExp(vimeoPipe, 'gim');\n if (vimeoRegex.test(string_)) {\n array = string_.split('/');\n if (array && array.length > 0) {\n id = array.pop();\n }\n } else if (/clip_id=/gim.test(string_)) {\n array = string_.split('clip_id=');\n if (array && array.length > 0) {\n [id] = array[1].split('&');\n }\n }\n return id;\n}\n\n/**\n * Get the vine id.\n * @param {string} string_ - the url from which you want to extract the id\n * @returns {string|undefined}\n */\nfunction vine(string_) {\n const regex = /https:\\/\\/vine\\.co\\/v\\/([a-zA-Z\\d]*)\\/?/;\n const matches = regex.exec(string_);\n if (matches && matches.length > 1) {\n return matches[1];\n }\n return undefined;\n}\n\n/**\n * Get the VideoPress id.\n * @param {string} urlString - the url from which you want to extract the id\n * @returns {string|undefined}\n */\nfunction videopress(urlString) {\n let idRegex;\n if (urlString.includes('embed')) {\n idRegex = /embed\\/(\\w{8})/;\n return urlString.match(idRegex)[1];\n }\n idRegex = /\\/v\\/(\\w{8})/;\n const matches = urlString.match(idRegex);\n if (matches && matches.length > 0) {\n return matches[1];\n }\n return undefined;\n}\n\n/**\n * Get the Microsoft Stream id.\n * @param {string} urlString - the url from which you want to extract the id\n * @returns {string|undefined}\n */\nfunction microsoftStream(urlString) {\n const regex = urlString.includes('embed') ? /https:\\/\\/web\\.microsoftstream\\.com\\/embed\\/video\\/([a-zA-Z\\d-]*)\\/?/ : /https:\\/\\/web\\.microsoftstream\\.com\\/video\\/([a-zA-Z\\d-]*)\\/?/;\n const matches = regex.exec(urlString);\n if (matches && matches.length > 1) {\n return matches[1];\n }\n return undefined;\n}\n\n/**\n * Get the tiktok id.\n * @param {string} urlString - the url from which you want to extract the id\n * @returns {string|undefined}\n */\nfunction tiktok(urlString) {\n // Parse basic url and embeds\n const basicReg = /tiktok\\.com(.*)\\/video\\/(\\d+)/gm;\n const basicParsed = basicReg.exec(urlString);\n if (basicParsed && basicParsed.length > 2) {\n return basicParsed[2];\n }\n return undefined;\n}\n\n/**\n * Get the dailymotion id.\n * @param {string} urlString - the url from which you want to extract the id\n * @returns {string|undefined}\n */\nfunction dailymotion(urlString) {\n // Parse basic url and embeds\n const basicReg = /dailymotion\\.com(.*)(video)\\/([a-zA-Z\\d]+)/gm;\n const basicParsed = basicReg.exec(urlString);\n if (basicParsed) {\n return basicParsed[3];\n }\n\n // Parse shortlink\n const shortRegex = /dai\\.ly\\/([a-zA-Z\\d]+)/gm;\n const shortParsed = shortRegex.exec(urlString);\n if (shortParsed && shortParsed.length > 1) {\n return shortParsed[1];\n }\n\n // Dynamic link\n const dynamicRegex = /dailymotion\\.com(.*)video=([a-zA-Z\\d]+)/gm;\n const dynamicParsed = dynamicRegex.exec(urlString);\n if (dynamicParsed && dynamicParsed.length > 2) {\n return dynamicParsed[2];\n }\n return undefined;\n}\n\n/**\n * Get the value assigned to a \"src\" attribute in a string, or undefined.\n * @param {String} input\n * @returns {String|undefined}\n */\nfunction getSrc(input) {\n if (typeof input !== 'string') {\n throw new TypeError('getSrc expected a string');\n }\n const srcRegEx = /src=\"(.*?)\"/gm;\n const matches = srcRegEx.exec(input);\n if (matches && matches.length >= 2) {\n return matches[1];\n }\n return undefined;\n}\n\n/**\n * Prepare the URL by doing common cleanup operations common for all URL types.\n * @param {String} input\n * @returns {String}\n */\nfunction sanitizeUrl(input) {\n if (typeof input !== 'string') {\n throw new TypeError(`sanitizeUrl expected a string, got ${typeof input}`);\n }\n let string_ = input;\n if (/