1 |
- {"version":3,"sources":["webpack:///webpack/bootstrap 48db8d025db8e11e58bc","webpack:///../dist/json-formatter.js","webpack:///./index.js"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AChEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA;AACA,KAAK;AACL;AACA,UAAU,IAAI,cAAc,IAAI,cAAc,IAAI,mFAAmF,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,yBAAyB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;AAC5N;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,aAAa;AACb;AACA;AACA,SA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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,+FAA+F;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA,+HAA+H;AAC/H,kBAAkB,wBAAwB;AAC1C;AACA;AACA;AACA;AACA;AACA,2EAA2E;AAC3E;AACA;AACA,SAAS;AACT;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA,2CAA2C,mBAAmB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA,mCAAmC,2BAA2B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACD;AACA;AACA,sCAAsC;AACtC;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,IAAI,WAAW,EAAE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD,0C;;;;;;ACjaA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,sEAAsE,2DAA2D;AACjI;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,8BAA8B,cAAc;AAC5C;;AAEA,YAAY,KAAK,KAAK,KAAK,MAAM,EAAE,EAAE,EAAE;;AAEvC;AACA,KAAK,kCAAkC;AACvC,KAAK,4BAA4B;AACjC,KAAK,4BAA4B;AACjC,KAAK,mDAAmD;AACxD,KAAK,iCAAiC;AACtC,KAAK,4BAA4B;AACjC,KAAK,wCAAwC,gBAAgB,EAAE;AAC/D,KAAK,+CAA+C,oCAAoC;AACxF;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA,0DAA0D,4BAA4B;AACtF;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,CAAC,C","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 48db8d025db8e11e58bc","module.exports = function(modules) {\n function __webpack_require__(moduleId) {\n if (installedModules[moduleId]) return installedModules[moduleId].exports;\n var module = installedModules[moduleId] = {\n i: moduleId,\n l: !1,\n exports: {}\n };\n return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), \n module.l = !0, module.exports;\n }\n var installedModules = {};\n return __webpack_require__.m = modules, __webpack_require__.c = installedModules, \n __webpack_require__.i = function(value) {\n return value;\n }, __webpack_require__.d = function(exports, name, getter) {\n __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, {\n configurable: !1,\n enumerable: !0,\n get: getter\n });\n }, __webpack_require__.n = function(module) {\n var getter = module && module.__esModule ? function() {\n return module.default;\n } : function() {\n return module;\n };\n return __webpack_require__.d(getter, \"a\", getter), getter;\n }, __webpack_require__.o = function(object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n }, __webpack_require__.p = \"dist\", __webpack_require__(__webpack_require__.s = 6);\n}([ function(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n Object.defineProperty(__webpack_exports__, \"__esModule\", {\n value: !0\n });\n var __WEBPACK_IMPORTED_MODULE_0__helpers__ = __webpack_require__(5), __WEBPACK_IMPORTED_MODULE_1__style_less__ = __webpack_require__(4), DATE_STRING_REGEX = (__webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__style_less__), \n /(^\\d{1,4}[\\.|\\\\\\/|-]\\d{1,2}[\\.|\\\\\\/|-]\\d{1,4})(\\s*(?:0?[1-9]:[0-5]|1(?=[012])\\d:[0-5])\\d\\s*[ap]m)?$/), PARTIAL_DATE_REGEX = /\\d{2}:\\d{2}:\\d{2} GMT-\\d{4}/, JSON_DATE_REGEX = /\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z/, requestAnimationFrame = window.requestAnimationFrame || function(cb) {\n return cb(), 0;\n }, _defaultConfig = {\n hoverPreviewEnabled: !1,\n hoverPreviewArrayCount: 100,\n hoverPreviewFieldCount: 5,\n animateOpen: !0,\n animateClose: !0,\n theme: null,\n useToJSON: !0,\n sortPropertiesBy: null\n }, JSONFormatter = function() {\n function JSONFormatter(json, open, config, key) {\n void 0 === open && (open = 1), void 0 === config && (config = _defaultConfig), this.json = json, \n this.open = open, this.config = config, this.key = key, this._isOpen = null, void 0 === this.config.hoverPreviewEnabled && (this.config.hoverPreviewEnabled = _defaultConfig.hoverPreviewEnabled), \n void 0 === this.config.hoverPreviewArrayCount && (this.config.hoverPreviewArrayCount = _defaultConfig.hoverPreviewArrayCount), \n void 0 === this.config.hoverPreviewFieldCount && (this.config.hoverPreviewFieldCount = _defaultConfig.hoverPreviewFieldCount), \n void 0 === this.config.useToJSON && (this.config.useToJSON = _defaultConfig.useToJSON);\n }\n return Object.defineProperty(JSONFormatter.prototype, \"isOpen\", {\n get: function() {\n return null !== this._isOpen ? this._isOpen : this.open > 0;\n },\n set: function(value) {\n this._isOpen = value;\n },\n enumerable: !0,\n configurable: !0\n }), Object.defineProperty(JSONFormatter.prototype, \"isDate\", {\n get: function() {\n return this.json instanceof Date || \"string\" === this.type && (DATE_STRING_REGEX.test(this.json) || JSON_DATE_REGEX.test(this.json) || PARTIAL_DATE_REGEX.test(this.json));\n },\n enumerable: !0,\n configurable: !0\n }), Object.defineProperty(JSONFormatter.prototype, \"isUrl\", {\n get: function() {\n return \"string\" === this.type && 0 === this.json.indexOf(\"http\");\n },\n enumerable: !0,\n configurable: !0\n }), Object.defineProperty(JSONFormatter.prototype, \"isArray\", {\n get: function() {\n return Array.isArray(this.json);\n },\n enumerable: !0,\n configurable: !0\n }), Object.defineProperty(JSONFormatter.prototype, \"isObject\", {\n get: function() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.a)(this.json);\n },\n enumerable: !0,\n configurable: !0\n }), Object.defineProperty(JSONFormatter.prototype, \"isEmptyObject\", {\n get: function() {\n return !this.keys.length && !this.isArray;\n },\n enumerable: !0,\n configurable: !0\n }), Object.defineProperty(JSONFormatter.prototype, \"isEmpty\", {\n get: function() {\n return this.isEmptyObject || this.keys && !this.keys.length && this.isArray;\n },\n enumerable: !0,\n configurable: !0\n }), Object.defineProperty(JSONFormatter.prototype, \"useToJSON\", {\n get: function() {\n return this.config.useToJSON && \"stringifiable\" === this.type;\n },\n enumerable: !0,\n configurable: !0\n }), Object.defineProperty(JSONFormatter.prototype, \"hasKey\", {\n get: function() {\n return void 0 !== this.key;\n },\n enumerable: !0,\n configurable: !0\n }), Object.defineProperty(JSONFormatter.prototype, \"constructorName\", {\n get: function() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.b)(this.json);\n },\n enumerable: !0,\n configurable: !0\n }), Object.defineProperty(JSONFormatter.prototype, \"type\", {\n get: function() {\n return null === this.json ? \"null\" : this.config.useToJSON && this.json && this.json.toJSON ? \"stringifiable\" : typeof this.json;\n },\n enumerable: !0,\n configurable: !0\n }), Object.defineProperty(JSONFormatter.prototype, \"keys\", {\n get: function() {\n if (this.isObject) {\n var keys = Object.keys(this.json).map(function(key) {\n return key || '\"\"';\n });\n return !this.isArray && this.config.sortPropertiesBy ? keys.sort(this.config.sortPropertiesBy) : keys;\n }\n return [];\n },\n enumerable: !0,\n configurable: !0\n }), JSONFormatter.prototype.toggleOpen = function() {\n this.isOpen = !this.isOpen, this.element && (this.isOpen ? this.appendChildren(this.config.animateOpen) : this.removeChildren(this.config.animateClose), \n this.element.classList.toggle(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.c)(\"open\")));\n }, JSONFormatter.prototype.openAtDepth = function(depth) {\n void 0 === depth && (depth = 1), depth < 0 || (this.open = depth, this.isOpen = 0 !== depth, \n this.element && (this.removeChildren(!1), 0 === depth ? this.element.classList.remove(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.c)(\"open\")) : (this.appendChildren(this.config.animateOpen), \n this.element.classList.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.c)(\"open\")))));\n }, JSONFormatter.prototype.getInlinepreview = function() {\n var _this = this;\n if (this.isArray) return this.json.length > this.config.hoverPreviewArrayCount ? \"Array[\" + this.json.length + \"]\" : \"[\" + this.json.map(__WEBPACK_IMPORTED_MODULE_0__helpers__.d).join(\", \") + \"]\";\n var keys = this.keys, narrowKeys = keys.slice(0, this.config.hoverPreviewFieldCount), kvs = narrowKeys.map(function(key) {\n return key + \":\" + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.d)(_this.type, _this.json[key]);\n }), ellipsis = keys.length >= this.config.hoverPreviewFieldCount ? \"…\" : \"\";\n return \"{\" + kvs.join(\", \") + ellipsis + \"}\";\n }, JSONFormatter.prototype.render = function() {\n this.element = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"div\", \"row\");\n var togglerLink = this.isObject ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"a\", \"toggler-link\") : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"span\");\n if (this.isObject && !this.useToJSON && togglerLink.appendChild(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"span\", \"toggler\")), \n this.hasKey && togglerLink.appendChild(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"span\", \"key\", this.key + \":\")), \n this.isObject && !this.useToJSON) {\n var value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"span\", \"value\"), objectWrapperSpan = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"span\"), constructorName = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"span\", \"constructor-name\", this.constructorName);\n if (objectWrapperSpan.appendChild(constructorName), this.isArray) {\n var arrayWrapperSpan = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"span\");\n arrayWrapperSpan.appendChild(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"span\", \"bracket\", \"[\")), \n arrayWrapperSpan.appendChild(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"span\", \"number\", this.json.length)), \n arrayWrapperSpan.appendChild(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"span\", \"bracket\", \"]\")), \n objectWrapperSpan.appendChild(arrayWrapperSpan);\n }\n value.appendChild(objectWrapperSpan), togglerLink.appendChild(value);\n } else {\n var value = this.isUrl ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"a\") : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"span\");\n value.classList.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.c)(this.type)), \n this.isDate && value.classList.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.c)(\"date\")), \n this.isUrl && (value.classList.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.c)(\"url\")), \n value.setAttribute(\"href\", this.json));\n var valuePreview = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.f)(this.type, this.json, this.useToJSON ? this.json.toJSON() : this.json);\n value.appendChild(document.createTextNode(valuePreview)), togglerLink.appendChild(value);\n }\n if (this.isObject && this.config.hoverPreviewEnabled) {\n var preview = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"span\", \"preview-text\");\n preview.appendChild(document.createTextNode(this.getInlinepreview())), togglerLink.appendChild(preview);\n }\n var children = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.e)(\"div\", \"children\");\n return this.isObject && children.classList.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.c)(\"object\")), \n this.isArray && children.classList.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.c)(\"array\")), \n this.isEmpty && children.classList.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.c)(\"empty\")), \n this.config && this.config.theme && this.element.classList.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.c)(this.config.theme)), \n this.isOpen && this.element.classList.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.c)(\"open\")), \n this.element.appendChild(togglerLink), this.element.appendChild(children), this.isObject && this.isOpen && this.appendChildren(), \n this.isObject && !this.useToJSON && togglerLink.addEventListener(\"click\", this.toggleOpen.bind(this)), \n this.element;\n }, JSONFormatter.prototype.appendChildren = function(animated) {\n var _this = this;\n void 0 === animated && (animated = !1);\n var children = this.element.querySelector(\"div.\" + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.c)(\"children\"));\n if (children && !this.isEmpty) if (animated) {\n var index_1 = 0, addAChild_1 = function() {\n var key = _this.keys[index_1], formatter = new JSONFormatter(_this.json[key], _this.open - 1, _this.config, key);\n children.appendChild(formatter.render()), (index_1 += 1) < _this.keys.length && (index_1 > 10 ? addAChild_1() : requestAnimationFrame(addAChild_1));\n };\n requestAnimationFrame(addAChild_1);\n } else this.keys.forEach(function(key) {\n var formatter = new JSONFormatter(_this.json[key], _this.open - 1, _this.config, key);\n children.appendChild(formatter.render());\n });\n }, JSONFormatter.prototype.removeChildren = function(animated) {\n void 0 === animated && (animated = !1);\n var childrenElement = this.element.querySelector(\"div.\" + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__helpers__.c)(\"children\"));\n if (animated) {\n var childrenRemoved_1 = 0, removeAChild_1 = function() {\n childrenElement && childrenElement.children.length && (childrenElement.removeChild(childrenElement.children[0]), \n childrenRemoved_1 += 1, childrenRemoved_1 > 10 ? removeAChild_1() : requestAnimationFrame(removeAChild_1));\n };\n requestAnimationFrame(removeAChild_1);\n } else childrenElement && (childrenElement.innerHTML = \"\");\n }, JSONFormatter;\n }();\n __webpack_exports__.default = JSONFormatter;\n}, function(module, exports, __webpack_require__) {\n exports = module.exports = __webpack_require__(2)(), exports.push([ module.i, '.json-formatter-row {\\n font-family: monospace;\\n}\\n.json-formatter-row,\\n.json-formatter-row a,\\n.json-formatter-row a:hover {\\n color: black;\\n text-decoration: none;\\n}\\n.json-formatter-row .json-formatter-row {\\n margin-left: 1rem;\\n}\\n.json-formatter-row .json-formatter-children.json-formatter-empty {\\n opacity: 0.5;\\n margin-left: 1rem;\\n}\\n.json-formatter-row .json-formatter-children.json-formatter-empty:after {\\n display: none;\\n}\\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\\n content: \"No properties\";\\n}\\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\\n content: \"[]\";\\n}\\n.json-formatter-row .json-formatter-string,\\n.json-formatter-row .json-formatter-stringifiable {\\n color: green;\\n white-space: pre;\\n word-wrap: break-word;\\n}\\n.json-formatter-row .json-formatter-number {\\n color: blue;\\n}\\n.json-formatter-row .json-formatter-boolean {\\n color: red;\\n}\\n.json-formatter-row .json-formatter-null {\\n color: #855A00;\\n}\\n.json-formatter-row .json-formatter-undefined {\\n color: #ca0b69;\\n}\\n.json-formatter-row .json-formatter-function {\\n color: #FF20ED;\\n}\\n.json-formatter-row .json-formatter-date {\\n background-color: rgba(0, 0, 0, 0.05);\\n}\\n.json-formatter-row .json-formatter-url {\\n text-decoration: underline;\\n color: blue;\\n cursor: pointer;\\n}\\n.json-formatter-row .json-formatter-bracket {\\n color: blue;\\n}\\n.json-formatter-row .json-formatter-key {\\n color: #00008B;\\n padding-right: 0.2rem;\\n}\\n.json-formatter-row .json-formatter-toggler-link {\\n cursor: pointer;\\n}\\n.json-formatter-row .json-formatter-toggler {\\n line-height: 1.2rem;\\n font-size: 0.7rem;\\n vertical-align: middle;\\n opacity: 0.6;\\n cursor: pointer;\\n padding-right: 0.2rem;\\n}\\n.json-formatter-row .json-formatter-toggler:after {\\n display: inline-block;\\n transition: transform 100ms ease-in;\\n content: \"\\\\25BA\";\\n}\\n.json-formatter-row > a > .json-formatter-preview-text {\\n opacity: 0;\\n transition: opacity 0.15s ease-in;\\n font-style: italic;\\n}\\n.json-formatter-row:hover > a > .json-formatter-preview-text {\\n opacity: 0.6;\\n}\\n.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\\n transform: rotate(90deg);\\n}\\n.json-formatter-row.json-formatter-open > .json-formatter-children:after {\\n display: inline-block;\\n}\\n.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\\n display: none;\\n}\\n.json-formatter-row.json-formatter-open.json-formatter-empty:after {\\n display: block;\\n}\\n.json-formatter-dark.json-formatter-row {\\n font-family: monospace;\\n}\\n.json-formatter-dark.json-formatter-row,\\n.json-formatter-dark.json-formatter-row a,\\n.json-formatter-dark.json-formatter-row a:hover {\\n color: white;\\n text-decoration: none;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-row {\\n margin-left: 1rem;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty {\\n opacity: 0.5;\\n margin-left: 1rem;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty:after {\\n display: none;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\\n content: \"No properties\";\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\\n content: \"[]\";\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-string,\\n.json-formatter-dark.json-formatter-row .json-formatter-stringifiable {\\n color: #31F031;\\n white-space: pre;\\n word-wrap: break-word;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-number {\\n color: #66C2FF;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-boolean {\\n color: #EC4242;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-null {\\n color: #EEC97D;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-undefined {\\n color: #ef8fbe;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-function {\\n color: #FD48CB;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-date {\\n background-color: rgba(255, 255, 255, 0.05);\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-url {\\n text-decoration: underline;\\n color: #027BFF;\\n cursor: pointer;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-bracket {\\n color: #9494FF;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-key {\\n color: #23A0DB;\\n padding-right: 0.2rem;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-toggler-link {\\n cursor: pointer;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-toggler {\\n line-height: 1.2rem;\\n font-size: 0.7rem;\\n vertical-align: middle;\\n opacity: 0.6;\\n cursor: pointer;\\n padding-right: 0.2rem;\\n}\\n.json-formatter-dark.json-formatter-row .json-formatter-toggler:after {\\n display: inline-block;\\n transition: transform 100ms ease-in;\\n content: \"\\\\25BA\";\\n}\\n.json-formatter-dark.json-formatter-row > a > .json-formatter-preview-text {\\n opacity: 0;\\n transition: opacity 0.15s ease-in;\\n font-style: italic;\\n}\\n.json-formatter-dark.json-formatter-row:hover > a > .json-formatter-preview-text {\\n opacity: 0.6;\\n}\\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\\n transform: rotate(90deg);\\n}\\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-children:after {\\n display: inline-block;\\n}\\n.json-formatter-dark.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\\n display: none;\\n}\\n.json-formatter-dark.json-formatter-row.json-formatter-open.json-formatter-empty:after {\\n display: block;\\n}\\n', \"\" ]);\n}, function(module, exports) {\n module.exports = function() {\n var list = [];\n return list.toString = function() {\n for (var result = [], i = 0; i < this.length; i++) {\n var item = this[i];\n item[2] ? result.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\") : result.push(item[1]);\n }\n return result.join(\"\");\n }, list.i = function(modules, mediaQuery) {\n \"string\" == typeof modules && (modules = [ [ null, modules, \"\" ] ]);\n for (var alreadyImportedModules = {}, i = 0; i < this.length; i++) {\n var id = this[i][0];\n \"number\" == typeof id && (alreadyImportedModules[id] = !0);\n }\n for (i = 0; i < modules.length; i++) {\n var item = modules[i];\n \"number\" == typeof item[0] && alreadyImportedModules[item[0]] || (mediaQuery && !item[2] ? item[2] = mediaQuery : mediaQuery && (item[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\"), \n list.push(item));\n }\n }, list;\n };\n}, function(module, exports) {\n function addStylesToDom(styles, options) {\n for (var i = 0; i < styles.length; i++) {\n var item = styles[i], domStyle = stylesInDom[item.id];\n if (domStyle) {\n domStyle.refs++;\n for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](item.parts[j]);\n for (;j < item.parts.length; j++) domStyle.parts.push(addStyle(item.parts[j], options));\n } else {\n for (var parts = [], j = 0; j < item.parts.length; j++) parts.push(addStyle(item.parts[j], options));\n stylesInDom[item.id] = {\n id: item.id,\n refs: 1,\n parts: parts\n };\n }\n }\n }\n function listToStyles(list) {\n for (var styles = [], newStyles = {}, i = 0; i < list.length; i++) {\n var item = list[i], id = item[0], css = item[1], media = item[2], sourceMap = item[3], part = {\n css: css,\n media: media,\n sourceMap: sourceMap\n };\n newStyles[id] ? newStyles[id].parts.push(part) : styles.push(newStyles[id] = {\n id: id,\n parts: [ part ]\n });\n }\n return styles;\n }\n function insertStyleElement(options, styleElement) {\n var head = getHeadElement(), lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];\n if (\"top\" === options.insertAt) lastStyleElementInsertedAtTop ? lastStyleElementInsertedAtTop.nextSibling ? head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling) : head.appendChild(styleElement) : head.insertBefore(styleElement, head.firstChild), \n styleElementsInsertedAtTop.push(styleElement); else {\n if (\"bottom\" !== options.insertAt) throw new Error(\"Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.\");\n head.appendChild(styleElement);\n }\n }\n function removeStyleElement(styleElement) {\n styleElement.parentNode.removeChild(styleElement);\n var idx = styleElementsInsertedAtTop.indexOf(styleElement);\n idx >= 0 && styleElementsInsertedAtTop.splice(idx, 1);\n }\n function createStyleElement(options) {\n var styleElement = document.createElement(\"style\");\n return styleElement.type = \"text/css\", insertStyleElement(options, styleElement), \n styleElement;\n }\n function createLinkElement(options) {\n var linkElement = document.createElement(\"link\");\n return linkElement.rel = \"stylesheet\", insertStyleElement(options, linkElement), \n linkElement;\n }\n function addStyle(obj, options) {\n var styleElement, update, remove;\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n styleElement = singletonElement || (singletonElement = createStyleElement(options)), \n update = applyToSingletonTag.bind(null, styleElement, styleIndex, !1), remove = applyToSingletonTag.bind(null, styleElement, styleIndex, !0);\n } else obj.sourceMap && \"function\" == typeof URL && \"function\" == typeof URL.createObjectURL && \"function\" == typeof URL.revokeObjectURL && \"function\" == typeof Blob && \"function\" == typeof btoa ? (styleElement = createLinkElement(options), \n update = updateLink.bind(null, styleElement), remove = function() {\n removeStyleElement(styleElement), styleElement.href && URL.revokeObjectURL(styleElement.href);\n }) : (styleElement = createStyleElement(options), update = applyToTag.bind(null, styleElement), \n remove = function() {\n removeStyleElement(styleElement);\n });\n return update(obj), function(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) return;\n update(obj = newObj);\n } else remove();\n };\n }\n function applyToSingletonTag(styleElement, index, remove, obj) {\n var css = remove ? \"\" : obj.css;\n if (styleElement.styleSheet) styleElement.styleSheet.cssText = replaceText(index, css); else {\n var cssNode = document.createTextNode(css), childNodes = styleElement.childNodes;\n childNodes[index] && styleElement.removeChild(childNodes[index]), childNodes.length ? styleElement.insertBefore(cssNode, childNodes[index]) : styleElement.appendChild(cssNode);\n }\n }\n function applyToTag(styleElement, obj) {\n var css = obj.css, media = obj.media;\n if (media && styleElement.setAttribute(\"media\", media), styleElement.styleSheet) styleElement.styleSheet.cssText = css; else {\n for (;styleElement.firstChild; ) styleElement.removeChild(styleElement.firstChild);\n styleElement.appendChild(document.createTextNode(css));\n }\n }\n function updateLink(linkElement, obj) {\n var css = obj.css, sourceMap = obj.sourceMap;\n sourceMap && (css += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\");\n var blob = new Blob([ css ], {\n type: \"text/css\"\n }), oldSrc = linkElement.href;\n linkElement.href = URL.createObjectURL(blob), oldSrc && URL.revokeObjectURL(oldSrc);\n }\n var stylesInDom = {}, memoize = function(fn) {\n var memo;\n return function() {\n return void 0 === memo && (memo = fn.apply(this, arguments)), memo;\n };\n }, isOldIE = memoize(function() {\n return /msie [6-9]\\b/.test(self.navigator.userAgent.toLowerCase());\n }), getHeadElement = memoize(function() {\n return document.head || document.getElementsByTagName(\"head\")[0];\n }), singletonElement = null, singletonCounter = 0, styleElementsInsertedAtTop = [];\n module.exports = function(list, options) {\n if (\"undefined\" != typeof DEBUG && DEBUG && \"object\" != typeof document) throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n options = options || {}, void 0 === options.singleton && (options.singleton = isOldIE()), \n void 0 === options.insertAt && (options.insertAt = \"bottom\");\n var styles = listToStyles(list);\n return addStylesToDom(styles, options), function(newList) {\n for (var mayRemove = [], i = 0; i < styles.length; i++) {\n var item = styles[i], domStyle = stylesInDom[item.id];\n domStyle.refs--, mayRemove.push(domStyle);\n }\n if (newList) {\n addStylesToDom(listToStyles(newList), options);\n }\n for (var i = 0; i < mayRemove.length; i++) {\n var domStyle = mayRemove[i];\n if (0 === domStyle.refs) {\n for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();\n delete stylesInDom[domStyle.id];\n }\n }\n };\n };\n var replaceText = function() {\n var textStore = [];\n return function(index, replacement) {\n return textStore[index] = replacement, textStore.filter(Boolean).join(\"\\n\");\n };\n }();\n}, function(module, exports, __webpack_require__) {\n var content = __webpack_require__(1);\n \"string\" == typeof content && (content = [ [ module.i, content, \"\" ] ]);\n __webpack_require__(3)(content, {});\n content.locals && (module.exports = content.locals);\n}, function(module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n function escapeString(str) {\n return str.replace('\"', '\"');\n }\n function isObject(value) {\n var type = typeof value;\n return !!value && \"object\" == type;\n }\n function getObjectName(object) {\n if (void 0 === object) return \"\";\n if (null === object) return \"Object\";\n if (\"object\" == typeof object && !object.constructor) return \"Object\";\n var funcNameRegex = /function ([^(]*)/, results = funcNameRegex.exec(object.constructor.toString());\n return results && results.length > 1 ? results[1] : \"\";\n }\n function getValuePreview(type, object, value) {\n return \"null\" === type || \"undefined\" === type ? type : (\"string\" !== type && \"stringifiable\" !== type || (value = '\"' + escapeString(value) + '\"'), \n \"function\" === type ? object.toString().replace(/[\\r\\n]/g, \"\").replace(/\\{.*\\}/, \"\") + \"{…}\" : value);\n }\n function getPreview(type, object) {\n var value = \"\";\n return isObject(object) ? (value = getObjectName(object), Array.isArray(object) && (value += \"[\" + object.length + \"]\")) : value = getValuePreview(type, object, object), \n value;\n }\n function cssClass(className) {\n return \"json-formatter-\" + className;\n }\n function createElement(type, className, content) {\n var el = document.createElement(type);\n return className && el.classList.add(cssClass(className)), void 0 !== content && (content instanceof Node ? el.appendChild(content) : el.appendChild(document.createTextNode(String(content)))), \n el;\n }\n __webpack_exports__.a = isObject, __webpack_exports__.b = getObjectName, __webpack_exports__.f = getValuePreview, \n __webpack_exports__.d = getPreview, __webpack_exports__.c = cssClass, __webpack_exports__.e = createElement;\n}, function(module, exports, __webpack_require__) {\n module.exports = __webpack_require__(0);\n} ]);\n//# sourceMappingURL=json-formatter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../dist/json-formatter.js\n// module id = 0\n// module chunks = 0","var JSONFormatter = require('../dist/json-formatter.js').default;\n\nvar live = document.getElementById('live');\nvar hoverPreviewEnabledCheckbox = document.getElementById('hoverPreviewEnabled');\n\nfunction render() {\n live.style.backgroundColor = 'transparent';\n var result = document.getElementById('live-result');\n try {\n var formatter = new JSONFormatter(JSON.parse(live.value), 1, { hoverPreviewEnabled: hoverPreviewEnabledCheckbox.checked });\n result.innerHTML = '';\n result.appendChild(formatter.render());\n } catch (e) {\n live.style.backgroundColor = 'rgba(255, 87, 34, 0.35)';\n }\n}\nlive.addEventListener('keyup', render);\nhoverPreviewEnabledCheckbox.addEventListener('change', render);\nrender();\n\n\nvar complex = {\n numbers: [\n 1,\n 2,\n 3\n ],\n boolean: true,\n 'null': null,\n number: 123,\n anObject: {\n a: 'b',\n e: 'd',\n c: 'f\\\"'\n },\n string: 'Hello World',\n url: 'https://github.com/mohsen1/json-formatter-js',\n date: new Date(),\n func: function add(a, b) { return a + b; }\n};\n\nvar deep = { a: { b: { c: { d: {} } } } };\n\nvar examples = [\n { title: 'Complex', json: complex },\n { title: 'Number', json: 42 },\n { title: 'null', json: null },\n { title: 'Empty Object', json: Object.create(null) },\n { title: 'Empty Array', json: [] },\n { title: 'Deep', json: deep },\n { title: 'Dark', json: complex, config: { theme: 'dark' } },\n { title: 'Sorted Keys', json: complex, config: { sortPropertiesBy: (a, b) => a > b } }\n];\n\nvar result = document.querySelector('.result');\n\nexamples.forEach(function (example) {\n var title = document.createElement('h3');\n var formatter = new JSONFormatter(example.json, 1, example.config);\n\n title.innerText = example.title;\n\n result.appendChild(title)\n var el = formatter.render();\n\n if (example.config && example.config.theme === 'dark') {\n el.style.backgroundColor = '#1E1E1E';\n }\n\n result.appendChild(el);\n});\n\nfetch('demo/giant.json').then(function (resp) {\n resp.json().then(function (giant) {\n var giantFormatter = new JSONFormatter(giant, 2, { hoverPreviewEnabled: true });\n var title = document.createElement('h3');\n\n title.innerText = 'Giant JSON';\n result.appendChild(title);\n\n console.time('Rendering giant JSON');\n result.appendChild(giantFormatter.render());\n console.timeEnd('Rendering giant JSON');\n });\n})\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./index.js\n// module id = 1\n// module chunks = 0"],"sourceRoot":""}
|