{"version":3,"file":"export-from-json-BvevaQwb.js","sources":["../../../node_modules/export-from-json/dist/esm/utils.js","../../../node_modules/export-from-json/dist/esm/processors.js","../../../node_modules/export-from-json/dist/esm/converters.js","../../../node_modules/export-from-json/dist/esm/types.js","../../../node_modules/export-from-json/dist/esm/exportFromJSON.js"],"sourcesContent":["export function isArray(data) {\n return Object.prototype.toString.call(data) === '[object Array]';\n}\nexport function assert(condition, msg) {\n if (!condition)\n throw new Error(msg);\n}\nexport function getValues(data) {\n return Object.keys(data).map(function (key) { return data[key]; });\n}\nexport function getKeys(data) {\n return Object.keys(data);\n}\nexport function getEntries(data) {\n return Object.keys(data).map(function (key) { return [key, data[key]]; });\n}\nexport function normalizeFileName(fileName, extension, fileNameFormatter) {\n var suffix = '.' + extension;\n var extensionPattern = new RegExp(\"(\\\\\".concat(extension, \")?$\"));\n return fileNameFormatter(fileName).replace(extensionPattern, suffix);\n}\nexport function normalizeXMLName(name) {\n '555xmlHello . world!'.trim().replace(/^([0-9,;]|(xml))+/, '');\n return name.replace(/[^_a-zA-Z 0-9:\\-\\.]/g, '').replace(/^([ 0-9-:\\-\\.]|(xml))+/i, '').replace(/ +/g, '-');\n}\nexport function indent(spaces) {\n return Array(spaces + 1).join(' ');\n}\nexport function stripHTML(text) {\n return text.replace(/([<>&])/g, function (_, $1) {\n switch ($1) {\n case '<': return '<';\n case '>': return '>';\n case '&': return '&';\n default: return '';\n }\n });\n}\n","export function generateDataURI(content, type, byBlob) {\n switch (type) {\n case 'txt': {\n var blobType = 'text/plain;charset=utf-8';\n if (byBlob)\n return URL.createObjectURL(new Blob([content], { type: blobType }));\n return \"data:,\".concat(blobType) + encodeURIComponent(content);\n }\n case 'css': {\n var blobType = 'text/css;charset=utf-8';\n if (byBlob)\n return URL.createObjectURL(new Blob([content], { type: blobType }));\n return \"data:,\".concat(blobType) + encodeURIComponent(content);\n }\n case 'html': {\n var blobType = 'text/html;charset=utf-8';\n if (byBlob)\n return URL.createObjectURL(new Blob([content], { type: blobType }));\n return \"data:,\".concat(blobType) + encodeURIComponent(content);\n }\n case 'json': {\n var blobType = 'text/json;charset=utf-8';\n if (byBlob)\n return URL.createObjectURL(new Blob([content], { type: blobType }));\n return \"data:,\".concat(blobType) + encodeURIComponent(content);\n }\n case 'csv': {\n var blobType = 'text/csv;charset=utf-8';\n if (byBlob)\n return URL.createObjectURL(new Blob([content], { type: blobType }));\n return \"data:,\".concat(blobType) + encodeURIComponent(content);\n }\n case 'xls': {\n var blobType = 'text/application/vnd.ms-excel;charset=utf-8';\n if (byBlob)\n return URL.createObjectURL(new Blob([content], { type: blobType }));\n return \"data:,\".concat(blobType) + encodeURIComponent(content);\n }\n case 'xml': {\n var blobType = 'text/application/xml;charset=utf-8';\n if (byBlob)\n return URL.createObjectURL(new Blob([content], { type: blobType }));\n return \"data:,\".concat(blobType) + encodeURIComponent(content);\n }\n default: {\n return '';\n }\n }\n}\nexport function downloadFile(content, type, fileName, byBlob) {\n if (fileName === void 0) { fileName = 'download'; }\n if (byBlob === void 0) { byBlob = true; }\n var dataURI = generateDataURI(content, type, byBlob);\n var anchor = document.createElement('a');\n anchor.href = dataURI;\n anchor.download = fileName;\n anchor.setAttribute('style', 'visibility:hidden');\n document.body.appendChild(anchor);\n anchor.dispatchEvent(new MouseEvent('click', {\n bubbles: false,\n cancelable: false,\n view: window,\n }));\n document.body.removeChild(anchor);\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nimport { isArray, getEntries, normalizeXMLName, indent, stripHTML, assert, getKeys } from './utils.js';\nexport function _createFieldsMapper(fields) {\n if (!fields\n || isArray(fields) && !fields.length\n || !isArray(fields) && !getKeys(fields).length)\n return function (item) { return item; };\n var mapper = isArray(fields)\n ? fields.reduce(function (map, key) {\n var _a;\n return (__assign(__assign({}, map), (_a = {}, _a[key] = key, _a)));\n }, Object.create(null))\n : fields;\n return function (item) {\n if (isArray(item)) {\n return item\n .map(function (i) { return getEntries(i).reduce(function (map, _a) {\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\n if (key in mapper) {\n map[mapper[key]] = value;\n }\n return map;\n }, Object.create(null)); })\n .filter(function (i) { return getKeys(i).length; });\n }\n return getEntries(item).reduce(function (map, _a) {\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\n if (key in mapper) {\n map[mapper[key]] = value;\n }\n return map;\n }, Object.create(null));\n };\n}\nexport function _prepareData(data) {\n var MESSAGE_VALID_JSON_FAIL = 'Invalid export data. Please provide a valid JSON';\n try {\n return (typeof data === 'string' ? JSON.parse(data) : data);\n }\n catch (_a) {\n throw new Error(MESSAGE_VALID_JSON_FAIL);\n }\n}\nexport function _createJSONData(data, replacer, space) {\n if (replacer === void 0) { replacer = null; }\n var MESSAGE_VALID_JSON_FAIL = 'Invalid export data. Please provide valid JSON object';\n try {\n return JSON.stringify(data, replacer, space);\n }\n catch (_a) {\n throw new Error(MESSAGE_VALID_JSON_FAIL);\n }\n}\nexport function _createTableMap(data) {\n return data.map(getEntries).reduce(function (tMap, rowKVs, rowIndex) {\n return rowKVs.reduce(function (map, _a) {\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\n var columnValues = map[key] || Array.from({ length: data.length }).map(function (_) { return ''; });\n columnValues[rowIndex] =\n (typeof value !== 'string' ? JSON.stringify(value) : value) || '';\n map[key] = columnValues;\n return map;\n }, tMap);\n }, Object.create(null));\n}\nexport function _createTableEntries(tableMap, beforeTableEncode) {\n if (beforeTableEncode === void 0) { beforeTableEncode = function (i) { return i; }; }\n return beforeTableEncode(getEntries(tableMap).map(function (_a) {\n var _b = __read(_a, 2), fieldName = _b[0], fieldValues = _b[1];\n return ({\n fieldName: fieldName,\n fieldValues: fieldValues,\n });\n }));\n}\nfunction encloser(value, delimiter) {\n var enclosingTester = new RegExp(\"\".concat(delimiter, \"|\\\"|\\n\"));\n var enclosingCharacter = enclosingTester.test(value) ? '\"' : '';\n var escaped = value.replace(/\"/g, '\"\"');\n return \"\".concat(enclosingCharacter).concat(escaped).concat(enclosingCharacter);\n}\nvar defaultCreateCSVDataOption = { beforeTableEncode: function (i) { return i; }, delimiter: ',' };\nexport function createCSVData(data, options) {\n if (options === void 0) { options = {}; }\n var _a = __assign(__assign({}, defaultCreateCSVDataOption), options), beforeTableEncode = _a.beforeTableEncode, delimiter = _a.delimiter;\n if (!data.length)\n return '';\n var tableMap = _createTableMap(data);\n var tableEntries = _createTableEntries(tableMap, beforeTableEncode);\n var head = tableEntries.map(function (_a) {\n var fieldName = _a.fieldName;\n return fieldName;\n }).join(delimiter) + '\\r\\n';\n var columns = tableEntries.map(function (_a) {\n var fieldValues = _a.fieldValues;\n return fieldValues;\n })\n .map(function (column) { return column.map(function (value) { return encloser(value, delimiter); }); });\n var rows = columns.reduce(function (mergedColumn, column) { return mergedColumn.map(function (value, rowIndex) { return \"\".concat(value).concat(delimiter).concat(column[rowIndex]); }); });\n return head + rows.join('\\r\\n');\n}\nexport function _renderTableHTMLText(data, beforeTableEncode) {\n assert(data.length > 0);\n var tableMap = _createTableMap(data);\n var tableEntries = _createTableEntries(tableMap, beforeTableEncode);\n var head = tableEntries.map(function (_a) {\n var fieldName = _a.fieldName;\n return fieldName;\n })\n .join('');\n var columns = tableEntries.map(function (_a) {\n var fieldValues = _a.fieldValues;\n return fieldValues;\n })\n .map(function (column) { return column.map(function (value) { return \"\".concat(value, \"\"); }); });\n var rows = columns.reduce(function (mergedColumn, column) { return mergedColumn\n .map(function (value, rowIndex) { return \"\".concat(value).concat(column[rowIndex]); }); });\n return \"\\n \\n \\n \\n \\n \\n \").concat(rows.join(\"\\n \"), \"\\n \\n
\".concat(head, \"
\\n \");\n}\nvar defaultCreateXLSDataOptions = { beforeTableEncode: function (i) { return i; } };\nexport function createXLSData(data, options) {\n var beforeTableEncode = __assign(__assign({}, defaultCreateXLSDataOptions), options).beforeTableEncode;\n if (!data.length)\n return '';\n var content = \"\\n \\n \\n \\n \\n \".concat(_renderTableHTMLText(data, beforeTableEncode), \"\\n \\n\\n\");\n return content;\n}\nexport function createXMLData(data) {\n var content = \"\\n\".concat(_renderXML(data, 'base'), \"\\n\");\n return content;\n}\nfunction _renderXML(data, tagName, arrayElementTag, spaces) {\n if (arrayElementTag === void 0) { arrayElementTag = 'element'; }\n if (spaces === void 0) { spaces = 0; }\n var tag = normalizeXMLName(tagName);\n var indentSpaces = indent(spaces);\n if (data === null || data === undefined) {\n return \"\".concat(indentSpaces, \"<\").concat(tag, \" />\");\n }\n var content = isArray(data)\n ? data.map(function (item) { return _renderXML(item, arrayElementTag, arrayElementTag, spaces + 2); }).join('\\n')\n : typeof data === 'object'\n ? getEntries(data)\n .map(function (_a) {\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\n return _renderXML(value, key, arrayElementTag, spaces + 2);\n }).join('\\n')\n : indentSpaces + ' ' + stripHTML(String(data));\n var contentWithWrapper = \"\".concat(indentSpaces, \"<\").concat(tag, \">\\n\").concat(content, \"\\n\").concat(indentSpaces, \"\");\n return contentWithWrapper;\n}\n","export var exportTypes = {\n txt: 'txt',\n css: 'css',\n html: 'html',\n json: 'json',\n csv: 'csv',\n xls: 'xls',\n xml: 'xml',\n};\n","import { assert, isArray, normalizeFileName } from './utils.js';\nimport { downloadFile } from './processors.js';\nimport { _prepareData, _createJSONData, createCSVData, createXLSData, createXMLData, _createFieldsMapper } from './converters.js';\nimport { exportTypes } from './types.js';\nfunction exportFromJSON(_a) {\n var data = _a.data, _b = _a.fileName, fileName = _b === void 0 ? 'download' : _b, extension = _a.extension, _c = _a.fileNameFormatter, fileNameFormatter = _c === void 0 ? function (name) { return name.replace(/\\s+/, '_'); } : _c, fields = _a.fields, _d = _a.exportType, exportType = _d === void 0 ? 'txt' : _d, _e = _a.replacer, replacer = _e === void 0 ? null : _e, _f = _a.space, space = _f === void 0 ? 4 : _f, _g = _a.processor, processor = _g === void 0 ? downloadFile : _g, _h = _a.withBOM, withBOM = _h === void 0 ? false : _h, _j = _a.beforeTableEncode, beforeTableEncode = _j === void 0 ? function (i) { return i; } : _j, _k = _a.delimiter, delimiter = _k === void 0 ? ',' : _k;\n var MESSAGE_IS_ARRAY_FAIL = 'Invalid export data. Please provide an array of objects';\n var MESSAGE_UNKNOWN_EXPORT_TYPE = \"Can't export unknown data type \".concat(exportType, \".\");\n var MESSAGE_FIELD_INVALID = \"Can't export string data to \".concat(exportType, \".\");\n if (typeof data === 'string') {\n switch (exportType) {\n case 'txt':\n case 'css':\n case 'html': {\n return processor(data, exportType, normalizeFileName(fileName, extension !== null && extension !== void 0 ? extension : exportType, fileNameFormatter));\n }\n default:\n throw new Error(MESSAGE_FIELD_INVALID);\n }\n }\n var fieldsMapper = _createFieldsMapper(fields);\n var safeData = fieldsMapper(_prepareData(data));\n var JSONData = _createJSONData(safeData, replacer, space);\n switch (exportType) {\n case 'txt':\n case 'css':\n case 'html': {\n return processor(JSONData, exportType, normalizeFileName(fileName, extension !== null && extension !== void 0 ? extension : exportType, fileNameFormatter));\n }\n case 'json': {\n return processor(JSONData, exportType, normalizeFileName(fileName, extension !== null && extension !== void 0 ? extension : 'json', fileNameFormatter));\n }\n case 'csv': {\n assert(isArray(safeData), MESSAGE_IS_ARRAY_FAIL);\n var BOM = '\\ufeff';\n var CSVData = createCSVData(safeData, { beforeTableEncode: beforeTableEncode, delimiter: delimiter });\n var content = withBOM ? BOM + CSVData : CSVData;\n return processor(content, exportType, normalizeFileName(fileName, extension !== null && extension !== void 0 ? extension : 'csv', fileNameFormatter));\n }\n case 'xls': {\n assert(isArray(safeData), MESSAGE_IS_ARRAY_FAIL);\n var content = createXLSData(safeData, { beforeTableEncode: beforeTableEncode });\n return processor(content, exportType, normalizeFileName(fileName, extension !== null && extension !== void 0 ? extension : 'xls', fileNameFormatter));\n }\n case 'xml': {\n var content = createXMLData(safeData);\n return processor(content, exportType, normalizeFileName(fileName, extension !== null && extension !== void 0 ? extension : 'xml', fileNameFormatter));\n }\n default:\n throw new Error(MESSAGE_UNKNOWN_EXPORT_TYPE);\n }\n}\nexportFromJSON.types = exportTypes;\nexportFromJSON.processors = { downloadFile: downloadFile };\nexport default exportFromJSON;\n"],"names":["isArray","data","assert","condition","msg","getKeys","getEntries","key","normalizeFileName","fileName","extension","fileNameFormatter","suffix","extensionPattern","normalizeXMLName","name","indent","spaces","stripHTML","text","_","$1","generateDataURI","content","type","byBlob","blobType","downloadFile","dataURI","anchor","__assign","t","s","i","n","p","__read","o","m","r","ar","e","error","_createFieldsMapper","fields","item","mapper","map","_a","_b","value","_prepareData","MESSAGE_VALID_JSON_FAIL","_createJSONData","replacer","space","_createTableMap","tMap","rowKVs","rowIndex","columnValues","_createTableEntries","tableMap","beforeTableEncode","fieldName","fieldValues","encloser","delimiter","enclosingTester","enclosingCharacter","escaped","defaultCreateCSVDataOption","createCSVData","options","tableEntries","head","columns","column","rows","mergedColumn","_renderTableHTMLText","defaultCreateXLSDataOptions","createXLSData","createXMLData","_renderXML","tagName","arrayElementTag","tag","indentSpaces","contentWithWrapper","exportTypes","exportFromJSON","_c","_d","exportType","_e","_f","_g","processor","_h","withBOM","_j","_k","MESSAGE_IS_ARRAY_FAIL","MESSAGE_UNKNOWN_EXPORT_TYPE","MESSAGE_FIELD_INVALID","fieldsMapper","safeData","JSONData","BOM","CSVData"],"mappings":"AAAO,SAASA,EAAQC,EAAM,CAC1B,OAAO,OAAO,UAAU,SAAS,KAAKA,CAAI,IAAM,gBACpD,CACO,SAAS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