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e,EAAK,UAC3B,EAAO,iBAAmB,EAC1B,EAAO,KAAO,EAAK,KAGf,EAAO,MAAQ,EAAO,OAAS,EAAK,OACtC,EAAO,KAAO,EAAO,KAAK,QAAQ,iBAAkB,qBAAqB,EAAO,OAEpF,MAGA,EAAS,EAEX,KAAK,OAAS,EACV,EAAQ,SACV,EAAQ,QAAQ,KAAK,KAAM,EAE/B,GACC,CACD,IAAK,OACL,MAAO,SAAc,GACnB,IAAI,EAAU,KAAK,QACnB,IAAI,EAAQ,MAGV,MAAM,EAFN,EAAQ,MAAM,KAAK,KAAM,EAI7B,GACC,CACD,IAAK,QACL,MAAO,WACA,KAAK,UACR,KAAK,SAAU,EACX,KAAK,OACP,KAAK,OAAO,QACF,KAAK,MAAM,SAIrB,KAAK,KAAK,IAAI,MAAM,+CAHpB,KAAK,MAAM,OAAS,KACpB,KAAK,MAAM,WAKjB,IAME,CAAC,CACH,IAAK,aACL,MAAO,WAEL,OADA,OAAO,WAAa,kBACb,CACT,GAMC,CACD,IAAK,cACL,MAAO,SAAqB,GAC1B,SAAS,SAAU,EACrB,KAEK,CACT,CA3Y8B,UA6YrB","file":"/npm/compressorjs@1.2.1/dist/compressor.esm.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/compressorjs@1.2.1/dist/compressor.esm.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*!\n * Compressor.js v1.2.1\n * https://fengyuanchen.github.io/compressorjs\n *\n * Copyright 2018-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2023-02-28T14:09:41.732Z\n */\n\nfunction ownKeys(object, enumerableOnly) {\n  var keys = Object.keys(object);\n  if (Object.getOwnPropertySymbols) {\n    var symbols = Object.getOwnPropertySymbols(object);\n    enumerableOnly && (symbols = symbols.filter(function (sym) {\n      return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n    })), keys.push.apply(keys, symbols);\n  }\n  return keys;\n}\nfunction _objectSpread2(target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = null != arguments[i] ? arguments[i] : {};\n    i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n      _defineProperty(target, key, source[key]);\n    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n      Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n    });\n  }\n  return target;\n}\nfunction _classCallCheck(instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n}\nfunction _defineProperties(target, props) {\n  for (var i = 0; i < props.length; i++) {\n    var descriptor = props[i];\n    descriptor.enumerable = descriptor.enumerable || false;\n    descriptor.configurable = true;\n    if (\"value\" in descriptor) descriptor.writable = true;\n    Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n  }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n  if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n  if (staticProps) _defineProperties(Constructor, staticProps);\n  Object.defineProperty(Constructor, \"prototype\", {\n    writable: false\n  });\n  return Constructor;\n}\nfunction _defineProperty(obj, key, value) {\n  key = _toPropertyKey(key);\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n  return obj;\n}\nfunction _extends() {\n  _extends = Object.assign ? Object.assign.bind() : function (target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var source = arguments[i];\n      for (var key in source) {\n        if (Object.prototype.hasOwnProperty.call(source, key)) {\n          target[key] = source[key];\n        }\n      }\n    }\n    return target;\n  };\n  return _extends.apply(this, arguments);\n}\nfunction _toPrimitive(input, hint) {\n  if (typeof input !== \"object\" || input === null) return input;\n  var prim = input[Symbol.toPrimitive];\n  if (prim !== undefined) {\n    var res = prim.call(input, hint || \"default\");\n    if (typeof res !== \"object\") return res;\n    throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n  }\n  return (hint === \"string\" ? String : Number)(input);\n}\nfunction _toPropertyKey(arg) {\n  var key = _toPrimitive(arg, \"string\");\n  return typeof key === \"symbol\" ? key : String(key);\n}\n\nvar canvasToBlob = {exports: {}};\n\n/*\n * JavaScript Canvas to Blob\n * https://github.com/blueimp/JavaScript-Canvas-to-Blob\n *\n * Copyright 2012, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on stackoverflow user Stoive's code snippet:\n * http://stackoverflow.com/q/4998908\n */\n(function (module) {\n  if (typeof window === 'undefined') {\n    return;\n  }\n  (function (window) {\n\n    var CanvasPrototype = window.HTMLCanvasElement && window.HTMLCanvasElement.prototype;\n    var hasBlobConstructor = window.Blob && function () {\n      try {\n        return Boolean(new Blob());\n      } catch (e) {\n        return false;\n      }\n    }();\n    var hasArrayBufferViewSupport = hasBlobConstructor && window.Uint8Array && function () {\n      try {\n        return new Blob([new Uint8Array(100)]).size === 100;\n      } catch (e) {\n        return false;\n      }\n    }();\n    var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;\n    var dataURIPattern = /^data:((.*?)(;charset=.*?)?)(;base64)?,/;\n    var dataURLtoBlob = (hasBlobConstructor || BlobBuilder) && window.atob && window.ArrayBuffer && window.Uint8Array && function (dataURI) {\n      var matches, mediaType, isBase64, dataString, byteString, arrayBuffer, intArray, i, bb;\n      // Parse the dataURI components as per RFC 2397\n      matches = dataURI.match(dataURIPattern);\n      if (!matches) {\n        throw new Error('invalid data URI');\n      }\n      // Default to text/plain;charset=US-ASCII\n      mediaType = matches[2] ? matches[1] : 'text/plain' + (matches[3] || ';charset=US-ASCII');\n      isBase64 = !!matches[4];\n      dataString = dataURI.slice(matches[0].length);\n      if (isBase64) {\n        // Convert base64 to raw binary data held in a string:\n        byteString = atob(dataString);\n      } else {\n        // Convert base64/URLEncoded data component to raw binary:\n        byteString = decodeURIComponent(dataString);\n      }\n      // Write the bytes of the string to an ArrayBuffer:\n      arrayBuffer = new ArrayBuffer(byteString.length);\n      intArray = new Uint8Array(arrayBuffer);\n      for (i = 0; i < byteString.length; i += 1) {\n        intArray[i] = byteString.charCodeAt(i);\n      }\n      // Write the ArrayBuffer (or ArrayBufferView) to a blob:\n      if (hasBlobConstructor) {\n        return new Blob([hasArrayBufferViewSupport ? intArray : arrayBuffer], {\n          type: mediaType\n        });\n      }\n      bb = new BlobBuilder();\n      bb.append(arrayBuffer);\n      return bb.getBlob(mediaType);\n    };\n    if (window.HTMLCanvasElement && !CanvasPrototype.toBlob) {\n      if (CanvasPrototype.mozGetAsFile) {\n        CanvasPrototype.toBlob = function (callback, type, quality) {\n          var self = this;\n          setTimeout(function () {\n            if (quality && CanvasPrototype.toDataURL && dataURLtoBlob) {\n              callback(dataURLtoBlob(self.toDataURL(type, quality)));\n            } else {\n              callback(self.mozGetAsFile('blob', type));\n            }\n          });\n        };\n      } else if (CanvasPrototype.toDataURL && dataURLtoBlob) {\n        if (CanvasPrototype.msToBlob) {\n          CanvasPrototype.toBlob = function (callback, type, quality) {\n            var self = this;\n            setTimeout(function () {\n              if ((type && type !== 'image/png' || quality) && CanvasPrototype.toDataURL && dataURLtoBlob) {\n                callback(dataURLtoBlob(self.toDataURL(type, quality)));\n              } else {\n                callback(self.msToBlob(type));\n              }\n            });\n          };\n        } else {\n          CanvasPrototype.toBlob = function (callback, type, quality) {\n            var self = this;\n            setTimeout(function () {\n              callback(dataURLtoBlob(self.toDataURL(type, quality)));\n            });\n          };\n        }\n      }\n    }\n    if (module.exports) {\n      module.exports = dataURLtoBlob;\n    } else {\n      window.dataURLtoBlob = dataURLtoBlob;\n    }\n  })(window);\n})(canvasToBlob);\nvar toBlob = canvasToBlob.exports;\n\nvar isBlob = function isBlob(value) {\n  if (typeof Blob === 'undefined') {\n    return false;\n  }\n  return value instanceof Blob || Object.prototype.toString.call(value) === '[object Blob]';\n};\n\nvar DEFAULTS = {\n  /**\n   * Indicates if output the original image instead of the compressed one\n   * when the size of the compressed image is greater than the original one's\n   * @type {boolean}\n   */\n  strict: true,\n  /**\n   * Indicates if read the image's Exif Orientation information,\n   * and then rotate or flip the image automatically.\n   * @type {boolean}\n   */\n  checkOrientation: true,\n  /**\n   * Indicates if retain the image's Exif information after compressed.\n   * @type {boolean}\n  */\n  retainExif: false,\n  /**\n   * The max width of the output image.\n   * @type {number}\n   */\n  maxWidth: Infinity,\n  /**\n   * The max height of the output image.\n   * @type {number}\n   */\n  maxHeight: Infinity,\n  /**\n   * The min width of the output image.\n   * @type {number}\n   */\n  minWidth: 0,\n  /**\n   * The min height of the output image.\n   * @type {number}\n   */\n  minHeight: 0,\n  /**\n   * The width of the output image.\n   * If not specified, the natural width of the source image will be used.\n   * @type {number}\n   */\n  width: undefined,\n  /**\n   * The height of the output image.\n   * If not specified, the natural height of the source image will be used.\n   * @type {number}\n   */\n  height: undefined,\n  /**\n   * Sets how the size of the image should be resized to the container\n   * specified by the `width` and `height` options.\n   * @type {string}\n   */\n  resize: 'none',\n  /**\n   * The quality of the output image.\n   * It must be a number between `0` and `1`,\n   * and only available for `image/jpeg` and `image/webp` images.\n   * Check out {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob canvas.toBlob}.\n   * @type {number}\n   */\n  quality: 0.8,\n  /**\n   * The mime type of the output image.\n   * By default, the original mime type of the source image file will be used.\n   * @type {string}\n   */\n  mimeType: 'auto',\n  /**\n   * Files whose file type is included in this list,\n   * and whose file size exceeds the `convertSize` value will be converted to JPEGs.\n   * @type {string｜Array}\n   */\n  convertTypes: ['image/png'],\n  /**\n   * PNG files over this size (5 MB by default) will be converted to JPEGs.\n   * To disable this, just set the value to `Infinity`.\n   * @type {number}\n   */\n  convertSize: 5000000,\n  /**\n   * The hook function to execute before draw the image into the canvas for compression.\n   * @type {Function}\n   * @param {CanvasRenderingContext2D} context - The 2d rendering context of the canvas.\n   * @param {HTMLCanvasElement} canvas - The canvas for compression.\n   * @example\n   * function (context, canvas) {\n   *   context.fillStyle = '#fff';\n   * }\n   */\n  beforeDraw: null,\n  /**\n   * The hook function to execute after drew the image into the canvas for compression.\n   * @type {Function}\n   * @param {CanvasRenderingContext2D} context - The 2d rendering context of the canvas.\n   * @param {HTMLCanvasElement} canvas - The canvas for compression.\n   * @example\n   * function (context, canvas) {\n   *   context.filter = 'grayscale(100%)';\n   * }\n   */\n  drew: null,\n  /**\n   * The hook function to execute when success to compress the image.\n   * @type {Function}\n   * @param {File} file - The compressed image File object.\n   * @example\n   * function (file) {\n   *   console.log(file);\n   * }\n   */\n  success: null,\n  /**\n   * The hook function to execute when fail to compress the image.\n   * @type {Function}\n   * @param {Error} err - An Error object.\n   * @example\n   * function (err) {\n   *   console.log(err.message);\n   * }\n   */\n  error: null\n};\n\nvar IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nvar WINDOW = IS_BROWSER ? window : {};\n\n/**\n * Check if the given value is a positive number.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a positive number, else `false`.\n */\nvar isPositiveNumber = function isPositiveNumber(value) {\n  return value > 0 && value < Infinity;\n};\nvar slice = Array.prototype.slice;\n\n/**\n * Convert array-like or iterable object to an array.\n * @param {*} value - The value to convert.\n * @returns {Array} Returns a new array.\n */\nfunction toArray(value) {\n  return Array.from ? Array.from(value) : slice.call(value);\n}\nvar REGEXP_IMAGE_TYPE = /^image\\/.+$/;\n\n/**\n * Check if the given value is a mime type of image.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given is a mime type of image, else `false`.\n */\nfunction isImageType(value) {\n  return REGEXP_IMAGE_TYPE.test(value);\n}\n\n/**\n * Convert image type to extension.\n * @param {string} value - The image type to convert.\n * @returns {boolean} Returns the image extension.\n */\nfunction imageTypeToExtension(value) {\n  var extension = isImageType(value) ? value.substr(6) : '';\n  if (extension === 'jpeg') {\n    extension = 'jpg';\n  }\n  return \".\".concat(extension);\n}\nvar fromCharCode = String.fromCharCode;\n\n/**\n * Get string from char code in data view.\n * @param {DataView} dataView - The data view for read.\n * @param {number} start - The start index.\n * @param {number} length - The read length.\n * @returns {string} The read result.\n */\nfunction getStringFromCharCode(dataView, start, length) {\n  var str = '';\n  var i;\n  length += start;\n  for (i = start; i < length; i += 1) {\n    str += fromCharCode(dataView.getUint8(i));\n  }\n  return str;\n}\nvar btoa = WINDOW.btoa;\n\n/**\n * Transform array buffer to Data URL.\n * @param {ArrayBuffer} arrayBuffer - The array buffer to transform.\n * @param {string} mimeType - The mime type of the Data URL.\n * @returns {string} The result Data URL.\n */\nfunction arrayBufferToDataURL(arrayBuffer, mimeType) {\n  var chunks = [];\n  var chunkSize = 8192;\n  var uint8 = new Uint8Array(arrayBuffer);\n  while (uint8.length > 0) {\n    // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9\n    // eslint-disable-next-line prefer-spread\n    chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));\n    uint8 = uint8.subarray(chunkSize);\n  }\n  return \"data:\".concat(mimeType, \";base64,\").concat(btoa(chunks.join('')));\n}\n\n/**\n * Get orientation value from given array buffer.\n * @param {ArrayBuffer} arrayBuffer - The array buffer to read.\n * @returns {number} The read orientation value.\n */\nfunction resetAndGetOrientation(arrayBuffer) {\n  var dataView = new DataView(arrayBuffer);\n  var orientation;\n\n  // Ignores range error when the image does not have correct Exif information\n  try {\n    var littleEndian;\n    var app1Start;\n    var ifdStart;\n\n    // Only handle JPEG image (start by 0xFFD8)\n    if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {\n      var length = dataView.byteLength;\n      var offset = 2;\n      while (offset + 1 < length) {\n        if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {\n          app1Start = offset;\n          break;\n        }\n        offset += 1;\n      }\n    }\n    if (app1Start) {\n      var exifIDCode = app1Start + 4;\n      var tiffOffset = app1Start + 10;\n      if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {\n        var endianness = dataView.getUint16(tiffOffset);\n        littleEndian = endianness === 0x4949;\n        if (littleEndian || endianness === 0x4D4D /* bigEndian */) {\n          if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {\n            var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);\n            if (firstIFDOffset >= 0x00000008) {\n              ifdStart = tiffOffset + firstIFDOffset;\n            }\n          }\n        }\n      }\n    }\n    if (ifdStart) {\n      var _length = dataView.getUint16(ifdStart, littleEndian);\n      var _offset;\n      var i;\n      for (i = 0; i < _length; i += 1) {\n        _offset = ifdStart + i * 12 + 2;\n        if (dataView.getUint16(_offset, littleEndian) === 0x0112 /* Orientation */) {\n          // 8 is the offset of the current tag's value\n          _offset += 8;\n\n          // Get the original orientation value\n          orientation = dataView.getUint16(_offset, littleEndian);\n\n          // Override the orientation with its default value\n          dataView.setUint16(_offset, 1, littleEndian);\n          break;\n        }\n      }\n    }\n  } catch (e) {\n    orientation = 1;\n  }\n  return orientation;\n}\n\n/**\n * Parse Exif Orientation value.\n * @param {number} orientation - The orientation to parse.\n * @returns {Object} The parsed result.\n */\nfunction parseOrientation(orientation) {\n  var rotate = 0;\n  var scaleX = 1;\n  var scaleY = 1;\n  switch (orientation) {\n    // Flip horizontal\n    case 2:\n      scaleX = -1;\n      break;\n\n    // Rotate left 180°\n    case 3:\n      rotate = -180;\n      break;\n\n    // Flip vertical\n    case 4:\n      scaleY = -1;\n      break;\n\n    // Flip vertical and rotate right 90°\n    case 5:\n      rotate = 90;\n      scaleY = -1;\n      break;\n\n    // Rotate right 90°\n    case 6:\n      rotate = 90;\n      break;\n\n    // Flip horizontal and rotate right 90°\n    case 7:\n      rotate = 90;\n      scaleX = -1;\n      break;\n\n    // Rotate left 90°\n    case 8:\n      rotate = -90;\n      break;\n  }\n  return {\n    rotate: rotate,\n    scaleX: scaleX,\n    scaleY: scaleY\n  };\n}\nvar REGEXP_DECIMALS = /\\.\\d*(?:0|9){12}\\d*$/;\n\n/**\n * Normalize decimal number.\n * Check out {@link https://0.30000000000000004.com/}\n * @param {number} value - The value to normalize.\n * @param {number} [times=100000000000] - The times for normalizing.\n * @returns {number} Returns the normalized number.\n */\nfunction normalizeDecimalNumber(value) {\n  var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000;\n  return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value;\n}\n\n/**\n * Get the max sizes in a rectangle under the given aspect ratio.\n * @param {Object} data - The original sizes.\n * @param {string} [type='contain'] - The adjust type.\n * @returns {Object} The result sizes.\n */\nfunction getAdjustedSizes(_ref) {\n  var aspectRatio = _ref.aspectRatio,\n    height = _ref.height,\n    width = _ref.width;\n  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'none';\n  var isValidWidth = isPositiveNumber(width);\n  var isValidHeight = isPositiveNumber(height);\n  if (isValidWidth && isValidHeight) {\n    var adjustedWidth = height * aspectRatio;\n    if ((type === 'contain' || type === 'none') && adjustedWidth > width || type === 'cover' && adjustedWidth < width) {\n      height = width / aspectRatio;\n    } else {\n      width = height * aspectRatio;\n    }\n  } else if (isValidWidth) {\n    height = width / aspectRatio;\n  } else if (isValidHeight) {\n    width = height * aspectRatio;\n  }\n  return {\n    width: width,\n    height: height\n  };\n}\n\n/**\n * Get Exif information from the given array buffer.\n * @param {ArrayBuffer} arrayBuffer - The array buffer to read.\n * @returns {Array} The read Exif information.\n */\nfunction getExif(arrayBuffer) {\n  var array = toArray(new Uint8Array(arrayBuffer));\n  var length = array.length;\n  var segments = [];\n  var start = 0;\n  while (start + 3 < length) {\n    var value = array[start];\n    var next = array[start + 1];\n\n    // SOS (Start of Scan)\n    if (value === 0xFF && next === 0xDA) {\n      break;\n    }\n\n    // SOI (Start of Image)\n    if (value === 0xFF && next === 0xD8) {\n      start += 2;\n    } else {\n      var offset = array[start + 2] * 256 + array[start + 3];\n      var end = start + offset + 2;\n      var segment = array.slice(start, end);\n      segments.push(segment);\n      start = end;\n    }\n  }\n  return segments.reduce(function (exifArray, current) {\n    if (current[0] === 0xFF && current[1] === 0xE1) {\n      return exifArray.concat(current);\n    }\n    return exifArray;\n  }, []);\n}\n\n/**\n * Insert Exif information into the given array buffer.\n * @param {ArrayBuffer} arrayBuffer - The array buffer to transform.\n * @param {Array} exifArray - The Exif information to insert.\n * @returns {ArrayBuffer} The transformed array buffer.\n */\nfunction insertExif(arrayBuffer, exifArray) {\n  var array = toArray(new Uint8Array(arrayBuffer));\n  if (array[2] !== 0xFF || array[3] !== 0xE0) {\n    return arrayBuffer;\n  }\n  var app0Length = array[4] * 256 + array[5];\n  var newArrayBuffer = [0xFF, 0xD8].concat(exifArray, array.slice(4 + app0Length));\n  return new Uint8Array(newArrayBuffer);\n}\n\nvar ArrayBuffer$1 = WINDOW.ArrayBuffer,\n  FileReader = WINDOW.FileReader;\nvar URL = WINDOW.URL || WINDOW.webkitURL;\nvar REGEXP_EXTENSION = /\\.\\w+$/;\nvar AnotherCompressor = WINDOW.Compressor;\n\n/**\n * Creates a new image compressor.\n * @class\n */\nvar Compressor = /*#__PURE__*/function () {\n  /**\n   * The constructor of Compressor.\n   * @param {File|Blob} file - The target image file for compressing.\n   * @param {Object} [options] - The options for compressing.\n   */\n  function Compressor(file, options) {\n    _classCallCheck(this, Compressor);\n    this.file = file;\n    this.exif = [];\n    this.image = new Image();\n    this.options = _objectSpread2(_objectSpread2({}, DEFAULTS), options);\n    this.aborted = false;\n    this.result = null;\n    this.init();\n  }\n  _createClass(Compressor, [{\n    key: \"init\",\n    value: function init() {\n      var _this = this;\n      var file = this.file,\n        options = this.options;\n      if (!isBlob(file)) {\n        this.fail(new Error('The first argument must be a File or Blob object.'));\n        return;\n      }\n      var mimeType = file.type;\n      if (!isImageType(mimeType)) {\n        this.fail(new Error('The first argument must be an image File or Blob object.'));\n        return;\n      }\n      if (!URL || !FileReader) {\n        this.fail(new Error('The current browser does not support image compression.'));\n        return;\n      }\n      if (!ArrayBuffer$1) {\n        options.checkOrientation = false;\n        options.retainExif = false;\n      }\n      var isJPEGImage = mimeType === 'image/jpeg';\n      var checkOrientation = isJPEGImage && options.checkOrientation;\n      var retainExif = isJPEGImage && options.retainExif;\n      if (URL && !checkOrientation && !retainExif) {\n        this.load({\n          url: URL.createObjectURL(file)\n        });\n      } else {\n        var reader = new FileReader();\n        this.reader = reader;\n        reader.onload = function (_ref) {\n          var target = _ref.target;\n          var result = target.result;\n          var data = {};\n          var orientation = 1;\n          if (checkOrientation) {\n            // Reset the orientation value to its default value 1\n            // as some iOS browsers will render image with its orientation\n            orientation = resetAndGetOrientation(result);\n            if (orientation > 1) {\n              _extends(data, parseOrientation(orientation));\n            }\n          }\n          if (retainExif) {\n            _this.exif = getExif(result);\n          }\n          if (checkOrientation || retainExif) {\n            if (!URL\n\n            // Generate a new URL with the default orientation value 1.\n            || orientation > 1) {\n              data.url = arrayBufferToDataURL(result, mimeType);\n            } else {\n              data.url = URL.createObjectURL(file);\n            }\n          } else {\n            data.url = result;\n          }\n          _this.load(data);\n        };\n        reader.onabort = function () {\n          _this.fail(new Error('Aborted to read the image with FileReader.'));\n        };\n        reader.onerror = function () {\n          _this.fail(new Error('Failed to read the image with FileReader.'));\n        };\n        reader.onloadend = function () {\n          _this.reader = null;\n        };\n        if (checkOrientation || retainExif) {\n          reader.readAsArrayBuffer(file);\n        } else {\n          reader.readAsDataURL(file);\n        }\n      }\n    }\n  }, {\n    key: \"load\",\n    value: function load(data) {\n      var _this2 = this;\n      var file = this.file,\n        image = this.image;\n      image.onload = function () {\n        _this2.draw(_objectSpread2(_objectSpread2({}, data), {}, {\n          naturalWidth: image.naturalWidth,\n          naturalHeight: image.naturalHeight\n        }));\n      };\n      image.onabort = function () {\n        _this2.fail(new Error('Aborted to load the image.'));\n      };\n      image.onerror = function () {\n        _this2.fail(new Error('Failed to load the image.'));\n      };\n\n      // Match all browsers that use WebKit as the layout engine in iOS devices,\n      // such as Safari for iOS, Chrome for iOS, and in-app browsers.\n      if (WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent)) {\n        // Fix the `The operation is insecure` error (#57)\n        image.crossOrigin = 'anonymous';\n      }\n      image.alt = file.name;\n      image.src = data.url;\n    }\n  }, {\n    key: \"draw\",\n    value: function draw(_ref2) {\n      var _this3 = this;\n      var naturalWidth = _ref2.naturalWidth,\n        naturalHeight = _ref2.naturalHeight,\n        _ref2$rotate = _ref2.rotate,\n        rotate = _ref2$rotate === void 0 ? 0 : _ref2$rotate,\n        _ref2$scaleX = _ref2.scaleX,\n        scaleX = _ref2$scaleX === void 0 ? 1 : _ref2$scaleX,\n        _ref2$scaleY = _ref2.scaleY,\n        scaleY = _ref2$scaleY === void 0 ? 1 : _ref2$scaleY;\n      var file = this.file,\n        image = this.image,\n        options = this.options;\n      var canvas = document.createElement('canvas');\n      var context = canvas.getContext('2d');\n      var is90DegreesRotated = Math.abs(rotate) % 180 === 90;\n      var resizable = (options.resize === 'contain' || options.resize === 'cover') && isPositiveNumber(options.width) && isPositiveNumber(options.height);\n      var maxWidth = Math.max(options.maxWidth, 0) || Infinity;\n      var maxHeight = Math.max(options.maxHeight, 0) || Infinity;\n      var minWidth = Math.max(options.minWidth, 0) || 0;\n      var minHeight = Math.max(options.minHeight, 0) || 0;\n      var aspectRatio = naturalWidth / naturalHeight;\n      var width = options.width,\n        height = options.height;\n      if (is90DegreesRotated) {\n        var _ref3 = [maxHeight, maxWidth];\n        maxWidth = _ref3[0];\n        maxHeight = _ref3[1];\n        var _ref4 = [minHeight, minWidth];\n        minWidth = _ref4[0];\n        minHeight = _ref4[1];\n        var _ref5 = [height, width];\n        width = _ref5[0];\n        height = _ref5[1];\n      }\n      if (resizable) {\n        aspectRatio = width / height;\n      }\n      var _getAdjustedSizes = getAdjustedSizes({\n        aspectRatio: aspectRatio,\n        width: maxWidth,\n        height: maxHeight\n      }, 'contain');\n      maxWidth = _getAdjustedSizes.width;\n      maxHeight = _getAdjustedSizes.height;\n      var _getAdjustedSizes2 = getAdjustedSizes({\n        aspectRatio: aspectRatio,\n        width: minWidth,\n        height: minHeight\n      }, 'cover');\n      minWidth = _getAdjustedSizes2.width;\n      minHeight = _getAdjustedSizes2.height;\n      if (resizable) {\n        var _getAdjustedSizes3 = getAdjustedSizes({\n          aspectRatio: aspectRatio,\n          width: width,\n          height: height\n        }, options.resize);\n        width = _getAdjustedSizes3.width;\n        height = _getAdjustedSizes3.height;\n      } else {\n        var _getAdjustedSizes4 = getAdjustedSizes({\n          aspectRatio: aspectRatio,\n          width: width,\n          height: height\n        });\n        var _getAdjustedSizes4$wi = _getAdjustedSizes4.width;\n        width = _getAdjustedSizes4$wi === void 0 ? naturalWidth : _getAdjustedSizes4$wi;\n        var _getAdjustedSizes4$he = _getAdjustedSizes4.height;\n        height = _getAdjustedSizes4$he === void 0 ? naturalHeight : _getAdjustedSizes4$he;\n      }\n      width = Math.floor(normalizeDecimalNumber(Math.min(Math.max(width, minWidth), maxWidth)));\n      height = Math.floor(normalizeDecimalNumber(Math.min(Math.max(height, minHeight), maxHeight)));\n      var destX = -width / 2;\n      var destY = -height / 2;\n      var destWidth = width;\n      var destHeight = height;\n      var params = [];\n      if (resizable) {\n        var srcX = 0;\n        var srcY = 0;\n        var srcWidth = naturalWidth;\n        var srcHeight = naturalHeight;\n        var _getAdjustedSizes5 = getAdjustedSizes({\n          aspectRatio: aspectRatio,\n          width: naturalWidth,\n          height: naturalHeight\n        }, {\n          contain: 'cover',\n          cover: 'contain'\n        }[options.resize]);\n        srcWidth = _getAdjustedSizes5.width;\n        srcHeight = _getAdjustedSizes5.height;\n        srcX = (naturalWidth - srcWidth) / 2;\n        srcY = (naturalHeight - srcHeight) / 2;\n        params.push(srcX, srcY, srcWidth, srcHeight);\n      }\n      params.push(destX, destY, destWidth, destHeight);\n      if (is90DegreesRotated) {\n        var _ref6 = [height, width];\n        width = _ref6[0];\n        height = _ref6[1];\n      }\n      canvas.width = width;\n      canvas.height = height;\n      if (!isImageType(options.mimeType)) {\n        options.mimeType = file.type;\n      }\n      var fillStyle = 'transparent';\n\n      // Converts PNG files over the `convertSize` to JPEGs.\n      if (file.size > options.convertSize && options.convertTypes.indexOf(options.mimeType) >= 0) {\n        options.mimeType = 'image/jpeg';\n      }\n      var isJPEGImage = options.mimeType === 'image/jpeg';\n      if (isJPEGImage) {\n        fillStyle = '#fff';\n      }\n\n      // Override the default fill color (#000, black)\n      context.fillStyle = fillStyle;\n      context.fillRect(0, 0, width, height);\n      if (options.beforeDraw) {\n        options.beforeDraw.call(this, context, canvas);\n      }\n      if (this.aborted) {\n        return;\n      }\n      context.save();\n      context.translate(width / 2, height / 2);\n      context.rotate(rotate * Math.PI / 180);\n      context.scale(scaleX, scaleY);\n      context.drawImage.apply(context, [image].concat(params));\n      context.restore();\n      if (options.drew) {\n        options.drew.call(this, context, canvas);\n      }\n      if (this.aborted) {\n        return;\n      }\n      var callback = function callback(blob) {\n        if (!_this3.aborted) {\n          var done = function done(result) {\n            return _this3.done({\n              naturalWidth: naturalWidth,\n              naturalHeight: naturalHeight,\n              result: result\n            });\n          };\n          if (blob && isJPEGImage && options.retainExif && _this3.exif && _this3.exif.length > 0) {\n            var next = function next(arrayBuffer) {\n              return done(toBlob(arrayBufferToDataURL(insertExif(arrayBuffer, _this3.exif), options.mimeType)));\n            };\n            if (blob.arrayBuffer) {\n              blob.arrayBuffer().then(next).catch(function () {\n                _this3.fail(new Error('Failed to read the compressed image with Blob.arrayBuffer().'));\n              });\n            } else {\n              var reader = new FileReader();\n              _this3.reader = reader;\n              reader.onload = function (_ref7) {\n                var target = _ref7.target;\n                next(target.result);\n              };\n              reader.onabort = function () {\n                _this3.fail(new Error('Aborted to read the compressed image with FileReader.'));\n              };\n              reader.onerror = function () {\n                _this3.fail(new Error('Failed to read the compressed image with FileReader.'));\n              };\n              reader.onloadend = function () {\n                _this3.reader = null;\n              };\n              reader.readAsArrayBuffer(blob);\n            }\n          } else {\n            done(blob);\n          }\n        }\n      };\n      if (canvas.toBlob) {\n        canvas.toBlob(callback, options.mimeType, options.quality);\n      } else {\n        callback(toBlob(canvas.toDataURL(options.mimeType, options.quality)));\n      }\n    }\n  }, {\n    key: \"done\",\n    value: function done(_ref8) {\n      var naturalWidth = _ref8.naturalWidth,\n        naturalHeight = _ref8.naturalHeight,\n        result = _ref8.result;\n      var file = this.file,\n        image = this.image,\n        options = this.options;\n      if (URL && image.src.indexOf('blob:') === 0) {\n        URL.revokeObjectURL(image.src);\n      }\n      if (result) {\n        // Returns original file if the result is greater than it and without size related options\n        if (options.strict && !options.retainExif && result.size > file.size && options.mimeType === file.type && !(options.width > naturalWidth || options.height > naturalHeight || options.minWidth > naturalWidth || options.minHeight > naturalHeight || options.maxWidth < naturalWidth || options.maxHeight < naturalHeight)) {\n          result = file;\n        } else {\n          var date = new Date();\n          result.lastModified = date.getTime();\n          result.lastModifiedDate = date;\n          result.name = file.name;\n\n          // Convert the extension to match its type\n          if (result.name && result.type !== file.type) {\n            result.name = result.name.replace(REGEXP_EXTENSION, imageTypeToExtension(result.type));\n          }\n        }\n      } else {\n        // Returns original file if the result is null in some cases.\n        result = file;\n      }\n      this.result = result;\n      if (options.success) {\n        options.success.call(this, result);\n      }\n    }\n  }, {\n    key: \"fail\",\n    value: function fail(err) {\n      var options = this.options;\n      if (options.error) {\n        options.error.call(this, err);\n      } else {\n        throw err;\n      }\n    }\n  }, {\n    key: \"abort\",\n    value: function abort() {\n      if (!this.aborted) {\n        this.aborted = true;\n        if (this.reader) {\n          this.reader.abort();\n        } else if (!this.image.complete) {\n          this.image.onload = null;\n          this.image.onabort();\n        } else {\n          this.fail(new Error('The compression process has been aborted.'));\n        }\n      }\n    }\n\n    /**\n     * Get the no conflict compressor class.\n     * @returns {Compressor} The compressor class.\n     */\n  }], [{\n    key: \"noConflict\",\n    value: function noConflict() {\n      window.Compressor = AnotherCompressor;\n      return Compressor;\n    }\n\n    /**\n     * Change the default options.\n     * @param {Object} options - The new default options.\n     */\n  }, {\n    key: \"setDefaults\",\n    value: function setDefaults(options) {\n      _extends(DEFAULTS, options);\n    }\n  }]);\n  return Compressor;\n}();\n\nexport { Compressor as default };\n"]}