{ "version": 3, "sources": ["apps/vendor-center-client/src/app/core/file-uploader.service.ts"], "sourcesContent": ["import { Injectable } from '@angular/core';\nimport { FileUploaderInterface, FileUploadInfo } from '@vendasta/forms';\nimport { Observable, throwError } from 'rxjs';\nimport { MarketplaceAppService } from '@galaxy/marketplace-apps/v1';\nimport { map, take } from 'rxjs/operators';\n\nexport const defaultMaxFileSize = 524288000; // 500MB\n\n@Injectable()\nexport class FileUploadService implements FileUploaderInterface {\n constructor(private marketplaceAppService: MarketplaceAppService) {}\n\n uploadFile(file: File): Observable {\n if (file.size > defaultMaxFileSize) {\n return throwError('File size too large');\n }\n\n return this.marketplaceAppService.uploadMarketingFile(file).pipe(\n take(1),\n map((fileUrl) => {\n return { url: fileUrl, name: file.name };\n }),\n );\n }\n}\n"], "mappings": "8GAMO,IAAMA,EAAqB,SAGrBC,GAAiB,IAAA,CAAxB,IAAOA,EAAP,MAAOA,CAAiB,CAC5BC,YAAoBC,EAA4C,CAA5C,KAAAA,sBAAAA,CAA+C,CAEnEC,WAAWC,EAAU,CACnB,OAAIA,EAAKC,KAAON,EACPO,EAAW,qBAAqB,EAGlC,KAAKJ,sBAAsBK,oBAAoBH,CAAI,EAAEI,KAC1DC,EAAK,CAAC,EACNC,EAAKC,IACI,CAAEC,IAAKD,EAASE,KAAMT,EAAKS,IAAI,EACvC,CAAC,CAEN,yCAdWb,GAAiBc,EAAAC,CAAA,CAAA,CAAA,wBAAjBf,EAAiBgB,QAAjBhB,EAAiBiB,SAAA,CAAA,EAAxB,IAAOjB,EAAPkB,SAAOlB,CAAiB,GAAA", "names": ["defaultMaxFileSize", "FileUploadService", "constructor", "marketplaceAppService", "uploadFile", "file", "size", "throwError", "uploadMarketingFile", "pipe", "take", "map", "fileUrl", "url", "name", "\u0275\u0275inject", "MarketplaceAppService", "factory", "\u0275fac", "_FileUploadService"] }