diff --git a/CHANGELOG.md b/CHANGELOG.md index ddef6845..6f12fefb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # angular-file - Change Log All notable changes to this project will be documented here. -## 3.2.2 - (2020-11-11) +## 3.2.3 - (2020-11-11) - Built with ng10 - new [capturePaste] window event listener for files (default off) - selectable attribute now reads string values of 'false', 'null', '0' as false diff --git a/bundles/angular-file.umd.js b/bundles/angular-file.umd.js index 7361144e..f715fc53 100644 --- a/bundles/angular-file.umd.js +++ b/bundles/angular-file.umd.js @@ -759,7 +759,7 @@ } this.pasteCapturer = function (e) { var clip = e.clipboardData; - if (clip && clip.files) { + if (clip && clip.files && clip.files.length) { _this.handleFiles(clip.files); e.preventDefault(); } diff --git a/bundles/angular-file.umd.js.map b/bundles/angular-file.umd.js.map index cb032cac..22ae6167 100644 --- a/bundles/angular-file.umd.js.map +++ b/bundles/angular-file.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"angular-file.umd.js","sources":["../../node_modules/tslib/tslib.es6.js","../../projects/angular-file/src/file-upload/doc-event-help.functions.ts","../../projects/angular-file/src/file-upload/fileTools.ts","../../projects/angular-file/src/file-upload/ngf.directive.ts","../../projects/angular-file/src/file-upload/ngfSelect.directive.ts","../../projects/angular-file/src/file-upload/ngfDrop.directive.ts","../../projects/angular-file/src/file-upload/ngfBackground.directive.ts","../../projects/angular-file/src/file-upload/ngfUploadStatus.directive.ts","../../projects/angular-file/src/file-upload/ngfFormData.directive.ts","../../projects/angular-file/src/file-upload/ngfSrc.directive.ts","../../projects/angular-file/src/file-upload/ngf.module.ts","../../projects/angular-file/src/public-api.ts","../../projects/angular-file/src/angular-file.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","export const isFileInput = function(elm:any){\n const ty = elm.getAttribute('type')\n return elm.tagName.toLowerCase() === 'input' && ty && ty.toLowerCase() === 'file';\n}\n\nlet initialTouchStartY = 0;\nlet initialTouchStartX = 0;\nexport const detectSwipe = function(evt:any):boolean {\n var touches = evt.changedTouches || (evt.originalEvent && evt.originalEvent.changedTouches);\n if (touches) {\n if (evt.type === 'touchstart') {\n initialTouchStartX = touches[0].clientX;\n initialTouchStartY = touches[0].clientY;\n return true; // don't block event default\n } else {\n // prevent scroll from triggering event\n if (evt.type === 'touchend') {\n var currentX = touches[0].clientX;\n var currentY = touches[0].clientY;\n if ((Math.abs(currentX - initialTouchStartX) > 20) ||\n (Math.abs(currentY - initialTouchStartY) > 20)) {\n evt.stopPropagation();\n if (evt.cancelable) {\n evt.preventDefault();\n }\n return false;\n }\n }\n return true;\n }\n }\n return false\n}\n\nexport const createInvisibleFileInputWrap = function() {\n var fileElem = createFileInput()\n var label = document.createElement('label');\n label.innerHTML = 'upload'\n label.style.visibility = 'hidden'\n label.style.position = 'absolute'\n label.style.overflow = 'hidden'\n label.style.width = '0px'\n label.style.height = '0px'\n label.style.border = 'none'\n label.style.margin = '0px'\n label.style.padding = '0px'\n label.setAttribute('tabindex','-1')\n \n //bindAttrToFileInput(fileElem, label);\n //generatedElems.push({el: elem, ref: label});\n\n label.appendChild( fileElem )\n //document.body.appendChild( label );\n\n return label;\n}\n\nexport const createFileInput = function() {\n var fileElem = document.createElement('input');\n fileElem.type=\"file\"\n return fileElem;\n}\n","export function getWindow():any{return window}\n\nexport function acceptType(accept:string, type:string, name?:string):boolean { \n if( !accept ){\n return true\n }\n\n const defs = accept.split(',')\n let regx:RegExp\n let acceptRegString:string\n\n for(let x=defs.length-1; x >= 0; --x){\n //Escapes dots in mimetype \n acceptRegString = defs[x]\n //trim\n acceptRegString = acceptRegString.replace(/(^\\s+|\\s+$)/g,'')\n //Escapes stars in mimetype \n acceptRegString = acceptRegString.replace(/\\*/g,'.*')\n //let acceptReg = '^((' + acceptRegString\n //acceptReg = acceptReg.replace(/,/g,')|(') + '))$'\n \n //try by mime\n regx = new RegExp(acceptRegString, 'gi')\n if( type.search(regx)>=0 ){\n return true\n }\n\n //try by ext\n if( acceptRegString.substring(0, 1)=='.' ){ \n acceptRegString = '\\\\'+ acceptRegString//.substring(1, acceptRegString.length-1)//remove dot at front\n regx = new RegExp(acceptRegString+'$', 'i')\n if( (name||type).search(regx)>=0 ){\n return true\n }\n }\n }\n return false\n}\n\nexport interface InvalidFileItem{\n file:File\n type:string\n}\n\nexport function arrayBufferToBase64(buffer:any) {\n var binary = '';\n var bytes = new Uint8Array(buffer);\n var len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return window.btoa(binary);\n}\n\nexport function dataUrltoBlob(\n dataurl:string,\n name:string,\n origSize?:any\n):Blob{\n var arr = dataurl.split(',');\n var mimeMatch = arr[0].match(/:(.*?);/)\n var mime:string = mimeMatch ? mimeMatch[1] : 'text/plain'\n var bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n var blob = new window.Blob([u8arr], {type: mime});\n blob[\"name\"] = name;\n blob[\"$ngfOrigSize\"] = origSize;\n return blob;\n}\n\nexport interface orientationMeta{\n orientation: number\n fixedArrayBuffer?:any[]\n}\n\nexport function applyTransform(\n ctx:CanvasRenderingContext2D,\n orientation:number,\n width:number,\n height:number\n) {\n switch (orientation) {\n case 2:\n return ctx.transform(-1, 0, 0, 1, width, 0);\n case 3:\n return ctx.transform(-1, 0, 0, -1, width, height);\n case 4:\n return ctx.transform(1, 0, 0, -1, 0, height);\n case 5:\n return ctx.transform(0, 1, 1, 0, 0, 0);\n case 6:\n return ctx.transform(0, 1, -1, 0, height, 0);\n case 7:\n return ctx.transform(0, -1, -1, 0, height, width);\n case 8:\n return ctx.transform(0, -1, 1, 0, 0, width);\n }\n}\n\nexport function fixFileOrientationByMeta(\n file:File, result:orientationMeta\n):Promise{\n return dataUrl(file, true)\n .then(url=>{\n var canvas = document.createElement('canvas');\n var img = document.createElement('img');\n\n return >new Promise(function(res,rej){\n img.onload = function () {\n try {\n canvas.width = result.orientation > 4 ? img.height : img.width\n canvas.height = result.orientation > 4 ? img.width : img.height\n var ctx = canvas.getContext('2d')\n applyTransform(ctx, result.orientation, img.width, img.height)\n ctx.drawImage(img, 0, 0);\n var dataUrl = canvas.toDataURL(file.type || 'image/WebP', 0.934)\n const base = arrayBufferToBase64(result.fixedArrayBuffer)\n dataUrl = restoreExif(base, dataUrl)\n var blob = dataUrltoBlob(dataUrl, file.name)\n const newFile = blobToFile(blob, file.name);\n res(newFile);\n } catch (e) {\n rej(e)\n }\n };\n img.onerror = rej;\n img.src = url; \n })\n })\n}\n\nexport function applyExifRotation(\n file:File\n):Promise{\n if (file.type.indexOf('image/jpeg') !== 0) {\n return Promise.resolve(file);\n }\n\n return readOrientation(file)\n .then((result:orientationMeta)=>{\n if (result.orientation < 2 || result.orientation > 8) {\n return file\n }\n \n return fixFileOrientationByMeta(file,result)\n })\n}\n\nexport function readOrientation(\n file:File\n):Promise{\n return new Promise((res,rej)=>{\n var reader = new FileReader();\n var slicedFile = file.slice ? file.slice(0, 64 * 1024) : file;\n reader.readAsArrayBuffer(slicedFile);\n reader.onerror = rej\n reader.onload = function (e:any) {\n var result:orientationMeta = {orientation: 1};\n var view = new DataView( this.result );\n if (view.getUint16(0, false) !== 0xFFD8) return res(result);\n\n var length = view.byteLength,\n offset = 2;\n while (offset < length) {\n var marker = view.getUint16(offset, false);\n offset += 2;\n if (marker === 0xFFE1) {\n if (view.getUint32(offset += 2, false) !== 0x45786966) return res(result);\n\n var little = view.getUint16(offset += 6, false) === 0x4949;\n offset += view.getUint32(offset + 4, little);\n var tags = view.getUint16(offset, little);\n offset += 2;\n for (var i = 0; i < tags; i++)\n if (view.getUint16(offset + (i * 12), little) === 0x0112) {\n var orientation = view.getUint16(offset + (i * 12) + 8, little);\n if (orientation >= 2 && orientation <= 8) {\n view.setUint16(offset + (i * 12) + 8, 1, little);\n result.fixedArrayBuffer = e.target.result;\n }\n result.orientation = orientation;\n return res(result);\n }\n } else if ((marker & 0xFF00) !== 0xFF00) break;\n else offset += view.getUint16(offset, false);\n }\n return res(result);\n };\n })\n}\n\n/** converts file-input file into base64 dataUri */\nexport function dataUrl(\n file:any,\n disallowObjectUrl?:any\n):Promise{\n if (!file) return Promise.resolve(file)\n \n if ((disallowObjectUrl && file.$ngfDataUrl != null) || (!disallowObjectUrl && file.$ngfBlobUrl != null)) {\n return Promise.resolve( disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl )\n }\n\n var p = disallowObjectUrl ? file.$$ngfDataUrlPromise : file.$$ngfBlobUrlPromise;\n if (p) return p;\n\n const win = getWindow()\n let deferred:Promise\n if (win.FileReader && file &&\n (!win.FileAPI || navigator.userAgent.indexOf('MSIE 8') === -1 || file.size < 20000) &&\n (!win.FileAPI || navigator.userAgent.indexOf('MSIE 9') === -1 || file.size < 4000000)) {\n //prefer URL.createObjectURL for handling refrences to files of all sizes\n //since it doesn´t build a large string in memory\n var URL = win.URL || win.webkitURL;\n if (FileReader) {\n deferred = new Promise((res,rej)=>{\n var fileReader = new FileReader();\n fileReader.onload = function (event:any) {\n file.$ngfDataUrl = event.target.result;\n delete file.$ngfDataUrl;\n res( event.target.result )\n };\n fileReader.onerror = function (e) {\n file.$ngfDataUrl = '';\n rej(e)\n };\n fileReader.readAsDataURL(file);\n })\n } else {\n var url:any;\n try {\n url = URL.createObjectURL(file);\n } catch (e) {\n return Promise.reject(e);\n }\n \n deferred = Promise.resolve( url )\n file.$ngfBlobUrl = url;\n }\n } else {\n file[disallowObjectUrl ? '$ngfDataUrl' : '$ngfBlobUrl'] = '';\n return Promise.reject( new Error('Browser does not support window.FileReader, window.FileReader, or window.FileAPI') )//deferred.reject();\n }\n\n if (disallowObjectUrl) {\n p = file.$$ngfDataUrlPromise = deferred;\n } else {\n p = file.$$ngfBlobUrlPromise = deferred;\n }\n\n p = p.then((x:any)=>{\n delete file[disallowObjectUrl ? '$$ngfDataUrlPromise' : '$$ngfBlobUrlPromise'];\n return x\n })\n\n return p;\n}\n\nexport function restoreExif(orig:any, resized:any) {\n var ExifRestorer:any = {\n KEY_STR:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n }\n\n ExifRestorer.encode64 = function (input:any) {\n var output = '',\n chr1, chr2, chr3:any = '',\n enc1, enc2, enc3, enc4:any = '',\n i = 0;\n\n do {\n chr1 = input[i++];\n chr2 = input[i++];\n chr3 = input[i++];\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output +\n this.KEY_STR.charAt(enc1) +\n this.KEY_STR.charAt(enc2) +\n this.KEY_STR.charAt(enc3) +\n this.KEY_STR.charAt(enc4);\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n } while (i < input.length);\n\n return output;\n };\n\n ExifRestorer.restore = function (origFileBase64:any, resizedFileBase64:any) {\n if (origFileBase64.match('data:image/jpeg;base64,')) {\n origFileBase64 = origFileBase64.replace('data:image/jpeg;base64,', '');\n }\n\n var rawImage:number[] = this.decode64(origFileBase64);\n var segments = this.slice2Segments(rawImage);\n\n var image = this.exifManipulation(resizedFileBase64, segments);\n\n return 'data:image/jpeg;base64,' + this.encode64(image);\n };\n\n\n ExifRestorer.exifManipulation = function (resizedFileBase64:any, segments:any) {\n var exifArray = this.getExifArray(segments),\n newImageArray = this.insertExif(resizedFileBase64, exifArray);\n return new Uint8Array(newImageArray);\n };\n\n ExifRestorer.getExifArray = function (segments:number[][]) {\n var seg;\n for (var x = 0; x < segments.length; x++) {\n seg = segments[x];\n if (seg[0] === 255 && seg[1] === 225) //(ff e1)\n {\n return seg;\n }\n }\n return [];\n };\n\n\n ExifRestorer.insertExif = function (resizedFileBase64:any, exifArray:any) {\n var imageData = resizedFileBase64.replace('data:image/jpeg;base64,', ''),\n buf = this.decode64(imageData),\n separatePoint = buf.indexOf(255, 3),\n mae = buf.slice(0, separatePoint),\n ato = buf.slice(separatePoint),\n array = mae;\n\n array = array.concat(exifArray);\n array = array.concat(ato);\n return array;\n };\n\n\n ExifRestorer.slice2Segments = function(\n rawImageArray:number[]\n ) {\n var head:number = 0,\n segments:number[][] = [];\n\n while (1) {\n if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 218) {\n break;\n }\n if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 216) {\n head += 2;\n }\n else {\n var length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3]\n var endPoint = head + length + 2\n var seg:number[] = rawImageArray.slice(head, endPoint)\n segments.push(seg);\n head = endPoint;\n }\n if (head > rawImageArray.length) {\n break;\n }\n }\n\n return segments;\n };\n\n\n ExifRestorer.decode64 = function (\n input:any\n ):number[]{\n var chr1, chr2, chr3:any = '',\n enc1, enc2, enc3, enc4:any = '',\n i = 0,\n buf:number[] = [];\n\n // remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n var base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n if (base64test.exec(input)) {\n console.log('There were invalid base64 characters in the input text.');\n }\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n\n do {\n enc1 = this.KEY_STR.indexOf(input.charAt(i++));\n enc2 = this.KEY_STR.indexOf(input.charAt(i++));\n enc3 = this.KEY_STR.indexOf(input.charAt(i++));\n enc4 = this.KEY_STR.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n buf.push(chr1);\n\n if (enc3 !== 64) {\n buf.push(chr2);\n }\n if (enc4 !== 64) {\n buf.push(chr3);\n }\n\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n\n } while (i < input.length);\n\n return buf;\n };\n\n return ExifRestorer.restore(orig, resized); //<= EXIF\n};\n\nfunction blobToFile(theBlob: Blob, fileName:string): File {\n var b: any = theBlob;\n //A Blob() is almost a File() - it's just missing the two properties below which we will add\n b.lastModifiedDate = new Date();\n b.name = fileName;\n\n //Cast to a File() type\n return theBlob;\n}\n","import { Directive, EventEmitter, ElementRef, Input, Output, HostListener, ChangeDetectionStrategy } from '@angular/core';\nimport { createInvisibleFileInputWrap, isFileInput, detectSwipe } from \"./doc-event-help.functions\"\nimport {\n acceptType, InvalidFileItem,\n applyExifRotation, dataUrl\n} from \"./fileTools\"\n\nexport interface dragMeta{\n type:string\n kind:string\n}\n\n/** A master base set of logic intended to support file select/drag/drop operations\n NOTE: Use ngfDrop for full drag/drop. Use ngfSelect for selecting\n*/\n@Directive({\n selector: \"[ngf]\",\n exportAs:\"ngf\"\n})\nexport class ngf {\n fileElm:any\n filters:{name:string, fn:(file:File)=>boolean}[] = []\n lastFileCount:number=0\n\n @Input() multiple !:string\n @Input() accept !:string\n @Input() maxSize !:number\n //@Input() forceFilename:string\n //@Input() forcePostname:string\n @Input() ngfFixOrientation:boolean = true\n\n @Input() fileDropDisabled:boolean = false\n @Input() selectable: boolean | string = false\n @Output('init') directiveInit:EventEmitter = new EventEmitter()\n\n @Input() lastInvalids:InvalidFileItem[] = []\n @Output() lastInvalidsChange:EventEmitter<{file:File,type:string}[]> = new EventEmitter()\n\n @Input() lastBaseUrl !: string//base64 last file uploaded url\n @Output() lastBaseUrlChange:EventEmitter = new EventEmitter()\n\n @Input() file !: File//last file uploaded\n @Output() fileChange:EventEmitter = new EventEmitter()\n\n @Input() files:File[] = []\n @Output() filesChange:EventEmitter = new EventEmitter();\n\n @Input() capturePaste: boolean; // window paste file watching (empty string turns on)\n pasteCapturer !: (e: Event) => void;\n\n constructor(public element:ElementRef){\n this.initFilters()\n }\n\n initFilters(){\n // the order is important\n this.filters.push({name: 'accept', fn: this._acceptFilter})\n this.filters.push({name: 'fileSize', fn: this._fileSizeFilter})\n\n //this.filters.push({name: 'fileType', fn: this._fileTypeFilter})\n //this.filters.push({name: 'queueLimit', fn: this._queueLimitFilter})\n //this.filters.push({name: 'mimeType', fn: this._mimeTypeFilter})\n }\n\n ngOnDestroy(){\n delete this.fileElm//faster memory release of dom element\n this.destroyPasteListener();\n }\n\n ngOnInit(){\n const selectable = (this.selectable || this.selectable==='') && !['false', 'null', '0'].includes(this.selectable as string);\n if( selectable ){\n this.enableSelecting()\n }\n\n if( this.multiple ){\n this.paramFileElm().setAttribute('multiple', this.multiple)\n }\n\n this.evalCapturePaste();\n\n //create reference to this class with one cycle delay to avoid ExpressionChangedAfterItHasBeenCheckedError\n setTimeout(()=>{\n this.directiveInit.emit(this)\n }, 0)\n }\n\n ngOnChanges( changes ){\n if( changes.accept ){\n this.paramFileElm().setAttribute('accept', changes.accept.currentValue || '*')\n }\n\n if (changes.capturePaste) {\n this.evalCapturePaste();\n }\n }\n\n evalCapturePaste() {\n const isActive = this.capturePaste || (this.capturePaste as any)==='' || ['false', '0', 'null'].includes(this.capturePaste as any);\n\n if (isActive) {\n if (this.pasteCapturer) {\n return; // already listening\n }\n\n this.pasteCapturer = (e: Event) => {\n const clip = (e as any).clipboardData;\n if (clip && clip.files) {\n this.handleFiles(clip.files);\n e.preventDefault();\n }\n }\n\n window.addEventListener('paste', this.pasteCapturer);\n\n return;\n }\n\n this.destroyPasteListener();\n }\n\n destroyPasteListener() {\n if (this.pasteCapturer) {\n window.removeEventListener('paste', this.pasteCapturer);\n delete this.pasteCapturer;\n }\n }\n\n paramFileElm(){\n if( this.fileElm )return this.fileElm//already defined\n\n //elm is a file input\n const isFile = isFileInput( this.element.nativeElement )\n if(isFile)return this.fileElm = this.element.nativeElement\n\n //create foo file input\n const label = createInvisibleFileInputWrap()\n this.fileElm = label.getElementsByTagName('input')[0]\n this.fileElm.addEventListener('change', this.changeFn.bind(this));\n this.element.nativeElement.appendChild( label )\n return this.fileElm\n }\n\n enableSelecting(){\n let elm = this.element.nativeElement\n\n if( isFileInput(elm) ){\n const bindedHandler = _ev=>this.beforeSelect()\n elm.addEventListener('click', bindedHandler)\n elm.addEventListener('touchstart', bindedHandler)\n return\n }\n\n const bindedHandler = ev=>this.clickHandler(ev)\n elm.addEventListener('click', bindedHandler)\n elm.addEventListener('touchstart', bindedHandler)\n elm.addEventListener('touchend', bindedHandler)\n }\n\n getValidFiles( files:File[] ):File[]{\n const rtn:File[] = []\n for(let x=files.length-1; x >= 0; --x){\n if( this.isFileValid(files[x]) ){\n rtn.push( files[x] )\n }\n }\n return rtn\n }\n\n getInvalidFiles(files:File[]):InvalidFileItem[]{\n const rtn:InvalidFileItem[] = []\n for(let x=files.length-1; x >= 0; --x){\n let failReason = this.getFileFilterFailName(files[x])\n if( failReason ){\n rtn.push({\n file : files[x],\n type : failReason\n })\n }\n }\n return rtn\n }\n\n // Primary handler of files coming in\n handleFiles(files:File[]){\n const valids = this.getValidFiles(files)\n\n if(files.length!=valids.length){\n this.lastInvalids = this.getInvalidFiles(files)\n }else{\n delete this.lastInvalids\n }\n\n this.lastInvalidsChange.emit(this.lastInvalids)\n\n if( valids.length ){\n if( this.ngfFixOrientation ){\n this.applyExifRotations(valids)\n .then( fixedFiles=>this.que(fixedFiles) )\n }else{\n this.que(valids)\n }\n }\n\n if (this.isEmptyAfterSelection()) {\n this.element.nativeElement.value = ''\n }\n }\n\n que( files:File[] ){\n this.files = this.files || []\n Array.prototype.push.apply(this.files, files)\n\n //below break memory ref and doesnt act like a que\n //this.files = files//causes memory change which triggers bindings like \n\n this.filesChange.emit( this.files )\n\n if(files.length){\n this.fileChange.emit( this.file=files[0] )\n\n if(this.lastBaseUrlChange.observers.length){\n dataUrl( files[0] )\n .then( url=>this.lastBaseUrlChange.emit(url) )\n }\n }\n\n //will be checked for input value clearing\n this.lastFileCount = this.files.length\n }\n\n /** called when input has files */\n changeFn(event:any) {\n var fileList = event.__files_ || (event.target && event.target.files)\n\n if (!fileList) return;\n\n this.stopEvent(event);\n this.handleFiles(fileList)\n }\n\n clickHandler(evt:any){\n const elm = this.element.nativeElement\n if (elm.getAttribute('disabled') || this.fileDropDisabled){\n return false;\n }\n\n var r = detectSwipe(evt);\n // prevent the click if it is a swipe\n if ( r!==false ) return r;\n\n const fileElm = this.paramFileElm()\n fileElm.click()\n //fileElm.dispatchEvent( new Event('click') );\n this.beforeSelect()\n\n return false;\n }\n\n beforeSelect(){\n if( this.files && this.lastFileCount===this.files.length )return\n\n //if no files in array, be sure browser doesnt prevent reselect of same file (see github issue 27)\n this.fileElm.value = null\n }\n\n isEmptyAfterSelection():boolean {\n return !!this.element.nativeElement.attributes.multiple;\n }\n\n eventToTransfer(event:any):any {\n if(event.dataTransfer)return event.dataTransfer\n return event.originalEvent ? event.originalEvent.dataTransfer : null\n }\n\n stopEvent(event:any):any {\n event.preventDefault();\n event.stopPropagation();\n }\n\n transferHasFiles(transfer:any):any {\n if (!transfer.types) {\n return false;\n }\n\n if (transfer.types.indexOf) {\n return transfer.types.indexOf('Files') !== -1;\n } else if (transfer.types.contains) {\n return transfer.types.contains('Files');\n } else {\n return false;\n }\n }\n\n eventToFiles(event:Event){\n const transfer = this.eventToTransfer(event);\n if( transfer ){\n if(transfer.files && transfer.files.length){\n return transfer.files\n }\n if(transfer.items && transfer.items.length){\n return transfer.items\n }\n }\n return []\n }\n\n applyExifRotations(\n files:File[]\n ):Promise{\n const mapper = (\n file:File,index:number\n ):Promise=>{\n return applyExifRotation(file)\n .then( fixedFile=>files.splice(index, 1, fixedFile) )\n }\n\n const proms:Promise[] = []\n for(let x=files.length-1; x >= 0; --x){\n proms[x] = mapper( files[x], x )\n }\n return Promise.all( proms ).then( ()=>files )\n }\n\n @HostListener('change', ['$event'])\n onChange(event:Event):void {\n let files = this.element.nativeElement.files || this.eventToFiles(event)\n\n if(!files.length)return\n\n this.stopEvent(event);\n this.handleFiles(files)\n }\n\n getFileFilterFailName(\n file:File\n ):string | undefined{\n for(let i = 0; i < this.filters.length; i++){\n if( !this.filters[i].fn.call(this, file) ){\n return this.filters[i].name\n }\n }\n return undefined\n }\n\n isFileValid(file:File):boolean{\n const noFilters = !this.accept && (!this.filters || !this.filters.length)\n if( noFilters ){\n return true//we have no filters so all files are valid\n }\n\n return this.getFileFilterFailName(file) ? false : true\n }\n\n isFilesValid(files:File[]){\n for(let x=files.length-1; x >= 0; --x){\n if( !this.isFileValid(files[x]) ){\n return false\n }\n }\n return true\n }\n\n protected _acceptFilter(item:File):boolean {\n return acceptType(this.accept, item.type, item.name)\n }\n\n protected _fileSizeFilter(item:File):boolean {\n return !(this.maxSize && item.size > this.maxSize);\n }\n\n /** browsers try hard to conceal data about file drags, this tends to undo that */\n filesToWriteableObject( files:File[] ):dragMeta[]{\n const jsonFiles:dragMeta[] = []\n for(let x=0; x < files.length; ++x){\n jsonFiles.push({\n type:files[x].type,\n kind:files[x][\"kind\"]\n })\n }\n return jsonFiles\n }\n}\n","import { Directive, Input } from \"@angular/core\"\nimport { ngf } from \"./ngf.directive\"\n\n@Directive({\n selector: \"[ngfSelect]\",\n exportAs: \"ngfSelect\"\n})\nexport class ngfSelect extends ngf {\n @Input() selectable:any = true\n}","import {\n Directive, EventEmitter,\n HostListener, Input, Output\n} from '@angular/core';\nimport { ngf, dragMeta } from \"./ngf.directive\"\n\n@Directive({\n selector: \"[ngfDrop]\",\n exportAs: \"ngfDrop\"\n})\nexport class ngfDrop extends ngf {\n @Output() fileOver:EventEmitter = new EventEmitter();\n\n @Input() validDrag:boolean = false\n @Output() validDragChange:EventEmitter = new EventEmitter()\n\n @Input() invalidDrag = false\n @Output() invalidDragChange:EventEmitter = new EventEmitter()\n\n @Input() dragFiles !: dragMeta[]\n @Output() dragFilesChange:EventEmitter = new EventEmitter()\n\n @HostListener('drop', ['$event'])\n onDrop(event:Event):void {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n\n this.closeDrags()\n let files = this.eventToFiles(event)\n\n if(!files.length)return\n\n this.stopEvent(event);\n this.handleFiles(files)\n }\n\n handleFiles(files:File[]){\n this.fileOver.emit(false)//turn-off dragover\n super.handleFiles(files)\n }\n\n @HostListener('dragover', ['$event'])\n onDragOver(event:Event):void {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n\n const transfer = this.eventToTransfer(event)\n\n let files = this.eventToFiles(event)\n\n let jsonFiles = this.filesToWriteableObject(files)\n this.dragFilesChange.emit( this.dragFiles=jsonFiles )\n\n if( files.length ){\n this.validDrag = this.isFilesValid(files)\n }else{\n //Safari, IE11 & some browsers do NOT tell you about dragged files until dropped. Always consider a valid drag\n this.validDrag = true\n }\n\n this.validDragChange.emit(this.validDrag)\n\n this.invalidDrag = !this.validDrag\n this.invalidDragChange.emit(this.invalidDrag)\n\n transfer.dropEffect = 'copy'//change cursor and such\n this.stopEvent(event)\n this.fileOver.emit(true)\n }\n\n closeDrags(){\n delete this.validDrag\n this.validDragChange.emit(this.validDrag)\n this.invalidDrag = false\n this.invalidDragChange.emit(this.invalidDrag)\n delete this.dragFiles\n this.dragFilesChange.emit( this.dragFiles )\n }\n\n @HostListener('dragleave', ['$event'])\n onDragLeave(event:Event):any {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n \n this.closeDrags()\n\n if ((this as any).element) {\n if (event.currentTarget === (this as any).element[0]) {\n return;\n }\n }\n\n this.stopEvent(event);\n this.fileOver.emit(false);\n }\n}","import { Directive, ElementRef, Input } from '@angular/core';\nimport { dataUrl } from './fileTools';\n\n@Directive({selector: '[ngfBackground]'})\nexport class ngfBackground {\n @Input('ngfBackground') file:any\n\n constructor(public ElementRef:ElementRef){}\n\n ngOnChanges( _changes:any ){\n dataUrl(this.file)\n .then(src=>{\n const urlString = 'url(\\'' + (src || '') + '\\')'\n this.ElementRef.nativeElement.style.backgroundImage = urlString\n })\n }\n}\n","import { Directive, EventEmitter, Output, Input } from '@angular/core';\n\n@Directive({selector: 'ngfUploadStatus'})\nexport class ngfUploadStatus {\n @Input() percent:number = 0\n @Output() percentChange:EventEmitter = new EventEmitter()\n @Input() httpEvent !: Event\n\n ngOnChanges( changes ){\n if( changes.httpEvent && changes.httpEvent.currentValue ){\n const event = changes.httpEvent.currentValue\n if (event.loaded && event.total) {\n setTimeout(()=>{\n this.percent = Math.round(100 * event.loaded / event.total);\n this.percentChange.emit( this.percent )\n }, 0)\n }\n }\n }\n}","import {\n IterableDiffer,\n IterableDiffers,\n Directive, EventEmitter,\n Output, Input\n} from '@angular/core';\n\n@Directive({selector: 'ngfFormData'})\nexport class ngfFormData {\n @Input() files !: File[]\n @Input() postName:string = \"file\"\n @Input() fileName !: string//force file name\n\n @Input() FormData:FormData = new FormData()\n @Output() FormDataChange:EventEmitter = new EventEmitter()\n\n differ:IterableDiffer<{}>\n\n constructor(IterableDiffers: IterableDiffers){\n this.differ = IterableDiffers.find([]).create()\n }\n\n ngDoCheck(){\n var changes = this.differ.diff( this.files );\n\n if (changes) {\n setTimeout(()=>this.buildFormData(), 0)\n }\n }\n\n buildFormData(){\n const isArray = typeof(this.files)==='object' && this.files.constructor===Array\n\n if( isArray ){\n this.FormData = new FormData()\n const files = this.files || []\n files.forEach(file=>\n this.FormData.append(this.postName, file, this.fileName||file.name)\n )\n this.FormDataChange.emit( this.FormData )\n }else{\n delete this.FormData\n }\n }\n}","import { Directive, ElementRef, Input } from '@angular/core';\nimport { dataUrl } from './fileTools';\n\n@Directive({ selector: '[ngfSrc]' })\nexport class ngfSrc {\n @Input('ngfSrc') file: any\n\n constructor(public ElementRef: ElementRef) { }\n\n ngOnChanges(_changes: any) {\n dataUrl(this.file)\n .then(src=>\n this.ElementRef.nativeElement.src = src\n )\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ngfBackground } from './ngfBackground.directive';\nimport { ngfDrop } from './ngfDrop.directive';\nimport { ngf } from './ngf.directive';\nimport { ngfSelect } from './ngfSelect.directive';\nimport { ngfUploadStatus } from './ngfUploadStatus.directive';\nimport { ngfFormData } from './ngfFormData.directive';\nimport { ngfSrc } from './ngfSrc.directive';\n//import{ HttpModule } from '@angular/http';\n\nconst declarations = [\n ngfDrop,\n ngfSelect,\n ngfBackground,\n ngfSrc,\n ngfUploadStatus,\n ngfFormData,\n ngf\n]\n\n@NgModule({\n imports: [\n CommonModule\n //,HttpModule\n ],\n declarations: declarations,\n exports: declarations//[HttpModule, ...declarations]\n}) export class ngfModule {}","/*\n * Public API Surface of angular-file\n */\n\nexport * from './file-upload/ngfSelect.directive';\nexport * from './file-upload/ngfDrop.directive';\nexport * from './file-upload/ngf.directive';\nexport * from './file-upload/ngf.module';\nexport { ngfBackground } from './file-upload/ngfBackground.directive';\nexport { ngfSrc } from './file-upload/ngfSrc.directive';\nexport { ngfUploadStatus } from './file-upload/ngfUploadStatus.directive';\nexport { ngfFormData } from './file-upload/ngfFormData.directive';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["EventEmitter","Directive","ElementRef","Input","Output","HostListener","IterableDiffers","NgModule","CommonModule"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;IAcA;IAEA,IAAI,aAAa,GAAG,UAAS,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,MAAM,CAAC,cAAc;aAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;oBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/E,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;aAEc,SAAS,CAAC,CAAC,EAAE,CAAC;QAC1B,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpB,SAAS,EAAE,KAAK,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;QACvC,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE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IAAE,IAAI,CAAC,IAAI,CAAC,GAAA,CACpE,CAAA;gBACD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAE,IAAI,CAAC,QAAQ,CAAE,CAAA;aAC1C;iBAAI;gBACH,OAAO,IAAI,CAAC,QAAQ,CAAA;aACrB;SACF;;;;gBApCFC,cAAS,SAAC,EAAC,QAAQ,EAAE,aAAa,EAAC;;;gBALlCK,oBAAe;;;wBAOdH,UAAK;2BACLA,UAAK;2BACLA,UAAK;2BAELA,UAAK;iCACLC,WAAM;;;;QCPP,gBAAmB,UAAsB;YAAtB,eAAU,GAAV,UAAU,CAAY;SAAK;QAE9C,4BAAW,GAAX,UAAY,QAAa;YAAzB,iBAKC;YAJC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;iBACjB,IAAI,CAAC,UAAA,GAAG,IACP,OAAA,KAAI,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,GAAG,GAAG,GAAA,CACxC,CAAA;SACF;;;;gBAXFH,cAAS,SAAC,EAAE,QAAQ,EAAE,UAAU,EAAE;;;gBAHfC,eAAU;;;uBAK3BC,UAAK,SAAC,QAAQ;;;ICKjB;IAEA,IAAM,YAAY,GAAG;QACnB,OAAO;QACP,SAAS;QACT,aAAa;QACb,MAAM;QACN,eAAe;QACf,WAAW;QACX,GAAG;KACJ,CAAA;;QASE;;;;;gBAPFI,aAAQ,SAAC;oBACR,OAAO,EAAE;wBACPC,mBAAY;;qBAEb;oBACD,YAAY,EAAE,YAAY;oBAC1B,OAAO,EAAE,YAAY;iBACtB;;;IC7BD;;;;ICAA;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"angular-file.umd.js","sources":["../../node_modules/tslib/tslib.es6.js","../../projects/angular-file/src/file-upload/doc-event-help.functions.ts","../../projects/angular-file/src/file-upload/fileTools.ts","../../projects/angular-file/src/file-upload/ngf.directive.ts","../../projects/angular-file/src/file-upload/ngfSelect.directive.ts","../../projects/angular-file/src/file-upload/ngfDrop.directive.ts","../../projects/angular-file/src/file-upload/ngfBackground.directive.ts","../../projects/angular-file/src/file-upload/ngfUploadStatus.directive.ts","../../projects/angular-file/src/file-upload/ngfFormData.directive.ts","../../projects/angular-file/src/file-upload/ngfSrc.directive.ts","../../projects/angular-file/src/file-upload/ngf.module.ts","../../projects/angular-file/src/public-api.ts","../../projects/angular-file/src/angular-file.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","export const isFileInput = function(elm:any){\n const ty = elm.getAttribute('type')\n return elm.tagName.toLowerCase() === 'input' && ty && ty.toLowerCase() === 'file';\n}\n\nlet initialTouchStartY = 0;\nlet initialTouchStartX = 0;\nexport const detectSwipe = function(evt:any):boolean {\n var touches = evt.changedTouches || (evt.originalEvent && evt.originalEvent.changedTouches);\n if (touches) {\n if (evt.type === 'touchstart') {\n initialTouchStartX = touches[0].clientX;\n initialTouchStartY = touches[0].clientY;\n return true; // don't block event default\n } else {\n // prevent scroll from triggering event\n if (evt.type === 'touchend') {\n var currentX = touches[0].clientX;\n var currentY = touches[0].clientY;\n if ((Math.abs(currentX - initialTouchStartX) > 20) ||\n (Math.abs(currentY - initialTouchStartY) > 20)) {\n evt.stopPropagation();\n if (evt.cancelable) {\n evt.preventDefault();\n }\n return false;\n }\n }\n return true;\n }\n }\n return false\n}\n\nexport const createInvisibleFileInputWrap = function() {\n var fileElem = createFileInput()\n var label = document.createElement('label');\n label.innerHTML = 'upload'\n label.style.visibility = 'hidden'\n label.style.position = 'absolute'\n label.style.overflow = 'hidden'\n label.style.width = '0px'\n label.style.height = '0px'\n label.style.border = 'none'\n label.style.margin = '0px'\n label.style.padding = '0px'\n label.setAttribute('tabindex','-1')\n \n //bindAttrToFileInput(fileElem, label);\n //generatedElems.push({el: elem, ref: label});\n\n label.appendChild( fileElem )\n //document.body.appendChild( label );\n\n return label;\n}\n\nexport const createFileInput = function() {\n var fileElem = document.createElement('input');\n fileElem.type=\"file\"\n return fileElem;\n}\n","export function getWindow():any{return window}\n\nexport function acceptType(accept:string, type:string, name?:string):boolean { \n if( !accept ){\n return true\n }\n\n const defs = accept.split(',')\n let regx:RegExp\n let acceptRegString:string\n\n for(let x=defs.length-1; x >= 0; --x){\n //Escapes dots in mimetype \n acceptRegString = defs[x]\n //trim\n acceptRegString = acceptRegString.replace(/(^\\s+|\\s+$)/g,'')\n //Escapes stars in mimetype \n acceptRegString = acceptRegString.replace(/\\*/g,'.*')\n //let acceptReg = '^((' + acceptRegString\n //acceptReg = acceptReg.replace(/,/g,')|(') + '))$'\n \n //try by mime\n regx = new RegExp(acceptRegString, 'gi')\n if( type.search(regx)>=0 ){\n return true\n }\n\n //try by ext\n if( acceptRegString.substring(0, 1)=='.' ){ \n acceptRegString = '\\\\'+ acceptRegString//.substring(1, acceptRegString.length-1)//remove dot at front\n regx = new RegExp(acceptRegString+'$', 'i')\n if( (name||type).search(regx)>=0 ){\n return true\n }\n }\n }\n return false\n}\n\nexport interface InvalidFileItem{\n file:File\n type:string\n}\n\nexport function arrayBufferToBase64(buffer:any) {\n var binary = '';\n var bytes = new Uint8Array(buffer);\n var len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return window.btoa(binary);\n}\n\nexport function dataUrltoBlob(\n dataurl:string,\n name:string,\n origSize?:any\n):Blob{\n var arr = dataurl.split(',');\n var mimeMatch = arr[0].match(/:(.*?);/)\n var mime:string = mimeMatch ? mimeMatch[1] : 'text/plain'\n var bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n var blob = new window.Blob([u8arr], {type: mime});\n blob[\"name\"] = name;\n blob[\"$ngfOrigSize\"] = origSize;\n return blob;\n}\n\nexport interface orientationMeta{\n orientation: number\n fixedArrayBuffer?:any[]\n}\n\nexport function applyTransform(\n ctx:CanvasRenderingContext2D,\n orientation:number,\n width:number,\n height:number\n) {\n switch (orientation) {\n case 2:\n return ctx.transform(-1, 0, 0, 1, width, 0);\n case 3:\n return ctx.transform(-1, 0, 0, -1, width, height);\n case 4:\n return ctx.transform(1, 0, 0, -1, 0, height);\n case 5:\n return ctx.transform(0, 1, 1, 0, 0, 0);\n case 6:\n return ctx.transform(0, 1, -1, 0, height, 0);\n case 7:\n return ctx.transform(0, -1, -1, 0, height, width);\n case 8:\n return ctx.transform(0, -1, 1, 0, 0, width);\n }\n}\n\nexport function fixFileOrientationByMeta(\n file:File, result:orientationMeta\n):Promise{\n return dataUrl(file, true)\n .then(url=>{\n var canvas = document.createElement('canvas');\n var img = document.createElement('img');\n\n return >new Promise(function(res,rej){\n img.onload = function () {\n try {\n canvas.width = result.orientation > 4 ? img.height : img.width\n canvas.height = result.orientation > 4 ? img.width : img.height\n var ctx = canvas.getContext('2d')\n applyTransform(ctx, result.orientation, img.width, img.height)\n ctx.drawImage(img, 0, 0);\n var dataUrl = canvas.toDataURL(file.type || 'image/WebP', 0.934)\n const base = arrayBufferToBase64(result.fixedArrayBuffer)\n dataUrl = restoreExif(base, dataUrl)\n var blob = dataUrltoBlob(dataUrl, file.name)\n const newFile = blobToFile(blob, file.name);\n res(newFile);\n } catch (e) {\n rej(e)\n }\n };\n img.onerror = rej;\n img.src = url; \n })\n })\n}\n\nexport function applyExifRotation(\n file:File\n):Promise{\n if (file.type.indexOf('image/jpeg') !== 0) {\n return Promise.resolve(file);\n }\n\n return readOrientation(file)\n .then((result:orientationMeta)=>{\n if (result.orientation < 2 || result.orientation > 8) {\n return file\n }\n \n return fixFileOrientationByMeta(file,result)\n })\n}\n\nexport function readOrientation(\n file:File\n):Promise{\n return new Promise((res,rej)=>{\n var reader = new FileReader();\n var slicedFile = file.slice ? file.slice(0, 64 * 1024) : file;\n reader.readAsArrayBuffer(slicedFile);\n reader.onerror = rej\n reader.onload = function (e:any) {\n var result:orientationMeta = {orientation: 1};\n var view = new DataView( this.result );\n if (view.getUint16(0, false) !== 0xFFD8) return res(result);\n\n var length = view.byteLength,\n offset = 2;\n while (offset < length) {\n var marker = view.getUint16(offset, false);\n offset += 2;\n if (marker === 0xFFE1) {\n if (view.getUint32(offset += 2, false) !== 0x45786966) return res(result);\n\n var little = view.getUint16(offset += 6, false) === 0x4949;\n offset += view.getUint32(offset + 4, little);\n var tags = view.getUint16(offset, little);\n offset += 2;\n for (var i = 0; i < tags; i++)\n if (view.getUint16(offset + (i * 12), little) === 0x0112) {\n var orientation = view.getUint16(offset + (i * 12) + 8, little);\n if (orientation >= 2 && orientation <= 8) {\n view.setUint16(offset + (i * 12) + 8, 1, little);\n result.fixedArrayBuffer = e.target.result;\n }\n result.orientation = orientation;\n return res(result);\n }\n } else if ((marker & 0xFF00) !== 0xFF00) break;\n else offset += view.getUint16(offset, false);\n }\n return res(result);\n };\n })\n}\n\n/** converts file-input file into base64 dataUri */\nexport function dataUrl(\n file:any,\n disallowObjectUrl?:any\n):Promise{\n if (!file) return Promise.resolve(file)\n \n if ((disallowObjectUrl && file.$ngfDataUrl != null) || (!disallowObjectUrl && file.$ngfBlobUrl != null)) {\n return Promise.resolve( disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl )\n }\n\n var p = disallowObjectUrl ? file.$$ngfDataUrlPromise : file.$$ngfBlobUrlPromise;\n if (p) return p;\n\n const win = getWindow()\n let deferred:Promise\n if (win.FileReader && file &&\n (!win.FileAPI || navigator.userAgent.indexOf('MSIE 8') === -1 || file.size < 20000) &&\n (!win.FileAPI || navigator.userAgent.indexOf('MSIE 9') === -1 || file.size < 4000000)) {\n //prefer URL.createObjectURL for handling refrences to files of all sizes\n //since it doesn´t build a large string in memory\n var URL = win.URL || win.webkitURL;\n if (FileReader) {\n deferred = new Promise((res,rej)=>{\n var fileReader = new FileReader();\n fileReader.onload = function (event:any) {\n file.$ngfDataUrl = event.target.result;\n delete file.$ngfDataUrl;\n res( event.target.result )\n };\n fileReader.onerror = function (e) {\n file.$ngfDataUrl = '';\n rej(e)\n };\n fileReader.readAsDataURL(file);\n })\n } else {\n var url:any;\n try {\n url = URL.createObjectURL(file);\n } catch (e) {\n return Promise.reject(e);\n }\n \n deferred = Promise.resolve( url )\n file.$ngfBlobUrl = url;\n }\n } else {\n file[disallowObjectUrl ? '$ngfDataUrl' : '$ngfBlobUrl'] = '';\n return Promise.reject( new Error('Browser does not support window.FileReader, window.FileReader, or window.FileAPI') )//deferred.reject();\n }\n\n if (disallowObjectUrl) {\n p = file.$$ngfDataUrlPromise = deferred;\n } else {\n p = file.$$ngfBlobUrlPromise = deferred;\n }\n\n p = p.then((x:any)=>{\n delete file[disallowObjectUrl ? '$$ngfDataUrlPromise' : '$$ngfBlobUrlPromise'];\n return x\n })\n\n return p;\n}\n\nexport function restoreExif(orig:any, resized:any) {\n var ExifRestorer:any = {\n KEY_STR:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n }\n\n ExifRestorer.encode64 = function (input:any) {\n var output = '',\n chr1, chr2, chr3:any = '',\n enc1, enc2, enc3, enc4:any = '',\n i = 0;\n\n do {\n chr1 = input[i++];\n chr2 = input[i++];\n chr3 = input[i++];\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output +\n this.KEY_STR.charAt(enc1) +\n this.KEY_STR.charAt(enc2) +\n this.KEY_STR.charAt(enc3) +\n this.KEY_STR.charAt(enc4);\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n } while (i < input.length);\n\n return output;\n };\n\n ExifRestorer.restore = function (origFileBase64:any, resizedFileBase64:any) {\n if (origFileBase64.match('data:image/jpeg;base64,')) {\n origFileBase64 = origFileBase64.replace('data:image/jpeg;base64,', '');\n }\n\n var rawImage:number[] = this.decode64(origFileBase64);\n var segments = this.slice2Segments(rawImage);\n\n var image = this.exifManipulation(resizedFileBase64, segments);\n\n return 'data:image/jpeg;base64,' + this.encode64(image);\n };\n\n\n ExifRestorer.exifManipulation = function (resizedFileBase64:any, segments:any) {\n var exifArray = this.getExifArray(segments),\n newImageArray = this.insertExif(resizedFileBase64, exifArray);\n return new Uint8Array(newImageArray);\n };\n\n ExifRestorer.getExifArray = function (segments:number[][]) {\n var seg;\n for (var x = 0; x < segments.length; x++) {\n seg = segments[x];\n if (seg[0] === 255 && seg[1] === 225) //(ff e1)\n {\n return seg;\n }\n }\n return [];\n };\n\n\n ExifRestorer.insertExif = function (resizedFileBase64:any, exifArray:any) {\n var imageData = resizedFileBase64.replace('data:image/jpeg;base64,', ''),\n buf = this.decode64(imageData),\n separatePoint = buf.indexOf(255, 3),\n mae = buf.slice(0, separatePoint),\n ato = buf.slice(separatePoint),\n array = mae;\n\n array = array.concat(exifArray);\n array = array.concat(ato);\n return array;\n };\n\n\n ExifRestorer.slice2Segments = function(\n rawImageArray:number[]\n ) {\n var head:number = 0,\n segments:number[][] = [];\n\n while (1) {\n if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 218) {\n break;\n }\n if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 216) {\n head += 2;\n }\n else {\n var length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3]\n var endPoint = head + length + 2\n var seg:number[] = rawImageArray.slice(head, endPoint)\n segments.push(seg);\n head = endPoint;\n }\n if (head > rawImageArray.length) {\n break;\n }\n }\n\n return segments;\n };\n\n\n ExifRestorer.decode64 = function (\n input:any\n ):number[]{\n var chr1, chr2, chr3:any = '',\n enc1, enc2, enc3, enc4:any = '',\n i = 0,\n buf:number[] = [];\n\n // remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n var base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n if (base64test.exec(input)) {\n console.log('There were invalid base64 characters in the input text.');\n }\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n\n do {\n enc1 = this.KEY_STR.indexOf(input.charAt(i++));\n enc2 = this.KEY_STR.indexOf(input.charAt(i++));\n enc3 = this.KEY_STR.indexOf(input.charAt(i++));\n enc4 = this.KEY_STR.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n buf.push(chr1);\n\n if (enc3 !== 64) {\n buf.push(chr2);\n }\n if (enc4 !== 64) {\n buf.push(chr3);\n }\n\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n\n } while (i < input.length);\n\n return buf;\n };\n\n return ExifRestorer.restore(orig, resized); //<= EXIF\n};\n\nfunction blobToFile(theBlob: Blob, fileName:string): File {\n var b: any = theBlob;\n //A Blob() is almost a File() - it's just missing the two properties below which we will add\n b.lastModifiedDate = new Date();\n b.name = fileName;\n\n //Cast to a File() type\n return theBlob;\n}\n","import { Directive, EventEmitter, ElementRef, Input, Output, HostListener, ChangeDetectionStrategy } from '@angular/core';\nimport { createInvisibleFileInputWrap, isFileInput, detectSwipe } from \"./doc-event-help.functions\"\nimport {\n acceptType, InvalidFileItem,\n applyExifRotation, dataUrl\n} from \"./fileTools\"\n\nexport interface dragMeta{\n type:string\n kind:string\n}\n\n/** A master base set of logic intended to support file select/drag/drop operations\n NOTE: Use ngfDrop for full drag/drop. Use ngfSelect for selecting\n*/\n@Directive({\n selector: \"[ngf]\",\n exportAs:\"ngf\"\n})\nexport class ngf {\n fileElm:any\n filters:{name:string, fn:(file:File)=>boolean}[] = []\n lastFileCount:number=0\n\n @Input() multiple !:string\n @Input() accept !:string\n @Input() maxSize !:number\n //@Input() forceFilename:string\n //@Input() forcePostname:string\n @Input() ngfFixOrientation:boolean = true\n\n @Input() fileDropDisabled:boolean = false\n @Input() selectable: boolean | string = false\n @Output('init') directiveInit:EventEmitter = new EventEmitter()\n\n @Input() lastInvalids:InvalidFileItem[] = []\n @Output() lastInvalidsChange:EventEmitter<{file:File,type:string}[]> = new EventEmitter()\n\n @Input() lastBaseUrl !: string//base64 last file uploaded url\n @Output() lastBaseUrlChange:EventEmitter = new EventEmitter()\n\n @Input() file !: File//last file uploaded\n @Output() fileChange:EventEmitter = new EventEmitter()\n\n @Input() files:File[] = []\n @Output() filesChange:EventEmitter = new EventEmitter();\n\n @Input() capturePaste: boolean; // window paste file watching (empty string turns on)\n pasteCapturer !: (e: Event) => void;\n\n constructor(public element:ElementRef){\n this.initFilters()\n }\n\n initFilters(){\n // the order is important\n this.filters.push({name: 'accept', fn: this._acceptFilter})\n this.filters.push({name: 'fileSize', fn: this._fileSizeFilter})\n\n //this.filters.push({name: 'fileType', fn: this._fileTypeFilter})\n //this.filters.push({name: 'queueLimit', fn: this._queueLimitFilter})\n //this.filters.push({name: 'mimeType', fn: this._mimeTypeFilter})\n }\n\n ngOnDestroy(){\n delete this.fileElm//faster memory release of dom element\n this.destroyPasteListener();\n }\n\n ngOnInit(){\n const selectable = (this.selectable || this.selectable==='') && !['false', 'null', '0'].includes(this.selectable as string);\n if( selectable ){\n this.enableSelecting()\n }\n\n if( this.multiple ){\n this.paramFileElm().setAttribute('multiple', this.multiple)\n }\n\n this.evalCapturePaste();\n\n //create reference to this class with one cycle delay to avoid ExpressionChangedAfterItHasBeenCheckedError\n setTimeout(()=>{\n this.directiveInit.emit(this)\n }, 0)\n }\n\n ngOnChanges( changes ){\n if( changes.accept ){\n this.paramFileElm().setAttribute('accept', changes.accept.currentValue || '*')\n }\n\n if (changes.capturePaste) {\n this.evalCapturePaste();\n }\n }\n\n evalCapturePaste() {\n const isActive = this.capturePaste || (this.capturePaste as any)==='' || ['false', '0', 'null'].includes(this.capturePaste as any);\n\n if (isActive) {\n if (this.pasteCapturer) {\n return; // already listening\n }\n\n this.pasteCapturer = (e: Event) => {\n const clip = (e as any).clipboardData;\n if (clip && clip.files && clip.files.length) {\n this.handleFiles(clip.files);\n e.preventDefault();\n }\n }\n\n window.addEventListener('paste', this.pasteCapturer);\n\n return;\n }\n\n this.destroyPasteListener();\n }\n\n destroyPasteListener() {\n if (this.pasteCapturer) {\n window.removeEventListener('paste', this.pasteCapturer);\n delete this.pasteCapturer;\n }\n }\n\n paramFileElm(){\n if( this.fileElm )return this.fileElm//already defined\n\n //elm is a file input\n const isFile = isFileInput( this.element.nativeElement )\n if(isFile)return this.fileElm = this.element.nativeElement\n\n //create foo file input\n const label = createInvisibleFileInputWrap()\n this.fileElm = label.getElementsByTagName('input')[0]\n this.fileElm.addEventListener('change', this.changeFn.bind(this));\n this.element.nativeElement.appendChild( label )\n return this.fileElm\n }\n\n enableSelecting(){\n let elm = this.element.nativeElement\n\n if( isFileInput(elm) ){\n const bindedHandler = _ev=>this.beforeSelect()\n elm.addEventListener('click', bindedHandler)\n elm.addEventListener('touchstart', bindedHandler)\n return\n }\n\n const bindedHandler = ev=>this.clickHandler(ev)\n elm.addEventListener('click', bindedHandler)\n elm.addEventListener('touchstart', bindedHandler)\n elm.addEventListener('touchend', bindedHandler)\n }\n\n getValidFiles( files:File[] ):File[]{\n const rtn:File[] = []\n for(let x=files.length-1; x >= 0; --x){\n if( this.isFileValid(files[x]) ){\n rtn.push( files[x] )\n }\n }\n return rtn\n }\n\n getInvalidFiles(files:File[]):InvalidFileItem[]{\n const rtn:InvalidFileItem[] = []\n for(let x=files.length-1; x >= 0; --x){\n let failReason = this.getFileFilterFailName(files[x])\n if( failReason ){\n rtn.push({\n file : files[x],\n type : failReason\n })\n }\n }\n return rtn\n }\n\n // Primary handler of files coming in\n handleFiles(files:File[]){\n const valids = this.getValidFiles(files)\n\n if(files.length!=valids.length){\n this.lastInvalids = this.getInvalidFiles(files)\n }else{\n delete this.lastInvalids\n }\n\n this.lastInvalidsChange.emit(this.lastInvalids)\n\n if( valids.length ){\n if( this.ngfFixOrientation ){\n this.applyExifRotations(valids)\n .then( fixedFiles=>this.que(fixedFiles) )\n }else{\n this.que(valids)\n }\n }\n\n if (this.isEmptyAfterSelection()) {\n this.element.nativeElement.value = ''\n }\n }\n\n que( files:File[] ){\n this.files = this.files || []\n Array.prototype.push.apply(this.files, files)\n\n //below break memory ref and doesnt act like a que\n //this.files = files//causes memory change which triggers bindings like \n\n this.filesChange.emit( this.files )\n\n if(files.length){\n this.fileChange.emit( this.file=files[0] )\n\n if(this.lastBaseUrlChange.observers.length){\n dataUrl( files[0] )\n .then( url=>this.lastBaseUrlChange.emit(url) )\n }\n }\n\n //will be checked for input value clearing\n this.lastFileCount = this.files.length\n }\n\n /** called when input has files */\n changeFn(event:any) {\n var fileList = event.__files_ || (event.target && event.target.files)\n\n if (!fileList) return;\n\n this.stopEvent(event);\n this.handleFiles(fileList)\n }\n\n clickHandler(evt:any){\n const elm = this.element.nativeElement\n if (elm.getAttribute('disabled') || this.fileDropDisabled){\n return false;\n }\n\n var r = detectSwipe(evt);\n // prevent the click if it is a swipe\n if ( r!==false ) return r;\n\n const fileElm = this.paramFileElm()\n fileElm.click()\n //fileElm.dispatchEvent( new Event('click') );\n this.beforeSelect()\n\n return false;\n }\n\n beforeSelect(){\n if( this.files && this.lastFileCount===this.files.length )return\n\n //if no files in array, be sure browser doesnt prevent reselect of same file (see github issue 27)\n this.fileElm.value = null\n }\n\n isEmptyAfterSelection():boolean {\n return !!this.element.nativeElement.attributes.multiple;\n }\n\n eventToTransfer(event:any):any {\n if(event.dataTransfer)return event.dataTransfer\n return event.originalEvent ? event.originalEvent.dataTransfer : null\n }\n\n stopEvent(event:any):any {\n event.preventDefault();\n event.stopPropagation();\n }\n\n transferHasFiles(transfer:any):any {\n if (!transfer.types) {\n return false;\n }\n\n if (transfer.types.indexOf) {\n return transfer.types.indexOf('Files') !== -1;\n } else if (transfer.types.contains) {\n return transfer.types.contains('Files');\n } else {\n return false;\n }\n }\n\n eventToFiles(event:Event){\n const transfer = this.eventToTransfer(event);\n if( transfer ){\n if(transfer.files && transfer.files.length){\n return transfer.files\n }\n if(transfer.items && transfer.items.length){\n return transfer.items\n }\n }\n return []\n }\n\n applyExifRotations(\n files:File[]\n ):Promise{\n const mapper = (\n file:File,index:number\n ):Promise=>{\n return applyExifRotation(file)\n .then( fixedFile=>files.splice(index, 1, fixedFile) )\n }\n\n const proms:Promise[] = []\n for(let x=files.length-1; x >= 0; --x){\n proms[x] = mapper( files[x], x )\n }\n return Promise.all( proms ).then( ()=>files )\n }\n\n @HostListener('change', ['$event'])\n onChange(event:Event):void {\n let files = this.element.nativeElement.files || this.eventToFiles(event)\n\n if(!files.length)return\n\n this.stopEvent(event);\n this.handleFiles(files)\n }\n\n getFileFilterFailName(\n file:File\n ):string | undefined{\n for(let i = 0; i < this.filters.length; i++){\n if( !this.filters[i].fn.call(this, file) ){\n return this.filters[i].name\n }\n }\n return undefined\n }\n\n isFileValid(file:File):boolean{\n const noFilters = !this.accept && (!this.filters || !this.filters.length)\n if( noFilters ){\n return true//we have no filters so all files are valid\n }\n\n return this.getFileFilterFailName(file) ? false : true\n }\n\n isFilesValid(files:File[]){\n for(let x=files.length-1; x >= 0; --x){\n if( !this.isFileValid(files[x]) ){\n return false\n }\n }\n return true\n }\n\n protected _acceptFilter(item:File):boolean {\n return acceptType(this.accept, item.type, item.name)\n }\n\n protected _fileSizeFilter(item:File):boolean {\n return !(this.maxSize && item.size > this.maxSize);\n }\n\n /** browsers try hard to conceal data about file drags, this tends to undo that */\n filesToWriteableObject( files:File[] ):dragMeta[]{\n const jsonFiles:dragMeta[] = []\n for(let x=0; x < files.length; ++x){\n jsonFiles.push({\n type:files[x].type,\n kind:files[x][\"kind\"]\n })\n }\n return jsonFiles\n }\n}\n","import { Directive, Input } from \"@angular/core\"\nimport { ngf } from \"./ngf.directive\"\n\n@Directive({\n selector: \"[ngfSelect]\",\n exportAs: \"ngfSelect\"\n})\nexport class ngfSelect extends ngf {\n @Input() selectable:any = true\n}","import {\n Directive, EventEmitter,\n HostListener, Input, Output\n} from '@angular/core';\nimport { ngf, dragMeta } from \"./ngf.directive\"\n\n@Directive({\n selector: \"[ngfDrop]\",\n exportAs: \"ngfDrop\"\n})\nexport class ngfDrop extends ngf {\n @Output() fileOver:EventEmitter = new EventEmitter();\n\n @Input() validDrag:boolean = false\n @Output() validDragChange:EventEmitter = new EventEmitter()\n\n @Input() invalidDrag = false\n @Output() invalidDragChange:EventEmitter = new EventEmitter()\n\n @Input() dragFiles !: dragMeta[]\n @Output() dragFilesChange:EventEmitter = new EventEmitter()\n\n @HostListener('drop', ['$event'])\n onDrop(event:Event):void {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n\n this.closeDrags()\n let files = this.eventToFiles(event)\n\n if(!files.length)return\n\n this.stopEvent(event);\n this.handleFiles(files)\n }\n\n handleFiles(files:File[]){\n this.fileOver.emit(false)//turn-off dragover\n super.handleFiles(files)\n }\n\n @HostListener('dragover', ['$event'])\n onDragOver(event:Event):void {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n\n const transfer = this.eventToTransfer(event)\n\n let files = this.eventToFiles(event)\n\n let jsonFiles = this.filesToWriteableObject(files)\n this.dragFilesChange.emit( this.dragFiles=jsonFiles )\n\n if( files.length ){\n this.validDrag = this.isFilesValid(files)\n }else{\n //Safari, IE11 & some browsers do NOT tell you about dragged files until dropped. Always consider a valid drag\n this.validDrag = true\n }\n\n this.validDragChange.emit(this.validDrag)\n\n this.invalidDrag = !this.validDrag\n this.invalidDragChange.emit(this.invalidDrag)\n\n transfer.dropEffect = 'copy'//change cursor and such\n this.stopEvent(event)\n this.fileOver.emit(true)\n }\n\n closeDrags(){\n delete this.validDrag\n this.validDragChange.emit(this.validDrag)\n this.invalidDrag = false\n this.invalidDragChange.emit(this.invalidDrag)\n delete this.dragFiles\n this.dragFilesChange.emit( this.dragFiles )\n }\n\n @HostListener('dragleave', ['$event'])\n onDragLeave(event:Event):any {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n \n this.closeDrags()\n\n if ((this as any).element) {\n if (event.currentTarget === (this as any).element[0]) {\n return;\n }\n }\n\n this.stopEvent(event);\n this.fileOver.emit(false);\n }\n}","import { Directive, ElementRef, Input } from '@angular/core';\nimport { dataUrl } from './fileTools';\n\n@Directive({selector: '[ngfBackground]'})\nexport class ngfBackground {\n @Input('ngfBackground') file:any\n\n constructor(public ElementRef:ElementRef){}\n\n ngOnChanges( _changes:any ){\n dataUrl(this.file)\n .then(src=>{\n const urlString = 'url(\\'' + (src || '') + '\\')'\n this.ElementRef.nativeElement.style.backgroundImage = urlString\n })\n }\n}\n","import { Directive, EventEmitter, Output, Input } from '@angular/core';\n\n@Directive({selector: 'ngfUploadStatus'})\nexport class ngfUploadStatus {\n @Input() percent:number = 0\n @Output() percentChange:EventEmitter = new EventEmitter()\n @Input() httpEvent !: Event\n\n ngOnChanges( changes ){\n if( changes.httpEvent && changes.httpEvent.currentValue ){\n const event = changes.httpEvent.currentValue\n if (event.loaded && event.total) {\n setTimeout(()=>{\n this.percent = Math.round(100 * event.loaded / event.total);\n this.percentChange.emit( this.percent )\n }, 0)\n }\n }\n }\n}","import {\n IterableDiffer,\n IterableDiffers,\n Directive, EventEmitter,\n Output, Input\n} from '@angular/core';\n\n@Directive({selector: 'ngfFormData'})\nexport class ngfFormData {\n @Input() files !: File[]\n @Input() postName:string = \"file\"\n @Input() fileName !: string//force file name\n\n @Input() FormData:FormData = new FormData()\n @Output() FormDataChange:EventEmitter = new EventEmitter()\n\n differ:IterableDiffer<{}>\n\n constructor(IterableDiffers: IterableDiffers){\n this.differ = IterableDiffers.find([]).create()\n }\n\n ngDoCheck(){\n var changes = this.differ.diff( this.files );\n\n if (changes) {\n setTimeout(()=>this.buildFormData(), 0)\n }\n }\n\n buildFormData(){\n const isArray = typeof(this.files)==='object' && this.files.constructor===Array\n\n if( isArray ){\n this.FormData = new FormData()\n const files = this.files || []\n files.forEach(file=>\n this.FormData.append(this.postName, file, this.fileName||file.name)\n )\n this.FormDataChange.emit( this.FormData )\n }else{\n delete this.FormData\n }\n }\n}","import { Directive, ElementRef, Input } from '@angular/core';\nimport { dataUrl } from './fileTools';\n\n@Directive({ selector: '[ngfSrc]' })\nexport class ngfSrc {\n @Input('ngfSrc') file: any\n\n constructor(public ElementRef: ElementRef) { }\n\n ngOnChanges(_changes: any) {\n dataUrl(this.file)\n .then(src=>\n this.ElementRef.nativeElement.src = src\n )\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ngfBackground } from './ngfBackground.directive';\nimport { ngfDrop } from './ngfDrop.directive';\nimport { ngf } from './ngf.directive';\nimport { ngfSelect } from './ngfSelect.directive';\nimport { ngfUploadStatus } from './ngfUploadStatus.directive';\nimport { ngfFormData } from './ngfFormData.directive';\nimport { ngfSrc } from './ngfSrc.directive';\n//import{ HttpModule } from '@angular/http';\n\nconst declarations = [\n ngfDrop,\n ngfSelect,\n ngfBackground,\n ngfSrc,\n ngfUploadStatus,\n ngfFormData,\n ngf\n]\n\n@NgModule({\n imports: [\n CommonModule\n //,HttpModule\n ],\n declarations: declarations,\n exports: declarations//[HttpModule, ...declarations]\n}) export class ngfModule {}","/*\n * Public API Surface of angular-file\n */\n\nexport * from './file-upload/ngfSelect.directive';\nexport * from './file-upload/ngfDrop.directive';\nexport * from './file-upload/ngf.directive';\nexport * from './file-upload/ngf.module';\nexport { ngfBackground } from './file-upload/ngfBackground.directive';\nexport { ngfSrc } from './file-upload/ngfSrc.directive';\nexport { ngfUploadStatus } from './file-upload/ngfUploadStatus.directive';\nexport { ngfFormData } from './file-upload/ngfFormData.directive';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["EventEmitter","Directive","ElementRef","Input","Output","HostListener","IterableDiffers","NgModule","CommonModule"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;IAcA;IAEA,IAAI,aAAa,GAAG,UAAS,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,MAAM,CAAC,cAAc;aAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;oBAAE,CAAC,CA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,aAAa;QACb,MAAM;QACN,eAAe;QACf,WAAW;QACX,GAAG;KACJ,CAAA;;QASE;;;;;gBAPFI,aAAQ,SAAC;oBACR,OAAO,EAAE;wBACPC,mBAAY;;qBAEb;oBACD,YAAY,EAAE,YAAY;oBAC1B,OAAO,EAAE,YAAY;iBACtB;;;IC7BD;;;;ICAA;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/bundles/angular-file.umd.min.js b/bundles/angular-file.umd.min.js index 1cd8ebdd..fc2ce038 100644 --- a/bundles/angular-file.umd.min.js +++ b/bundles/angular-file.umd.min.js @@ -12,5 +12,5 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function r(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,a=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)s.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return s}function s(){for(var e=[],t=0;t4?r.height:r.width,i.height=t.orientation>4?r.width:r.height;var n=i.getContext("2d");!function(e,t,n,i){switch(t){case 2:return e.transform(-1,0,0,1,n,0);case 3:return e.transform(-1,0,0,-1,n,i);case 4:return e.transform(1,0,0,-1,0,i);case 5:return e.transform(0,1,1,0,0,0);case 6:return e.transform(0,1,-1,0,i,0);case 7:return e.transform(0,-1,-1,0,i,n);case 8:e.transform(0,-1,1,0,0,n)}}(n,t.orientation,r.width,r.height),n.drawImage(r,0,0);var o=i.toDataURL(e.type||"image/WebP",.934),l=function(e){for(var t="",n=new Uint8Array(e),i=n.byteLength,r=0;r>2,r=(3&t)<<4|(n=e[u++])>>4,a=(15&n)<<2|(o=e[u++])>>6,l=63&o,isNaN(n)?a=l=64:isNaN(o)&&(l=64),s=s+this.KEY_STR.charAt(i)+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(l),t=n=o="",i=r=a=l=""}while(ue.length)break}return n},decode64:function(e){var t,n,i,r,a="",s="",o=0,l=[];/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.log("There were invalid base64 characters in the input text."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{t=this.KEY_STR.indexOf(e.charAt(o++))<<2|(i=this.KEY_STR.indexOf(e.charAt(o++)))>>4,n=(15&i)<<4|(r=this.KEY_STR.indexOf(e.charAt(o++)))>>2,a=(3&r)<<6|(s=this.KEY_STR.indexOf(e.charAt(o++))),l.push(t),64!==r&&l.push(n),64!==s&&l.push(a),t=n=a="",i=r=s=""}while(o=2&&f<=8&&(i.setUint16(a+12*u+8,1,o),n.fixedArrayBuffer=e.target.result),n.orientation=f,t(n)}}else{if(65280!=(65280&s))break;a+=i.getUint16(a,!1)}}return t(n)}}))}(e).then((function(t){return t.orientation<2||t.orientation>8?e:p(e,t)}))}function c(e,t){if(!e)return Promise.resolve(e);if(t&&null!=e.$ngfDataUrl||!t&&null!=e.$ngfBlobUrl)return Promise.resolve(t?e.$ngfDataUrl:e.$ngfBlobUrl);var n=t?e.$$ngfDataUrlPromise:e.$$ngfBlobUrlPromise;if(n)return n;var i,r=window;if(!r.FileReader||!e||r.FileAPI&&-1!==navigator.userAgent.indexOf("MSIE 8")&&!(e.size<2e4)||r.FileAPI&&-1!==navigator.userAgent.indexOf("MSIE 9")&&!(e.size<4e6))return e[t?"$ngfDataUrl":"$ngfBlobUrl"]="",Promise.reject(new Error("Browser does not support window.FileReader, window.FileReader, or window.FileAPI"));var a=r.URL||r.webkitURL;if(FileReader)i=new Promise((function(t,n){var i=new FileReader;i.onload=function(n){e.$ngfDataUrl=n.target.result,delete e.$ngfDataUrl,t(n.target.result)},i.onerror=function(t){e.$ngfDataUrl="",n(t)},i.readAsDataURL(e)}));else{var s;try{s=a.createObjectURL(e)}catch(e){return Promise.reject(e)}i=Promise.resolve(s),e.$ngfBlobUrl=s}return n=(n=t?e.$$ngfDataUrlPromise=i:e.$$ngfBlobUrlPromise=i).then((function(n){return delete e[t?"$$ngfDataUrlPromise":"$$ngfBlobUrlPromise"],n}))}var g=function(){function e(e){this.element=e,this.filters=[],this.lastFileCount=0,this.ngfFixOrientation=!0,this.fileDropDisabled=!1,this.selectable=!1,this.directiveInit=new t.EventEmitter,this.lastInvalids=[],this.lastInvalidsChange=new t.EventEmitter,this.lastBaseUrlChange=new t.EventEmitter,this.fileChange=new t.EventEmitter,this.files=[],this.filesChange=new t.EventEmitter,this.initFilters()}return e.prototype.initFilters=function(){this.filters.push({name:"accept",fn:this._acceptFilter}),this.filters.push({name:"fileSize",fn:this._fileSizeFilter})},e.prototype.ngOnDestroy=function(){delete this.fileElm,this.destroyPasteListener()},e.prototype.ngOnInit=function(){var e=this;(this.selectable||""===this.selectable)&&!["false","null","0"].includes(this.selectable)&&this.enableSelecting(),this.multiple&&this.paramFileElm().setAttribute("multiple",this.multiple),this.evalCapturePaste(),setTimeout((function(){e.directiveInit.emit(e)}),0)},e.prototype.ngOnChanges=function(e){e.accept&&this.paramFileElm().setAttribute("accept",e.accept.currentValue||"*"),e.capturePaste&&this.evalCapturePaste()},e.prototype.evalCapturePaste=function(){var e=this;if(this.capturePaste||""===this.capturePaste||["false","0","null"].includes(this.capturePaste)){if(this.pasteCapturer)return;return this.pasteCapturer=function(t){var n=t.clipboardData;n&&n.files&&(e.handleFiles(n.files),t.preventDefault())},void window.addEventListener("paste",this.pasteCapturer)}this.destroyPasteListener()},e.prototype.destroyPasteListener=function(){this.pasteCapturer&&(window.removeEventListener("paste",this.pasteCapturer),delete this.pasteCapturer)},e.prototype.paramFileElm=function(){if(this.fileElm)return this.fileElm;if(o(this.element.nativeElement))return this.fileElm=this.element.nativeElement;var e=function(){var e=f(),t=document.createElement("label");return t.innerHTML="upload",t.style.visibility="hidden",t.style.position="absolute",t.style.overflow="hidden",t.style.width="0px",t.style.height="0px",t.style.border="none",t.style.margin="0px",t.style.padding="0px",t.setAttribute("tabindex","-1"),t.appendChild(e),t}();return this.fileElm=e.getElementsByTagName("input")[0],this.fileElm.addEventListener("change",this.changeFn.bind(this)),this.element.nativeElement.appendChild(e),this.fileElm},e.prototype.enableSelecting=function(){var e=this,t=this.element.nativeElement;if(o(t)){var n=function(t){return e.beforeSelect()};return t.addEventListener("click",n),void t.addEventListener("touchstart",n)}var i=function(t){return e.clickHandler(t)};t.addEventListener("click",i),t.addEventListener("touchstart",i),t.addEventListener("touchend",i)},e.prototype.getValidFiles=function(e){for(var t=[],n=e.length-1;n>=0;--n)this.isFileValid(e[n])&&t.push(e[n]);return t},e.prototype.getInvalidFiles=function(e){for(var t=[],n=e.length-1;n>=0;--n){var i=this.getFileFilterFailName(e[n]);i&&t.push({file:e[n],type:i})}return t},e.prototype.handleFiles=function(e){var t=this,n=this.getValidFiles(e);e.length!=n.length?this.lastInvalids=this.getInvalidFiles(e):delete this.lastInvalids,this.lastInvalidsChange.emit(this.lastInvalids),n.length&&(this.ngfFixOrientation?this.applyExifRotations(n).then((function(e){return t.que(e)})):this.que(n)),this.isEmptyAfterSelection()&&(this.element.nativeElement.value="")},e.prototype.que=function(e){var t=this;this.files=this.files||[],Array.prototype.push.apply(this.files,e),this.filesChange.emit(this.files),e.length&&(this.fileChange.emit(this.file=e[0]),this.lastBaseUrlChange.observers.length&&c(e[0]).then((function(e){return t.lastBaseUrlChange.emit(e)}))),this.lastFileCount=this.files.length},e.prototype.changeFn=function(e){var t=e.__files_||e.target&&e.target.files;t&&(this.stopEvent(e),this.handleFiles(t))},e.prototype.clickHandler=function(e){if(this.element.nativeElement.getAttribute("disabled")||this.fileDropDisabled)return!1;var t=function(e){var t=e.changedTouches||e.originalEvent&&e.originalEvent.changedTouches;if(t){if("touchstart"===e.type)return u=t[0].clientX,l=t[0].clientY,!0;if("touchend"===e.type){var n=t[0].clientX,i=t[0].clientY;if(Math.abs(n-u)>20||Math.abs(i-l)>20)return e.stopPropagation(),e.cancelable&&e.preventDefault(),!1}return!0}return!1}(e);return!1!==t?t:(this.paramFileElm().click(),this.beforeSelect(),!1)},e.prototype.beforeSelect=function(){this.files&&this.lastFileCount===this.files.length||(this.fileElm.value=null)},e.prototype.isEmptyAfterSelection=function(){return!!this.element.nativeElement.attributes.multiple},e.prototype.eventToTransfer=function(e){return e.dataTransfer?e.dataTransfer:e.originalEvent?e.originalEvent.dataTransfer:null},e.prototype.stopEvent=function(e){e.preventDefault(),e.stopPropagation()},e.prototype.transferHasFiles=function(e){return!!e.types&&(e.types.indexOf?-1!==e.types.indexOf("Files"):!!e.types.contains&&e.types.contains("Files"))},e.prototype.eventToFiles=function(e){var t=this.eventToTransfer(e);if(t){if(t.files&&t.files.length)return t.files;if(t.items&&t.items.length)return t.items}return[]},e.prototype.applyExifRotations=function(e){for(var t=function(t,n){return h(t).then((function(t){return e.splice(n,1,t)}))},n=[],i=e.length-1;i>=0;--i)n[i]=t(e[i],i);return Promise.all(n).then((function(){return e}))},e.prototype.onChange=function(e){var t=this.element.nativeElement.files||this.eventToFiles(e);t.length&&(this.stopEvent(e),this.handleFiles(t))},e.prototype.getFileFilterFailName=function(e){for(var t=0;t=0;--t)if(!this.isFileValid(e[t]))return!1;return!0},e.prototype._acceptFilter=function(e){return function(e,t,n){if(!e)return!0;for(var i,r,a=e.split(","),s=a.length-1;s>=0;--s){if(r=(r=(r=a[s]).replace(/(^\s+|\s+$)/g,"")).replace(/\*/g,".*"),i=new RegExp(r,"gi"),t.search(i)>=0)return!0;if("."==r.substring(0,1)&&(r="\\"+r,i=new RegExp(r+"$","i"),(n||t).search(i)>=0))return!0}return!1}(this.accept,e.type,e.name)},e.prototype._fileSizeFilter=function(e){return!(this.maxSize&&e.size>this.maxSize)},e.prototype.filesToWriteableObject=function(e){for(var t=[],n=0;n0)&&!(i=a.next()).done;)s.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return s}function s(){for(var e=[],t=0;t4?r.height:r.width,i.height=t.orientation>4?r.width:r.height;var n=i.getContext("2d");!function(e,t,n,i){switch(t){case 2:return e.transform(-1,0,0,1,n,0);case 3:return e.transform(-1,0,0,-1,n,i);case 4:return e.transform(1,0,0,-1,0,i);case 5:return e.transform(0,1,1,0,0,0);case 6:return e.transform(0,1,-1,0,i,0);case 7:return e.transform(0,-1,-1,0,i,n);case 8:e.transform(0,-1,1,0,0,n)}}(n,t.orientation,r.width,r.height),n.drawImage(r,0,0);var o=i.toDataURL(e.type||"image/WebP",.934),l=function(e){for(var t="",n=new Uint8Array(e),i=n.byteLength,r=0;r>2,r=(3&t)<<4|(n=e[u++])>>4,a=(15&n)<<2|(o=e[u++])>>6,l=63&o,isNaN(n)?a=l=64:isNaN(o)&&(l=64),s=s+this.KEY_STR.charAt(i)+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(l),t=n=o="",i=r=a=l=""}while(ue.length)break}return n},decode64:function(e){var t,n,i,r,a="",s="",o=0,l=[];/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.log("There were invalid base64 characters in the input text."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{t=this.KEY_STR.indexOf(e.charAt(o++))<<2|(i=this.KEY_STR.indexOf(e.charAt(o++)))>>4,n=(15&i)<<4|(r=this.KEY_STR.indexOf(e.charAt(o++)))>>2,a=(3&r)<<6|(s=this.KEY_STR.indexOf(e.charAt(o++))),l.push(t),64!==r&&l.push(n),64!==s&&l.push(a),t=n=a="",i=r=s=""}while(o=2&&f<=8&&(i.setUint16(a+12*u+8,1,o),n.fixedArrayBuffer=e.target.result),n.orientation=f,t(n)}}else{if(65280!=(65280&s))break;a+=i.getUint16(a,!1)}}return t(n)}}))}(e).then((function(t){return t.orientation<2||t.orientation>8?e:p(e,t)}))}function c(e,t){if(!e)return Promise.resolve(e);if(t&&null!=e.$ngfDataUrl||!t&&null!=e.$ngfBlobUrl)return Promise.resolve(t?e.$ngfDataUrl:e.$ngfBlobUrl);var n=t?e.$$ngfDataUrlPromise:e.$$ngfBlobUrlPromise;if(n)return n;var i,r=window;if(!r.FileReader||!e||r.FileAPI&&-1!==navigator.userAgent.indexOf("MSIE 8")&&!(e.size<2e4)||r.FileAPI&&-1!==navigator.userAgent.indexOf("MSIE 9")&&!(e.size<4e6))return e[t?"$ngfDataUrl":"$ngfBlobUrl"]="",Promise.reject(new Error("Browser does not support window.FileReader, window.FileReader, or window.FileAPI"));var a=r.URL||r.webkitURL;if(FileReader)i=new Promise((function(t,n){var i=new FileReader;i.onload=function(n){e.$ngfDataUrl=n.target.result,delete e.$ngfDataUrl,t(n.target.result)},i.onerror=function(t){e.$ngfDataUrl="",n(t)},i.readAsDataURL(e)}));else{var s;try{s=a.createObjectURL(e)}catch(e){return Promise.reject(e)}i=Promise.resolve(s),e.$ngfBlobUrl=s}return n=(n=t?e.$$ngfDataUrlPromise=i:e.$$ngfBlobUrlPromise=i).then((function(n){return delete e[t?"$$ngfDataUrlPromise":"$$ngfBlobUrlPromise"],n}))}var g=function(){function e(e){this.element=e,this.filters=[],this.lastFileCount=0,this.ngfFixOrientation=!0,this.fileDropDisabled=!1,this.selectable=!1,this.directiveInit=new t.EventEmitter,this.lastInvalids=[],this.lastInvalidsChange=new t.EventEmitter,this.lastBaseUrlChange=new t.EventEmitter,this.fileChange=new t.EventEmitter,this.files=[],this.filesChange=new t.EventEmitter,this.initFilters()}return e.prototype.initFilters=function(){this.filters.push({name:"accept",fn:this._acceptFilter}),this.filters.push({name:"fileSize",fn:this._fileSizeFilter})},e.prototype.ngOnDestroy=function(){delete this.fileElm,this.destroyPasteListener()},e.prototype.ngOnInit=function(){var e=this;(this.selectable||""===this.selectable)&&!["false","null","0"].includes(this.selectable)&&this.enableSelecting(),this.multiple&&this.paramFileElm().setAttribute("multiple",this.multiple),this.evalCapturePaste(),setTimeout((function(){e.directiveInit.emit(e)}),0)},e.prototype.ngOnChanges=function(e){e.accept&&this.paramFileElm().setAttribute("accept",e.accept.currentValue||"*"),e.capturePaste&&this.evalCapturePaste()},e.prototype.evalCapturePaste=function(){var e=this;if(this.capturePaste||""===this.capturePaste||["false","0","null"].includes(this.capturePaste)){if(this.pasteCapturer)return;return this.pasteCapturer=function(t){var n=t.clipboardData;n&&n.files&&n.files.length&&(e.handleFiles(n.files),t.preventDefault())},void window.addEventListener("paste",this.pasteCapturer)}this.destroyPasteListener()},e.prototype.destroyPasteListener=function(){this.pasteCapturer&&(window.removeEventListener("paste",this.pasteCapturer),delete this.pasteCapturer)},e.prototype.paramFileElm=function(){if(this.fileElm)return this.fileElm;if(o(this.element.nativeElement))return this.fileElm=this.element.nativeElement;var e=function(){var e=f(),t=document.createElement("label");return t.innerHTML="upload",t.style.visibility="hidden",t.style.position="absolute",t.style.overflow="hidden",t.style.width="0px",t.style.height="0px",t.style.border="none",t.style.margin="0px",t.style.padding="0px",t.setAttribute("tabindex","-1"),t.appendChild(e),t}();return this.fileElm=e.getElementsByTagName("input")[0],this.fileElm.addEventListener("change",this.changeFn.bind(this)),this.element.nativeElement.appendChild(e),this.fileElm},e.prototype.enableSelecting=function(){var e=this,t=this.element.nativeElement;if(o(t)){var n=function(t){return e.beforeSelect()};return t.addEventListener("click",n),void t.addEventListener("touchstart",n)}var i=function(t){return e.clickHandler(t)};t.addEventListener("click",i),t.addEventListener("touchstart",i),t.addEventListener("touchend",i)},e.prototype.getValidFiles=function(e){for(var t=[],n=e.length-1;n>=0;--n)this.isFileValid(e[n])&&t.push(e[n]);return t},e.prototype.getInvalidFiles=function(e){for(var t=[],n=e.length-1;n>=0;--n){var i=this.getFileFilterFailName(e[n]);i&&t.push({file:e[n],type:i})}return t},e.prototype.handleFiles=function(e){var t=this,n=this.getValidFiles(e);e.length!=n.length?this.lastInvalids=this.getInvalidFiles(e):delete this.lastInvalids,this.lastInvalidsChange.emit(this.lastInvalids),n.length&&(this.ngfFixOrientation?this.applyExifRotations(n).then((function(e){return t.que(e)})):this.que(n)),this.isEmptyAfterSelection()&&(this.element.nativeElement.value="")},e.prototype.que=function(e){var t=this;this.files=this.files||[],Array.prototype.push.apply(this.files,e),this.filesChange.emit(this.files),e.length&&(this.fileChange.emit(this.file=e[0]),this.lastBaseUrlChange.observers.length&&c(e[0]).then((function(e){return t.lastBaseUrlChange.emit(e)}))),this.lastFileCount=this.files.length},e.prototype.changeFn=function(e){var t=e.__files_||e.target&&e.target.files;t&&(this.stopEvent(e),this.handleFiles(t))},e.prototype.clickHandler=function(e){if(this.element.nativeElement.getAttribute("disabled")||this.fileDropDisabled)return!1;var t=function(e){var t=e.changedTouches||e.originalEvent&&e.originalEvent.changedTouches;if(t){if("touchstart"===e.type)return u=t[0].clientX,l=t[0].clientY,!0;if("touchend"===e.type){var n=t[0].clientX,i=t[0].clientY;if(Math.abs(n-u)>20||Math.abs(i-l)>20)return e.stopPropagation(),e.cancelable&&e.preventDefault(),!1}return!0}return!1}(e);return!1!==t?t:(this.paramFileElm().click(),this.beforeSelect(),!1)},e.prototype.beforeSelect=function(){this.files&&this.lastFileCount===this.files.length||(this.fileElm.value=null)},e.prototype.isEmptyAfterSelection=function(){return!!this.element.nativeElement.attributes.multiple},e.prototype.eventToTransfer=function(e){return e.dataTransfer?e.dataTransfer:e.originalEvent?e.originalEvent.dataTransfer:null},e.prototype.stopEvent=function(e){e.preventDefault(),e.stopPropagation()},e.prototype.transferHasFiles=function(e){return!!e.types&&(e.types.indexOf?-1!==e.types.indexOf("Files"):!!e.types.contains&&e.types.contains("Files"))},e.prototype.eventToFiles=function(e){var t=this.eventToTransfer(e);if(t){if(t.files&&t.files.length)return t.files;if(t.items&&t.items.length)return t.items}return[]},e.prototype.applyExifRotations=function(e){for(var t=function(t,n){return h(t).then((function(t){return e.splice(n,1,t)}))},n=[],i=e.length-1;i>=0;--i)n[i]=t(e[i],i);return Promise.all(n).then((function(){return e}))},e.prototype.onChange=function(e){var t=this.element.nativeElement.files||this.eventToFiles(e);t.length&&(this.stopEvent(e),this.handleFiles(t))},e.prototype.getFileFilterFailName=function(e){for(var t=0;t=0;--t)if(!this.isFileValid(e[t]))return!1;return!0},e.prototype._acceptFilter=function(e){return function(e,t,n){if(!e)return!0;for(var i,r,a=e.split(","),s=a.length-1;s>=0;--s){if(r=(r=(r=a[s]).replace(/(^\s+|\s+$)/g,"")).replace(/\*/g,".*"),i=new RegExp(r,"gi"),t.search(i)>=0)return!0;if("."==r.substring(0,1)&&(r="\\"+r,i=new RegExp(r+"$","i"),(n||t).search(i)>=0))return!0}return!1}(this.accept,e.type,e.name)},e.prototype._fileSizeFilter=function(e){return!(this.maxSize&&e.size>this.maxSize)},e.prototype.filesToWriteableObject=function(e){for(var t=[],n=0;n= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","export const isFileInput = function(elm:any){\n const ty = elm.getAttribute('type')\n return elm.tagName.toLowerCase() === 'input' && ty && ty.toLowerCase() === 'file';\n}\n\nlet initialTouchStartY = 0;\nlet initialTouchStartX = 0;\nexport const detectSwipe = function(evt:any):boolean {\n var touches = evt.changedTouches || (evt.originalEvent && evt.originalEvent.changedTouches);\n if (touches) {\n if (evt.type === 'touchstart') {\n initialTouchStartX = touches[0].clientX;\n initialTouchStartY = touches[0].clientY;\n return true; // don't block event default\n } else {\n // prevent scroll from triggering event\n if (evt.type === 'touchend') {\n var currentX = touches[0].clientX;\n var currentY = touches[0].clientY;\n if ((Math.abs(currentX - initialTouchStartX) > 20) ||\n (Math.abs(currentY - initialTouchStartY) > 20)) {\n evt.stopPropagation();\n if (evt.cancelable) {\n evt.preventDefault();\n }\n return false;\n }\n }\n return true;\n }\n }\n return false\n}\n\nexport const createInvisibleFileInputWrap = function() {\n var fileElem = createFileInput()\n var label = document.createElement('label');\n label.innerHTML = 'upload'\n label.style.visibility = 'hidden'\n label.style.position = 'absolute'\n label.style.overflow = 'hidden'\n label.style.width = '0px'\n label.style.height = '0px'\n label.style.border = 'none'\n label.style.margin = '0px'\n label.style.padding = '0px'\n label.setAttribute('tabindex','-1')\n \n //bindAttrToFileInput(fileElem, label);\n //generatedElems.push({el: elem, ref: label});\n\n label.appendChild( fileElem )\n //document.body.appendChild( label );\n\n return label;\n}\n\nexport const createFileInput = function() {\n var fileElem = document.createElement('input');\n fileElem.type=\"file\"\n return fileElem;\n}\n","export function getWindow():any{return window}\n\nexport function acceptType(accept:string, type:string, name?:string):boolean { \n if( !accept ){\n return true\n }\n\n const defs = accept.split(',')\n let regx:RegExp\n let acceptRegString:string\n\n for(let x=defs.length-1; x >= 0; --x){\n //Escapes dots in mimetype \n acceptRegString = defs[x]\n //trim\n acceptRegString = acceptRegString.replace(/(^\\s+|\\s+$)/g,'')\n //Escapes stars in mimetype \n acceptRegString = acceptRegString.replace(/\\*/g,'.*')\n //let acceptReg = '^((' + acceptRegString\n //acceptReg = acceptReg.replace(/,/g,')|(') + '))$'\n \n //try by mime\n regx = new RegExp(acceptRegString, 'gi')\n if( type.search(regx)>=0 ){\n return true\n }\n\n //try by ext\n if( acceptRegString.substring(0, 1)=='.' ){ \n acceptRegString = '\\\\'+ acceptRegString//.substring(1, acceptRegString.length-1)//remove dot at front\n regx = new RegExp(acceptRegString+'$', 'i')\n if( (name||type).search(regx)>=0 ){\n return true\n }\n }\n }\n return false\n}\n\nexport interface InvalidFileItem{\n file:File\n type:string\n}\n\nexport function arrayBufferToBase64(buffer:any) {\n var binary = '';\n var bytes = new Uint8Array(buffer);\n var len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return window.btoa(binary);\n}\n\nexport function dataUrltoBlob(\n dataurl:string,\n name:string,\n origSize?:any\n):Blob{\n var arr = dataurl.split(',');\n var mimeMatch = arr[0].match(/:(.*?);/)\n var mime:string = mimeMatch ? mimeMatch[1] : 'text/plain'\n var bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n var blob = new window.Blob([u8arr], {type: mime});\n blob[\"name\"] = name;\n blob[\"$ngfOrigSize\"] = origSize;\n return blob;\n}\n\nexport interface orientationMeta{\n orientation: number\n fixedArrayBuffer?:any[]\n}\n\nexport function applyTransform(\n ctx:CanvasRenderingContext2D,\n orientation:number,\n width:number,\n height:number\n) {\n switch (orientation) {\n case 2:\n return ctx.transform(-1, 0, 0, 1, width, 0);\n case 3:\n return ctx.transform(-1, 0, 0, -1, width, height);\n case 4:\n return ctx.transform(1, 0, 0, -1, 0, height);\n case 5:\n return ctx.transform(0, 1, 1, 0, 0, 0);\n case 6:\n return ctx.transform(0, 1, -1, 0, height, 0);\n case 7:\n return ctx.transform(0, -1, -1, 0, height, width);\n case 8:\n return ctx.transform(0, -1, 1, 0, 0, width);\n }\n}\n\nexport function fixFileOrientationByMeta(\n file:File, result:orientationMeta\n):Promise{\n return dataUrl(file, true)\n .then(url=>{\n var canvas = document.createElement('canvas');\n var img = document.createElement('img');\n\n return >new Promise(function(res,rej){\n img.onload = function () {\n try {\n canvas.width = result.orientation > 4 ? img.height : img.width\n canvas.height = result.orientation > 4 ? img.width : img.height\n var ctx = canvas.getContext('2d')\n applyTransform(ctx, result.orientation, img.width, img.height)\n ctx.drawImage(img, 0, 0);\n var dataUrl = canvas.toDataURL(file.type || 'image/WebP', 0.934)\n const base = arrayBufferToBase64(result.fixedArrayBuffer)\n dataUrl = restoreExif(base, dataUrl)\n var blob = dataUrltoBlob(dataUrl, file.name)\n const newFile = blobToFile(blob, file.name);\n res(newFile);\n } catch (e) {\n rej(e)\n }\n };\n img.onerror = rej;\n img.src = url; \n })\n })\n}\n\nexport function applyExifRotation(\n file:File\n):Promise{\n if (file.type.indexOf('image/jpeg') !== 0) {\n return Promise.resolve(file);\n }\n\n return readOrientation(file)\n .then((result:orientationMeta)=>{\n if (result.orientation < 2 || result.orientation > 8) {\n return file\n }\n \n return fixFileOrientationByMeta(file,result)\n })\n}\n\nexport function readOrientation(\n file:File\n):Promise{\n return new Promise((res,rej)=>{\n var reader = new FileReader();\n var slicedFile = file.slice ? file.slice(0, 64 * 1024) : file;\n reader.readAsArrayBuffer(slicedFile);\n reader.onerror = rej\n reader.onload = function (e:any) {\n var result:orientationMeta = {orientation: 1};\n var view = new DataView( this.result );\n if (view.getUint16(0, false) !== 0xFFD8) return res(result);\n\n var length = view.byteLength,\n offset = 2;\n while (offset < length) {\n var marker = view.getUint16(offset, false);\n offset += 2;\n if (marker === 0xFFE1) {\n if (view.getUint32(offset += 2, false) !== 0x45786966) return res(result);\n\n var little = view.getUint16(offset += 6, false) === 0x4949;\n offset += view.getUint32(offset + 4, little);\n var tags = view.getUint16(offset, little);\n offset += 2;\n for (var i = 0; i < tags; i++)\n if (view.getUint16(offset + (i * 12), little) === 0x0112) {\n var orientation = view.getUint16(offset + (i * 12) + 8, little);\n if (orientation >= 2 && orientation <= 8) {\n view.setUint16(offset + (i * 12) + 8, 1, little);\n result.fixedArrayBuffer = e.target.result;\n }\n result.orientation = orientation;\n return res(result);\n }\n } else if ((marker & 0xFF00) !== 0xFF00) break;\n else offset += view.getUint16(offset, false);\n }\n return res(result);\n };\n })\n}\n\n/** converts file-input file into base64 dataUri */\nexport function dataUrl(\n file:any,\n disallowObjectUrl?:any\n):Promise{\n if (!file) return Promise.resolve(file)\n \n if ((disallowObjectUrl && file.$ngfDataUrl != null) || (!disallowObjectUrl && file.$ngfBlobUrl != null)) {\n return Promise.resolve( disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl )\n }\n\n var p = disallowObjectUrl ? file.$$ngfDataUrlPromise : file.$$ngfBlobUrlPromise;\n if (p) return p;\n\n const win = getWindow()\n let deferred:Promise\n if (win.FileReader && file &&\n (!win.FileAPI || navigator.userAgent.indexOf('MSIE 8') === -1 || file.size < 20000) &&\n (!win.FileAPI || navigator.userAgent.indexOf('MSIE 9') === -1 || file.size < 4000000)) {\n //prefer URL.createObjectURL for handling refrences to files of all sizes\n //since it doesn´t build a large string in memory\n var URL = win.URL || win.webkitURL;\n if (FileReader) {\n deferred = new Promise((res,rej)=>{\n var fileReader = new FileReader();\n fileReader.onload = function (event:any) {\n file.$ngfDataUrl = event.target.result;\n delete file.$ngfDataUrl;\n res( event.target.result )\n };\n fileReader.onerror = function (e) {\n file.$ngfDataUrl = '';\n rej(e)\n };\n fileReader.readAsDataURL(file);\n })\n } else {\n var url:any;\n try {\n url = URL.createObjectURL(file);\n } catch (e) {\n return Promise.reject(e);\n }\n \n deferred = Promise.resolve( url )\n file.$ngfBlobUrl = url;\n }\n } else {\n file[disallowObjectUrl ? '$ngfDataUrl' : '$ngfBlobUrl'] = '';\n return Promise.reject( new Error('Browser does not support window.FileReader, window.FileReader, or window.FileAPI') )//deferred.reject();\n }\n\n if (disallowObjectUrl) {\n p = file.$$ngfDataUrlPromise = deferred;\n } else {\n p = file.$$ngfBlobUrlPromise = deferred;\n }\n\n p = p.then((x:any)=>{\n delete file[disallowObjectUrl ? '$$ngfDataUrlPromise' : '$$ngfBlobUrlPromise'];\n return x\n })\n\n return p;\n}\n\nexport function restoreExif(orig:any, resized:any) {\n var ExifRestorer:any = {\n KEY_STR:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n }\n\n ExifRestorer.encode64 = function (input:any) {\n var output = '',\n chr1, chr2, chr3:any = '',\n enc1, enc2, enc3, enc4:any = '',\n i = 0;\n\n do {\n chr1 = input[i++];\n chr2 = input[i++];\n chr3 = input[i++];\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output +\n this.KEY_STR.charAt(enc1) +\n this.KEY_STR.charAt(enc2) +\n this.KEY_STR.charAt(enc3) +\n this.KEY_STR.charAt(enc4);\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n } while (i < input.length);\n\n return output;\n };\n\n ExifRestorer.restore = function (origFileBase64:any, resizedFileBase64:any) {\n if (origFileBase64.match('data:image/jpeg;base64,')) {\n origFileBase64 = origFileBase64.replace('data:image/jpeg;base64,', '');\n }\n\n var rawImage:number[] = this.decode64(origFileBase64);\n var segments = this.slice2Segments(rawImage);\n\n var image = this.exifManipulation(resizedFileBase64, segments);\n\n return 'data:image/jpeg;base64,' + this.encode64(image);\n };\n\n\n ExifRestorer.exifManipulation = function (resizedFileBase64:any, segments:any) {\n var exifArray = this.getExifArray(segments),\n newImageArray = this.insertExif(resizedFileBase64, exifArray);\n return new Uint8Array(newImageArray);\n };\n\n ExifRestorer.getExifArray = function (segments:number[][]) {\n var seg;\n for (var x = 0; x < segments.length; x++) {\n seg = segments[x];\n if (seg[0] === 255 && seg[1] === 225) //(ff e1)\n {\n return seg;\n }\n }\n return [];\n };\n\n\n ExifRestorer.insertExif = function (resizedFileBase64:any, exifArray:any) {\n var imageData = resizedFileBase64.replace('data:image/jpeg;base64,', ''),\n buf = this.decode64(imageData),\n separatePoint = buf.indexOf(255, 3),\n mae = buf.slice(0, separatePoint),\n ato = buf.slice(separatePoint),\n array = mae;\n\n array = array.concat(exifArray);\n array = array.concat(ato);\n return array;\n };\n\n\n ExifRestorer.slice2Segments = function(\n rawImageArray:number[]\n ) {\n var head:number = 0,\n segments:number[][] = [];\n\n while (1) {\n if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 218) {\n break;\n }\n if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 216) {\n head += 2;\n }\n else {\n var length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3]\n var endPoint = head + length + 2\n var seg:number[] = rawImageArray.slice(head, endPoint)\n segments.push(seg);\n head = endPoint;\n }\n if (head > rawImageArray.length) {\n break;\n }\n }\n\n return segments;\n };\n\n\n ExifRestorer.decode64 = function (\n input:any\n ):number[]{\n var chr1, chr2, chr3:any = '',\n enc1, enc2, enc3, enc4:any = '',\n i = 0,\n buf:number[] = [];\n\n // remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n var base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n if (base64test.exec(input)) {\n console.log('There were invalid base64 characters in the input text.');\n }\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n\n do {\n enc1 = this.KEY_STR.indexOf(input.charAt(i++));\n enc2 = this.KEY_STR.indexOf(input.charAt(i++));\n enc3 = this.KEY_STR.indexOf(input.charAt(i++));\n enc4 = this.KEY_STR.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n buf.push(chr1);\n\n if (enc3 !== 64) {\n buf.push(chr2);\n }\n if (enc4 !== 64) {\n buf.push(chr3);\n }\n\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n\n } while (i < input.length);\n\n return buf;\n };\n\n return ExifRestorer.restore(orig, resized); //<= EXIF\n};\n\nfunction blobToFile(theBlob: Blob, fileName:string): File {\n var b: any = theBlob;\n //A Blob() is almost a File() - it's just missing the two properties below which we will add\n b.lastModifiedDate = new Date();\n b.name = fileName;\n\n //Cast to a File() type\n return theBlob;\n}\n","import { Directive, EventEmitter, ElementRef, Input, Output, HostListener, ChangeDetectionStrategy } from '@angular/core';\nimport { createInvisibleFileInputWrap, isFileInput, detectSwipe } from \"./doc-event-help.functions\"\nimport {\n acceptType, InvalidFileItem,\n applyExifRotation, dataUrl\n} from \"./fileTools\"\n\nexport interface dragMeta{\n type:string\n kind:string\n}\n\n/** A master base set of logic intended to support file select/drag/drop operations\n NOTE: Use ngfDrop for full drag/drop. Use ngfSelect for selecting\n*/\n@Directive({\n selector: \"[ngf]\",\n exportAs:\"ngf\"\n})\nexport class ngf {\n fileElm:any\n filters:{name:string, fn:(file:File)=>boolean}[] = []\n lastFileCount:number=0\n\n @Input() multiple !:string\n @Input() accept !:string\n @Input() maxSize !:number\n //@Input() forceFilename:string\n //@Input() forcePostname:string\n @Input() ngfFixOrientation:boolean = true\n\n @Input() fileDropDisabled:boolean = false\n @Input() selectable: boolean | string = false\n @Output('init') directiveInit:EventEmitter = new EventEmitter()\n\n @Input() lastInvalids:InvalidFileItem[] = []\n @Output() lastInvalidsChange:EventEmitter<{file:File,type:string}[]> = new EventEmitter()\n\n @Input() lastBaseUrl !: string//base64 last file uploaded url\n @Output() lastBaseUrlChange:EventEmitter = new EventEmitter()\n\n @Input() file !: File//last file uploaded\n @Output() fileChange:EventEmitter = new EventEmitter()\n\n @Input() files:File[] = []\n @Output() filesChange:EventEmitter = new EventEmitter();\n\n @Input() capturePaste: boolean; // window paste file watching (empty string turns on)\n pasteCapturer !: (e: Event) => void;\n\n constructor(public element:ElementRef){\n this.initFilters()\n }\n\n initFilters(){\n // the order is important\n this.filters.push({name: 'accept', fn: this._acceptFilter})\n this.filters.push({name: 'fileSize', fn: this._fileSizeFilter})\n\n //this.filters.push({name: 'fileType', fn: this._fileTypeFilter})\n //this.filters.push({name: 'queueLimit', fn: this._queueLimitFilter})\n //this.filters.push({name: 'mimeType', fn: this._mimeTypeFilter})\n }\n\n ngOnDestroy(){\n delete this.fileElm//faster memory release of dom element\n this.destroyPasteListener();\n }\n\n ngOnInit(){\n const selectable = (this.selectable || this.selectable==='') && !['false', 'null', '0'].includes(this.selectable as string);\n if( selectable ){\n this.enableSelecting()\n }\n\n if( this.multiple ){\n this.paramFileElm().setAttribute('multiple', this.multiple)\n }\n\n this.evalCapturePaste();\n\n //create reference to this class with one cycle delay to avoid ExpressionChangedAfterItHasBeenCheckedError\n setTimeout(()=>{\n this.directiveInit.emit(this)\n }, 0)\n }\n\n ngOnChanges( changes ){\n if( changes.accept ){\n this.paramFileElm().setAttribute('accept', changes.accept.currentValue || '*')\n }\n\n if (changes.capturePaste) {\n this.evalCapturePaste();\n }\n }\n\n evalCapturePaste() {\n const isActive = this.capturePaste || (this.capturePaste as any)==='' || ['false', '0', 'null'].includes(this.capturePaste as any);\n\n if (isActive) {\n if (this.pasteCapturer) {\n return; // already listening\n }\n\n this.pasteCapturer = (e: Event) => {\n const clip = (e as any).clipboardData;\n if (clip && clip.files) {\n this.handleFiles(clip.files);\n e.preventDefault();\n }\n }\n\n window.addEventListener('paste', this.pasteCapturer);\n\n return;\n }\n\n this.destroyPasteListener();\n }\n\n destroyPasteListener() {\n if (this.pasteCapturer) {\n window.removeEventListener('paste', this.pasteCapturer);\n delete this.pasteCapturer;\n }\n }\n\n paramFileElm(){\n if( this.fileElm )return this.fileElm//already defined\n\n //elm is a file input\n const isFile = isFileInput( this.element.nativeElement )\n if(isFile)return this.fileElm = this.element.nativeElement\n\n //create foo file input\n const label = createInvisibleFileInputWrap()\n this.fileElm = label.getElementsByTagName('input')[0]\n this.fileElm.addEventListener('change', this.changeFn.bind(this));\n this.element.nativeElement.appendChild( label )\n return this.fileElm\n }\n\n enableSelecting(){\n let elm = this.element.nativeElement\n\n if( isFileInput(elm) ){\n const bindedHandler = _ev=>this.beforeSelect()\n elm.addEventListener('click', bindedHandler)\n elm.addEventListener('touchstart', bindedHandler)\n return\n }\n\n const bindedHandler = ev=>this.clickHandler(ev)\n elm.addEventListener('click', bindedHandler)\n elm.addEventListener('touchstart', bindedHandler)\n elm.addEventListener('touchend', bindedHandler)\n }\n\n getValidFiles( files:File[] ):File[]{\n const rtn:File[] = []\n for(let x=files.length-1; x >= 0; --x){\n if( this.isFileValid(files[x]) ){\n rtn.push( files[x] )\n }\n }\n return rtn\n }\n\n getInvalidFiles(files:File[]):InvalidFileItem[]{\n const rtn:InvalidFileItem[] = []\n for(let x=files.length-1; x >= 0; --x){\n let failReason = this.getFileFilterFailName(files[x])\n if( failReason ){\n rtn.push({\n file : files[x],\n type : failReason\n })\n }\n }\n return rtn\n }\n\n // Primary handler of files coming in\n handleFiles(files:File[]){\n const valids = this.getValidFiles(files)\n\n if(files.length!=valids.length){\n this.lastInvalids = this.getInvalidFiles(files)\n }else{\n delete this.lastInvalids\n }\n\n this.lastInvalidsChange.emit(this.lastInvalids)\n\n if( valids.length ){\n if( this.ngfFixOrientation ){\n this.applyExifRotations(valids)\n .then( fixedFiles=>this.que(fixedFiles) )\n }else{\n this.que(valids)\n }\n }\n\n if (this.isEmptyAfterSelection()) {\n this.element.nativeElement.value = ''\n }\n }\n\n que( files:File[] ){\n this.files = this.files || []\n Array.prototype.push.apply(this.files, files)\n\n //below break memory ref and doesnt act like a que\n //this.files = files//causes memory change which triggers bindings like \n\n this.filesChange.emit( this.files )\n\n if(files.length){\n this.fileChange.emit( this.file=files[0] )\n\n if(this.lastBaseUrlChange.observers.length){\n dataUrl( files[0] )\n .then( url=>this.lastBaseUrlChange.emit(url) )\n }\n }\n\n //will be checked for input value clearing\n this.lastFileCount = this.files.length\n }\n\n /** called when input has files */\n changeFn(event:any) {\n var fileList = event.__files_ || (event.target && event.target.files)\n\n if (!fileList) return;\n\n this.stopEvent(event);\n this.handleFiles(fileList)\n }\n\n clickHandler(evt:any){\n const elm = this.element.nativeElement\n if (elm.getAttribute('disabled') || this.fileDropDisabled){\n return false;\n }\n\n var r = detectSwipe(evt);\n // prevent the click if it is a swipe\n if ( r!==false ) return r;\n\n const fileElm = this.paramFileElm()\n fileElm.click()\n //fileElm.dispatchEvent( new Event('click') );\n this.beforeSelect()\n\n return false;\n }\n\n beforeSelect(){\n if( this.files && this.lastFileCount===this.files.length )return\n\n //if no files in array, be sure browser doesnt prevent reselect of same file (see github issue 27)\n this.fileElm.value = null\n }\n\n isEmptyAfterSelection():boolean {\n return !!this.element.nativeElement.attributes.multiple;\n }\n\n eventToTransfer(event:any):any {\n if(event.dataTransfer)return event.dataTransfer\n return event.originalEvent ? event.originalEvent.dataTransfer : null\n }\n\n stopEvent(event:any):any {\n event.preventDefault();\n event.stopPropagation();\n }\n\n transferHasFiles(transfer:any):any {\n if (!transfer.types) {\n return false;\n }\n\n if (transfer.types.indexOf) {\n return transfer.types.indexOf('Files') !== -1;\n } else if (transfer.types.contains) {\n return transfer.types.contains('Files');\n } else {\n return false;\n }\n }\n\n eventToFiles(event:Event){\n const transfer = this.eventToTransfer(event);\n if( transfer ){\n if(transfer.files && transfer.files.length){\n return transfer.files\n }\n if(transfer.items && transfer.items.length){\n return transfer.items\n }\n }\n return []\n }\n\n applyExifRotations(\n files:File[]\n ):Promise{\n const mapper = (\n file:File,index:number\n ):Promise=>{\n return applyExifRotation(file)\n .then( fixedFile=>files.splice(index, 1, fixedFile) )\n }\n\n const proms:Promise[] = []\n for(let x=files.length-1; x >= 0; --x){\n proms[x] = mapper( files[x], x )\n }\n return Promise.all( proms ).then( ()=>files )\n }\n\n @HostListener('change', ['$event'])\n onChange(event:Event):void {\n let files = this.element.nativeElement.files || this.eventToFiles(event)\n\n if(!files.length)return\n\n this.stopEvent(event);\n this.handleFiles(files)\n }\n\n getFileFilterFailName(\n file:File\n ):string | undefined{\n for(let i = 0; i < this.filters.length; i++){\n if( !this.filters[i].fn.call(this, file) ){\n return this.filters[i].name\n }\n }\n return undefined\n }\n\n isFileValid(file:File):boolean{\n const noFilters = !this.accept && (!this.filters || !this.filters.length)\n if( noFilters ){\n return true//we have no filters so all files are valid\n }\n\n return this.getFileFilterFailName(file) ? false : true\n }\n\n isFilesValid(files:File[]){\n for(let x=files.length-1; x >= 0; --x){\n if( !this.isFileValid(files[x]) ){\n return false\n }\n }\n return true\n }\n\n protected _acceptFilter(item:File):boolean {\n return acceptType(this.accept, item.type, item.name)\n }\n\n protected _fileSizeFilter(item:File):boolean {\n return !(this.maxSize && item.size > this.maxSize);\n }\n\n /** browsers try hard to conceal data about file drags, this tends to undo that */\n filesToWriteableObject( files:File[] ):dragMeta[]{\n const jsonFiles:dragMeta[] = []\n for(let x=0; x < files.length; ++x){\n jsonFiles.push({\n type:files[x].type,\n kind:files[x][\"kind\"]\n })\n }\n return jsonFiles\n }\n}\n","import { Directive, Input } from \"@angular/core\"\nimport { ngf } from \"./ngf.directive\"\n\n@Directive({\n selector: \"[ngfSelect]\",\n exportAs: \"ngfSelect\"\n})\nexport class ngfSelect extends ngf {\n @Input() selectable:any = true\n}","import {\n Directive, EventEmitter,\n HostListener, Input, Output\n} from '@angular/core';\nimport { ngf, dragMeta } from \"./ngf.directive\"\n\n@Directive({\n selector: \"[ngfDrop]\",\n exportAs: \"ngfDrop\"\n})\nexport class ngfDrop extends ngf {\n @Output() fileOver:EventEmitter = new EventEmitter();\n\n @Input() validDrag:boolean = false\n @Output() validDragChange:EventEmitter = new EventEmitter()\n\n @Input() invalidDrag = false\n @Output() invalidDragChange:EventEmitter = new EventEmitter()\n\n @Input() dragFiles !: dragMeta[]\n @Output() dragFilesChange:EventEmitter = new EventEmitter()\n\n @HostListener('drop', ['$event'])\n onDrop(event:Event):void {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n\n this.closeDrags()\n let files = this.eventToFiles(event)\n\n if(!files.length)return\n\n this.stopEvent(event);\n this.handleFiles(files)\n }\n\n handleFiles(files:File[]){\n this.fileOver.emit(false)//turn-off dragover\n super.handleFiles(files)\n }\n\n @HostListener('dragover', ['$event'])\n onDragOver(event:Event):void {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n\n const transfer = this.eventToTransfer(event)\n\n let files = this.eventToFiles(event)\n\n let jsonFiles = this.filesToWriteableObject(files)\n this.dragFilesChange.emit( this.dragFiles=jsonFiles )\n\n if( files.length ){\n this.validDrag = this.isFilesValid(files)\n }else{\n //Safari, IE11 & some browsers do NOT tell you about dragged files until dropped. Always consider a valid drag\n this.validDrag = true\n }\n\n this.validDragChange.emit(this.validDrag)\n\n this.invalidDrag = !this.validDrag\n this.invalidDragChange.emit(this.invalidDrag)\n\n transfer.dropEffect = 'copy'//change cursor and such\n this.stopEvent(event)\n this.fileOver.emit(true)\n }\n\n closeDrags(){\n delete this.validDrag\n this.validDragChange.emit(this.validDrag)\n this.invalidDrag = false\n this.invalidDragChange.emit(this.invalidDrag)\n delete this.dragFiles\n this.dragFilesChange.emit( this.dragFiles )\n }\n\n @HostListener('dragleave', ['$event'])\n onDragLeave(event:Event):any {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n \n this.closeDrags()\n\n if ((this as any).element) {\n if (event.currentTarget === (this as any).element[0]) {\n return;\n }\n }\n\n this.stopEvent(event);\n this.fileOver.emit(false);\n }\n}","import { Directive, ElementRef, Input } from '@angular/core';\nimport { dataUrl } from './fileTools';\n\n@Directive({selector: '[ngfBackground]'})\nexport class ngfBackground {\n @Input('ngfBackground') file:any\n\n constructor(public ElementRef:ElementRef){}\n\n ngOnChanges( _changes:any ){\n dataUrl(this.file)\n .then(src=>{\n const urlString = 'url(\\'' + (src || '') + '\\')'\n this.ElementRef.nativeElement.style.backgroundImage = urlString\n })\n }\n}\n","import { Directive, EventEmitter, Output, Input } from '@angular/core';\n\n@Directive({selector: 'ngfUploadStatus'})\nexport class ngfUploadStatus {\n @Input() percent:number = 0\n @Output() percentChange:EventEmitter = new EventEmitter()\n @Input() httpEvent !: Event\n\n ngOnChanges( changes ){\n if( changes.httpEvent && changes.httpEvent.currentValue ){\n const event = changes.httpEvent.currentValue\n if (event.loaded && event.total) {\n setTimeout(()=>{\n this.percent = Math.round(100 * event.loaded / event.total);\n this.percentChange.emit( this.percent )\n }, 0)\n }\n }\n }\n}","import {\n IterableDiffer,\n IterableDiffers,\n Directive, EventEmitter,\n Output, Input\n} from '@angular/core';\n\n@Directive({selector: 'ngfFormData'})\nexport class ngfFormData {\n @Input() files !: File[]\n @Input() postName:string = \"file\"\n @Input() fileName !: string//force file name\n\n @Input() FormData:FormData = new FormData()\n @Output() FormDataChange:EventEmitter = new EventEmitter()\n\n differ:IterableDiffer<{}>\n\n constructor(IterableDiffers: IterableDiffers){\n this.differ = IterableDiffers.find([]).create()\n }\n\n ngDoCheck(){\n var changes = this.differ.diff( this.files );\n\n if (changes) {\n setTimeout(()=>this.buildFormData(), 0)\n }\n }\n\n buildFormData(){\n const isArray = typeof(this.files)==='object' && this.files.constructor===Array\n\n if( isArray ){\n this.FormData = new FormData()\n const files = this.files || []\n files.forEach(file=>\n this.FormData.append(this.postName, file, this.fileName||file.name)\n )\n this.FormDataChange.emit( this.FormData )\n }else{\n delete this.FormData\n }\n }\n}","import { Directive, ElementRef, Input } from '@angular/core';\nimport { dataUrl } from './fileTools';\n\n@Directive({ selector: '[ngfSrc]' })\nexport class ngfSrc {\n @Input('ngfSrc') file: any\n\n constructor(public ElementRef: ElementRef) { }\n\n ngOnChanges(_changes: any) {\n dataUrl(this.file)\n .then(src=>\n this.ElementRef.nativeElement.src = src\n )\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ngfBackground } from './ngfBackground.directive';\nimport { ngfDrop } from './ngfDrop.directive';\nimport { ngf } from './ngf.directive';\nimport { ngfSelect } from './ngfSelect.directive';\nimport { ngfUploadStatus } from './ngfUploadStatus.directive';\nimport { ngfFormData } from './ngfFormData.directive';\nimport { ngfSrc } from './ngfSrc.directive';\n//import{ HttpModule } from '@angular/http';\n\nconst declarations = [\n ngfDrop,\n ngfSelect,\n ngfBackground,\n ngfSrc,\n ngfUploadStatus,\n ngfFormData,\n ngf\n]\n\n@NgModule({\n imports: [\n CommonModule\n //,HttpModule\n ],\n declarations: declarations,\n exports: declarations//[HttpModule, ...declarations]\n}) export class ngfModule {}"]} \ No newline at end of file +{"version":3,"sources":["../../node_modules/tslib/tslib.es6.js","../../projects/angular-file/src/file-upload/doc-event-help.functions.ts","../../projects/angular-file/src/file-upload/fileTools.ts","../../projects/angular-file/src/file-upload/ngf.directive.ts","../../projects/angular-file/src/file-upload/ngfSelect.directive.ts","../../projects/angular-file/src/file-upload/ngfDrop.directive.ts","../../projects/angular-file/src/file-upload/ngfBackground.directive.ts","../../projects/angular-file/src/file-upload/ngfUploadStatus.directive.ts","../../projects/angular-file/src/file-upload/ngfFormData.directive.ts","../../projects/angular-file/src/file-upload/ngfSrc.directive.ts","../../projects/angular-file/src/file-upload/ngf.module.ts"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","__read","o","n","m","Symbol","iterator","r","e","i","call","ar","next","done","push","value","error","__spread","arguments","length","concat","isFileInput","elm","ty","getAttribute","tagName","toLowerCase","initialTouchStartY","initialTouchStartX","createFileInput","fileElem","document","createElement","type","fixFileOrientationByMeta","file","result","dataUrl","then","url","canvas","img","Promise","res","rej","onload","width","orientation","height","ctx","getContext","transform","applyTransform","drawImage","toDataURL","base","buffer","binary","bytes","Uint8Array","len","byteLength","String","fromCharCode","window","btoa","arrayBufferToBase64","fixedArrayBuffer","blob","dataurl","name","origSize","arr","split","mimeMatch","match","mime","bstr","atob","u8arr","charCodeAt","Blob","dataUrltoBlob","KEY_STR","encode64","input","chr1","chr2","enc1","enc2","enc3","output","chr3","enc4","isNaN","charAt","restore","origFileBase64","resizedFileBase64","replace","rawImage","decode64","segments","slice2Segments","image","exifManipulation","exifArray","getExifArray","newImageArray","insertExif","seg","x","imageData","buf","separatePoint","indexOf","mae","slice","ato","array","rawImageArray","head","endPoint","exec","console","log","newFile","theBlob","fileName","lastModifiedDate","Date","onerror","src","applyExifRotation","resolve","reader","FileReader","slicedFile","readAsArrayBuffer","view","DataView","getUint16","offset","marker","getUint32","little","tags","setUint16","target","readOrientation","disallowObjectUrl","$ngfDataUrl","$ngfBlobUrl","$$ngfDataUrlPromise","$$ngfBlobUrlPromise","deferred","win","FileAPI","navigator","userAgent","size","reject","Error","URL","webkitURL","fileReader","event","readAsDataURL","createObjectURL","ngf","element","filters","lastFileCount","ngfFixOrientation","fileDropDisabled","selectable","directiveInit","EventEmitter","lastInvalids","lastInvalidsChange","lastBaseUrlChange","fileChange","files","filesChange","initFilters","fn","_acceptFilter","_fileSizeFilter","ngOnDestroy","fileElm","destroyPasteListener","ngOnInit","_this","includes","enableSelecting","multiple","paramFileElm","setAttribute","evalCapturePaste","setTimeout","emit","ngOnChanges","changes","accept","currentValue","capturePaste","pasteCapturer","clip","clipboardData","handleFiles","preventDefault","addEventListener","removeEventListener","nativeElement","label","innerHTML","style","visibility","position","overflow","border","margin","padding","appendChild","createInvisibleFileInputWrap","getElementsByTagName","changeFn","bind","bindedHandler_1","_ev","beforeSelect","bindedHandler","ev","clickHandler","getValidFiles","rtn","isFileValid","getInvalidFiles","failReason","getFileFilterFailName","valids","applyExifRotations","fixedFiles","que","isEmptyAfterSelection","apply","observers","fileList","__files_","stopEvent","evt","touches","changedTouches","originalEvent","clientX","clientY","currentX","currentY","Math","abs","stopPropagation","cancelable","detectSwipe","click","attributes","eventToTransfer","dataTransfer","transferHasFiles","transfer","types","contains","eventToFiles","items","mapper","index","fixedFile","splice","proms","all","onChange","isFilesValid","item","regx","acceptRegString","defs","RegExp","search","substring","acceptType","maxSize","filesToWriteableObject","jsonFiles","kind","Directive","args","selector","exportAs","ElementRef","Input","Output","HostListener","ngfSelect","_super","ngfDrop","fileOver","validDrag","validDragChange","invalidDrag","invalidDragChange","dragFilesChange","onDrop","closeDrags","onDragOver","dragFiles","dropEffect","onDragLeave","currentTarget","ngfBackground","_changes","urlString","backgroundImage","ngfUploadStatus","percent","percentChange","httpEvent","event_1","loaded","total","round","ngfFormData","IterableDiffers","postName","FormData","FormDataChange","differ","find","ngDoCheck","diff","buildFormData","forEach","append","ngfSrc","declarations","NgModule","imports","CommonModule","exports"],"mappings":";;;;;;;;;;;;;;oFAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,MACpDN,EAAGC,aAGZO,EAAUR,EAAGC,GAEzB,SAASQ,IAAOC,KAAKC,YAAcX,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEY,UAAkB,OAANX,EAAaC,OAAOW,OAAOZ,IAAMQ,EAAGG,UAAYX,EAAEW,UAAW,IAAIH,YAoGnEK,EAAOC,EAAGC,GACtB,IAAIC,EAAsB,mBAAXC,QAAyBH,EAAEG,OAAOC,UACjD,IAAKF,EAAG,OAAOF,EACf,IAAmBK,EAAYC,EAA3BC,EAAIL,EAAEM,KAAKR,GAAOS,EAAK,GAC3B,IACI,WAAc,IAANR,GAAgBA,KAAM,MAAQI,EAAIE,EAAEG,QAAQC,MAAMF,EAAGG,KAAKP,EAAE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C,GAAA5S,KAAA4S,WAAAA,SAEnB4C,EAAAtV,UAAA0M,YAAA,SAAYqH,GAAZ,IAAA9H,EAAAnM,KACEwC,EAAQxC,KAAKsC,MACZG,MAAK,SAAA8F,GACJ,OAAA4D,EAAKyG,WAAWpF,cAAcjF,IAAMA,+BATzCiK,EAAAA,UAASC,KAAA,CAAC,CAAEC,SAAU,wDAHHE,EAAAA,4CAKjBC,EAAAA,MAAKJ,KAAA,CAAC,aCOT,IAAMgD,EAAe,CACnBvC,EACAF,EACAgB,EACAwB,EACApB,EACAQ,EACAhK,KAUC,iCAPF8K,EAAAA,SAAQjD,KAAA,CAAC,CACRkD,QAAS,CACPC,EAAAA,cAGFH,aAAcA,EACdI,QAASJ","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","export const isFileInput = function(elm:any){\n const ty = elm.getAttribute('type')\n return elm.tagName.toLowerCase() === 'input' && ty && ty.toLowerCase() === 'file';\n}\n\nlet initialTouchStartY = 0;\nlet initialTouchStartX = 0;\nexport const detectSwipe = function(evt:any):boolean {\n var touches = evt.changedTouches || (evt.originalEvent && evt.originalEvent.changedTouches);\n if (touches) {\n if (evt.type === 'touchstart') {\n initialTouchStartX = touches[0].clientX;\n initialTouchStartY = touches[0].clientY;\n return true; // don't block event default\n } else {\n // prevent scroll from triggering event\n if (evt.type === 'touchend') {\n var currentX = touches[0].clientX;\n var currentY = touches[0].clientY;\n if ((Math.abs(currentX - initialTouchStartX) > 20) ||\n (Math.abs(currentY - initialTouchStartY) > 20)) {\n evt.stopPropagation();\n if (evt.cancelable) {\n evt.preventDefault();\n }\n return false;\n }\n }\n return true;\n }\n }\n return false\n}\n\nexport const createInvisibleFileInputWrap = function() {\n var fileElem = createFileInput()\n var label = document.createElement('label');\n label.innerHTML = 'upload'\n label.style.visibility = 'hidden'\n label.style.position = 'absolute'\n label.style.overflow = 'hidden'\n label.style.width = '0px'\n label.style.height = '0px'\n label.style.border = 'none'\n label.style.margin = '0px'\n label.style.padding = '0px'\n label.setAttribute('tabindex','-1')\n \n //bindAttrToFileInput(fileElem, label);\n //generatedElems.push({el: elem, ref: label});\n\n label.appendChild( fileElem )\n //document.body.appendChild( label );\n\n return label;\n}\n\nexport const createFileInput = function() {\n var fileElem = document.createElement('input');\n fileElem.type=\"file\"\n return fileElem;\n}\n","export function getWindow():any{return window}\n\nexport function acceptType(accept:string, type:string, name?:string):boolean { \n if( !accept ){\n return true\n }\n\n const defs = accept.split(',')\n let regx:RegExp\n let acceptRegString:string\n\n for(let x=defs.length-1; x >= 0; --x){\n //Escapes dots in mimetype \n acceptRegString = defs[x]\n //trim\n acceptRegString = acceptRegString.replace(/(^\\s+|\\s+$)/g,'')\n //Escapes stars in mimetype \n acceptRegString = acceptRegString.replace(/\\*/g,'.*')\n //let acceptReg = '^((' + acceptRegString\n //acceptReg = acceptReg.replace(/,/g,')|(') + '))$'\n \n //try by mime\n regx = new RegExp(acceptRegString, 'gi')\n if( type.search(regx)>=0 ){\n return true\n }\n\n //try by ext\n if( acceptRegString.substring(0, 1)=='.' ){ \n acceptRegString = '\\\\'+ acceptRegString//.substring(1, acceptRegString.length-1)//remove dot at front\n regx = new RegExp(acceptRegString+'$', 'i')\n if( (name||type).search(regx)>=0 ){\n return true\n }\n }\n }\n return false\n}\n\nexport interface InvalidFileItem{\n file:File\n type:string\n}\n\nexport function arrayBufferToBase64(buffer:any) {\n var binary = '';\n var bytes = new Uint8Array(buffer);\n var len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return window.btoa(binary);\n}\n\nexport function dataUrltoBlob(\n dataurl:string,\n name:string,\n origSize?:any\n):Blob{\n var arr = dataurl.split(',');\n var mimeMatch = arr[0].match(/:(.*?);/)\n var mime:string = mimeMatch ? mimeMatch[1] : 'text/plain'\n var bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n var blob = new window.Blob([u8arr], {type: mime});\n blob[\"name\"] = name;\n blob[\"$ngfOrigSize\"] = origSize;\n return blob;\n}\n\nexport interface orientationMeta{\n orientation: number\n fixedArrayBuffer?:any[]\n}\n\nexport function applyTransform(\n ctx:CanvasRenderingContext2D,\n orientation:number,\n width:number,\n height:number\n) {\n switch (orientation) {\n case 2:\n return ctx.transform(-1, 0, 0, 1, width, 0);\n case 3:\n return ctx.transform(-1, 0, 0, -1, width, height);\n case 4:\n return ctx.transform(1, 0, 0, -1, 0, height);\n case 5:\n return ctx.transform(0, 1, 1, 0, 0, 0);\n case 6:\n return ctx.transform(0, 1, -1, 0, height, 0);\n case 7:\n return ctx.transform(0, -1, -1, 0, height, width);\n case 8:\n return ctx.transform(0, -1, 1, 0, 0, width);\n }\n}\n\nexport function fixFileOrientationByMeta(\n file:File, result:orientationMeta\n):Promise{\n return dataUrl(file, true)\n .then(url=>{\n var canvas = document.createElement('canvas');\n var img = document.createElement('img');\n\n return >new Promise(function(res,rej){\n img.onload = function () {\n try {\n canvas.width = result.orientation > 4 ? img.height : img.width\n canvas.height = result.orientation > 4 ? img.width : img.height\n var ctx = canvas.getContext('2d')\n applyTransform(ctx, result.orientation, img.width, img.height)\n ctx.drawImage(img, 0, 0);\n var dataUrl = canvas.toDataURL(file.type || 'image/WebP', 0.934)\n const base = arrayBufferToBase64(result.fixedArrayBuffer)\n dataUrl = restoreExif(base, dataUrl)\n var blob = dataUrltoBlob(dataUrl, file.name)\n const newFile = blobToFile(blob, file.name);\n res(newFile);\n } catch (e) {\n rej(e)\n }\n };\n img.onerror = rej;\n img.src = url; \n })\n })\n}\n\nexport function applyExifRotation(\n file:File\n):Promise{\n if (file.type.indexOf('image/jpeg') !== 0) {\n return Promise.resolve(file);\n }\n\n return readOrientation(file)\n .then((result:orientationMeta)=>{\n if (result.orientation < 2 || result.orientation > 8) {\n return file\n }\n \n return fixFileOrientationByMeta(file,result)\n })\n}\n\nexport function readOrientation(\n file:File\n):Promise{\n return new Promise((res,rej)=>{\n var reader = new FileReader();\n var slicedFile = file.slice ? file.slice(0, 64 * 1024) : file;\n reader.readAsArrayBuffer(slicedFile);\n reader.onerror = rej\n reader.onload = function (e:any) {\n var result:orientationMeta = {orientation: 1};\n var view = new DataView( this.result );\n if (view.getUint16(0, false) !== 0xFFD8) return res(result);\n\n var length = view.byteLength,\n offset = 2;\n while (offset < length) {\n var marker = view.getUint16(offset, false);\n offset += 2;\n if (marker === 0xFFE1) {\n if (view.getUint32(offset += 2, false) !== 0x45786966) return res(result);\n\n var little = view.getUint16(offset += 6, false) === 0x4949;\n offset += view.getUint32(offset + 4, little);\n var tags = view.getUint16(offset, little);\n offset += 2;\n for (var i = 0; i < tags; i++)\n if (view.getUint16(offset + (i * 12), little) === 0x0112) {\n var orientation = view.getUint16(offset + (i * 12) + 8, little);\n if (orientation >= 2 && orientation <= 8) {\n view.setUint16(offset + (i * 12) + 8, 1, little);\n result.fixedArrayBuffer = e.target.result;\n }\n result.orientation = orientation;\n return res(result);\n }\n } else if ((marker & 0xFF00) !== 0xFF00) break;\n else offset += view.getUint16(offset, false);\n }\n return res(result);\n };\n })\n}\n\n/** converts file-input file into base64 dataUri */\nexport function dataUrl(\n file:any,\n disallowObjectUrl?:any\n):Promise{\n if (!file) return Promise.resolve(file)\n \n if ((disallowObjectUrl && file.$ngfDataUrl != null) || (!disallowObjectUrl && file.$ngfBlobUrl != null)) {\n return Promise.resolve( disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl )\n }\n\n var p = disallowObjectUrl ? file.$$ngfDataUrlPromise : file.$$ngfBlobUrlPromise;\n if (p) return p;\n\n const win = getWindow()\n let deferred:Promise\n if (win.FileReader && file &&\n (!win.FileAPI || navigator.userAgent.indexOf('MSIE 8') === -1 || file.size < 20000) &&\n (!win.FileAPI || navigator.userAgent.indexOf('MSIE 9') === -1 || file.size < 4000000)) {\n //prefer URL.createObjectURL for handling refrences to files of all sizes\n //since it doesn´t build a large string in memory\n var URL = win.URL || win.webkitURL;\n if (FileReader) {\n deferred = new Promise((res,rej)=>{\n var fileReader = new FileReader();\n fileReader.onload = function (event:any) {\n file.$ngfDataUrl = event.target.result;\n delete file.$ngfDataUrl;\n res( event.target.result )\n };\n fileReader.onerror = function (e) {\n file.$ngfDataUrl = '';\n rej(e)\n };\n fileReader.readAsDataURL(file);\n })\n } else {\n var url:any;\n try {\n url = URL.createObjectURL(file);\n } catch (e) {\n return Promise.reject(e);\n }\n \n deferred = Promise.resolve( url )\n file.$ngfBlobUrl = url;\n }\n } else {\n file[disallowObjectUrl ? '$ngfDataUrl' : '$ngfBlobUrl'] = '';\n return Promise.reject( new Error('Browser does not support window.FileReader, window.FileReader, or window.FileAPI') )//deferred.reject();\n }\n\n if (disallowObjectUrl) {\n p = file.$$ngfDataUrlPromise = deferred;\n } else {\n p = file.$$ngfBlobUrlPromise = deferred;\n }\n\n p = p.then((x:any)=>{\n delete file[disallowObjectUrl ? '$$ngfDataUrlPromise' : '$$ngfBlobUrlPromise'];\n return x\n })\n\n return p;\n}\n\nexport function restoreExif(orig:any, resized:any) {\n var ExifRestorer:any = {\n KEY_STR:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n }\n\n ExifRestorer.encode64 = function (input:any) {\n var output = '',\n chr1, chr2, chr3:any = '',\n enc1, enc2, enc3, enc4:any = '',\n i = 0;\n\n do {\n chr1 = input[i++];\n chr2 = input[i++];\n chr3 = input[i++];\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output +\n this.KEY_STR.charAt(enc1) +\n this.KEY_STR.charAt(enc2) +\n this.KEY_STR.charAt(enc3) +\n this.KEY_STR.charAt(enc4);\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n } while (i < input.length);\n\n return output;\n };\n\n ExifRestorer.restore = function (origFileBase64:any, resizedFileBase64:any) {\n if (origFileBase64.match('data:image/jpeg;base64,')) {\n origFileBase64 = origFileBase64.replace('data:image/jpeg;base64,', '');\n }\n\n var rawImage:number[] = this.decode64(origFileBase64);\n var segments = this.slice2Segments(rawImage);\n\n var image = this.exifManipulation(resizedFileBase64, segments);\n\n return 'data:image/jpeg;base64,' + this.encode64(image);\n };\n\n\n ExifRestorer.exifManipulation = function (resizedFileBase64:any, segments:any) {\n var exifArray = this.getExifArray(segments),\n newImageArray = this.insertExif(resizedFileBase64, exifArray);\n return new Uint8Array(newImageArray);\n };\n\n ExifRestorer.getExifArray = function (segments:number[][]) {\n var seg;\n for (var x = 0; x < segments.length; x++) {\n seg = segments[x];\n if (seg[0] === 255 && seg[1] === 225) //(ff e1)\n {\n return seg;\n }\n }\n return [];\n };\n\n\n ExifRestorer.insertExif = function (resizedFileBase64:any, exifArray:any) {\n var imageData = resizedFileBase64.replace('data:image/jpeg;base64,', ''),\n buf = this.decode64(imageData),\n separatePoint = buf.indexOf(255, 3),\n mae = buf.slice(0, separatePoint),\n ato = buf.slice(separatePoint),\n array = mae;\n\n array = array.concat(exifArray);\n array = array.concat(ato);\n return array;\n };\n\n\n ExifRestorer.slice2Segments = function(\n rawImageArray:number[]\n ) {\n var head:number = 0,\n segments:number[][] = [];\n\n while (1) {\n if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 218) {\n break;\n }\n if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 216) {\n head += 2;\n }\n else {\n var length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3]\n var endPoint = head + length + 2\n var seg:number[] = rawImageArray.slice(head, endPoint)\n segments.push(seg);\n head = endPoint;\n }\n if (head > rawImageArray.length) {\n break;\n }\n }\n\n return segments;\n };\n\n\n ExifRestorer.decode64 = function (\n input:any\n ):number[]{\n var chr1, chr2, chr3:any = '',\n enc1, enc2, enc3, enc4:any = '',\n i = 0,\n buf:number[] = [];\n\n // remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n var base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n if (base64test.exec(input)) {\n console.log('There were invalid base64 characters in the input text.');\n }\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n\n do {\n enc1 = this.KEY_STR.indexOf(input.charAt(i++));\n enc2 = this.KEY_STR.indexOf(input.charAt(i++));\n enc3 = this.KEY_STR.indexOf(input.charAt(i++));\n enc4 = this.KEY_STR.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n buf.push(chr1);\n\n if (enc3 !== 64) {\n buf.push(chr2);\n }\n if (enc4 !== 64) {\n buf.push(chr3);\n }\n\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n\n } while (i < input.length);\n\n return buf;\n };\n\n return ExifRestorer.restore(orig, resized); //<= EXIF\n};\n\nfunction blobToFile(theBlob: Blob, fileName:string): File {\n var b: any = theBlob;\n //A Blob() is almost a File() - it's just missing the two properties below which we will add\n b.lastModifiedDate = new Date();\n b.name = fileName;\n\n //Cast to a File() type\n return theBlob;\n}\n","import { Directive, EventEmitter, ElementRef, Input, Output, HostListener, ChangeDetectionStrategy } from '@angular/core';\nimport { createInvisibleFileInputWrap, isFileInput, detectSwipe } from \"./doc-event-help.functions\"\nimport {\n acceptType, InvalidFileItem,\n applyExifRotation, dataUrl\n} from \"./fileTools\"\n\nexport interface dragMeta{\n type:string\n kind:string\n}\n\n/** A master base set of logic intended to support file select/drag/drop operations\n NOTE: Use ngfDrop for full drag/drop. Use ngfSelect for selecting\n*/\n@Directive({\n selector: \"[ngf]\",\n exportAs:\"ngf\"\n})\nexport class ngf {\n fileElm:any\n filters:{name:string, fn:(file:File)=>boolean}[] = []\n lastFileCount:number=0\n\n @Input() multiple !:string\n @Input() accept !:string\n @Input() maxSize !:number\n //@Input() forceFilename:string\n //@Input() forcePostname:string\n @Input() ngfFixOrientation:boolean = true\n\n @Input() fileDropDisabled:boolean = false\n @Input() selectable: boolean | string = false\n @Output('init') directiveInit:EventEmitter = new EventEmitter()\n\n @Input() lastInvalids:InvalidFileItem[] = []\n @Output() lastInvalidsChange:EventEmitter<{file:File,type:string}[]> = new EventEmitter()\n\n @Input() lastBaseUrl !: string//base64 last file uploaded url\n @Output() lastBaseUrlChange:EventEmitter = new EventEmitter()\n\n @Input() file !: File//last file uploaded\n @Output() fileChange:EventEmitter = new EventEmitter()\n\n @Input() files:File[] = []\n @Output() filesChange:EventEmitter = new EventEmitter();\n\n @Input() capturePaste: boolean; // window paste file watching (empty string turns on)\n pasteCapturer !: (e: Event) => void;\n\n constructor(public element:ElementRef){\n this.initFilters()\n }\n\n initFilters(){\n // the order is important\n this.filters.push({name: 'accept', fn: this._acceptFilter})\n this.filters.push({name: 'fileSize', fn: this._fileSizeFilter})\n\n //this.filters.push({name: 'fileType', fn: this._fileTypeFilter})\n //this.filters.push({name: 'queueLimit', fn: this._queueLimitFilter})\n //this.filters.push({name: 'mimeType', fn: this._mimeTypeFilter})\n }\n\n ngOnDestroy(){\n delete this.fileElm//faster memory release of dom element\n this.destroyPasteListener();\n }\n\n ngOnInit(){\n const selectable = (this.selectable || this.selectable==='') && !['false', 'null', '0'].includes(this.selectable as string);\n if( selectable ){\n this.enableSelecting()\n }\n\n if( this.multiple ){\n this.paramFileElm().setAttribute('multiple', this.multiple)\n }\n\n this.evalCapturePaste();\n\n //create reference to this class with one cycle delay to avoid ExpressionChangedAfterItHasBeenCheckedError\n setTimeout(()=>{\n this.directiveInit.emit(this)\n }, 0)\n }\n\n ngOnChanges( changes ){\n if( changes.accept ){\n this.paramFileElm().setAttribute('accept', changes.accept.currentValue || '*')\n }\n\n if (changes.capturePaste) {\n this.evalCapturePaste();\n }\n }\n\n evalCapturePaste() {\n const isActive = this.capturePaste || (this.capturePaste as any)==='' || ['false', '0', 'null'].includes(this.capturePaste as any);\n\n if (isActive) {\n if (this.pasteCapturer) {\n return; // already listening\n }\n\n this.pasteCapturer = (e: Event) => {\n const clip = (e as any).clipboardData;\n if (clip && clip.files && clip.files.length) {\n this.handleFiles(clip.files);\n e.preventDefault();\n }\n }\n\n window.addEventListener('paste', this.pasteCapturer);\n\n return;\n }\n\n this.destroyPasteListener();\n }\n\n destroyPasteListener() {\n if (this.pasteCapturer) {\n window.removeEventListener('paste', this.pasteCapturer);\n delete this.pasteCapturer;\n }\n }\n\n paramFileElm(){\n if( this.fileElm )return this.fileElm//already defined\n\n //elm is a file input\n const isFile = isFileInput( this.element.nativeElement )\n if(isFile)return this.fileElm = this.element.nativeElement\n\n //create foo file input\n const label = createInvisibleFileInputWrap()\n this.fileElm = label.getElementsByTagName('input')[0]\n this.fileElm.addEventListener('change', this.changeFn.bind(this));\n this.element.nativeElement.appendChild( label )\n return this.fileElm\n }\n\n enableSelecting(){\n let elm = this.element.nativeElement\n\n if( isFileInput(elm) ){\n const bindedHandler = _ev=>this.beforeSelect()\n elm.addEventListener('click', bindedHandler)\n elm.addEventListener('touchstart', bindedHandler)\n return\n }\n\n const bindedHandler = ev=>this.clickHandler(ev)\n elm.addEventListener('click', bindedHandler)\n elm.addEventListener('touchstart', bindedHandler)\n elm.addEventListener('touchend', bindedHandler)\n }\n\n getValidFiles( files:File[] ):File[]{\n const rtn:File[] = []\n for(let x=files.length-1; x >= 0; --x){\n if( this.isFileValid(files[x]) ){\n rtn.push( files[x] )\n }\n }\n return rtn\n }\n\n getInvalidFiles(files:File[]):InvalidFileItem[]{\n const rtn:InvalidFileItem[] = []\n for(let x=files.length-1; x >= 0; --x){\n let failReason = this.getFileFilterFailName(files[x])\n if( failReason ){\n rtn.push({\n file : files[x],\n type : failReason\n })\n }\n }\n return rtn\n }\n\n // Primary handler of files coming in\n handleFiles(files:File[]){\n const valids = this.getValidFiles(files)\n\n if(files.length!=valids.length){\n this.lastInvalids = this.getInvalidFiles(files)\n }else{\n delete this.lastInvalids\n }\n\n this.lastInvalidsChange.emit(this.lastInvalids)\n\n if( valids.length ){\n if( this.ngfFixOrientation ){\n this.applyExifRotations(valids)\n .then( fixedFiles=>this.que(fixedFiles) )\n }else{\n this.que(valids)\n }\n }\n\n if (this.isEmptyAfterSelection()) {\n this.element.nativeElement.value = ''\n }\n }\n\n que( files:File[] ){\n this.files = this.files || []\n Array.prototype.push.apply(this.files, files)\n\n //below break memory ref and doesnt act like a que\n //this.files = files//causes memory change which triggers bindings like \n\n this.filesChange.emit( this.files )\n\n if(files.length){\n this.fileChange.emit( this.file=files[0] )\n\n if(this.lastBaseUrlChange.observers.length){\n dataUrl( files[0] )\n .then( url=>this.lastBaseUrlChange.emit(url) )\n }\n }\n\n //will be checked for input value clearing\n this.lastFileCount = this.files.length\n }\n\n /** called when input has files */\n changeFn(event:any) {\n var fileList = event.__files_ || (event.target && event.target.files)\n\n if (!fileList) return;\n\n this.stopEvent(event);\n this.handleFiles(fileList)\n }\n\n clickHandler(evt:any){\n const elm = this.element.nativeElement\n if (elm.getAttribute('disabled') || this.fileDropDisabled){\n return false;\n }\n\n var r = detectSwipe(evt);\n // prevent the click if it is a swipe\n if ( r!==false ) return r;\n\n const fileElm = this.paramFileElm()\n fileElm.click()\n //fileElm.dispatchEvent( new Event('click') );\n this.beforeSelect()\n\n return false;\n }\n\n beforeSelect(){\n if( this.files && this.lastFileCount===this.files.length )return\n\n //if no files in array, be sure browser doesnt prevent reselect of same file (see github issue 27)\n this.fileElm.value = null\n }\n\n isEmptyAfterSelection():boolean {\n return !!this.element.nativeElement.attributes.multiple;\n }\n\n eventToTransfer(event:any):any {\n if(event.dataTransfer)return event.dataTransfer\n return event.originalEvent ? event.originalEvent.dataTransfer : null\n }\n\n stopEvent(event:any):any {\n event.preventDefault();\n event.stopPropagation();\n }\n\n transferHasFiles(transfer:any):any {\n if (!transfer.types) {\n return false;\n }\n\n if (transfer.types.indexOf) {\n return transfer.types.indexOf('Files') !== -1;\n } else if (transfer.types.contains) {\n return transfer.types.contains('Files');\n } else {\n return false;\n }\n }\n\n eventToFiles(event:Event){\n const transfer = this.eventToTransfer(event);\n if( transfer ){\n if(transfer.files && transfer.files.length){\n return transfer.files\n }\n if(transfer.items && transfer.items.length){\n return transfer.items\n }\n }\n return []\n }\n\n applyExifRotations(\n files:File[]\n ):Promise{\n const mapper = (\n file:File,index:number\n ):Promise=>{\n return applyExifRotation(file)\n .then( fixedFile=>files.splice(index, 1, fixedFile) )\n }\n\n const proms:Promise[] = []\n for(let x=files.length-1; x >= 0; --x){\n proms[x] = mapper( files[x], x )\n }\n return Promise.all( proms ).then( ()=>files )\n }\n\n @HostListener('change', ['$event'])\n onChange(event:Event):void {\n let files = this.element.nativeElement.files || this.eventToFiles(event)\n\n if(!files.length)return\n\n this.stopEvent(event);\n this.handleFiles(files)\n }\n\n getFileFilterFailName(\n file:File\n ):string | undefined{\n for(let i = 0; i < this.filters.length; i++){\n if( !this.filters[i].fn.call(this, file) ){\n return this.filters[i].name\n }\n }\n return undefined\n }\n\n isFileValid(file:File):boolean{\n const noFilters = !this.accept && (!this.filters || !this.filters.length)\n if( noFilters ){\n return true//we have no filters so all files are valid\n }\n\n return this.getFileFilterFailName(file) ? false : true\n }\n\n isFilesValid(files:File[]){\n for(let x=files.length-1; x >= 0; --x){\n if( !this.isFileValid(files[x]) ){\n return false\n }\n }\n return true\n }\n\n protected _acceptFilter(item:File):boolean {\n return acceptType(this.accept, item.type, item.name)\n }\n\n protected _fileSizeFilter(item:File):boolean {\n return !(this.maxSize && item.size > this.maxSize);\n }\n\n /** browsers try hard to conceal data about file drags, this tends to undo that */\n filesToWriteableObject( files:File[] ):dragMeta[]{\n const jsonFiles:dragMeta[] = []\n for(let x=0; x < files.length; ++x){\n jsonFiles.push({\n type:files[x].type,\n kind:files[x][\"kind\"]\n })\n }\n return jsonFiles\n }\n}\n","import { Directive, Input } from \"@angular/core\"\nimport { ngf } from \"./ngf.directive\"\n\n@Directive({\n selector: \"[ngfSelect]\",\n exportAs: \"ngfSelect\"\n})\nexport class ngfSelect extends ngf {\n @Input() selectable:any = true\n}","import {\n Directive, EventEmitter,\n HostListener, Input, Output\n} from '@angular/core';\nimport { ngf, dragMeta } from \"./ngf.directive\"\n\n@Directive({\n selector: \"[ngfDrop]\",\n exportAs: \"ngfDrop\"\n})\nexport class ngfDrop extends ngf {\n @Output() fileOver:EventEmitter = new EventEmitter();\n\n @Input() validDrag:boolean = false\n @Output() validDragChange:EventEmitter = new EventEmitter()\n\n @Input() invalidDrag = false\n @Output() invalidDragChange:EventEmitter = new EventEmitter()\n\n @Input() dragFiles !: dragMeta[]\n @Output() dragFilesChange:EventEmitter = new EventEmitter()\n\n @HostListener('drop', ['$event'])\n onDrop(event:Event):void {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n\n this.closeDrags()\n let files = this.eventToFiles(event)\n\n if(!files.length)return\n\n this.stopEvent(event);\n this.handleFiles(files)\n }\n\n handleFiles(files:File[]){\n this.fileOver.emit(false)//turn-off dragover\n super.handleFiles(files)\n }\n\n @HostListener('dragover', ['$event'])\n onDragOver(event:Event):void {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n\n const transfer = this.eventToTransfer(event)\n\n let files = this.eventToFiles(event)\n\n let jsonFiles = this.filesToWriteableObject(files)\n this.dragFilesChange.emit( this.dragFiles=jsonFiles )\n\n if( files.length ){\n this.validDrag = this.isFilesValid(files)\n }else{\n //Safari, IE11 & some browsers do NOT tell you about dragged files until dropped. Always consider a valid drag\n this.validDrag = true\n }\n\n this.validDragChange.emit(this.validDrag)\n\n this.invalidDrag = !this.validDrag\n this.invalidDragChange.emit(this.invalidDrag)\n\n transfer.dropEffect = 'copy'//change cursor and such\n this.stopEvent(event)\n this.fileOver.emit(true)\n }\n\n closeDrags(){\n delete this.validDrag\n this.validDragChange.emit(this.validDrag)\n this.invalidDrag = false\n this.invalidDragChange.emit(this.invalidDrag)\n delete this.dragFiles\n this.dragFilesChange.emit( this.dragFiles )\n }\n\n @HostListener('dragleave', ['$event'])\n onDragLeave(event:Event):any {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n \n this.closeDrags()\n\n if ((this as any).element) {\n if (event.currentTarget === (this as any).element[0]) {\n return;\n }\n }\n\n this.stopEvent(event);\n this.fileOver.emit(false);\n }\n}","import { Directive, ElementRef, Input } from '@angular/core';\nimport { dataUrl } from './fileTools';\n\n@Directive({selector: '[ngfBackground]'})\nexport class ngfBackground {\n @Input('ngfBackground') file:any\n\n constructor(public ElementRef:ElementRef){}\n\n ngOnChanges( _changes:any ){\n dataUrl(this.file)\n .then(src=>{\n const urlString = 'url(\\'' + (src || '') + '\\')'\n this.ElementRef.nativeElement.style.backgroundImage = urlString\n })\n }\n}\n","import { Directive, EventEmitter, Output, Input } from '@angular/core';\n\n@Directive({selector: 'ngfUploadStatus'})\nexport class ngfUploadStatus {\n @Input() percent:number = 0\n @Output() percentChange:EventEmitter = new EventEmitter()\n @Input() httpEvent !: Event\n\n ngOnChanges( changes ){\n if( changes.httpEvent && changes.httpEvent.currentValue ){\n const event = changes.httpEvent.currentValue\n if (event.loaded && event.total) {\n setTimeout(()=>{\n this.percent = Math.round(100 * event.loaded / event.total);\n this.percentChange.emit( this.percent )\n }, 0)\n }\n }\n }\n}","import {\n IterableDiffer,\n IterableDiffers,\n Directive, EventEmitter,\n Output, Input\n} from '@angular/core';\n\n@Directive({selector: 'ngfFormData'})\nexport class ngfFormData {\n @Input() files !: File[]\n @Input() postName:string = \"file\"\n @Input() fileName !: string//force file name\n\n @Input() FormData:FormData = new FormData()\n @Output() FormDataChange:EventEmitter = new EventEmitter()\n\n differ:IterableDiffer<{}>\n\n constructor(IterableDiffers: IterableDiffers){\n this.differ = IterableDiffers.find([]).create()\n }\n\n ngDoCheck(){\n var changes = this.differ.diff( this.files );\n\n if (changes) {\n setTimeout(()=>this.buildFormData(), 0)\n }\n }\n\n buildFormData(){\n const isArray = typeof(this.files)==='object' && this.files.constructor===Array\n\n if( isArray ){\n this.FormData = new FormData()\n const files = this.files || []\n files.forEach(file=>\n this.FormData.append(this.postName, file, this.fileName||file.name)\n )\n this.FormDataChange.emit( this.FormData )\n }else{\n delete this.FormData\n }\n }\n}","import { Directive, ElementRef, Input } from '@angular/core';\nimport { dataUrl } from './fileTools';\n\n@Directive({ selector: '[ngfSrc]' })\nexport class ngfSrc {\n @Input('ngfSrc') file: any\n\n constructor(public ElementRef: ElementRef) { }\n\n ngOnChanges(_changes: any) {\n dataUrl(this.file)\n .then(src=>\n this.ElementRef.nativeElement.src = src\n )\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ngfBackground } from './ngfBackground.directive';\nimport { ngfDrop } from './ngfDrop.directive';\nimport { ngf } from './ngf.directive';\nimport { ngfSelect } from './ngfSelect.directive';\nimport { ngfUploadStatus } from './ngfUploadStatus.directive';\nimport { ngfFormData } from './ngfFormData.directive';\nimport { ngfSrc } from './ngfSrc.directive';\n//import{ HttpModule } from '@angular/http';\n\nconst declarations = [\n ngfDrop,\n ngfSelect,\n ngfBackground,\n ngfSrc,\n ngfUploadStatus,\n ngfFormData,\n ngf\n]\n\n@NgModule({\n imports: [\n CommonModule\n //,HttpModule\n ],\n declarations: declarations,\n exports: declarations//[HttpModule, ...declarations]\n}) export class ngfModule {}"]} \ No newline at end of file diff --git a/esm2015/file-upload/ngf.directive.js b/esm2015/file-upload/ngf.directive.js index 52846b0b..9520c417 100644 --- a/esm2015/file-upload/ngf.directive.js +++ b/esm2015/file-upload/ngf.directive.js @@ -65,7 +65,7 @@ export class ngf { } this.pasteCapturer = (e) => { const clip = e.clipboardData; - if (clip && clip.files) { + if (clip && clip.files && clip.files.length) { this.handleFiles(clip.files); e.preventDefault(); } @@ -323,4 +323,4 @@ ngf.propDecorators = { capturePaste: [{ type: Input }], onChange: [{ type: HostListener, args: ['change', ['$event'],] }] }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmdmLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIvVXNlcnMvYWNrZXJhcHBsZS9Qcm9qZWN0cy93ZWIvYW5ndWxhci9hbmd1bGFyLWZpbGUvZGV2Z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aGlzLm1heFNpemUgJiYgaXRlbS5zaXplID4gdGhpcy5tYXhTaXplKTtcbiAgfVxuXG4gIC8qKiBicm93c2VycyB0cnkgaGFyZCB0byBjb25jZWFsIGRhdGEgYWJvdXQgZmlsZSBkcmFncywgdGhpcyB0ZW5kcyB0byB1bmRvIHRoYXQgKi9cbiAgZmlsZXNUb1dyaXRlYWJsZU9iamVjdCggZmlsZXM6RmlsZVtdICk6ZHJhZ01ldGFbXXtcbiAgICBjb25zdCBqc29uRmlsZXM6ZHJhZ01ldGFbXSA9IFtdXG4gICAgZm9yKGxldCB4PTA7IHggPCBmaWxlcy5sZW5ndGg7ICsreCl7XG4gICAgICBqc29uRmlsZXMucHVzaCh7XG4gICAgICAgIHR5cGU6ZmlsZXNbeF0udHlwZSxcbiAgICAgICAga2luZDpmaWxlc1t4XVtcImtpbmRcIl1cbiAgICAgIH0pXG4gICAgfVxuICAgIHJldHVybiBqc29uRmlsZXNcbiAgfVxufVxuIl19 \ No newline at end of file diff --git a/fesm2015/angular-file.js b/fesm2015/angular-file.js index 3de5de57..83cb8371 100644 --- a/fesm2015/angular-file.js +++ b/fesm2015/angular-file.js @@ -462,7 +462,7 @@ class ngf { } this.pasteCapturer = (e) => { const clip = e.clipboardData; - if (clip && clip.files) { + if (clip && clip.files && clip.files.length) { this.handleFiles(clip.files); e.preventDefault(); } diff --git a/fesm2015/angular-file.js.map b/fesm2015/angular-file.js.map index 0a02b94c..da9b1acb 100644 --- a/fesm2015/angular-file.js.map +++ b/fesm2015/angular-file.js.map @@ -1 +1 @@ -{"version":3,"file":"angular-file.js","sources":["../../projects/angular-file/src/file-upload/doc-event-help.functions.ts","../../projects/angular-file/src/file-upload/fileTools.ts","../../projects/angular-file/src/file-upload/ngf.directive.ts","../../projects/angular-file/src/file-upload/ngfSelect.directive.ts","../../projects/angular-file/src/file-upload/ngfDrop.directive.ts","../../projects/angular-file/src/file-upload/ngfBackground.directive.ts","../../projects/angular-file/src/file-upload/ngfUploadStatus.directive.ts","../../projects/angular-file/src/file-upload/ngfFormData.directive.ts","../../projects/angular-file/src/file-upload/ngfSrc.directive.ts","../../projects/angular-file/src/file-upload/ngf.module.ts","../../projects/angular-file/src/public-api.ts","../../projects/angular-file/src/angular-file.ts"],"sourcesContent":["export const isFileInput = function(elm:any){\n const ty = elm.getAttribute('type')\n return elm.tagName.toLowerCase() === 'input' && ty && ty.toLowerCase() === 'file';\n}\n\nlet initialTouchStartY = 0;\nlet initialTouchStartX = 0;\nexport const detectSwipe = function(evt:any):boolean {\n var touches = evt.changedTouches || (evt.originalEvent && evt.originalEvent.changedTouches);\n if (touches) {\n if (evt.type === 'touchstart') {\n initialTouchStartX = touches[0].clientX;\n initialTouchStartY = touches[0].clientY;\n return true; // don't block event default\n } else {\n // prevent scroll from triggering event\n if (evt.type === 'touchend') {\n var currentX = touches[0].clientX;\n var currentY = touches[0].clientY;\n if ((Math.abs(currentX - initialTouchStartX) > 20) ||\n (Math.abs(currentY - initialTouchStartY) > 20)) {\n evt.stopPropagation();\n if (evt.cancelable) {\n evt.preventDefault();\n }\n return false;\n }\n }\n return true;\n }\n }\n return false\n}\n\nexport const createInvisibleFileInputWrap = function() {\n var fileElem = createFileInput()\n var label = document.createElement('label');\n label.innerHTML = 'upload'\n label.style.visibility = 'hidden'\n label.style.position = 'absolute'\n label.style.overflow = 'hidden'\n label.style.width = '0px'\n label.style.height = '0px'\n label.style.border = 'none'\n label.style.margin = '0px'\n label.style.padding = '0px'\n label.setAttribute('tabindex','-1')\n \n //bindAttrToFileInput(fileElem, label);\n //generatedElems.push({el: elem, ref: label});\n\n label.appendChild( fileElem )\n //document.body.appendChild( label );\n\n return label;\n}\n\nexport const createFileInput = function() {\n var fileElem = document.createElement('input');\n fileElem.type=\"file\"\n return fileElem;\n}\n","export function getWindow():any{return window}\n\nexport function acceptType(accept:string, type:string, name?:string):boolean { \n if( !accept ){\n return true\n }\n\n const defs = accept.split(',')\n let regx:RegExp\n let acceptRegString:string\n\n for(let x=defs.length-1; x >= 0; --x){\n //Escapes dots in mimetype \n acceptRegString = defs[x]\n //trim\n acceptRegString = acceptRegString.replace(/(^\\s+|\\s+$)/g,'')\n //Escapes stars in mimetype \n acceptRegString = acceptRegString.replace(/\\*/g,'.*')\n //let acceptReg = '^((' + acceptRegString\n //acceptReg = acceptReg.replace(/,/g,')|(') + '))$'\n \n //try by mime\n regx = new RegExp(acceptRegString, 'gi')\n if( type.search(regx)>=0 ){\n return true\n }\n\n //try by ext\n if( acceptRegString.substring(0, 1)=='.' ){ \n acceptRegString = '\\\\'+ acceptRegString//.substring(1, acceptRegString.length-1)//remove dot at front\n regx = new RegExp(acceptRegString+'$', 'i')\n if( (name||type).search(regx)>=0 ){\n return true\n }\n }\n }\n return false\n}\n\nexport interface InvalidFileItem{\n file:File\n type:string\n}\n\nexport function arrayBufferToBase64(buffer:any) {\n var binary = '';\n var bytes = new Uint8Array(buffer);\n var len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return window.btoa(binary);\n}\n\nexport function dataUrltoBlob(\n dataurl:string,\n name:string,\n origSize?:any\n):Blob{\n var arr = dataurl.split(',');\n var mimeMatch = arr[0].match(/:(.*?);/)\n var mime:string = mimeMatch ? mimeMatch[1] : 'text/plain'\n var bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n var blob = new window.Blob([u8arr], {type: mime});\n blob[\"name\"] = name;\n blob[\"$ngfOrigSize\"] = origSize;\n return blob;\n}\n\nexport interface orientationMeta{\n orientation: number\n fixedArrayBuffer?:any[]\n}\n\nexport function applyTransform(\n ctx:CanvasRenderingContext2D,\n orientation:number,\n width:number,\n height:number\n) {\n switch (orientation) {\n case 2:\n return ctx.transform(-1, 0, 0, 1, width, 0);\n case 3:\n return ctx.transform(-1, 0, 0, -1, width, height);\n case 4:\n return ctx.transform(1, 0, 0, -1, 0, height);\n case 5:\n return ctx.transform(0, 1, 1, 0, 0, 0);\n case 6:\n return ctx.transform(0, 1, -1, 0, height, 0);\n case 7:\n return ctx.transform(0, -1, -1, 0, height, width);\n case 8:\n return ctx.transform(0, -1, 1, 0, 0, width);\n }\n}\n\nexport function fixFileOrientationByMeta(\n file:File, result:orientationMeta\n):Promise{\n return dataUrl(file, true)\n .then(url=>{\n var canvas = document.createElement('canvas');\n var img = document.createElement('img');\n\n return >new Promise(function(res,rej){\n img.onload = function () {\n try {\n canvas.width = result.orientation > 4 ? img.height : img.width\n canvas.height = result.orientation > 4 ? img.width : img.height\n var ctx = canvas.getContext('2d')\n applyTransform(ctx, result.orientation, img.width, img.height)\n ctx.drawImage(img, 0, 0);\n var dataUrl = canvas.toDataURL(file.type || 'image/WebP', 0.934)\n const base = arrayBufferToBase64(result.fixedArrayBuffer)\n dataUrl = restoreExif(base, dataUrl)\n var blob = dataUrltoBlob(dataUrl, file.name)\n const newFile = blobToFile(blob, file.name);\n res(newFile);\n } catch (e) {\n rej(e)\n }\n };\n img.onerror = rej;\n img.src = url; \n })\n })\n}\n\nexport function applyExifRotation(\n file:File\n):Promise{\n if (file.type.indexOf('image/jpeg') !== 0) {\n return Promise.resolve(file);\n }\n\n return readOrientation(file)\n .then((result:orientationMeta)=>{\n if (result.orientation < 2 || result.orientation > 8) {\n return file\n }\n \n return fixFileOrientationByMeta(file,result)\n })\n}\n\nexport function readOrientation(\n file:File\n):Promise{\n return new Promise((res,rej)=>{\n var reader = new FileReader();\n var slicedFile = file.slice ? file.slice(0, 64 * 1024) : file;\n reader.readAsArrayBuffer(slicedFile);\n reader.onerror = rej\n reader.onload = function (e:any) {\n var result:orientationMeta = {orientation: 1};\n var view = new DataView( this.result );\n if (view.getUint16(0, false) !== 0xFFD8) return res(result);\n\n var length = view.byteLength,\n offset = 2;\n while (offset < length) {\n var marker = view.getUint16(offset, false);\n offset += 2;\n if (marker === 0xFFE1) {\n if (view.getUint32(offset += 2, false) !== 0x45786966) return res(result);\n\n var little = view.getUint16(offset += 6, false) === 0x4949;\n offset += view.getUint32(offset + 4, little);\n var tags = view.getUint16(offset, little);\n offset += 2;\n for (var i = 0; i < tags; i++)\n if (view.getUint16(offset + (i * 12), little) === 0x0112) {\n var orientation = view.getUint16(offset + (i * 12) + 8, little);\n if (orientation >= 2 && orientation <= 8) {\n view.setUint16(offset + (i * 12) + 8, 1, little);\n result.fixedArrayBuffer = e.target.result;\n }\n result.orientation = orientation;\n return res(result);\n }\n } else if ((marker & 0xFF00) !== 0xFF00) break;\n else offset += view.getUint16(offset, false);\n }\n return res(result);\n };\n })\n}\n\n/** converts file-input file into base64 dataUri */\nexport function dataUrl(\n file:any,\n disallowObjectUrl?:any\n):Promise{\n if (!file) return Promise.resolve(file)\n \n if ((disallowObjectUrl && file.$ngfDataUrl != null) || (!disallowObjectUrl && file.$ngfBlobUrl != null)) {\n return Promise.resolve( disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl )\n }\n\n var p = disallowObjectUrl ? file.$$ngfDataUrlPromise : file.$$ngfBlobUrlPromise;\n if (p) return p;\n\n const win = getWindow()\n let deferred:Promise\n if (win.FileReader && file &&\n (!win.FileAPI || navigator.userAgent.indexOf('MSIE 8') === -1 || file.size < 20000) &&\n (!win.FileAPI || navigator.userAgent.indexOf('MSIE 9') === -1 || file.size < 4000000)) {\n //prefer URL.createObjectURL for handling refrences to files of all sizes\n //since it doesn´t build a large string in memory\n var URL = win.URL || win.webkitURL;\n if (FileReader) {\n deferred = new Promise((res,rej)=>{\n var fileReader = new FileReader();\n fileReader.onload = function (event:any) {\n file.$ngfDataUrl = event.target.result;\n delete file.$ngfDataUrl;\n res( event.target.result )\n };\n fileReader.onerror = function (e) {\n file.$ngfDataUrl = '';\n rej(e)\n };\n fileReader.readAsDataURL(file);\n })\n } else {\n var url:any;\n try {\n url = URL.createObjectURL(file);\n } catch (e) {\n return Promise.reject(e);\n }\n \n deferred = Promise.resolve( url )\n file.$ngfBlobUrl = url;\n }\n } else {\n file[disallowObjectUrl ? '$ngfDataUrl' : '$ngfBlobUrl'] = '';\n return Promise.reject( new Error('Browser does not support window.FileReader, window.FileReader, or window.FileAPI') )//deferred.reject();\n }\n\n if (disallowObjectUrl) {\n p = file.$$ngfDataUrlPromise = deferred;\n } else {\n p = file.$$ngfBlobUrlPromise = deferred;\n }\n\n p = p.then((x:any)=>{\n delete file[disallowObjectUrl ? '$$ngfDataUrlPromise' : '$$ngfBlobUrlPromise'];\n return x\n })\n\n return p;\n}\n\nexport function restoreExif(orig:any, resized:any) {\n var ExifRestorer:any = {\n KEY_STR:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n }\n\n ExifRestorer.encode64 = function (input:any) {\n var output = '',\n chr1, chr2, chr3:any = '',\n enc1, enc2, enc3, enc4:any = '',\n i = 0;\n\n do {\n chr1 = input[i++];\n chr2 = input[i++];\n chr3 = input[i++];\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output +\n this.KEY_STR.charAt(enc1) +\n this.KEY_STR.charAt(enc2) +\n this.KEY_STR.charAt(enc3) +\n this.KEY_STR.charAt(enc4);\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n } while (i < input.length);\n\n return output;\n };\n\n ExifRestorer.restore = function (origFileBase64:any, resizedFileBase64:any) {\n if (origFileBase64.match('data:image/jpeg;base64,')) {\n origFileBase64 = origFileBase64.replace('data:image/jpeg;base64,', '');\n }\n\n var rawImage:number[] = this.decode64(origFileBase64);\n var segments = this.slice2Segments(rawImage);\n\n var image = this.exifManipulation(resizedFileBase64, segments);\n\n return 'data:image/jpeg;base64,' + this.encode64(image);\n };\n\n\n ExifRestorer.exifManipulation = function (resizedFileBase64:any, segments:any) {\n var exifArray = this.getExifArray(segments),\n newImageArray = this.insertExif(resizedFileBase64, exifArray);\n return new Uint8Array(newImageArray);\n };\n\n ExifRestorer.getExifArray = function (segments:number[][]) {\n var seg;\n for (var x = 0; x < segments.length; x++) {\n seg = segments[x];\n if (seg[0] === 255 && seg[1] === 225) //(ff e1)\n {\n return seg;\n }\n }\n return [];\n };\n\n\n ExifRestorer.insertExif = function (resizedFileBase64:any, exifArray:any) {\n var imageData = resizedFileBase64.replace('data:image/jpeg;base64,', ''),\n buf = this.decode64(imageData),\n separatePoint = buf.indexOf(255, 3),\n mae = buf.slice(0, separatePoint),\n ato = buf.slice(separatePoint),\n array = mae;\n\n array = array.concat(exifArray);\n array = array.concat(ato);\n return array;\n };\n\n\n ExifRestorer.slice2Segments = function(\n rawImageArray:number[]\n ) {\n var head:number = 0,\n segments:number[][] = [];\n\n while (1) {\n if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 218) {\n break;\n }\n if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 216) {\n head += 2;\n }\n else {\n var length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3]\n var endPoint = head + length + 2\n var seg:number[] = rawImageArray.slice(head, endPoint)\n segments.push(seg);\n head = endPoint;\n }\n if (head > rawImageArray.length) {\n break;\n }\n }\n\n return segments;\n };\n\n\n ExifRestorer.decode64 = function (\n input:any\n ):number[]{\n var chr1, chr2, chr3:any = '',\n enc1, enc2, enc3, enc4:any = '',\n i = 0,\n buf:number[] = [];\n\n // remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n var base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n if (base64test.exec(input)) {\n console.log('There were invalid base64 characters in the input text.');\n }\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n\n do {\n enc1 = this.KEY_STR.indexOf(input.charAt(i++));\n enc2 = this.KEY_STR.indexOf(input.charAt(i++));\n enc3 = this.KEY_STR.indexOf(input.charAt(i++));\n enc4 = this.KEY_STR.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n buf.push(chr1);\n\n if (enc3 !== 64) {\n buf.push(chr2);\n }\n if (enc4 !== 64) {\n buf.push(chr3);\n }\n\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n\n } while (i < input.length);\n\n return buf;\n };\n\n return ExifRestorer.restore(orig, resized); //<= EXIF\n};\n\nfunction blobToFile(theBlob: Blob, fileName:string): File {\n var b: any = theBlob;\n //A Blob() is almost a File() - it's just missing the two properties below which we will add\n b.lastModifiedDate = new Date();\n b.name = fileName;\n\n //Cast to a File() type\n return theBlob;\n}\n","import { Directive, EventEmitter, ElementRef, Input, Output, HostListener, ChangeDetectionStrategy } from '@angular/core';\nimport { createInvisibleFileInputWrap, isFileInput, detectSwipe } from \"./doc-event-help.functions\"\nimport {\n acceptType, InvalidFileItem,\n applyExifRotation, dataUrl\n} from \"./fileTools\"\n\nexport interface dragMeta{\n type:string\n kind:string\n}\n\n/** A master base set of logic intended to support file select/drag/drop operations\n NOTE: Use ngfDrop for full drag/drop. Use ngfSelect for selecting\n*/\n@Directive({\n selector: \"[ngf]\",\n exportAs:\"ngf\"\n})\nexport class ngf {\n fileElm:any\n filters:{name:string, fn:(file:File)=>boolean}[] = []\n lastFileCount:number=0\n\n @Input() multiple !:string\n @Input() accept !:string\n @Input() maxSize !:number\n //@Input() forceFilename:string\n //@Input() forcePostname:string\n @Input() ngfFixOrientation:boolean = true\n\n @Input() fileDropDisabled:boolean = false\n @Input() selectable: boolean | string = false\n @Output('init') directiveInit:EventEmitter = new EventEmitter()\n\n @Input() lastInvalids:InvalidFileItem[] = []\n @Output() lastInvalidsChange:EventEmitter<{file:File,type:string}[]> = new EventEmitter()\n\n @Input() lastBaseUrl !: string//base64 last file uploaded url\n @Output() lastBaseUrlChange:EventEmitter = new EventEmitter()\n\n @Input() file !: File//last file uploaded\n @Output() fileChange:EventEmitter = new EventEmitter()\n\n @Input() files:File[] = []\n @Output() filesChange:EventEmitter = new EventEmitter();\n\n @Input() capturePaste: boolean; // window paste file watching (empty string turns on)\n pasteCapturer !: (e: Event) => void;\n\n constructor(public element:ElementRef){\n this.initFilters()\n }\n\n initFilters(){\n // the order is important\n this.filters.push({name: 'accept', fn: this._acceptFilter})\n this.filters.push({name: 'fileSize', fn: this._fileSizeFilter})\n\n //this.filters.push({name: 'fileType', fn: this._fileTypeFilter})\n //this.filters.push({name: 'queueLimit', fn: this._queueLimitFilter})\n //this.filters.push({name: 'mimeType', fn: this._mimeTypeFilter})\n }\n\n ngOnDestroy(){\n delete this.fileElm//faster memory release of dom element\n this.destroyPasteListener();\n }\n\n ngOnInit(){\n const selectable = (this.selectable || this.selectable==='') && !['false', 'null', '0'].includes(this.selectable as string);\n if( selectable ){\n this.enableSelecting()\n }\n\n if( this.multiple ){\n this.paramFileElm().setAttribute('multiple', this.multiple)\n }\n\n this.evalCapturePaste();\n\n //create reference to this class with one cycle delay to avoid ExpressionChangedAfterItHasBeenCheckedError\n setTimeout(()=>{\n this.directiveInit.emit(this)\n }, 0)\n }\n\n ngOnChanges( changes ){\n if( changes.accept ){\n this.paramFileElm().setAttribute('accept', changes.accept.currentValue || '*')\n }\n\n if (changes.capturePaste) {\n this.evalCapturePaste();\n }\n }\n\n evalCapturePaste() {\n const isActive = this.capturePaste || (this.capturePaste as any)==='' || ['false', '0', 'null'].includes(this.capturePaste as any);\n\n if (isActive) {\n if (this.pasteCapturer) {\n return; // already listening\n }\n\n this.pasteCapturer = (e: Event) => {\n const clip = (e as any).clipboardData;\n if (clip && clip.files) {\n this.handleFiles(clip.files);\n e.preventDefault();\n }\n }\n\n window.addEventListener('paste', this.pasteCapturer);\n\n return;\n }\n\n this.destroyPasteListener();\n }\n\n destroyPasteListener() {\n if (this.pasteCapturer) {\n window.removeEventListener('paste', this.pasteCapturer);\n delete this.pasteCapturer;\n }\n }\n\n paramFileElm(){\n if( this.fileElm )return this.fileElm//already defined\n\n //elm is a file input\n const isFile = isFileInput( this.element.nativeElement )\n if(isFile)return this.fileElm = this.element.nativeElement\n\n //create foo file input\n const label = createInvisibleFileInputWrap()\n this.fileElm = label.getElementsByTagName('input')[0]\n this.fileElm.addEventListener('change', this.changeFn.bind(this));\n this.element.nativeElement.appendChild( label )\n return this.fileElm\n }\n\n enableSelecting(){\n let elm = this.element.nativeElement\n\n if( isFileInput(elm) ){\n const bindedHandler = _ev=>this.beforeSelect()\n elm.addEventListener('click', bindedHandler)\n elm.addEventListener('touchstart', bindedHandler)\n return\n }\n\n const bindedHandler = ev=>this.clickHandler(ev)\n elm.addEventListener('click', bindedHandler)\n elm.addEventListener('touchstart', bindedHandler)\n elm.addEventListener('touchend', bindedHandler)\n }\n\n getValidFiles( files:File[] ):File[]{\n const rtn:File[] = []\n for(let x=files.length-1; x >= 0; --x){\n if( this.isFileValid(files[x]) ){\n rtn.push( files[x] )\n }\n }\n return rtn\n }\n\n getInvalidFiles(files:File[]):InvalidFileItem[]{\n const rtn:InvalidFileItem[] = []\n for(let x=files.length-1; x >= 0; --x){\n let failReason = this.getFileFilterFailName(files[x])\n if( failReason ){\n rtn.push({\n file : files[x],\n type : failReason\n })\n }\n }\n return rtn\n }\n\n // Primary handler of files coming in\n handleFiles(files:File[]){\n const valids = this.getValidFiles(files)\n\n if(files.length!=valids.length){\n this.lastInvalids = this.getInvalidFiles(files)\n }else{\n delete this.lastInvalids\n }\n\n this.lastInvalidsChange.emit(this.lastInvalids)\n\n if( valids.length ){\n if( this.ngfFixOrientation ){\n this.applyExifRotations(valids)\n .then( fixedFiles=>this.que(fixedFiles) )\n }else{\n this.que(valids)\n }\n }\n\n if (this.isEmptyAfterSelection()) {\n this.element.nativeElement.value = ''\n }\n }\n\n que( files:File[] ){\n this.files = this.files || []\n Array.prototype.push.apply(this.files, files)\n\n //below break memory ref and doesnt act like a que\n //this.files = files//causes memory change which triggers bindings like \n\n this.filesChange.emit( this.files )\n\n if(files.length){\n this.fileChange.emit( this.file=files[0] )\n\n if(this.lastBaseUrlChange.observers.length){\n dataUrl( files[0] )\n .then( url=>this.lastBaseUrlChange.emit(url) )\n }\n }\n\n //will be checked for input value clearing\n this.lastFileCount = this.files.length\n }\n\n /** called when input has files */\n changeFn(event:any) {\n var fileList = event.__files_ || (event.target && event.target.files)\n\n if (!fileList) return;\n\n this.stopEvent(event);\n this.handleFiles(fileList)\n }\n\n clickHandler(evt:any){\n const elm = this.element.nativeElement\n if (elm.getAttribute('disabled') || this.fileDropDisabled){\n return false;\n }\n\n var r = detectSwipe(evt);\n // prevent the click if it is a swipe\n if ( r!==false ) return r;\n\n const fileElm = this.paramFileElm()\n fileElm.click()\n //fileElm.dispatchEvent( new Event('click') );\n this.beforeSelect()\n\n return false;\n }\n\n beforeSelect(){\n if( this.files && this.lastFileCount===this.files.length )return\n\n //if no files in array, be sure browser doesnt prevent reselect of same file (see github issue 27)\n this.fileElm.value = null\n }\n\n isEmptyAfterSelection():boolean {\n return !!this.element.nativeElement.attributes.multiple;\n }\n\n eventToTransfer(event:any):any {\n if(event.dataTransfer)return event.dataTransfer\n return event.originalEvent ? event.originalEvent.dataTransfer : null\n }\n\n stopEvent(event:any):any {\n event.preventDefault();\n event.stopPropagation();\n }\n\n transferHasFiles(transfer:any):any {\n if (!transfer.types) {\n return false;\n }\n\n if (transfer.types.indexOf) {\n return transfer.types.indexOf('Files') !== -1;\n } else if (transfer.types.contains) {\n return transfer.types.contains('Files');\n } else {\n return false;\n }\n }\n\n eventToFiles(event:Event){\n const transfer = this.eventToTransfer(event);\n if( transfer ){\n if(transfer.files && transfer.files.length){\n return transfer.files\n }\n if(transfer.items && transfer.items.length){\n return transfer.items\n }\n }\n return []\n }\n\n applyExifRotations(\n files:File[]\n ):Promise{\n const mapper = (\n file:File,index:number\n ):Promise=>{\n return applyExifRotation(file)\n .then( fixedFile=>files.splice(index, 1, fixedFile) )\n }\n\n const proms:Promise[] = []\n for(let x=files.length-1; x >= 0; --x){\n proms[x] = mapper( files[x], x )\n }\n return Promise.all( proms ).then( ()=>files )\n }\n\n @HostListener('change', ['$event'])\n onChange(event:Event):void {\n let files = this.element.nativeElement.files || this.eventToFiles(event)\n\n if(!files.length)return\n\n this.stopEvent(event);\n this.handleFiles(files)\n }\n\n getFileFilterFailName(\n file:File\n ):string | undefined{\n for(let i = 0; i < this.filters.length; i++){\n if( !this.filters[i].fn.call(this, file) ){\n return this.filters[i].name\n }\n }\n return undefined\n }\n\n isFileValid(file:File):boolean{\n const noFilters = !this.accept && (!this.filters || !this.filters.length)\n if( noFilters ){\n return true//we have no filters so all files are valid\n }\n\n return this.getFileFilterFailName(file) ? false : true\n }\n\n isFilesValid(files:File[]){\n for(let x=files.length-1; x >= 0; --x){\n if( !this.isFileValid(files[x]) ){\n return false\n }\n }\n return true\n }\n\n protected _acceptFilter(item:File):boolean {\n return acceptType(this.accept, item.type, item.name)\n }\n\n protected _fileSizeFilter(item:File):boolean {\n return !(this.maxSize && item.size > this.maxSize);\n }\n\n /** browsers try hard to conceal data about file drags, this tends to undo that */\n filesToWriteableObject( files:File[] ):dragMeta[]{\n const jsonFiles:dragMeta[] = []\n for(let x=0; x < files.length; ++x){\n jsonFiles.push({\n type:files[x].type,\n kind:files[x][\"kind\"]\n })\n }\n return jsonFiles\n }\n}\n","import { Directive, Input } from \"@angular/core\"\nimport { ngf } from \"./ngf.directive\"\n\n@Directive({\n selector: \"[ngfSelect]\",\n exportAs: \"ngfSelect\"\n})\nexport class ngfSelect extends ngf {\n @Input() selectable:any = true\n}","import {\n Directive, EventEmitter,\n HostListener, Input, Output\n} from '@angular/core';\nimport { ngf, dragMeta } from \"./ngf.directive\"\n\n@Directive({\n selector: \"[ngfDrop]\",\n exportAs: \"ngfDrop\"\n})\nexport class ngfDrop extends ngf {\n @Output() fileOver:EventEmitter = new EventEmitter();\n\n @Input() validDrag:boolean = false\n @Output() validDragChange:EventEmitter = new EventEmitter()\n\n @Input() invalidDrag = false\n @Output() invalidDragChange:EventEmitter = new EventEmitter()\n\n @Input() dragFiles !: dragMeta[]\n @Output() dragFilesChange:EventEmitter = new EventEmitter()\n\n @HostListener('drop', ['$event'])\n onDrop(event:Event):void {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n\n this.closeDrags()\n let files = this.eventToFiles(event)\n\n if(!files.length)return\n\n this.stopEvent(event);\n this.handleFiles(files)\n }\n\n handleFiles(files:File[]){\n this.fileOver.emit(false)//turn-off dragover\n super.handleFiles(files)\n }\n\n @HostListener('dragover', ['$event'])\n onDragOver(event:Event):void {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n\n const transfer = this.eventToTransfer(event)\n\n let files = this.eventToFiles(event)\n\n let jsonFiles = this.filesToWriteableObject(files)\n this.dragFilesChange.emit( this.dragFiles=jsonFiles )\n\n if( files.length ){\n this.validDrag = this.isFilesValid(files)\n }else{\n //Safari, IE11 & some browsers do NOT tell you about dragged files until dropped. Always consider a valid drag\n this.validDrag = true\n }\n\n this.validDragChange.emit(this.validDrag)\n\n this.invalidDrag = !this.validDrag\n this.invalidDragChange.emit(this.invalidDrag)\n\n transfer.dropEffect = 'copy'//change cursor and such\n this.stopEvent(event)\n this.fileOver.emit(true)\n }\n\n closeDrags(){\n delete this.validDrag\n this.validDragChange.emit(this.validDrag)\n this.invalidDrag = false\n this.invalidDragChange.emit(this.invalidDrag)\n delete this.dragFiles\n this.dragFilesChange.emit( this.dragFiles )\n }\n\n @HostListener('dragleave', ['$event'])\n onDragLeave(event:Event):any {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n \n this.closeDrags()\n\n if ((this as any).element) {\n if (event.currentTarget === (this as any).element[0]) {\n return;\n }\n }\n\n this.stopEvent(event);\n this.fileOver.emit(false);\n }\n}","import { Directive, ElementRef, Input } from '@angular/core';\nimport { dataUrl } from './fileTools';\n\n@Directive({selector: '[ngfBackground]'})\nexport class ngfBackground {\n @Input('ngfBackground') file:any\n\n constructor(public ElementRef:ElementRef){}\n\n ngOnChanges( _changes:any ){\n dataUrl(this.file)\n .then(src=>{\n const urlString = 'url(\\'' + (src || '') + '\\')'\n this.ElementRef.nativeElement.style.backgroundImage = urlString\n })\n }\n}\n","import { Directive, EventEmitter, Output, Input } from '@angular/core';\n\n@Directive({selector: 'ngfUploadStatus'})\nexport class ngfUploadStatus {\n @Input() percent:number = 0\n @Output() percentChange:EventEmitter = new EventEmitter()\n @Input() httpEvent !: Event\n\n ngOnChanges( changes ){\n if( changes.httpEvent && changes.httpEvent.currentValue ){\n const event = changes.httpEvent.currentValue\n if (event.loaded && event.total) {\n setTimeout(()=>{\n this.percent = Math.round(100 * event.loaded / event.total);\n this.percentChange.emit( this.percent )\n }, 0)\n }\n }\n }\n}","import {\n IterableDiffer,\n IterableDiffers,\n Directive, EventEmitter,\n Output, Input\n} from '@angular/core';\n\n@Directive({selector: 'ngfFormData'})\nexport class ngfFormData {\n @Input() files !: File[]\n @Input() postName:string = \"file\"\n @Input() fileName !: string//force file name\n\n @Input() FormData:FormData = new FormData()\n @Output() FormDataChange:EventEmitter = new EventEmitter()\n\n differ:IterableDiffer<{}>\n\n constructor(IterableDiffers: IterableDiffers){\n this.differ = IterableDiffers.find([]).create()\n }\n\n ngDoCheck(){\n var changes = this.differ.diff( this.files );\n\n if (changes) {\n setTimeout(()=>this.buildFormData(), 0)\n }\n }\n\n buildFormData(){\n const isArray = typeof(this.files)==='object' && this.files.constructor===Array\n\n if( isArray ){\n this.FormData = new FormData()\n const files = this.files || []\n files.forEach(file=>\n this.FormData.append(this.postName, file, this.fileName||file.name)\n )\n this.FormDataChange.emit( this.FormData )\n }else{\n delete this.FormData\n }\n }\n}","import { Directive, ElementRef, Input } from '@angular/core';\nimport { dataUrl } from './fileTools';\n\n@Directive({ selector: '[ngfSrc]' })\nexport class ngfSrc {\n @Input('ngfSrc') file: any\n\n constructor(public ElementRef: ElementRef) { }\n\n ngOnChanges(_changes: any) {\n dataUrl(this.file)\n .then(src=>\n this.ElementRef.nativeElement.src = src\n )\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ngfBackground } from './ngfBackground.directive';\nimport { ngfDrop } from './ngfDrop.directive';\nimport { ngf } from './ngf.directive';\nimport { ngfSelect } from './ngfSelect.directive';\nimport { ngfUploadStatus } from './ngfUploadStatus.directive';\nimport { ngfFormData } from './ngfFormData.directive';\nimport { ngfSrc } from './ngfSrc.directive';\n//import{ HttpModule } from '@angular/http';\n\nconst declarations = [\n ngfDrop,\n ngfSelect,\n ngfBackground,\n ngfSrc,\n ngfUploadStatus,\n ngfFormData,\n ngf\n]\n\n@NgModule({\n imports: [\n CommonModule\n //,HttpModule\n ],\n declarations: declarations,\n exports: declarations//[HttpModule, ...declarations]\n}) export class ngfModule {}","/*\n * Public API Surface of angular-file\n */\n\nexport * from './file-upload/ngfSelect.directive';\nexport * from './file-upload/ngfDrop.directive';\nexport * from './file-upload/ngf.directive';\nexport * from './file-upload/ngf.module';\nexport { ngfBackground } from './file-upload/ngfBackground.directive';\nexport { ngfSrc } from './file-upload/ngfSrc.directive';\nexport { ngfUploadStatus } from './file-upload/ngfUploadStatus.directive';\nexport { ngfFormData } from './file-upload/ngfFormData.directive';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAO,MAAM,WAAW,GAAG,UAAS,GAAO;IACzC,MAAM,EAAE,GAAG,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;IACnC,OAAO,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,OAAO,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;AACpF,CAAC,CAAA;AAED,IAAI,kBAAkB,GAAG,CAAC,CAAC;AAC3B,IAAI,kBAAkB,GAAG,CAAC,CAAC;AACpB,MAAM,WAAW,GAAG,UAAS,GAAO;IACzC,IAAI,OAAO,GAAG,GAAG,CAA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-file/src/file-upload/doc-event-help.functions.ts","../../projects/angular-file/src/file-upload/fileTools.ts","../../projects/angular-file/src/file-upload/ngf.directive.ts","../../projects/angular-file/src/file-upload/ngfSelect.directive.ts","../../projects/angular-file/src/file-upload/ngfDrop.directive.ts","../../projects/angular-file/src/file-upload/ngfBackground.directive.ts","../../projects/angular-file/src/file-upload/ngfUploadStatus.directive.ts","../../projects/angular-file/src/file-upload/ngfFormData.directive.ts","../../projects/angular-file/src/file-upload/ngfSrc.directive.ts","../../projects/angular-file/src/file-upload/ngf.module.ts","../../projects/angular-file/src/public-api.ts","../../projects/angular-file/src/angular-file.ts"],"sourcesContent":["export const isFileInput = function(elm:any){\n const ty = elm.getAttribute('type')\n return elm.tagName.toLowerCase() === 'input' && ty && ty.toLowerCase() === 'file';\n}\n\nlet initialTouchStartY = 0;\nlet initialTouchStartX = 0;\nexport const detectSwipe = function(evt:any):boolean {\n var touches = evt.changedTouches || (evt.originalEvent && evt.originalEvent.changedTouches);\n if (touches) {\n if (evt.type === 'touchstart') {\n initialTouchStartX = touches[0].clientX;\n initialTouchStartY = touches[0].clientY;\n return true; // don't block event default\n } else {\n // prevent scroll from triggering event\n if (evt.type === 'touchend') {\n var currentX = touches[0].clientX;\n var currentY = touches[0].clientY;\n if ((Math.abs(currentX - initialTouchStartX) > 20) ||\n (Math.abs(currentY - initialTouchStartY) > 20)) {\n evt.stopPropagation();\n if (evt.cancelable) {\n evt.preventDefault();\n }\n return false;\n }\n }\n return true;\n }\n }\n return false\n}\n\nexport const createInvisibleFileInputWrap = function() {\n var fileElem = createFileInput()\n var label = document.createElement('label');\n label.innerHTML = 'upload'\n label.style.visibility = 'hidden'\n label.style.position = 'absolute'\n label.style.overflow = 'hidden'\n label.style.width = '0px'\n label.style.height = '0px'\n label.style.border = 'none'\n label.style.margin = '0px'\n label.style.padding = '0px'\n label.setAttribute('tabindex','-1')\n \n //bindAttrToFileInput(fileElem, label);\n //generatedElems.push({el: elem, ref: label});\n\n label.appendChild( fileElem )\n //document.body.appendChild( label );\n\n return label;\n}\n\nexport const createFileInput = function() {\n var fileElem = document.createElement('input');\n fileElem.type=\"file\"\n return fileElem;\n}\n","export function getWindow():any{return window}\n\nexport function acceptType(accept:string, type:string, name?:string):boolean { \n if( !accept ){\n return true\n }\n\n const defs = accept.split(',')\n let regx:RegExp\n let acceptRegString:string\n\n for(let x=defs.length-1; x >= 0; --x){\n //Escapes dots in mimetype \n acceptRegString = defs[x]\n //trim\n acceptRegString = acceptRegString.replace(/(^\\s+|\\s+$)/g,'')\n //Escapes stars in mimetype \n acceptRegString = acceptRegString.replace(/\\*/g,'.*')\n //let acceptReg = '^((' + acceptRegString\n //acceptReg = acceptReg.replace(/,/g,')|(') + '))$'\n \n //try by mime\n regx = new RegExp(acceptRegString, 'gi')\n if( type.search(regx)>=0 ){\n return true\n }\n\n //try by ext\n if( acceptRegString.substring(0, 1)=='.' ){ \n acceptRegString = '\\\\'+ acceptRegString//.substring(1, acceptRegString.length-1)//remove dot at front\n regx = new RegExp(acceptRegString+'$', 'i')\n if( (name||type).search(regx)>=0 ){\n return true\n }\n }\n }\n return false\n}\n\nexport interface InvalidFileItem{\n file:File\n type:string\n}\n\nexport function arrayBufferToBase64(buffer:any) {\n var binary = '';\n var bytes = new Uint8Array(buffer);\n var len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return window.btoa(binary);\n}\n\nexport function dataUrltoBlob(\n dataurl:string,\n name:string,\n origSize?:any\n):Blob{\n var arr = dataurl.split(',');\n var mimeMatch = arr[0].match(/:(.*?);/)\n var mime:string = mimeMatch ? mimeMatch[1] : 'text/plain'\n var bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n var blob = new window.Blob([u8arr], {type: mime});\n blob[\"name\"] = name;\n blob[\"$ngfOrigSize\"] = origSize;\n return blob;\n}\n\nexport interface orientationMeta{\n orientation: number\n fixedArrayBuffer?:any[]\n}\n\nexport function applyTransform(\n ctx:CanvasRenderingContext2D,\n orientation:number,\n width:number,\n height:number\n) {\n switch (orientation) {\n case 2:\n return ctx.transform(-1, 0, 0, 1, width, 0);\n case 3:\n return ctx.transform(-1, 0, 0, -1, width, height);\n case 4:\n return ctx.transform(1, 0, 0, -1, 0, height);\n case 5:\n return ctx.transform(0, 1, 1, 0, 0, 0);\n case 6:\n return ctx.transform(0, 1, -1, 0, height, 0);\n case 7:\n return ctx.transform(0, -1, -1, 0, height, width);\n case 8:\n return ctx.transform(0, -1, 1, 0, 0, width);\n }\n}\n\nexport function fixFileOrientationByMeta(\n file:File, result:orientationMeta\n):Promise{\n return dataUrl(file, true)\n .then(url=>{\n var canvas = document.createElement('canvas');\n var img = document.createElement('img');\n\n return >new Promise(function(res,rej){\n img.onload = function () {\n try {\n canvas.width = result.orientation > 4 ? img.height : img.width\n canvas.height = result.orientation > 4 ? img.width : img.height\n var ctx = canvas.getContext('2d')\n applyTransform(ctx, result.orientation, img.width, img.height)\n ctx.drawImage(img, 0, 0);\n var dataUrl = canvas.toDataURL(file.type || 'image/WebP', 0.934)\n const base = arrayBufferToBase64(result.fixedArrayBuffer)\n dataUrl = restoreExif(base, dataUrl)\n var blob = dataUrltoBlob(dataUrl, file.name)\n const newFile = blobToFile(blob, file.name);\n res(newFile);\n } catch (e) {\n rej(e)\n }\n };\n img.onerror = rej;\n img.src = url; \n })\n })\n}\n\nexport function applyExifRotation(\n file:File\n):Promise{\n if (file.type.indexOf('image/jpeg') !== 0) {\n return Promise.resolve(file);\n }\n\n return readOrientation(file)\n .then((result:orientationMeta)=>{\n if (result.orientation < 2 || result.orientation > 8) {\n return file\n }\n \n return fixFileOrientationByMeta(file,result)\n })\n}\n\nexport function readOrientation(\n file:File\n):Promise{\n return new Promise((res,rej)=>{\n var reader = new FileReader();\n var slicedFile = file.slice ? file.slice(0, 64 * 1024) : file;\n reader.readAsArrayBuffer(slicedFile);\n reader.onerror = rej\n reader.onload = function (e:any) {\n var result:orientationMeta = {orientation: 1};\n var view = new DataView( this.result );\n if (view.getUint16(0, false) !== 0xFFD8) return res(result);\n\n var length = view.byteLength,\n offset = 2;\n while (offset < length) {\n var marker = view.getUint16(offset, false);\n offset += 2;\n if (marker === 0xFFE1) {\n if (view.getUint32(offset += 2, false) !== 0x45786966) return res(result);\n\n var little = view.getUint16(offset += 6, false) === 0x4949;\n offset += view.getUint32(offset + 4, little);\n var tags = view.getUint16(offset, little);\n offset += 2;\n for (var i = 0; i < tags; i++)\n if (view.getUint16(offset + (i * 12), little) === 0x0112) {\n var orientation = view.getUint16(offset + (i * 12) + 8, little);\n if (orientation >= 2 && orientation <= 8) {\n view.setUint16(offset + (i * 12) + 8, 1, little);\n result.fixedArrayBuffer = e.target.result;\n }\n result.orientation = orientation;\n return res(result);\n }\n } else if ((marker & 0xFF00) !== 0xFF00) break;\n else offset += view.getUint16(offset, false);\n }\n return res(result);\n };\n })\n}\n\n/** converts file-input file into base64 dataUri */\nexport function dataUrl(\n file:any,\n disallowObjectUrl?:any\n):Promise{\n if (!file) return Promise.resolve(file)\n \n if ((disallowObjectUrl && file.$ngfDataUrl != null) || (!disallowObjectUrl && file.$ngfBlobUrl != null)) {\n return Promise.resolve( disallowObjectUrl ? file.$ngfDataUrl : file.$ngfBlobUrl )\n }\n\n var p = disallowObjectUrl ? file.$$ngfDataUrlPromise : file.$$ngfBlobUrlPromise;\n if (p) return p;\n\n const win = getWindow()\n let deferred:Promise\n if (win.FileReader && file &&\n (!win.FileAPI || navigator.userAgent.indexOf('MSIE 8') === -1 || file.size < 20000) &&\n (!win.FileAPI || navigator.userAgent.indexOf('MSIE 9') === -1 || file.size < 4000000)) {\n //prefer URL.createObjectURL for handling refrences to files of all sizes\n //since it doesn´t build a large string in memory\n var URL = win.URL || win.webkitURL;\n if (FileReader) {\n deferred = new Promise((res,rej)=>{\n var fileReader = new FileReader();\n fileReader.onload = function (event:any) {\n file.$ngfDataUrl = event.target.result;\n delete file.$ngfDataUrl;\n res( event.target.result )\n };\n fileReader.onerror = function (e) {\n file.$ngfDataUrl = '';\n rej(e)\n };\n fileReader.readAsDataURL(file);\n })\n } else {\n var url:any;\n try {\n url = URL.createObjectURL(file);\n } catch (e) {\n return Promise.reject(e);\n }\n \n deferred = Promise.resolve( url )\n file.$ngfBlobUrl = url;\n }\n } else {\n file[disallowObjectUrl ? '$ngfDataUrl' : '$ngfBlobUrl'] = '';\n return Promise.reject( new Error('Browser does not support window.FileReader, window.FileReader, or window.FileAPI') )//deferred.reject();\n }\n\n if (disallowObjectUrl) {\n p = file.$$ngfDataUrlPromise = deferred;\n } else {\n p = file.$$ngfBlobUrlPromise = deferred;\n }\n\n p = p.then((x:any)=>{\n delete file[disallowObjectUrl ? '$$ngfDataUrlPromise' : '$$ngfBlobUrlPromise'];\n return x\n })\n\n return p;\n}\n\nexport function restoreExif(orig:any, resized:any) {\n var ExifRestorer:any = {\n KEY_STR:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n }\n\n ExifRestorer.encode64 = function (input:any) {\n var output = '',\n chr1, chr2, chr3:any = '',\n enc1, enc2, enc3, enc4:any = '',\n i = 0;\n\n do {\n chr1 = input[i++];\n chr2 = input[i++];\n chr3 = input[i++];\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output +\n this.KEY_STR.charAt(enc1) +\n this.KEY_STR.charAt(enc2) +\n this.KEY_STR.charAt(enc3) +\n this.KEY_STR.charAt(enc4);\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n } while (i < input.length);\n\n return output;\n };\n\n ExifRestorer.restore = function (origFileBase64:any, resizedFileBase64:any) {\n if (origFileBase64.match('data:image/jpeg;base64,')) {\n origFileBase64 = origFileBase64.replace('data:image/jpeg;base64,', '');\n }\n\n var rawImage:number[] = this.decode64(origFileBase64);\n var segments = this.slice2Segments(rawImage);\n\n var image = this.exifManipulation(resizedFileBase64, segments);\n\n return 'data:image/jpeg;base64,' + this.encode64(image);\n };\n\n\n ExifRestorer.exifManipulation = function (resizedFileBase64:any, segments:any) {\n var exifArray = this.getExifArray(segments),\n newImageArray = this.insertExif(resizedFileBase64, exifArray);\n return new Uint8Array(newImageArray);\n };\n\n ExifRestorer.getExifArray = function (segments:number[][]) {\n var seg;\n for (var x = 0; x < segments.length; x++) {\n seg = segments[x];\n if (seg[0] === 255 && seg[1] === 225) //(ff e1)\n {\n return seg;\n }\n }\n return [];\n };\n\n\n ExifRestorer.insertExif = function (resizedFileBase64:any, exifArray:any) {\n var imageData = resizedFileBase64.replace('data:image/jpeg;base64,', ''),\n buf = this.decode64(imageData),\n separatePoint = buf.indexOf(255, 3),\n mae = buf.slice(0, separatePoint),\n ato = buf.slice(separatePoint),\n array = mae;\n\n array = array.concat(exifArray);\n array = array.concat(ato);\n return array;\n };\n\n\n ExifRestorer.slice2Segments = function(\n rawImageArray:number[]\n ) {\n var head:number = 0,\n segments:number[][] = [];\n\n while (1) {\n if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 218) {\n break;\n }\n if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 216) {\n head += 2;\n }\n else {\n var length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3]\n var endPoint = head + length + 2\n var seg:number[] = rawImageArray.slice(head, endPoint)\n segments.push(seg);\n head = endPoint;\n }\n if (head > rawImageArray.length) {\n break;\n }\n }\n\n return segments;\n };\n\n\n ExifRestorer.decode64 = function (\n input:any\n ):number[]{\n var chr1, chr2, chr3:any = '',\n enc1, enc2, enc3, enc4:any = '',\n i = 0,\n buf:number[] = [];\n\n // remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n var base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n if (base64test.exec(input)) {\n console.log('There were invalid base64 characters in the input text.');\n }\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n\n do {\n enc1 = this.KEY_STR.indexOf(input.charAt(i++));\n enc2 = this.KEY_STR.indexOf(input.charAt(i++));\n enc3 = this.KEY_STR.indexOf(input.charAt(i++));\n enc4 = this.KEY_STR.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n buf.push(chr1);\n\n if (enc3 !== 64) {\n buf.push(chr2);\n }\n if (enc4 !== 64) {\n buf.push(chr3);\n }\n\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n\n } while (i < input.length);\n\n return buf;\n };\n\n return ExifRestorer.restore(orig, resized); //<= EXIF\n};\n\nfunction blobToFile(theBlob: Blob, fileName:string): File {\n var b: any = theBlob;\n //A Blob() is almost a File() - it's just missing the two properties below which we will add\n b.lastModifiedDate = new Date();\n b.name = fileName;\n\n //Cast to a File() type\n return theBlob;\n}\n","import { Directive, EventEmitter, ElementRef, Input, Output, HostListener, ChangeDetectionStrategy } from '@angular/core';\nimport { createInvisibleFileInputWrap, isFileInput, detectSwipe } from \"./doc-event-help.functions\"\nimport {\n acceptType, InvalidFileItem,\n applyExifRotation, dataUrl\n} from \"./fileTools\"\n\nexport interface dragMeta{\n type:string\n kind:string\n}\n\n/** A master base set of logic intended to support file select/drag/drop operations\n NOTE: Use ngfDrop for full drag/drop. Use ngfSelect for selecting\n*/\n@Directive({\n selector: \"[ngf]\",\n exportAs:\"ngf\"\n})\nexport class ngf {\n fileElm:any\n filters:{name:string, fn:(file:File)=>boolean}[] = []\n lastFileCount:number=0\n\n @Input() multiple !:string\n @Input() accept !:string\n @Input() maxSize !:number\n //@Input() forceFilename:string\n //@Input() forcePostname:string\n @Input() ngfFixOrientation:boolean = true\n\n @Input() fileDropDisabled:boolean = false\n @Input() selectable: boolean | string = false\n @Output('init') directiveInit:EventEmitter = new EventEmitter()\n\n @Input() lastInvalids:InvalidFileItem[] = []\n @Output() lastInvalidsChange:EventEmitter<{file:File,type:string}[]> = new EventEmitter()\n\n @Input() lastBaseUrl !: string//base64 last file uploaded url\n @Output() lastBaseUrlChange:EventEmitter = new EventEmitter()\n\n @Input() file !: File//last file uploaded\n @Output() fileChange:EventEmitter = new EventEmitter()\n\n @Input() files:File[] = []\n @Output() filesChange:EventEmitter = new EventEmitter();\n\n @Input() capturePaste: boolean; // window paste file watching (empty string turns on)\n pasteCapturer !: (e: Event) => void;\n\n constructor(public element:ElementRef){\n this.initFilters()\n }\n\n initFilters(){\n // the order is important\n this.filters.push({name: 'accept', fn: this._acceptFilter})\n this.filters.push({name: 'fileSize', fn: this._fileSizeFilter})\n\n //this.filters.push({name: 'fileType', fn: this._fileTypeFilter})\n //this.filters.push({name: 'queueLimit', fn: this._queueLimitFilter})\n //this.filters.push({name: 'mimeType', fn: this._mimeTypeFilter})\n }\n\n ngOnDestroy(){\n delete this.fileElm//faster memory release of dom element\n this.destroyPasteListener();\n }\n\n ngOnInit(){\n const selectable = (this.selectable || this.selectable==='') && !['false', 'null', '0'].includes(this.selectable as string);\n if( selectable ){\n this.enableSelecting()\n }\n\n if( this.multiple ){\n this.paramFileElm().setAttribute('multiple', this.multiple)\n }\n\n this.evalCapturePaste();\n\n //create reference to this class with one cycle delay to avoid ExpressionChangedAfterItHasBeenCheckedError\n setTimeout(()=>{\n this.directiveInit.emit(this)\n }, 0)\n }\n\n ngOnChanges( changes ){\n if( changes.accept ){\n this.paramFileElm().setAttribute('accept', changes.accept.currentValue || '*')\n }\n\n if (changes.capturePaste) {\n this.evalCapturePaste();\n }\n }\n\n evalCapturePaste() {\n const isActive = this.capturePaste || (this.capturePaste as any)==='' || ['false', '0', 'null'].includes(this.capturePaste as any);\n\n if (isActive) {\n if (this.pasteCapturer) {\n return; // already listening\n }\n\n this.pasteCapturer = (e: Event) => {\n const clip = (e as any).clipboardData;\n if (clip && clip.files && clip.files.length) {\n this.handleFiles(clip.files);\n e.preventDefault();\n }\n }\n\n window.addEventListener('paste', this.pasteCapturer);\n\n return;\n }\n\n this.destroyPasteListener();\n }\n\n destroyPasteListener() {\n if (this.pasteCapturer) {\n window.removeEventListener('paste', this.pasteCapturer);\n delete this.pasteCapturer;\n }\n }\n\n paramFileElm(){\n if( this.fileElm )return this.fileElm//already defined\n\n //elm is a file input\n const isFile = isFileInput( this.element.nativeElement )\n if(isFile)return this.fileElm = this.element.nativeElement\n\n //create foo file input\n const label = createInvisibleFileInputWrap()\n this.fileElm = label.getElementsByTagName('input')[0]\n this.fileElm.addEventListener('change', this.changeFn.bind(this));\n this.element.nativeElement.appendChild( label )\n return this.fileElm\n }\n\n enableSelecting(){\n let elm = this.element.nativeElement\n\n if( isFileInput(elm) ){\n const bindedHandler = _ev=>this.beforeSelect()\n elm.addEventListener('click', bindedHandler)\n elm.addEventListener('touchstart', bindedHandler)\n return\n }\n\n const bindedHandler = ev=>this.clickHandler(ev)\n elm.addEventListener('click', bindedHandler)\n elm.addEventListener('touchstart', bindedHandler)\n elm.addEventListener('touchend', bindedHandler)\n }\n\n getValidFiles( files:File[] ):File[]{\n const rtn:File[] = []\n for(let x=files.length-1; x >= 0; --x){\n if( this.isFileValid(files[x]) ){\n rtn.push( files[x] )\n }\n }\n return rtn\n }\n\n getInvalidFiles(files:File[]):InvalidFileItem[]{\n const rtn:InvalidFileItem[] = []\n for(let x=files.length-1; x >= 0; --x){\n let failReason = this.getFileFilterFailName(files[x])\n if( failReason ){\n rtn.push({\n file : files[x],\n type : failReason\n })\n }\n }\n return rtn\n }\n\n // Primary handler of files coming in\n handleFiles(files:File[]){\n const valids = this.getValidFiles(files)\n\n if(files.length!=valids.length){\n this.lastInvalids = this.getInvalidFiles(files)\n }else{\n delete this.lastInvalids\n }\n\n this.lastInvalidsChange.emit(this.lastInvalids)\n\n if( valids.length ){\n if( this.ngfFixOrientation ){\n this.applyExifRotations(valids)\n .then( fixedFiles=>this.que(fixedFiles) )\n }else{\n this.que(valids)\n }\n }\n\n if (this.isEmptyAfterSelection()) {\n this.element.nativeElement.value = ''\n }\n }\n\n que( files:File[] ){\n this.files = this.files || []\n Array.prototype.push.apply(this.files, files)\n\n //below break memory ref and doesnt act like a que\n //this.files = files//causes memory change which triggers bindings like \n\n this.filesChange.emit( this.files )\n\n if(files.length){\n this.fileChange.emit( this.file=files[0] )\n\n if(this.lastBaseUrlChange.observers.length){\n dataUrl( files[0] )\n .then( url=>this.lastBaseUrlChange.emit(url) )\n }\n }\n\n //will be checked for input value clearing\n this.lastFileCount = this.files.length\n }\n\n /** called when input has files */\n changeFn(event:any) {\n var fileList = event.__files_ || (event.target && event.target.files)\n\n if (!fileList) return;\n\n this.stopEvent(event);\n this.handleFiles(fileList)\n }\n\n clickHandler(evt:any){\n const elm = this.element.nativeElement\n if (elm.getAttribute('disabled') || this.fileDropDisabled){\n return false;\n }\n\n var r = detectSwipe(evt);\n // prevent the click if it is a swipe\n if ( r!==false ) return r;\n\n const fileElm = this.paramFileElm()\n fileElm.click()\n //fileElm.dispatchEvent( new Event('click') );\n this.beforeSelect()\n\n return false;\n }\n\n beforeSelect(){\n if( this.files && this.lastFileCount===this.files.length )return\n\n //if no files in array, be sure browser doesnt prevent reselect of same file (see github issue 27)\n this.fileElm.value = null\n }\n\n isEmptyAfterSelection():boolean {\n return !!this.element.nativeElement.attributes.multiple;\n }\n\n eventToTransfer(event:any):any {\n if(event.dataTransfer)return event.dataTransfer\n return event.originalEvent ? event.originalEvent.dataTransfer : null\n }\n\n stopEvent(event:any):any {\n event.preventDefault();\n event.stopPropagation();\n }\n\n transferHasFiles(transfer:any):any {\n if (!transfer.types) {\n return false;\n }\n\n if (transfer.types.indexOf) {\n return transfer.types.indexOf('Files') !== -1;\n } else if (transfer.types.contains) {\n return transfer.types.contains('Files');\n } else {\n return false;\n }\n }\n\n eventToFiles(event:Event){\n const transfer = this.eventToTransfer(event);\n if( transfer ){\n if(transfer.files && transfer.files.length){\n return transfer.files\n }\n if(transfer.items && transfer.items.length){\n return transfer.items\n }\n }\n return []\n }\n\n applyExifRotations(\n files:File[]\n ):Promise{\n const mapper = (\n file:File,index:number\n ):Promise=>{\n return applyExifRotation(file)\n .then( fixedFile=>files.splice(index, 1, fixedFile) )\n }\n\n const proms:Promise[] = []\n for(let x=files.length-1; x >= 0; --x){\n proms[x] = mapper( files[x], x )\n }\n return Promise.all( proms ).then( ()=>files )\n }\n\n @HostListener('change', ['$event'])\n onChange(event:Event):void {\n let files = this.element.nativeElement.files || this.eventToFiles(event)\n\n if(!files.length)return\n\n this.stopEvent(event);\n this.handleFiles(files)\n }\n\n getFileFilterFailName(\n file:File\n ):string | undefined{\n for(let i = 0; i < this.filters.length; i++){\n if( !this.filters[i].fn.call(this, file) ){\n return this.filters[i].name\n }\n }\n return undefined\n }\n\n isFileValid(file:File):boolean{\n const noFilters = !this.accept && (!this.filters || !this.filters.length)\n if( noFilters ){\n return true//we have no filters so all files are valid\n }\n\n return this.getFileFilterFailName(file) ? false : true\n }\n\n isFilesValid(files:File[]){\n for(let x=files.length-1; x >= 0; --x){\n if( !this.isFileValid(files[x]) ){\n return false\n }\n }\n return true\n }\n\n protected _acceptFilter(item:File):boolean {\n return acceptType(this.accept, item.type, item.name)\n }\n\n protected _fileSizeFilter(item:File):boolean {\n return !(this.maxSize && item.size > this.maxSize);\n }\n\n /** browsers try hard to conceal data about file drags, this tends to undo that */\n filesToWriteableObject( files:File[] ):dragMeta[]{\n const jsonFiles:dragMeta[] = []\n for(let x=0; x < files.length; ++x){\n jsonFiles.push({\n type:files[x].type,\n kind:files[x][\"kind\"]\n })\n }\n return jsonFiles\n }\n}\n","import { Directive, Input } from \"@angular/core\"\nimport { ngf } from \"./ngf.directive\"\n\n@Directive({\n selector: \"[ngfSelect]\",\n exportAs: \"ngfSelect\"\n})\nexport class ngfSelect extends ngf {\n @Input() selectable:any = true\n}","import {\n Directive, EventEmitter,\n HostListener, Input, Output\n} from '@angular/core';\nimport { ngf, dragMeta } from \"./ngf.directive\"\n\n@Directive({\n selector: \"[ngfDrop]\",\n exportAs: \"ngfDrop\"\n})\nexport class ngfDrop extends ngf {\n @Output() fileOver:EventEmitter = new EventEmitter();\n\n @Input() validDrag:boolean = false\n @Output() validDragChange:EventEmitter = new EventEmitter()\n\n @Input() invalidDrag = false\n @Output() invalidDragChange:EventEmitter = new EventEmitter()\n\n @Input() dragFiles !: dragMeta[]\n @Output() dragFilesChange:EventEmitter = new EventEmitter()\n\n @HostListener('drop', ['$event'])\n onDrop(event:Event):void {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n\n this.closeDrags()\n let files = this.eventToFiles(event)\n\n if(!files.length)return\n\n this.stopEvent(event);\n this.handleFiles(files)\n }\n\n handleFiles(files:File[]){\n this.fileOver.emit(false)//turn-off dragover\n super.handleFiles(files)\n }\n\n @HostListener('dragover', ['$event'])\n onDragOver(event:Event):void {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n\n const transfer = this.eventToTransfer(event)\n\n let files = this.eventToFiles(event)\n\n let jsonFiles = this.filesToWriteableObject(files)\n this.dragFilesChange.emit( this.dragFiles=jsonFiles )\n\n if( files.length ){\n this.validDrag = this.isFilesValid(files)\n }else{\n //Safari, IE11 & some browsers do NOT tell you about dragged files until dropped. Always consider a valid drag\n this.validDrag = true\n }\n\n this.validDragChange.emit(this.validDrag)\n\n this.invalidDrag = !this.validDrag\n this.invalidDragChange.emit(this.invalidDrag)\n\n transfer.dropEffect = 'copy'//change cursor and such\n this.stopEvent(event)\n this.fileOver.emit(true)\n }\n\n closeDrags(){\n delete this.validDrag\n this.validDragChange.emit(this.validDrag)\n this.invalidDrag = false\n this.invalidDragChange.emit(this.invalidDrag)\n delete this.dragFiles\n this.dragFilesChange.emit( this.dragFiles )\n }\n\n @HostListener('dragleave', ['$event'])\n onDragLeave(event:Event):any {\n if(this.fileDropDisabled){\n this.stopEvent(event);\n return\n }\n \n this.closeDrags()\n\n if ((this as any).element) {\n if (event.currentTarget === (this as any).element[0]) {\n return;\n }\n }\n\n this.stopEvent(event);\n this.fileOver.emit(false);\n }\n}","import { Directive, ElementRef, Input } from '@angular/core';\nimport { dataUrl } from './fileTools';\n\n@Directive({selector: '[ngfBackground]'})\nexport class ngfBackground {\n @Input('ngfBackground') file:any\n\n constructor(public ElementRef:ElementRef){}\n\n ngOnChanges( _changes:any ){\n dataUrl(this.file)\n .then(src=>{\n const urlString = 'url(\\'' + (src || '') + '\\')'\n this.ElementRef.nativeElement.style.backgroundImage = urlString\n })\n }\n}\n","import { Directive, EventEmitter, Output, Input } from '@angular/core';\n\n@Directive({selector: 'ngfUploadStatus'})\nexport class ngfUploadStatus {\n @Input() percent:number = 0\n @Output() percentChange:EventEmitter = new EventEmitter()\n @Input() httpEvent !: Event\n\n ngOnChanges( changes ){\n if( changes.httpEvent && changes.httpEvent.currentValue ){\n const event = changes.httpEvent.currentValue\n if (event.loaded && event.total) {\n setTimeout(()=>{\n this.percent = Math.round(100 * event.loaded / event.total);\n this.percentChange.emit( this.percent )\n }, 0)\n }\n }\n }\n}","import {\n IterableDiffer,\n IterableDiffers,\n Directive, EventEmitter,\n Output, Input\n} from '@angular/core';\n\n@Directive({selector: 'ngfFormData'})\nexport class ngfFormData {\n @Input() files !: File[]\n @Input() postName:string = \"file\"\n @Input() fileName !: string//force file name\n\n @Input() FormData:FormData = new FormData()\n @Output() FormDataChange:EventEmitter = new EventEmitter()\n\n differ:IterableDiffer<{}>\n\n constructor(IterableDiffers: IterableDiffers){\n this.differ = IterableDiffers.find([]).create()\n }\n\n ngDoCheck(){\n var changes = this.differ.diff( this.files );\n\n if (changes) {\n setTimeout(()=>this.buildFormData(), 0)\n }\n }\n\n buildFormData(){\n const isArray = typeof(this.files)==='object' && this.files.constructor===Array\n\n if( isArray ){\n this.FormData = new FormData()\n const files = this.files || []\n files.forEach(file=>\n this.FormData.append(this.postName, file, this.fileName||file.name)\n )\n this.FormDataChange.emit( this.FormData )\n }else{\n delete this.FormData\n }\n }\n}","import { Directive, ElementRef, Input } from '@angular/core';\nimport { dataUrl } from './fileTools';\n\n@Directive({ selector: '[ngfSrc]' })\nexport class ngfSrc {\n @Input('ngfSrc') file: any\n\n constructor(public ElementRef: ElementRef) { }\n\n ngOnChanges(_changes: any) {\n dataUrl(this.file)\n .then(src=>\n this.ElementRef.nativeElement.src = src\n )\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ngfBackground } from './ngfBackground.directive';\nimport { ngfDrop } from './ngfDrop.directive';\nimport { ngf } from './ngf.directive';\nimport { ngfSelect } from './ngfSelect.directive';\nimport { ngfUploadStatus } from './ngfUploadStatus.directive';\nimport { ngfFormData } from './ngfFormData.directive';\nimport { ngfSrc } from './ngfSrc.directive';\n//import{ HttpModule } from '@angular/http';\n\nconst declarations = [\n ngfDrop,\n ngfSelect,\n ngfBackground,\n ngfSrc,\n ngfUploadStatus,\n ngfFormData,\n ngf\n]\n\n@NgModule({\n imports: [\n CommonModule\n //,HttpModule\n ],\n declarations: declarations,\n exports: declarations//[HttpModule, ...declarations]\n}) export class ngfModule {}","/*\n * Public API Surface of angular-file\n */\n\nexport * from './file-upload/ngfSelect.directive';\nexport * from './file-upload/ngfDrop.directive';\nexport * from './file-upload/ngf.directive';\nexport * from './file-upload/ngf.module';\nexport { ngfBackground } from './file-upload/ngfBackground.directive';\nexport { ngfSrc } from './file-upload/ngfSrc.directive';\nexport { ngfUploadStatus } from './file-upload/ngfUploadStatus.directive';\nexport { ngfFormData } from './file-upload/ngfFormData.directive';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAO,MAAM,WAAW,GAAG,UAAS,GAAO;IACzC,MAAM,EAAE,GAAG,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;IACnC,OAAO,GAAG,CAAC,OAAO,CAAC,WAAW,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;IACP,SAAS;IACT,aAAa;IACb,MAAM;IACN,eAAe;IACf,WAAW;IACX,GAAG;CACJ,CAAA;MASe,SAAS;;;YAPxB,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;;iBAEb;gBACD,YAAY,EAAE,YAAY;gBAC1B,OAAO,EAAE,YAAY;aACtB;;;AC7BD;;;;ACAA;;;;;;"} \ No newline at end of file diff --git a/package.json b/package.json index 53fc744f..ac1804e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-file", - "version": "3.2.2", + "version": "3.2.3", "description": "Easy to use Angular directives for user file selections", "keywords": [ "Angular",