{"version":3,"file":"ngx-dropzone-compressing.mjs","sources":["../../../projects/ngx-dropzone/src/lib/ngx-dropzone-label.directive.ts","../../../projects/ngx-dropzone/src/lib/helpers.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone-preview/ngx-dropzone-remove-badge/ngx-dropzone-remove-badge.component.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone-preview/ngx-dropzone-preview.component.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone.service.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone/ngx-dropzone.component.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone/ngx-dropzone.component.html","../../../projects/ngx-dropzone/src/lib/ngx-dropzone-preview/ngx-dropzone-image-preview/ngx-dropzone-image-preview.component.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone-preview/ngx-dropzone-video-preview/ngx-dropzone-video-preview.component.ts","../../../projects/ngx-dropzone/src/lib/ngx-dropzone.module.ts","../../../projects/ngx-dropzone/src/public_api.ts","../../../projects/ngx-dropzone/src/ngx-dropzone-compressing.ts"],"sourcesContent":["import { Directive } from '@angular/core';\r\n\r\n@Directive({\r\n\tselector: 'ngx-dropzone-label'\r\n})\r\nexport class NgxDropzoneLabelDirective { }\r\n","\r\n/**\r\n * Coerces a data-bound value (typically a string) to a boolean.\r\n * Taken from https://github.com/angular/components/blob/master/src/cdk/coercion/boolean-property.ts\r\n */\r\nexport function coerceBooleanProperty(value: any): boolean\r\n{\r\n\treturn value != null && `${value}` !== 'false';\r\n}\r\n\r\n/**\r\n * Whether the provided value is considered a number.\r\n * Taken from https://github.com/angular/components/blob/master/src/cdk/coercion/number-property.ts\r\n */\r\nexport function coerceNumberProperty(value: any): number\r\n{\r\n\t// parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\r\n\t// and other non-number values as NaN, where Number just uses 0) but it considers the string\r\n\t// '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\r\n\treturn (!isNaN(parseFloat(value as any)) && !isNaN(Number(value))) ? Number(value) : null;\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\n@Component({\r\n  selector: 'ngx-dropzone-remove-badge',\r\n  template: `\r\n    <svg>\r\n      <line x1=\"0\" y1=\"0\" x2=\"10\" y2=\"10\" />\r\n      <line x1=\"0\" y1=\"10\" x2=\"10\" y2=\"0\" />\r\n    </svg>\r\n  `,\r\n  styleUrls: ['./ngx-dropzone-remove-badge.component.scss']\r\n})\r\nexport class NgxDropzoneRemoveBadgeComponent { }\r\n","import { Component, Input, Output, EventEmitter, HostBinding, HostListener } from '@angular/core';\r\nimport { coerceBooleanProperty } from '../helpers';\r\nimport { SafeStyle, DomSanitizer } from '@angular/platform-browser';\r\n\r\nenum KEY_CODE {\r\n\tBACKSPACE = 8,\r\n\tDELETE = 46\r\n}\r\n\r\n@Component({\r\n\tselector: 'ngx-dropzone-preview',\r\n\ttemplate: `\r\n\t\t<ng-content select=\"ngx-dropzone-label\"></ng-content>\r\n\t\t<ngx-dropzone-remove-badge *ngIf=\"removable\" (click)=\"_remove($event)\">\r\n\t\t</ngx-dropzone-remove-badge>\r\n\t`,\r\n\tstyleUrls: ['./ngx-dropzone-preview.component.scss']\r\n})\r\nexport class NgxDropzonePreviewComponent {\r\n\r\n\tconstructor(\r\n\t\tprotected sanitizer: DomSanitizer\r\n\t) { }\r\n\r\n\tprotected _file: File;\r\n\r\n\t/** The file to preview. */\r\n\t@Input()\r\n\tset file(value: File) { this._file = value; }\r\n\tget file(): File { return this._file; }\r\n\r\n\t/** Allow the user to remove files. */\r\n\t@Input()\r\n\tget removable(): boolean {\r\n\t\treturn this._removable;\r\n\t}\r\n\tset removable(value: boolean) {\r\n\t\tthis._removable = coerceBooleanProperty(value);\r\n\t}\r\n\tprotected _removable = false;\r\n\r\n\t/** Emitted when the element should be removed. */\r\n\t@Output() readonly removed = new EventEmitter<File>();\r\n\r\n\t@HostListener('keyup', ['$event'])\r\n\tkeyEvent(event: KeyboardEvent) {\r\n\t\tswitch (event.keyCode) {\r\n\t\t\tcase KEY_CODE.BACKSPACE:\r\n\t\t\tcase KEY_CODE.DELETE:\r\n\t\t\t\tthis.remove();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\t/** We use the HostBinding to pass these common styles to child components. */\r\n\t@HostBinding('style')\r\n\tget hostStyle(): SafeStyle {\r\n\t\tconst styles = `\r\n\t\t\tdisplay: flex;\r\n\t\t\theight: 140px;\r\n\t\t\tmin-height: 140px;\r\n\t\t\tmin-width: 180px;\r\n\t\t\tmax-width: 180px;\r\n\t\t\tjustify-content: center;\r\n\t\t\talign-items: center;\r\n\t\t\tpadding: 0 20px;\r\n\t\t\tmargin: 10px;\r\n\t\t\tborder-radius: 5px;\r\n\t\t\tposition: relative;\r\n\t\t`;\r\n\r\n\t\treturn this.sanitizer.bypassSecurityTrustStyle(styles);\r\n\t}\r\n\r\n\t/** Make the preview item focusable using the tab key. */\r\n\t@HostBinding('tabindex') tabIndex = 0;\r\n\r\n\t/** Remove method to be used from the template. */\r\n\t_remove(event) {\r\n\t\tevent.stopPropagation();\r\n\t\tthis.remove();\r\n\t}\r\n\r\n\t/** Remove the preview item (use from component code). */\r\n\tremove() {\r\n\t\tif (this._removable) {\r\n\t\t\tthis.removed.next(this.file);\r\n\t\t}\r\n\t}\r\n\r\n\tprotected async readFile(): Promise<string | ArrayBuffer> {\r\n\t\treturn new Promise<string | ArrayBuffer>((resolve, reject) => {\r\n\t\t\tconst reader = new FileReader();\r\n\r\n\t\t\treader.onload = e => {\r\n\t\t\t\tresolve((e.target as FileReader).result);\r\n\t\t\t};\r\n\r\n\t\t\treader.onerror = e => {\r\n\t\t\t\tconsole.error(`FileReader failed on file ${this.file.name}.`);\r\n\t\t\t\treject(e);\r\n\t\t\t};\r\n\r\n\t\t\tif (!this.file) {\r\n\t\t\t\treturn reject('No file to read. Please provide a file using the [file] Input property.');\r\n\t\t\t}\r\n\r\n\t\t\treader.readAsDataURL(this.file);\r\n\t\t});\r\n\t}\r\n}\r\n","import { EventEmitter, Injectable } from '@angular/core';\r\nimport { NgxImageCompressService } from 'ngx-image-compress';\r\nimport { NgxDropzoneFileProcessingEvent } from '../public_api';\r\n\r\nexport interface CompressImageConfig {\r\n\torientation: number;\r\n\tmaxHeight?: number;\r\n\tmaxWidth?: number;\r\n\tquality?: number;\r\n\tratio?: number;\r\n}\r\n\r\nexport class FileExtended extends File {\r\n\toriginalSize?: number;\r\n}\r\n\r\nexport interface FileSelectResult {\r\n\r\n\t/** The added files, emitted in the filesAdded event. */\r\n\taddedFiles: FileExtended[];\r\n\r\n\t/** The rejected files, emitted in the filesRejected event. */\r\n\trejectedFiles: RejectedFile[];\r\n}\r\n\r\nexport interface RejectedFile extends File {\r\n\r\n\t/** The reason the file was rejected. */\r\n\treason?: RejectReason;\r\n}\r\n\r\nexport type RejectReason = 'type' | 'size' | 'no_multiple';\r\n\r\n/**\r\n * This service contains the filtering logic to be applied to\r\n * any dropped or selected file. If a file matches all criteria\r\n * like maximum size or accept type, it will be emitted in the\r\n * addedFiles array, otherwise in the rejectedFiles array.\r\n */\r\n@Injectable()\r\nexport class NgxDropzoneService {\r\n\r\n\tconstructor(private _ngxImageCompressService: NgxImageCompressService) { }\r\n\r\n\tasync parseFileList(\r\n\t\tfiles: FileList,\r\n\t\taccept: string,\r\n\t\tmaxFileSize: number,\r\n\t\tmultiple: boolean,\r\n\t\tcompress: boolean | CompressImageConfig,\r\n\t\tonFileProcessing: EventEmitter<NgxDropzoneFileProcessingEvent>,\r\n\t): Promise<FileSelectResult> {\r\n\r\n\t\tconst rejectedFiles: RejectedFile[] = [];\r\n\t\tconst addedFiles: FileExtended[] = [];\r\n\r\n\t\tconst filesArray = Array.from(files);\r\n\t\tvar remainingFilesNumber = filesArray.length - 1;\r\n\r\n\t\tfor (var file of filesArray) {\r\n\t\t\tonFileProcessing.emit({ file, remainingFilesNumber });\r\n\t\t\tremainingFilesNumber--;\r\n\r\n\t\t\tif (!this.isAccepted(file, accept)) {\r\n\t\t\t\tthis.rejectFile(rejectedFiles, file, 'type');\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (!multiple && filesArray.length >= 1) {\r\n\t\t\t\tthis.rejectFile(rejectedFiles, file, 'no_multiple');\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (compress && file.type.search('image') != -1) {\r\n\t\t\t\tconst compressConfig = typeof compress != 'boolean' ? compress : undefined;\r\n\t\t\t\tfile = await this.compressImage(file, compressConfig);\r\n\t\t\t}\r\n\r\n\t\t\tif (maxFileSize && file.size > maxFileSize) {\r\n\t\t\t\tthis.rejectFile(rejectedFiles, file, 'size');\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\taddedFiles.push(file);\r\n\t\t}\r\n\r\n\t\tconst result: FileSelectResult = {\r\n\t\t\taddedFiles,\r\n\t\t\trejectedFiles\r\n\t\t};\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\tprivate isAccepted(file: File, accept: string): boolean {\r\n\r\n\t\tif (accept === '*') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tconst acceptFiletypes = accept.split(',').map(it => it.toLowerCase().trim());\r\n\t\tconst filetype = file.type.toLowerCase();\r\n\t\tconst filename = file.name.toLowerCase();\r\n\r\n\t\tconst matchedFileType = acceptFiletypes.find(acceptFiletype => {\r\n\r\n\t\t\t// check for wildcard mimetype (e.g. image/*)\r\n\t\t\tif (acceptFiletype.endsWith('/*')) {\r\n\t\t\t\treturn filetype.split('/')[0] === acceptFiletype.split('/')[0];\r\n\t\t\t}\r\n\r\n\t\t\t// check for file extension (e.g. .csv)\r\n\t\t\tif (acceptFiletype.startsWith(\".\")) {\r\n\t\t\t\treturn filename.endsWith(acceptFiletype);\r\n\t\t\t}\r\n\r\n\t\t\t// check for exact mimetype match (e.g. image/jpeg)\r\n\t\t\treturn acceptFiletype == filetype;\r\n\t\t});\r\n\r\n\t\treturn !!matchedFileType;\r\n\t}\r\n\r\n\tprivate rejectFile(rejectedFiles: RejectedFile[], file: File, reason: RejectReason) {\r\n\r\n\t\tconst rejectedFile = file as RejectedFile;\r\n\t\trejectedFile.reason = reason;\r\n\r\n\t\trejectedFiles.push(rejectedFile);\r\n\t}\r\n\r\n\tprivate async compressImage(imageFile: File, config: CompressImageConfig = { orientation: -1 }) {\r\n\t\tconst base64Image = await this.fileToBase64(imageFile);\r\n\t\tconst compressedImageBase64 = await this._ngxImageCompressService.compressFile(\r\n\t\t\tbase64Image,\r\n\t\t\tconfig.orientation,\r\n\t\t\tconfig.ratio,\r\n\t\t\tconfig.quality,\r\n\t\t\tconfig.maxWidth,\r\n\t\t\tconfig.maxHeight,\r\n\t\t);\r\n\t\tconst compressedImageFile = await this.base64ToFile(compressedImageBase64, imageFile.name, imageFile.type);\r\n\t\tcompressedImageFile['originalSize'] = imageFile.size;\r\n\t\treturn compressedImageFile;\r\n\t}\r\n\r\n\tprivate fileToBase64(file: File) {\r\n\t\tconst reader = new FileReader();\r\n\t\treader.readAsDataURL(file);\r\n\t\treturn (new Promise<string>((resolve, reject) => {\r\n\t\t\treader.onloadend = () => {\r\n\t\t\t\tif (typeof reader.result == 'string') {\r\n\t\t\t\t\tresolve(reader.result);\r\n\t\t\t\t} else {\r\n\t\t\t\t\treject(reader.result);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t}));\r\n\t}\r\n\r\n\tprivate async base64ToFile(base64File: string, name: string, type: string) {\r\n\t\tconst res: Response = await fetch(base64File);\r\n\t\tconst blob: Blob = await res.blob();\r\n\t\treturn new File([blob], name, { type });\r\n\t}\r\n}\r\n","import { Component, EventEmitter, Output, Input, ViewChild, ContentChildren, QueryList, HostBinding, HostListener, Self, ElementRef } from '@angular/core';\r\nimport { CompressImageConfig, FileExtended, NgxDropzoneService, RejectedFile } from '../ngx-dropzone.service';\r\nimport { coerceBooleanProperty, coerceNumberProperty } from '../helpers';\r\nimport { NgxDropzonePreviewComponent } from '../ngx-dropzone-preview/ngx-dropzone-preview.component';\r\n\r\nexport interface NgxDropzoneChangeEvent {\r\n  source: NgxDropzoneComponent;\r\n  addedFiles: FileExtended[];\r\n  rejectedFiles: RejectedFile[];\r\n}\r\n\r\nexport interface NgxDropzoneFileProcessingEvent {\r\n  file: File;\r\n  remainingFilesNumber: number;\r\n}\r\n\r\n@Component({\r\n  selector: 'ngx-dropzone, [ngx-dropzone]',\r\n  templateUrl: './ngx-dropzone.component.html',\r\n  styleUrls: ['./ngx-dropzone.component.scss'],\r\n  providers: [NgxDropzoneService]\r\n})\r\nexport class NgxDropzoneComponent {\r\n\r\n  constructor(\r\n    @Self() private service: NgxDropzoneService\r\n  ) { }\r\n\r\n  /** A list of the content-projected preview children. */\r\n  @ContentChildren(NgxDropzonePreviewComponent, { descendants: true })\r\n  _previewChildren: QueryList<NgxDropzonePreviewComponent>;\r\n\r\n  get _hasPreviews(): boolean {\r\n    return !!this._previewChildren.length;\r\n  }\r\n\r\n  /** A template reference to the native file input element. */\r\n  @ViewChild('fileInput', { static: true }) _fileInput: ElementRef;\r\n\r\n  /** Emitted when any files were added or rejected. */\r\n  @Output() readonly change = new EventEmitter<NgxDropzoneChangeEvent>();\r\n\r\n  /** Emitted when a file is trying to be processed. */\r\n  @Output() readonly onFileProcessing = new EventEmitter<NgxDropzoneFileProcessingEvent>();\r\n\r\n  /** Set the accepted file types. Defaults to '*'. */\r\n  @Input() accept = '*';\r\n\r\n  /** Enable compression of image files. Default false(no compression). */\r\n  @Input() compress: boolean | CompressImageConfig = false;\r\n\r\n  /** Disable any user interaction with the component. */\r\n  @Input()\r\n  @HostBinding('class.ngx-dz-disabled')\r\n  get disabled(): boolean {\r\n    return this._disabled;\r\n  }\r\n  set disabled(value: boolean) {\r\n    this._disabled = coerceBooleanProperty(value);\r\n\r\n    if (this._isHovered) {\r\n      this._isHovered = false;\r\n    }\r\n  }\r\n  private _disabled = false;\r\n\r\n  /** Allow the selection of multiple files. */\r\n  @Input()\r\n  get multiple(): boolean {\r\n    return this._multiple;\r\n  }\r\n  set multiple(value: boolean) {\r\n    this._multiple = coerceBooleanProperty(value);\r\n  }\r\n  private _multiple = true;\r\n\r\n  /** Set the maximum size a single file may have. */\r\n  @Input()\r\n  get maxFileSize(): number {\r\n    return this._maxFileSize;\r\n  }\r\n  set maxFileSize(value: number) {\r\n    this._maxFileSize = coerceNumberProperty(value);\r\n  }\r\n  private _maxFileSize: number = undefined;\r\n\r\n  /** Allow the dropzone container to expand vertically. */\r\n  @Input()\r\n  @HostBinding('class.expandable')\r\n  get expandable(): boolean {\r\n    return this._expandable;\r\n  }\r\n  set expandable(value: boolean) {\r\n    this._expandable = coerceBooleanProperty(value);\r\n  }\r\n  private _expandable: boolean = false;\r\n\r\n  /** Open the file selector on click. */\r\n  @Input()\r\n  @HostBinding('class.unclickable')\r\n  get disableClick(): boolean {\r\n    return this._disableClick;\r\n  }\r\n  set disableClick(value: boolean) {\r\n    this._disableClick = coerceBooleanProperty(value);\r\n  }\r\n  private _disableClick = false;\r\n\r\n  /** Allow dropping directories. */\r\n  @Input()\r\n  get processDirectoryDrop(): boolean {\r\n    return this._processDirectoryDrop;\r\n  }\r\n  set processDirectoryDrop(value: boolean) {\r\n    this._processDirectoryDrop = coerceBooleanProperty(value);\r\n  }\r\n  private _processDirectoryDrop = false;\r\n\r\n  /** Expose the id, aria-label, aria-labelledby and aria-describedby of the native file input for proper accessibility. */\r\n  @Input() id: string;\r\n  @Input('aria-label') ariaLabel: string;\r\n  @Input('aria-labelledby') ariaLabelledby: string;\r\n  @Input('aria-describedby') ariaDescribedBy: string;\r\n\r\n  @HostBinding('class.ngx-dz-hovered')\r\n  _isHovered = false;\r\n\r\n  /** Show the native OS file explorer to select files. */\r\n  @HostListener('click')\r\n  _onClick() {\r\n    if (!this.disableClick) {\r\n      this.showFileSelector();\r\n    }\r\n  }\r\n\r\n  @HostListener('dragover', ['$event'])\r\n  _onDragOver(event) {\r\n    if (this.disabled) {\r\n      return;\r\n    }\r\n\r\n    this.preventDefault(event);\r\n    this._isHovered = true;\r\n  }\r\n\r\n  @HostListener('dragleave')\r\n  _onDragLeave() {\r\n    this._isHovered = false;\r\n  }\r\n\r\n  @HostListener('drop', ['$event'])\r\n  async _onDrop(event) {\r\n    if (this.disabled) {\r\n      return;\r\n    }\r\n\r\n    this.preventDefault(event);\r\n    this._isHovered = false;\r\n\r\n    // if processDirectoryDrop is not enabled or webkitGetAsEntry is not supported we handle the drop as usual\r\n    if (!this.processDirectoryDrop || !DataTransferItem.prototype.webkitGetAsEntry) {\r\n      await this.handleFileDrop(event.dataTransfer.files);\r\n\r\n      // if processDirectoryDrop is enabled and webkitGetAsEntry is supported we can extract files from a dropped directory\r\n    } else {\r\n      const droppedItems: DataTransferItem[] = event.dataTransfer.items;\r\n\r\n      if (droppedItems.length > 0) {\r\n        const droppedFiles: File[] = [];\r\n        const droppedDirectories = [];\r\n\r\n        // seperate dropped files from dropped directories for easier handling\r\n        for (let i = 0; i < droppedItems.length; i++) {\r\n          const entry = droppedItems[i].webkitGetAsEntry();\r\n          if (entry.isFile) {\r\n            droppedFiles.push(event.dataTransfer.files[i]);\r\n          } else if (entry.isDirectory) {\r\n            droppedDirectories.push(entry);\r\n          }\r\n        }\r\n\r\n        // create a DataTransfer\r\n        const droppedFilesList = new DataTransfer();\r\n        droppedFiles.forEach((droppedFile) => {\r\n          droppedFilesList.items.add(droppedFile);\r\n        });\r\n\r\n        // if no directory is dropped we are done and can call handleFileDrop\r\n        if (!droppedDirectories.length && droppedFilesList.items.length) {\r\n          await this.handleFileDrop(droppedFilesList.files);\r\n        }\r\n\r\n        // if directories are dropped we extract the files from these directories one-by-one and add it to droppedFilesList\r\n        if (droppedDirectories.length) {\r\n          const extractFilesFromDirectoryCalls = [];\r\n\r\n          for (const droppedDirectory of droppedDirectories) {\r\n            extractFilesFromDirectoryCalls.push(this.extractFilesFromDirectory(droppedDirectory));\r\n          }\r\n\r\n          // wait for all directories to be proccessed to add the extracted files afterwards\r\n          Promise.all(extractFilesFromDirectoryCalls).then(async (allExtractedFiles: any[]) => {\r\n            allExtractedFiles.reduce((a, b) => [...a, ...b]).forEach((extractedFile: File) => {\r\n              droppedFilesList.items.add(extractedFile);\r\n            });\r\n\r\n            await this.handleFileDrop(droppedFilesList.files);\r\n          });\r\n        }\r\n      }\r\n    }\r\n  }\r\n\r\n  private extractFilesFromDirectory(directory) {\r\n    async function getFileFromFileEntry(fileEntry) {\r\n      try {\r\n        return await new Promise((resolve, reject) => fileEntry.file(resolve, reject));\r\n      } catch (err) {\r\n        console.log('Error converting a fileEntry to a File: ', err);\r\n      }\r\n    }\r\n\r\n    return new Promise((resolve, reject) => {\r\n      const files: File[] = [];\r\n\r\n      const dirReader = directory.createReader();\r\n\r\n      // we need this to be a recursion because of this issue: https://bugs.chromium.org/p/chromium/issues/detail?id=514087\r\n      const readEntries = () => {\r\n        dirReader.readEntries(async (dirItems) => {\r\n          if (!dirItems.length) {\r\n            resolve(files);\r\n          } else {\r\n            const fileEntries = dirItems.filter((dirItem) => dirItem.isFile);\r\n\r\n            for (const fileEntry of fileEntries) {\r\n              const file: any = await getFileFromFileEntry(fileEntry);\r\n              files.push(file);\r\n            }\r\n\r\n            readEntries();\r\n          }\r\n        });\r\n      };\r\n      readEntries();\r\n    });\r\n  }\r\n\r\n  showFileSelector() {\r\n    if (!this.disabled) {\r\n      (this._fileInput.nativeElement as HTMLInputElement).click();\r\n    }\r\n  }\r\n\r\n  async _onFilesSelected(event) {\r\n    const files: FileList = event.target.files;\r\n    this.handleFileDrop(files);\r\n\r\n    // Reset the native file input element to allow selecting the same file again\r\n    this._fileInput.nativeElement.value = '';\r\n\r\n    // fix(#32): Prevent the default event behavior which caused the change event to emit twice.\r\n    this.preventDefault(event);\r\n  }\r\n\r\n  private async handleFileDrop(files: FileList) {\r\n    const result = await this.service.parseFileList(files, this.accept, this.maxFileSize, this.multiple, this.compress, this.onFileProcessing);\r\n\r\n    this.change.next({\r\n      addedFiles: result.addedFiles,\r\n      rejectedFiles: result.rejectedFiles,\r\n      source: this\r\n    });\r\n  }\r\n\r\n  private preventDefault(event: DragEvent) {\r\n    event.preventDefault();\r\n    event.stopPropagation();\r\n  }\r\n}\r\n","<input #fileInput type=\"file\" [id]=\"id\" [multiple]=\"multiple\" [accept]=\"accept\" [disabled]=\"disabled\"\r\n  (change)=\"_onFilesSelected($event)\" [attr.aria-label]=\"ariaLabel\" [attr.aria-labelledby]=\"ariaLabelledby\"\r\n  [attr.aria-describedby]=\"ariaDescribedBy\">\r\n<ng-content select=\"ngx-dropzone-label\" *ngIf=\"!_hasPreviews\"></ng-content>\r\n<ng-content select=\"ngx-dropzone-preview\"></ng-content>\r\n<ng-content></ng-content>\r\n","import { Component, OnInit, HostBinding, Input } from '@angular/core';\r\nimport { NgxDropzonePreviewComponent } from '../ngx-dropzone-preview.component';\r\nimport { DomSanitizer, SafeStyle } from '@angular/platform-browser';\r\n\r\n@Component({\r\n  selector: 'ngx-dropzone-image-preview',\r\n  template: `\r\n    <img [src]=\"imageSrc\" />\r\n\t\t<ng-content select=\"ngx-dropzone-label\"></ng-content>\r\n    <ngx-dropzone-remove-badge *ngIf=\"removable\" (click)=\"_remove($event)\">\r\n    </ngx-dropzone-remove-badge>\r\n\t`,\r\n  styleUrls: ['./ngx-dropzone-image-preview.component.scss'],\r\n  providers: [\r\n    {\r\n      provide: NgxDropzonePreviewComponent,\r\n      useExisting: NgxDropzoneImagePreviewComponent\r\n    }\r\n  ]\r\n})\r\nexport class NgxDropzoneImagePreviewComponent extends NgxDropzonePreviewComponent implements OnInit {\r\n\r\n  constructor(\r\n    sanitizer: DomSanitizer\r\n  ) {\r\n    super(sanitizer);\r\n  }\r\n\r\n  /** The file to preview. */\r\n  @Input()\r\n  set file(value: File) {\r\n    this._file = value;\r\n    this.renderImage();\r\n  }\r\n  get file(): File { return this._file; }\r\n\r\n  /** The image data source. */\r\n  defaultImgLoading = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj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lLWRhc2hvZmZzZXQ9IjE1LjcwNzk2MzI2Nzk0ODk2NiIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KICA8YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgZHVyPSIxLjE2Mjc5MDY5NzY3NDQxODRzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIga2V5VGltZXM9IjA7MSIgdmFsdWVzPSIwIDUwIDUwOy0zNjAgNTAgNTAiPjwvYW5pbWF0ZVRyYW5zZm9ybT4KPC9jaXJjbGU+CjwhLS0gW2xkaW9dIGdlbmVyYXRlZCBieSBodHRwczovL2xvYWRpbmcuaW8vIC0tPjwvc3ZnPg==';\r\n  imageSrc: any = this.sanitizer.bypassSecurityTrustUrl(this.defaultImgLoading);\r\n\r\n  ngOnInit() {\r\n    this.renderImage();\r\n  }\r\n\r\n  private renderImage() {\r\n    this.readFile()\r\n      .then(img => setTimeout(() => this.imageSrc = img))\r\n      .catch(err => console.error(err));\r\n  }\r\n}\r\n","import { Component, OnInit, OnDestroy } from '@angular/core';\r\nimport { NgxDropzonePreviewComponent } from '../ngx-dropzone-preview.component';\r\nimport { DomSanitizer, SafeUrl } from '@angular/platform-browser';\r\n\r\n@Component({\r\n  selector: 'ngx-dropzone-video-preview',\r\n  template: `\r\n    <video *ngIf=\"sanitizedVideoSrc\" controls (click)=\"$event.stopPropagation()\">\r\n      <source [src]=\"sanitizedVideoSrc\" />\r\n    </video>\r\n    <ng-content select=\"ngx-dropzone-label\"></ng-content>\r\n    <ngx-dropzone-remove-badge *ngIf=\"removable\" (click)=\"_remove($event)\">\r\n    </ngx-dropzone-remove-badge>\r\n\t`,\r\n  styleUrls: ['./ngx-dropzone-video-preview.component.scss'],\r\n  providers: [\r\n    {\r\n      provide: NgxDropzonePreviewComponent,\r\n      useExisting: NgxDropzoneVideoPreviewComponent\r\n    }\r\n  ]\r\n})\r\nexport class NgxDropzoneVideoPreviewComponent extends NgxDropzonePreviewComponent implements OnInit, OnDestroy {\r\n\r\n  constructor(\r\n    sanitizer: DomSanitizer\r\n  ) {\r\n    super(sanitizer);\r\n  }\r\n\r\n  /** The video data source. */\r\n  sanitizedVideoSrc: SafeUrl;\r\n\r\n  private videoSrc: string;\r\n\r\n  ngOnInit() {\r\n    if (!this.file) {\r\n      console.error('No file to read. Please provide a file using the [file] Input property.');\r\n      return;\r\n    }\r\n\r\n    /**\r\n     * We sanitize the URL here to enable the preview.\r\n     * Please note that this could cause security issues!\r\n     **/\r\n    this.videoSrc = URL.createObjectURL(this.file);\r\n    this.sanitizedVideoSrc = this.sanitizer.bypassSecurityTrustUrl(this.videoSrc);\r\n  }\r\n\r\n  ngOnDestroy() {\r\n    URL.revokeObjectURL(this.videoSrc);\r\n  }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { NgxDropzoneLabelDirective } from './ngx-dropzone-label.directive';\r\nimport { NgxDropzonePreviewComponent } from './ngx-dropzone-preview/ngx-dropzone-preview.component';\r\nimport { NgxDropzoneComponent } from './ngx-dropzone/ngx-dropzone.component';\r\nimport { NgxDropzoneImagePreviewComponent } from './ngx-dropzone-preview/ngx-dropzone-image-preview/ngx-dropzone-image-preview.component';\r\nimport { NgxDropzoneRemoveBadgeComponent } from './ngx-dropzone-preview/ngx-dropzone-remove-badge/ngx-dropzone-remove-badge.component';\r\nimport { NgxDropzoneVideoPreviewComponent } from './ngx-dropzone-preview/ngx-dropzone-video-preview/ngx-dropzone-video-preview.component';\r\nimport { NgxImageCompressService } from 'ngx-image-compress';\r\n\r\n@NgModule({\r\n\timports: [\r\n\t\tCommonModule,\r\n\t],\r\n\tdeclarations: [\r\n\t\tNgxDropzoneComponent,\r\n\t\tNgxDropzoneLabelDirective,\r\n\t\tNgxDropzonePreviewComponent,\r\n\t\tNgxDropzoneImagePreviewComponent,\r\n\t\tNgxDropzoneRemoveBadgeComponent,\r\n\t\tNgxDropzoneVideoPreviewComponent,\r\n\t],\r\n\texports: [\r\n\t\tNgxDropzoneComponent,\r\n\t\tNgxDropzoneLabelDirective,\r\n\t\tNgxDropzonePreviewComponent,\r\n\t\tNgxDropzoneImagePreviewComponent,\r\n\t\tNgxDropzoneRemoveBadgeComponent,\r\n\t\tNgxDropzoneVideoPreviewComponent,\r\n\t],\r\n\tproviders: [\r\n\t\tNgxImageCompressService,\r\n\t],\r\n})\r\nexport class NgxDropzoneModule { }\r\n","/*\r\n * Public API Surface of ngx-dropzone\r\n */\r\n\r\nexport * from './lib/ngx-dropzone.module';\r\nexport * from './lib/ngx-dropzone-label.directive';\r\nexport * from './lib/ngx-dropzone/ngx-dropzone.component';\r\nexport * from './lib/ngx-dropzone-preview/ngx-dropzone-preview.component';\r\nexport * from './lib/ngx-dropzone-preview/ngx-dropzone-image-preview/ngx-dropzone-image-preview.component';\r\nexport * from './lib/ngx-dropzone-preview/ngx-dropzone-video-preview/ngx-dropzone-video-preview.component';\r\nexport * from './lib/ngx-dropzone-preview/ngx-dropzone-remove-badge/ngx-dropzone-remove-badge.component';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAKa,yBAAyB;;sHAAzB,yBAAyB;0GAAzB,yBAAyB;2FAAzB,yBAAyB;kBAHrC,SAAS;mBAAC;oBACV,QAAQ,EAAE,oBAAoB;iBAC9B;;;ACHD;;;;SAIgB,qBAAqB,CAAC,KAAU;IAE/C,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG,KAAK,EAAE,KAAK,OAAO,CAAC;AAChD,CAAC;AAED;;;;SAIgB,oBAAoB,CAAC,KAAU;;;;IAK9C,OAAO,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,KAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI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